summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
Diffstat (limited to 'solenv')
-rwxr-xr-xsolenv/bin/_mkout11
-rwxr-xr-xsolenv/bin/addsym-macosx.sh29
-rw-r--r--solenv/bin/addsym-mingw.sh34
-rw-r--r--solenv/bin/addsym.awk54
-rw-r--r--solenv/bin/build.pl3547
-rwxr-xr-xsolenv/bin/build_client.pl445
-rw-r--r--solenv/bin/buildalyzer138
-rwxr-xr-xsolenv/bin/checkdll.sh83
-rw-r--r--solenv/bin/chrel.sed2
-rw-r--r--solenv/bin/cleandiff.pl45
-rwxr-xr-xsolenv/bin/cleanzip.pl64
-rw-r--r--solenv/bin/clipatchconfig.pl133
-rw-r--r--solenv/bin/convertlinks.pl122
-rw-r--r--solenv/bin/converttags.pl94
-rw-r--r--solenv/bin/createcomponent.xslt51
-rwxr-xr-xsolenv/bin/createpdbrelocators7
-rw-r--r--solenv/bin/createpdbrelocators.btm9
-rw-r--r--solenv/bin/createpdbrelocators.pl82
-rwxr-xr-xsolenv/bin/cws6
-rw-r--r--solenv/bin/cws.btm11
-rw-r--r--solenv/bin/cws.pl2087
-rwxr-xr-xsolenv/bin/cwsattach7
-rw-r--r--solenv/bin/cwsattach.btm11
-rw-r--r--solenv/bin/cwsattach.pl220
-rwxr-xr-xsolenv/bin/cwscreate6
-rwxr-xr-xsolenv/bin/cwstestresult7
-rw-r--r--solenv/bin/cwstestresult.btm11
-rw-r--r--solenv/bin/cwstestresult.pl192
-rwxr-xr-xsolenv/bin/cwstouched6
-rwxr-xr-xsolenv/bin/cwstouched.btm11
-rwxr-xr-xsolenv/bin/cwstouched.pl151
-rwxr-xr-xsolenv/bin/cwstouched.py111
-rw-r--r--solenv/bin/dbgsv.ini29
-rwxr-xr-xsolenv/bin/deliver.pl1510
-rwxr-xr-xsolenv/bin/diffmv.pl76
-rw-r--r--solenv/bin/exectest.pl98
-rw-r--r--solenv/bin/fix_def_file.cmd52
-rw-r--r--solenv/bin/fix_def_ord.cmd19
-rw-r--r--solenv/bin/fix_dxp_file.cmd30
-rw-r--r--solenv/bin/fix_exp_file.cmd54
-rw-r--r--solenv/bin/fix_lin_file.cmd13
-rw-r--r--solenv/bin/fix_shl.cmd11
-rwxr-xr-xsolenv/bin/gccinstlib.pl65
-rw-r--r--solenv/bin/gen_update_info.pl176
-rwxr-xr-xsolenv/bin/gen_userfeedback_VCL_names.pl196
-rwxr-xr-xsolenv/bin/genmap1
-rw-r--r--solenv/bin/getcompver.awk79
-rw-r--r--solenv/bin/getcsym.awk34
-rwxr-xr-xsolenv/bin/gsicheck18
-rwxr-xr-xsolenv/bin/guw.pl347
-rw-r--r--solenv/bin/hicontrast-to-theme.pl125
-rwxr-xr-xsolenv/bin/image-sort.pl149
-rwxr-xr-xsolenv/bin/install-sh3
-rw-r--r--solenv/bin/installoffice.oxtbin0 -> 1680 bytes
-rwxr-xr-xsolenv/bin/installoffice_impress.oxtbin0 -> 1311 bytes
-rwxr-xr-xsolenv/bin/langwrap131
-rwxr-xr-xsolenv/bin/leconvert.pl91
-rw-r--r--solenv/bin/licinserter.pl138
-rwxr-xr-xsolenv/bin/linkoo360
-rwxr-xr-xsolenv/bin/localize20
-rwxr-xr-xsolenv/bin/localize_sl18
-rw-r--r--solenv/bin/macosx-change-install-names.pl97
-rwxr-xr-xsolenv/bin/macosx-create-bundle105
-rw-r--r--solenv/bin/macosx-dylib-link-list.pl91
-rw-r--r--solenv/bin/make_download.pl129
-rwxr-xr-xsolenv/bin/make_ext_update_info.pl613
-rw-r--r--solenv/bin/make_installer.pl2342
-rwxr-xr-xsolenv/bin/makedepn13
-rw-r--r--solenv/bin/makemani.pl112
-rw-r--r--solenv/bin/mapgen.pl207
-rw-r--r--solenv/bin/mkdir.btm6
-rwxr-xr-xsolenv/bin/mkdir.pl65
-rwxr-xr-xsolenv/bin/mkout.pl162
-rw-r--r--solenv/bin/modules/CreatePDBRelocators.pm233
-rwxr-xr-xsolenv/bin/modules/Cws.pm2153
-rw-r--r--solenv/bin/modules/CwsConfig.pm576
-rwxr-xr-xsolenv/bin/modules/Eis.pm220
-rw-r--r--solenv/bin/modules/GenInfoParser.pm296
-rw-r--r--solenv/bin/modules/RepositoryHelper.pm210
-rwxr-xr-xsolenv/bin/modules/SourceConfig.pm669
-rw-r--r--solenv/bin/modules/SourceConfigHelper.pm422
-rw-r--r--solenv/bin/modules/installer/archivefiles.pm565
-rw-r--r--solenv/bin/modules/installer/configuration.pm901
-rw-r--r--solenv/bin/modules/installer/control.pm759
-rw-r--r--solenv/bin/modules/installer/converter.pm462
-rw-r--r--solenv/bin/modules/installer/copyproject.pm118
-rw-r--r--solenv/bin/modules/installer/download.pm2180
-rw-r--r--solenv/bin/modules/installer/downloadsigner.pm585
-rw-r--r--solenv/bin/modules/installer/environment.pm139
-rw-r--r--solenv/bin/modules/installer/epmfile.pm3454
-rw-r--r--solenv/bin/modules/installer/existence.pm190
-rw-r--r--solenv/bin/modules/installer/exiter.pm113
-rw-r--r--solenv/bin/modules/installer/files.pm219
-rw-r--r--solenv/bin/modules/installer/followme.pm215
-rw-r--r--solenv/bin/modules/installer/globals.pm536
-rw-r--r--solenv/bin/modules/installer/javainstaller.pm1885
-rw-r--r--solenv/bin/modules/installer/languagepack.pm565
-rw-r--r--solenv/bin/modules/installer/languages.pm379
-rw-r--r--solenv/bin/modules/installer/logger.pm339
-rw-r--r--solenv/bin/modules/installer/mail.pm136
-rw-r--r--solenv/bin/modules/installer/packagelist.pm872
-rw-r--r--solenv/bin/modules/installer/packagepool.pm1048
-rw-r--r--solenv/bin/modules/installer/parameter.pm651
-rw-r--r--solenv/bin/modules/installer/pathanalyzer.pm75
-rw-r--r--solenv/bin/modules/installer/profiles.pm231
-rw-r--r--solenv/bin/modules/installer/remover.pm82
-rw-r--r--solenv/bin/modules/installer/scppatchsoname.pm218
-rw-r--r--solenv/bin/modules/installer/scpzipfiles.pm187
-rw-r--r--solenv/bin/modules/installer/scriptitems.pm2944
-rw-r--r--solenv/bin/modules/installer/setupscript.pm540
-rw-r--r--solenv/bin/modules/installer/simplepackage.pm836
-rw-r--r--solenv/bin/modules/installer/sorter.pm116
-rw-r--r--solenv/bin/modules/installer/strip.pm139
-rw-r--r--solenv/bin/modules/installer/substfilenamefiles.pm166
-rw-r--r--solenv/bin/modules/installer/systemactions.pm1738
-rw-r--r--solenv/bin/modules/installer/upx.pm156
-rw-r--r--solenv/bin/modules/installer/windows/admin.pm916
-rw-r--r--solenv/bin/modules/installer/windows/assembly.pm371
-rw-r--r--solenv/bin/modules/installer/windows/binary.pm77
-rw-r--r--solenv/bin/modules/installer/windows/component.pm524
-rw-r--r--solenv/bin/modules/installer/windows/createfolder.pm153
-rw-r--r--solenv/bin/modules/installer/windows/directory.pm456
-rw-r--r--solenv/bin/modules/installer/windows/feature.pm445
-rw-r--r--solenv/bin/modules/installer/windows/featurecomponent.pm244
-rw-r--r--solenv/bin/modules/installer/windows/file.pm971
-rw-r--r--solenv/bin/modules/installer/windows/font.pm110
-rw-r--r--solenv/bin/modules/installer/windows/icon.pm77
-rw-r--r--solenv/bin/modules/installer/windows/idtglobal.pm2423
-rw-r--r--solenv/bin/modules/installer/windows/inifile.pm146
-rw-r--r--solenv/bin/modules/installer/windows/java.pm120
-rw-r--r--solenv/bin/modules/installer/windows/language.pm74
-rw-r--r--solenv/bin/modules/installer/windows/media.pm458
-rwxr-xr-xsolenv/bin/modules/installer/windows/mergemodule.pm1652
-rw-r--r--solenv/bin/modules/installer/windows/msiglobal.pm2264
-rw-r--r--solenv/bin/modules/installer/windows/msp.pm1293
-rw-r--r--solenv/bin/modules/installer/windows/patch.pm155
-rw-r--r--solenv/bin/modules/installer/windows/property.pm656
-rw-r--r--solenv/bin/modules/installer/windows/registry.pm397
-rw-r--r--solenv/bin/modules/installer/windows/removefile.pm152
-rw-r--r--solenv/bin/modules/installer/windows/selfreg.pm88
-rw-r--r--solenv/bin/modules/installer/windows/shortcut.pm697
-rw-r--r--solenv/bin/modules/installer/windows/sign.pm1249
-rw-r--r--solenv/bin/modules/installer/windows/strip.pm159
-rw-r--r--solenv/bin/modules/installer/windows/update.pm600
-rw-r--r--solenv/bin/modules/installer/windows/upgrade.pm167
-rw-r--r--solenv/bin/modules/installer/worker.pm3436
-rw-r--r--solenv/bin/modules/installer/xpdinstaller.pm1832
-rw-r--r--solenv/bin/modules/installer/ziplist.pm812
-rw-r--r--solenv/bin/modules/macosxotoolhelper.pm44
-rwxr-xr-xsolenv/bin/modules/osarch.pm195
-rw-r--r--solenv/bin/modules/packager/check.pm88
-rw-r--r--solenv/bin/modules/packager/existence.pm52
-rw-r--r--solenv/bin/modules/packager/exiter.pm71
-rw-r--r--solenv/bin/modules/packager/files.pm184
-rw-r--r--solenv/bin/modules/packager/globals.pm54
-rw-r--r--solenv/bin/modules/packager/work.pm327
-rw-r--r--solenv/bin/modules/par2script/check.pm347
-rw-r--r--solenv/bin/modules/par2script/converter.pm142
-rw-r--r--solenv/bin/modules/par2script/existence.pm74
-rw-r--r--solenv/bin/modules/par2script/exiter.pm122
-rw-r--r--solenv/bin/modules/par2script/files.pm124
-rw-r--r--solenv/bin/modules/par2script/globals.pm81
-rw-r--r--solenv/bin/modules/par2script/module.pm264
-rw-r--r--solenv/bin/modules/par2script/parameter.pm154
-rw-r--r--solenv/bin/modules/par2script/remover.pm75
-rw-r--r--solenv/bin/modules/par2script/shortcut.pm75
-rw-r--r--solenv/bin/modules/par2script/systemactions.pm184
-rw-r--r--solenv/bin/modules/par2script/undefine.pm144
-rw-r--r--solenv/bin/modules/par2script/work.pm416
-rw-r--r--solenv/bin/modules/pre2par/directory.pm54
-rw-r--r--solenv/bin/modules/pre2par/existence.pm74
-rw-r--r--solenv/bin/modules/pre2par/exiter.pm70
-rw-r--r--solenv/bin/modules/pre2par/files.pm125
-rw-r--r--solenv/bin/modules/pre2par/globals.pm68
-rw-r--r--solenv/bin/modules/pre2par/language.pm172
-rw-r--r--solenv/bin/modules/pre2par/parameter.pm178
-rw-r--r--solenv/bin/modules/pre2par/pathanalyzer.pm75
-rw-r--r--solenv/bin/modules/pre2par/remover.pm67
-rw-r--r--solenv/bin/modules/pre2par/systemactions.pm206
-rw-r--r--solenv/bin/modules/pre2par/work.pm363
-rwxr-xr-xsolenv/bin/msg_filter61
-rw-r--r--solenv/bin/newfolderforce1
-rwxr-xr-xsolenv/bin/oochkpatch6
-rwxr-xr-xsolenv/bin/oochkpatch.btm2
-rw-r--r--solenv/bin/oochkpatch.pl301
-rw-r--r--solenv/bin/packager.pl61
-rw-r--r--solenv/bin/packcomponents.xslt52
-rwxr-xr-xsolenv/bin/packimages.pl437
-rwxr-xr-xsolenv/bin/packmodule58
-rw-r--r--solenv/bin/packregistry.xslt90
-rw-r--r--solenv/bin/par2script.pl115
-rwxr-xr-xsolenv/bin/patch_sanitizer.pl126
-rwxr-xr-xsolenv/bin/pchdelta4
-rwxr-xr-xsolenv/bin/pchdelta.py149
-rw-r--r--solenv/bin/pre2par.pl74
-rwxr-xr-xsolenv/bin/receditor6
-rwxr-xr-xsolenv/bin/relocate233
-rw-r--r--solenv/bin/rmdir.pl46
-rwxr-xr-xsolenv/bin/rpm-wrapper49
-rwxr-xr-xsolenv/bin/slfl.pl176
-rwxr-xr-xsolenv/bin/soirpm.sh32
-rw-r--r--solenv/bin/sort.pl50
-rwxr-xr-xsolenv/bin/subsequenttests158
-rw-r--r--solenv/bin/touch.pl42
-rw-r--r--solenv/bin/transform_description.pl138
-rw-r--r--solenv/bin/unxmap-to-macosx-explist.awk63
-rw-r--r--solenv/bin/update_module_ignore_lists.pl255
-rwxr-xr-xsolenv/bin/zipdep.pl337
-rw-r--r--solenv/config/sdev300.ini3346
-rw-r--r--solenv/config/ssolar.cmn337
-rw-r--r--solenv/doc/gbuild/doxygen.cfg1510
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/alllangres.mk90
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/executable.mk25
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/gbuild.mk82
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/helper.mk42
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/library.mk41
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/linktarget.mk128
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/package.mk30
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/sdi.mk23
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/static_library.mk39
-rw-r--r--solenv/doc/gbuild/solenv/gbuild/types.mk169
-rw-r--r--solenv/gbuild/AllLangResTarget.mk324
-rw-r--r--solenv/gbuild/BuildDirs.mk59
-rw-r--r--solenv/gbuild/ComponentTarget.mk77
-rw-r--r--solenv/gbuild/Deliver.mk82
-rw-r--r--solenv/gbuild/Executable.mk92
-rw-r--r--solenv/gbuild/Helper.mk156
-rw-r--r--solenv/gbuild/Library.mk117
-rw-r--r--solenv/gbuild/LinkTarget.mk569
-rw-r--r--solenv/gbuild/Module.mk128
-rw-r--r--solenv/gbuild/Output.mk147
-rw-r--r--solenv/gbuild/Package.mk67
-rw-r--r--solenv/gbuild/PrecompiledHeaders.mk75
-rw-r--r--solenv/gbuild/SdiTarget.mk72
-rw-r--r--solenv/gbuild/StaticLibrary.mk107
-rw-r--r--solenv/gbuild/TargetLocations.mk145
-rw-r--r--solenv/gbuild/extensions/PackModule.mk62
-rw-r--r--solenv/gbuild/extensions/SetupLocal.mk68
-rw-r--r--solenv/gbuild/gbuild.mk212
-rwxr-xr-xsolenv/gbuild/platform/linux.mk346
-rwxr-xr-xsolenv/gbuild/platform/macosx.mk391
-rwxr-xr-xsolenv/gbuild/platform/solaris.mk330
-rwxr-xr-xsolenv/gbuild/platform/windows.mk566
-rw-r--r--solenv/gbuild/processdelivered.awk35
-rw-r--r--solenv/gbuild/processdeps.awk74
-rw-r--r--solenv/inc/_cppunit.mk120
-rw-r--r--solenv/inc/_tg_app.mk2840
-rw-r--r--solenv/inc/_tg_def.mk2810
-rw-r--r--solenv/inc/_tg_lib.mk1020
-rw-r--r--solenv/inc/_tg_rslb.mk610
-rw-r--r--solenv/inc/_tg_scp.mk180
-rw-r--r--solenv/inc/_tg_sdi.mk180
-rw-r--r--solenv/inc/_tg_shl.mk5980
-rw-r--r--solenv/inc/_tg_srs.mk410
-rw-r--r--solenv/inc/_tg_zip.mk1230
-rw-r--r--solenv/inc/ant.mk100
-rw-r--r--solenv/inc/ant.properties12
-rw-r--r--solenv/inc/antsettings.mk87
-rw-r--r--solenv/inc/cppunit.mk56
-rw-r--r--solenv/inc/dummy.flt0
-rw-r--r--solenv/inc/extension_helplink.mk80
-rw-r--r--solenv/inc/extension_post.mk176
-rw-r--r--solenv/inc/extension_pre.mk59
-rw-r--r--solenv/inc/found_no.mk5
-rw-r--r--solenv/inc/installationtest.mk125
-rw-r--r--solenv/inc/javaunittest.mk107
-rw-r--r--solenv/inc/lang.mk57
-rw-r--r--solenv/inc/layout.mk32
-rw-r--r--solenv/inc/libs.mk541
-rw-r--r--solenv/inc/mime.types201
-rw-r--r--solenv/inc/minor.mk5
-rw-r--r--solenv/inc/os2.mk333
-rw-r--r--solenv/inc/os2gcci.mk288
-rw-r--r--solenv/inc/pkg_config.mk49
-rw-r--r--solenv/inc/postmac.h52
-rw-r--r--solenv/inc/postset.mk169
-rw-r--r--solenv/inc/preinclude.h38
-rw-r--r--solenv/inc/premac.h52
-rw-r--r--solenv/inc/pstrules.mk155
-rw-r--r--solenv/inc/rules.mk799
-rw-r--r--solenv/inc/sc.mk28
-rw-r--r--solenv/inc/scpre.mk50
-rw-r--r--solenv/inc/set_ext.mk37
-rwxr-xr-xsolenv/inc/set_wntx64.mk215
-rw-r--r--solenv/inc/settings.mk1377
-rw-r--r--solenv/inc/shlinfo.rc113
-rw-r--r--solenv/inc/startup/OS2/macros.mk30
-rw-r--r--solenv/inc/startup/Readme6
-rw-r--r--solenv/inc/startup/startup.mk109
-rw-r--r--solenv/inc/startup/summary3
-rw-r--r--solenv/inc/startup/wnt/macros.mk32
-rw-r--r--solenv/inc/starview.hid304
-rw-r--r--solenv/inc/target.mk2085
-rw-r--r--solenv/inc/templates/extension_tmpl.mk153
-rw-r--r--solenv/inc/tg_app.mk316
-rw-r--r--solenv/inc/tg_compv.mk158
-rw-r--r--solenv/inc/tg_config.mk203
-rw-r--r--solenv/inc/tg_def.mk313
-rw-r--r--solenv/inc/tg_dep.mk96
-rw-r--r--solenv/inc/tg_ext.mk362
-rw-r--r--solenv/inc/tg_help.mk90
-rw-r--r--solenv/inc/tg_jar.mk89
-rw-r--r--solenv/inc/tg_java.mk84
-rw-r--r--solenv/inc/tg_javav.mk53
-rw-r--r--solenv/inc/tg_lib.mk134
-rw-r--r--solenv/inc/tg_merge.mk66
-rw-r--r--solenv/inc/tg_moz.mk89
-rw-r--r--solenv/inc/tg_obj.mk94
-rwxr-xr-xsolenv/inc/tg_propmerge.mk66
-rw-r--r--solenv/inc/tg_res.mk43
-rw-r--r--solenv/inc/tg_rslb.mk92
-rw-r--r--solenv/inc/tg_scp.mk50
-rw-r--r--solenv/inc/tg_sdi.mk50
-rw-r--r--solenv/inc/tg_shl.mk637
-rw-r--r--solenv/inc/tg_slo.mk98
-rw-r--r--solenv/inc/tg_srs.mk73
-rw-r--r--solenv/inc/tg_wntx64.mk514
-rwxr-xr-xsolenv/inc/tg_xmerge.mk108
-rw-r--r--solenv/inc/tg_yxx.mk48
-rw-r--r--solenv/inc/tg_zip.mk154
-rw-r--r--solenv/inc/trustedinfo.manifest11
-rw-r--r--solenv/inc/udkversion.mk33
-rw-r--r--solenv/inc/unitools.mk192
-rw-r--r--solenv/inc/unx.mk208
-rw-r--r--solenv/inc/unxaixp.mk113
-rw-r--r--solenv/inc/unxbsda.mk99
-rw-r--r--solenv/inc/unxbsdi.mk179
-rw-r--r--solenv/inc/unxbsdi2.mk198
-rw-r--r--solenv/inc/unxbsds.mk179
-rw-r--r--solenv/inc/unxfbsd.mk229
-rw-r--r--solenv/inc/unxfbsdi.mk46
-rw-r--r--solenv/inc/unxfbsdx.mk49
-rw-r--r--solenv/inc/unxhpgr.mk133
-rw-r--r--solenv/inc/unxhpxr.mk131
-rw-r--r--solenv/inc/unxlng.mk268
-rw-r--r--solenv/inc/unxlnga.mk33
-rw-r--r--solenv/inc/unxlngaxp.mk34
-rw-r--r--solenv/inc/unxlnghppa.mk35
-rw-r--r--solenv/inc/unxlngi.mk34
-rw-r--r--solenv/inc/unxlngm68k.mk37
-rw-r--r--solenv/inc/unxlngmips.mk33
-rw-r--r--solenv/inc/unxlngppc.mk37
-rw-r--r--solenv/inc/unxlngppc64.mk34
-rw-r--r--solenv/inc/unxlngr.mk34
-rw-r--r--solenv/inc/unxlngs.mk36
-rw-r--r--solenv/inc/unxlngs390.mk36
-rw-r--r--solenv/inc/unxlngs390x.mk33
-rw-r--r--solenv/inc/unxlngx.mk33
-rw-r--r--solenv/inc/unxmacx.mk290
-rw-r--r--solenv/inc/unxmacxi.mk53
-rw-r--r--solenv/inc/unxmacxp.mk37
-rw-r--r--solenv/inc/unxscoi.mk140
-rw-r--r--solenv/inc/unxsogi.mk141
-rw-r--r--solenv/inc/unxsogs.mk140
-rw-r--r--solenv/inc/unxsoli4.mk241
-rw-r--r--solenv/inc/unxsols4.mk247
-rw-r--r--solenv/inc/unxsolu4.mk242
-rw-r--r--solenv/inc/verinfo.hrc229
-rwxr-xr-xsolenv/inc/version.hrc70
-rwxr-xr-xsolenv/inc/version.lst34
-rwxr-xr-xsolenv/inc/version_so.hrc69
-rwxr-xr-xsolenv/inc/versionlist.mk30
-rw-r--r--solenv/inc/wnt.mk72
-rw-r--r--solenv/inc/wntgcci.mk217
-rw-r--r--solenv/inc/wntmsci10.mk343
-rwxr-xr-xsolenv/inc/wntmsci11.mk391
-rwxr-xr-xsolenv/makefile.mk45
-rw-r--r--solenv/prj/build.lst3
-rwxr-xr-xsolenv/prj/d.lst4
-rwxr-xr-xsolenv/src/component.map7
-rw-r--r--solenv/src/default_description.xml15
-rw-r--r--solenv/src/reg-component.map8
-rw-r--r--solenv/src/solaris_noexstk.map4
-rwxr-xr-xsolenv/src/unloadablecomponent.map8
-rw-r--r--solenv/src/version.c79
-rw-r--r--solenv/unxmacxp/inc/poll.h173
376 files changed, 118647 insertions, 0 deletions
diff --git a/solenv/bin/_mkout b/solenv/bin/_mkout
new file mode 100755
index 000000000000..b1ff7b0f5c89
--- /dev/null
+++ b/solenv/bin/_mkout
@@ -0,0 +1,11 @@
+#!/bin/sh -e
+if [ -z "$1" ]; then
+ exit 1;
+fi
+mkdir -p "$1"/bin
+mkdir -p "$1"/inc
+mkdir -p "$1"/lib
+mkdir -p "$1"/misc
+mkdir -p "$1"/obj
+mkdir -p "$1"/slb
+mkdir -p "$1"/slo
diff --git a/solenv/bin/addsym-macosx.sh b/solenv/bin/addsym-macosx.sh
new file mode 100755
index 000000000000..b69f59fff319
--- /dev/null
+++ b/solenv/bin/addsym-macosx.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# This script is needed in the process of generating exported
+# symbols list out of map files on Mac OS X (see also #i69351#)
+# The magic generating the regular expression from the temporary
+# mapfile containing only star and question mark symbols
+#
+# The script has to be called as follows:
+# nm -gx <file>.o | addsym-macosx.sh <file-with-wildcard-symbols> <temporary-file-where-to-write-the-search-expression-to>
+# See tg_shl.mk for an example of how to use the script
+#
+# Replace every * with .* and every ? with . to get awk expression
+# Put ^ at the beginning of every expression
+# Put $ at the beginning of every expression
+# Connect them all on one line, separated by |
+# Remove | at the end of this regular expression because the last end
+# of line was also replaced by |
+
+cat $1 | sed 's#*#.*#g
+s#?#.#g
+s#^#^#
+s#$#$#' | tr '\n' '|' | sed "s#|\$##" >$2
+
+# Please note that the awk expression expects to get the output of 'nm -gx'!
+# On Panther we have to filter out symbols with a value "1f" otherwise external
+# symbols will erroneously be added to the generated export symbols list file.
+awk -v SYMBOLSREGEXP="`cat $2`" '
+match ($6,SYMBOLSREGEXP) > 0 && $6 !~ /_GLOBAL_/ { if (($2 != 1) && ( $2 != "1f" ) ) print $6 }'
+
diff --git a/solenv/bin/addsym-mingw.sh b/solenv/bin/addsym-mingw.sh
new file mode 100644
index 000000000000..f59dbf5e64b7
--- /dev/null
+++ b/solenv/bin/addsym-mingw.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# This script is needed in the process of generating exported
+# symbols list out of map files on MinGW
+# The magic generating the regular expression from the temporary
+# mapfile containing only star and question mark symbols
+#
+# The script has to be called as follows:
+# nm -gx <file>.o | addsym-mingw.sh <file-with-wildcard-symbols> <temporary-file-where-to-write-the-search-expression-to>
+# See tg_shl.mk for an example of how to use the script
+#
+# Replace every * with .* and every ? with . to get awk expression
+# Remove whitespaces and comments in expression
+# Put ^ at the beginning of every expression
+# Put $ at the beginning of every expression
+# Connect them all on one line, separated by |
+# Remove | at the end of this regular expression because the last end
+# of line was also replaced by |
+
+if [ -s $1 ]
+then
+cat $1 | sed 's#*#.*#g
+s#?#.#g
+s#;.*##g
+s# ##g
+s# ##g
+s#^#^#
+s#$#$#' | tr '\n' '|' | sed "s#|\$##" >$2
+
+# Please note that the awk expression expects to get the output of 'nm -gP'!
+awk -v SYMBOLSREGEXP="`cat $2`" '
+match (substr ($1,2) ,SYMBOLSREGEXP) > 0 { print substr ($1,2) ";" }'
+fi
+
diff --git a/solenv/bin/addsym.awk b/solenv/bin/addsym.awk
new file mode 100644
index 000000000000..621ca2e4bc42
--- /dev/null
+++ b/solenv/bin/addsym.awk
@@ -0,0 +1,54 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# Add certain symbol patterns to the first global section.
+#
+# The below code fails with 'perverted' mapfiles (using a strange line layout,
+# or containing version UDK_3_0_0 without a global section, ...).
+
+BEGIN { state = 0 }
+END {
+ if (state == 0) {
+ print "# Weak RTTI symbols for C++ exceptions:"
+ print "UDK_3_0_0 {"
+ print "global:"
+ print "_ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions"
+ if (ENVIRON["USE_SYSTEM_STL"] != "YES")
+ print "_ZN4_STL7num_put*; # for STLport"
+ print "};"
+ }
+}
+state == 2 {
+ print "_ZTI*; _ZTS*; # weak RTTI symbols for C++ exceptions"
+ if (ENVIRON["USE_SYSTEM_STL"] != "YES")
+ print "_ZN4_STL7num_put*; # for STLport"
+ state = 3
+}
+# #i66636# - ???
+/^[\t ]*UDK_3_0_0[\t ]*\{/ { state = 1 }
+/^[\t ]*global[\t ]*:/ && state == 1 { state = 2 }
+{ print }
diff --git a/solenv/bin/build.pl b/solenv/bin/build.pl
new file mode 100644
index 000000000000..ed9dcc3721e6
--- /dev/null
+++ b/solenv/bin/build.pl
@@ -0,0 +1,3547 @@
+:
+ eval 'exec perl -S $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+#
+# build - build entire project
+#
+ use strict;
+ use Config;
+ use POSIX;
+ use Cwd qw (cwd);
+ use File::Path;
+ use File::Temp qw(tmpnam tempdir);
+ use File::Find;
+ use Socket;
+ use IO::Socket::INET;
+ use IO::Select;
+ use Fcntl;
+ use POSIX qw(:errno_h);
+ use Sys::Hostname;
+
+ use lib ("$ENV{SOLARENV}/bin/modules");
+ use SourceConfig;
+ use RepositoryHelper;
+ use Cwd 'chdir';
+
+ my $in_so_env = 0;
+ if (defined $ENV{COMMON_ENV_TOOLS}) {
+ unshift(@INC, "$ENV{COMMON_ENV_TOOLS}/modules");
+ $in_so_env++;
+ };
+ if (defined $ENV{CWS_WORK_STAMP}) {
+ require GenInfoParser; import GenInfoParser;
+ require IO::Handle; import IO::Handle;
+ };
+ my $verbose_mode = 0;
+ if (defined $ENV{verbose} || defined $ENV{VERBOSE}) {
+ $verbose_mode = ($ENV{verbose} =~ /^t\S*$/i);
+ }
+ my $enable_multiprocessing = 1;
+ ### for XML file format
+ eval { require XMLBuildListParser; import XMLBuildListParser; };
+ my $enable_xml = 0;
+ my @modes_array = ();
+ if (!$@) {
+ $enable_xml = 1;
+ @modes_array = split('\s' , $ENV{BUILD_TYPE});
+ };
+#### script id #####
+
+ ( my $script_name = $0 ) =~ s/^.*\b(\w+)\.pl$/$1/;
+ my $id_str = ' $Revision: 275224 $ ';
+ my $script_rev = 0;
+ $id_str =~ /Revision:\s+(\S+)\s+\$/
+ ? ($script_rev = $1) : ($script_rev = "-");
+
+ print "$script_name -- version: $script_rev\n";
+
+#########################
+# #
+# Globale Variablen #
+# #
+#########################
+
+ my $modules_number++;
+ my $perl = 'perl';
+ my $remove_command = 'rm -rf';
+ my $nul = '> /dev/null';
+
+ my $processes_to_run = 0;
+# delete $pid when not needed
+ my %projects_deps_hash = (); # hash of projects with no dependencies,
+ # that could be built now
+ my %broken_build = (); # hash of hashes of the modules,
+ # where build was broken (error occurred)
+ my %folders_hashes = ();
+ my %running_children = ();
+ my $dependencies_hash = 0;
+ my $cmd_file = '';
+ my $build_all_parents = 0;
+ my $show = 0;
+ my $checkparents = 0;
+ my $deliver = 0;
+ my $pre_custom_job = '';
+ my $custom_job = '';
+ my $post_custom_job = '';
+ my %local_deps_hash = ();
+ my %path_hash = ();
+ my %platform_hash = ();
+ my %alive_dependencies = ();
+ my %global_deps_hash = (); # hash of dependencies of the all modules
+ my %global_deps_hash_backup = (); # backup hash of external dependencies of the all modules
+ my %module_deps_hash_backup = (); # backup hash of internal dependencies for aech module
+ my @broken_module_names = (); # array of modules, which cannot be built further
+ my @dmake_args = ();
+ my %dead_parents = ();
+ my $initial_module = '';
+ my $all_dependent = 1; # a flag indicating if the hash has independent keys
+ my $build_from_with_branches = '';
+ my $build_all_cont = '';
+ my $build_since = '';
+ my $dlv_switch = '';
+ my $child = 0;
+ my %processes_hash = ();
+ my %module_announced = ();
+ my $prepare = ''; # prepare for following incompatible build
+ my $ignore = '';
+ my $html = '';
+ my @ignored_errors = ();
+ my %incompatibles = ();
+ my %skip_modules = ();
+ my %exclude_branches = ();
+ my $only_platform = ''; # the only platform to prepare
+ my $only_common = ''; # the only common output tree to delete when preparing
+ my %build_modes = ();
+ my $maximal_processes = 0; # the max number of the processes run
+ my %modules_types = (); # modules types ('mod', 'img', 'lnk') hash
+ my %platforms = (); # platforms available or being working with
+ my %platforms_to_copy = (); # copy output trees for the platforms when --prepare
+ my $tmp_dir = get_tmp_dir(); # temp directory for checkout and other actions
+# $dmake_batch = undef; #
+ my @possible_build_lists = ('build.lst', 'build.xlist'); # build lists names
+ my %build_list_paths = (); # build lists names
+ my %build_lists_hash = (); # hash of arrays $build_lists_hash{$module} = \($path, $xml_list_object)
+ my $pre_job = 'announce'; # job to add for not-single module build
+ my $post_job = ''; # -"-
+ my @warnings = (); # array of warnings to be shown at the end of the process
+ my @errors = (); # array of errors to be shown at the end of the process
+ my %html_info = (); # hash containing all necessary info for generating of html page
+ my %module_by_hash = (); # hash containing all modules names as values and correspondent hashes as keys
+ my %build_in_progress = (); # hash of modules currently being built
+ my %build_is_finished = (); # hash of already built modules
+ my %modules_with_errors = (); # hash of modules with build errors
+ my %build_in_progress_shown = (); # hash of modules being built,
+ # and shown last time (to keep order)
+ my $build_time = time;
+ my $html_last_updated = 0;
+ my %jobs_hash = ();
+ my $html_path = undef;
+ my $build_finished = 0;
+ my $html_file = '';
+ my %had_error = (); # hack for misteriuos windows problems - try run dmake 2 times if first time there was an error
+ my $mkout = correct_path("$ENV{SOLARENV}/bin/mkout.pl");
+ my %weights_hash = (); # hash contains info about how many modules are dependent from one module
+# %weight_stored = ();
+ my $grab_output = 1;
+ my $stop_build_on_error = 0; # for multiprocessing mode: do not build further module if there is an error
+ my $interactive = 0; # for interactive mode... (for testing purpose enabled by default)
+ my $parent_process = 1;
+ my $server_mode = 0;
+ my $setenv_string = ''; # string for configuration of the client environment
+ my $ports_string = ''; # string with possible ports for server
+ my @server_ports = ();
+ my $html_port = 0;
+ my $server_socket_obj = undef; # socket object for server
+ my $html_socket_obj = undef; # socket object for server
+ my %clients_jobs = ();
+ my %clients_times = ();
+ my $client_timeout = 0; # time for client to build (in sec)...
+ # The longest time period after that
+ # the server considered as an error/client crash
+ my %lost_client_jobs = (); # hash containing lost jobs
+ my %job_jobdir = (); # hash containing job-dir pairs
+ my $reschedule_queue = 0;
+ my %module_build_queue = ();
+ my %reversed_dependencies = ();
+ my %module_paths = (); # hash with absolute module paths
+ my %active_modules = ();
+ my $generate_config = 0;
+ my %add_to_config = ();
+ my %remove_from_config = ();
+ my $clear_config = 0;
+ my $finisched_children = 0;
+ my $debug = 0;
+ my %module_deps_hash_pids = ();
+ my @argv = @ARGV;
+ my $source_config_file;
+ my @modules_built = ();
+ my $deliver_command = $ENV{DELIVER};
+ my %prj_platform = ();
+ my $check_error_string = '';
+ my $dmake = '';
+ my $dmake_args = '';
+ my $echo = '';
+ my $new_line = "\n";
+ my $incompatible = 0;
+ my $local_host_ip = 'localhost';
+### main ###
+
+ get_options();
+
+# my $temp_html_file = correct_path($tmp_dir. '/' . $ENV{INPATH}. '.build.html');
+ get_build_modes();
+ my %deliver_env = ();
+ if ($prepare) {
+ get_platforms(\%platforms);
+
+ $deliver_env{'BUILD_SOSL'}++;
+ $deliver_env{'COMMON_OUTDIR'}++;
+ $deliver_env{'GUI'}++;
+ $deliver_env{'INPATH'}++;
+ $deliver_env{'OFFENV_PATH'}++;
+ $deliver_env{'OUTPATH'}++;
+ $deliver_env{'L10N_framework'}++;
+ };
+ my $workspace_path = get_workspace_path(); # This also sets $initial_module
+ my $source_config = SourceConfig -> new($workspace_path);
+ check_partial_gnumake_build($initial_module);
+
+ if ($html) {
+ if (defined $html_path) {
+ $html_file = correct_path($html_path . '/' . $ENV{INPATH}. '.build.html');
+ } else {
+ my $log_directory = Cwd::realpath(correct_path($workspace_path . '/..')) . '/log';
+ if ((!-d $log_directory) && (!mkdir($log_directory))) {
+ print_error("Cannot create $log_directory for writing html file\n");
+ };
+ $html_file = $log_directory . '/' . $ENV{INPATH}. '.build.html';
+ print "\nPath to html status page: $html_file\n";
+ };
+ };
+
+ if ($generate_config && ($clear_config || (scalar keys %remove_from_config)||(scalar keys %add_to_config))) {
+ generate_config_file();
+ exit 0;
+ }
+ get_module_and_buildlist_paths();
+ provide_consistency() if (defined $ENV{CWS_WORK_STAMP} && defined($ENV{COMMON_ENV_TOOLS}));
+
+ $deliver_command .= ' -verbose' if ($html);
+ $deliver_command .= ' '. $dlv_switch if ($dlv_switch);
+ $ENV{mk_tmp}++;
+
+ get_commands();
+ unlink ($cmd_file);
+ if ($cmd_file) {
+ if (open (CMD_FILE, ">>$cmd_file")) {
+ select CMD_FILE;
+ $echo = 'echo ';
+ if ($ENV{GUI} ne 'UNX') {
+ $new_line = "echo.\n";
+ print "\@$echo off\npushd\n";
+ } else {
+ $new_line = $echo."\"\"\n";
+ };
+ } else {
+ print_error ("Cannot open file $cmd_file");
+ };
+# } elsif ($show) {
+# select STDOUT;
+ };
+
+ print $new_line;
+ get_server_ports();
+ start_interactive() if ($interactive);
+
+ if ($checkparents) {
+ get_parent_deps( $initial_module, \%global_deps_hash );
+ } else {
+ build_all();
+ }
+ if (scalar keys %broken_build) {
+ cancel_build();
+# } elsif (!$custom_job && $post_custom_job) {
+# do_post_custom_job(correct_path($workspace_path.$initial_module));
+ };
+ print_warnings();
+ if (scalar keys %active_modules) {
+ foreach (keys %dead_parents) {
+ delete $dead_parents{$_} if (!defined $active_modules{$_});
+ };
+ };
+ if (scalar keys %dead_parents) {
+ print $new_line.$new_line;
+ print $echo."WARNING! Project(s):\n";
+ foreach (keys %dead_parents) {
+ print $echo."$_\n";
+ };
+ print $new_line;
+ print $echo."not found and couldn't be built. dependencies on that module(s) ignored. Maybe you should correct build lists.\n";
+ print $new_line;
+ do_exit(1) if ($checkparents);
+ };
+ if (($ENV{GUI} ne 'UNX') && $cmd_file) {
+ print "popd\n";
+ };
+ $ENV{mk_tmp} = '';
+ if ($cmd_file) {
+ close CMD_FILE;
+ print STDOUT "Script $cmd_file generated\n";
+ };
+ if ($ignore && scalar @ignored_errors) {
+ print STDERR "\nERROR: next directories could not be built:\n";
+ foreach (@ignored_errors) {
+ print STDERR "\t$_\n";
+ };
+ print STDERR "\nERROR: please check these directories and build the corresponding module(s) anew!!\n\n";
+ do_exit(1);
+ };
+ do_exit(0);
+
+
+#########################
+# #
+# Procedures #
+# #
+#########################
+
+sub print_warnings {
+ if (scalar @warnings) {
+ print STDERR "\nWARNING(S):\n";
+ print STDERR $_ foreach (@warnings);
+ };
+};
+
+sub rename_file {
+ my ($old_file_name, $new_file_name, $throw_error) = @_;
+
+ if(-e $old_file_name) {
+ rename($old_file_name, $new_file_name) or system("mv", $old_file_name, $new_file_name);
+ if (-e $old_file_name) {
+ system("rm -rf $old_file_name") if (!unlink $old_file_name);
+ };
+ } elsif ($throw_error) {
+ print_error("No such file $old_file_name");
+ };
+};
+
+sub generate_config_file {
+ $source_config->add_active_modules([keys %add_to_config], 1) if (scalar %add_to_config);
+ $source_config->remove_activated_modules([keys %remove_from_config], 1) if (scalar %remove_from_config);
+ $source_config->remove_all_activated_modules() if ($clear_config);
+};
+
+
+sub start_interactive {
+ my $pid = open(HTML_PIPE, "-|");
+ print "Pipe is open\n";
+
+ if ($pid) { # parent
+ # make file handle non-blocking
+ my $flags = '';
+ fcntl(HTML_PIPE, F_GETFL, $flags);
+ $flags |= O_NONBLOCK;
+ fcntl(HTML_PIPE, F_SETFL, $flags);
+ } else { # child
+ $parent_process = 0;
+ start_html_listener();
+ };
+};
+
+sub start_html_listener {
+ $html_port = $server_ports[$#server_ports];
+ do {
+ $html_port++
+ } while (start_server_on_port($html_port, \$html_socket_obj));
+ print "html_port:$html_port html_socket_obj: $html_socket_obj\n";
+ my $new_socket_obj;
+ do {
+ $new_socket_obj = accept_html_connection();
+ if (defined $new_socket_obj) {
+ my $html_message;
+ $html_message = <$new_socket_obj>;
+ chomp $html_message;
+ print $html_message . "\n";
+ my $socket_message = '';
+ for my $action ('rebuild', 'delete') {
+ if ($html_message =~ /$action=(\S+)/) {
+ print $new_socket_obj "Module $1 is scheduled for $action";
+ };
+ };
+ close($new_socket_obj);
+ } else {
+ sleep(10);
+ };
+ } while(1);
+};
+
+sub start_html_message_trigger {
+ my $child_id=fork(); ### VG: for windows there is a "simulation of the "fork"", no new procs... One can use Win32::Process::Create
+
+ if ($child_id) {
+ # parent
+# print "started listener trigger\n";
+ } else {
+ my $buffer_size = 1024;
+ my $buffer;
+ my $rv;
+ my $full_buffer = '';
+ my %modules_to_rebuild = ();
+ my $paddr;
+ while ($rv = sysread(HTML_PIPE, $buffer, $buffer_size)) {
+ $full_buffer .= $buffer;
+ };
+ if (length $full_buffer) {
+ print "**********Got message $full_buffer\n";
+ socket(SOCKET, PF_INET, SOCK_STREAM, getprotobyname('tcp')) or die "socket: $!";
+ if (connect(SOCKET, $paddr)) {
+ $full_buffer .= "\n";
+ syswrite SOCKET, $full_buffer, length $full_buffer;
+# close SOCKET or die "Child close socket: $!";
+ } else {
+ die "Child connect: $!";
+ };
+ }
+ _exit(0);
+ };
+};
+
+sub get_html_orders {
+ return if (!$interactive);
+ my $buffer_size = 1024;
+ my $buffer;
+ my $rv;
+ my $full_buffer = '';
+ my %modules_to_rebuild = ();
+ my %modules_to_delete = ();
+ while ($rv = sysread(HTML_PIPE, $buffer, $buffer_size)) {
+ $full_buffer .= $buffer;
+ };
+# };
+ my @html_messages = split(/\n/, $full_buffer);
+ foreach (@html_messages) {
+ if (/^html_port:(\d+)/) {
+ $html_port = $1;
+ print "Html port is: $html_port\n";
+ next;
+ };# GET /rebuild=officenames HTTP/1.0
+ print "Message: $_\n";
+ chomp;
+ if (/GET\s+\/delete=(\S+)[:(\S+)]*\s*HTTP/) {
+ $modules_to_delete{$1} = $2;
+ print "$1 scheduled for removal from build for \n";
+ }
+ if (/GET\s+\/rebuild=(\S+)[:(\S+)]*\s*HTTP/) {
+ if (defined $global_deps_hash{$1}) {
+ print "!!! /tarModule $1 has not been built. Html order ignored\n";
+ } else {
+ $modules_to_rebuild{$1} = $2;
+ print "Scheduled $1 for rebuild\n";
+ }
+ }
+ };
+ if (scalar keys %modules_to_delete) {
+ $reschedule_queue++;
+ schedule_delete(\%modules_to_delete);
+ generate_html_file();
+ };
+ if (scalar keys %modules_to_rebuild) {
+ $reschedule_queue++;
+ schedule_rebuild(\%modules_to_rebuild);
+ generate_html_file();
+ };
+};
+
+sub schedule_delete {
+ my $modules_to_delete = shift;
+ foreach (keys %$modules_to_delete) {
+ print "Schedule module $_ for delete\n";
+ delete ($global_deps_hash{$_});
+ delete ($global_deps_hash_backup{$_});
+ if (scalar keys %{$module_deps_hash_pids{$projects_deps_hash{$_}}}) {
+ kill 9, keys %{$module_deps_hash_pids{$projects_deps_hash{$_}}};
+ handle_dead_children(0);
+ };
+ remove_from_dependencies($_, \%global_deps_hash);
+ remove_from_dependencies($_, \%global_deps_hash_backup);
+ delete $reversed_dependencies{$_};
+ delete $build_is_finished{$_} if defined $build_is_finished{$_};
+ delete $modules_with_errors{$_} if defined $modules_with_errors{$_};
+ delete $module_announced{$_} if defined $module_announced{$_};
+ delete $html_info{$_} if defined $html_info{$_};
+ delete $projects_deps_hash{$_} if defined $projects_deps_hash{$_};
+ };
+};
+
+sub schedule_rebuild {
+ my $modules_to_rebuild = shift;
+ foreach (keys %$modules_to_rebuild) {
+ if (defined $$modules_to_rebuild{$_}) {
+ print "Schedule directory for rebuild";
+ } else {
+ print "Schedule complete $_ module for rebuild\n";
+ if (scalar keys %{$module_deps_hash_pids{$projects_deps_hash{$_}}}) {
+ kill 9, keys %{$module_deps_hash_pids{$projects_deps_hash{$_}}};
+ handle_dead_children(0);
+ };
+ delete $build_is_finished{$_} if defined $build_is_finished{$_};
+ delete $modules_with_errors{$_} if defined $modules_with_errors{$_};
+ delete $module_announced{$_};
+ initialize_html_info($_);
+
+ foreach my $waiter (keys %{$reversed_dependencies{$_}}) {
+ # for rebuild_all_dependent - refacture "if" condition
+ ${$global_deps_hash{$waiter}}{$_}++ if (!defined $build_is_finished{$waiter});
+ };
+ delete $projects_deps_hash{$_} if defined $projects_deps_hash{$_};
+ my %single_module_dep_hash = ();
+ foreach my $module (keys %{$global_deps_hash_backup{$_}}) {
+ if (defined ${$global_deps_hash_backup{$_}}{$module} && (!defined $build_is_finished{$module})) {
+ $single_module_dep_hash{$module}++;
+ };
+ };
+ $global_deps_hash{$_} = \%single_module_dep_hash;
+ };
+ };
+};
+
+
+#
+# procedure retrieves build list path
+# (all possibilities are taken into account)
+#
+sub get_build_list_path {
+ my $module = shift;
+ return $build_list_paths{$module} if (defined $build_list_paths{$module});
+ my @possible_dirs = ($module, $module. '.lnk', $module. '.link');
+ return $build_list_paths{$module} if (defined $build_list_paths{$module});
+ foreach (@possible_dirs) {
+ my $possible_dir_path = $module_paths{$_}.'/prj/';
+ if (-d $possible_dir_path) {
+ foreach my $build_list (@possible_build_lists) {
+ my $possible_build_list_path = correct_path($possible_dir_path . $build_list);
+ if (-f $possible_build_list_path) {
+ $build_list_paths{$module} = $possible_build_list_path;
+ return $possible_build_list_path;
+ };
+ }
+ print_error("There's no build list for $module");
+ };
+ };
+ $dead_parents{$module}++;
+ $build_list_paths{$module} = correct_path(retrieve_build_list($module)) if (!defined $build_list_paths{$module});
+ return $build_list_paths{$module};
+};
+
+#
+# Get dependencies hash of the current and all parent projects
+#
+sub get_parent_deps {
+ my $prj_dir = shift;
+ my $deps_hash = shift;
+ my @unresolved_parents = ($prj_dir);
+ my %skipped_branches = ();
+ while (my $module = pop(@unresolved_parents)) {
+ next if (defined $$deps_hash{$module});
+ my %parents_deps_hash = ();
+ foreach (get_parents_array($module)) {
+ if (defined $exclude_branches{$_}) {
+ $skipped_branches{$_}++;
+ next;
+ };
+ $parents_deps_hash{$_}++;
+ }
+ $$deps_hash{$module} = \%parents_deps_hash;
+ foreach my $parent (keys %parents_deps_hash) {
+ if (!defined($$deps_hash{$parent}) && (!defined $exclude_branches{$module})) {
+ push (@unresolved_parents, $parent);
+ };
+ };
+ };
+ check_deps_hash($deps_hash);
+ foreach (keys %skipped_branches) {
+ print $echo . "Skipping module's $_ branch\n";
+ delete $exclude_branches{$_};
+ };
+ my @missing_branches = keys %exclude_branches;
+ if (scalar @missing_branches) {
+ print_error("For $prj_dir branche(s): \"@missing_branches\" not found\n");
+ };
+};
+
+sub store_weights {
+ my $deps_hash = shift;
+ foreach (keys %$deps_hash) {
+ foreach my $module_deps_hash ($$deps_hash{$_}) {
+ foreach my $dependency (keys %$module_deps_hash) {
+ $weights_hash{$dependency}++;
+ };
+ };
+ };
+};
+
+#
+# This procedure builds comlete dependency for each module, ie if the deps look like:
+# mod1 -> mod2 -> mod3 -> mod4,mod5,
+# than mod1 get mod3,mod4,mod5 as eplicit list of deps, not only mod2 as earlier
+#
+sub expand_dependencies {
+ my $deps_hash = shift;
+
+ foreach my $module1 (keys %$deps_hash) {
+ foreach my $module2 (keys %$deps_hash) {
+ next if ($module1 eq $module2);
+ if (defined ${$$deps_hash{$module2}}{$module1}) {
+ ${$$deps_hash{$module2}}{$_}++ foreach (keys %{$$deps_hash{$module1}})
+ };
+ };
+ };
+};
+
+#
+# This procedure fills the second hash with reversed dependencies,
+# ie, with info about modules "waiting" for the module
+#
+sub reverse_dependensies {
+ my ($deps_hash, $reversed) = @_;
+ foreach my $module (keys %$deps_hash) {
+ foreach (keys %{$$deps_hash{$module}}) {
+ if (defined $$reversed{$_}) {
+ ${$$reversed{$_}}{$module}++
+ } else {
+ my %single_module_dep_hash = ($module => 1);
+ $$reversed{$_} = \%single_module_dep_hash;
+ };
+ };
+ };
+};
+
+#
+# Build everything that should be built
+#
+sub build_all {
+ if ($build_all_parents) {
+ my ($prj, $prj_dir, $orig_prj);
+ get_parent_deps( $initial_module, \%global_deps_hash);
+ if (scalar keys %active_modules) {
+ $active_modules{$initial_module}++;
+ $modules_types{$initial_module} = 'mod';
+ };
+ modules_classify(keys %global_deps_hash);
+ expand_dependencies (\%global_deps_hash);
+ prepare_incompatible_build(\%global_deps_hash) if ($incompatible && (!$build_from_with_branches));
+ if ($build_from_with_branches) {
+ my %reversed_full_deps_hash = ();
+ reverse_dependensies(\%global_deps_hash, \%reversed_full_deps_hash);
+ prepare_build_from_with_branches(\%global_deps_hash, \%reversed_full_deps_hash);
+ }
+ if ($build_all_cont || $build_since) {
+ store_weights(\%global_deps_hash);
+ prepare_build_all_cont(\%global_deps_hash);
+ %weights_hash = ();
+ };
+ if ($generate_config) {
+ %add_to_config = %global_deps_hash;
+ generate_config_file();
+ exit 0;
+ } elsif ($incompatible) {
+ my @missing_modules = ();
+ foreach (sort keys %global_deps_hash) {
+ push(@missing_modules, $_) if (!defined $active_modules{$_});
+ };
+ if (scalar @missing_modules) {
+ push(@warnings, "The modules: \"@missing_modules\" should be have been built, but they are not activated and have been skipped. Be aware, that can cause compatibility problems. Maybe you should verify your $source_config_file.\n");
+ };
+ };
+ foreach my $module (keys %dead_parents, keys %skip_modules) {
+ remove_from_dependencies($module, \%global_deps_hash);
+ delete ($global_deps_hash{$module}) if (defined $global_deps_hash{$module});
+ };
+ store_weights(\%global_deps_hash);
+ backup_deps_hash(\%global_deps_hash, \%global_deps_hash_backup);
+ reverse_dependensies(\%global_deps_hash_backup, \%reversed_dependencies);
+ $modules_number = scalar keys %global_deps_hash;
+ initialize_html_info($_) foreach (keys %global_deps_hash);
+ if ($processes_to_run) {
+ build_multiprocessing();
+ return;
+ };
+ if ($server_mode) {
+ run_server();
+ };
+ while ($prj = pick_prj_to_build(\%global_deps_hash)) {
+ if (!defined $dead_parents{$prj}) {
+ if (scalar keys %broken_build) {
+ print $echo . "Skipping project $prj because of error(s)\n";
+ remove_from_dependencies($prj, \%global_deps_hash);
+ $build_is_finished{$prj}++;
+ next;
+ };
+
+ $prj_dir = $module_paths{$prj};
+ get_module_dep_hash($prj, \%local_deps_hash);
+ my $info_hash = $html_info{$prj};
+ $$info_hash{DIRS} = check_deps_hash(\%local_deps_hash, $prj);
+ $module_by_hash{\%local_deps_hash} = $prj;
+ build_dependent(\%local_deps_hash);
+ print $check_error_string;
+ };
+
+ remove_from_dependencies($prj, \%global_deps_hash);
+ $build_is_finished{$prj}++;
+ };
+ } else {
+ store_build_list_content($initial_module);
+ get_module_dep_hash($initial_module, \%local_deps_hash);
+ initialize_html_info($initial_module);
+ my $info_hash = $html_info{$initial_module};
+ $$info_hash{DIRS} = check_deps_hash(\%local_deps_hash, $initial_module);
+ $module_by_hash{\%local_deps_hash} = $initial_module;
+ if ($server_mode) {
+ run_server();
+ } else {
+ build_dependent(\%local_deps_hash);
+ };
+ };
+};
+
+sub backup_deps_hash {
+ my $source_hash = shift;
+ my $backup_hash = shift;
+ foreach my $key (keys %$source_hash) {
+ my %values_hash = %{$$source_hash{$key}};
+ $$backup_hash{$key} = \%values_hash;
+ };
+};
+
+sub initialize_html_info {
+ my $module = shift;
+ return if (defined $dead_parents{$module});
+ $html_info{$module} = { 'DIRS' => [],
+ 'ERRORFUL' => [],
+ 'SUCCESSFUL' => [],
+ 'BUILD_TIME' => 0};
+}
+
+#
+# Do job
+#
+sub dmake_dir {
+ my ($new_job_name, $error_code);
+ my $job_name = shift;
+ $jobs_hash{$job_name}->{START_TIME} = time();
+ $jobs_hash{$job_name}->{STATUS} = 'building';
+ if ($job_name =~ /(\s)/o && (!-d $job_name)) {
+ $error_code = do_custom_job($job_name, \%local_deps_hash);
+ } else {
+ html_store_job_info(\%local_deps_hash, $job_name);
+ print_error("$job_name not found!!\n") if (!-d $job_name);
+ if (!-d $job_name) {
+ $new_job_name = $job_name;
+ $new_job_name =~ s/_simple//g;
+ if ((-d $new_job_name)) {
+ print("\nTrying $new_job_name, $job_name not found!!\n");
+ $job_name = $new_job_name;
+ } else {
+ print_error("\n$job_name not found!!\n");
+ }
+ }
+ if ($cmd_file) {
+ print "cd $job_name\n";
+ print $check_error_string;
+ print $echo.$job_name."\n";
+ print "$dmake\n";
+ print $check_error_string;
+ } else {
+ print "\n" if ( ! $show );
+ print "Entering $job_name\n";
+ };
+ remove_from_dependencies($job_name, \%local_deps_hash) if (!$child);
+ return if ($cmd_file || $show);
+ $error_code = run_job($dmake, $job_name);
+ html_store_job_info(\%local_deps_hash, $job_name, $error_code) if (!$child);
+ };
+
+ if ($error_code && $ignore) {
+ push(@ignored_errors, $job_name);
+ $error_code = 0;
+ };
+ if ($child) {
+ my $oldfh = select STDERR;
+ $| = 1;
+ select $oldfh;
+ $| =1;
+ if ($error_code) {
+ _exit($error_code >> 8);
+ } else {
+ _exit($? >> 8) if ($? && ($? != -1));
+ };
+ _exit(0);
+ } elsif ($error_code && ($error_code != -1)) {
+ $broken_build{$job_name} = $error_code;
+ return $error_code;
+ };
+};
+
+#
+# Procedure stores information about build list (and)
+# build list object in build_lists_hash
+#
+sub store_build_list_content {
+ my $module = shift;
+ my $build_list_path = get_build_list_path($module);
+ return undef if (!defined $build_list_path);
+ return if (!$build_list_path);
+ my $xml_list = undef;
+ if ($build_list_path =~ /\.xlist$/o) {
+ print_error("XMLBuildListParser.pm couldn\'t be found, so XML format for build lists is not enabled") if (!defined $enable_xml);
+ $xml_list = XMLBuildListParser->new();
+ if (!$xml_list->loadXMLFile($build_list_path)) {
+ print_error("Cannot use $build_list_path");
+ };
+ $build_lists_hash{$module} = $xml_list;
+ } else {
+ if (open (BUILD_LST, $build_list_path)) {
+ my @build_lst = <BUILD_LST>;
+ $build_lists_hash{$module} = \@build_lst;
+ close BUILD_LST;
+ return;
+ }
+ $dead_parents{$module}++;
+ };
+}
+#
+# Get string (list) of parent projects to build
+#
+sub get_parents_array {
+ my $module = shift;
+ store_build_list_content($module);
+ my $build_list_ref = $build_lists_hash{$module};
+
+ if (ref($build_list_ref) eq 'XMLBuildListParser') {
+ return $build_list_ref->getModuleDependencies(\@modes_array);
+ };
+ foreach (@$build_list_ref) {
+ if ($_ =~ /#/) {
+ if ($`) {
+ $_ = $`;
+ } else {
+ next;
+ };
+ };
+ s/\r\n//;
+ if ($_ =~ /\:+\s+/) {
+ return pick_for_build_type($');
+ };
+ };
+ return ();
+};
+
+#
+# get folders' platform infos
+#
+sub get_prj_platform {
+ my $build_list_ref = shift;
+ my ($prj_alias, $line);
+ foreach(@$build_list_ref) {
+ s/\r\n//;
+ $line++;
+ if ($_ =~ /\snmake\s/) {
+ if ($' =~ /\s*-\s+(\w+)[,\S+]*\s+(\S+)/ ) {
+ my $platform = $1;
+ my $alias = $2;
+ print_error ("There is no correct alias set in the line $line!") if ($alias eq 'NULL');
+ mark_platform($alias, $platform);
+ } else {
+ print_error("Misspelling in line: \n$_");
+ };
+ };
+ };
+};
+
+#
+# Procedure populate the dependencies hash with
+# information from XML build list object
+#
+sub get_deps_from_object {
+ my ($module, $build_list_object, $dependencies_hash) = @_;
+
+ foreach my $dir ($build_list_object->getJobDirectories("make", $ENV{GUI})) {
+ $path_hash{$dir} = $module_paths{$module};
+ $path_hash{$dir} .= $dir if ($dir ne '/');
+ my %deps_hash = ();
+
+ foreach my $dep ($build_list_object->getJobDependencies($dir, "make", $ENV{GUI})) {
+ $deps_hash{$dep}++;
+ };
+ $$dependencies_hash{$dir} = \%deps_hash;
+ };
+};
+
+#
+# this function wraps the get_module_dep_hash and backups the resultung hash
+#
+sub get_module_dep_hash {
+ my ($module, $module_dep_hash) = @_;
+ if (defined $module_deps_hash_backup{$module}) {
+ backup_deps_hash($module_deps_hash_backup{$module}, $module_dep_hash);
+ } else {
+ get_deps_hash($module, $module_dep_hash);
+ my %values_hash = ();
+ backup_deps_hash($module_dep_hash, \%values_hash);
+ $module_deps_hash_backup{$module} = \%values_hash;
+ }
+};
+
+#
+# Getting hashes of all internal dependencies and additional
+# information for given project
+#
+sub get_deps_hash {
+ my ($dummy, $module_to_build);
+ my %dead_dependencies = ();
+ $module_to_build = shift;
+ my $dependencies_hash = shift;
+ if ($custom_job) {
+ if ($modules_types{$module_to_build} ne 'lnk') {
+ add_prerequisite_job($dependencies_hash, $module_to_build, $pre_custom_job);
+ add_prerequisite_job($dependencies_hash, $module_to_build, $pre_job);
+ add_dependent_job($dependencies_hash, $module_to_build, $custom_job);
+ add_dependent_job($dependencies_hash, $module_to_build, $post_job);
+ add_dependent_job($dependencies_hash, $module_to_build, $post_custom_job);
+ };
+ return;
+ };
+ if ( defined $modules_types{$module_to_build} && $modules_types{$module_to_build} ne 'mod') {
+ add_prerequisite_job($dependencies_hash, $module_to_build, $pre_job);
+ return;
+ };
+
+ my $build_list_ref = $build_lists_hash{$module_to_build};
+# delete $build_lists_hash{$module_to_build};
+ if (ref($build_list_ref) eq 'XMLBuildListParser') {
+ get_deps_from_object($module_to_build, $build_list_ref, $dependencies_hash);
+ } else {
+ get_prj_platform($build_list_ref);
+ foreach (@$build_list_ref) {
+ if ($_ =~ /#/o) {
+ next if (!$`);
+ $_ = $`;
+ };
+ s/\r\n//;
+ if ($_ =~ /\s+nmake\s+/o) {
+ my ($platform, $dependencies, $dir, $dir_alias);
+ my %deps_hash = ();
+ $dependencies = $';
+ $dummy = $`;
+ $dummy =~ /(\S+)\s+(\S*)/o;
+ $dir = $2;
+ $dependencies =~ /(\w+)/o;
+ $platform = $1;
+ $dependencies = $';
+ while ($dependencies =~ /,(\w+)/o) {
+ $dependencies = $';
+ };
+ $dependencies =~ /\s+(\S+)\s+/o;
+ $dir_alias = $1;
+ if (!check_platform($platform)) {
+ next if (defined $platform_hash{$dir_alias});
+ $dead_dependencies{$dir_alias}++;
+ next;
+ };
+ delete $dead_dependencies{$dir_alias} if (defined $dead_dependencies{$dir_alias});
+ print_error("Directory alias $dir_alias is defined at least twice!! Please, correct build.lst in module $module_to_build") if (defined $$dependencies_hash{$dir_alias});
+ $platform_hash{$dir_alias}++;
+ $dependencies = $';
+ print_error("$module_to_build/prj/build.lst has wrongly written dependencies string:\n$_\n") if (!$dependencies);
+ $deps_hash{$_}++ foreach (get_dependency_array($dependencies));
+ $$dependencies_hash{$dir_alias} = \%deps_hash;
+ my $local_dir = '';
+ if ($dir =~ /(\\|\/)/o) {
+ $local_dir = "/$'";
+ };
+ $path_hash{$dir_alias} = correct_path($module_paths{$module_to_build} . $local_dir);
+ } elsif ($_ !~ /^\s*$/ && $_ !~ /^\w*\s/o) {
+ chomp;
+ push(@errors, $_);
+ };
+ };
+ if (scalar @errors) {
+ my $message = "$module_to_build/prj/build.lst has wrongly written string(s):\n";
+ $message .= "$_\n" foreach(@errors);
+ if ($processes_to_run) {
+ $broken_build{$module_to_build} = $message;
+ $dependencies_hash = undef;
+ return;
+ } else {
+ print_error($message);
+ };
+ };
+ foreach my $alias (keys %dead_dependencies) {
+ next if defined $alive_dependencies{$alias};
+# if (!IsHashNative($alias)) {
+ remove_from_dependencies($alias, $dependencies_hash);
+ delete $dead_dependencies{$alias};
+# };
+ };
+ };
+ resolve_aliases($dependencies_hash, \%path_hash);
+ if (!$prepare) {
+ add_prerequisite_job($dependencies_hash, $module_to_build, $pre_custom_job);
+ add_prerequisite_job($dependencies_hash, $module_to_build, $pre_job);
+ add_dependent_job($dependencies_hash, $module_to_build, $custom_job);
+ add_dependent_job($dependencies_hash, $module_to_build, $post_job) if ($module_to_build ne $initial_module);
+ add_dependent_job($dependencies_hash, $module_to_build, $post_custom_job);
+ };
+ store_weights($dependencies_hash);
+};
+
+#
+# procedure adds which is independent from anothers, but anothers are dependent from it
+#
+sub add_prerequisite_job {
+ my ($dependencies_hash, $module, $job) = @_;
+ return if (!$job);
+ $job = "$module $job";
+ foreach (keys %$dependencies_hash) {
+ my $deps_hash = $$dependencies_hash{$_};
+ $$deps_hash{$job}++;
+ };
+ $$dependencies_hash{$job} = {};
+};
+
+#
+# procedure adds a job wich is dependent from all already registered jobs
+#
+sub add_dependent_job {
+ # $post_job is dependent from all jobs
+ my ($dependencies_hash, $module, $job) = @_;
+ return if (!$job);
+ my %deps_hash = ();
+ $deps_hash{$_}++ foreach (keys %$dependencies_hash);
+ $$dependencies_hash{"$module $job"} = \%deps_hash;
+};
+
+#
+# this procedure converts aliases to absolute paths
+#
+sub resolve_aliases {
+ my ($dependencies_hash, $path_hash) = @_;
+ foreach my $dir_alias (keys %$dependencies_hash) {
+ my $aliases_hash_ref = $$dependencies_hash{$dir_alias};
+ my %paths_hash = ();
+ foreach (keys %$aliases_hash_ref) {
+ $paths_hash{$$path_hash{$_}}++;
+ };
+ delete $$dependencies_hash{$dir_alias};
+ $$dependencies_hash{$$path_hash{$dir_alias}} = \%paths_hash;
+ };
+};
+
+#
+# mark platform in order to prove if alias has been used according to specs
+#
+sub mark_platform {
+ my $prj_alias = shift;
+ if (exists $prj_platform{$prj_alias}) {
+ $prj_platform{$prj_alias} = 'all';
+ } else {
+ $prj_platform{$prj_alias} = shift;
+ };
+};
+
+#
+# Convert path from abstract (with '\' and/or '/' delimiters)
+# to system-independent
+#
+sub correct_path {
+ $_ = shift;
+ s/\\/\//g;
+ return $_;
+};
+
+
+sub check_dmake {
+#print "Checking dmake...";
+ if (open(DMAKEVERSION, "dmake -V |")) {
+# if (open(DMAKEVERSION, "dmake -V |")) {
+ my @dmake_version = <DMAKEVERSION>;
+ close DMAKEVERSION;
+# if ($dmake_version[0] =~ /^dmake\s\-\sCopyright\s\(c\)/) {
+# print " Using version $1\n" if ($dmake_version[0] =~ /Version\s(\d+\.*\d*)/);
+# };
+ return;
+ };
+ my $error_message = 'dmake: Command not found.';
+ $error_message .= ' Please rerun bootstrap' if (!defined $ENV{COMMON_ENV_TOOLS});
+ print_error($error_message);
+};
+
+#
+# Get platform-dependent commands
+#
+sub get_commands {
+ my $arg = '';
+ # Setting alias for dmake
+ $dmake = 'dmake';
+ check_dmake();
+
+ if ($cmd_file) {
+ if ($ENV{GUI} eq 'UNX') {
+ $check_error_string = "if \"\$?\" != \"0\" exit\n";
+ } else {
+ $check_error_string = "if \"\%?\" != \"0\" quit\n";
+ };
+ };
+
+ $dmake_args = join(' ', 'dmake', @dmake_args);
+
+ while ($arg = pop(@dmake_args)) {
+ $dmake .= ' '.$arg;
+ };
+ $dmake .= ' verbose=true' if ($html);
+};
+
+#
+# Procedure retrieves list of projects to be built from build.lst
+#
+sub get_workspace_path {
+ if (!defined $ENV{GUI}) {
+ $ENV{mk_tmp} = '';
+ die "No environment set\n";
+ };
+ my $repository_helper = RepositoryHelper->new();
+ my $workspace_path = $repository_helper->get_repository_root();
+ my $initial_dir = $repository_helper->get_initial_directory();
+ if ($workspace_path eq $initial_dir) {
+ print_error('Found no project to build');
+ };
+ $initial_module = substr($initial_dir, length($workspace_path) + 1);
+ if ($initial_module =~ /(\\|\/)/) {
+ $initial_module = $`;
+ };
+ $module_paths{$initial_module} = $workspace_path . "/$initial_module";
+ return $workspace_path;
+};
+
+#
+# Picks project which can be built now from hash and then deletes it from hash
+#
+sub pick_prj_to_build {
+ my $deps_hash = shift;
+ get_html_orders();
+ my $prj = find_indep_prj($deps_hash);
+ if ($prj) {
+ delete $$deps_hash{$prj};
+ generate_html_file();
+ };
+ return $prj;
+};
+
+#
+# Make a decision if the project should be built on this platform
+#
+sub check_platform {
+ my $platform = shift;
+ return 1 if ($platform eq 'all');
+ return 1 if (($ENV{GUI} eq 'WIN') && ($platform eq 'w'));
+ return 1 if (($ENV{GUI} eq 'UNX') && ($platform eq 'u'));
+ return 1 if (($ENV{GUI} eq 'OS2') && ($platform eq 'p'));
+ return 1 if (($ENV{GUI} eq 'WNT') &&
+ (($platform eq 'w') || ($platform eq 'n')));
+ return 0;
+};
+
+#
+# Remove project to build ahead from dependencies and make an array
+# of all from given project dependent projects
+#
+sub remove_from_dependencies {
+ my ($exclude_prj, $i, $prj, $dependencies);
+ $exclude_prj = shift;
+ my $exclude_prj_orig = '';
+ $exclude_prj_orig = $` if (($exclude_prj =~ /\.lnk$/o) || ($exclude_prj =~ /\.link$/o));
+ $dependencies = shift;
+ foreach $prj (keys %$dependencies) {
+ my $prj_deps_hash = $$dependencies{$prj};
+ delete $$prj_deps_hash{$exclude_prj} if (defined $$prj_deps_hash{$exclude_prj});
+ };
+};
+
+
+#
+# Check the hash for consistency
+#
+sub check_deps_hash {
+ my ($deps_hash_ref, $module) = @_;
+ my @possible_order;
+ my $module_path = $module_paths{$module} if (defined $module);
+ return if (!scalar keys %$deps_hash_ref);
+ my %deps_hash = ();
+ my $consistent;
+ backup_deps_hash($deps_hash_ref, \%deps_hash);
+ my $string;
+ my $log_name;
+ my $build_number = 0;
+
+ do {
+ $consistent = '';
+ foreach my $key (sort keys %deps_hash) {
+ my $local_deps_ref = $deps_hash{$key};
+ if (!scalar keys %$local_deps_ref) {
+ if (defined $module) {
+ $build_number++;
+ $string = undef;
+ if ($key =~ /(\s)/o) {
+ $string = $key;
+ } else {
+ if (length($key) == length($module_path)) {
+ $string = './';
+ } else {
+ $string = substr($key, length($module_path) + 1);
+ $string =~ s/\\/\//go;
+ };
+ };
+ $log_name = $string;
+ if ($log_name eq "$module $custom_job") {
+ $log_name = "custom_job";
+ };
+ if ($log_name eq "$module $pre_custom_job") {
+ $log_name = "pre_custom_job";
+ };
+ if ($log_name eq "$module $post_custom_job") {
+ $log_name = "post_custom_job";
+ };
+ $log_name =~ s/\\|\//\./g;
+ $log_name =~ s/\s/_/g;
+ $log_name = $module if ($log_name =~ /^\.+$/);
+ $log_name .= '.txt';
+ push(@possible_order, $key);
+ $jobs_hash{$key} = { SHORT_NAME => $string,
+ BUILD_NUMBER => $build_number,
+ STATUS => 'waiting',
+ LOG_PATH => '../' . $source_config->get_module_repository($module) . "/$module/$ENV{INPATH}/misc/logs/$log_name",
+ LONG_LOG_PATH => correct_path($module_paths{$module} . "/$ENV{INPATH}/misc/logs/$log_name"),
+ START_TIME => 0,
+ FINISH_TIME => 0,
+ CLIENT => '-'
+ };
+ };
+ remove_from_dependencies($key, \%deps_hash);
+ delete $deps_hash{$key};
+ $consistent++;
+ };
+ };
+ } while ($consistent && (scalar keys %deps_hash));
+ return \@possible_order if ($consistent);
+ print STDERR "Fatal error:";
+ foreach (keys %deps_hash) {
+ print STDERR "\n\t$_ depends on: ";
+ foreach my $i (keys %{$deps_hash{$_}}) {
+ print STDERR (' ', $i);
+ };
+ };
+ if ($child) {
+ my $oldfh = select STDERR;
+ $| = 1;
+ _do_exit(1);
+ } else {
+ print_error("There are dead or circular dependencies\n");
+ };
+};
+
+#
+# Find project with no dependencies left.
+#
+sub find_indep_prj {
+ my ($dependencies, $i);
+ my @candidates = ();
+ $all_dependent = 1;
+ handle_dead_children(0) if ($processes_to_run);
+ my $children = children_number();
+ return '' if (!$server_mode && $children && ($children >= $processes_to_run));
+ $dependencies = shift;
+ if (scalar keys %$dependencies) {
+ foreach my $job (keys %$dependencies) {
+ if (!scalar keys %{$$dependencies{$job}}) {
+ push(@candidates, $job);
+ last if (!$processes_to_run);
+ };
+ };
+ if (scalar @candidates) {
+ $all_dependent = 0;
+ my $best_candidate = undef;
+ my $best_weight = 0;
+ if (scalar @candidates > 1) {
+ foreach my $candidate (@candidates) {
+ my $candidate_weight = get_waiters_number($candidate);
+ if ($candidate_weight > $best_weight) {
+ $best_candidate = $candidate;
+ $best_weight = $candidate_weight;
+ };
+ };
+ if (defined $best_candidate) {
+ return $best_candidate;
+ }
+ }
+ my @sorted_candidates = sort(@candidates);
+ return $sorted_candidates[0];
+ };
+ };
+ return '';
+};
+
+sub get_waiters_number {
+ my $module = shift;
+ if (defined $weights_hash{$module}) {
+ return $weights_hash{$module};
+ };
+ if (defined $reversed_dependencies{$module}) {
+ return scalar keys %{$reversed_dependencies{$module}};
+ };
+ return 0;
+};
+
+#
+# Check if given entry is HASH-native, that is not a user-defined data
+#
+#sub IsHashNative {
+# my $prj = shift;
+# return 1 if ($prj =~ /^HASH\(0x[\d | a | b | c | d | e | f]{6,}\)/);
+# return 0;
+#};
+
+#
+# Getting array of dependencies from the string given
+#
+sub get_dependency_array {
+ my ($dep_string, @dependencies, $parent_prj, $prj, $string);
+ @dependencies = ();
+ $dep_string = shift;
+ $string = $dep_string;
+ $prj = shift;
+ while ($dep_string !~ /^NULL/o) {
+ print_error("Project $prj has wrongly written dependencies string:\n $string") if (!$dep_string);
+ $dep_string =~ /(\S+)\s*/o;
+ $parent_prj = $1;
+ $dep_string = $';
+ if ($parent_prj =~ /\.(\w+)$/o) {
+ $parent_prj = $`;
+ if (($prj_platform{$parent_prj} ne $1) &&
+ ($prj_platform{$parent_prj} ne 'all')) {
+ print_error ("$parent_prj\.$1 is a wrongly dependency identifier!\nCheck if it is platform dependent");
+ };
+ $alive_dependencies{$parent_prj}++ if (check_platform($1));
+ push(@dependencies, $parent_prj);
+ } else {
+ if ((exists($prj_platform{$parent_prj})) &&
+ ($prj_platform{$parent_prj} ne 'all') ) {
+ print_error("$parent_prj is a wrongly used dependency identifier!\nCheck if it is platform dependent");
+ };
+ push(@dependencies, $parent_prj);
+ };
+ };
+ return @dependencies;
+};
+
+
+#
+# Getting current directory list
+#
+sub get_directory_list {
+ my $path = shift;
+ opendir(CurrentDirList, $path);
+ my @directory_list = readdir(CurrentDirList);
+ closedir(CurrentDirList);
+ return @directory_list;
+};
+
+sub print_error {
+ my $message = shift;
+ my $force = shift;
+ $modules_number -= scalar keys %global_deps_hash;
+ $modules_number -= 1;
+ print STDERR "\nERROR: $message\n";
+ $ENV{mk_tmp} = '';
+ if ($cmd_file) {
+ close CMD_FILE;
+ unlink ($cmd_file);
+ };
+ if (!$child) {
+ $ENV{mk_tmp} = '';
+ close CMD_FILE if ($cmd_file);
+ unlink ($cmd_file);
+ do_exit(1);
+ };
+ do_exit(1) if (defined $force);
+};
+
+sub usage {
+ print STDERR "\nbuild\n";
+ print STDERR "Syntax: build [--all|-a[:prj_name]]|[--from|-f prj_name1[:prj_name2] [prj_name3 [...]]]|[--since|-c prj_name] [--with_branches prj_name1[:prj_name2] [--skip prj_name1[:prj_name2] [prj_name3 [...]] [prj_name3 [...]|-b]|[--prepare|-p][:platform] [--deliver|-d [--dlv_switch deliver_switch]]] [-P processes|--server [--setenvstring \"string\"] [--client_timeout MIN] [--port port1[:port2:...:portN]]] [--show|-s] [--help|-h] [--file|-F] [--ignore|-i] [--version|-V] [--mode|-m OOo[,SO[,EXT]] [--html [--html_path html_file_path] [--dontgraboutput]] [--pre_job=pre_job_sring] [--job=job_string|-j] [--post_job=post_job_sring] [--stoponerror] [--genconf [--removeall|--clear|--remove|--add [module1,module2[,...,moduleN]]]] [--exclude_branch_from prj_name1[:prj_name2] [prj_name3 [...]]] [--interactive]\n";
+ print STDERR "Example1: build --from sfx2\n";
+ print STDERR " - build all projects dependent from sfx2, starting with sfx2, finishing with the current module\n";
+ print STDERR "Example2: build --all:sfx2\n";
+ print STDERR " - the same as --all, but skip all projects that have been already built when using \"--all\" switch before sfx2\n";
+ print STDERR "Example3: build --all --server\n";
+ print STDERR " - build all projects in server mode, use first available port from default range 7890-7894 (running clients required!!)\n";
+ print STDERR "Example4(for unixes):\n";
+ print STDERR " build --all --pre_job=echo\\ Starting\\ job\\ in\\ \\\$PWD --job=some_script.sh --post_job=echo\\ Job\\ in\\ \\\$PWD\\ is\\ made\n";
+ print STDERR " - go through all projects, echo \"Starting job in \$PWD\" in each module, execute script some_script.sh, and finally echo \"Job in \$PWD is made\"\n";
+ print STDERR "\nSwitches:\n";
+ print STDERR " --all - build all projects from very beginning till current one\n";
+ print STDERR " --from - build all projects dependent from the specified (including it) till current one\n";
+ print STDERR " --exclude_branch_from - exclude module(s) and its branch from the build\n";
+ print STDERR " --mode OOo - build only projects needed for OpenOffice.org\n";
+ print STDERR " --prepare - clear all projects for incompatible build from prj_name till current one [for platform] (cws version)\n";
+ print STDERR " --with_branches- the same as \"--from\" but with build all projects in neighbour branches\n";
+ print STDERR " --skip - do not build certain module(s)\n";
+ print STDERR " --since - build all projects beginning from the specified till current one (the same as \"--all:prj_name\", but skipping prj_name)\n";
+ print STDERR " --checkmodules - check if all required parent projects are availlable\n";
+ print STDERR " --show - show what is going to be built\n";
+ print STDERR " --file - generate command file file_name\n";
+ print STDERR " --deliver - only deliver, no build (usable for \'-all\' and \'-from\' keys)\n";
+ print STDERR " -P - start multiprocessing build, with number of processes passed\n";
+ print STDERR " --server - start build in server mode (clients required)\n";
+ print STDERR " --setenvstring - string for configuration of the client environment\n";
+ print STDERR " --port - set server port, default is 7890. You may pass several ports, the server will be started on the first available\n";
+ print STDERR " otherwise the server will be started on first available port from the default range 7890-7894\n";
+ print STDERR " --client_timeout - time frame after which the client/job is considered to be lost. Default is 120 min\n";
+ print STDERR " --dlv_switch - use deliver with the switch specified\n";
+ print STDERR " --help - print help info\n";
+ print STDERR " --ignore - force tool to ignore errors\n";
+ print STDERR " --html - generate html page with build status\n";
+ print STDERR " file named $ENV{INPATH}.build.html will be generated in $ENV{SOLARSRC}\n";
+ print STDERR " --html_path - set html page path\n";
+ print STDERR " --dontgraboutput - do not grab console output when generating html page\n";
+ print STDERR " --genconf - generate/modify workspace configuration file\n";
+ print STDERR " --add - add active module(s) to configuration file\n";
+ print STDERR " --remove - removeactive modules(s) from configuration file\n";
+ print STDERR " --removeall|--clear - remove all active modules(s) from configuration file\n";
+
+ print STDERR " --stoponerror - stop build when error occurs (for mp builds)\n";
+ print STDERR " --interactive - start interactive build process (process can be managed via html page)\n";
+ print STDERR " Custom jobs:\n";
+ print STDERR " --job=job_string - execute custom job in (each) module. job_string is a shell script/command to be executed instead of regular dmake jobs\n";
+ print STDERR " --pre_job=pre_job_string - execute preliminary job in (each) module. pre_job_string is a shell script/command to be executed before regular job in the module\n";
+ print STDERR " --post_job=job_string - execute a postprocess job in (each) module. post_job_string is a shell script/command to be executed after regular job in the module\n";
+ print STDERR "Default: - build current project\n";
+ print STDERR "Unknown switches passed to dmake\n";
+};
+
+#
+# Get all options passed
+#
+sub get_options {
+ my ($arg, $dont_grab_output);
+ while ($arg = shift @ARGV) {
+ $arg =~ /^-P$/ and $processes_to_run = shift @ARGV and next;
+ $arg =~ /^-P(\d+)$/ and $processes_to_run = $1 and next;
+ $arg =~ /^--all$/ and $build_all_parents = 1 and next;
+ $arg =~ /^-a$/ and $build_all_parents = 1 and next;
+ $arg =~ /^--show$/ and $show = 1 and next;
+ $arg =~ /^--checkmodules$/ and $checkparents = 1 and $ignore = 1 and next;
+ $arg =~ /^-s$/ and $show = 1 and next;
+ $arg =~ /^--deliver$/ and $deliver = 1 and next;
+ $arg =~ /^(--job=)/ and $custom_job = $' and next;
+ $arg =~ /^(--pre_job=)/ and $pre_custom_job = $' and next;
+ $arg =~ /^(--post_job=)/ and $post_custom_job = $' and next;
+ $arg =~ /^-d$/ and $deliver = 1 and next;
+ $arg =~ /^--dlv_switch$/ and $dlv_switch = shift @ARGV and next;
+ $arg =~ /^--file$/ and $cmd_file = shift @ARGV and next;
+ $arg =~ /^-F$/ and $cmd_file = shift @ARGV and next;
+ $arg =~ /^--skip$/ and get_modules_passed(\%skip_modules) and next;
+
+ if ($arg =~ /^--with_branches$/ || $arg =~ /^-b$/) {
+ $build_from_with_branches = 1;
+ $build_all_parents = 1;
+ get_modules_passed(\%incompatibles);
+ next;
+ };
+ $arg =~ /^--all:(\S+)$/ and $build_all_parents = 1
+ and $build_all_cont = $1 and next;
+ $arg =~ /^-a:(\S+)$/ and $build_all_parents = 1
+ and $build_all_cont = $1 and next;
+ if ($arg =~ /^--from$/ || $arg =~ /^-f$/) {
+ $build_all_parents = 1;
+ get_modules_passed(\%incompatibles);
+ next;
+ };
+ if ($arg =~ /^--exclude_branch_from$/) {
+ get_modules_passed(\%exclude_branches);
+ next;
+ };
+ $arg =~ /^--prepare$/ and $prepare = 1 and next;
+ $arg =~ /^-p$/ and $prepare = 1 and next;
+ $arg =~ /^--prepare:/ and $prepare = 1 and $only_platform = $' and next;
+ $arg =~ /^-p:/ and $prepare = 1 and $only_platform = $' and next;
+ $arg =~ /^--since$/ and $build_all_parents = 1
+ and $build_since = shift @ARGV and next;
+ $arg =~ /^-c$/ and $build_all_parents = 1
+ and $build_since = shift @ARGV and next;
+ $arg =~ /^-s$/ and $build_all_parents = 1
+ and $build_since = shift @ARGV and next;
+ $arg =~ /^--help$/ and usage() and do_exit(0);
+ $arg =~ /^-h$/ and usage() and do_exit(0);
+ $arg =~ /^--ignore$/ and $ignore = 1 and next;
+ $arg =~ /^--genconf$/ and $generate_config = 1 and next;
+ if ($arg =~ /^--add$/) {
+ get_list_of_modules(\%add_to_config);
+ next;
+ };
+ if ($arg =~ /^--remove$/) {
+ get_list_of_modules(\%remove_from_config);
+ if (!scalar %remove_from_config) {
+ print_error('No module list supplied!!');
+ };
+ next;
+ };
+ ($arg =~ /^--clear$/ || $arg =~ /^--removeall$/) and $clear_config = 1 and next;
+ $arg =~ /^--html$/ and $html = 1 and next;
+ $arg =~ /^--dontgraboutput$/ and $dont_grab_output = 1 and next;
+ $arg =~ /^--html_path$/ and $html_path = shift @ARGV and next;
+ $arg =~ /^-i$/ and $ignore = 1 and next;
+ $arg =~ /^--server$/ and $server_mode = 1 and next;
+ $arg =~ /^--client_timeout$/ and $client_timeout = (shift @ARGV)*60 and next;
+ $arg =~ /^--setenvstring$/ and $setenv_string = shift @ARGV and next;
+ $arg =~ /^--port$/ and $ports_string = shift @ARGV and next;
+ $arg =~ /^--version$/ and do_exit(0);
+ $arg =~ /^-V$/ and do_exit(0);
+ $arg =~ /^-m$/ and get_modes() and next;
+ $arg =~ /^--mode$/ and get_modes() and next;
+ $arg =~ /^--stoponerror$/ and $stop_build_on_error = 1 and next;
+ $arg =~ /^--interactive$/ and $interactive = 1 and next;
+ if ($arg =~ /^--$/) {
+ push (@dmake_args, get_dmake_args()) if (!$custom_job);
+ next;
+ };
+ push (@dmake_args, $arg);
+ };
+ if (!$html) {
+ print_error("\"--html_path\" switch is used only with \"--html\"") if ($html_path);
+ print_error("\"--dontgraboutput\" switch is used only with \"--html\"") if ($dont_grab_output);
+ };
+ if ((scalar keys %exclude_branches) && !$build_all_parents) {
+ print_error("\"--exclude_branch_from\" is not applicable for one module builds!!");
+ };
+ $grab_output = 0 if ($dont_grab_output);
+ print_error('Switches --with_branches and --all collision') if ($build_from_with_branches && $build_all_cont);
+ print_error('Switch --skip is for building multiple modules only!!') if ((scalar keys %skip_modules) && (!$build_all_parents));
+# print_error('Please prepare the workspace on one of UNIX platforms') if ($prepare && ($ENV{GUI} ne 'UNX'));
+ print_error('Switches --with_branches and --since collision') if ($build_from_with_branches && $build_since);
+ if ($show) {
+ $processes_to_run = 0;
+ $cmd_file = '';
+ };
+ print_error('Switches --job and --deliver collision') if ($custom_job && $deliver);
+ $custom_job = 'deliver' if $deliver;
+ $post_job = 'deliver' if (!$custom_job);
+ $incompatible = scalar keys %incompatibles;
+ if ($prepare) {
+ print_error("--prepare is for use with --from switch only!\n") if (!$incompatible);
+ };
+ if ($processes_to_run) {
+ if ($ignore && !$html) {
+ print_error("Cannot ignore errors in multiprocessing build");
+ };
+ if (!$enable_multiprocessing) {
+ print_error("Cannot load Win32::Process module for multiprocessing build");
+ };
+ if ($server_mode) {
+ print_error("Switches -P and --server collision");
+ };
+ } elsif ($stop_build_on_error) {
+ print_error("Switch --stoponerror is only for multiprocessing builds");
+ };
+ if ($server_mode) {
+ $html++;
+ $client_timeout = 60 * 60 * 2 if (!$client_timeout);
+ } else {
+ print_error("--ports switch is for server mode only!!") if ($ports_string);
+ print_error("--setenvstring switch is for server mode only!!") if ($setenv_string);
+ print_error("--client_timeout switch is for server mode only!!") if ($client_timeout);
+ };
+
+ if (!$generate_config) {
+ my $error_message = ' switch(es) should be used only with "--genconf"';
+ print_error('"--removeall" ("--clear")' . $error_message) if ($clear_config);
+ if ((scalar %add_to_config) || (scalar %remove_from_config)) {
+ print_error('"--add" or/and "--remove"' . $error_message);
+ };
+ } elsif ((!scalar %add_to_config) && !$clear_config && (!scalar %remove_from_config) && !$build_all_parents){
+ print_error('Please supply necessary switch for "--genconf" (--add|--remove|--removeall). --add can be used with --from and such');
+ };
+
+ if ($only_platform) {
+ $only_common = 'common';
+ $only_common .= '.pro' if ($only_platform =~ /\.pro$/);
+ };
+ if ($interactive) {
+ $html++; # enable html page generation...
+ my $local_host_name = hostname();
+ $local_host_ip = inet_ntoa(scalar(gethostbyname($local_host_name)) || 'localhost');
+ }
+ # Default build modes(for OpenOffice.org)
+ $ENV{BUILD_TYPE} = 'OOo EXT' if (!defined $ENV{BUILD_TYPE});
+ @ARGV = @dmake_args;
+ foreach $arg (@dmake_args) {
+ $arg =~ /^verbose=(\S+)$/i and $verbose_mode = ($1 =~ /^t\S*$/i);
+ }
+};
+
+sub get_module_and_buildlist_paths {
+ if ($build_all_parents || $checkparents) {
+ $source_config_file = $source_config->get_config_file_path();
+ $active_modules{$_}++ foreach ($source_config->get_active_modules());
+ my %active_modules_copy = %active_modules;
+ foreach ($source_config->get_all_modules()) {
+ delete $active_modules_copy{$_} if defined($active_modules_copy{$_});
+ next if ($_ eq $initial_module);
+ $module_paths{$_} = $source_config->get_module_path($_);
+ $build_list_paths{$_} = $source_config->get_module_build_list($_)
+ }
+ $dead_parents{$_}++ foreach (keys %active_modules_copy);
+ };
+};
+
+
+sub get_dmake_args {
+ my $arg;
+ my @job_args = ();
+ while ($arg = shift @ARGV) {
+ next if ($arg =~ /^--$/);
+ push (@job_args, $arg);
+ };
+ return @job_args;
+};
+
+#
+# get all options without '-'
+#
+sub get_switch_options {
+ my $string = '';
+ my $option = '';
+ while ($option = shift @ARGV) {
+ if (!($option =~ /^-+/)) {
+ $string .= '-' . $option;
+ $string .= ' ';
+ } else {
+ unshift(@ARGV, $option);
+ last;
+ };
+ };
+ $string =~ s/\s$//;
+ return $string;
+};
+
+#
+# cancel build when one of children has error exit code
+#
+sub cancel_build {
+# close_server_socket();
+ my $broken_modules_number = scalar @broken_module_names;
+ my $message_part = 'build ';
+ if (scalar keys %incompatibles) {
+ my @incompatible_modules = keys %incompatibles;
+ if ($stop_build_on_error) {
+ $message_part .= "--from @incompatible_modules:@broken_module_names\n";
+ } else {
+ $message_part .= "--from @broken_module_names\n";
+ };
+ } else {
+ if ($processes_to_run) {
+ $message_part .= "--from ";
+ } else {
+ $message_part .= "--all:";
+ };
+ $message_part .= "@broken_module_names\n";
+
+ };
+ if ($broken_modules_number && $build_all_parents) {
+ print STDERR "\n";
+ print STDERR $broken_modules_number;
+ print STDERR " module(s): ";
+ foreach (@broken_module_names) {
+ print STDERR "\n\t$_";
+ };
+ print STDERR "\nneed(s) to be rebuilt\n\nReason(s):\n\n";
+ foreach (keys %broken_build) {
+ print STDERR "ERROR: error " . $broken_build{$_} . " occurred while making $_\n";
+ };
+ print STDERR "\nAttention: if you fix the errors in above module(s) you may prolongue your the build issuing command:\n\n\t" . $message_part;
+ } else {
+ while (children_number()) {
+ handle_dead_children(1);
+ }
+ foreach (keys %broken_build) {
+ print STDERR "ERROR: error " . $broken_build{$_} . " occurred while making $_\n";
+ };
+ };
+ print "\n";
+ do_exit(1);
+};
+
+#
+# Function for storing errors in multiprocessing AllParents build
+#
+sub store_error {
+ my ($pid, $error_code) = @_;
+ return 0 if (!$error_code);
+ my $child_nick = $processes_hash{$pid};
+ if ($ENV{GUI} eq 'WNT') {
+ if (!defined $had_error{$child_nick}) {
+ $had_error{$child_nick}++;
+ return 1;
+ };
+ };
+ $modules_with_errors{$folders_hashes{$child_nick}}++;
+ $broken_build{$child_nick} = $error_code;
+ if ($stop_build_on_error) {
+ clear_from_child($pid);
+ # Let all children finish their work
+ while (children_number()) {
+ handle_dead_children(1);
+ };
+ cancel_build();
+ };
+ return 0;
+};
+
+#
+# child handler (clears (or stores info about) the terminated child)
+#
+sub handle_dead_children {
+ my $running_children = children_number();
+ return if (!$running_children);
+ my $force_wait = shift;
+ my $try_once_more = 0;
+ do {
+ my $pid = 0;
+ if (children_number() >= $processes_to_run ||
+ ($force_wait && ($running_children == children_number()))) {
+ $pid = wait();
+ } else {
+ $pid = waitpid( -1, &WNOHANG);
+ };
+ if ($pid > 0) {
+ $try_once_more = store_error($pid, $?);
+ if ($try_once_more) {
+ give_second_chance($pid);
+ } else {
+ clear_from_child($pid);
+ };
+ $finisched_children++;
+ };
+ } while(children_number() >= $processes_to_run);
+};
+
+sub give_second_chance {
+ my $pid = shift;
+ # A malicious hack for misterious windows problems - try 2 times
+ # to run dmake in the same directory if errors occurs
+ my $child_nick = $processes_hash{$pid};
+ $running_children{$folders_hashes{$child_nick}}--;
+ delete $processes_hash{$pid};
+ start_child($child_nick, $folders_hashes{$child_nick});
+};
+
+sub clear_from_child {
+ my $pid = shift;
+ my $child_nick = $processes_hash{$pid};
+ my $error_code = 0;
+ if (defined $broken_build{$child_nick}) {
+ $error_code = $broken_build{$child_nick};
+ } else {
+ remove_from_dependencies($child_nick,
+ $folders_hashes{$child_nick});
+ };
+ foreach (keys %module_deps_hash_pids) {
+ delete ${$module_deps_hash_pids{$_}}{$pid} if defined (${$module_deps_hash_pids{$_}}{$pid});
+ };
+ my $module = $module_by_hash{$folders_hashes{$child_nick}};
+ html_store_job_info($folders_hashes{$child_nick}, $child_nick, $error_code);
+ $running_children{$folders_hashes{$child_nick}}--;
+ delete $processes_hash{$pid};
+ $verbose_mode && print 'Running processes: ' . children_number() . "\n";
+};
+
+#
+# Build the entire project according to queue of dependencies
+#
+sub build_dependent {
+ $dependencies_hash = shift;
+ my $pid = 0;
+ my $child_nick = '';
+ $running_children{$dependencies_hash} = 0 if (!defined $running_children{$dependencies_hash});
+ while ($child_nick = pick_prj_to_build($dependencies_hash)) {
+ if ($processes_to_run) {
+ do {
+ if (defined $modules_with_errors{$dependencies_hash} && !$ignore) {
+ return 0 if ($build_all_parents);
+ last;
+ };
+ # start current child & all
+ # that could be started now
+ if ($child_nick) {
+ start_child($child_nick, $dependencies_hash);
+ return 1 if ($build_all_parents);
+ } else {
+ return 0 if ($build_all_parents);
+ if (scalar keys %$dependencies_hash) {
+ handle_dead_children(1);
+ };
+ };
+ $child_nick = pick_prj_to_build($dependencies_hash);
+ } while (scalar keys %$dependencies_hash || $child_nick);
+ while (children_number()) {
+ handle_dead_children(1);
+ };
+
+ if (defined $modules_with_errors{$dependencies_hash}) {
+ cancel_build();
+ }
+ mp_success_exit();
+ } else {
+ if (dmake_dir($child_nick)) {
+ push(@broken_module_names, $module_by_hash{$dependencies_hash});
+ cancel_build();
+ };
+ };
+ $child_nick = '';
+ };
+};
+
+sub children_number {
+ return scalar keys %processes_hash;
+};
+
+sub start_child {
+ my ($job_dir, $dependencies_hash) = @_;
+ $jobs_hash{$job_dir}->{START_TIME} = time();
+ $jobs_hash{$job_dir}->{STATUS} = 'building';
+ if ($job_dir =~ /(\s)/o) {
+ my $error_code = undef;
+ if ($job_dir !~ /\sdeliver$/o) {
+ $error_code = do_custom_job($job_dir, $dependencies_hash);
+ return;
+ }
+ };
+ $build_in_progress{$module_by_hash{$dependencies_hash}}++;
+ html_store_job_info($dependencies_hash, $job_dir);
+ my $pid = undef;
+ my $children_running;
+ my $oldfh = select STDOUT;
+ $| = 1;
+ if ($pid = fork) { # parent
+ select $oldfh;
+ $processes_hash{$pid} = $job_dir;
+ $children_running = children_number();
+ $verbose_mode && print 'Running processes: ', $children_running, "\n";
+ $maximal_processes = $children_running if ($children_running > $maximal_processes);
+ $folders_hashes{$job_dir} = $dependencies_hash;
+ store_pid($dependencies_hash, $pid);
+ $running_children{$dependencies_hash}++;
+ } elsif (defined $pid) { # child
+ select $oldfh;
+ $child = 1;
+ dmake_dir($job_dir);
+ do_exit(1);
+ };
+};
+
+sub store_pid {
+ my ($deps_hash, $pid) = @_;
+ if (!defined $module_deps_hash_pids{$deps_hash}) {
+ my %module_hash_pids = ();
+ $module_deps_hash_pids{$deps_hash} = \%module_hash_pids;
+ };
+ ${$module_deps_hash_pids{$deps_hash}}{$pid}++;
+};
+
+#
+# Build everything that should be built multiprocessing version
+#
+sub build_multiprocessing {
+ my $prj;
+ do {
+ my $got_module = 0;
+ $finisched_children = 0;
+ while ($prj = pick_prj_to_build(\%global_deps_hash)) {
+ if (!defined $projects_deps_hash{$prj}) {
+ $projects_deps_hash{$prj} = {};
+ get_module_dep_hash($prj, $projects_deps_hash{$prj});
+ my $info_hash = $html_info{$prj};
+ $$info_hash{DIRS} = check_deps_hash($projects_deps_hash{$prj}, $prj);
+ $module_by_hash{$projects_deps_hash{$prj}} = $prj;
+ }
+ $module_build_queue{$prj}++;
+ $got_module++;
+ };
+ if (!$got_module) {
+ cancel_build() if ((!scalar keys %module_build_queue) && !children_number());
+ if (!$finisched_children) {
+# print "#### 1979: Starting waiting for dead child\n";
+ handle_dead_children(1);
+ };
+ };
+ build_actual_queue(\%module_build_queue);
+ } while (scalar keys %global_deps_hash);
+ # Let the last module be built till the end
+ while (scalar keys %module_build_queue) {
+ build_actual_queue(\%module_build_queue);
+# print "#### 1988: Starting waiting for dead child\n";
+ handle_dead_children(1);
+ };
+ # Let all children finish their work
+ while (children_number()) {
+ handle_dead_children(1);
+ };
+ cancel_build() if (scalar keys %broken_build);
+ mp_success_exit();
+};
+
+sub mp_success_exit {
+# close_server_socket();
+# if (!$custom_job && $post_custom_job) {
+# do_post_custom_job(correct_path($workspace_path.$initial_module));
+# };
+ print "\nMultiprocessing build is finished\n";
+ print "Maximal number of processes run: $maximal_processes\n";
+ do_exit(0);
+};
+
+#
+# Here the built queue is built as long as possible
+#
+sub build_actual_queue {
+ my $build_queue = shift;
+ my $finished_projects = 0;
+ do {
+ my @sorted_queue = sort {(scalar keys %{$projects_deps_hash{$a}}) <=> (scalar keys %{$projects_deps_hash{$b}})} keys %$build_queue;
+ my $started_children = 0;
+ foreach my $prj (keys %$build_queue) {
+ get_html_orders();
+ if ($reschedule_queue) {
+ $reschedule_queue = 0;
+ foreach (keys %$build_queue) {
+ # Remove the module from the build queue if there is a dependency emerged
+ if ((defined $global_deps_hash{$_}) && (scalar keys %{$global_deps_hash{$_}})) {
+ delete $$build_queue{$_};
+ };
+ delete $$build_queue{$_} if (!defined $global_deps_hash_backup{$_})
+ };
+ return;
+ };
+ if (defined $modules_with_errors{$projects_deps_hash{$prj}} && !$ignore) {
+ push (@broken_module_names, $prj);
+ delete $$build_queue{$prj};
+ next;
+ };
+ $started_children += build_dependent($projects_deps_hash{$prj});
+ if ((!scalar keys %{$projects_deps_hash{$prj}}) &&
+ !$running_children{$projects_deps_hash{$prj}}) {
+ if (!defined $modules_with_errors{$projects_deps_hash{$prj}} || $ignore)
+ {
+ remove_from_dependencies($prj, \%global_deps_hash);
+ $build_is_finished{$prj}++;
+ delete $$build_queue{$prj};
+ $finished_projects++;
+ };
+ };
+ };
+ # trigger wait
+ if (!$started_children) {
+ if ($finished_projects) {
+ return;
+ } else {
+ handle_dead_children(1);
+ };
+ };
+ } while (scalar keys %$build_queue);
+};
+
+sub run_job {
+ my ($job, $path, $registered_name) = @_;
+ my $job_to_do = $job;
+ my $error_code = 0;
+ print "$registered_name\n";
+ return 0 if ( $show );
+ $job_to_do = $deliver_command if ($job eq 'deliver');
+ $registered_name = $path if (!defined $registered_name);
+ chdir $path;
+ getcwd();
+
+ if ($html) {
+ my $log_file = $jobs_hash{$registered_name}->{LONG_LOG_PATH};
+ my $log_dir = File::Basename::dirname($log_file);
+ if (!-d $log_dir) {
+ system("$perl $mkout");
+ };
+ $error_code = system ("$job_to_do > $log_file 2>&1");
+ if (!$grab_output && -f $log_file) {
+ system("cat $log_file");
+ };
+ } else {
+ $error_code = system ("$job_to_do");
+ };
+ return $error_code;
+};
+
+sub do_custom_job {
+ my ($module_job, $dependencies_hash) = @_;
+ $module_job =~ /(\s)/o;
+ my $module = $`;
+ my $job = $';
+ html_store_job_info($dependencies_hash, $module_job);
+ my $error_code = 0;
+ if ($job eq $pre_job) {
+ announce_module($module);
+# html_store_job_info($dependencies_hash, $job_dir);
+ remove_from_dependencies($module_job, $dependencies_hash);
+ } else {
+ $error_code = run_job($job, $module_paths{$module}, $module_job);
+ if ($error_code) {
+ # give windows one more chance
+ if ($ENV{GUI} eq 'WNT') {
+ $error_code = run_job($job, $module_paths{$module}, $module_job);
+ };
+ };
+ if ($error_code) {
+ $modules_with_errors{$dependencies_hash}++;
+# $broken_build{$module_job} = $error_code;
+ } else {
+ remove_from_dependencies($module_job, $dependencies_hash);
+ };
+ };
+ html_store_job_info($dependencies_hash, $module_job, $error_code);
+ return $error_code;
+};
+
+#
+# Print announcement for module just started
+#
+sub announce_module {
+ my $prj = shift;
+ $build_in_progress{$prj}++;
+ print_announce($prj);
+};
+
+sub print_announce {
+ my $prj = shift;
+ return if (defined $module_announced{$prj});
+ my $prj_type = '';
+ $prj_type = $modules_types{$prj} if (defined $modules_types{$prj});
+ my $text;
+ if ($prj_type eq 'lnk') {
+ if (!defined $active_modules{$prj}) {
+ $text = "Skipping module $prj\n";
+ } else {
+ $text = "Skipping link to $prj\n";
+ };
+ $build_is_finished{$prj}++;
+ } elsif ($prj_type eq 'img') {
+ $text = "Skipping incomplete $prj\n";
+ $build_is_finished{$prj}++;
+ } elsif ($custom_job) {
+ $text = "Running custom job \"$custom_job\" in module $prj\n";
+ } else {
+ $text = "Building module $prj\n";
+ };
+ my $announce_string = $new_line;
+ $announce_string .= $echo . "=============\n";
+ $announce_string .= $echo . $text;
+ $announce_string .= $echo . "=============\n";
+ print $announce_string;
+ $module_announced{$prj}++;
+};
+
+sub are_all_dependent {
+ my $build_queue = shift;
+ my $folder = '';
+ my $first_candidate = undef;
+ foreach my $prj (keys %$build_queue) {
+ $folder = find_indep_prj($projects_deps_hash{$prj});
+ $first_candidate = $folder if (!defined $first_candidate);
+ };
+ $folder = $first_candidate;
+ return '' if ($first_candidate);
+ return '1';
+};
+
+
+#
+# Procedure defines if the local directory is a
+# complete module, an image or a link
+# return values: lnk link
+# img incomplete (image)
+# mod complete (module)
+#
+sub modules_classify {
+ my @modules = @_;
+ foreach my $module (sort @modules) {
+ if (!defined $module_paths{$module}) {
+ $modules_types{$module} = 'img';
+ next;
+ };
+ if (( $module_paths{$module} =~ /\.lnk$/) || ($module_paths{$module} =~ /\.link$/)
+ || (!defined $active_modules{$module})) {
+ $modules_types{$module} = 'lnk';
+ next;
+ };
+ $modules_types{$module} = 'mod';
+ };
+};
+
+#
+# This procedure provides consistency for cws
+# and optimized build (ie in case of --with_branches, -all:prj_name
+# and -since switches)
+#
+sub provide_consistency {
+ check_dir();
+ foreach my $var_ref (\$build_all_cont, \$build_since) {
+ if ($$var_ref) {
+ return if (defined $module_paths{$$var_ref});
+ print_error("Cannot find module '$$var_ref'", 9);
+ return;
+ };
+ };
+};
+
+#
+# Get the workspace list ('stand.lst'), either from 'localini'
+# or, if this is not possible, from 'globalini.
+# (Heiner's proprietary :)
+#
+sub get_workspace_lst
+{
+ my $home = $ENV{HOME};
+ my $inifile = $ENV{HOME}. '/localini/stand.lst';
+ if (-f $inifile) {
+ return $inifile;
+ };
+ return '';
+}
+
+#
+# Procedure clears up module for incompatible build
+#
+sub ensure_clear_module {
+ my $module = shift;
+ if ($modules_types{$module} eq 'mod') {
+ clear_module($module);
+ return;
+ };
+ if ($modules_types{$module} eq 'lnk' && (File::Basename::basename($module_paths{$module}) ne $module)) {
+ if(rename($module_paths{$module}, File::Basename::dirname($module_paths{$module}) ."/$module")) {
+ $module_paths{$module} = File::Basename::dirname($module_paths{$module}) ."/$module";
+ clear_module($module);
+ } else {
+ print_error("Cannot rename link to $module. Please rename it manually");
+ };
+ };
+};
+
+#
+# Procedure removes output tree from the module (without common trees)
+#
+sub clear_module {
+ my $module = shift;
+ print "Removing module's $module output trees...\n";
+ print "\n" and return if ($show);
+ opendir DIRHANDLE, $module_paths{$module};
+ my @dir_content = readdir(DIRHANDLE);
+ closedir(DIRHANDLE);
+ foreach (@dir_content) {
+ next if (/^\.+$/);
+ my $dir = correct_path($module_paths{$module}.'/'.$_);
+ if ((!-d $dir.'/.svn') && is_output_tree($dir)) {
+ #print "I would delete $dir\n";
+ rmtree("$dir", 0, 1);
+ if (-d $dir) {
+ system("$remove_command $dir");
+ if (-d $dir) {
+ push(@warnings, "Cannot delete $dir");
+#print_error("Cannot delete $dir");
+ } else {
+ print STDERR (">>> Removed $dir by force\n");
+ };
+ };
+ };
+ };
+};
+
+#
+# Figure out if the directory is an output tree
+#
+sub is_output_tree {
+ my $dir = shift;
+ $dir =~ /([\w\d\.]+)$/;
+ $_ = $1;
+ return '1' if (defined $platforms{$_});
+ if ($only_common) {
+ return '1' if ($_ eq $only_common);
+ } else {
+ if (scalar keys %platforms < scalar keys %platforms_to_copy) {
+ return '';
+ };
+ return '1' if (/^common$/);
+ return '1' if (/^common\.pro$/);
+ };
+ return '';
+};
+sub get_tmp_dir {
+ my $tmp_dir;
+ if( defined($ENV{TMPDIR}) ) {
+ $tmp_dir = $ENV{TMPDIR} . '/';
+ } elsif( defined($ENV{TMP}) ) {
+ $tmp_dir = $ENV{TMP} . '/';
+ } else {
+ $tmp_dir = '/tmp/';
+ }
+ $tmp_dir = tempdir ( DIR => $tmp_dir );
+ if (!-d $tmp_dir) {
+ print_error("Cannot create temporary directory for checkout in $tmp_dir") if ($@);
+ };
+ return $tmp_dir;
+};
+
+sub retrieve_build_list {
+ my $module = shift;
+ my $old_fh = select(STDOUT);
+
+ # Try to get global depencies from solver's build.lst if such exists
+ my $solver_inc_dir = "$ENV{SOLARVER}/common";
+ $solver_inc_dir .= $ENV{PROEXT} if (defined $ENV{PROEXT});
+ $solver_inc_dir .= '/inc';
+ $solver_inc_dir .= $ENV{UPDMINOREXT} if (defined $ENV{UPDMINOREXT});
+ $solver_inc_dir .= "/$module";
+ $solver_inc_dir = correct_path($solver_inc_dir);
+ $dead_parents{$module}++;
+ print "Fetching dependencies for module $module from solver...";
+ foreach (@possible_build_lists) {
+ my $possible_build_lst = "$solver_inc_dir/$_";
+ if (-e $possible_build_lst) {
+ print " ok\n";
+ select($old_fh);
+ return $possible_build_lst;
+ };
+ }
+ print " failed\n";
+
+ if (!defined $dead_parents{$module}) {
+ print "WARNING: Cannot figure out CWS for $module. Forgot to set CWS?\n";
+ }
+ select($old_fh);
+ return undef;
+};
+
+sub fix_permissions {
+ my $file = $File::Find::name;
+ return unless -f $file;
+ chmod '0664', $file;
+};
+
+sub prepare_build_from_with_branches {
+ my ($full_deps_hash, $reversed_full_deps_hash) = @_;
+ foreach my $prerequisite (keys %$full_deps_hash) {
+ foreach my $dependent_module (keys %incompatibles) {
+ if (defined ${$$reversed_full_deps_hash{$prerequisite}}{$dependent_module}) {
+ remove_from_dependencies($prerequisite, $full_deps_hash);
+ delete $$full_deps_hash{$prerequisite};
+# print "Removed $prerequisite\n";
+ last;
+ };
+ };
+ };
+};
+
+#
+# Removes projects which it is not necessary to build
+# in incompatible build
+#
+sub prepare_incompatible_build {
+ my ($prj, $deps_hash, @missing_modules);
+ $deps_hash = shift;
+ foreach my $module (keys %incompatibles) {
+ if (!defined $$deps_hash{$module}) {
+ print_error("The module $initial_module is independent from $module\n");
+ }
+ $incompatibles{$module} = $$deps_hash{$module};
+ delete $$deps_hash{$module};
+ }
+ while ($prj = pick_prj_to_build($deps_hash)) {
+ remove_from_dependencies($prj, $deps_hash);
+ remove_from_dependencies($prj, \%incompatibles);
+ };
+ foreach (keys %incompatibles) {
+ $$deps_hash{$_} = $incompatibles{$_};
+ };
+ if ($build_all_cont) {
+ prepare_build_all_cont($deps_hash);
+ delete $$deps_hash{$build_all_cont};
+ };
+ @modules_built = keys %$deps_hash;
+ %add_to_config = %$deps_hash;
+ if ($prepare) {
+ if ((!(defined $ENV{UPDATER} && (!defined $ENV{CWS_WORK_STAMP}))) || (defined $ENV{CWS_WORK_STAMP})) {
+ $source_config->add_active_modules([keys %add_to_config], 0);
+ }
+ clear_delivered();
+ }
+ my $old_output_tree = '';
+ foreach $prj (sort keys %$deps_hash) {
+ if ($prepare) {
+ ensure_clear_module($prj);
+ } else {
+ next if ($show);
+ if ($modules_types{$prj} ne 'mod') {
+ push(@missing_modules, $prj);
+ } elsif (-d $module_paths{$prj}. '/'. $ENV{INPATH}) {
+ $old_output_tree++;
+ };
+ };
+ };
+ if (scalar @missing_modules) {
+ my $warning_string = 'Following modules are inconsistent/missing: ' . "@missing_modules";
+ push(@warnings, $warning_string);
+ };
+ if ($build_all_cont) {
+ $$deps_hash{$build_all_cont} = ();
+ $build_all_cont = '';
+ };
+ if ($old_output_tree) {
+ push(@warnings, 'Some module(s) contain old output tree(s)!');
+ };
+ if (!$generate_config && scalar @warnings) {
+ print "WARNING(S):\n";
+ print STDERR "$_\n" foreach (@warnings);
+ print "\nATTENTION: If you are performing an incompatible build, please break the build with Ctrl+C and prepare the workspace with \"--prepare\" switch!\n\n" if (!$prepare);
+ sleep(10);
+ };
+ if ($prepare) {
+ print "\nPreparation finished";
+ if (scalar @warnings) {
+ print " with WARNINGS!!\n\n";
+ } else {print " successfully\n\n";}
+ }
+ do_exit(0) if ($prepare);
+};
+
+#
+# Removes projects which it is not necessary to build
+# with --all:prj_name or --since switch
+#
+sub prepare_build_all_cont {
+ my ($prj, $deps_hash, $border_prj);
+ $deps_hash = shift;
+ $border_prj = $build_all_cont if ($build_all_cont);
+ $border_prj = $build_since if ($build_since);
+ while ($prj = pick_prj_to_build($deps_hash)) {
+ my $orig_prj = '';
+ $orig_prj = $` if ($prj =~ /\.lnk$/o);
+ $orig_prj = $` if ($prj =~ /\.link$/o);
+ if (($border_prj ne $prj) &&
+ ($border_prj ne $orig_prj)) {
+ remove_from_dependencies($prj, $deps_hash);
+ next;
+ } else {
+ if ($build_all_cont) {
+ $$deps_hash{$prj} = ();
+ } else {
+ remove_from_dependencies($prj, $deps_hash);
+ };
+ return;
+ };
+ };
+};
+
+sub get_modes {
+ my $option = '';
+ while ($option = shift @ARGV) {
+ if ($option =~ /^-+/) {
+ unshift(@ARGV, $option);
+ return;
+ } else {
+ if ($option =~ /,/) {
+ $build_modes{$`}++;
+ unshift(@ARGV, $') if ($');
+ } else {$build_modes{$option}++;};
+ };
+ };
+ $build_modes{$option}++;
+};
+
+sub get_list_of_modules {
+ my $option = '';
+ my $hash_ref = shift;
+ while ($option = shift @ARGV) {
+ if ($option =~ /^-+/) {
+ unshift(@ARGV, $option);
+ return;
+ } else {
+ if ($option =~ /,/) {
+ foreach (split /,/, $option) {
+ next if (!$_);
+ $$hash_ref{$_}++;
+ };
+ } else {
+ $$hash_ref{$option}++;
+ };
+ };
+ };
+# if (!scalar %$hash_ref) {
+# print_error('No module list supplied!!');
+# };
+};
+
+sub get_modules_passed {
+ my $hash_ref = shift;
+ my $option = '';
+ while ($option = shift @ARGV) {
+ if ($option =~ /^-+/) {
+ unshift(@ARGV, $option);
+ return;
+ } else {
+ if ($option =~ /(:)/) {
+ $option = $`;
+ print_error("\'--from\' switch collision") if ($build_all_cont);
+ $build_all_cont = $';
+ };
+ $$hash_ref{$option}++;
+ };
+ };
+};
+
+sub get_workspace_platforms {
+ my $workspace_patforms = shift;
+ my $solver_path = $ENV{SOLARVERSION};
+ opendir(SOLVERDIR, $solver_path);
+ my @dir_list = readdir(SOLVERDIR);
+ close SOLVERDIR;
+ foreach (@dir_list) {
+ next if /^common/;
+ next if /^\./;
+ if (open(LS, "ls $solver_path/$_/inc/*minor.mk 2>$nul |")) {
+ foreach my $string (<LS>) {
+ chomp $string;
+ if ($string =~ /minor.mk$/) {
+ $$workspace_patforms{$_}++
+ };
+ };
+ close LS;
+ };
+ };
+};
+
+sub get_platforms {
+ my $platforms_ref = shift;
+ if ($only_platform) {
+ foreach (split(',', $only_platform)) {
+ $$platforms_ref{$_}++;
+ }
+ $platforms_ref = \%platforms_to_copy;
+ };
+
+ my $workspace_lst = get_workspace_lst();
+ if ($workspace_lst) {
+ my $workspace_db;
+ eval { $workspace_db = GenInfoParser->new(); };
+ if (!$@) {
+ my $success = $workspace_db->load_list($workspace_lst);
+ if ( !$success ) {
+ print_error("Can't load workspace list '$workspace_lst'.", 4);
+ }
+ my $access_path = $ENV{WORK_STAMP} . '/Environments';
+ my @platforms_available = $workspace_db->get_keys($access_path);
+ my $solver = $ENV{SOLARVERSION};
+ foreach (@platforms_available) {
+ my $s_path = $solver . '/' . $_;
+ $$platforms_ref{$_}++ if (-d $s_path);
+ };
+ } else {
+ get_workspace_platforms(\%platforms);
+ };
+ };
+
+ if (!scalar keys %platforms) {
+ # An Auses wish - fallback to INPATH for new platforms
+ if (defined $ENV{INPATH}) {
+ $$platforms_ref{$ENV{INPATH}}++;
+ } else {
+ print_error("There is no platform found!!") ;
+ };
+ };
+};
+
+#
+# This procedure clears solver from delivered
+# by the modules to be build
+#
+sub clear_delivered {
+ my $message = 'Clearing up delivered';
+ my %backup_vars;
+ my $deliver_delete_switches = '-delete';
+ if (scalar keys %platforms < scalar keys %platforms_to_copy) {
+ $message .= ' without common trees';
+ $deliver_delete_switches .= ' -dontdeletecommon';
+ $only_common = '';
+ };
+ print "$message\n";
+
+ foreach my $platform (keys %platforms) {
+ print "\nRemoving files delivered for $platform\n";
+ my %solar_vars = ();
+ read_ssolar_vars($platform, \%solar_vars);
+ if (scalar keys %solar_vars) {
+ foreach (keys %solar_vars) {
+ if (!defined $backup_vars{$_}) {
+ $backup_vars{$_} = $ENV{$_};
+ };
+ $ENV{$_} = $solar_vars{$_};
+ };
+ };
+ my $undeliver = "$deliver_command $deliver_delete_switches $nul";
+# my $current_dir = getcwd();
+ foreach my $module (sort @modules_built) {
+ if (chdir($module_paths{$module})) {
+ print "Removing delivered from module $module\n";
+ next if ($show);
+ if (system($undeliver)) {
+ $ENV{$_} = $backup_vars{$_} foreach (keys %backup_vars);
+ print_error("Cannot run: $undeliver");
+ }
+ } else {
+ push(@warnings, "Could not remove delivered files from the module $module. Your build can become inconsistent.\n");
+ };
+ };
+# chdir $current_dir;
+# getcwd();
+ };
+ $ENV{$_} = $backup_vars{$_} foreach (keys %backup_vars);
+};
+
+#
+# Run setsolar for given platform and
+# write all variables needed in %solar_vars hash
+#
+sub read_ssolar_vars {
+ my ($setsolar, $tmp_file);
+ $setsolar = $ENV{ENV_ROOT} . '/etools/setsolar.pl';
+ my ($platform, $solar_vars) = @_;
+ $setsolar = '/net/jumbo2.germany/buildenv/r/etools/setsolar.pl' if ! -e $setsolar;
+ $tmp_file = $ENV{HOME} . "/.solar.env.$$.tmp";
+ if (!-e $setsolar) {
+ print STDERR "There is no setsolar found. Falling back to current platform settings\n";
+ return;
+ }
+ my $pro = "";
+ if ($platform =~ /\.pro$/) {
+ $pro = "-pro";
+ $platform = $`;
+ };
+
+ my ($verswitch, $source_root, $cwsname);
+ $verswitch = "-ver $ENV{UPDMINOR}" if (defined $ENV{UPDMINOR});
+ $source_root = '-sourceroot' if (defined $ENV{SOURCE_ROOT_USED});
+ my $cws_name = "-cwsname $ENV{CWS_WORK_STAMP}" if (defined $ENV{CWS_WORK_STAMP});
+
+ my $param = "-$ENV{WORK_STAMP} $verswitch $source_root $cws_name $pro $platform";
+ my $ss_command = "$perl $setsolar -file $tmp_file $param $nul";
+ if (system($ss_command)) {
+ unlink $tmp_file;
+ print_error("Cannot run command:\n$ss_command");
+ };
+ get_solar_vars($solar_vars, $tmp_file);
+};
+
+#
+# read variables to hash
+#
+sub get_solar_vars {
+ my ($solar_vars, $file) = @_;
+ my ($var, $value);
+ open SOLARTABLE, "<$file" or die "can´t open solarfile $file";
+ while(<SOLARTABLE>) {
+ s/\r\n//o;
+ next if(!/^\w+\s+(\w+)/o);
+ next if (!defined $deliver_env{$1});
+ $var = $1;
+ /\'(\S+)\'$/o;
+ $value = $1;
+ $$solar_vars{$var} = $value;
+ };
+ close SOLARTABLE;
+ unlink $file;
+}
+
+#
+# Procedure renames <module>.lnk (.link) into <module>
+#
+sub get_current_module {
+ my $module_name = shift;
+ my $link_name = $module_name . '.lnk';
+ $link_name .= '.link' if (-e $workspace_path.$module_name . '.link');
+ chdir $workspace_path;
+ getcwd();
+ print "\nBreaking link to module $module_name";
+ my $result = rename $link_name, $module_name;
+ if ( ! $result ) {
+ print_error("Cannot rename $module_name: $!\n");
+ }
+ if ( $initial_module eq $link_name) {
+ $initial_module = $module_name;
+ }
+ chdir $module_name;
+ getcwd();
+};
+
+sub check_dir {
+ my $start_dir = getcwd();
+ my @dir_entries = split(/[\\\/]/, $ENV{PWD});
+ my $current_module = $dir_entries[$#dir_entries];
+ if (($current_module =~ /(\.lnk)$/) || ($current_module =~ /(\.link)$/)) {
+ $current_module = $`;
+ # we're dealing with a link => fallback to SOLARSRC under UNIX
+ $workspace_path = $ENV{SOLARSRC}.'/';
+ get_current_module($current_module);
+ return;
+ } else {
+ chdir $start_dir;
+ getcwd();
+ };
+};
+
+#
+# Store all available build modi in %build_modes
+#
+sub get_build_modes {
+ return if (scalar keys %build_modes);
+ if (defined $ENV{BUILD_TYPE}) {
+ if ($ENV{BUILD_TYPE} =~ /\s+/o) {
+ my @build_modes = split (/\s+/, $ENV{BUILD_TYPE});
+ $build_modes{$_}++ foreach (@build_modes);
+ } else {
+ $build_modes{$ENV{BUILD_TYPE}}++;
+ };
+ return;
+ };
+};
+
+#
+# pick only the modules, that should be built for
+# build types from %build_modes
+#
+sub pick_for_build_type {
+ my $modules = shift;
+ my @mod_array = split(/\s+/, $modules);
+ print_error("Wrongly written dependencies string:\n $modules\n") if ($mod_array[$#mod_array] ne 'NULL');
+ pop @mod_array;
+ my @modules_to_build;
+ foreach (@mod_array) {
+ if (/(\w+):(\S+)/o) {
+ push(@modules_to_build, $2) if (defined $build_modes{$1});
+ next;
+ };
+ push(@modules_to_build, $_);
+ };
+ return @modules_to_build;
+};
+
+sub do_exit {
+# close_server_socket();
+ my $exit_code = shift;
+ $build_finished++;
+ generate_html_file(1);
+ if ( $^O eq 'os2' )
+ {
+ # perl 5.10 returns 'resource busy' for rmtree
+ rmdir(correct_path($tmp_dir)) if ($tmp_dir);
+ }
+ rmtree(correct_path($tmp_dir), 0, 0) if ($tmp_dir);
+ print STDERR "Cannot delete $tmp_dir. Please remove it manually\n" if (-d $tmp_dir);
+ exit($exit_code);
+};
+
+#
+# Procedure sorts module in user-frendly order
+#
+sub sort_modules_appearance {
+ foreach (keys %dead_parents) {
+ delete $build_is_finished{$_} if (defined $build_is_finished{$_});
+ delete $build_in_progress{$_} if (defined $build_in_progress{$_});
+ };
+ foreach (keys %build_is_finished) {
+ delete $build_in_progress{$_} if (defined $build_in_progress{$_});
+ delete $build_in_progress_shown{$_} if (defined $build_in_progress_shown{$_});
+ };
+ my @modules_order = sort keys %modules_with_errors;
+ foreach (keys %modules_with_errors) {
+ delete $build_in_progress{$_} if (defined $build_in_progress{$_});
+ delete $build_is_finished{$_} if (defined $build_is_finished{$_});
+ delete $build_in_progress_shown{$_} if (defined $build_in_progress_shown{$_});
+ };
+ $build_in_progress_shown{$_}++ foreach (keys %build_in_progress);
+ push(@modules_order, $_) foreach (sort { $build_in_progress_shown{$b} <=> $build_in_progress_shown{$a} } keys %build_in_progress_shown);
+ push(@modules_order, $_) foreach (sort keys %build_is_finished);
+ foreach(sort keys %html_info) {
+ next if (defined $build_is_finished{$_} || defined $build_in_progress{$_} || defined $modules_with_errors{$_});
+ push(@modules_order, $_);
+ };
+ return @modules_order;
+};
+
+sub generate_html_file {
+ return if (!$html);
+ my $force_update = shift;
+ $force_update++ if ($debug);
+ $html_last_updated = time;
+ my @modules_order = sort_modules_appearance();
+ my ($successes_percent, $errors_percent) = get_progress_percentage(scalar keys %html_info, scalar keys %build_is_finished, scalar keys %modules_with_errors);
+ my $build_duration = get_time_line(time - $build_time);
+ my $temp_html_file = File::Temp::tmpnam($tmp_dir);
+ my $title;
+ $title = $ENV{CWS_WORK_STAMP} . ': ' if (defined $ENV{CWS_WORK_STAMP});
+ $title .= $ENV{INPATH};
+ die("Cannot open $temp_html_file") if (!open(HTML, ">$temp_html_file"));
+ print HTML '<html><head>';
+ print HTML '<TITLE id=MainTitle>' . $title . '</TITLE>';
+ print HTML '<script type="text/javascript">' . "\n";
+ print HTML 'initFrames();' . "\n";
+ print HTML 'var IntervalID;' . "\n";
+ print HTML 'function loadFrame_0() {' . "\n";
+ print HTML ' document.write("<html>");' . "\n";
+ print HTML ' document.write("<head>");' . "\n";
+ print HTML ' document.write("</head>");' . "\n";
+ print HTML ' document.write("<body>");' . "\n";
+ if ($build_finished) {
+ print HTML 'document.write("<h3 align=center style=\"color:red\">Build process is finished</h3>");' . "\n";
+ print HTML ' top.frames[0].clearInterval(top.frames[0].IntervalID);' . "\n";
+ } elsif ($interactive) {
+ print HTML 'document.write(" <div id=divContext style=\"border: 1px solid; display: none; position: absolute\">");' . "\n";
+ print HTML 'document.write(" <ul style=\"margin: 0; padding: 0.3em; list-style-type: none; background-color: lightgrey;\" :li:hover {} :hr {border: 0; border-bottom: 1px solid grey; margin: 3px 0px 3px 0px; width: 10em;} :a {border: 0 !important;} >");' . "\n";
+ print HTML 'document.write(" <li><a onmouseover=\"this.style.color=\'red\'\" onmouseout=\"this.style.color=\'black\'\" id=aRebuild href=\"#\">Rebuild module</a></li>");' . "\n";
+ print HTML 'document.write(" <li><a onmouseover=\"this.style.color=\'red\'\" onmouseout=\"this.style.color=\'black\'\" id=aDelete href=\"#\" >Remove module</a></li>");' . "\n";
+ print HTML 'document.write(" </ul>");' . "\n";
+ print HTML 'document.write(" </div>");' . "\n";
+ };
+ if ($build_all_parents) {
+ print HTML 'document.write("<table valign=top cellpadding=0 hspace=0 vspace=0 cellspacing=0 border=0>");' . "\n";
+ print HTML 'document.write(" <tr>");' . "\n";
+ print HTML 'document.write(" <td><a id=ErroneousModules href=\"javascript:top.Error(\'\', \'';
+ print HTML join('<br>', sort keys %modules_with_errors);
+ print HTML '\', \'\')\"); title=\"';
+ print HTML scalar keys %modules_with_errors;
+ print HTML ' module(s) with errors\">Total Progress:</a></td>");' . "\n";
+ print HTML 'document.write(" <td>");' . "\n";
+ print HTML 'document.write(" <table width=100px valign=top cellpadding=0 hspace=0 vspace=0 cellspacing=0 border=0>");' . "\n";
+ print HTML 'document.write(" <tr>");' . "\n";
+ print HTML 'document.write(" <td height=20px width=';
+ print HTML $successes_percent + $errors_percent;
+ if (scalar keys %modules_with_errors) {
+ print HTML '% bgcolor=red valign=top></td>");' . "\n";
+ } else {
+ print HTML '% bgcolor=#25A528 valign=top></td>");' . "\n";
+ };
+ print HTML 'document.write(" <td width=';
+ print HTML 100 - ($successes_percent + $errors_percent);
+ print HTML '% bgcolor=lightgrey valign=top></td>");' . "\n";
+ print HTML 'document.write(" </tr>");' . "\n";
+ print HTML 'document.write(" </table>");' . "\n";
+ print HTML 'document.write(" </td>");' . "\n";
+ print HTML 'document.write(" <td align=right>&nbsp Build time: ' . $build_duration .'</td>");' . "\n";
+ print HTML 'document.write(" </tr>");' . "\n";
+ print HTML 'document.write("</table>");' . "\n";
+ };
+
+ print HTML 'document.write("<table width=100% bgcolor=white>");' . "\n";
+ print HTML 'document.write(" <tr>");' . "\n";
+ print HTML 'document.write(" <td width=30% align=\"center\"><strong style=\"color:blue\">Module</strong></td>");' . "\n";
+ print HTML 'document.write(" <td width=* align=\"center\"><strong style=\"color:blue\">Status</strong></td>");' . "\n";
+ print HTML 'document.write(" <td width=15% align=\"center\"><strong style=\"color:blue\">CPU Time</strong></td>");' . "\n";
+ print HTML 'document.write(" </tr>");' . "\n";
+
+ foreach (@modules_order) {
+ next if ($modules_types{$_} eq 'lnk');
+ next if (!defined $active_modules{$_});
+ my ($errors_info_line, $dirs_info_line, $errors_number, $successes_percent, $errors_percent, $time) = get_html_info($_);
+#<one module>
+ print HTML 'document.write(" <tr>");' . "\n";
+ print HTML 'document.write(" <td width=*>");' . "\n";
+
+ if (defined $dirs_info_line) {
+ print HTML 'document.write(" <a id=';
+ print HTML $_;
+ print HTML ' href=\"javascript:top.Error(\'';
+ print HTML $_ , '\', ' ;
+ print HTML $errors_info_line;
+ print HTML ',';
+ print HTML $dirs_info_line;
+ print HTML ')\"); title=\"';
+ print HTML $errors_number;
+ print HTML ' error(s)\">', $_, '</a>");' . "\n";
+ } else {
+# print HTML 'document.write("<em style=color:gray>' . $_ . '</em>");';
+#### print HTML 'document.write("<em style=color:gray>' . $_ ."href=\'http://$local_host_ip:$html_port/delete=\'$_". '</em>");';
+
+ print HTML 'document.write(" <a target=\'infoframe\' id=';
+ print HTML $_;
+ print HTML ' href=\"javascript:void(0)\"; title=\"Remove module\">' . $_ . '</a>");' . "\n";
+ };
+
+
+ print HTML 'document.write(" </td>");' . "\n";
+ print HTML 'document.write(" <td>");' . "\n";
+ print HTML 'document.write(" <table width=100% valign=top cellpadding=0 hspace=0 vspace=0 cellspacing=0 border=0>");' . "\n";
+ print HTML 'document.write(" <tr>");' . "\n";
+ print HTML 'document.write(" <td height=15* width=';
+
+ print HTML $successes_percent + $errors_percent;
+ if ($errors_number) {
+ print HTML '% bgcolor=red valign=top></td>");' . "\n";
+ } else {
+ print HTML '% bgcolor=#25A528 valign=top></td>");' . "\n";
+ };
+ print HTML 'document.write(" <td width=';
+
+ print HTML 100 - ($successes_percent + $errors_percent);
+ print HTML '% bgcolor=lightgrey valign=top></td>");' . "\n";
+ print HTML 'document.write(" </tr>");' . "\n";
+ print HTML 'document.write(" </table>");' . "\n";
+ print HTML 'document.write(" </td>");' . "\n";
+ print HTML 'document.write(" <td align=\"center\">', $time, '</td>");' . "\n";
+ print HTML 'document.write(" </tr>");' . "\n";
+# </one module>
+ }
+ print HTML 'document.write(" </table>");' . "\n";
+ print HTML 'document.write(" </body>");' . "\n";
+ print HTML 'document.write("</html>");' . "\n";
+ print HTML 'document.close();' . "\n";
+ print HTML 'refreshInfoFrames();' . "\n";
+ print HTML '}' . "\n";
+
+
+ if (!$build_finished && $interactive ) {
+ print HTML 'var _replaceContext = false;' . "\n";
+ print HTML 'var _mouseOverContext = false;' . "\n";
+ print HTML 'var _noContext = false;' . "\n";
+ print HTML 'var _divContext = $(\'divContext\');' . "\n";
+ print HTML 'var activeElement = 0;' . "\n";
+ print HTML 'function $(id) {return document.getElementById(id);}' . "\n";
+ print HTML 'InitContext();' . "\n";
+ print HTML 'function InitContext()' . "\n";
+ print HTML '{' . "\n";
+ print HTML ' $(\'aRebuild\').target = \'infoframe\';' . "\n";
+ print HTML ' $(\'aDelete\').target = \'infoframe\';' . "\n";
+ print HTML ' $(\'aRebuild\').style.color = \'black\';' . "\n";
+ print HTML ' $(\'aDelete\').style.color = \'black\';' . "\n";
+ print HTML ' _divContext.onmouseover = function() { _mouseOverContext = true; };' . "\n";
+ print HTML ' _divContext.onmouseout = function() { _mouseOverContext = false; };' . "\n";
+ print HTML ' _divContext.onclick = function() { _divContext.style.display = \'none\'; };' . "\n";
+ print HTML ' document.body.onmousedown = ContextMouseDown;' . "\n";
+ print HTML ' document.body.oncontextmenu = ContextShow;' . "\n";
+ print HTML '}' . "\n";
+ print HTML 'function ContextMouseDown(event) {' . "\n";
+ print HTML ' if (_noContext || _mouseOverContext) return;' . "\n";
+ print HTML ' if (event == null) event = window.event;' . "\n";
+ print HTML ' var target = event.target != null ? event.target : event.srcElement;' . "\n";
+ print HTML ' if (event.button == 2 && target.tagName.toLowerCase() == \'a\')' . "\n";
+ print HTML ' _replaceContext = true;' . "\n";
+ print HTML ' else if (!_mouseOverContext)' . "\n";
+ print HTML ' _divContext.style.display = \'none\';' . "\n";
+ print HTML '}' . "\n";
+ print HTML 'function ContextShow(event) {' . "\n";
+ print HTML ' if (_noContext || _mouseOverContext) return;' . "\n";
+ print HTML ' if (event == null) event = window.event;' . "\n";
+ print HTML ' var target = event.target != null ? event.target : event.srcElement;' . "\n";
+ print HTML ' if (_replaceContext) {' . "\n";
+ print HTML ' $(\'aRebuild\').href = \'http://'. $local_host_ip .':' . $html_port . '/rebuild=\' + target.id;' . "\n";
+ print HTML ' $(\'aDelete\').href = \'http://'. $local_host_ip .':' . $html_port . '/delete=\' + target.id' . "\n";
+ print HTML ' var scrollTop = document.body.scrollTop ? document.body.scrollTop : ';
+ print HTML 'document.documentElement.scrollTop;' . "\n";
+ print HTML ' var scrollLeft = document.body.scrollLeft ? document.body.scrollLeft : ';
+ print HTML 'document.documentElement.scrollLeft;' . "\n";
+ print HTML ' _divContext.style.display = \'none\';' . "\n";
+ print HTML ' _divContext.style.left = event.clientX + scrollLeft + \'px\';' . "\n";
+ print HTML ' _divContext.style.top = event.clientY + scrollTop + \'px\';' . "\n";
+ print HTML ' _divContext.style.display = \'block\';' . "\n";
+ print HTML ' _replaceContext = false;' . "\n";
+ print HTML ' return false;' . "\n";
+ print HTML ' }' . "\n";
+ print HTML '}' . "\n";
+ };
+
+ print HTML 'function refreshInfoFrames() { ' . "\n";
+ print HTML ' var ModuleNameObj = top.innerFrame.frames[2].document.getElementById("ModuleErrors");' . "\n";
+ print HTML ' if (ModuleNameObj != null) {' . "\n";
+ print HTML ' var ModuleName = ModuleNameObj.getAttribute(\'name\');' . "\n";
+ print HTML ' var ModuleHref = top.innerFrame.frames[0].document.getElementById(ModuleName).getAttribute(\'href\');' . "\n";
+ print HTML ' eval(ModuleHref);' . "\n";
+ print HTML ' } else if (top.innerFrame.frames[2].document.getElementById("ErroneousModules") != null) {' . "\n";
+ print HTML ' var ModuleHref = top.innerFrame.frames[0].document.getElementById("ErroneousModules").getAttribute(\'href\');' . "\n";
+ print HTML ' eval(ModuleHref);' . "\n";
+ print HTML ' if (top.innerFrame.frames[1].document.getElementById("ModuleJobs") != null) {' . "\n";
+ print HTML ' var ModuleName = top.innerFrame.frames[1].document.getElementById("ModuleJobs").getAttribute(\'name\');' . "\n";
+ print HTML ' ModuleHref = top.innerFrame.frames[0].document.getElementById(ModuleName).getAttribute(\'href\');' . "\n";
+ print HTML ' var HrefString = ModuleHref.toString();' . "\n";
+ print HTML ' var RefEntries = HrefString.split(",");' . "\n";
+ print HTML ' var RefreshParams = new Array();' . "\n";
+ print HTML ' for (i = 0; i < RefEntries.length; i++) {' . "\n";
+ print HTML ' RefreshParams[i] = RefEntries[i].substring(RefEntries[i].indexOf("\'") + 1, RefEntries[i].lastIndexOf("\'"));' . "\n";
+ print HTML ' };' . "\n";
+ print HTML ' FillFrame_1(RefreshParams[0], RefreshParams[1], RefreshParams[2]);' . "\n";
+ print HTML ' }' . "\n";
+ print HTML ' };' . "\n";
+ print HTML '}' . "\n";
+ print HTML 'function loadFrame_1() {' . "\n";
+ print HTML ' document.write("<h3 align=center>Jobs</h3>");' . "\n";
+ print HTML ' document.write("Click on the project of interest");' . "\n";
+ print HTML ' document.close();' . "\n";
+ print HTML '}' . "\n";
+ print HTML 'function loadFrame_2() {' . "\n";
+ print HTML ' document.write("<tr bgcolor=lightgrey<td><h3>Errors</h3></pre></td></tr>");' . "\n";
+ print HTML ' document.write("Click on the project of interest");' . "\n";
+ print HTML ' document.close();' . "\n";
+ print HTML '} function getStatusInnerHTML(Status) { var StatusInnerHtml;' . "\n";
+ print HTML ' if (Status == "success") {' . "\n";
+ print HTML ' StatusInnerHtml = "<em style=color:green>";' . "\n";
+ print HTML ' } else if (Status == "building") {' . "\n";
+ print HTML ' StatusInnerHtml = "<em style=color:blue>";' . "\n";
+ print HTML ' } else if (Status == "error") {' . "\n";
+ print HTML ' StatusInnerHtml = "<em style=color:red>";' . "\n";
+ print HTML ' } else {' . "\n";
+ print HTML ' StatusInnerHtml = "<em style=color:gray>";' . "\n";
+ print HTML ' };' . "\n";
+ print HTML ' StatusInnerHtml += Status + "</em>";' . "\n";
+ print HTML ' return StatusInnerHtml;' . "\n";
+ print HTML '} ' . "\n";
+ print HTML 'function ShowLog(LogFilePath, ModuleJob) {' . "\n";
+ print HTML ' top.innerFrame.frames[2].document.write("<h3 id=ModuleErrors name=\"" + null + "\">Log for " + ModuleJob + "</h3>");' . "\n";
+ print HTML ' top.innerFrame.frames[2].document.write("<iframe id=LogFile name=Log src="';
+ if (defined $html_path) {
+ print HTML 'file://';
+ }
+ print HTML '+ LogFilePath + " width=100%></iframe>");' . "\n";
+ print HTML ' top.innerFrame.frames[2].document.close();' . "\n";
+ print HTML '};' . "\n";
+ print HTML 'function FillFrame_1(Module, Message1, Message2) {' . "\n";
+ print HTML ' var FullUpdate = 1;' . "\n";
+ print HTML ' if (top.innerFrame.frames[1].document.getElementById("ModuleJobs") != null) {' . "\n";
+ print HTML ' var ModuleName = top.innerFrame.frames[1].document.getElementById("ModuleJobs").getAttribute(\'name\');' . "\n";
+ print HTML ' if (Module == ModuleName) FullUpdate = 0;' . "\n";
+ print HTML ' }' . "\n";
+ print HTML ' if (FullUpdate) {' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write("<h3 align=center>Jobs in module " + Module + ":</h3>");' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write("<table id=ModuleJobs name=" + Module + " width=100% bgcolor=white>");' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write(" <tr>");' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write(" <td width=* align=center><strong style=color:blue>Status</strong></td>");' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write(" <td width=* align=center><strong style=color:blue>Job</strong></td>");' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write(" <td width=* align=center><strong style=color:blue>Start Time</strong></td>");' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write(" <td width=* align=center><strong style=color:blue>Finish Time</strong></td>");' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write(" <td width=* align=center><strong style=color:blue>Client</strong></td>");' . "\n" if ($server_mode);
+ print HTML ' top.innerFrame.frames[1].document.write(" </tr>");' . "\n";
+ print HTML ' var dir_info_strings = Message2.split("<br><br>");' . "\n";
+ print HTML ' for (i = 0; i < dir_info_strings.length; i++) {' . "\n";
+ print HTML ' var dir_info_array = dir_info_strings[i].split("<br>");' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write(" <tr status=" + dir_info_array[0] + ">");' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write(" <td align=center>");' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write( getStatusInnerHTML(dir_info_array[0]) + "&nbsp");' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write(" </td>");' . "\n";
+ print HTML ' if (dir_info_array[4] == "@") {' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write(" <td style=white-space:nowrap>" + dir_info_array[1] + "</td>");' . "\n";
+ print HTML ' } else {' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write(" <td><a href=\"javascript:top.ShowLog(\'" + dir_info_array[4] + "\', \'" + dir_info_array[1] + "\')\"); title=\"Show Log\">" + dir_info_array[1] + "</a></td>");' . "\n";
+ print HTML ' };' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write(" <td align=center>" + dir_info_array[2] + "</td>");' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write(" <td align=center>" + dir_info_array[3] + "</td>");' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write(" <td align=center>" + dir_info_array[5] + "</td>");' . "\n" if ($server_mode);
+ print HTML ' top.innerFrame.frames[1].document.write(" </tr>");' . "\n";
+ print HTML ' };' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.write("</table>");' . "\n";
+ print HTML ' } else {' . "\n";
+ print HTML ' var dir_info_strings = Message2.split("<br><br>");' . "\n";
+ print HTML ' var ModuleRows = top.innerFrame.frames[1].document.getElementById("ModuleJobs").rows;' . "\n";
+ print HTML ' for (i = 0; i < dir_info_strings.length; i++) {' . "\n";
+ print HTML ' var dir_info_array = dir_info_strings[i].split("<br>");' . "\n";
+ print HTML ' var OldStatus = ModuleRows[i + 1].getAttribute(\'status\');' . "\n";
+ print HTML ' if(dir_info_array[0] != OldStatus) {' . "\n";
+ print HTML ' var DirectoryInfos = ModuleRows[i + 1].cells;' . "\n";
+ print HTML ' DirectoryInfos[0].innerHTML = getStatusInnerHTML(dir_info_array[0]) + "&nbsp";' . "\n";
+ print HTML ' if (dir_info_array[4] != "@") {' . "\n";
+ print HTML ' DirectoryInfos[1].innerHTML = "<a href=\"javascript:top.ShowLog(\'" + dir_info_array[4] + "\', \'" + dir_info_array[1] + "\')\"); title=\"Show Log\">" + dir_info_array[1] + "</a>";' . "\n";
+ print HTML ' };' . "\n";
+ print HTML ' DirectoryInfos[2].innerHTML = dir_info_array[2];' . "\n";
+ print HTML ' DirectoryInfos[3].innerHTML = dir_info_array[3];' . "\n";
+ print HTML ' DirectoryInfos[4].innerHTML = dir_info_array[5];' . "\n" if ($server_mode);
+ print HTML ' };' . "\n";
+ print HTML ' };' . "\n";
+ print HTML ' };' . "\n";
+ print HTML ' top.innerFrame.frames[1].document.close();' . "\n";
+ print HTML '};' . "\n";
+ print HTML 'function Error(Module, Message1, Message2) {' . "\n";
+ print HTML ' if (Module == \'\') {' . "\n";
+ print HTML ' if (Message1 != \'\') {' . "\n";
+ print HTML ' var erroneous_modules = Message1.split("<br>");' . "\n";
+ print HTML ' var ErrorNumber = erroneous_modules.length;' . "\n";
+
+ print HTML ' top.innerFrame.frames[2].document.write("<h3 id=ErroneousModules errors=" + erroneous_modules.length + ">Modules with errors:</h3>");' . "\n";
+ print HTML ' for (i = 0; i < ErrorNumber; i++) {' . "\n";
+ print HTML ' var ModuleObj = top.innerFrame.frames[0].document.getElementById(erroneous_modules[i]);' . "\n";
+ print HTML ' top.innerFrame.frames[2].document.write("<a href=\"");' . "\n";
+ print HTML ' top.innerFrame.frames[2].document.write(ModuleObj.getAttribute(\'href\'));' . "\n";
+ print HTML ' top.innerFrame.frames[2].document.write("\"); title=\"");' . "\n";
+ print HTML ' top.innerFrame.frames[2].document.write("\">" + erroneous_modules[i] + "</a>&nbsp ");' . "\n";
+ print HTML ' };' . "\n";
+ print HTML ' top.innerFrame.frames[2].document.close();' . "\n";
+ print HTML ' };' . "\n";
+ print HTML ' } else {' . "\n";
+ print HTML ' var ModuleNameObj = top.innerFrame.frames[2].document.getElementById("ModuleErrors");' . "\n";
+ print HTML ' var OldErrors = null;' . "\n";
+ print HTML ' var ErrorNumber = Message1.split("<br>").length;' . "\n";
+ print HTML ' if ((ModuleNameObj != null) && (Module == ModuleNameObj.getAttribute(\'name\')) ) {' . "\n";
+ print HTML ' OldErrors = ModuleNameObj.getAttribute(\'errors\');' . "\n";
+ print HTML ' }' . "\n";
+ print HTML ' if ((OldErrors == null) || (OldErrors != ErrorNumber)) {' . "\n";
+ print HTML ' top.innerFrame.frames[2].document.write("<h3 id=ModuleErrors errors=" + ErrorNumber + " name=\"" + Module + "\">Errors in module " + Module + ":</h3>");' . "\n";
+ print HTML ' top.innerFrame.frames[2].document.write(Message1);' . "\n";
+ print HTML ' top.innerFrame.frames[2].document.close();' . "\n";
+ print HTML ' }' . "\n";
+ print HTML ' FillFrame_1(Module, Message1, Message2);' . "\n";
+ print HTML ' }' . "\n";
+ print HTML '}' . "\n";
+ print HTML 'function updateInnerFrame() {' . "\n";
+ print HTML ' top.innerFrame.frames[0].document.location.reload();' . "\n";
+ print HTML ' refreshInfoFrames();' . "\n";
+ print HTML '};' . "\n\n";
+
+ print HTML 'function setRefreshRate() {' . "\n";
+ print HTML ' RefreshRate = document.Formular.rate.value;' . "\n";
+ print HTML ' if (!isNaN(RefreshRate * 1)) {' . "\n";
+ print HTML ' top.frames[0].clearInterval(IntervalID);' . "\n";
+ print HTML ' IntervalID = top.frames[0].setInterval("updateInnerFrame()", RefreshRate * 1000);' . "\n";
+ print HTML ' };' . "\n";
+ print HTML '};' . "\n";
+
+ print HTML 'function initFrames() {' . "\n";
+ print HTML ' var urlquery = location.href.split("?");' . "\n";
+ print HTML ' if (urlquery.length == 1) {' . "\n";
+ print HTML ' document.write("<html><head><TITLE id=MainTitle>' . $ENV{INPATH} .'</TITLE>");' . "\n";
+ print HTML ' document.write(" <frameset rows=\"12%,88%\">");' . "\n";
+ print HTML ' document.write(" <frame name=\"topFrame\" src=\"" + urlquery + "?initTop\"/>");' . "\n";
+ print HTML ' document.write(" <frame name=\"innerFrame\" src=\"" + urlquery + "?initInnerPage\"/>");' . "\n";
+ print HTML ' document.write(" </frameset>");' . "\n";
+ print HTML ' document.write("</head></html>");' . "\n";
+ print HTML ' } else if (urlquery[1].substring(0,7) == "initTop") {' . "\n";
+ print HTML ' var urlquerycontent = urlquery[1].split("=");' . "\n";
+ print HTML ' var UpdateRate = 10' . "\n";
+ print HTML ' if (urlquerycontent.length > 2) {' . "\n";
+ print HTML ' if (isNaN(urlquerycontent[2] * 1)) {' . "\n";
+ print HTML ' alert(urlquerycontent[2] + " is not a number. Ignored.");' . "\n";
+ print HTML ' } else {' . "\n";
+ print HTML ' UpdateRate = urlquerycontent[2];' . "\n";
+ print HTML ' };' . "\n";
+ print HTML ' };' . "\n";
+ print HTML ' document.write("<html><body>");' . "\n";
+ print HTML ' document.write("<h3 align=center>Build process progress status</h3>");' . "\n";
+ print HTML ' document.write("<div align=\"right\">");' . "\n";
+ print HTML ' document.write(" <table border=\"0\"> <tr>");' . "\n";
+ print HTML ' document.write("<td>Refresh rate(sec):</td>");' . "\n";
+ print HTML ' document.write("<th>");' . "\n";
+ print HTML ' document.write("<FORM name=\"Formular\" onsubmit=\"setRefreshRate()\">");' . "\n";
+ print HTML ' document.write("<input type=\"hidden\" name=\"initTop\" value=\"\"/>");' . "\n";
+ print HTML ' document.write("<input type=\"text\" id=\"RateValue\" name=\"rate\" autocomplete=\"off\" value=\"" + UpdateRate + "\" size=\"1\"/>");' . "\n";
+ print HTML ' document.write("<input type=\"submit\" value=\"OK\">");' . "\n";
+ print HTML ' document.write("</FORM>");' . "\n";
+ print HTML ' document.write("</th></tr></table>");' . "\n";
+ print HTML ' document.write("</div>");' . "\n";
+ print HTML ' document.write(" </frameset>");' . "\n";
+ print HTML ' document.write("</body></html>");' . "\n";
+ print HTML ' top.frames[0].clearInterval(IntervalID);' . "\n";
+ print HTML ' IntervalID = top.frames[0].setInterval("updateInnerFrame()", UpdateRate * 1000);' . "\n";
+ print HTML ' } else if (urlquery[1] == "initInnerPage") {' . "\n";
+ print HTML ' document.write("<html><head>");' . "\n";
+ print HTML ' document.write(\' <frameset rows="80%,20%\">\');' . "\n";
+ print HTML ' document.write(\' <frameset cols="70%,30%">\');' . "\n";
+ print HTML ' document.write(\' <frame src="\');' . "\n";
+ print HTML ' document.write(urlquery[0]);' . "\n";
+ print HTML ' document.write(\'?initFrame0"/>\');' . "\n";
+ print HTML ' document.write(\' <frame src="\');' . "\n";
+ print HTML ' document.write(urlquery[0]);' . "\n";
+ print HTML ' document.write(\'?initFrame1"/>\');' . "\n";
+ print HTML ' document.write(\' </frameset>\');' . "\n";
+ print HTML ' document.write(\' <frame src="\');' . "\n";
+ print HTML ' document.write(urlquery[0]);' . "\n";
+ print HTML ' document.write(\'?initFrame2" name="infoframe"/>\');' . "\n";
+ print HTML ' document.write(\' </frameset>\');' . "\n";
+ print HTML ' document.write("</head></html>");' . "\n";
+ print HTML ' } else {' . "\n";
+ print HTML ' if (urlquery[1] == "initFrame0" ) {' . "\n";
+ print HTML ' loadFrame_0();' . "\n";
+ print HTML ' } else if (urlquery[1] == "initFrame1" ) { ' . "\n";
+ print HTML ' loadFrame_1();' . "\n";
+ print HTML ' } else if (urlquery[1] == "initFrame2" ) {' . "\n";
+ print HTML ' loadFrame_2();' . "\n";
+ print HTML ' }' . "\n";
+ print HTML ' };' . "\n";
+ print HTML '};' . "\n";
+ print HTML '</script><noscript>Your browser doesn\'t support JavaScript!</noscript></head></html>' . "\n";
+ close HTML;
+ rename_file($temp_html_file, $html_file);
+};
+
+sub get_local_time_line {
+ my $epoch_time = shift;
+ my $local_time_line;
+ my @time_array;
+ if ($epoch_time) {
+ @time_array = localtime($epoch_time);
+ $local_time_line = sprintf("%02d:%02d:%02d", $time_array[2], $time_array[1], $time_array[0]);
+ } else {
+ $local_time_line = '-';
+ };
+ return $local_time_line;
+};
+
+sub get_dirs_info_line {
+ my $job = shift;
+ my $dirs_info_line = $jobs_hash{$job}->{STATUS} . '<br>';
+ my @time_array;
+ my $log_path_string;
+ $dirs_info_line .= $jobs_hash{$job}->{SHORT_NAME} . '<br>';
+ $dirs_info_line .= get_local_time_line($jobs_hash{$job}->{START_TIME}) . '<br>';
+ $dirs_info_line .= get_local_time_line($jobs_hash{$job}->{FINISH_TIME}) . '<br>';
+ if ($jobs_hash{$job}->{STATUS} eq 'waiting' || (!-f $jobs_hash{$job}->{LONG_LOG_PATH})) {
+ $dirs_info_line .= '@';
+ } else {
+ if (defined $html_path) {
+ $log_path_string = $jobs_hash{$job}->{LONG_LOG_PATH};
+ } else {
+ $log_path_string = $jobs_hash{$job}->{LOG_PATH};
+ };
+ $log_path_string =~ s/\\/\//g;
+ $dirs_info_line .= $log_path_string;
+ };
+ $dirs_info_line .= '<br>';
+ $dirs_info_line .= $jobs_hash{$job}->{CLIENT} . '<br>' if ($server_mode);
+ return $dirs_info_line;
+};
+
+sub get_html_info {
+ my $module = shift;
+ my $module_info_hash = $html_info{$module};
+ my $dirs = $$module_info_hash{DIRS};
+ my $dirs_number = scalar @$dirs;
+ my $dirs_info_line = '\'';
+ if ($dirs_number) {
+ my %dirs_sorted_by_order = ();
+ foreach (@$dirs) {
+ $dirs_sorted_by_order{$jobs_hash{$_}->{BUILD_NUMBER}} = $_;
+ }
+ foreach (sort {$a <=> $b} keys %dirs_sorted_by_order) {
+ $dirs_info_line .= get_dirs_info_line($dirs_sorted_by_order{$_}) . '<br>';
+ }
+ } else {
+ return(undef, undef, 0, 0, 0, '-');
+# $dirs_info_line .= 'No information available yet';
+ };
+ $dirs_info_line =~ s/(<br>)*$//o;
+ $dirs_info_line .= '\'';
+ $dirs = $$module_info_hash{SUCCESSFUL};
+ my $successful_number = scalar @$dirs;
+ $dirs = $$module_info_hash{ERRORFUL};
+ my $errorful_number = scalar @$dirs;
+ my $errors_info_line = '\'';
+ if ($errorful_number) {
+ $errors_info_line .= $_ . '<br>' foreach (@$dirs);
+ } else {
+ $errors_info_line .= 'No errors';
+ };
+ $errors_info_line .= '\'';
+# if (defined $full_info) {
+ my $time_line = get_time_line($$module_info_hash{BUILD_TIME});
+ my ($successes_percent, $errors_percent) = get_progress_percentage($dirs_number - 1, $successful_number - 1, $errorful_number);
+ return($errors_info_line, $dirs_info_line, $errorful_number, $successes_percent, $errors_percent, $time_line);
+# } else {
+# return($errors_info_line, $dirs_info_line, $errorful_number);
+# };
+};
+
+sub get_time_line {
+ use integer;
+ my $seconds = shift;
+ my $hours = $seconds/3600;
+ my $minits = ($seconds/60)%60;
+ $seconds -= ($hours*3600 + $minits*60);
+ return(sprintf("%02d\:%02d\:%02d" , $hours, $minits, $seconds));
+};
+
+sub get_progress_percentage {
+ use integer;
+ my ($dirs_number, $successful_number, $errorful_number) = @_;
+ return (0 ,0) if (!$dirs_number);
+ my $errors_percent = ($errorful_number * 100)/ $dirs_number;
+ my $successes_percent;
+ if ($dirs_number == ($successful_number + $errorful_number)) {
+ $successes_percent = 100 - $errors_percent;
+ } else {
+ $successes_percent = ($successful_number * 100)/ $dirs_number;
+ };
+ return ($successes_percent, $errors_percent);
+};
+
+#
+# This procedure stores the dmake result in %html_info
+#
+sub html_store_job_info {
+ return if (!$html);
+ my ($deps_hash, $build_dir, $error_code) = @_;
+ my $force_update = 0;
+ if ($build_dir =~ /(\s)/o && (defined $error_code)) {
+ $force_update++ if (!children_number());
+ }
+ my $module = $module_by_hash{$deps_hash};
+ my $module_info_hash = $html_info{$module};
+ my $dmake_array;
+ if (defined $error_code) {
+ $jobs_hash{$build_dir}->{FINISH_TIME} = time();
+ $$module_info_hash{BUILD_TIME} += $jobs_hash{$build_dir}->{FINISH_TIME} - $jobs_hash{$build_dir}->{START_TIME};
+ if ($error_code) {
+ $jobs_hash{$build_dir}->{STATUS} = 'error';
+ $dmake_array = $$module_info_hash{ERRORFUL};
+ $build_dir =~ s/\\/\//g;
+ $modules_with_errors{$module}++;
+ } else {
+ if ($build_dir =~ /(\s)announce/o) {
+ $jobs_hash{$build_dir}->{STATUS} = '-';
+ } else {
+ $jobs_hash{$build_dir}->{STATUS} = 'success';
+ };
+ $dmake_array = $$module_info_hash{SUCCESSFUL};
+ };
+ push (@$dmake_array, $build_dir);
+ };
+};
+
+sub start_server_on_port {
+ my $port = shift;
+ my $socket_obj = shift;
+ $client_timeout = 1 if (!$parent_process);
+ if ($ENV{GUI} eq 'WNT') {
+ $$socket_obj = new IO::Socket::INET (#LocalAddr => hostname(),
+ LocalPort => $port,
+ Proto => 'tcp',
+ Listen => 100); # 100 clients can be on queue, I think it is enough
+ } else {
+ $$socket_obj = new IO::Socket::INET (#LocalAddr => hostname(),
+ LocalPort => $port,
+ Proto => 'tcp',
+ ReuseAddr => 1,
+ Listen => 100); # 100 clients can be on queue, I think it is enough
+ };
+ return('Cannot create socket object') if (!defined $$socket_obj);
+ my $timeout = $$socket_obj->timeout($client_timeout);
+ $$socket_obj->autoflush(1);
+ if ($parent_process && $debug) {
+ print "SERVER started on port $port\n";
+ } else {
+ print "html_port:$html_port html_socket_obj: $html_socket_obj\n";
+ };
+ return 0;
+};
+
+sub accept_html_connection {
+ my $new_socket_obj = undef;
+ $new_socket_obj = $html_socket_obj->accept();
+ return $new_socket_obj;
+};
+
+sub accept_connection {
+ my $new_socket_obj = undef;
+ do {
+ $new_socket_obj = $server_socket_obj->accept();
+ if (!$new_socket_obj) {
+ print "Timeout on incoming connection\n";
+ check_client_jobs();
+ };
+ } while (!$new_socket_obj);
+ return $new_socket_obj;
+};
+
+sub check_client_jobs {
+ foreach (keys %clients_times) {
+ if (time - $clients_times{$_} > $client_timeout) {
+ print "Client's $_ Job: \"$clients_jobs{$_}\" apparently got lost...\n";
+ print "Scheduling for rebuild...\n";
+ print "You might need to check the $_\n";
+ $lost_client_jobs{$clients_jobs{$_}}++;
+ delete $processes_hash{$_};
+ delete $clients_jobs{$_};
+ delete $clients_times{$_};
+# } else {
+# print time - $clients_times{$_} . "\n";
+ };
+ };
+};
+
+sub get_server_ports {
+ # use port 7890 as default
+ my $default_port = 7890;
+ if ($ports_string) {
+ @server_ports = split( /:/, $ports_string);
+ } else {
+ @server_ports = ($default_port .. $default_port + 4);
+ };
+};
+
+sub run_server {
+ my @build_queue = (); # array, containing queue of projects
+ # to build
+ my $error = 0;
+ if (scalar @server_ports) {
+ foreach (@server_ports) {
+ $error = start_server_on_port($_, \$server_socket_obj);
+ if ($error) {
+ print STDERR "port $_: $error\n";
+ } else {
+# $SIG{KILL} = \&stop_server;
+# $SIG{INT} = \&stop_server;
+# $SIG{TERM} = \&stop_server;
+# $SIG{QUIT} = \&stop_server;
+ last;
+ };
+ };
+ print_error('Unable to start server on port(s): ' . "@server_ports\n") if ($error);
+ } else {
+ print_error('No ports for server to start');
+ };
+
+ my $client_addr;
+ my $job_string_base = get_job_string_base();
+ my $new_socket_obj;
+ while ($new_socket_obj = accept_connection()) {
+ check_client_jobs();
+ # find out who connected
+ my $client_ipnum = $new_socket_obj->peerhost();
+ my $client_host = gethostbyaddr(inet_aton($client_ipnum), AF_INET);
+ # print who is connected
+ # send them a message, close connection
+ my $client_message = <$new_socket_obj>;
+ chomp $client_message;
+ my @client_data = split(/ /, $client_message);
+ my %client_hash = ();
+ foreach (@client_data) {
+ /(=)/;
+ $client_hash{$`} = $';
+ }
+ my $pid = $client_hash{pid} . '@' . $client_host;
+ if (defined $client_hash{platform}) {
+ if ($client_hash{platform} ne $ENV{OUTPATH} || (defined $client_hash{osname} && ($^O ne $client_hash{osname}))) {
+ print $new_socket_obj "Wrong platform";
+ close($new_socket_obj);
+ next;
+ };
+ } else {
+ if ($client_hash{result} eq "0") {
+# print "$clients_jobs{$pid} succedded on $pid\n";
+ } else {
+ print "Error $client_hash{result}\n";
+ if (store_error($pid, $client_hash{result})) {
+ print $new_socket_obj $job_string_base . $clients_jobs{$pid};
+ close($new_socket_obj);
+ $clients_times{$pid} = time;
+ next;
+ };
+ };
+ delete $clients_times{$pid};
+ clear_from_child($pid);
+ delete $clients_jobs{$pid};
+ $verbose_mode && print 'Running processes: ', children_number(), "\n";
+ # Actually, next 3 strings are only for even distribution
+ # of clients if there are more than one build server running
+ print $new_socket_obj 'No job';
+ close($new_socket_obj);
+ next;
+ };
+ my $job_string;
+ my @lost_jobs = keys %lost_client_jobs;
+ if (scalar @lost_jobs) {
+ $job_string = $lost_jobs[0];
+ delete $lost_client_jobs{$lost_jobs[0]};
+ } else {
+# $job_string = get_job_string(\@build_queue, $pid);
+ $job_string = get_job_string(\@build_queue);
+ };
+ if ($job_string) {
+ my $job_dir = $job_jobdir{$job_string};
+ $processes_hash{$pid} = $job_dir;
+ $jobs_hash{$job_dir}->{CLIENT} = $pid;
+ print "$pid got $job_dir\n";
+ print $new_socket_obj $job_string_base . $job_string;
+ $clients_jobs{$pid} = $job_string;
+ $clients_times{$pid} = time;
+ my $children_running = children_number();
+ $verbose_mode && print 'Running processes: ', $children_running, "\n";
+ $maximal_processes = $children_running if ($children_running > $maximal_processes);
+ } else {
+ print $new_socket_obj 'No job';
+ };
+ close($new_socket_obj);
+ };
+};
+
+#
+# Procedure returns the part of the job string that is similar for all clients
+#
+sub get_job_string_base {
+ if ($setenv_string) {
+ return "setenv_string=$setenv_string ";
+ };
+ my $job_string_base = "server_pid=$$ setsolar_cmd=$ENV{SETSOLAR_CMD} ";
+ $job_string_base .= "source_root=$ENV{SOURCE_ROOT} " if (defined $ENV{SOURCE_ROOT});
+ $job_string_base .= "updater=$ENV{UPDATER} " if (defined $ENV{UPDATER});
+ return $job_string_base;
+};
+
+sub get_job_string {
+ my $build_queue = shift;
+ my $job = $dmake;
+ my ($job_dir, $dependencies_hash);
+ if ($build_all_parents) {
+ fill_modules_queue($build_queue);
+ do {
+ ($job_dir, $dependencies_hash) = pick_jobdir($build_queue);
+ return '' if (!$job_dir);
+ $jobs_hash{$job_dir}->{START_TIME} = time();
+ $jobs_hash{$job_dir}->{STATUS} = 'building';
+ if ($job_dir =~ /(\s)$pre_job/o) {
+ do_custom_job($job_dir, $dependencies_hash);
+ $job_dir = '';
+ };
+ } while (!$job_dir);
+ } else {
+ $dependencies_hash = \%local_deps_hash;
+ do {
+ $job_dir = pick_prj_to_build(\%local_deps_hash);
+ if (!$job_dir && !children_number()) {
+ cancel_build() if (scalar keys %broken_build);
+ mp_success_exit();
+ };
+ return '' if (!$job_dir);
+ $jobs_hash{$job_dir}->{START_TIME} = time();
+ $jobs_hash{$job_dir}->{STATUS} = 'building';
+ if ($job_dir =~ /(\s)$pre_job/o) {
+# if ($' eq $pre_job) {
+ do_custom_job($job_dir, $dependencies_hash);
+ $job_dir = '';
+# }
+ };
+ } while (!$job_dir);
+ };
+ $running_children{$dependencies_hash}++;
+ $folders_hashes{$job_dir} = $dependencies_hash;
+ my $log_file = $jobs_hash{$job_dir}->{LONG_LOG_PATH};
+ my $full_job_dir = $job_dir;
+ if ($job_dir =~ /(\s)/o) {
+ $job = $';
+ $job = $deliver_command if ($job eq $post_job);
+ $full_job_dir = $module_paths{$`};
+ }
+ my $log_dir = File::Basename::dirname($log_file);
+ if (!-d $log_dir) {
+ chdir $full_job_dir;
+ getcwd();
+ system("$perl $mkout");
+ };
+ my $job_string = "job_dir=$full_job_dir job=$job log=$log_file";
+ $job_jobdir{$job_string} = $job_dir;
+ return $job_string;
+};
+
+sub pick_jobdir {
+ my $build_queue = shift;
+ my $i = 0;
+ foreach (@$build_queue) {
+ my $prj = $$build_queue[$i];
+ my $prj_deps_hash = $projects_deps_hash{$prj};
+ if (defined $modules_with_errors{$prj_deps_hash} && !$ignore) {
+ push (@broken_module_names, $prj);
+ splice (@$build_queue, $i, 1);
+ next;
+ };
+ $running_children{$prj_deps_hash} = 0 if (!defined $running_children{$prj_deps_hash});
+ my $child_nick = pick_prj_to_build($prj_deps_hash);
+ if ($child_nick) {
+ return ($child_nick, $prj_deps_hash);
+ }
+ if ((!scalar keys %$prj_deps_hash) && !$running_children{$prj_deps_hash}) {
+ if (!defined $modules_with_errors{$prj_deps_hash} || $ignore)
+ {
+ remove_from_dependencies($prj, \%global_deps_hash);
+ $build_is_finished{$prj}++;
+ splice (@$build_queue, $i, 1);
+ next;
+ };
+ };
+ $i++;
+ };
+};
+
+sub fill_modules_queue {
+ my $build_queue = shift;
+ my $prj;
+ while ($prj = pick_prj_to_build(\%global_deps_hash)) {
+ push @$build_queue, $prj;
+ $projects_deps_hash{$prj} = {};
+ get_module_dep_hash($prj, $projects_deps_hash{$prj});
+ my $info_hash = $html_info{$prj};
+ $$info_hash{DIRS} = check_deps_hash($projects_deps_hash{$prj}, $prj);
+ $module_by_hash{$projects_deps_hash{$prj}} = $prj;
+ };
+ if (!$prj && !children_number() && (!scalar @$build_queue)) {
+ cancel_build() if (scalar keys %broken_build);
+ mp_success_exit();
+ };
+};
+
+sub is_gnumake_module {
+ my $module = shift;
+ my $bridgemakefile = $source_config->get_module_path($module) . "/prj/makefile.mk";
+ return (-e $bridgemakefile);
+}
+
+sub check_partial_gnumake_build {
+ if(!$build_all_parents && is_gnumake_module(shift)) {
+ print "This module has been migrated to GNU make.\n";
+ print "You can only use build --all/--since here with build.pl.\n";
+ print "To do the equivalent of 'build && deliver' call:\n";
+ print "\tmake -sr\n";
+ print "in the module root (This will modify the solver).\n";
+ exit 1;
+ }
+}
diff --git a/solenv/bin/build_client.pl b/solenv/bin/build_client.pl
new file mode 100755
index 000000000000..54a5c4f84de2
--- /dev/null
+++ b/solenv/bin/build_client.pl
@@ -0,0 +1,445 @@
+:
+eval 'exec perl -S $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+#
+# build_client - client for the build tool in server mode
+#
+
+use strict;
+use Socket;
+use Sys::Hostname;
+use File::Temp qw(tmpnam);
+use POSIX;
+use Cwd qw (cwd);
+
+$SIG{KILL} = \&handle_temp_files;
+$SIG{INT} = \&handle_temp_files;
+
+### main ###
+my $enable_multiprocessing = 1;
+my $server_list_file;
+my $server_list_time_stamp = 0;
+my %ENV_BACKUP;
+$ENV_BACKUP{$_} = $ENV{$_} foreach (keys %ENV);
+
+if ($^O eq 'MSWin32') {
+ eval { require Win32::Process; import Win32::Process; };
+ $enable_multiprocessing = 0 if ($@);
+} else {
+ use Cwd 'chdir';
+};
+my $processes_to_run = 1;
+
+my %hosts_ports = ();
+my $default_port = 7890;
+my @ARGV_COPY = @ARGV; # @ARGV BACKUP
+#$ARGV_COPY{$_}++ foreach (@ARGV);
+print "arguments: @ARGV\n";
+get_options();
+
+my $proto = getprotobyname('tcp');
+my $paddr;
+my $host = hostname();
+my $current_server = '';
+my $got_job = 0;
+my %job_temp_files = ();
+my %environments = (); # hash containing all environments
+my $env_alias;
+my %platform_rejects = (); # hash containing paddr of server, that replied "Wrong platform"
+
+my $child = 0;
+if ($processes_to_run > 1) {
+ my $started_processes = 1;
+ if ($^O eq 'MSWin32') {
+ my $process_obj = undef;
+ my $child_args = "perl $0";
+ foreach (@ARGV_COPY) {
+ /^-P(\d+)$/ and next;
+ /^-P$/ and shift @ARGV_COPY and next;
+ $child_args .= " $_";
+ };
+ do {
+ my $rc = Win32::Process::Create($process_obj, $^X,
+ $child_args,
+ 0, 0, #NORMAL_PRIORITY_CLASS,
+ ".");
+ print_error("Cannot start child process") if (!$rc);
+ $started_processes++;
+ } while ($started_processes < $processes_to_run);
+ } else {
+ my $pid;
+ do {
+ if ($pid = fork) { # parent
+ $started_processes++;
+ print $started_processes . "\n";
+ } elsif (defined $pid) { # child
+ $child++;
+ };
+ } while (($started_processes < $processes_to_run) && !$child);
+ };
+};
+
+run_client();
+### end of main procedure ###
+
+#########################
+# #
+# Procedures #
+# #
+#########################
+sub handle_temp_files {
+ print STDERR "Got signal - clearing up...\n";
+ foreach (keys %job_temp_files) {
+ if ($job_temp_files{$_}) {
+ rename($_, $job_temp_files{$_}) or system("mv", $_, $job_temp_files{$_});
+ print STDERR "Could not rename $_ to $job_temp_files{$_}\n" if (-e $_);
+ } else {
+ unlink $_ or system("rm -rf $_");
+ print STDERR "Could not remove $_\n" if (-e $_);
+ };
+ };
+ exit($?);
+};
+
+sub run_client {
+# initialize host and port
+ if (!scalar keys %hosts_ports) {
+ $hosts_ports{localhost} = $default_port;
+ }
+
+ print "Started client with PID $$, hostname $host\n";
+
+ my $message = '';
+ my $current_port = '';
+ my %active_servers = ();
+
+ do {
+ $got_job = 0;
+ foreach $current_server (keys %hosts_ports) {
+ foreach $current_port (keys %{$hosts_ports{$current_server}}) {
+
+ #before each "inactive" server/port connect - connect to each "active" server/port
+ next if (defined ${$active_servers{$current_server}}{$current_port});
+ # "active" cycle
+ foreach my $active_server (keys %active_servers) {
+ foreach my $active_port (keys %{$active_servers{$active_server}}) {
+# print "Active: $active_server:$active_port\n";
+ my $iaddr = inet_aton($active_server);
+ $paddr = sockaddr_in($active_port, $iaddr);
+ do {
+ my $server_is_active = 0;
+ $message = request_job($message, $active_server, $active_port);
+ $server_is_active++ if ($message);
+ if (!$server_is_active) {
+ delete ${$active_servers{$active_server}}{$active_port};
+ # throw away obsolete environments
+ foreach (keys %environments) {
+ /^\d+@/;
+ if ($' eq "$active_server:$active_port") {
+ delete $environments{$_};
+ };
+ };
+ };
+ $message = '' if ($message eq 'No job');
+ } while ($message);
+ };
+ };
+
+ # "inactive" cycle
+# print "Inactive: $current_server:$current_port\n";
+ my $iaddr = inet_aton($current_server);
+ $paddr = sockaddr_in($current_port, $iaddr);
+ do {
+ $message = request_job($message, $current_server, $current_port);
+ if ($message) {
+ if (!defined $active_servers{$current_server}) {
+ my %ports;
+ $active_servers{$current_server} = \%ports;
+ };
+ ${$active_servers{$current_server}}{$current_port}++;
+ };
+ $message = '' if ($message eq 'No job');
+ } while ($message);
+ };
+ };
+ sleep 5 if (!$got_job);
+ read_server_list();
+ } while(1);
+};
+
+sub usage {
+ my $error = shift;
+ print STDERR "\nbuild_client\n";
+ print STDERR "Syntax: build_client [-PN] host1[:port1:...:portN] [host2[:port1:...:portN] ... hostN[:port1:...:portN]]|\@server_list_file\n";
+ print STDERR " -P - start multiprocessing build, with number of processes passed\n";
+ print STDERR "Example1: build_client myserver1 myserver2:7891:7892\n";
+ print STDERR " the client will be asking for jobs on myserver1's default ports (7890-7894)\n";
+ print STDERR " and on myserver2's ports 7891 and 7892\n";
+ print STDERR "Example2: build_client -P2 myserver1:7990 myserver2\n";
+ print STDERR " start 2 clients which will be asking for jobs myserver1's port 7990\n";
+ print STDERR " and myserver2's default ports (7890-7894)\n";
+ exit ($error);
+};
+
+sub get_options {
+ my $arg;
+ usage(1) if (!scalar @ARGV);
+ while ($arg = shift @ARGV) {
+ usage(0) if /^--help$/;
+ usage(0) if /^-h$/;
+ $arg =~ /^-P(\d+)$/ and $processes_to_run = $1 and next;
+ $arg =~ /^-P$/ and $processes_to_run = shift @ARGV and next;
+ $arg =~ /^@(\S+)$/ and $server_list_file = $1 and next;
+ store_server($arg);
+ };
+ if (($processes_to_run > 1) && (!$enable_multiprocessing)) {
+ print_error("Cannot load Win32::Process module for multiple client start");
+ };
+ if ($server_list_file) {
+ print_error("$server_list_file is not a regular file!!") if (!-f $server_list_file);
+ read_server_list();
+ }
+ print_error("No server info") if (!scalar %hosts_ports);
+};
+
+sub store_server {
+ my $server_string = shift;
+ my @server_params = ();
+ @server_params = split (/:/, $server_string);
+ my $host = shift @server_params;
+ my @names = gethostbyname($host);
+ my $host_full_name = $names[0];
+ my %ports = ();
+ if (defined $hosts_ports{$host_full_name}) {
+ %ports = %{$hosts_ports{$host_full_name}};
+ };
+ # To do: implement keys in form server:port -> priority
+ if (defined $hosts_ports{$host_full_name}) {
+ if (!$server_list_time_stamp) {
+ print "The $host with ip address " . inet_ntoa(inet_aton($host)) . " is at least two times in the server list\n";
+ };
+ } else {
+ print "Added server $host as $host_full_name\n";
+ };
+ if (scalar @server_params) {
+ $ports{$_}++ foreach (@server_params);
+ } else {
+ $ports{$_}++ foreach ($default_port .. $default_port + 4);
+ };
+ $hosts_ports{$host_full_name} = \%ports;
+};
+
+sub read_server_list {
+ open(SERVER_LIST, "<$server_list_file") or return;
+ my $current_time_stamp = (stat($server_list_file))[9];
+ return if ($server_list_time_stamp >= $current_time_stamp);
+ my @server_array = ();
+ foreach my $file_string(<SERVER_LIST>) {
+ while ($file_string =~ /(\S+)/) {
+ $file_string = $';
+ store_server($1);
+ };
+ };
+ close SERVER_LIST;
+ $server_list_time_stamp = $current_time_stamp;
+};
+
+sub request_job {
+ my ($message, $current_server, $current_port) = @_;
+ $message = "platform=$ENV_BACKUP{OUTPATH} pid=$$ osname=$^O" if (!$message);
+ # create the socket, connect to the port
+ socket(SOCKET, PF_INET, SOCK_STREAM, $proto) or die "socket: $!";
+ connect(SOCKET, $paddr) or return '';#die "connect: $!";
+ my $error_code = 1;
+ $message .= "\n";
+ syswrite SOCKET, $message, length $message;
+ while (my $line = <SOCKET>) {
+ chomp $line;
+ if ($line eq 'No job') {
+ close SOCKET or die "close: $!";
+ return $line;
+ };
+ if ($line eq "Wrong platform") {
+ if (!defined $platform_rejects{$paddr}) {
+ $platform_rejects{$paddr}++;
+ print STDERR $line . "\n";
+ }
+ close SOCKET or die "close: $!";
+ delete $hosts_ports{$current_server};
+ return '';
+ } elsif (defined $platform_rejects{$paddr}) {
+ delete $platform_rejects{$paddr};
+ };
+ $got_job++;
+ $error_code = do_job($line . " server=$current_server port=$current_port");
+ }
+ close SOCKET or die "close: $!";
+ return("result=$error_code pid=$$");
+}
+
+sub do_job {
+ my @job_parameters = split(/ /, shift);
+ my %job_hash = ();
+ my $last_param;
+ my $error_code;
+ print "Client $$@" . "$host\n";
+ foreach (@job_parameters) {
+ if (/(=)/) {
+ $job_hash{$`} = $';
+ $last_param = $`;
+ } else {
+ $job_hash{$last_param} .= " $_";
+ };
+ };
+ $env_alias = $job_hash{server_pid} . '@' . $job_hash{server} . ':' . $job_hash{port};
+ my $result = "1"; # default value
+ my $cmd_file = File::Temp::tmpnam($ENV_BACKUP{TMP});
+ my $tmp_log_file = File::Temp::tmpnam($ENV_BACKUP{TMP});
+ $job_temp_files{$tmp_log_file} = $job_hash{log};
+ my $setenv_string = '';
+ if (defined $job_hash{setenv_string}) {
+ # use configuration string from server
+ $setenv_string .= $job_hash{setenv_string};
+ print "Environment: $setenv_string\n";
+
+ my $directory = $job_hash{job_dir};
+ open (COMMAND_FILE, ">$cmd_file");
+ print COMMAND_FILE "$setenv_string\n";
+ if (!defined $job_hash{job_dir}) {
+ close COMMAND_FILE;
+ print "No job_dir, cmd file: $cmd_file\n";
+ foreach (keys %job_hash) {
+ print "key: $_ $job_hash{$_}\n";
+ };
+ exit (1);
+ };
+
+ print COMMAND_FILE "pushd $job_hash{job_dir} && ";
+ print COMMAND_FILE $job_hash{job} ." >& $tmp_log_file\n";
+ print COMMAND_FILE "exit \$?\n";
+ close COMMAND_FILE;
+ $job_temp_files{$cmd_file} = 0;
+ $job_temp_files{$tmp_log_file} = $job_hash{log};
+ $error_code = system($ENV{SHELL}, $cmd_file);
+ unlink $cmd_file or system("rm -rf $cmd_file");
+ delete $job_temp_files{$cmd_file};
+ } else {
+ # generate setsolar string
+ if (!defined $environments{$env_alias}) {
+ $error_code = get_setsolar_environment(\%job_hash);
+ return($error_code) if ($error_code);
+ };
+ my $solar_vars = $environments{$env_alias};
+
+ delete $ENV{$_} foreach (keys %ENV);
+ $ENV{$_} = $$solar_vars{$_} foreach (keys %$solar_vars);
+ print 'Workspace: ';
+ if (defined $ENV{CWS_WORK_STAMP}) {
+ print $ENV{CWS_WORK_STAMP};
+ } else {
+ print $ENV{SOLARSRC};
+ };
+
+ print "\nplatform: $ENV{INPATH} $^O";
+ print "\ndir: $job_hash{job_dir}\n";
+ print "job: $job_hash{job}\n";
+ chdir $job_hash{job_dir};
+ getcwd();
+ my $job_string = $job_hash{job} . ' > ' . $tmp_log_file . ' 2>&1';
+ $error_code = system($job_string);
+# rename($tmp_log_file, $job_hash{log}) or system("mv", $tmp_log_file, $job_hash{log});
+# delete $job_temp_files{$tmp_log_file};# = $job_hash{log};
+ };
+ rename($tmp_log_file, $job_hash{log}) or system("mv", $tmp_log_file, $job_hash{log});
+ delete $job_temp_files{$tmp_log_file};
+
+ if ($error_code) {
+ print "Error code = $error_code\n\n";
+ } else {
+ print "Success!!\n\n";
+ };
+ return $error_code;
+};
+
+sub get_setsolar_environment {
+ my $job_hash = shift;
+ my $server_pid = $$job_hash{server_pid};
+ my $setsolar_string = $$job_hash{setsolar_cmd};
+ # Prepare the string for the client
+ $setsolar_string =~ s/\s-file\s\S+//g;
+ my $error_code = 0;
+ my $cmd_file = File::Temp::tmpnam($ENV_BACKUP{TMP});
+ my $tmp_log_file = File::Temp::tmpnam($ENV_BACKUP{TMP});
+ if (defined $$job_hash{updater}) {
+ $ENV{UPDATER} = $$job_hash{updater};
+ } else {
+ undef $ENV{UPDATER} if (defined $ENV{UPDATER});
+ };
+ if (defined $$job_hash{source_root}) {
+ $ENV{SOURCE_ROOT} = $$job_hash{source_root};
+ } else {
+ undef $ENV{SOURCE_ROOT} if (defined $ENV{SOURCE_ROOT});
+ };
+ $error_code = system("$setsolar_string -file $cmd_file");
+ store_env_hash($cmd_file);
+ return $error_code;
+};
+
+sub print_error {
+ my $message = shift;
+ print STDERR "\nERROR: $message\n";
+ exit(1);
+};
+sub store_env_hash {
+ my $ss_setenv_file = shift;#($$job_hash{server_pid}.$$job_hash{setsolar_cmd}, $cmd_file);
+ my %solar_vars = ();
+ my $cmd_file = File::Temp::tmpnam($ENV_BACKUP{TMP});
+ my $env_vars_file = File::Temp::tmpnam($ENV_BACKUP{TMP});
+ print "$cmd_file $env_vars_file\n";
+ #get all env variables in $env_vars_file
+ open (COMMAND_FILE, ">$cmd_file");
+ print COMMAND_FILE "source $ss_setenv_file\n";
+ print COMMAND_FILE "env > $env_vars_file\n";
+ close COMMAND_FILE;
+ system($ENV{SHELL}, $cmd_file);
+ print_error($?) if ($?);
+ unlink $cmd_file or system("rm -rf $cmd_file");
+ unlink $ss_setenv_file or system("rm -rf $ss_setenv_file");
+
+ open SOLARTABLE, "<$env_vars_file" or die "can´t open solarfile $env_vars_file";
+ while(<SOLARTABLE>) {
+ chomp;
+ s/\r\n//o;
+ /(=)/;
+ $solar_vars{$`} = $';
+ };
+ close SOLARTABLE;
+ unlink $env_vars_file or system("rm -rf $env_vars_file");
+ $environments{$env_alias} = \%solar_vars;
+};
diff --git a/solenv/bin/buildalyzer b/solenv/bin/buildalyzer
new file mode 100644
index 000000000000..8b278e66b8e6
--- /dev/null
+++ b/solenv/bin/buildalyzer
@@ -0,0 +1,138 @@
+#!/usr/bin/env python
+import sys
+import os
+
+class CxxTarget:
+ def __init__(self, line):
+ self.directory = ''
+ self.outputfile = ''
+ self.includeflags = []
+ self.cxxflags = []
+ self.inputfiles = []
+ self.nolink = False
+ options = line[:-1].split(' ')
+ self.directory = options.pop(0)
+ parsing_outputfile = False
+ for option in options:
+ if parsing_outputfile:
+ self.outputfile = option
+ parsing_outputfile = False
+ elif option == '-o':
+ parsing_outputfile = True
+ elif option == '-c':
+ self.nolink = True
+ elif option.startswith('-I'):
+ self.includeflags.append(CxxFlag(option))
+ elif option.startswith('-'):
+ self.cxxflags.append(CxxFlag(option))
+ else:
+ self.inputfiles.append(option)
+ self.cxxflags.sort()
+ self.includeflags.sort()
+ cxxflags_tmp = dict()
+ for flag in self.cxxflags:
+ cxxflags_tmp[flag.name] = flag
+ self.cxxflags = cxxflags_tmp.values()
+ includeflags_tmp = dict()
+ for flag in self.includeflags:
+ includeflags_tmp[flag.name] = flag
+ self.includeflags = includeflags_tmp.values()
+ CxxTargets.by_name[self.getFullOutputname()] = self
+ def __str__(self):
+ return '%s' % (self.getFullOutputname())
+ def getFullOutputname(self):
+ return self.directory + '/' + self.outputfile
+ def __cmp__(self, other):
+ return cmp(self.getFullOutputname(), other.getFullOutputname())
+
+class CxxFlag:
+ def __init__(self, name):
+ self.name = name
+ CxxFlags.by_name[self.name] = self
+ def __str__(self):
+ return 'Flag %s' % (self.name)
+ def __cmp__(self, other):
+ return cmp(self.name, other.name)
+
+class CxxFlags:
+ by_name = dict()
+
+class CxxTargets:
+ by_name = dict()
+
+if __name__ == '__main__':
+ [CxxTarget(line) for line in sys.stdin.readlines()]
+ compile_targets = [target for target in CxxTargets.by_name.values() if target.nolink]
+ link_targets = [target for target in CxxTargets.by_name.values() if not target.nolink]
+ common_compile_flags = []
+ for flag in CxxFlags.by_name.values():
+ if sum((flag in target.cxxflags for target in compile_targets)) == len(compile_targets):
+ common_compile_flags.append(flag)
+ common_link_flags = []
+ for flag in CxxFlags.by_name.values():
+ if sum((flag in target.cxxflags for target in compile_targets)) == len(compile_targets):
+ common_link_flags.append(flag)
+
+ for target in compile_targets:
+ target.cxxflags = [flag for flag in target.cxxflags if flag not in common_compile_flags]
+ target.cxxflags.sort()
+ for target in link_targets:
+ target.cxxflags = [flag for flag in target.cxxflags if flag not in common_link_flags]
+ target.cxxflags.sort()
+
+ common_compile_flags.sort()
+ common_link_flags.sort()
+ print 'common compile flags: %s' % (' '.join(flag.name for flag in common_compile_flags))
+ print 'common link flags: %s' % (' '.join(flag.name for flag in common_link_flags))
+
+ by_flagset = dict()
+ for target in CxxTargets.by_name.values():
+ flagset = ' '.join((flag.name for flag in target.cxxflags))
+ if flagset not in by_flagset:
+ by_flagset[flagset] = list()
+ by_flagset[flagset].append(target)
+ for targetlist in by_flagset.values():
+ targetlist.sort()
+ flagsets = by_flagset.keys()
+ flagsets.sort()
+ print '%d compilerflag groups:' % (len(flagsets))
+ for flagset in flagsets:
+ print flagset
+ for target in by_flagset[flagset]:
+ print '%s' % (target)
+ print
+
+ by_flagset = dict()
+ for target in CxxTargets.by_name.values():
+ flagset = ' '.join((flag.name for flag in target.includeflags))
+ if flagset not in by_flagset:
+ by_flagset[flagset] = list()
+ by_flagset[flagset].append(target)
+ for targetlist in by_flagset.values():
+ targetlist.sort()
+ flagsets = by_flagset.keys()
+ flagsets.sort()
+ print '%d include flag groups:' % (len(flagsets))
+ for flagset in flagsets:
+ print flagset
+ for target in by_flagset[flagset]:
+ print '%s' % (target)
+ print
+
+ print 'sources:'
+ by_name = dict()
+ for target in CxxTargets.by_name.values():
+ by_name[os.path.basename(target.outputfile)] = target
+ names = by_name.keys()
+ names.sort()
+ for target in CxxTargets.by_name.values():
+ if len(target.inputfiles) > 1:
+ objects = [os.path.basename(object) for object in target.inputfiles]
+ sources = list()
+ for object in objects:
+ if object in by_name:
+ sources.append(by_name[object].inputfiles[0])
+ else:
+ sources.append('!!!!' + object)
+ sources.sort()
+ print '%s %s' % (target.getFullOutputname(), ' '.join(sources))
diff --git a/solenv/bin/checkdll.sh b/solenv/bin/checkdll.sh
new file mode 100755
index 000000000000..a9a502c7f6af
--- /dev/null
+++ b/solenv/bin/checkdll.sh
@@ -0,0 +1,83 @@
+#! /bin/sh
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+# checkdll.sh - execute checkdll with all -L arguments to this script
+# prepended to LD_LIBRARY_PATH
+
+set -- `getopt "L:" "$@"` || {
+ echo "Usage: `basename $0` [-L library_path] <shared_library>" 1>&2
+ exit 1
+}
+
+checkdll="$SOLARVERSION/$INPATH/bin$UPDMINOREXT/checkdll"
+
+if [ -x $checkdll ]; then
+ while :
+ do
+ case $1 in
+ -L) shift; option=$1;;
+ --) break;;
+ esac
+ case "${libpath+X}" in
+ X) libpath=$libpath:$option;;
+ *) libpath=$option;;
+ esac
+ shift
+ done
+ shift # remove the trailing ---
+
+ case `uname -s` in
+ Darwin) case "${DYLD_LIBRARY_PATH:+X}" in
+ X) DYLD_LIBRARY_PATH=$libpath:$DYLD_LIBRARY_PATH;;
+ *) DYLD_LIBRARY_PATH=$libpath;;
+ esac
+ export DYLD_LIBRARY_PATH;;
+ *) case "${LD_LIBRARY_PATH:+X}" in
+ X) LD_LIBRARY_PATH=$libpath:$LD_LIBRARY_PATH;;
+ *) LD_LIBRARY_PATH=$libpath;;
+ esac
+ export LD_LIBRARY_PATH;;
+ esac
+
+ $checkdll "$@"
+ if [ $? -ne 0 ]; then exit 1 ; fi
+
+ for parameter in $*; do
+ library=$parameter;
+ done
+ realname=`echo $library | sed "s/check_//"`
+ if [ $library != $realname ]; then
+ LD_LIBRARY_PATH=
+ export LD_LIBRARY_PATH
+ mv $library $realname
+ fi
+else
+ echo "WARNING: checkdll not found!" 1>&2
+fi
+
+exit 0
+
diff --git a/solenv/bin/chrel.sed b/solenv/bin/chrel.sed
new file mode 100644
index 000000000000..19455b00c252
--- /dev/null
+++ b/solenv/bin/chrel.sed
@@ -0,0 +1,2 @@
+s/\(\.\.\/\)\{2,4\}/..\//g
+s/\(\.\.\\\)\{2,4\}/..\\/g
diff --git a/solenv/bin/cleandiff.pl b/solenv/bin/cleandiff.pl
new file mode 100644
index 000000000000..c7fc80487a7f
--- /dev/null
+++ b/solenv/bin/cleandiff.pl
@@ -0,0 +1,45 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+while (<>)
+{
+ next if /^Only in/ ;
+ next if /^diff -rc / ;
+ next if /^diff -ru / ;
+ next if /^Common sub/ ;
+
+ if ( /^---/ || /^\*\*\*/ || /^\+\+\+/ )
+ {
+ s/\\/\//g;
+ }
+
+ print ;
+}
+
diff --git a/solenv/bin/cleanzip.pl b/solenv/bin/cleanzip.pl
new file mode 100755
index 000000000000..8103a13945b1
--- /dev/null
+++ b/solenv/bin/cleanzip.pl
@@ -0,0 +1,64 @@
+#!/usr/bin/perl -w
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+sub usage
+{
+ print "Cleanup unwanted unix attributes in zip archives\n\n";
+ print "Usage:\n";
+ print "$0 archive\n\n";
+ exit(1);
+}
+
+usage() if ! defined $ARGV[0];
+
+my $filename = $ARGV[0];
+use Archive::Zip qw(:ERROR_CODES :CONSTANTS);
+my $zip = Archive::Zip->new();
+
+unless ( $zip->read( $filename ) == AZ_OK ) {
+ die "$0: ERROR reading $filename\n";
+}
+my @members = $zip ->members();
+
+foreach my $member ( @members ) {
+# printf ( "%o\n",$member->unixFileAttributes());
+# printf ( "%o\n",$member->unixFileAttributes() & 0b111111111111);
+ my $attribs = $member->unixFileAttributes();
+ if ( $member->isDirectory ) {
+ $attribs = $attribs & 0b101111111111;
+ $member->unixFileAttributes($attribs)
+ }
+# printf ( "%o\n",$member->unixFileAttributes());
+# printf ( "%o\n",$member->unixFileAttributes() & 0b111111111111);
+# print ( $member->fileName()."\n");
+}
+unless ( $zip->writeToFileNamed( ${filename}."_new" ) == AZ_OK ) {
+ die "$0: ERROR reading ${filename}_new\n";
+}
+rename($filename."_new", $filename);
+
diff --git a/solenv/bin/clipatchconfig.pl b/solenv/bin/clipatchconfig.pl
new file mode 100644
index 000000000000..365e0bb14950
--- /dev/null
+++ b/solenv/bin/clipatchconfig.pl
@@ -0,0 +1,133 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+use warnings;
+use strict;
+# use diagnostics;
+
+sub trim;
+sub readRedirectionValues($);
+
+my $usage =
+ "Usage is: \n clipatchconfig.pl configTemplate redirections policyConfig
+
+ configTemplate: The config file which is used for the policy assembly. It
+ contains place holders for the binding redirection.
+
+ redirections: file containing the values for oldVersion and newVersion tags
+ which are used in the BindingRedirect element of the config files.
+
+ policyConfig: Name of the file in which we want to write the config file.
+";
+
+
+if (scalar @ARGV < 3) {
+ print $usage;
+ exit -1;
+}
+
+
+my %redirectionValue = readRedirectionValues($ARGV[1]);
+#print "|$_| |$redirectionValue{$_}|\n", for keys %redirectionValue;
+
+
+#Read config file in which we will replace the versions
+$/ = undef;
+open TEMPLATE, $ARGV[0] or die $!;
+my $templ = <TEMPLATE>;
+
+#Open the config file we are goint to write to
+open CONFIG, "> $ARGV[2]" or die "Cannot write to $ARGV[2] $!";
+
+#No substitute the place holders for oldVersion and new Version in the config template with
+#the values obtained from the redirections file
+for (keys %redirectionValue) {
+ $templ=~ s/\b$_\b/$redirectionValue{$_}/;
+}
+#Write the config file
+print CONFIG $templ;
+
+#Reads the key value pairs from the files, which name must be passed in
+#the parameter. The file contains lines of the form name=value, for example
+#CLI_URETYPES_OLD_VERSION=1.1.0.0-1.1.1.0
+sub readRedirectionValues($)
+{
+ #Read in the values for the version redirection
+ open REDIR, $_[0] or die $!;
+
+ my %redirectionValues;
+
+ while (<REDIR>)
+ {
+ chomp;
+ my $trimmed;
+ #Skip empty lines
+ if (length($trimmed = trim($_)) == 0) {
+ next;
+ }
+
+ #Skip comment symbol: #
+ if ($trimmed =~ /^#/) {
+ next;
+ }
+
+ my @lineParts = split /=/,$_;
+
+ #Check if we have valid name value pairs.
+ if (scalar @lineParts != 2) {
+ print "Error: Values in $ARGV[1] are not correct (Entries must have the form name=value). Invalid line: \n$_\n";
+ exit -1;
+ }
+
+ #Trim the strings and check if they still contain characters
+ my $name = trim($lineParts[0]);
+ my $value = trim($lineParts[1]);
+ if (length($name) == 0 || length($value) == 0) {
+ print "Error: Values in $ARGV[1] are not correct. Invalid line: \n$_\n";
+ exit -1;
+ }
+
+ #Check if we have duplicate key names
+ for (keys %redirectionValues) {
+ if ( $name eq $_) {
+ print "Error: Values in $ARGV[1] are not correct. The name $_ is not unique.\n";
+ exit -1;
+ }
+ }
+
+ $redirectionValues{$name} = $value;
+ }
+ return %redirectionValues;
+}
+
+sub trim($)
+{
+ my $string = shift;
+ $string =~ s/^\s+//;
+ $string =~ s/\s+$//;
+ return $string;
+} \ No newline at end of file
diff --git a/solenv/bin/convertlinks.pl b/solenv/bin/convertlinks.pl
new file mode 100644
index 000000000000..09b298bd5ea5
--- /dev/null
+++ b/solenv/bin/convertlinks.pl
@@ -0,0 +1,122 @@
+#
+# convertlinks - a perl script to make hrefs to
+# http://api.openoffice.org/common/ref relativ.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+
+use File::Find;
+
+# for the convenience of &wanted calls, including -eval statements:
+use vars qw/*name *dir/;
+*name = *File::Find::name;
+*dir = *File::Find::dir;
+@files = ();
+
+if($#ARGV == 1)
+{
+ $pattern = "www";
+} else
+{
+ $pattern = $ARGV[2];
+}
+
+find(\&wanted, "$ARGV[0]");
+
+$return = 1;
+
+foreach $i (@files)
+{
+ next if( $i->{directory} =~ /.*common((\/|\\)ref(.*))/ ||
+ $i->{directory} =~ /.*cpp((\/|\\)ref(.*))/ ||
+ $i->{directory} =~ /.*java((\/|\\)ref(.*))/ );
+
+ open ( FILEIN, $i->{filename} ) || die "could not open $i->{filename} for reading";
+
+ $relPath = ".";
+ $relToSource = ".";
+ if( $i->{directory} =~ /.*$pattern((\/|\\)(.*))/ )
+ {
+ $relPath = $3;
+ $relPath =~ s#\w+#\.\.#go;
+ if($pattern eq "examples")
+ {
+ $relPath = "\.\.\/$relPath";
+ }
+ if($pattern eq "www")
+ {
+ $relToSource = "\.\.\/$relPath";
+ } else
+ {
+ $relToSource = $relPath;
+ }
+ } else
+ {
+ if($pattern eq "examples")
+ {
+ $relPath = "\.\.";
+ }
+ if($pattern eq "www")
+ {
+ $relToSource = "\.\.";
+ } else
+ {
+ $relToSource = $relPath;
+ }
+ }
+
+ @lines = <FILEIN>;
+ close( FILEIN );
+ open( FILEOUT, ">$i->{filename}.tmp" ) || die "could not open $i->{filename} for writing";
+ foreach $_ (@lines)
+ {
+ # change the refenreces to the index in dependency of UDK or ODK
+ if("$ARGV[1]" eq "udk_" | "$ARGV[1]" eq "odk_")
+ {
+ s#((\")(index.html\"))#$2$ARGV[1]$3#go;
+ s#((\/|\")(faq.html\"))#$2$ARGV[1]$3#go;
+ s#((\/|\")(bylaws.html\"))#$2$ARGV[1]$3#go;
+ }
+
+ s#((http:\/\/api\.openoffice\.org\/)(common\/ref[^\"]+))#$relPath\/$3#go;
+ s#((http:\/\/api\.openoffice\.org\/unbranded-source\/)(.*)(examples\/examples.html))#$relToSource\/$4#go;
+
+ if($pattern eq "examples")
+ {
+ # change the links for the C++/Java examples in the ODK
+ s#((http:\/\/api\.openoffice\.org\/source\/browse\/api\/odk\/examples\/)(java\/*))#$3#go;
+ s#((http:\/\/api\.openoffice\.org\/source\/browse\/api\/odk\/examples\/)(cpp\/*))#$3#go;
+ s#((http:\/\/api\.openoffice\.org\/source\/browse\/api\/odk\/examples\/)(basic\/*))#$3#go;
+ s#((http:\/\/api\.openoffice\.org\/source\/browse\/api\/odk\/examples\/)(OLE\/*))#$3#go;
+
+ # change link api specific stuff
+ s#((http:\/\/api\.openoffice\.org\/)(design_guide.html))#$relPath\/www\/$3#go;
+ s#(http:\/\/api\.openoffice\.org\/index.html)#$relPath\/www\/odk_index.html#go;
+
+ # change the links for the C++ examples in the UDK
+ s#((http:\/\/udk\.openoffice\.org\/source\/browse\/udk\/product\/examples\/)(cpp\/*))#$3#go;
+
+ # change the links to udk.openoffice.org to relativ links
+ s#(http:\/\/udk\.openoffice\.org\/index.html)#$relPath\/www\/udk_index.html#go;
+ s#((http:\/\/udk\.openoffice\.org)(\/*))#$relPath\/www$3#go;
+
+ # change the link to tutorial
+ s#((http:\/\/api\.openoffice\.org\/)(basic\/man\/tutorial\/tutorial.pdf))#$relPath\/www\/$3#go;
+ }
+ print FILEOUT $_;
+ }
+ close FILEOUT;
+ chmod 0666, $i->{filename};
+ rename "$i->{filename}.tmp", $i->{filename} || die "could not rename $i->{filename}.tmp to $i->{filename}";
+ $return = 0;
+}
+
+exit $return;
+
+sub wanted {
+ %file = (
+ directory => $dir,
+ filename => $name
+ );
+ push @files, {%file} if /^.*\.html\z/s;
+}
diff --git a/solenv/bin/converttags.pl b/solenv/bin/converttags.pl
new file mode 100644
index 000000000000..aa2fe63c6ce8
--- /dev/null
+++ b/solenv/bin/converttags.pl
@@ -0,0 +1,94 @@
+#
+# converttags - a perl script to coonvert some predefined tags
+# to user specified values
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+
+if($#ARGV == -1)
+{
+ die "No parameters were specified.\nperl converttags.pl <mode> <title> <productname> [<color1>] [<color2>] file_1 [... file_n]\n";
+}
+if($#ARGV < 2)
+{
+ die "No file were specified -> no file must be converted!\n";
+}
+
+# mode = 1 -> convert
+# = 2 -> exit without conversion
+$mode = shift @ARGV;
+
+$title = shift @ARGV;
+$productname = shift @ARGV;
+
+$color1 = "";
+$color2 = "";
+
+if( $mode =~ s/2/$1/go )
+{
+ exit 0;
+}
+
+if( $ARGV[0] =~ s/(#[\w]{6})/$1/go )
+{
+ $color1 = shift @ARGV;
+}
+if( $ARGV[0] =~ s/(#[\w]{6})/$1/go )
+{
+ $color2 = shift @ARGV;
+}
+
+print "$title\n";
+print "$productname\n";
+print "$color1\n";
+print "$color2\n";
+
+$return = 0;
+
+while (@ARGV)
+{
+ my $lineCount = 0;
+ $ARGV = shift @ARGV;
+ print "convert tags: $ARGV ";
+
+ open ( FILEIN, $ARGV ) || die "could not open $ARGV for reading";
+ @lines = <FILEIN>;
+ close( FILEIN );
+ open( FILEOUT, ">$ARGV.tmp" ) || die "could not open $ARGV.tmp for writing";
+
+
+ foreach $_ (@lines)
+ {
+ $lineCount++;
+ if ( $lineCount == 10 )
+ {
+ $lineCount = 0;
+ print ".";
+ }
+ # change [TITLE] tag
+ s#\[TITLE\]#$title#go;
+
+ # change [PRODUCTNAME] tag
+ s#\[PRODUCTNAME\]#$productname#go;
+
+ # change color #003399 to #$color1 if color1 was specified!
+ if ( ! "$color1" eq "" )
+ {
+ s/#003399/$color1/go;
+ }
+
+ # change color #99CCFF to #$color2 if color2 was specified!
+ if ( ! "$color2" eq "" )
+ {
+ s/#99CCFF/$color2/go;
+ }
+ print FILEOUT $_;
+ }
+ print " OK\n";
+
+ close FILEOUT;
+ chmod 0666, $ARGV;
+ rename "$ARGV.tmp", $ARGV || die "could not rename $ARGV.tmp to $ARGV";
+}
+
+exit $return;
diff --git a/solenv/bin/createcomponent.xslt b/solenv/bin/createcomponent.xslt
new file mode 100644
index 000000000000..7f7695d533b3
--- /dev/null
+++ b/solenv/bin/createcomponent.xslt
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:uc="http://openoffice.org/2010/uno-components">
+ <xsl:param name="uri"/>
+ <xsl:strip-space elements="*"/>
+ <xsl:template match="uc:component">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:attribute name="uri">
+ <xsl:value-of select="$uri"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+ <xsl:template match="*">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+ <xsl:template match="@*">
+ <xsl:copy/>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/solenv/bin/createpdbrelocators b/solenv/bin/createpdbrelocators
new file mode 100755
index 000000000000..40a44e8f2e7c
--- /dev/null
+++ b/solenv/bin/createpdbrelocators
@@ -0,0 +1,7 @@
+#!/bin/sh
+if [ x${SOLARENV}x = xx ]; then
+ echo createpdbrelocators: no environment found!
+ exit 1
+fi
+exec perl -w $SOLARENV/bin/createpdbrelocators.pl
+
diff --git a/solenv/bin/createpdbrelocators.btm b/solenv/bin/createpdbrelocators.btm
new file mode 100644
index 000000000000..fe68d5572f3d
--- /dev/null
+++ b/solenv/bin/createpdbrelocators.btm
@@ -0,0 +1,9 @@
+@echo off
+iff "%SOLARENV%" == "" then
+ echo Please configure environment with setsolar
+endiff
+iff "%PERL%" == "" then
+ call perl5 -I%SOLARENV%\bin\modules %SOLARENV%\bin\createpdbrelocators.pl %1&
+else
+ call %PERL% -I%SOLARENV%\bin\modules %SOLARENV%\bin\createpdbrelocators.pl %1&
+endiff
diff --git a/solenv/bin/createpdbrelocators.pl b/solenv/bin/createpdbrelocators.pl
new file mode 100644
index 000000000000..75047f3952f5
--- /dev/null
+++ b/solenv/bin/createpdbrelocators.pl
@@ -0,0 +1,82 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#*************************************************************************
+#
+# createpdbrelocators - create for pdb relocator files
+# PDB relocator files are used to find debug infos
+# for analysis of creash reports
+#
+# usage: createpdbrelocators;
+#
+#*************************************************************************
+
+use strict;
+
+#### module lookup
+
+use lib ("$ENV{SOLARENV}/bin/modules");
+use CreatePDBRelocators;
+
+#### script id #####
+
+( my $script_name = $0 ) =~ s/^.*\b(\w+)\.pl$/$1/;
+
+my $script_rev;
+my $id_str = ' $Revision: 1.5 $ ';
+$id_str =~ /Revision:\s+(\S+)\s+\$/
+ ? ($script_rev = $1) : ($script_rev = "-");
+
+print "$script_name -- version: $script_rev\n";
+
+my $inpath = $ENV{INPATH};
+my $milestone = $ENV{UPDMINOR};
+my $milestoneext = $ENV{UPDMINOREXT};
+
+if ( $ARGV[0] ) {
+ if ( $milestone && ( $milestone ne $ARGV[0] ) ) {
+ die "Error: specified milestone $ARGV[0] does not match your environment";
+ }
+ $milestone = $ARGV[0];
+}
+
+if ( !$inpath || !$milestone ) {
+ print STDERR "$script_name: INAPTH or UPDMINOR not set!\n";
+ exit(1);
+}
+my $relocators = CreatePDBRelocators->new();
+my $rc = $relocators->create_pdb_relocators($inpath, $milestoneext, "");
+
+if ( !$rc ) {
+ print STDERR "$script_name: creating PDB relocators failed!\n";
+ exit(2);
+}
+
+exit(0);
diff --git a/solenv/bin/cws b/solenv/bin/cws
new file mode 100755
index 000000000000..e8bcf5060f39
--- /dev/null
+++ b/solenv/bin/cws
@@ -0,0 +1,6 @@
+#!/bin/sh
+if [ x${SOLARENV}x = xx ]; then
+ echo No environment found, please use 'configure'
+ exit 1
+fi
+exec perl -w $SOLARENV/bin/cws.pl "$@"
diff --git a/solenv/bin/cws.btm b/solenv/bin/cws.btm
new file mode 100644
index 000000000000..31bff3ab2d0f
--- /dev/null
+++ b/solenv/bin/cws.btm
@@ -0,0 +1,11 @@
+@echo off
+iff "%SOLARENV%" == "" then
+ echo No environment found, please use 'configure' or 'setsolar'
+ goto end
+endiff
+iff "%PERL%" == "" then
+ call perl5 -I%SOLARENV%\bin\modules %SOLARENV%\bin\cws.pl %1&
+else
+ call %PERL% -I%SOLARENV%\bin\modules %SOLARENV%\bin\cws.pl %1&
+endiff
+:end
diff --git a/solenv/bin/cws.pl b/solenv/bin/cws.pl
new file mode 100644
index 000000000000..bf9ce9508d38
--- /dev/null
+++ b/solenv/bin/cws.pl
@@ -0,0 +1,2087 @@
+#!/usr/bin/perl -w
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#*************************************************************************
+#
+# cws.pl - wrap common childworkspace operations
+#
+use strict;
+use Getopt::Long;
+use File::Basename;
+use File::Path;
+use File::Copy;
+use Cwd;
+use Benchmark;
+
+#### module lookup
+my @lib_dirs;
+BEGIN {
+ if ( !defined($ENV{SOLARENV}) ) {
+ die "No environment found (environment variable SOLARENV is undefined)";
+ }
+ push(@lib_dirs, "$ENV{SOLARENV}/bin/modules");
+}
+use lib (@lib_dirs);
+
+use Cws;
+
+#### script id #####
+
+( my $script_name = $0 ) =~ s/^.*\b(\w+)\.pl$/$1/;
+
+#### globals ####
+
+# TODO: replace dummy vales with actual source_config migration milestone
+my $ooo320_source_config_milestone = 'm999';
+
+# valid command with possible abbreviations
+my @valid_commands = (
+ 'help', 'h', '?',
+ 'create',
+ 'fetch', 'f',
+ 'query', 'q',
+ 'task', 't',
+ 'eisclone',
+ 'setcurrent'
+ );
+
+# list the valid options to each command
+my %valid_options_hash = (
+ 'help' => ['help'],
+ 'create' => ['help', 'milestone', 'migration', 'hg'],
+ 'fetch' => ['help', 'milestone', 'childworkspace','platforms','noautocommon',
+ 'quiet', 'onlysolver'],
+ 'query' => ['help', 'milestone','masterworkspace','childworkspace'],
+ 'task' => ['help'],
+ 'setcurrent' => ['help', 'milestone'],
+ 'eisclone' => ['help']
+ );
+
+my %valid_commands_hash;
+for (@valid_commands) {
+ $valid_commands_hash{$_}++;
+}
+
+# set by --debug switch
+my $debug = 0;
+# set by --profile switch
+my $profile = 0;
+
+
+#### main ####
+
+my ($command, $args_ref, $options_ref) = parse_command_line();
+dispatch_command($command, $args_ref, $options_ref);
+exit(0);
+
+#### subroutines ####
+
+# Parses the command line. does prelimiary argument and option verification
+sub parse_command_line
+{
+ if (@ARGV == 0) {
+ usage();
+ exit(1);
+ }
+
+ my %options_hash;
+ Getopt::Long::Configure ("no_auto_abbrev", "no_ignorecase");
+ my $success = GetOptions(\%options_hash, 'milestone|m=s',
+ 'masterworkspace|master|M=s',
+ 'hg',
+ 'migration',
+ 'childworkspace|child|c=s',
+ 'debug',
+ 'profile',
+ 'commit|C',
+ 'platforms|p=s',
+ 'noautocommon|x=s',
+ 'onlysolver|o',
+ 'quiet|q',
+ 'help|h'
+ );
+
+ my $command = shift @ARGV;
+
+ if (!exists $valid_commands_hash{$command}) {
+ print_error("Unkown command: '$command'\n");
+ usage();
+ exit(1);
+ }
+
+ if ($command eq 'h' || $command eq '?') {
+ $command = 'help';
+ }
+ elsif ($command eq 'f') {
+ $command = 'fetch';
+ }
+ elsif ($command eq 'q') {
+ $command = 'query';
+ }
+ elsif ($command eq 't') {
+ $command = 'task';
+ }
+
+ # An unkown option might be accompanied with a valid command.
+ # Show the command specific help
+ if ( !$success ) {
+ do_help([$command])
+ }
+
+ verify_options($command, \%options_hash);
+ return ($command, \@ARGV, \%options_hash);
+}
+
+# Verify options against the valid options list.
+sub verify_options
+{
+ my $command = shift;
+ my $options_ref = shift;
+
+ my $valid_command_options_ref = $valid_options_hash{$command};
+
+ my %valid_command_options_hash;
+ foreach (@{$valid_command_options_ref}) {
+ $valid_command_options_hash{$_}++;
+ }
+
+ # check all specified options against the valid options for the sub command
+ foreach (keys %{$options_ref}) {
+ if ( /debug/ ) {
+ $debug = 1;
+ next;
+ }
+ if ( /profile/ ) {
+ $profile = 1;
+ next;
+ }
+ if (!exists $valid_command_options_hash{$_}) {
+ print_error("can't use option '--$_' with subcommand '$command'.", 1);
+ }
+ }
+
+}
+
+# Dispatches to the do_xxx() routines depending on command.
+sub dispatch_command
+{
+ my $command = shift;
+ my $args_ref = shift;
+ my $options_ref = shift;
+
+ no strict 'refs';
+ &{"do_".$command}($args_ref, $options_ref);
+}
+
+# Returns the global cws object.
+BEGIN {
+my $the_cws;
+
+ sub get_this_cws {
+ if (!defined($the_cws)) {
+ $the_cws = Cws->new();
+ return $the_cws;
+ }
+ else {
+ return $the_cws;
+ }
+ }
+}
+
+# Returns a list of the master workspaces.
+sub get_master_workspaces
+{
+ my $cws = get_this_cws();
+ my @masters = $cws->get_masters();
+
+ return wantarray ? @masters : \@masters;
+}
+
+# Checks if master argument is a valid MWS name.
+BEGIN {
+ my %master_hash;
+
+ sub is_master
+ {
+ my $master_name = shift;
+
+ if (!%master_hash) {
+ my @masters = get_master_workspaces();
+ foreach (@masters) {
+ $master_hash{$_}++;
+ }
+ }
+ return exists $master_hash{$master_name} ? 1 : 0;
+ }
+}
+
+# Fetches the current CWS from environment, returns a Cws object
+sub get_cws_from_environment
+{
+ my $child = $ENV{CWS_WORK_STAMP};
+ my $master = $ENV{WORK_STAMP};
+
+ if ( !$child ) {
+ print_error("Environment variable CWS_WORK_STAMP is not set. Please set it to your CWS name.", 2);
+ }
+
+ if ( !$master ) {
+ print_error("Environment variable WORK_STAMP is not set. Please set it to the MWS name.", 2);
+ }
+
+ my $cws = get_this_cws();
+ $cws->child($child);
+ $cws->master($master);
+
+ # Check if we got a valid child workspace.
+ my $id = $cws->eis_id();
+ if ( $debug ) {
+ print STDERR "CWS-DEBUG: ... master: $master, child: $child, $id\n";
+ }
+ if ( !$id ) {
+ print_error("Child workspace $child for master workspace $master not found in EIS database.", 2);
+ }
+ return ($cws);
+}
+
+# Fetches the CWS by name, returns a Cws object
+sub get_cws_by_name
+{
+ my $child = shift;
+
+ my $cws = get_this_cws();
+ $cws->child($child);
+
+ # Check if we got a valid child workspace.
+ my $id = $cws->eis_id();
+ if ( $debug ) {
+ print STDERR "CWS-DEBUG: child: $child, $id\n";
+ }
+ if ( !$id ) {
+ print_error("Child workspace $child not found in EIS database.", 2);
+ }
+
+ # Update masterws part of Cws object.
+ my $masterws = $cws->get_mws();
+ if ( $cws->master() ne $masterws ) {
+ # can this still happen?
+ if ( $debug ) {
+ print STDERR "CWS-DEBUG: get_cws_by_name(): fixup of masterws in cws object detected\n";
+ }
+ $cws->master($masterws);
+ }
+ return ($cws);
+}
+
+# Register child workspace with eis.
+sub register_child_workspace
+{
+ my $cws = shift;
+ my $scm = shift;
+ my $is_promotion = shift;
+
+ my $milestone = $cws->milestone();
+ my $child = $cws->child();
+ my $master = $cws->master();
+
+ # TODO: introduce a EIS_USER in the configuration, which should be used here
+ my $config = CwsConfig->new();
+ my $vcsid = $config->vcsid();
+ # TODO: there is no real need for socustom anymore, should go ASAP
+ my $socustom = $config->sointernal();
+
+ if ( !$vcsid ) {
+ if ( $socustom ) {
+ print_error("Can't determine owner for CWS '$child'. Please set VCSID environment variable.", 11);
+ }
+ else {
+ print_error("Can't determine owner for CWS '$child'. Please set CVS_ID entry in \$HOME/.cwsrc.", 11);
+ }
+ }
+
+ if ( $is_promotion ) {
+ my $rc = $cws->set_scm($scm);
+ if ( !$rc ) {
+ print_error("Failed to set the SCM property '$scm' on child workspace '$child'.\nContact EIS administrator!\n", 12);
+ }
+
+ $rc = $cws->promote($vcsid, "");
+
+ if ( !$rc ) {
+ print_error("Failed to promote child workspace '$child' to status 'new'.\n", 12);
+ }
+ else {
+ print "\n***** Successfully ***** promoted child workspace '$child' to status 'new'.\n";
+ print "Milestone: '$milestone'.\n";
+ }
+ }
+ else {
+
+ my $eis_id = $cws->register($vcsid, "");
+
+ if ( !defined($eis_id) ) {
+ print_error("Failed to register child workspace '$child' for master '$master'.", 12);
+ }
+ else {
+ my $rc = $cws->set_scm($scm);
+ if ( !$rc ) {
+ print_error("Failed to set the SCM property '$scm' on child workspace '$child'.\nContact EIS administrator!\n", 12);
+ }
+ print "\n***** Successfully ***** registered child workspace '$child'\n";
+ print "for master workspace '$master' (milestone '$milestone').\n";
+ print "Child workspace Id: $eis_id.\n";
+ }
+ }
+ return 0;
+}
+
+sub print_time_elapsed
+{
+ my $t_start = shift;
+ my $t_stop = shift;
+
+ my $time_diff = timediff($t_stop, $t_start);
+ print_message("... finished in " . timestr($time_diff));
+}
+
+sub hgrc_append_push_path_and_hooks
+{
+ my $target = shift;
+ my $cws_source = shift;
+
+ $cws_source =~ s/http:\/\//ssh:\/\/hg@/;
+ if ( $debug ) {
+ print STDERR "CWS-DEBUG: hgrc_append_push_path_and_hooks(): default-push path: '$cws_source'\n";
+ }
+ if ( !open(HGRC, ">>$target/.hg/hgrc") ) {
+ print_error("Can't append to hgrc file of repository '$target'.\n", 88);
+ }
+ print HGRC "default-push = " . "$cws_source\n";
+ print HGRC "[extensions]\n";
+ print HGRC "hgext.win32text=\n";
+ print HGRC "[hooks]\n";
+ print HGRC "# Reject commits which would introduce windows-style CR/LF files\n";
+ print HGRC "pretxncommit.crlf = python:hgext.win32text.forbidcrlf\n";
+ close(HGRC);
+}
+
+sub hg_clone_cws_or_milestone
+{
+ my $rep_type = shift;
+ my $cws = shift;
+ my $target = shift;
+ my $clone_milestone_only = shift;
+
+ my ($hg_local_source, $hg_lan_source, $hg_remote_source);
+ my $config = CwsConfig->new();
+ if ( $rep_type eq 'ooo') {
+ $hg_local_source = $config->get_ooo_hg_local_source();
+ $hg_lan_source = $config->get_ooo_hg_lan_source();
+ $hg_remote_source = $config->get_ooo_hg_remote_source();
+ }
+ else {
+ $hg_local_source = $config->get_so_hg_local_source();
+ $hg_lan_source = $config->get_so_hg_lan_source();
+ $hg_remote_source = $config->get_so_hg_remote_source();
+ }
+
+ my $masterws = $cws->master();
+ my $master_local_source = "$hg_local_source/" . $masterws;
+ my $master_lan_source = "$hg_lan_source/" . $masterws;
+
+ my $milestone_tag;
+ if ( $clone_milestone_only ) {
+ $milestone_tag = uc($masterws) . '_' . $clone_milestone_only;
+ }
+ else {
+ my @tags = $cws->get_tags();
+ $milestone_tag = $tags[3];
+ }
+
+ if ( $debug ) {
+ print STDERR "CWS-DEBUG: master_local_source: '$master_local_source'\n";
+ print STDERR "CWS-DEBUG: master_lan_source: '$master_lan_source'\n";
+ if ( !-d $master_local_source ) {
+ print STDERR "CWS-DEBUG: not a directory '$master_local_source'\n";
+ }
+ }
+
+ my $pull_from_remote = 0;
+ my $cws_remote_source;
+ if ( !$clone_milestone_only ) {
+ $cws_remote_source = "$hg_remote_source/cws/" . $cws->child();
+
+ # The outgoing repository might not yet be available. Which is not
+ # an error. Since pulling from the cws outgoing URL results in an ugly
+ # and hardly understandable error message, we check for availibility
+ # first. TODO: incorporate configured proxy instead of env_proxy. Use
+ # a dedicated request and content-type to find out if the repo is there
+ # instead of parsing the content of the page
+ print_message("... check availibility of 'outgoing' repository '$cws_remote_source'.");
+ require LWP::Simple;
+ my $content = LWP::Simple::get($cws_remote_source);
+ my $pattern = "<title>cws/". $cws->child();
+ if ( $content && $content =~ /$pattern/ ) {
+ $pull_from_remote = 1;
+ }
+ else {
+ print_message("... 'outgoing' repository '$cws_remote_source' is not accessible/available yet.");
+ }
+ }
+
+ # clone repository (without working tree if we still need to pull from remote)
+ my $clone_with_update = !$pull_from_remote;
+ hg_clone_repository($master_local_source, $master_lan_source, $target, $milestone_tag, $clone_with_update);
+
+ # now pull from the remote cws outgoing repository if its already available
+ if ( $pull_from_remote ) {
+ hg_remote_pull_repository($cws_remote_source, $target);
+ }
+
+ # if we fetched a CWS adorn the result with push-path and hooks
+ if ( $cws_remote_source ) {
+ hgrc_append_push_path_and_hooks($target, $cws_remote_source);
+ }
+
+ # update the result if necessary
+ if ( !$clone_with_update ) {
+ hg_update_repository($target);
+ }
+
+}
+
+sub hg_clone_repository
+{
+ my $local_source = shift;
+ my $lan_source = shift;
+ my $dest = shift;
+ my $milestone_tag = shift;
+ my $update = shift;
+
+ my $t1 = Benchmark->new();
+ my $source;
+ my $clone_option = $update ? '' : '-U ';
+ if ( -d $local_source && can_use_hardlinks($local_source, $dest) ) {
+ $source = $local_source;
+ if ( !hg_milestone_is_latest_in_repository($local_source, $milestone_tag) ) {
+ $clone_option .= "-r $milestone_tag";
+ }
+ print_message("... clone LOCAL repository '$local_source' to '$dest'");
+ }
+ else {
+ $source = $lan_source;
+ $clone_option .= "-r $milestone_tag";
+ print_message("... clone LAN repository '$lan_source' to '$dest'");
+ }
+ hg_clone($source, $dest, $clone_option);
+
+ my $t2 = Benchmark->new();
+ print_time_elapsed($t1, $t2) if $profile;
+}
+
+sub hg_remote_pull_repository
+{
+ my $remote_source = shift;
+ my $dest = shift;
+
+ my $t1 = Benchmark->new();
+ print_message("... pull from REMOTE repository '$remote_source' to '$dest'");
+ hg_pull($dest, $remote_source);
+ my $t2 = Benchmark->new();
+ print_time_elapsed($t1, $t2) if $profile;
+}
+
+sub hg_update_repository
+{
+ my $dest = shift;
+
+ my $t1 = Benchmark->new();
+ print_message("... update repository '$dest'");
+ hg_update($dest);
+ my $t2 = Benchmark->new();
+ print_time_elapsed($t1, $t2) if $profile;
+}
+
+sub hg_milestone_is_latest_in_repository
+{
+ my $repository = shift;
+ my $milestone_tag = shift;
+
+ # Our milestone is the lastest thing in the repository
+ # if the parent of the repository tip is adorned
+ # with the milestone tag.
+ my $tags_of_parent_of_tip = hg_parent($repository, 'tip', "--template='{tags}\\n'");
+ if ( $tags_of_parent_of_tip =~ /\b$milestone_tag\b/ ) {
+ return 1;
+ }
+ return 0;
+}
+
+# Check if clone source and destination are on the same filesystem,
+# in that case hg clone can employ hard links.
+sub can_use_hardlinks
+{
+ my $source = shift;
+ my $dest = shift;
+
+ if ( $^O eq 'cygwin' ) {
+ # no hard links on windows
+ return 0;
+ }
+ # st_dev is the first field return by stat()
+ my @stat_source = stat($source);
+ my @stat_dest = stat(dirname($dest));
+
+ if ( $debug ) {
+ my $source_result = defined($stat_source[0]) ? $stat_source[0] : 'stat failed';
+ my $dest_result = defined($stat_dest[0]) ? $stat_dest[0] : 'stat failed';
+ print STDERR "CWS-DEBUG: can_use_hardlinks(): source device: '$stat_source[0]', destination device: '$stat_dest[0]'\n";
+ }
+ if ( defined($stat_source[0]) && defined($stat_dest[0]) && $stat_source[0] == $stat_dest[0] ) {
+ return 1;
+ }
+ return 0;
+}
+
+sub query_cws
+{
+ my $query_mode = shift;
+ my $options_ref = shift;
+ # get master and child workspace
+ my $masterws = exists $options_ref->{'masterworkspace'} ? uc($options_ref->{'masterworkspace'}) : $ENV{WORK_STAMP};
+ my $childws = exists $options_ref->{'childworkspace'} ? $options_ref->{'childworkspace'} : $ENV{CWS_WORK_STAMP};
+ my $milestone = exists $options_ref->{'milestone'} ? $options_ref->{'milestone'} : 'latest';
+
+ if ( !defined($masterws) && $query_mode ne 'masters') {
+ print_error("Can't determine master workspace environment.\n", 30);
+ }
+
+ if ( ($query_mode eq 'integratedinto' || $query_mode eq 'incompatible' || $query_mode eq 'taskids' || $query_mode eq 'status' || $query_mode eq 'current' || $query_mode eq 'owner' || $query_mode eq 'qarep' || $query_mode eq 'issubversion' || $query_mode eq 'ispublic' || $query_mode eq 'build') && !defined($childws) ) {
+ print_error("Can't determine child workspace environment.\n", 30);
+ }
+
+ my $cws = Cws->new();
+ if ( defined($childws) ) {
+ $cws->child($childws);
+ }
+ if ( defined($masterws) ) {
+ $cws->master($masterws);
+ }
+
+ no strict;
+ &{"query_".$query_mode}($cws, $milestone);
+ return;
+}
+
+sub query_integratedinto
+{
+ my $cws = shift;
+
+ if ( is_valid_cws($cws) ) {
+ my $milestone = $cws->get_milestone_integrated();
+ print_message("Integrated into:");
+ print defined($milestone) ? "$milestone\n" : "unkown\n";
+ }
+ return;
+}
+
+sub query_incompatible
+{
+ my $cws = shift;
+
+ if ( is_valid_cws($cws) ) {
+ my @modules = $cws->incompatible_modules();
+ print_message("Incompatible Modules:");
+ foreach (@modules) {
+ if ( defined($_) ) {
+ print "$_\n";
+ }
+ }
+ }
+ return;
+}
+
+sub query_taskids
+{
+ my $cws = shift;
+
+ if ( is_valid_cws($cws) ) {
+ my @taskids = $cws->taskids();
+ print_message("Task ID(s):");
+ foreach (@taskids) {
+ if ( defined($_) ) {
+ print "$_\n";
+ }
+ }
+ }
+ return;
+}
+
+sub query_status
+{
+ my $cws = shift;
+
+ if ( is_valid_cws($cws) ) {
+ my $status = $cws->get_approval();
+ if ( !$status ) {
+ print_error("Internal error: can't get approval status.", 3);
+ } else {
+ print_message("Approval status:");
+ print "$status\n";
+ }
+ }
+ return;
+}
+
+sub query_scm
+{
+ my $cws = shift;
+ my $masterws = $cws->master();
+ my $childws = $cws->child();
+
+ if ( is_valid_cws($cws) ) {
+ my $scm = $cws->get_scm();
+ if ( !defined($scm) ) {
+ print_error("Internal error: can't retrieve scm info.", 3);
+ } else {
+ print_message("Child workspace uses '$scm'.");
+ }
+ }
+ return;
+}
+
+sub query_ispublic
+{
+ my $cws = shift;
+ my $masterws = $cws->master();
+ my $childws = $cws->child();
+
+ if ( is_valid_cws($cws) ) {
+ my $ispublic = $cws->get_public_flag();
+ if ( !defined($ispublic) ) {
+ print_error("Internal error: can't get isPublic flag.", 3);
+ } else {
+ if ( $ispublic==1 ) {
+ print_message("Child workspace is public");
+ } else {
+ print_message("Child workspace is internal");
+ }
+ }
+ }
+
+ return;
+}
+
+sub query_current
+{
+ my $cws = shift;
+
+ if ( is_valid_cws($cws) ) {
+ my $milestone = $cws->milestone();
+ if ( !$milestone ) {
+ print_error("Internal error: can't get current milestone.", 3);
+ } else {
+ print_message("Current milestone:");
+ print "$milestone\n";
+ }
+ }
+ return;
+}
+
+sub query_owner
+{
+ my $cws = shift;
+
+ if ( is_valid_cws($cws) ) {
+ my $owner = $cws->get_owner();
+ print_message("Owner:");
+ if ( !$owner ) {
+ print "not set\n" ;
+ } else {
+ print "$owner\n";
+ }
+ }
+ return;
+}
+
+sub query_qarep
+{
+ my $cws = shift;
+
+ if ( is_valid_cws($cws) ) {
+ my $qarep = $cws->get_qarep();
+ print_message("QA Representative:");
+ if ( !$qarep ) {
+ print "not set\n" ;
+ } else {
+ print "$qarep\n";
+ }
+ }
+ return;
+}
+
+
+sub query_build
+{
+ my $cws = shift;
+
+ if ( is_valid_cws($cws) ) {
+ my $build = $cws->get_build();
+ print_message("Build:");
+ if ( $build ) {
+ print "$build\n";
+ }
+ }
+ return;
+}
+
+sub query_latest
+{
+ my $cws = shift;
+
+ my $masterws = $cws->master();
+ my $latest = $cws->get_current_milestone($masterws);
+
+
+ if ( $latest ) {
+ print_message("Master workspace '$masterws':");
+ print_message("Latest milestone available for update:");
+ print "$masterws $latest\n";
+ }
+ else {
+ print_error("Can't determine latest milestone of '$masterws' available for update.", 3);
+ }
+
+ return;
+}
+
+sub query_masters
+{
+ my $cws = shift;
+
+ my @mws = $cws->get_masters();
+ my $list="";
+
+ if ( @mws ) {
+ foreach (@mws) {
+ if ( $list ne "" ) {
+ $list .= ", ";
+ }
+ $list .= $_;
+ }
+ print_message("Master workspaces available: $list");
+ }
+ else {
+ print_error("Can't determine masterworkspaces.", 3);
+ }
+
+ return;
+}
+
+sub query_milestones
+{
+ my $cws = shift;
+ my $masterws = $cws->master();
+
+ my @milestones = $cws->get_milestones($masterws);
+ my $list="";
+
+ if ( @milestones ) {
+ foreach (@milestones) {
+ if ( $list ne "" ) {
+ $list .= ", ";
+ }
+ $list .= $_;
+ }
+ print_message("Master workspace '$masterws':");
+ print_message("Milestones known on Master: $list");
+ }
+ else {
+ print_error("Can't determine milestones of '$masterws'.", 3);
+ }
+
+ return;
+}
+
+sub query_ispublicmaster
+{
+ my $cws = shift;
+ my $masterws = $cws->master();
+
+ my $ispublic = $cws->get_publicmaster_flag();
+ my $list="";
+
+ if ( defined($ispublic) ) {
+ print_message("Master workspace '$masterws':");
+ if ( !defined($ispublic) ) {
+ print_error("Internal error: can't get isPublicMaster flag.", 3);
+ } else {
+ if ( $ispublic==1 ) {
+ print_message("Master workspace is public");
+ } else {
+ print_message("Master workspace is internal");
+ }
+ }
+ }
+ else {
+ print_error("Can't determine isPublicMaster flag of '$masterws'.", 3);
+ }
+
+ return;
+}
+
+sub query_buildid
+{
+ my $cws = shift;
+ my $milestone = shift;
+
+ my $masterws = $cws->master();
+ if ( $milestone eq 'latest' ) {
+ $milestone = $cws->get_current_milestone($masterws);
+ }
+
+ if ( !$milestone ) {
+ print_error("Can't determine latest milestone of '$masterws'.", 3);
+ }
+
+ if ( !$cws->is_milestone($masterws, $milestone) ) {
+ print_error("Milestone '$milestone' is no a valid milestone of '$masterws'.", 3);
+ }
+
+ my $buildid = $cws->get_buildid($masterws, $milestone);
+
+
+ if ( $buildid ) {
+ print_message("Master workspace '$masterws':");
+ print_message("BuildId for milestone '$milestone':");
+ print("$buildid\n");
+ }
+
+ return;
+}
+
+sub query_integrated
+{
+ my $cws = shift;
+ my $milestone = shift;
+
+ my $masterws = $cws->master();
+ if ( $milestone eq 'latest' ) {
+ $milestone = $cws->get_current_milestone($masterws);
+ }
+
+ if ( !$milestone ) {
+ print_error("Can't determine latest milestone of '$masterws'.", 3);
+ }
+
+ if ( !$cws->is_milestone($masterws, $milestone) ) {
+ print_error("Milestone '$milestone' is no a valid milestone of '$masterws'.", 3);
+ }
+
+ my @integrated_cws = $cws->get_integrated_cws($masterws, $milestone);
+
+
+ if ( @integrated_cws ) {
+ print_message("Master workspace '$masterws':");
+ print_message("Integrated CWSs for milestone '$milestone':");
+ foreach (@integrated_cws) {
+ print "$_\n";
+ }
+ }
+
+ return;
+}
+
+sub query_approved
+{
+ my $cws = shift;
+
+ my $masterws = $cws->master();
+
+ my @approved_cws = $cws->get_cws_with_state($masterws, 'approved by QA');
+
+ if ( @approved_cws ) {
+ print_message("Master workspace '$masterws':");
+ print_message("CWSs approved by QA:");
+ foreach (@approved_cws) {
+ print "$_\n";
+ }
+ }
+
+ return;
+}
+
+sub query_nominated
+{
+ my $cws = shift;
+
+ my $masterws = $cws->master();
+
+ my @nominated_cws = $cws->get_cws_with_state($masterws, 'nominated');
+
+ if ( @nominated_cws ) {
+ print_message("Master workspace '$masterws':");
+ print_message("Nominated CWSs:");
+ foreach (@nominated_cws) {
+ print "$_\n";
+ }
+ }
+
+ return;
+}
+
+sub query_ready
+{
+ my $cws = shift;
+
+ my $masterws = $cws->master();
+
+ my @ready_cws = $cws->get_cws_with_state($masterws, 'ready for QA');
+
+ if ( @ready_cws ) {
+ print_message("Master workspace '$masterws':");
+ print_message("CWSs ready for QA:");
+ foreach (@ready_cws) {
+ print "$_\n";
+ }
+ }
+
+ return;
+}
+
+sub query_new
+{
+ my $cws = shift;
+
+ my $masterws = $cws->master();
+
+ my @ready_cws = $cws->get_cws_with_state($masterws, 'new');
+
+ if ( @ready_cws ) {
+ print_message("Master workspace '$masterws':");
+ print_message("CWSs with state 'new':");
+ foreach (@ready_cws) {
+ print "$_\n";
+ }
+ }
+
+ return;
+}
+
+sub query_planned
+{
+ my $cws = shift;
+
+ my $masterws = $cws->master();
+
+ my @ready_cws = $cws->get_cws_with_state($masterws, 'planned');
+
+ if ( @ready_cws ) {
+ print_message("Master workspace '$masterws':");
+ print_message("CWSs with state 'planned':");
+ foreach (@ready_cws) {
+ print "$_\n";
+ }
+ }
+
+ return;
+}
+
+sub is_valid_cws
+{
+ my $cws = shift;
+
+ my $masterws = $cws->master();
+ my $childws = $cws->child();
+ # check if we got a valid child workspace
+ my $id = $cws->eis_id();
+ if ( !$id ) {
+ print_error("Child workspace '$childws' for master workspace '$masterws' not found in EIS database.", 2);
+ }
+ print STDERR "Master workspace '$masterws', child workspace '$childws'\n";
+ return 1;
+}
+
+sub query_release
+{
+ my $cws = shift;
+
+ if ( is_valid_cws($cws) ) {
+ my $release = $cws->get_release();
+ print_message("Release target:");
+ if ( !$release ) {
+ print "not set\n";
+ } else {
+ print "$release\n";
+ }
+ }
+ return;
+}
+
+sub query_due
+{
+ my $cws = shift;
+
+ if ( is_valid_cws($cws) ) {
+ my $due = $cws->get_due_date();
+ print_message("Due date:");
+ if ( !$due ) {
+ print "not set\n";
+ } else {
+ print "$due\n";
+ }
+ }
+ return;
+}
+
+sub query_due_qa
+{
+ my $cws = shift;
+
+ if ( is_valid_cws($cws) ) {
+ my $due_qa = $cws->get_due_date_qa();
+ print_message("Due date (QA):");
+ if ( !$due_qa ) {
+ print "not set\n";
+ } else {
+ print "$due_qa\n";
+ }
+ }
+ return;
+}
+
+sub query_help
+{
+ my $cws = shift;
+
+ if ( is_valid_cws($cws) ) {
+ my $help = $cws->is_helprelevant();
+ print_message("Help relevant:");
+ if ( !$help ) {
+ print "false\n";
+ } else {
+ print "true\n";
+ }
+ }
+ return;
+}
+
+sub query_ui
+{
+ my $cws = shift;
+
+ if ( is_valid_cws($cws) ) {
+ my $help = $cws->is_uirelevant();
+ print_message("UI relevant:");
+ if ( !$help ) {
+ print "false\n";
+ } else {
+ print "true\n";
+ }
+ }
+ return;
+}
+
+sub verify_milestone
+{
+ my $cws = shift;
+ my $qualified_milestone = shift;
+
+ my $invalid = 0;
+ my ($master, $milestone);
+ $invalid++ if $qualified_milestone =~ /-/;
+
+ if ( $qualified_milestone =~ /:/ ) {
+ ($master, $milestone) = split(/:/, $qualified_milestone);
+ $invalid++ unless ( $master && $milestone );
+ }
+ else {
+ $milestone = $qualified_milestone;
+ }
+
+ if ( $invalid ) {
+ print_error("Invalid milestone", 0);
+ usage();
+ exit(1);
+ }
+
+ $master = $cws->master() if !$master;
+ if ( !$cws->is_milestone($master, $milestone) ) {
+ print_error("Milestone '$milestone' is not registered with master workspace '$master'.", 21);
+ }
+ return ($master, $milestone);
+}
+
+sub relink_workspace {
+ my $linkdir = shift;
+ my $restore = shift;
+
+ # The list of obligatorily added modules, build will not work
+ # if these are not present.
+ my %added_modules_hash;
+ if (defined $ENV{ADDED_MODULES}) {
+ for ( split(/\s/, $ENV{ADDED_MODULES}) ) {
+ $added_modules_hash{$_}++;
+ }
+ }
+
+ # clean out pre-existing linkdir
+ my $bd = dirname($linkdir);
+ if ( !opendir(DIR, $bd) ) {
+ print_error("Can't open directory '$bd': $!.", 44);
+ }
+ my @old_link_dirs = grep { /^src.m\d+/ } readdir(DIR);
+ close(DIR);
+
+ if ( @old_link_dirs > 1 ) {
+ print_error("Found more than one old link directories:", 0);
+ foreach (@old_link_dirs) {
+ print STDERR "@old_link_dirs\n";
+ }
+ if ( $restore ) {
+ print_error("Please remove all old link directories but the last one", 67);
+ }
+ }
+
+ # Originally the extension .lnk indicated a linked module. This turned out to be
+ # not an overly smart choice. Cygwin has some heuristics which regards .lnk
+ # files as Windows shortcuts, breaking the build. Use .link instead.
+ # When in restoring mode still consider .lnk as link to modules (for old CWSs)
+ my $old_link_dir = "$bd/" . $old_link_dirs[0];
+ if ( $restore ) {
+ if ( !opendir(DIR, $old_link_dir) ) {
+ print_error("Can't open directory '$old_link_dir': $!.", 44);
+ }
+ my @links = grep { !(/\.lnk/ || /\.link/) } readdir(DIR);
+ close(DIR);
+ # everything which is not a link to a directory can't be an "added" module
+ foreach (@links) {
+ next if /^\./;
+ my $link = "$old_link_dir/$_";
+ if ( -s $link && -d $link ) {
+ $added_modules_hash{$_} = 1;
+ }
+ }
+ }
+ print_message("... removing '$old_link_dir'");
+ rmtree([$old_link_dir], 0);
+
+ print_message("... (re)create '$linkdir'");
+ if ( !mkdir("$linkdir") ) {
+ print_error("Can't create directory '$linkdir': $!.", 44);
+ }
+ if ( !opendir(DIR, "$bd/ooo") ) {
+ print_error("Can't open directory '$bd/sun': $!.", 44);
+ }
+ my @ooo_top_level_dirs = grep { !/^\./ } readdir(DIR);
+ close(DIR);
+ if ( !opendir(DIR, "$bd/sun") ) {
+ print_error("Can't open directory '$bd/sun': $!.", 44);
+ }
+ my @so_top_level_dirs = grep { !/^\./ } readdir(DIR);
+ close(DIR);
+ my $savedir = getcwd();
+ if ( !chdir($linkdir) ) {
+ print_error("Can't chdir() to directory '$linkdir': $!.", 44);
+ }
+ my $suffix = '.link';
+ foreach(@ooo_top_level_dirs) {
+ if ( $_ eq 'REBASE.LOG' || $_ eq 'REBASE.CONFIG_DONT_DELETE' ) {
+ next;
+ }
+ my $target = $_;
+ if ( -d "../ooo/$_" && !exists $added_modules_hash{$_} ) {
+ $target .= $suffix;
+ }
+ if ( !symlink("../ooo/$_", $target) ) {
+ print_error("Can't symlink directory '../ooo/$_ -> $target': $!.", 44);
+ }
+ }
+ foreach(@so_top_level_dirs) {
+ if ( $_ eq 'REBASE.LOG' || $_ eq 'REBASE.CONFIG_DONT_DELETE' ) {
+ next;
+ }
+ my $target = $_;
+ if ( -d "../sun/$_" && !exists $added_modules_hash{$_} ) {
+ $target .= $suffix;
+ }
+ if ( !symlink("../sun/$_", $target) ) {
+ print_error("Can't symlink directory '../sun/$_ -> $target': $!.", 44);
+ }
+ }
+ if ( !chdir($savedir) ) {
+ print_error("Can't chdir() to directory '$linkdir': $!.", 44);
+ }
+}
+
+sub fetch_external_tarballs
+{
+ my $source_root_dir = shift;
+ my $external_tarballs_source = shift;
+
+ my $ooo_external_file = "$source_root_dir/ooo/ooo.lst";
+ my $sun_external_file = "$source_root_dir/sun/sun.lst";
+ my $sun_path = "$source_root_dir/sun";
+
+ my @external_sources_list;
+ push(@external_sources_list, read_external_file($ooo_external_file));
+ if ( -d $sun_path ) {
+ if ( -e $sun_external_file ) {
+ push(@external_sources_list, read_external_file($sun_external_file));
+ }
+ else {
+ print_error("Can't find external file list '$sun_external_file'.", 8);
+ }
+ }
+
+ my $ext_sources_dir = "$source_root_dir/ext_sources";
+ print_message("Copy external tarballs to '$ext_sources_dir'");
+ if ( ! -d $ext_sources_dir) {
+ if ( !mkdir($ext_sources_dir) ) {
+ print_error("Can't create directory '$ext_sources_dir': $!.", 44);
+ }
+ }
+ foreach (@external_sources_list) {
+ if ( ! copy("$external_tarballs_source/$_", $ext_sources_dir) ) {
+ print_error("Can't copy file '$external_tarballs_source' -> '$ext_sources_dir': $!", 0);
+ }
+ }
+ return;
+}
+
+sub read_external_file
+{
+ my $external_file = shift;
+
+ my @external_sources;
+ open(EXT, "<$external_file") or print_error("Can't open file '$external_file' for reading: $!", 98);
+ while(<EXT>) {
+ if ( !/^http:/ ) {
+ chomp;
+ push(@external_sources, $_);
+ }
+ }
+ close(EXT);
+ return @external_sources;
+}
+
+sub update_solver
+{
+ my $platform = shift;
+ my $source = shift;
+ my $solver = shift;
+ my $milestone = shift;
+ my $source_config = shift;
+
+ my @zip_sub_dirs = ('bin', 'doc', 'idl', 'inc', 'lib', 'par', 'pck', 'pdb', 'pus', 'rdb', 'res', 'xml', 'sdf');
+
+ use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
+
+ my $platform_solver = "$solver/$platform";
+
+ if ( -d $platform_solver ) {
+ print_message("... removing old solver for platform '$platform'");
+ if ( !rmtree([$platform_solver]) ) {
+ print_error("Can't remove directory '$platform_solver': $!.", 44);
+ }
+ }
+
+ if ( !mkdir("$platform_solver") ) {
+ print_error("Can't create directory '$platform_solver': $!.", 44);
+ }
+
+ my $platform_source = "$source/$platform/zip.$milestone";
+ if ( !opendir(DIR, "$platform_source") ) {
+ print_error("Can't open directory '$platform_source': $!.", 44);
+ }
+ my @zips = grep { /\.zip$/ } readdir(DIR);
+ close(DIR);
+
+ my $nzips = @zips;
+ print_message("... unzipping $nzips zip archives for platform '$platform'");
+
+
+ foreach(@zips) {
+ my $zip = Archive::Zip->new();
+ unless ( $zip->read( "$platform_source/$_" ) == AZ_OK ) {
+ print_error("Can't read zip file '$platform_source/$_': $!.", 44);
+ }
+ # TODO: check for erorrs
+ foreach (@zip_sub_dirs) {
+ my $extract_destination = $source_config ? "$platform_solver/$_" : "$platform_solver/$_.$milestone";
+ unless ( $zip->extractTree($_, $extract_destination) == AZ_OK ) {
+ print_error("Can't extract stream from zip file '$platform_source/$_': $!.", 44);
+ }
+ }
+ }
+}
+
+# TODO: special provisions for "source_config" migration, remove this
+# some time after migration
+sub get_source_config_for_milestone
+{
+ my $masterws = shift;
+ my $milestone = shift;
+
+ my $milestone_sequence_number = extract_milestone_sequence_number($milestone);
+ my $ooo320_migration_sequence_number = extract_milestone_sequence_number($ooo320_source_config_milestone);
+
+ my $source_config = 1;
+ if ( $masterws eq 'OOO320' ) {
+ if ( $milestone_sequence_number < $ooo320_migration_sequence_number ) {
+ $source_config = 0;
+ }
+ }
+ return $source_config;
+}
+
+sub extract_milestone_sequence_number
+{
+ my $milestone = shift;
+
+ my $milestone_sequence_number;
+ if ( $milestone =~ /m(\d+)/ ) {
+ $milestone_sequence_number = $1;
+ }
+ else {
+ print_error("can't extract milestone sequence number from milestone '$milestone'", 99);
+ }
+ return $milestone_sequence_number;
+}
+
+# Executes the help command.
+sub do_help
+{
+ my $args_ref = shift;
+ my $options_ref = shift;
+
+ if (@{$args_ref} == 0) {
+ print STDERR "usage: cws <subcommand> [options] [args]\n";
+ print STDERR "Type 'cws help <subcommand>' for help on a specific subcommand.\n";
+ print STDERR "\n";
+ print STDERR "Available subcommands:\n";
+ print STDERR "\thelp (h,?)\n";
+ print STDERR "\tcreate\n";
+ print STDERR "\tfetch (f)\n";
+ print STDERR "\tquery (q)\n";
+ print STDERR "\ttask (t)\n";
+ print STDERR "\tsetcurrent\n";
+ print STDERR "\teisclone *** release engineers only ***\n";
+ }
+
+ my $arg = $args_ref->[0];
+
+ if (!defined($arg) || $arg eq 'help') {
+ print STDERR "help (h, ?): Describe the usage of this script or its subcommands\n";
+ print STDERR "usage: help [subcommand]\n";
+ }
+ elsif ($arg eq 'create') {
+ print STDERR "create: Create a new child workspace\n";
+ print STDERR "usage: create [-m milestone] <master workspace> <child workspace>\n";
+ print STDERR "\t-m milestone: Milestone to base the child workspace on. If ommitted the\n";
+ print STDERR "\t last published milestone will be used.\n";
+ print STDERR "\t--milestone milestone: Same as -m milestone.\n";
+ }
+ elsif ($arg eq 'task') {
+ print STDERR "task: Add a task to a child workspace\n";
+ print STDERR "usage: task <task id> [task id ...]\n";
+ }
+ elsif ($arg eq 'query') {
+ print STDERR "query: Query child workspace for miscellaneous information\n";
+ print STDERR "usage: query [-M master] [-c child] <current|integratedinto|incompatible|owner|qarep|status|taskids>\n";
+ print STDERR " query [-M master] [-c child] <release|due|due_qa|help|ui|ispublic|scm|build>\n";
+ print STDERR " query [-M master] <latest|milestones|ispublicmaster>\n";
+ print STDERR " query <masters>\n";
+ print STDERR " query [-M master] [-m milestone] <integrated|buildid>\n";
+ print STDERR " query [-M master] <planned|new|approved|nominated|ready>\n";
+ print STDERR "\t-M master:\t\toverride MWS specified in environment\n";
+ print STDERR "\t-c child:\t\toverride CWS specified in environment\n";
+ print STDERR "\t-m milestone:\t\toverride latest milestone with specified one\n";
+ print STDERR "\t--master master:\tSame as -M master\t\n";
+ print STDERR "\t--child child:\t\tSame -c child\n";
+ print STDERR "\t--milestone milestone:\tSame as -m milestone\n";
+ print STDERR "Modes:\n";
+ print STDERR "\tcurrent\t\tquery current milestone of CWS\n";
+ print STDERR "\tincompatible\tquery modules which should be build incompatible\n";
+ print STDERR "\towner\t\tquery CWS owner\n";
+ print STDERR "\tqarep\t\tquery CWS QA Representative\n";
+ print STDERR "\tstatus\t\tquery approval status of CWS\n";
+ print STDERR "\ttaskids\t\tquery taskids to be handled on the CWS\n";
+ print STDERR "\trelease\t\tquery for target release of CWS\n";
+ print STDERR "\tdue\t\tquery for due date of CWS\n";
+ print STDERR "\tdue_qa\t\tquery for due date (QA) of CWS\n";
+ print STDERR "\thelp\t\tquery if the CWS is help relevant\n";
+ print STDERR "\tui\t\tquery if the CWS is UI relevant\n";
+ print STDERR "\tbuild\t\tquery build String for CWS\n";
+ print STDERR "\tlatest\t\tquery the latest milestone available for resync\n";
+ print STDERR "\tbuildid\t\tquery build ID for milestone\n";
+ print STDERR "\tintegrated\tquery integrated CWSs for milestone\n";
+ print STDERR "\tintegratedinto\tquery milestone which CWS was integrated into\n";
+ print STDERR "\tplanned\t\tquery for planned CWSs\n";
+ print STDERR "\tnew\t\tquery for new CWSs\n";
+ print STDERR "\tapproved\tquery CWSs approved by QA\n";
+ print STDERR "\tnominated\tquery nominated CWSs\n";
+ print STDERR "\tready\t\tquery CWSs ready for QA\n";
+ print STDERR "\tispublic\tquery public flag of CWS\n";
+ print STDERR "\tscm\t\tquery Source Control Management (SCM) system used for CWS\n";
+ print STDERR "\tmasters\t\tquery available MWS\n";
+ print STDERR "\tmilestones\tquery which milestones are know on the given MWS\n";
+ print STDERR "\tispublicmaster\tquery public flag of MWS\n";
+
+ }
+ elsif ($arg eq 'fetch') {
+ print STDERR "fetch: fetch a milestone or CWS\n";
+ print STDERR "usage: fetch [-q] [-p platforms] [-o] <-m milestone> <workspace>\n";
+ print STDERR "usage: fetch [-q] [-p platforms] [-o] <-c cws> <workspace>\n";
+ print STDERR "usage: fetch [-q] [-x platforms] [-o] <-m milestone> <workspace>\n";
+ print STDERR "usage: fetch [-q] [-x platforms] [-o] <-c cws> <workspace>\n";
+ print STDERR "usage: fetch [-q] <-m milestone> <workspace>\n";
+ print STDERR "usage: fetch [-q] <-c cws> <workspace>\n";
+ print STDERR "\t-m milestone: Checkout milestone <milestone> to workspace <workspace>\n";
+ print STDERR "\t Use 'latest' for the for lastest published milestone on the current master\n";
+ print STDERR "\t For cross master checkouts use the form <MWS>:<milestone>\n";
+ print STDERR "\t--milestone milestone: Same as -m milestone\n";
+ print STDERR "\t-c childworkspace: Checkout CWS <childworkspace> to workspace <workspace>\n";
+ print STDERR "\t--child childworkspace: Same as -c childworkspace\n";
+ print STDERR "\t-p platform: Copy one or more prebuilt platforms 'platform'. \n";
+ print STDERR "\t Separate multiple platforms with commas.\n";
+ print STDERR "\t Automatically adds 'common[.pro]' as required.\n";
+ print STDERR "\t--platforms platform: Same as -p\n";
+ print STDERR "\t-x platform: Copy one or more prebuilt platforms 'platform'. \n";
+ print STDERR "\t Separate multiple platforms with commas.\n";
+ print STDERR "\t Does not automatically adds 'common[.pro]'.\n";
+ print STDERR "\t--noautocommon platform: Same as -x\n";
+ print STDERR "\t-o: Omit checkout of sources, copy only solver. \n";
+ print STDERR "\t--onlysolver: Same as -o\n";
+ print STDERR "\t-q: Silence some of the output of the command.\n";
+ print STDERR "\t--quiet: Same as -q\n";
+ }
+ elsif ($arg eq 'setcurrent') {
+ print STDERR "setcurrent: Set the current milestone for the CWS (only hg based CWSs)\n";
+ print STDERR "usage: setcurrent [-m milestone]\n";
+ print STDERR "\t-m milestone: Set milestone to <milestone> to workspace <workspace>\n";
+ print STDERR "\t Use 'latest' for the for lastest published milestone on the current master\n";
+ print STDERR "\t For cross master change use the form <MWS>:<milestone>\n";
+ print STDERR "\t--milestone milestone: Same as -m milestone\n";
+ }
+ else {
+ print STDERR "'$arg': unknown subcommand\n";
+ exit(1);
+ }
+ exit(0);
+}
+
+# Executes the create command.
+sub do_create
+{
+ my $args_ref = shift;
+ my $options_ref = shift;
+
+ if ( exists $options_ref->{'help'} || @{$args_ref} != 2) {
+ do_help(['create']);
+ }
+
+ if ( exists $options_ref->{'hg'} ) {
+ print_warning("All childworkspaces are now hosted on Mercurial. The switch --hg is obsolete.");
+ }
+
+ my $master = uc $args_ref->[0];
+ my $cws_name = $args_ref->[1];
+
+ if (!is_master($master)) {
+ print_error("'$master' is not a valid master workspace.", 7);
+ }
+
+ # check if cws name fits the convention
+ if ( $cws_name !~ /^\w[\w\.\#]*$/ ) {
+ print_error("Invalid child workspace name '$cws_name'.\nCws names should consist of alphanumeric characters, preferable all lowercase and starting with a letter.\nThe characters . and # are allowed if they are not the first character.", 7);
+ }
+
+ my $cws = get_this_cws();
+ $cws->master($master);
+ $cws->child($cws_name);
+
+ # check if child workspace already exists
+ my $eis_id = $cws->eis_id();
+ if ( !defined($eis_id) ) {
+ print_error("Connection with EIS database failed.", 8);
+ }
+
+ my $is_promotion = 0;
+ if ( $eis_id > 0 ) {
+ if ( $cws->get_approval() eq 'planned' ) {
+ print "Promote child workspace '$cws_name' from 'planned' to 'new'.\n";
+ $is_promotion++;
+ }
+ else {
+ print_error("Child workspace '$cws_name' already exists.", 7);
+ }
+ }
+ else {
+ # check if child workspace name is still available
+ if ( !$cws->is_cws_name_available()) {
+ print_error("Child workspace name '$cws_name' is already in use.", 7);
+ }
+ }
+
+ my $milestone;
+ # verify milestone or query latest milestone
+ if ( exists $options_ref->{'milestone'} ) {
+ $milestone=$options_ref->{'milestone'};
+ # check if milestone exists
+ if ( !$cws->is_milestone($master, $milestone) ) {
+ print_error("Milestone '$milestone' is not registered with master workspace '$master'.", 8);
+ }
+ }
+ else {
+ $milestone=$cws->get_current_milestone($cws->master());
+ }
+
+ # set milestone
+ $cws->milestone($milestone);
+
+ register_child_workspace($cws, 'hg', $is_promotion);
+
+ return;
+}
+
+# Executes the fetch command.
+sub do_fetch
+{
+ my $args_ref = shift;
+ my $options_ref = shift;
+
+ my $time_fetch_start = Benchmark->new();
+ if ( exists $options_ref->{'help'} || @{$args_ref} != 1) {
+ do_help(['fetch']);
+ }
+
+ my $milestone_opt = $options_ref->{'milestone'};
+ my $child = $options_ref->{'childworkspace'};
+ my $platforms = $options_ref->{'platforms'};
+ my $noautocommon = $options_ref->{'noautocommon'};
+ my $quiet = $options_ref->{'quiet'} ? 1 : 0 ;
+ my $switch = $options_ref->{'switch'} ? 1 : 0 ;
+ my $onlysolver = $options_ref->{'onlysolver'} ? 1 : 0 ;
+
+ if ( !defined($milestone_opt) && !defined($child) ) {
+ print_error("Specify one of these options: -m or -c", 0);
+ do_help(['fetch']);
+ }
+
+ if ( defined($milestone_opt) && defined($child) ) {
+ print_error("Options -m and -c are mutally exclusive", 0);
+ do_help(['fetch']);
+ }
+
+ if ( defined($platforms) && defined($noautocommon) ) {
+ print_error("Options -p and -x are mutally exclusive", 0);
+ do_help(['fetch']);
+ }
+
+ if ( $onlysolver && !(defined($platforms) || defined($noautocommon)) ) {
+ print_error("Option '-o' is Only usuable combination with option '-p' or '-x'.", 0);
+ do_help(['fetch']);
+ }
+
+ my $cws = get_this_cws();
+ my $masterws = $ENV{WORK_STAMP};
+ if ( !defined($masterws) ) {
+ print_error("Can't determine current master workspace: check environment variable WORK_STAMP", 21);
+ }
+ $cws->master($masterws);
+ my $milestone;
+ if( defined($milestone_opt) ) {
+ if ( $milestone_opt eq 'latest' ) {
+ $cws->master($masterws);
+ my $latest = $cws->get_current_milestone($masterws);
+
+ if ( !$latest ) {
+ print_error("Can't determine latest milestone of master workspace '$masterws'.", 22);
+ }
+ $milestone = $cws->get_current_milestone($masterws);
+ }
+ else {
+ ($masterws, $milestone) = verify_milestone($cws, $milestone_opt);
+ }
+ }
+ elsif ( defined($child) ) {
+ $cws = get_cws_by_name($child);
+ $masterws = $cws->master(); # CWS can have another master than specified in ENV
+ $milestone = $cws->milestone();
+ }
+ else {
+ do_help(['fetch']);
+ }
+
+ my $config = CwsConfig->new();
+ # $so_svn_server is still required to determine if we are in SO environment
+ # TODO: change this configuration setting to something more meaningful
+ my $so_svn_server = $config->get_so_svn_server();
+ my $prebuild_dir = $config->get_prebuild_binaries_location();
+ my $external_tarball_source = $prebuild_dir;
+ # Check early for platforms so we can bail out before anything time consuming is done
+ # in case of a missing platform
+ my @platforms;
+ if ( defined($platforms) || defined($noautocommon) ) {
+ use Archive::Zip; # warn early if module is missing
+ if ( !defined($prebuild_dir ) ) {
+ print_error("PREBUILD_BINARIES not configured, can't find platform solvers", 99);
+ }
+ $prebuild_dir = "$prebuild_dir/$masterws";
+
+ if ( defined($platforms) ) {
+ @platforms = split(/,/, $platforms);
+
+ my $added_product = 0;
+ my $added_nonproduct = 0;
+ foreach(@platforms) {
+ if ( $_ eq 'common.pro' ) {
+ $added_product = 1;
+ print_warning("'$_' is added automatically to the platform list, don't specify it explicit");
+ }
+ if ( $_ eq 'common' ) {
+ $added_nonproduct = 1;
+ print_warning("'$_' is added automatically to the platform list, don't specify it explicit");
+ }
+ }
+
+ # add common.pro/common to platform list
+ if ( $so_svn_server ) {
+ my $product = 0;
+ my $nonproduct = 0;
+ foreach(@platforms) {
+ if ( /\.pro$/ ) {
+ $product = 1;
+ }
+ else {
+ $nonproduct = 1;
+ }
+ }
+ unshift(@platforms, 'common.pro') if ($product && !$added_product);
+ unshift(@platforms, 'common') if ($nonproduct && !$added_nonproduct);
+ }
+ }
+ else {
+ @platforms = split(/,/, $noautocommon);
+ }
+
+ foreach(@platforms) {
+ if ( ! -d "$prebuild_dir/$_") {
+ print_error("Can't find prebuild binaries for platform '$_'.", 22);
+ }
+ }
+
+ }
+
+ my $cwsname = $cws->child();
+ my $linkdir = $milestone_opt ? "src.$milestone" : "src." . $cws->milestone;
+
+ my $workspace = $args_ref->[0];
+
+ if ( !$onlysolver ) {
+ if ( -e $workspace ) {
+ print_error("File or directory '$workspace' already exists.", 8);
+ }
+
+ my $clone_milestone_only = $milestone_opt ? $milestone : 0;
+ if ( defined($so_svn_server) ) {
+ if ( !mkdir($workspace) ) {
+ print_error("Can't create directory '$workspace': $!.", 8);
+ }
+ my $work_master = "$workspace/$masterws";
+ if ( !mkdir($work_master) ) {
+ print_error("Can't create directory '$work_master': $!.", 8);
+ }
+ hg_clone_cws_or_milestone('ooo', $cws, "$work_master/ooo", $clone_milestone_only);
+ hg_clone_cws_or_milestone('so', $cws, "$work_master/sun", $clone_milestone_only);
+ if ( get_source_config_for_milestone($masterws, $milestone) ) {
+ # write source_config file
+ my $source_config_file = "$work_master/source_config";
+ if ( !open(SOURCE_CONFIG, ">$source_config_file") ) {
+ print_error("Can't create source_config file '$source_config_file': $!.", 8);
+ }
+ print SOURCE_CONFIG "[repositories]\n";
+ print SOURCE_CONFIG "ooo=active\n";
+ print SOURCE_CONFIG "sun=active\n";
+ close(SOURCE_CONFIG);
+ }
+ else {
+ my $linkdir = "$work_master/src.$milestone";
+ if ( !mkdir($linkdir) ) {
+ print_error("Can't create directory '$linkdir': $!.", 8);
+ }
+ relink_workspace($linkdir);
+ }
+ }
+ else {
+ hg_clone_cws_or_milestone('ooo', $cws, $workspace, $clone_milestone_only);
+ }
+ }
+
+ if ( !$onlysolver && defined($external_tarball_source) ) {
+ my $source_root_dir = "$workspace/$masterws";
+ $external_tarball_source .= "/$masterws/ext_sources";
+ if ( -e "$source_root_dir/ooo/ooo.lst" && -d $external_tarball_source ) {
+ fetch_external_tarballs($source_root_dir, $external_tarball_source);
+ }
+ }
+
+ if ( defined($platforms) || defined($noautocommon) ) {
+ if ( !-d $workspace ) {
+ if ( !mkdir($workspace) ) {
+ print_error("Can't create directory '$workspace': $!.", 8);
+ }
+ }
+ my $solver = defined($so_svn_server) ? "$workspace/$masterws" : "$workspace/solver";
+ if ( !-d $solver ) {
+ if ( !mkdir($solver) ) {
+ print_error("Can't create directory '$solver': $!.", 8);
+ }
+ }
+ my $source_config = get_source_config_for_milestone($masterws, $milestone);
+ foreach(@platforms) {
+ my $time_solver_start = Benchmark->new();
+ print_message("... copying platform solver '$_'.");
+ update_solver($_, $prebuild_dir, $solver, $milestone, $source_config);
+ my $time_solver_stop = Benchmark->new();
+ print_time_elapsed($time_solver_start, $time_solver_stop) if $profile;
+ }
+ }
+ my $time_fetch_stop = Benchmark->new();
+ my $time_fetch = timediff($time_fetch_stop, $time_fetch_start);
+ print_message("cws fetch: total time required " . timestr($time_fetch));
+}
+
+sub do_query
+{
+ my $args_ref = shift;
+ my $options_ref = shift;
+
+ # list of available query modes
+ my @query_modes = qw(integratedinto incompatible taskids status latest current owner qarep build buildid integrated approved nominated ready new planned release due due_qa help ui milestones masters scm ispublic ispublicmaster);
+ my %query_modes_hash = ();
+ foreach (@query_modes) {
+ $query_modes_hash{$_}++;
+ }
+
+ if ( exists $options_ref->{'help'} || @{$args_ref} != 1) {
+ do_help(['query']);
+ }
+ my $mode = lc($args_ref->[0]);
+
+ # cwquery mode 'state' has been renamed to 'status' to be more consistent
+ # with CVS etc. 'state' is still an alias for 'status'
+ $mode = 'status' if $mode eq 'state';
+
+ # cwquery mode 'vcs' has been renamed to 'scm' to be more consistent
+ # with general use etc. 'vcs' is still an alias for 'scm'
+ $mode = 'scm' if $mode eq 'vcs';
+
+ # there will be more query modes over time
+ if ( !exists $query_modes_hash{$mode} ) {
+ do_help(['query']);
+ }
+ query_cws($mode, $options_ref);
+}
+
+sub do_task
+{
+ my $args_ref = shift;
+ my $options_ref = shift;
+
+ if ( exists $options_ref->{'help'} ) {
+ do_help(['task']);
+ }
+
+ # CWS states for which adding tasks are blocked.
+ my @states_blocked_for_adding = (
+ "integrated",
+ "nominated",
+ "approved by QA",
+ "cancelled",
+ "finished"
+ );
+ my $cws = get_cws_from_environment();
+
+ # register taskids with EIS database;
+ # checks taksids for sanity, will notify user
+ # if taskid is already registered.
+ my $status = $cws->get_approval();
+
+ my $child = $cws->child();
+ my $master = $cws->master();
+
+ my @registered_taskids = $cws->taskids();
+
+ # if called without ids to register just query for tasks
+ if ( @{$args_ref} == 0 ) {
+ print_message("Task ID(s):");
+ foreach (@registered_taskids) {
+ if ( defined($_) ) {
+ print "$_\n";
+ }
+ }
+ }
+
+ if ( !defined($status) ) {
+ print_error("Can't determine status of child workspace `$child`.", 20);
+ }
+
+ if ( grep($status eq $_, @states_blocked_for_adding) ) {
+ print_error("Can't add tasks to child workspace '$child' with state '$status'.", 21);
+ }
+
+ # Create hash for easier searching.
+ my %registered_taskids_hash = ();
+ for (@registered_taskids) {
+ $registered_taskids_hash{$_}++;
+ }
+
+ my @new_taskids = ();
+ foreach (@{$args_ref}) {
+ if ( $_ !~ /^([ib]?\d+)$/ ) {
+ print_error("'$_' is an invalid task ID.", 22);
+ }
+ if ( exists $registered_taskids_hash{$1} ) {
+ print_warning("Task ID '$_' already registered, skipping.");
+ next;
+ }
+ push(@new_taskids, $_);
+ }
+
+ # TODO: introduce a EIS_USER in the configuration, which should be used here
+ my $config = CwsConfig->new();
+ my $vcsid = $config->vcsid();
+ my $added_taskids_ref = $cws->add_taskids($vcsid, @new_taskids);
+ if ( !$added_taskids_ref ) {
+ my $taskids_str = join(" ", @new_taskids);
+ print_error("Couldn't register taskID(s) '$taskids_str' with child workspace '$child'.", 23);
+ }
+ my @added_taskids = @{$added_taskids_ref};
+ if ( @added_taskids ) {
+ my $taskids_str = join(" ", @added_taskids);
+ print_message("Registered taskID(s) '$taskids_str' with child workspace '$child'.");
+ }
+ return;
+}
+
+sub do_setcurrent
+{
+ my $args_ref = shift;
+ my $options_ref = shift;
+
+ if ( exists $options_ref->{'help'} || @{$args_ref} != 0) {
+ do_help(['setcurrent']);
+ }
+
+ if ( !exists $options_ref->{'milestone'} ) {
+ do_help(['setcurrent']);
+ }
+
+ my $cws = get_cws_from_environment();
+ my $old_masterws = $cws->master();
+ my $new_masterws;
+ my $new_milestone;
+
+ my $milestone = $options_ref->{'milestone'};
+ if ( $milestone eq 'latest' ) {
+ my $latest = $cws->get_current_milestone($old_masterws);
+
+ if ( !$latest ) {
+ print_error("Can't determine latest milestone of '$old_masterws'.", 22);
+ }
+ $new_masterws = $old_masterws;
+ $new_milestone = $latest;
+ }
+ else {
+ ($new_masterws, $new_milestone) = verify_milestone($cws, $milestone);
+ }
+
+ print_message("... updating EIS database");
+ my $push_return = $cws->set_master_and_milestone($new_masterws, $new_milestone);
+ # sanity check
+ if ( $$push_return[1] ne $new_milestone) {
+ print_error("Couldn't push new milestone '$new_milestone' to database", 0);
+ }
+}
+
+sub do_eisclone
+{
+ my $args_ref = shift;
+ my $options_ref = shift;
+
+ print_error("not yet implemented.", 2);
+}
+
+sub print_message
+{
+ my $message = shift;
+
+ print "$message\n";
+ return;
+}
+
+sub print_warning
+{
+ my $message = shift;
+ print STDERR "$script_name: ";
+ print STDERR "WARNING: $message\n";
+ return;
+}
+
+sub print_error
+{
+ my $message = shift;
+ my $error_code = shift;
+
+ print STDERR "$script_name: ";
+ print STDERR "ERROR: $message\n";
+
+ if ( $error_code ) {
+ print STDERR "\nFAILURE: $script_name aborted.\n";
+ exit($error_code);
+ }
+ return;
+}
+
+sub usage
+{
+ print STDERR "Type 'cws help' for usage.\n";
+}
+
+### HG glue ###
+
+sub hg_clone
+{
+ my $source = shift;
+ my $dest = shift;
+ my $options = shift;
+
+ if ( $debug ) {
+ print STDERR "CWS-DEBUG: ... hg clone: '$source -> $dest', options: '$options'\n";
+ }
+
+ # The to be cloned revision might not yet be avaliable. In this case clone
+ # the available tip.
+ my @result = execute_hg_command(0, 'clone', $options, $source, $dest);
+ if ( defined($result[0]) && $result[0] =~ /abort: unknown revision/ ) {
+ $options =~ s/-r \w+//;
+ @result = execute_hg_command(1, 'clone', $options, $source, $dest);
+ }
+ return @result;
+}
+
+sub hg_parent
+{
+ my $repository = shift;
+ my $rev_id = shift;
+ my $options = shift;
+
+ if ( $debug ) {
+ print STDERR "CWS-DEBUG: ... hg parent: 'repository', revision: '$rev_id', options: $options\n";
+ }
+
+ my @result = execute_hg_command(0, 'parent', "--cwd $repository", "-r $rev_id", $options);
+ my $line = $result[0];
+ chomp($line);
+ return $line;
+}
+
+sub hg_pull
+{
+ my $repository = shift;
+ my $remote = shift;
+
+ if ( $debug ) {
+ print STDERR "CWS-DEBUG: ... hg pull: 'repository', remote: '$remote'\n";
+ }
+
+ my @result = execute_hg_command(0, 'pull', "--cwd $repository", $remote);
+ my $line = $result[0];
+ if ($line =~ /abort: /) {
+ return undef;
+ }
+}
+
+sub hg_update
+{
+ my $repository = shift;
+
+ if ( $debug ) {
+ print STDERR "CWS-DEBUG: ... hg update: 'repository'\n";
+ }
+
+ my @result = execute_hg_command(1, 'update', "--cwd $repository");
+ return @result;
+}
+
+sub hg_show
+{
+ if ( $debug ) {
+ print STDERR "CWS-DEBUG: ... hg show\n";
+ }
+ my $result = execute_hg_command(0, 'show', '');
+ return $result;
+}
+
+sub execute_hg_command
+{
+ my $terminate_on_rc = shift;
+ my $command = shift;
+ my $options = shift;
+ my @args = @_;
+
+ my $args_str = join(" ", @args);
+
+ # we can only parse english strings, hopefully a C locale is available everywhere
+ $ENV{LC_ALL}='C';
+ $command = "hg $command $options $args_str";
+
+ if ( $debug ) {
+ print STDERR "CWS-DEBUG: ... execute command line: '$command'\n";
+ }
+
+ my @result;
+ open(OUTPUT, "$command 2>&1 |") or print_error("Can't execute mercurial command line client", 98);
+ while (<OUTPUT>) {
+ push(@result, $_);
+ }
+ close(OUTPUT);
+
+ my $rc = $? >> 8;
+
+ if ( $rc > 0 && $terminate_on_rc) {
+ print STDERR @result;
+ print_error("The mercurial command line client failed with exit status '$rc'", 99);
+ }
+ return wantarray ? @result : \@result;
+}
+
+
+# vim: set ts=4 shiftwidth=4 expandtab syntax=perl:
diff --git a/solenv/bin/cwsattach b/solenv/bin/cwsattach
new file mode 100755
index 000000000000..99bcde52977a
--- /dev/null
+++ b/solenv/bin/cwsattach
@@ -0,0 +1,7 @@
+#!/bin/sh
+if [ x${SOLARENV}x = xx ]; then
+ echo No environment found, please use 'configure' or 'setsolar'
+ exit 1
+fi
+exec perl -w $SOLARENV/bin/cwsattach.pl "$@"
+
diff --git a/solenv/bin/cwsattach.btm b/solenv/bin/cwsattach.btm
new file mode 100644
index 000000000000..94a0f28c7ab8
--- /dev/null
+++ b/solenv/bin/cwsattach.btm
@@ -0,0 +1,11 @@
+@echo off
+iff "%SOLARENV%" == "" then
+ echo No environment found, please use 'configure' or 'setsolar'
+ goto end
+endiff
+iff "%PERL%" == "" then
+ call perl5 -I%SOLARENV%\bin\modules %SOLARENV%\bin\cwsattach.pl %1&
+else
+ call %PERL% -I%SOLARENV%\bin\modules %SOLARENV%\bin\cwsattach.pl %1&
+endiff
+:end
diff --git a/solenv/bin/cwsattach.pl b/solenv/bin/cwsattach.pl
new file mode 100644
index 000000000000..05e1b8df3cb4
--- /dev/null
+++ b/solenv/bin/cwsattach.pl
@@ -0,0 +1,220 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+#
+# cwsattach.pl - attach files to CWS
+#
+
+use strict;
+use Getopt::Long;
+use Cwd;
+
+#### module lookup
+my @lib_dirs;
+BEGIN {
+ if ( !defined($ENV{SOLARENV}) ) {
+ die "No environment found (environment variable SOLARENV is undefined)";
+ }
+ push(@lib_dirs, "$ENV{SOLARENV}/bin/modules");
+ push(@lib_dirs, "$ENV{COMMON_ENV_TOOLS}/modules") if defined($ENV{COMMON_ENV_TOOLS});
+}
+use lib (@lib_dirs);
+
+use Cws;
+
+#### script id #####
+
+( my $script_name = $0 ) =~ s/^.*\b(\w+)\.pl$/$1/;
+
+my $script_rev;
+my $id_str = ' $Revision: 1.3 $ ';
+$id_str =~ /Revision:\s+(\S+)\s+\$/
+ ? ($script_rev = $1) : ($script_rev = "-");
+
+print STDERR "$script_name -- version: $script_rev\n";
+
+#### global #####
+
+my $is_debug = 1; # enable debug
+my $opt_master = ''; # option: master workspace
+my $opt_child = ''; # option: child workspace
+my $opt_mime_type = ''; # option: mime type
+
+
+#### main #####
+
+my $arg_file = parse_options();
+attach_cws($arg_file);
+exit(0);
+
+#### subroutines ####
+
+sub attach_cws
+{
+ my $filename = shift;
+ # get master and child workspace
+ my $masterws = $opt_master ? uc($opt_master) : $ENV{WORK_STAMP};
+ my $childws = $opt_child ? $opt_child : $ENV{CWS_WORK_STAMP};
+
+ if ( !defined($masterws) ) {
+ print_error("Can't determine master workspace environment.\n"
+ . "Please initialize environment with setsolar ...", 1);
+ }
+
+ if ( !defined($childws) ) {
+ print_error("Can't determine child workspace environment.\n"
+ . "Please initialize environment with setsolar ...", 1);
+ }
+
+ my $cws = Cws->new();
+ $cws->child($childws);
+ $cws->master($masterws);
+
+ my $mime_type = $opt_mime_type ? $opt_mime_type : find_mime_type($filename);
+
+ no strict;
+
+ if ( is_valid_cws($cws) ) {
+ #print "CWS is valid filename=" . $filename . " mime_type=" . $mime_type . "\n";
+ open(DATA,"<$filename") || die "can't open filename";
+ $data="";
+ while(<DATA>) {
+ $data.=$_;
+ }
+ my $result=$cws->save_attachment($filename,$mime_type,$data);
+ } else {
+ print STDERR "cws is not valid";
+ }
+ exit(0)
+}
+
+
+sub find_mime_type
+{
+ my $filename = shift;
+ $filename=~/(.*)\.(.*$)/;
+ my $ext=$2;
+ my $fmime='';
+
+ if ( defined($ext) ) {
+ open(MIME,"< $ENV{SOLARENV}/inc/mime.types")|| die "can not open mimetype file";
+ while (<MIME>) {
+ my @a=split();
+ my $iscomment=0;
+ if ( /(\s*\#).*/ ) {
+ $iscomment=1;
+ } else {
+ $iscomment=0;
+ }
+ if ( $iscomment eq 0 && $#a >= 1 && $fmime eq '' ) {
+ my $i=1;
+ for ($i=1; $i<=$#a; $i++) {
+ if ( $a[$i] eq $ext ) {
+ $fmime=$a[0];
+ }
+ }
+ }
+ }
+
+ }
+ if ( $fmime eq '' ) {
+ $fmime="application/octet-stream";
+ }
+ return $fmime;
+}
+
+
+sub is_valid_cws
+{
+ my $cws = shift;
+
+ my $masterws = $cws->master();
+ my $childws = $cws->child();
+ # check if we got a valid child workspace
+ my $id = $cws->eis_id();
+ if ( !$id ) {
+ print_error("Child workspace '$childws' for master workspace '$masterws' not found in EIS database.", 2);
+ }
+ print_message("Master workspace '$masterws', child workspace '$childws':");
+ return 1;
+}
+
+sub parse_options
+{
+ # parse options and do some sanity checks
+ my $help = 0;
+ my $success = GetOptions('h' => \$help, 'm=s' => \$opt_master, 'c=s'=> \$opt_child, 't=s'=> \$opt_mime_type);
+ if ( $help || !$success || $#ARGV < 0 ) {
+ usage();
+ exit(1);
+ }
+
+ return $ARGV[0];
+}
+
+sub print_message
+{
+ my $message = shift;
+
+ print STDERR "$script_name: ";
+ print STDERR "$message\n";
+ return;
+}
+
+sub print_error
+{
+ my $message = shift;
+ my $error_code = shift;
+
+ print STDERR "$script_name: ";
+ print STDERR "ERROR: $message\n";
+
+ if ( $error_code ) {
+ print STDERR "\nFAILURE: $script_name aborted.\n";
+ exit($error_code);
+ }
+ return;
+}
+
+sub usage
+{
+ print STDERR "Usage: cwsattach [-h] [-m master] [-c child] [-t mimetype] filename\n";
+ print STDERR "\n";
+ print STDERR "Attach files to CWS in EIS database\n";
+ print STDERR "\n";
+ print STDERR "Options:\n";
+ print STDERR "\t-h\t\thelp\n";
+ print STDERR "\t-m master\toverride MWS specified in environment\n";
+ print STDERR "\t-c child\toverride CWS specified in environment\n";
+ print STDERR "\t-t mimetype\texplicitly set mime type\n";
+ print STDERR "Examples:\n";
+ print STDERR "\tcwsattach barfoo.html\n";
+ print STDERR "\tcwsattach -t text bar.cxx\n";
+ print STDERR "\tcwsattach -t text/rtf foo.rtf\n";
+}
diff --git a/solenv/bin/cwscreate b/solenv/bin/cwscreate
new file mode 100755
index 000000000000..c3260f746e39
--- /dev/null
+++ b/solenv/bin/cwscreate
@@ -0,0 +1,6 @@
+#!/bin/sh
+if [ x${SOLARENV}x = xx ]; then
+ echo No environment found, please use 'configure' or 'setsolar'
+ exit 1
+fi
+echo "Please use the 'cws create' command for creating new child workspaces!"
diff --git a/solenv/bin/cwstestresult b/solenv/bin/cwstestresult
new file mode 100755
index 000000000000..29b1c0c8e99d
--- /dev/null
+++ b/solenv/bin/cwstestresult
@@ -0,0 +1,7 @@
+#!/bin/sh
+if [ x${SOLARENV}x = xx ]; then
+ echo No environment found, please use 'configure' or 'setsolar'
+ exit 1
+fi
+exec perl -w $SOLARENV/bin/cwstestresult.pl "$@"
+
diff --git a/solenv/bin/cwstestresult.btm b/solenv/bin/cwstestresult.btm
new file mode 100644
index 000000000000..38a012996500
--- /dev/null
+++ b/solenv/bin/cwstestresult.btm
@@ -0,0 +1,11 @@
+@echo off
+iff "%SOLARENV%" == "" then
+ echo No environment found, please use 'configure' or 'setsolar'
+ goto end
+endiff
+iff "%PERL%" == "" then
+ call perl5 -I%SOLARENV%\bin\modules %SOLARENV%\bin\cwstestresult.pl %1&
+else
+ call %PERL% -I%SOLARENV%\bin\modules %SOLARENV%\bin\cwstestresult.pl %1&
+endiff
+:end
diff --git a/solenv/bin/cwstestresult.pl b/solenv/bin/cwstestresult.pl
new file mode 100644
index 000000000000..43b41ff7b5e8
--- /dev/null
+++ b/solenv/bin/cwstestresult.pl
@@ -0,0 +1,192 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+#
+# cwstestresult.pl - publish results of CWS tests to EIS
+#
+
+use strict;
+use Getopt::Long;
+use Cwd;
+
+#### module lookup
+my @lib_dirs;
+BEGIN {
+ if ( !defined($ENV{SOLARENV}) ) {
+ die "No environment found (environment variable SOLARENV is undefined)";
+ }
+ push(@lib_dirs, "$ENV{SOLARENV}/bin/modules");
+ push(@lib_dirs, "$ENV{COMMON_ENV_TOOLS}/modules") if defined($ENV{COMMON_ENV_TOOLS});
+}
+use lib (@lib_dirs);
+
+use Cws;
+
+#### global #####
+( my $script_name = $0 ) =~ s/^.*\b(\w+)\.pl$/$1/;
+
+my $is_debug = 1; # enable debug
+my $opt_master; # option: master workspace
+my $opt_child; # option: child workspace
+my $opt_milestone; # option: milestone
+my $opt_testrunName; # option: testrunName
+my $opt_testrunPlatform; # option: testrunPlatfrom
+my $opt_resultPage; # option: resultPage
+
+
+#### main #####
+
+my $arg_status= parse_options();
+testresult($arg_status);
+exit(0);
+
+#### subroutines ####
+
+sub testresult
+{
+ my $status = shift;
+ # get master and child workspace
+ my $masterws = $opt_master ? uc($opt_master) : $ENV{WORK_STAMP};
+ my $milestone = $opt_milestone ? $opt_milestone : $ENV{UPDMINOR};
+ my $childws = $opt_milestone ? undef : ( $opt_child ? $opt_child : $ENV{CWS_WORK_STAMP} );
+
+ if ( !defined($masterws) ) {
+ print_error("Can't determine master workspace environment.\n"
+ . "Please initialize environment with setsolar ...", 1);
+ }
+
+ if ( !defined($childws) && !defined($milestone) ) {
+ print_error("Can't determine child workspace environment or milestone.\n"
+ . "Please initialize environment with setsolar ...", 1);
+ }
+ if ( !defined($opt_resultPage) ) {
+ $opt_resultPage="";
+ }
+ my $cws = Cws->new();
+ if ( defined($childws) ) {
+ $cws->child($childws);
+ }
+ $cws->master($masterws);
+ my $eis = $cws->eis();
+
+ no strict;
+ my $result='';
+
+ if ( defined($childws) ) {
+ $opt_resultPage=SOAP::Data->type(string => $opt_resultPage);
+ my $id = $cws->eis_id();
+ if ( is_valid_cws($cws) ) {
+ $result=$eis->submitTestResult($id,$opt_testrunName,$opt_testrunPlatform, $opt_resultPage, $status);
+ } else {
+ print STDERR "cws is not valid";
+ }
+ } else {
+ $opt_resultPage=SOAP::Data->type(string => $opt_resultPage);
+ $result=$eis->submitTestResultMWS($masterws,$milestone,$opt_testrunName,$opt_testrunPlatform, $opt_resultPage, $status);
+ }
+
+ exit(0)
+}
+
+
+sub is_valid_cws
+{
+ my $cws = shift;
+
+ my $masterws = $cws->master();
+ my $childws = $cws->child();
+ # check if we got a valid child workspace
+ my $id = $cws->eis_id();
+ if ( !$id ) {
+ print_error("Child workspace '$childws' for master workspace '$masterws' not found in EIS database.", 2);
+ }
+ return 1;
+}
+
+sub parse_options
+{
+ # parse options and do some sanity checks
+ Getopt::Long::Configure("no_ignore_case");
+ my $help = 0;
+ my $success = GetOptions('h' => \$help, 'M=s' => \$opt_master, 'm=s' => \$opt_milestone, 'c=s' => \$opt_child, 'n=s' => \$opt_testrunName, 'p=s' => \$opt_testrunPlatform , 'r=s' => \$opt_resultPage );
+ if ( $help || !$success || $#ARGV < 0 || (!defined($opt_testrunName)) || ( !defined($opt_testrunPlatform)) ) {
+ usage();
+ exit(1);
+ }
+ if ( defined($opt_milestone) && defined($opt_child) ) {
+ print_error("-m and -c are mutually exclusive options",1);
+ }
+
+ return $ARGV[0];
+}
+
+sub print_message
+{
+ my $message = shift;
+
+ print STDERR "$script_name: ";
+ print STDERR "$message\n";
+ return;
+}
+
+sub print_error
+{
+ my $message = shift;
+ my $error_code = shift;
+
+ print STDERR "$script_name: ";
+ print STDERR "ERROR: $message\n";
+
+ if ( $error_code ) {
+ print STDERR "\nFAILURE: $script_name aborted.\n";
+ exit($error_code);
+ }
+ return;
+}
+
+sub usage
+{
+ print STDERR "Usage: cwstestresult[-h] [-m masterws] [-m milestone|-c childws] <-n testrunName> <-p testrunPlatform> <-r resultPage> statusName\n";
+ print STDERR "\n";
+ print STDERR "Publish result of CWS- or milestone-test to EIS\n";
+ print STDERR "\n";
+ print STDERR "Options:\n";
+ print STDERR "\t-h\t\t\thelp\n";
+ print STDERR "\t-M master\t\toverride MWS specified in environment\n";
+ print STDERR "\t-m milestone\t\toverride milestone specified in environment\n";
+ print STDERR "\t-c child\t\toverride CWS specified in environment\n";
+ print STDERR "\t-n testrunName\t\tspecifiy name of the test\n";
+ print STDERR "\t-p testrunPlatform\tspecify platform where the test ran on\n";
+ print STDERR "\t-r resultPage\t\tspecify name of attachment or hyperlink\n";
+ print STDERR "\t\t\t\tfor resultPage\n";
+
+
+ print STDERR "\nExample:\n";
+ print STDERR "\tcwstestresult -c mycws -n Performance -p Windows -r PerfomanceTestWindows.html ok\n";
+}
diff --git a/solenv/bin/cwstouched b/solenv/bin/cwstouched
new file mode 100755
index 000000000000..dac08c07f9a7
--- /dev/null
+++ b/solenv/bin/cwstouched
@@ -0,0 +1,6 @@
+#!/bin/sh
+if [ x${SOLARENV}x = xx ]; then
+ echo No environment found, please use 'configure' or 'setsolar'
+ exit 1
+fi
+exec perl -w $SOLARENV/bin/cwstouched.pl
diff --git a/solenv/bin/cwstouched.btm b/solenv/bin/cwstouched.btm
new file mode 100755
index 000000000000..33e442dbb51c
--- /dev/null
+++ b/solenv/bin/cwstouched.btm
@@ -0,0 +1,11 @@
+@echo off
+iff "%SOLARENV%" == "" then
+ echo No environment found, please use 'configure' or 'setsolar'
+ goto end
+endiff
+iff "%PERL%" == "" then
+ call perl5 -I%SOLARENV%\bin\modules %SOLARENV%\bin\cwstouched.pl %1&
+else
+ call %PERL% -I%SOLARENV%\bin\modules %SOLARENV%\bin\cwstouched.pl %1&
+endiff
+:end
diff --git a/solenv/bin/cwstouched.pl b/solenv/bin/cwstouched.pl
new file mode 100755
index 000000000000..eb306277580c
--- /dev/null
+++ b/solenv/bin/cwstouched.pl
@@ -0,0 +1,151 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+
+#*************************************************************************
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+use strict;
+use Cwd;
+
+#### module lookup
+my @lib_dirs;
+BEGIN {
+ if ( !defined($ENV{SOLARENV}) ) {
+ die "No environment found (environment variable SOLARENV is undefined)";
+ }
+ push(@lib_dirs, "$ENV{SOLARENV}/bin/modules");
+}
+use lib (@lib_dirs);
+
+use Cws;
+
+# Prototypes
+sub getMinor($);
+sub getCwsWorkStamp();
+
+my $workstamp = $ENV{'WORK_STAMP'};
+my $solenv= $ENV{'SOLARENV'};
+my $cwsWorkStamp = getCwsWorkStamp();
+my $minor = getMinor($cwsWorkStamp);
+
+my $oldWorkStamp = $workstamp."_".$minor;
+my $svndiff="svn diff --summarize --old=svn://svn.services.openoffice.org/ooo/tags/".$oldWorkStamp." --new=svn://svn.services.openoffice.org/ooo/cws/".$cwsWorkStamp;
+
+my @diff = `$svndiff`;
+
+my @modules;
+foreach(@diff)
+{
+ if (/.*svn:\/\/svn.services.openoffice.org.*/)
+ {
+ $_ =~ /.*$oldWorkStamp\/(\w*)/;
+ my $newModule=$1;
+ if (defined($newModule))
+ {
+ if ( ! grep(/$newModule/,@modules))
+ {
+ push(@modules, $newModule);
+ }
+
+ }
+ }
+}
+
+foreach(@modules)
+{
+ print "$_\n";
+}
+
+exit(0);
+
+sub getMinor($)
+{
+ my $workst = shift;
+ my $min="";
+
+ if ( ! defined($ENV{'UPDMINOR'}))
+ {
+ my $cws = Cws->new();
+ $cws->child($workst);
+ $cws->master($ENV{'WORK_STAMP'});
+ my $masterws = $cws->master();
+ my $childws = $cws->child();
+
+ # check if we got a valid child workspace
+ my $id = $cws->eis_id();
+ if ( !$id )
+ {
+ print("Child workspace '$childws' for master workspace '$masterws' not found in EIS database.\n");
+ exit(1);
+ }
+
+ my @milestones = $cws->milestone();
+ foreach (@milestones) {
+ if ( defined($_) )
+ {
+ $min=$_;
+ }
+ }
+ }
+ else
+ {
+ $min = $ENV{'UPDMINOR'};
+ }
+
+ chomp($min);
+ return $min;
+}
+
+sub getCwsWorkStamp()
+{
+ my $cwsWorkSt="";
+
+ if ( ! defined($ENV{'CWS_WORK_STAMP'}))
+ {
+ my $currPath= cwd;
+
+ chdir($ENV{'SOLARENV'});
+
+ my @info = `svn info`;
+
+ foreach(@info)
+ {
+ if ( /URL:.*/ )
+ {
+ # URL: svn+ssh://svn@svn.services.openoffice.org/ooo/cws/qadev37/solenv
+ $_ = ~ /.*svn.services.openoffice.org(.*\/(.*))\/\w*/;
+ $cwsWorkSt=$2; #qadev37
+ }
+ }
+
+ }
+ else
+ {
+ $cwsWorkSt = $ENV{'CWS_WORK_STAMP'};
+ }
+ return $cwsWorkSt
+}
diff --git a/solenv/bin/cwstouched.py b/solenv/bin/cwstouched.py
new file mode 100755
index 000000000000..87dfe4b03595
--- /dev/null
+++ b/solenv/bin/cwstouched.py
@@ -0,0 +1,111 @@
+#!/usr/bin/python
+
+#*************************************************************************
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+import os
+import sys
+import string
+from os import path
+
+def getCurrPath():
+ currPath = sys.path[0] or os.getcwd()
+ currPath = path.abspath(currPath)
+ return currPath
+
+def getCwsWorkStamp():
+ cwsWorkStamp=os.getenv('CWS_WORK_STAMP')
+
+ if not cwsWorkStamp:
+ currPath=getCurrPath()
+
+ os.chdir(os.getenv('SOLARENV'))
+
+ (input, output) = os.popen4("svn info")
+
+ for outline in output.readlines():
+ if outline.startswith("URL:"):
+ cwsWorkStamp = outline[outline.index("svn.services"):outline.index("solenv")-1]
+ cwsWorkStamp = cwsWorkStamp[cwsWorkStamp.rfind("/")+1:len(cwsWorkStamp)]
+ break
+
+ os.putenv("CWS_WORK_STAMP",cwsWorkStamp);
+ os.chdir(currPath)
+
+ return string.strip(cwsWorkStamp)
+
+def getMinor(cwsWorkStamp):
+ minor = os.getenv('UPDMINOR')
+
+ if not minor:
+ if (os.getenv('OSTYPE') == "cygwin"):
+ bash=os.getenv("SHELL")
+ (input, output) = os.popen4("cygpath -w "+bash)
+ winbash=string.strip(output.readlines()[0])
+ cws=winbash+" -c 'cws query -c "+cwsWorkStamp+" current'"
+ else:
+ cws="cws query -c "+cwsWorkStamp+" current"
+
+ (input, output) = os.popen4(cws)
+
+ found=0
+ for outline in output.readlines():
+ if found:
+ minor=outline
+ break
+ elif outline.find("Current milestone:") != -1:
+ found=1
+
+ return string.strip(minor)
+
+
+workstamp = os.getenv('WORK_STAMP')
+solenv= os.getenv('SOLARENV')
+cwsWorkStamp=getCwsWorkStamp()
+minor = getMinor(cwsWorkStamp)
+
+oldWorkStamp = workstamp + "_" + minor
+diff="svn diff --summarize --old=svn://svn.services.openoffice.org/ooo/tags/"+oldWorkStamp+" --new=svn://svn.services.openoffice.org/ooo/cws/"+cwsWorkStamp
+
+modules=[]
+(input, output) = os.popen4(diff)
+
+for outline in output.readlines():
+ if outline.find("svn://svn.services.openoffice.org"):
+ index = outline.index(oldWorkStamp)+len(oldWorkStamp)+1
+ newModule=""
+ if outline.find("/",index) != -1:
+ # seems to be a file
+ newModule=string.strip(outline[index:outline.index("/",index)])
+ else:
+ #seems to be a folder
+ if len(outline[index:]) > 0:
+ newModule=string.strip(outline[index:])
+ if newModule != "" and not modules.count(newModule):
+ modules.append(newModule)
+
+for module in modules:
+ print module \ No newline at end of file
diff --git a/solenv/bin/dbgsv.ini b/solenv/bin/dbgsv.ini
new file mode 100644
index 000000000000..006dadf98a40
--- /dev/null
+++ b/solenv/bin/dbgsv.ini
@@ -0,0 +1,29 @@
+=*************************************************************************
+=
+= DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+=
+= Copyright 2000, 2010 Oracle and/or its affiliates.
+=
+= OpenOffice.org - a multi-platform office productivity suite
+=
+= This file is part of OpenOffice.org.
+=
+= OpenOffice.org is free software: you can redistribute it and/or modify
+= it under the terms of the GNU Lesser General Public License version 3
+= only, as published by the Free Software Foundation.
+=
+= OpenOffice.org is distributed in the hope that it will be useful,
+= but WITHOUT ANY WARRANTY; without even the implied warranty of
+= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+= GNU Lesser General Public License version 3 for more details
+= (a copy is included in the LICENSE file that accompanied this code).
+=
+= You should have received a copy of the GNU Lesser General Public License
+= version 3 along with OpenOffice.org. If not, see
+= <http://www.openoffice.org/license.html>
+= for a copy of the LGPLv3 License.
+=
+=***********************************************************************/
+
+[output]
+error=shell
diff --git a/solenv/bin/deliver.pl b/solenv/bin/deliver.pl
new file mode 100755
index 000000000000..b87665c6b011
--- /dev/null
+++ b/solenv/bin/deliver.pl
@@ -0,0 +1,1510 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#
+# deliver.pl - copy from module output tree to solver
+#
+
+use Cwd;
+use File::Basename;
+use File::Copy;
+use File::DosGlob 'glob';
+use File::Path;
+use File::Spec;
+
+#### script id #####
+
+( $script_name = $0 ) =~ s/^.*\b(\w+)\.pl$/$1/;
+
+$id_str = ' $Revision: 275594 $ ';
+$id_str =~ /Revision:\s+(\S+)\s+\$/
+ ? ($script_rev = $1) : ($script_rev = "-");
+
+
+#### globals ####
+
+### valid actions ###
+# if you add a action 'foo', than add 'foo' to this list and
+# implement 'do_foo()' in the implemented actions area
+@action_list = ( # valid actions
+ 'copy',
+ 'dos',
+ 'addincpath',
+ 'linklib',
+ 'mkdir',
+ 'symlink',
+ 'touch'
+ );
+
+# copy filter: files matching these patterns won't be copied by
+# the copy action
+@copy_filter_patterns = (
+ );
+
+$strip = '';
+$is_debug = 0;
+
+$error = 0;
+$module = 0; # module name
+$repository = 0; # parent directory of this module
+$base_dir = 0; # path to module base directory
+$dlst_file = 0; # path to d.lst
+$ilst_ext = 'ilst'; # extension of image lists
+$umask = 22; # default file/directory creation mask
+$dest = 0; # optional destination path
+$common_build = 0; # do we have common trees?
+$common_dest = 0; # common tree on solver
+
+@action_data = (); # LoL with all action data
+@macros = (); # d.lst macros
+@addincpath_list = (); # files which have to be filtered through addincpath
+@dirlist = (); # List of 'mkdir' targets
+@zip_list = (); # files which have to be zipped
+@common_zip_list = (); # common files which have to be zipped
+@log_list = (); # LoL for logging all copy and link actions
+@common_log_list = (); # LoL for logging all copy and link actions in common_dest
+$logfiledate = 0; # Make log file as old as newest delivered file
+$commonlogfiledate = 0; # Make log file as old as newest delivered file
+
+$files_copied = 0; # statistics
+$files_unchanged = 0; # statistics
+
+$opt_force = 0; # option force copy
+$opt_check = 0; # do actually execute any action
+$opt_zip = 0; # create an additional zip file
+$opt_silent = 0; # be silent, only report errors
+$opt_verbose = 0; # be verbose (former default behaviour)
+$opt_log = 1; # create an additional log file
+$opt_link = 0; # hard link files into the solver to save disk space
+$opt_deloutput = 0; # delete the output tree for the project once successfully delivered
+$opt_checkdlst = 0;
+$delete_common = 1; # for "-delete": if defined delete files from common tree also
+
+if ($^O ne 'cygwin') { # iz59477 - cygwin needes a dot "." at the end of filenames to disable
+ $maybedot = ''; # some .exe transformation magic.
+} else {
+ my $cygvernum = `uname -r`;
+ my @cygvernum = split( /\./, $cygvernum);
+ $cygvernum = shift @cygvernum;
+ $cygvernum .= shift @cygvernum;
+ if ( $cygvernum < 17 ) {
+ $maybedot = '.';
+ } else {
+ $maybedot = ''; # no longer works with cygwin 1.7. other magic below.
+ }
+}
+
+($gui = lc($ENV{GUI})) || die "Can't determine 'GUI'. Please set environment.\n";
+$tempcounter = 0;
+
+# zip is default for RE master builds
+$opt_zip = 1 if ( defined($ENV{DELIVER_TO_ZIP}) && uc($ENV{DELIVER_TO_ZIP}) eq 'TRUE' && ! defined($ENV{CWS_WORK_STAMP}));
+
+$has_symlinks = 0; # system supports symlinks
+
+for (@action_list) {
+ $action_hash{$_}++;
+}
+
+# trap normal signals (HUP, INT, PIPE, TERM)
+# for clean up on unexpected termination
+use sigtrap 'handler' => \&cleanup_and_die, 'normal-signals';
+
+#### main ####
+
+parse_options();
+
+print "$script_name -- version: $script_rev\n" if !$opt_silent;
+
+if ( ! $opt_delete ) {
+ if ( $ENV{GUI} eq 'WNT' ) {
+ if ($ENV{COM} eq 'GCC') {
+ initialize_strip() ;
+ };
+ } else {
+ initialize_strip();
+ }
+}
+
+init_globals();
+push_default_actions();
+parse_dlst();
+check_dlst() if $opt_checkdlst;
+walk_action_data();
+walk_addincpath_list();
+write_log() if $opt_log;
+zip_files() if $opt_zip;
+cleanup() if $opt_delete;
+delete_output() if $opt_deloutput;
+print_stats();
+
+exit($error);
+
+#### implemented actions #####
+
+sub do_copy
+{
+ # We need to copy two times:
+ # from the platform dependent output tree
+ # and from the common output tree
+ my ($dependent, $common, $from, $to, $file_list);
+ my $line = shift;
+ my $touch = 0;
+
+ $dependent = expand_macros($line);
+ ($from, $to) = split(' ', $dependent);
+ print "copy dependent: from: $from, to: $to\n" if $is_debug;
+ glob_and_copy($from, $to, $touch);
+
+ if ($delete_common && $common_build && ( $line !~ /%COMMON_OUTDIR%/ ) ) {
+ $line =~ s/%__SRC%/%COMMON_OUTDIR%/ig;
+ if ( $line =~ /%COMMON_OUTDIR%/ ) {
+ $line =~ s/%_DEST%/%COMMON_DEST%/ig;
+ $common = expand_macros($line);
+ ($from, $to) = split(' ', $common);
+ print "copy common: from: $from, to: $to\n" if $is_debug;
+ glob_and_copy($from, $to, $touch);
+ }
+ }
+}
+
+sub do_dos
+{
+ my $line = shift;
+
+ my $command = expand_macros($line);
+ if ( $opt_check ) {
+ print "DOS: $command\n";
+ }
+ else {
+ # HACK: remove MACOSX stuff which is wrongly labled with dos
+ # better: fix broken d.lst
+ return if ( $command =~ /MACOSX/ );
+ $command =~ s#/#\\#g if $^O eq 'MSWin32';
+ system($command);
+ }
+}
+
+sub do_addincpath
+{
+ # just collect all addincpath files, actual filtering is done later
+ my $line = shift;
+ my ($from, $to);
+ my @globbed_files = ();
+
+ $line = expand_macros($line);
+ ($from, $to) = split(' ', $line);
+
+ push( @addincpath_list, @{glob_line($from, $to)});
+}
+
+sub do_linklib
+{
+ my ($lib_base, $lib_major,$from_dir, $to_dir);
+ my $lib = shift;
+ my @globbed_files = ();
+ my %globbed_hash = ();
+
+ print "linklib: $lib\n" if $is_debug;
+ print "has symlinks\n" if ( $has_symlinks && $is_debug );
+
+ return unless $has_symlinks;
+
+ $from_dir = expand_macros('../%__SRC%/lib');
+ $to_dir = expand_macros('%_DEST%/lib%_EXT%');
+
+ @globbed_files = glob("$from_dir/$lib");
+
+ if ( $#globbed_files == -1 ) {
+ return;
+ }
+
+ foreach $lib (@globbed_files) {
+ $lib = basename($lib);
+ if ( $lib =~ /^(lib\S+(\.so|\.dylib))\.(\d+)\.(\d+)(\.(\d+))?$/
+ || $lib =~ /^(lib\S+(\.so|\.dylib))\.(\d+)$/ )
+ {
+ push(@{$globbed_hash{$1}}, $lib);
+ }
+ else {
+ print_warning("invalid library name: $lib");
+ }
+ }
+
+ foreach $lib_base ( sort keys %globbed_hash ) {
+ $lib = get_latest_patchlevel(@{$globbed_hash{$lib_base}});
+
+ if ( $lib =~ /^(lib\S+(\.so|\.dylib))\.(\d+)\.(\d+)(\.(\d+))?$/ )
+ {
+ $lib_major = "$lib_base.$3";
+ $long = 1;
+ }
+ else
+ {
+ # $lib =~ /^(lib[\w-]+(\.so|\.dylib))\.(\d+)$/;
+ $long = 0;
+ }
+
+ if ( $opt_check ) {
+ if ( $opt_delete ) {
+ print "REMOVE: $to_dir/$lib_major\n" if $long;
+ print "REMOVE: $to_dir/$lib_base\n";
+ }
+ else {
+ print "LINKLIB: $to_dir/$lib -> $to_dir/$lib_major\n" if $long;
+ print "LINKLIB: $to_dir/$lib -> $to_dir/$lib_base\n";
+ }
+ }
+ else {
+ if ( $opt_delete ) {
+ print "REMOVE: $to_dir/$lib_major\n" if ($long && $opt_verbose);
+ print "REMOVE: $to_dir/$lib_base\n" if $opt_verbose;
+ unlink "$to_dir/$lib_major" if $long;
+ unlink "$to_dir/$lib_base";
+ if ( $opt_zip ) {
+ push_on_ziplist("$to_dir/$lib_major") if $long;
+ push_on_ziplist("$to_dir/$lib_base");
+ }
+ return;
+ }
+ my $symlib;
+ my @symlibs;
+ if ($long)
+ {
+ @symlibs = ("$to_dir/$lib_major", "$to_dir/$lib_base");
+ }
+ else
+ {
+ @symlibs = ("$to_dir/$lib_base");
+ }
+ # remove old symlinks
+ unlink(@symlibs);
+ foreach $symlib (@symlibs) {
+ print "LINKLIB: $lib -> $symlib\n" if $opt_verbose;
+ if ( !symlink("$lib", "$symlib") ) {
+ print_error("can't symlink $lib -> $symlib: $!",0);
+ }
+ else {
+ push_on_ziplist($symlib) if $opt_zip;
+ push_on_loglist("LINK", "$lib", "$symlib") if $opt_log;
+ }
+ }
+ }
+ }
+}
+
+sub do_mkdir
+{
+ my $path = expand_macros(shift);
+ # strip whitespaces from path name
+ $path =~ s/\s$//;
+ if (( ! $opt_delete ) && ( ! -d $path )) {
+ if ( $opt_check ) {
+ print "MKDIR: $path\n";
+ } else {
+ mkpath($path, 0, 0777-$umask);
+ if ( ! -d $path ) {
+ print_error("mkdir: could not create directory '$path'", 0);
+ }
+ }
+ }
+}
+
+sub do_symlink
+{
+ my $line = shift;
+
+ $line = expand_macros($line);
+ ($from, $to) = split(' ',$line);
+ my $fullfrom = $from;
+ if ( dirname($from) eq dirname($to) ) {
+ $from = basename($from);
+ }
+ elsif ( dirname($from) eq '.' ) {
+ # nothing to do
+ }
+ else {
+ print_error("symlink: link must be in the same directory as file",0);
+ return 0;
+ }
+
+ print "symlink: $from, to: $to\n" if $is_debug;
+
+ return unless $has_symlinks;
+
+ if ( $opt_check ) {
+ if ( $opt_delete ) {
+ print "REMOVE: $to\n";
+ }
+ else {
+ print "SYMLINK $from -> $to\n";
+ }
+ }
+ else {
+ print "REMOVE: $to\n" if $opt_verbose;
+ unlink $to;
+ if ( $opt_delete ) {
+ push_on_ziplist($to) if $opt_zip;
+ return;
+ }
+ return unless -e $fullfrom;
+ print "SYMLIB: $from -> $to\n" if $opt_verbose;
+ if ( !symlink("$from", "$to") ) {
+ print_error("can't symlink $from -> $to: $!",0);
+ }
+ else {
+ push_on_ziplist($to) if $opt_zip;
+ push_on_loglist("LINK", "$from", "$to") if $opt_log;
+ }
+ }
+}
+
+sub do_touch
+{
+ my ($from, $to);
+ my $line = shift;
+ my $touch = 1;
+
+ $line = expand_macros($line);
+ ($from, $to) = split(' ', $line);
+ print "touch: $from, to: $to\n" if $is_debug;
+ glob_and_copy($from, $to, $touch);
+}
+
+#### subroutines #####
+
+sub parse_options
+{
+ my $arg;
+ my $dontdeletecommon = 0;
+ $opt_silent = 1 if ( defined $ENV{VERBOSE} && $ENV{VERBOSE} eq 'FALSE');
+ $opt_verbose = 1 if ( defined $ENV{VERBOSE} && $ENV{VERBOSE} eq 'TRUE');
+ while ( $arg = shift @ARGV ) {
+ $arg =~ /^-force$/ and $opt_force = 1 and next;
+ $arg =~ /^-check$/ and $opt_check = 1 and $opt_verbose = 1 and next;
+ $arg =~ /^-quiet$/ and $opt_silent = 1 and next;
+ $arg =~ /^-verbose$/ and $opt_verbose = 1 and next;
+ $arg =~ /^-zip$/ and $opt_zip = 1 and next;
+ $arg =~ /^-delete$/ and $opt_delete = 1 and next;
+ $arg =~ /^-dontdeletecommon$/ and $dontdeletecommon = 1 and next;
+ $arg =~ /^-help$/ and $opt_help = 1 and $arg = '';
+ $arg =~ /^-link$/ and $ENV{GUI} ne 'WNT' and $opt_link = 1 and next;
+ $arg =~ /^-deloutput$/ and $opt_deloutput = 1 and next;
+ $arg =~ /^-debug$/ and $is_debug = 1 and next;
+ $arg =~ /^-checkdlst$/ and $opt_checkdlst = 1 and next;
+ print_error("invalid option $arg") if ( $arg =~ /^-/ );
+ if ( $arg =~ /^-/ || $opt_help || $#ARGV > -1 ) {
+ usage(1);
+ }
+ $dest = $arg;
+ }
+ # $dest and $opt_zip or $opt_delete are mutually exclusive
+ if ( $dest and ($opt_zip || $opt_delete) ) {
+ usage(1);
+ }
+ # $opt_silent and $opt_check or $opt_verbose are mutually exclusive
+ if ( ($opt_check or $opt_verbose) and $opt_silent ) {
+ print STDERR "Error on command line: options '-check' and '-quiet' are mutually exclusive.\n";
+ usage(1);
+ }
+ if ($dontdeletecommon) {
+ if (!$opt_delete) {
+ usage(1);
+ }
+ $delete_common = 0;
+ };
+ # $opt_delete implies $opt_force
+ $opt_force = 1 if $opt_delete;
+}
+
+sub init_globals
+{
+ my $ext;
+ ($module, $repository, $base_dir, $dlst_file) = get_base();
+
+ # for CWS:
+ $module =~ s/\.lnk$//;
+
+ print "Module=$module, Base_Dir=$base_dir, d.lst=$dlst_file\n" if $is_debug;
+
+ $umask = umask();
+ if ( !defined($umask) ) {
+ $umask = 22;
+ }
+
+ my $build_sosl = $ENV{'BUILD_SOSL'};
+ my $common_outdir = $ENV{'COMMON_OUTDIR'};
+ my $inpath = $ENV{'INPATH'};
+ my $solarversion = $ENV{'SOLARVERSION'};
+ my $updater = $ENV{'UPDATER'};
+ my $updminor = $ENV{'UPDMINOR'};
+ my $updminorext = $ENV{'UPDMINOREXT'};
+ my $work_stamp = $ENV{'WORK_STAMP'};
+
+ # special security check for release engineers
+ if ( defined($updater) && !defined($build_sosl) && !$opt_force) {
+ my $path = getcwd();
+ if ( $path !~ /$work_stamp/io ) {
+ print_error("can't deliver from local directory to SOLARVERSION");
+ print STDERR "\nDANGER! Release Engineer:\n";
+ print STDERR "do you really want to deliver from $path to SOLARVERSION?\n";
+ print STDERR "If so, please use the -force switch\n\n";
+ exit(7);
+ }
+ }
+
+ # do we have a valid environment?
+ if ( !defined($inpath) ) {
+ print_error("no environment", 0);
+ exit(3);
+ }
+
+ $ext = "";
+ if ( ($updminor) && !$dest ) {
+ $ext = "$updminorext";
+ }
+
+ # Do we have common trees?
+ if ( defined($ENV{'common_build'}) && $ENV{'common_build'} eq 'TRUE' ) {
+ $common_build = 1;
+ if ((defined $common_outdir) && ($common_outdir ne "")) {
+ $common_outdir = $common_outdir . ".pro" if $inpath =~ /\.pro$/;
+ if ( $dest ) {
+ $common_dest = $dest;
+ } else {
+ $common_dest = "$solarversion/$common_outdir";
+ $dest = "$solarversion/$inpath";
+ }
+ } else {
+ print_error("common_build defined without common_outdir", 0);
+ exit(6);
+ }
+ } else {
+ $common_outdir = $inpath;
+ $dest = "$solarversion/$inpath" if ( !$dest );
+ $common_dest = $dest;
+ }
+ $dest =~ s#\\#/#g;
+ $common_dest =~ s#\\#/#g;
+
+ # the following macros are obsolete, will be flagged as error
+ # %__WORKSTAMP%
+ # %GUIBASE%
+ # %SDK%
+ # %SOLARVER%
+ # %__OFFENV%
+ # %DLLSUFFIX%'
+ # %OUTPATH%
+ # %L10N_FRAMEWORK%
+ # %UPD%
+
+ # valid macros
+ @macros = (
+ [ '%__PRJROOT%', $base_dir ],
+ [ '%__SRC%', $inpath ],
+ [ '%_DEST%', $dest ],
+ [ '%_EXT%', $ext ],
+ [ '%COMMON_OUTDIR%', $common_outdir ],
+ [ '%COMMON_DEST%', $common_dest ],
+ [ '%GUI%', $gui ]
+ );
+
+ # find out if the system supports symlinks
+ $has_symlinks = eval { symlink("",""); 1 };
+}
+
+sub get_base
+{
+ # a module base dir contains a subdir 'prj'
+ # which in turn contains a file 'd.lst'
+ my (@field, $repo, $base, $dlst);
+ my $path = getcwd();
+
+ @field = split(/\//, $path);
+
+ while ( $#field != -1 ) {
+ $base = join('/', @field);
+ $dlst = $base . '/prj/d.lst';
+ last if -e $dlst;
+ pop @field;
+ }
+
+ if ( $#field == -1 ) {
+ print_error("can't find d.lst");
+ exit(2);
+ }
+ else {
+ if ( defined $field[-2] ) {
+ $repo = $field[-2];
+ } else {
+ print_error("Internal error: cannot determine module's parent directory");
+ }
+ return ($field[-1], $repo, $base, $dlst);
+ }
+}
+
+sub parse_dlst
+{
+ my $line_cnt = 0;
+ open(DLST, "<$dlst_file") or die "can't open d.lst";
+ while(<DLST>) {
+ $line_cnt++;
+ tr/\r\n//d;
+ next if /^#/;
+ next if /^\s*$/;
+ if (!$delete_common && /%COMMON_DEST%/) {
+ # Just ignore all lines with %COMMON_DEST%
+ next;
+ };
+ if ( /^\s*(\w+?):\s+(.*)$/ ) {
+ if ( !exists $action_hash{$1} ) {
+ print_error("unknown action: \'$1\'", $line_cnt);
+ exit(4);
+ }
+ push(@action_data, [$1, $2]);
+ }
+ else {
+ if ( /^\s*%(COMMON)?_DEST%\\/ ) {
+ # only copy from source dir to solver, not from solver to solver
+ print_warning("illegal copy action, ignored: \'$_\'", $line_cnt);
+ next;
+ }
+ push(@action_data, ['copy', $_]);
+ # for each ressource file (.res) copy its image list (.ilst)
+ if ( /\.res\s/ ) {
+ my $imagelist = $_;
+ $imagelist =~ s/\.res/\.$ilst_ext/g;
+ $imagelist =~ s/\\bin%_EXT%\\/\\res%_EXT%\\img\\/;
+ push(@action_data, ['copy', $imagelist]);
+ }
+ }
+ # call expand_macros()just to find any undefined macros early
+ # real expansion is done later
+ expand_macros($_, $line_cnt);
+ }
+ close(DLST);
+}
+
+sub expand_macros
+{
+ # expand all macros and change backslashes to slashes
+ my $line = shift;
+ my $line_cnt = shift;
+ my $i;
+
+ for ($i=0; $i<=$#macros; $i++) {
+ $line =~ s/$macros[$i][0]/$macros[$i][1]/gi
+ }
+ if ( $line =~ /(%\w+%)/ ) {
+ if ( $1 ne '%OS%' ) { # %OS% looks like a macro but is not ...
+ print_error("unknown/obsolete macro: \'$1\'", $line_cnt);
+ }
+ }
+ $line =~ s#\\#/#g;
+ return $line;
+}
+
+sub walk_action_data
+{
+ # all actions have to be excuted relative to the prj directory
+ chdir("$base_dir/prj");
+ # dispatch depending on action type
+ for (my $i=0; $i <= $#action_data; $i++) {
+ &{"do_".$action_data[$i][0]}($action_data[$i][1]);
+ if ( $action_data[$i][0] eq 'mkdir' ) {
+ # fill array with (possibly) created directories in
+ # revers order for removal in 'cleanup'
+ unshift @dirlist, $action_data[$i][1];
+ }
+ }
+}
+
+sub glob_line
+{
+ my $from = shift;
+ my $to = shift;
+ my $to_dir = shift;
+ my $replace = 0;
+ my @globbed_files = ();
+
+ if ( ! ( $from && $to ) ) {
+ print_warning("Error in d.lst? source: '$from' destination: '$to'");
+ return \@globbed_files;
+ }
+
+ if ( $to =~ /[\*\?\[\]]/ ) {
+ my $to_fname;
+ ($to_fname, $to_dir) = fileparse($to);
+ $replace = 1;
+ }
+
+ if ( $from =~ /[\*\?\[\]]/ ) {
+ # globbing necessary, no renaming possible
+ my $file;
+ my @file_list = glob($from);
+
+ foreach $file ( @file_list ) {
+ next if ( -d $file); # we only copy files, not directories
+ my ($fname, $dir) = fileparse($file);
+ my $copy = ($replace) ? $to_dir . $fname : $to . '/' . $fname;
+ push(@globbed_files, [$file, $copy]);
+ }
+ }
+ else {
+ # no globbing but renaming possible
+ # #i89066#
+ if (-d $to && -f $from) {
+ my $filename = File::Basename::basename($from);
+ $to .= '/' if ($to !~ /[\\|\/]$/);
+ $to .= $filename;
+ };
+ push(@globbed_files, [$from, $to]);
+ }
+ if ( $opt_checkdlst ) {
+ my $outtree = expand_macros("%__SRC%");
+ my $commonouttree = expand_macros("%COMMON_OUTDIR%");
+ if (( $from !~ /\Q$outtree\E/ ) && ( $from !~ /\Q$commonouttree\E/ )) {
+ print_warning("'$from' does not match any file") if ( $#globbed_files == -1 );
+ }
+ }
+ return \@globbed_files;
+}
+
+
+sub glob_and_copy
+{
+ my $from = shift;
+ my $to = shift;
+ my $touch = shift;
+
+ my @copy_files = @{glob_line($from, $to)};
+
+ for (my $i = 0; $i <= $#copy_files; $i++) {
+ next if filter_out($copy_files[$i][0]); # apply copy filter
+ copy_if_newer($copy_files[$i][0], $copy_files[$i][1], $touch)
+ ? $files_copied++ : $files_unchanged++;
+ }
+}
+
+sub is_unstripped {
+ my $file_name = shift;
+ my $nm_output;
+
+ if (-f $file_name.$maybedot) {
+ my $file_type = `file $file_name`;
+ # OS X file command doesn't know if a file is stripped or not
+ if (($file_type =~ /not stripped/o) || ($file_type =~ /Mach-O/o) ||
+ (($file_type =~ /PE/o) && ($ENV{GUI} eq 'WNT') &&
+ ($nm_output = `nm $file_name 2>&1`) && $nm_output &&
+ !($nm_output =~ /no symbols/i) && !($nm_output =~ /not recognized/i))) {
+ return '1' if ($file_name =~ /\.bin$/o);
+ return '1' if ($file_name =~ /\.so\.*/o);
+ return '1' if ($file_name =~ /\.dylib\.*/o);
+ return '1' if ($file_name =~ /\.com\.*/o);
+ return '1' if ($file_name =~ /\.dll\.*/o);
+ return '1' if ($file_name =~ /\.exe\.*/o);
+ return '1' if (basename($file_name) !~ /\./o);
+ }
+ };
+ return '';
+}
+
+sub initialize_strip {
+ if ((!defined $ENV{DISABLE_STRIP}) || ($ENV{DISABLE_STRIP} eq "")) {
+ $strip .= 'guw ' if ($^O eq 'cygwin');
+ $strip .= 'strip';
+ $strip .= " -x" if ($ENV{OS} eq 'MACOSX');
+ $strip .= " -R '.comment' -s" if ($ENV{OS} eq 'LINUX');
+ };
+};
+
+sub is_jar {
+ my $file_name = shift;
+
+ if (-f $file_name && (( `file $file_name` ) =~ /Zip archive/o)) {
+ return '1' if ($file_name =~ /\.jar\.*/o);
+ };
+ return '';
+}
+
+sub execute_system {
+ my $command = shift;
+ if (system($command)) {
+ print_error("Failed to execute $command");
+ exit($?);
+ };
+};
+
+sub strip_target {
+ my $file = shift;
+ my $temp_file = shift;
+ $temp_file =~ s/\/{2,}/\//g;
+ my $rc = copy($file, $temp_file);
+ execute_system("$strip $temp_file");
+ return $rc;
+};
+
+sub copy_if_newer
+{
+ # return 0 if file is unchanged ( for whatever reason )
+ # return 1 if file has been copied
+ my $from = shift;
+ my $to = shift;
+ my $touch = shift;
+ my $from_stat_ref;
+ my $rc = 0;
+
+ print "testing $from, $to\n" if $is_debug;
+ push_on_ziplist($to) if $opt_zip;
+ push_on_loglist("COPY", "$from", "$to") if $opt_log;
+ return 0 unless ($from_stat_ref = is_newer($from, $to, $touch));
+
+ if ( $opt_delete ) {
+ print "REMOVE: $to\n" if $opt_verbose;
+ $rc = unlink($to) unless $opt_check;
+ return 1 if $opt_check;
+ return $rc;
+ }
+
+ if( !$opt_check && $opt_link ) {
+ # hard link if possible
+ if( link($from, $to) ){
+ print "LINK: $from -> $to\n" if $opt_verbose;
+ return 1;
+ }
+ }
+
+ if( $touch ) {
+ print "TOUCH: $from -> $to\n" if $opt_verbose;
+ }
+ else {
+ print "COPY: $from -> $to\n" if $opt_verbose;
+ }
+
+ return 1 if( $opt_check );
+
+ #
+ # copy to temporary file first and rename later
+ # to minimize the possibility for race conditions
+ local $temp_file = sprintf('%s.%d-%d', $to, $$, time());
+ $rc = '';
+ if (($strip ne '') && (defined $ENV{PROEXT}) && (is_unstripped($from))) {
+ $rc = strip_target($from, $temp_file);
+ } else {
+ $rc = copy($from, $temp_file);
+ };
+ if ( $rc) {
+ if ( is_newer($temp_file, $from, 0) ) {
+ $rc = utime($$from_stat_ref[9], $$from_stat_ref[9], $temp_file);
+ if ( !$rc ) {
+ print_warning("can't update temporary file modification time '$temp_file': $!\n
+ Check file permissions of '$from'.",0);
+ }
+ }
+ fix_file_permissions($$from_stat_ref[2], $temp_file);
+ if ( $^O eq 'os2' )
+ {
+ $rc = unlink($to); # YD OS/2 can't rename if $to exists!
+ }
+ # Ugly hack: on windows file locking(?) sometimes prevents renaming.
+ # Until we've found and fixed the real reason try it repeatedly :-(
+ my $try = 0;
+ my $maxtries = 1;
+ $maxtries = 5 if ( $^O eq 'MSWin32' );
+ my $success = 0;
+ while ( $try < $maxtries && ! $success ) {
+ sleep $try;
+ $try ++;
+ $success = rename($temp_file, $to);
+ if ( $^O eq 'cygwin' && $to =~ /\.bin$/) {
+ # hack to survive automatically added .exe for executables renamed to
+ # *.bin - will break if there is intentionally a .bin _and_ .bin.exe file.
+ $success = rename( "$to.exe", $to ) if -f "$to.exe";
+ }
+ }
+ if ( $success ) {
+ # handle special packaging of *.dylib files for Mac OS X
+ if ( $^O eq 'darwin' )
+ {
+ system("macosx-create-bundle", "$to=$from.app") if ( -d "$from.app" );
+ system("ranlib", "$to" ) if ( $to =~ /\.a/ );
+ }
+ if ( $try > 1 ) {
+ print_warning("File '$to' temporarily locked. Dependency bug?");
+ }
+ return 1;
+ }
+ else {
+ print_error("can't rename temporary file to $to: $!",0);
+ }
+ }
+ else {
+ print_error("can't copy $from: $!",0);
+ my $destdir = dirname($to);
+ if ( ! -d $destdir ) {
+ print_error("directory '$destdir' does not exist", 0);
+ }
+ }
+ unlink($temp_file);
+ return 0;
+}
+
+sub is_newer
+{
+ # returns whole stat buffer if newer
+ my $from = shift;
+ my $to = shift;
+ my $touch = shift;
+ my (@from_stat, @to_stat);
+
+ @from_stat = stat($from.$maybedot);
+ if ( $opt_checkdlst ) {
+ my $outtree = expand_macros("%__SRC%");
+ my $commonouttree = expand_macros("%COMMON_OUTDIR%");
+ if ( $from !~ /$outtree/ ) {
+ if ( $from !~ /$commonouttree/ ) {
+ print_warning("'$from' does not exist") unless -e _;
+ }
+ }
+ }
+ return 0 unless -f _;
+
+ if ( $touch ) {
+ $from_stat[9] = time();
+ }
+ # adjust timestamps to even seconds
+ # this is necessary since NT platforms have a
+ # 2s modified time granularity while the timestamps
+ # on Samba volumes have a 1s granularity
+
+ $from_stat[9]-- if $from_stat[9] % 2;
+
+ if ( $to =~ /^\Q$dest\E/ ) {
+ if ( $from_stat[9] > $logfiledate ) {
+ $logfiledate = $from_stat[9];
+ }
+ } elsif ( $common_build && ( $to =~ /^\Q$common_dest\E/ ) ) {
+ if ( $from_stat[9] > $commonlogfiledate ) {
+ $commonlogfiledate = $from_stat[9];
+ }
+ }
+
+ @to_stat = stat($to.$maybedot);
+ return \@from_stat unless -f _;
+
+ if ( $opt_force ) {
+ return \@from_stat;
+ }
+ else {
+ return ($from_stat[9] > $to_stat[9]) ? \@from_stat : 0;
+ }
+}
+
+sub filter_out
+{
+ my $file = shift;
+
+ foreach my $pattern ( @copy_filter_patterns ) {
+ if ( $file =~ /$pattern/ ) {
+ print "filter out: $file\n" if $is_debug;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+sub fix_file_permissions
+{
+ my $mode = shift;
+ my $file = shift;
+
+ if ( ($mode >> 6) % 2 == 1 ) {
+ $mode = 0777 & ~$umask;
+ }
+ else {
+ $mode = 0666 & ~$umask;
+ }
+ chmod($mode, $file);
+}
+
+sub get_latest_patchlevel
+{
+ # note: feed only well formed library names to this function
+ # of the form libfoo.so.x.y.z with x,y,z numbers
+
+ my @sorted_files = sort by_rev @_;
+ return $sorted_files[-1];
+
+ sub by_rev {
+ # comparison function for sorting
+ my (@field_a, @field_b, $i);
+
+ $a =~ /^(lib[\w-]+(\.so|\.dylib))\.(\d+)\.(\d+)\.(\d+)$/;
+ @field_a = ($3, $4, $5);
+ $b =~ /^(lib[\w-]+(\.so|\.dylib))\.(\d+)\.(\d+)\.(\d+)$/;
+ @field_b = ($3, $4, $5);
+
+ for ($i = 0; $i < 3; $i++)
+ {
+ if ( ($field_a[$i] < $field_b[$i]) ) {
+ return -1;
+ }
+ if ( ($field_a[$i] > $field_b[$i]) ) {
+ return 1;
+ }
+ }
+
+ # can't happen
+ return 0;
+ }
+
+}
+
+sub push_default_actions
+{
+ # any default action (that is an action which must be done even without
+ # a corresponding d.lst entry) should be pushed here on the
+ # @action_data list.
+ my $subdir;
+ my @subdirs = (
+ 'bin',
+ 'doc',
+ 'inc',
+ 'lib',
+ 'par',
+ 'pck',
+ 'rdb',
+ 'res',
+ 'xml'
+ );
+ push(@subdirs, 'zip') if $opt_zip;
+ push(@subdirs, 'idl') if ! $common_build;
+ push(@subdirs, 'pus') if ! $common_build;
+ my @common_subdirs = (
+ 'bin',
+ 'idl',
+ 'inc',
+ 'pck',
+ 'pus',
+ 'res'
+ );
+ push(@common_subdirs, 'zip') if $opt_zip;
+
+ if ( ! $opt_delete ) {
+ # create all the subdirectories on solver
+ foreach $subdir (@subdirs) {
+ push(@action_data, ['mkdir', "%_DEST%/$subdir%_EXT%"]);
+ }
+ if ( $common_build ) {
+ foreach $subdir (@common_subdirs) {
+ push(@action_data, ['mkdir', "%COMMON_DEST%/$subdir%_EXT%"]);
+ }
+ }
+ }
+ push(@action_data, ['mkdir', "%_DEST%/inc%_EXT%/$module"]);
+ if ( $common_build ) {
+ push(@action_data, ['mkdir', "%COMMON_DEST%/inc%_EXT%/$module"]);
+ push(@action_data, ['mkdir', "%COMMON_DEST%/res%_EXT%/img"]);
+ } else {
+ push(@action_data, ['mkdir', "%_DEST%/res%_EXT%/img"]);
+ }
+
+ # deliver build.lst to $dest/inc/$module
+ push(@action_data, ['copy', "build.lst %_DEST%/inc%_EXT%/$module/build.lst"]);
+ if ( $common_build ) {
+ # ... and to $common_dest/inc/$module
+ push(@action_data, ['copy', "build.lst %COMMON_DEST%/inc%_EXT%/$module/build.lst"]);
+ }
+
+ # need to copy libstaticmxp.dylib for Mac OS X
+ if ( $^O eq 'darwin' )
+ {
+ push(@action_data, ['copy', "../%__SRC%/lib/lib*static*.dylib %_DEST%/lib%_EXT%/lib*static*.dylib"]);
+ }
+}
+
+sub walk_addincpath_list
+{
+ my (@addincpath_headers);
+ return if $#addincpath_list == -1;
+
+ # create hash with all addincpath header names
+ for (my $i = 0; $i <= $#addincpath_list; $i++) {
+ my @field = split('/', $addincpath_list[$i][0]);
+ push (@addincpath_headers, $field[-1]);
+ }
+
+ # now stream all addincpath headers through addincpath filter
+ for (my $i = 0; $i <= $#addincpath_list; $i++) {
+ add_incpath_if_newer($addincpath_list[$i][0], $addincpath_list[$i][1], \@addincpath_headers)
+ ? $files_copied++ : $files_unchanged++;
+ }
+}
+
+sub add_incpath_if_newer
+{
+ my $from = shift;
+ my $to = shift;
+ my $modify_headers_ref = shift;
+ my ($from_stat_ref, $header);
+
+ push_on_ziplist($to) if $opt_zip;
+ push_on_loglist("ADDINCPATH", "$from", "$to") if $opt_log;
+
+ if ( $opt_delete ) {
+ print "REMOVE: $to\n" if $opt_verbose;
+ my $rc = unlink($to);
+ return 1 if $rc;
+ return 0;
+ }
+
+ if ( $from_stat_ref = is_newer($from, $to) ) {
+ print "ADDINCPATH: $from -> $to\n" if $opt_verbose;
+
+ return 1 if $opt_check;
+
+ my $save = $/;
+ undef $/;
+ open(FROM, "<$from");
+ # slurp whole file in one big string
+ my $content = <FROM>;
+ close(FROM);
+ $/ = $save;
+
+ foreach $header (@$modify_headers_ref) {
+ $content =~ s/#include [<"]$header[>"]/#include <$module\/$header>/g;
+ }
+
+ open(TO, ">$to");
+ print TO $content;
+ close(TO);
+
+ utime($$from_stat_ref[9], $$from_stat_ref[9], $to);
+ fix_file_permissions($$from_stat_ref[2], $to);
+ return 1;
+ }
+ return 0;
+}
+
+sub push_on_ziplist
+{
+ my $file = shift;
+ return if ( $opt_check );
+ # strip $dest from path since we don't want to record it in zip file
+ if ( $file =~ s#^\Q$dest\E/##o ) {
+ if ( $updminor ){
+ # strip minor from path
+ my $ext = "%_EXT%";
+ $ext = expand_macros($ext);
+ $file =~ s#^$ext##o;
+ }
+ push(@zip_list, $file);
+ } elsif ( $file =~ s#^\Q$common_dest\E/##o ) {
+ if ( $updminor ){
+ # strip minor from path
+ my $ext = "%_EXT%";
+ $ext = expand_macros($ext);
+ $file =~ s#^$ext##o;
+ }
+ push(@common_zip_list, $file);
+ }
+}
+
+sub push_on_loglist
+{
+ my @entry = @_;
+ return 0 if ( $opt_check );
+ return -1 if ( $#entry != 2 );
+ if (( $entry[0] eq "COPY" ) || ( $entry[0] eq "ADDINCPATH" )) {
+ return 0 if ( ! -e $entry[1].$maybedot );
+ # make 'from' relative to source root
+ $entry[1] = $repository ."/" . $module . "/prj/" . $entry[1];
+ $entry[1] =~ s/$module\/prj\/\.\./$module/;
+ }
+ # platform or common tree?
+ my $common;
+ if ( $entry[2] =~ /^\Q$dest\E/ ) {
+ $common = 0;
+ } elsif ( $common_build && ( $entry[2] =~ /^\Q$common_dest\E/ )) {
+ $common = 1;
+ } else {
+ warn "Neither common nor platform tree?";
+ return;
+ }
+ # make 'to' relative to SOLARVERSION
+ my $solarversion = $ENV{'SOLARVERSION'};
+ $solarversion =~ s#\\#/#g;
+ $entry[2] =~ s/^\Q$solarversion\E\///;
+ # strip minor from 'to'
+ my $ext = "%_EXT%";
+ $ext = expand_macros($ext);
+ $entry[2] =~ s#$ext([\\\/])#$1#o;
+
+ if ( $common ) {
+ push @common_log_list, [@entry];
+ } else {
+ push @log_list, [@entry];
+ }
+ return 1;
+}
+
+sub zip_files
+{
+ my $zipexe = 'zip';
+ $zipexe .= ' -y' unless $^O eq 'MSWin32';
+
+ my ($platform_zip_file, $common_zip_file);
+ $platform_zip_file = "%_DEST%/zip%_EXT%/$module.zip";
+ $platform_zip_file = expand_macros($platform_zip_file);
+ my (%dest_dir, %list_ref);
+ $dest_dir{$platform_zip_file} = $dest;
+ $list_ref{$platform_zip_file} = \@zip_list;
+ if ( $common_build ) {
+ $common_zip_file = "%COMMON_DEST%/zip%_EXT%/$module.zip";
+ $common_zip_file = expand_macros($common_zip_file);
+ $dest_dir{$common_zip_file} = $common_dest;
+ $list_ref{$common_zip_file} = \@common_zip_list;
+ }
+
+ my $ext = "%_EXT%";
+ $ext = expand_macros($ext);
+
+ my @zipfiles;
+ $zipfiles[0] = $platform_zip_file;
+ if ( $common_build ) {
+ push @zipfiles, ($common_zip_file);
+ }
+ foreach my $zip_file ( @zipfiles ) {
+ print "ZIP: updating $zip_file\n" if $opt_verbose;
+ next if ( $opt_check );
+
+ if ( $opt_delete ) {
+ if ( -e $zip_file ) {
+ unlink $zip_file or die "Error: can't remove file '$zip_file': $!";
+ }
+ next;
+ }
+
+ local $work_file = "";
+ if ( $zip_file eq $common_zip_file) {
+ # Zip file in common tree: work on uniq copy to avoid collisions
+ $work_file = $zip_file;
+ $work_file =~ s/\.zip$//;
+ $work_file .= (sprintf('.%d-%d', $$, time())) . ".zip";
+ die "Error: temp file $work_file already exists" if ( -e $work_file);
+ if ( -e $zip_file ) {
+ if ( -z $zip_file) {
+ # sometimes there are files of 0 byte size - remove them
+ unlink $zip_file or print_error("can't remove empty file '$zip_file': $!",0);
+ } else {
+ if ( ! copy($zip_file, $work_file)) {
+ # give a warning, not an error:
+ # we can zip from scratch instead of just updating the old zip file
+ print_warning("can't copy'$zip_file' into '$work_file': $!", 0);
+ unlink $work_file;
+ }
+ }
+ }
+ } else {
+ # No pre processing necessary, working directly on solver.
+ $work_file = $zip_file;
+ }
+
+ # zip content has to be relative to $dest_dir
+ chdir($dest_dir{$zip_file}) or die "Error: cannot chdir into $dest_dir{$zip_file}";
+ my $this_ref = $list_ref{$zip_file};
+ open(ZIP, "| $zipexe -q -o -u -@ $work_file") or die "error opening zip file";
+ foreach $file ( @$this_ref ) {
+ print "ZIP: adding $file to $zip_file\n" if $is_debug;
+ print ZIP "$file\n";
+ }
+ close(ZIP);
+ fix_broken_cygwin_created_zips($work_file) if $^O eq "cygwin";
+
+ if ( $zip_file eq $common_zip_file) {
+ # rename work file back
+ if ( -e $work_file ) {
+ if ( -e $zip_file) {
+ # do some tricks to be fast. otherwise we may disturb other platforms
+ # by unlinking a file which just gets copied -> stale file handle.
+ my $buffer_file=$work_file . '_rm';
+ rename($zip_file, $buffer_file) or warn "Warning: can't rename old zip file '$zip_file': $!";
+ if (! rename($work_file, $zip_file)) {
+ print_error("can't rename temporary file to $zip_file: $!",0);
+ unlink $work_file;
+ }
+ unlink $buffer_file;
+ } else {
+ if (! rename($work_file, $zip_file)) {
+ print_error("can't rename temporary file to $zip_file: $!",0);
+ unlink $work_file;
+ }
+ }
+ }
+ }
+ }
+}
+
+sub fix_broken_cygwin_created_zips
+# add given extension to or strip it from stored path
+{
+ require Archive::Zip; import Archive::Zip;
+ my $zip_file = shift;
+
+ $zip = Archive::Zip->new();
+ unless ( $zip->read($work_file) == AZ_OK ) {
+ die "Error: can't open zip file '$zip_file' to fix broken cygwin file permissions";
+ }
+ my $latest_member_mod_time = 0;
+ foreach $member ( $zip->members() ) {
+ my $attributes = $member->unixFileAttributes();
+ $attributes &= ~0xFE00;
+ print $member->fileName() . ": " . sprintf("%lo", $attributes) if $is_debug;
+ $attributes |= 0x10; # add group write permission
+ print "-> " . sprintf("%lo", $attributes) . "\n" if $is_debug;
+ $member->unixFileAttributes($attributes);
+ if ( $latest_member_mod_time < $member->lastModTime() ) {
+ $latest_member_mod_time = $member->lastModTime();
+ }
+ }
+ die "Error: can't overwrite zip file '$zip_file' for fixing permissions" unless $zip->overwrite() == AZ_OK;
+ utime($latest_member_mod_time, $latest_member_mod_time, $zip_file);
+}
+
+sub get_tempfilename
+{
+ my $temp_dir = shift;
+ $temp_dir = ( -d '/tmp' ? '/tmp' : $ENV{TMPDIR} || $ENV{TEMP} || '.' )
+ unless defined($temp_dir);
+ if ( ! -d $temp_dir ) {
+ die "no temp directory $temp_dir\n";
+ }
+ my $base_name = sprintf( "%d-%di-%d", $$, time(), $tempcounter++ );
+ return "$temp_dir/$base_name";
+}
+
+sub write_log
+{
+ my (%log_file, %file_date);
+ $log_file{\@log_list} = "%_DEST%/inc%_EXT%/$module/deliver.log";
+ $log_file{\@common_log_list} = "%COMMON_DEST%/inc%_EXT%/$module/deliver.log";
+ $file_date{\@log_list} = $logfiledate;
+ $file_date{\@common_log_list} = $commonlogfiledate;
+
+ my @logs = ( \@log_list );
+ push @logs, ( \@common_log_list ) if ( $common_build );
+ foreach my $log ( @logs ) {
+ $log_file{$log} = expand_macros( $log_file{$log} );
+ if ( $opt_delete ) {
+ print "LOG: removing $log_file{$log}\n" if $opt_verbose;
+ next if ( $opt_check );
+ unlink $log_file{$log};
+ } else {
+ print "LOG: writing $log_file{$log}\n" if $opt_verbose;
+ next if ( $opt_check );
+ open( LOGFILE, "> $log_file{$log}" ) or warn "Error: could not open log file.";
+ foreach my $item ( @$log ) {
+ print LOGFILE "@$item\n";
+ }
+ close( LOGFILE );
+ utime($file_date{$log}, $file_date{$log}, $log_file{$log});
+ }
+ push_on_ziplist( $log_file{$log} ) if $opt_zip;
+ }
+ return;
+}
+
+sub check_dlst
+{
+ my %createddir;
+ my %destdir;
+ my %destfile;
+ # get all checkable actions to perform
+ foreach my $action ( @action_data ) {
+ my $path = expand_macros( $$action[1] );
+ if ( $$action[0] eq 'mkdir' ) {
+ $createddir{$path} ++;
+ } elsif (( $$action[0] eq 'copy' ) || ( $$action[0] eq 'addincpath' )) {
+ my ($from, $to) = split(' ', $path);
+ my ($to_fname, $to_dir);
+ my $withwildcard = 0;
+ if ( $from =~ /[\*\?\[\]]/ ) {
+ $withwildcard = 1;
+ }
+ ($to_fname, $to_dir) = fileparse($to);
+ if ( $withwildcard ) {
+ if ( $to !~ /[\*\?\[\]]/ ) {
+ $to_dir = $to;
+ $to_fname ='';
+ }
+ }
+ $to_dir =~ s/[\\\/\s]$//;
+ $destdir{$to_dir} ++;
+ # Check: copy into non existing directory?
+ if ( ! $createddir{$to_dir} ) {
+ # unfortunately it is not so easy: it's OK if a subdirectory of $to_dir
+ # gets created, because mkpath creates the whole tree
+ foreach my $directory ( keys %createddir ) {
+ if ( $directory =~ /^\Q$to_dir\E[\\\/]/ ) {
+ $createddir{$to_dir} ++;
+ last;
+ }
+ }
+ print_warning("Possibly copying into directory without creating in before: '$to_dir'")
+ unless $createddir{$to_dir};
+ }
+ # Check: overwrite file?
+ if ( ! $to ) {
+ if ( $destfile{$to} ) {
+ print_warning("Multiple entries copying to '$to'");
+ }
+ $destfile{$to} ++;
+ }
+ }
+ }
+}
+
+sub cleanup
+{
+ # remove empty directories
+ foreach my $path ( @dirlist ) {
+ $path = expand_macros($path);
+ if ( $opt_check ) {
+ print "RMDIR: $path\n" if $opt_verbose;
+ } else {
+ rmdir $path;
+ }
+ }
+}
+
+sub delete_output
+{
+ my $output_path = expand_macros("../%__SRC%");
+ if ( "$output_path" ne "../" ) {
+ if ( rmtree([$output_path], 0, 1) ) {
+ print "Deleted output tree.\n" if $opt_verbose;
+ }
+ else {
+ print_error("Error deleting output tree $output_path: $!",0);
+ }
+ }
+ else {
+ print_error("Output not deleted - INPATH is not set");
+ }
+}
+
+sub print_warning
+{
+ my $message = shift;
+ my $line = shift;
+
+ print STDERR "$script_name: ";
+ if ( $dlst_file ) {
+ print STDERR "$dlst_file: ";
+ }
+ if ( $line ) {
+ print STDERR "line $line: ";
+ }
+ print STDERR "WARNING: $message\n";
+}
+
+sub print_error
+{
+ my $message = shift;
+ my $line = shift;
+
+ print STDERR "$script_name: ";
+ if ( $dlst_file ) {
+ print STDERR "$dlst_file: ";
+ }
+ if ( $line ) {
+ print STDERR "line $line: ";
+ }
+ print STDERR "ERROR: $message\n";
+ $error ++;
+}
+
+sub print_stats
+{
+ print "Module '$module' delivered ";
+ if ( $error ) {
+ print "with errors\n";
+ } else {
+ print "successfully.";
+ if ( $opt_delete ) {
+ print " $files_copied files removed,";
+ }
+ else {
+ print " $files_copied files copied,";
+ }
+ print " $files_unchanged files unchanged\n";
+ }
+}
+
+sub cleanup_and_die
+{
+ # clean up on unexpected termination
+ my $sig = shift;
+ if ( defined($temp_file) && -e $temp_file ) {
+ unlink($temp_file);
+ }
+ if ( defined($work_file) && -e $work_file ) {
+ unlink($work_file);
+ print STDERR "$work_file removed\n";
+ }
+
+ die "caught unexpected signal $sig, terminating ...";
+}
+
+sub usage
+{
+ my $exit_code = shift;
+ print STDERR "Usage:\ndeliver [OPTIONS] [DESTINATION-PATH]\n";
+ print STDERR "Options:\n";
+ print STDERR " -check just print what would happen, no actual copying of files\n";
+ print STDERR " -checkdlst be verbose about (possible) d.lst bugs\n";
+ print STDERR " -delete delete files (undeliver), use with care\n";
+ print STDERR " -deloutput remove the output tree after copying\n";
+ print STDERR " -dontdeletecommon do not delete common files (for -delete option)\n";
+ print STDERR " -force copy even if not newer\n";
+ print STDERR " -help print this message\n";
+ if ( !defined($ENV{GUI}) || $ENV{GUI} ne 'WNT' ) {
+ print STDERR " -link hard link files into the solver to save disk space\n";
+ }
+ print STDERR " -quiet be quiet, only report errors\n";
+ print STDERR " -verbose be verbose\n";
+ print STDERR " -zip additionally create zip files of delivered content\n";
+ print STDERR "Options '-zip' and a destination-path are mutually exclusive.\n";
+ print STDERR "Options '-check' and '-quiet' are mutually exclusive.\n";
+ exit($exit_code);
+}
+
+# vim: set ts=4 shiftwidth=4 expandtab syntax=perl:
diff --git a/solenv/bin/diffmv.pl b/solenv/bin/diffmv.pl
new file mode 100755
index 000000000000..89e5e4fd9ffb
--- /dev/null
+++ b/solenv/bin/diffmv.pl
@@ -0,0 +1,76 @@
+:
+ eval 'exec perl -S $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+my ( $srcfile, $destfile ) = @ARGV;
+my ( @srclines, @destlines );
+my $dest_existing = 0;
+@destlines = ();
+
+usage() if ( ! defined $srcfile || ! defined $destfile);
+
+open(SRCFILE, "$srcfile") or die "ERROR: Can't open $srcfile\n";
+@srclines = <SRCFILE>;
+close SRCFILE;
+
+if ( -f $destfile ) {
+ open(DESTFILE, "$destfile") or die "ERROR: Can't open $destfile\n";
+ @destlines = <DESTFILE>;
+ close DESTFILE;
+ $dest_existing = 1;
+}
+
+if ( ! check_if_lists_equal(\@srclines, \@destlines) ) {
+ print STDERR "Updating \"$destfile\".\n";
+ unlink "$destfile" or die "ERROR: Can't remove old $destfile\n" if ( $dest_existing );
+ rename "$srcfile", "$destfile" or die "ERROR: Can't rename $srcfile to $destfile\n";
+} else {
+ print STDERR "\"$destfile\" unchanged.\n";
+}
+
+sub check_if_lists_equal
+{
+ my ( $srclist_ref, $destlist_ref ) = @_;
+ my @srclist = @{ $srclist_ref };
+ my @destlist = @{ $destlist_ref };
+ return 0 if ( $#srclist != $#destlist );
+ for ( my $i = 0; $i < $#srclist; $i++ ) {
+ return 0 if ( $srclist[$i] ne $destlist[$i]);
+ }
+ return 1;
+}
+
+sub usage
+{
+ print STDERR "Usage: diffmv sourcefile destfile\n";
+ print STDERR "Do move diffing file only\n";
+ exit 1;
+}
+
diff --git a/solenv/bin/exectest.pl b/solenv/bin/exectest.pl
new file mode 100644
index 000000000000..d343cf298017
--- /dev/null
+++ b/solenv/bin/exectest.pl
@@ -0,0 +1,98 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+$#ARGV >= 1
+ or die "Usage: $0 <input file>|-SUCCESS|-FAILURE <command> <arguments...>";
+if ($ARGV[0] eq "-SUCCESS")
+{
+ $expect = "SUCCESS";
+ $input = 0;
+}
+elsif ($ARGV[0] eq "-FAILURE")
+{
+ $expect = "FAILURE";
+ $input = 0;
+}
+else
+{
+ open INPUT, $ARGV[0] or die "cannot open $ARGV[0]: $!";
+ $input = 1;
+}
+shift @ARGV;
+$failed = 0;
+$open = 0;
+while (1) {
+ $eof = $input ? eof INPUT : $open;
+ $in = <INPUT> if $input && !$eof;
+ if (!$input || $eof
+ || $in =~ /^EXPECT (SUCCESS|FAILURE|\d+)( "([^"]*)")?:\n$/)
+ {
+ if ($open)
+ {
+ close PIPE;
+ if ($? % 256 == 0)
+ {
+ $exit = $? / 256;
+ $ok = $expect eq "SUCCESS" ? $exit == 0
+ : $expect eq "FAILURE" ? $exit != 0 : $exit == $expect;
+ }
+ else
+ {
+ $exit = "signal";
+ $ok = 0;
+ }
+ print "\"$title\", " if defined $title;
+ print "expected $expect, got $exit ($?): ";
+ if ($ok)
+ {
+ print "ok\n";
+ }
+ else
+ {
+ print "FAILED!\n";
+ $failed = 1;
+ }
+ }
+ last if $eof;
+ $expect = $1 if $input;
+ if (defined $3)
+ {
+ $title = $3;
+ }
+ else
+ {
+ undef $title;
+ }
+ open PIPE, "| @ARGV" or die "cannot start process: $!";
+ $open = 1;
+ }
+ elsif ($open && $input)
+ {
+ print PIPE $in or die "cannot write to pipe: $!";
+ }
+}
+exit $failed;
diff --git a/solenv/bin/fix_def_file.cmd b/solenv/bin/fix_def_file.cmd
new file mode 100644
index 000000000000..4db97f8ce435
--- /dev/null
+++ b/solenv/bin/fix_def_file.cmd
@@ -0,0 +1,52 @@
+/* os2 build scripts
+
+this script is used to process def results
+
+*/
+
+lmax = 0
+smax = ''
+ordinal = 1
+
+do while( lines())
+
+ l = strip(linein())
+ l = strip(l,,X2C(9))
+ l = strip(l,,";")
+ if LEFT( l,4) \= 'Java' THEN l = '_'l
+
+ /* remove comments */
+ if POS(';', l) > 0 then l = LEFT( l, POS(';', l)-1)
+ if POS('#', l) > 0 then l = LEFT( l, POS('#', l)-1)
+ /* remove wildcards */
+ if POS('*', l) > 0 then l = ''
+
+ /* remove empty lines */
+ if l = '_' then l = ''
+
+ /* remove component_getDescriptionFunc, since it is already added by tg_def */
+ if l = '_component_getDescriptionFunc' then l = ''
+ if l = '_GetVersionInfo' then l = ''
+
+ /* remove GLOBAL symbols */
+/*
+ if POS('_GLOBAL_', l) > 0 then l = ';'l
+ if POS('_ZN4_STL', l) > 0 then l = ';'l
+ if POS('_ZNK4_STL', l) > 0 then l = ';'l
+*/
+ /* if LENGTH(l) > 254 then l = ';(>254)'left(l,100)*/
+
+ IF LENGTH(l)>0 THEN DO
+ say l
+ ordinal = ordinal + 1
+ END
+
+ if LENGTH(l)>lmax then do
+ lmax = LENGTH(l)
+ smax = l
+ end
+
+end
+
+say ';lmax='lmax
+say ';smax='smax
diff --git a/solenv/bin/fix_def_ord.cmd b/solenv/bin/fix_def_ord.cmd
new file mode 100644
index 000000000000..eaeb666626db
--- /dev/null
+++ b/solenv/bin/fix_def_ord.cmd
@@ -0,0 +1,19 @@
+/* os2 build scripts
+
+this script is used to process def results.
+Adds ordinal number to every line.
+
+*/
+
+lmax = 0
+smax = ''
+
+ord = 1
+do while( lines())
+
+ l = linein()
+ IF LENGTH(l)>0 THEN DO
+ say l /* ' @'ord ' RESIDENTNAME' */
+ ord = ord + 1
+ END
+end
diff --git a/solenv/bin/fix_dxp_file.cmd b/solenv/bin/fix_dxp_file.cmd
new file mode 100644
index 000000000000..66149c1207ea
--- /dev/null
+++ b/solenv/bin/fix_dxp_file.cmd
@@ -0,0 +1,30 @@
+/* os2 build scripts
+
+this script is used to process dxp files produced from .map
+
+*/
+
+do while( lines())
+
+ l = linein()
+
+ l = strip(l)
+ l = strip(l,,X2C(9))
+ l = strip(l,,";")
+ if LEFT( l,4) \= 'Java' THEN l = '_'l
+
+ /* remove empty lines */
+ if l = '_' then l = ''
+
+ /* remove component_getDescriptionFunc, since it is already added by tg_def */
+ if l = '_component_getDescriptionFunc' then l = ''
+ if l = '_GetVersionInfo' then l = ''
+
+ /* remove GLOBAL symbols */
+/*
+ if WORDPOS( l, '_GLOBAL_') > 0 then l = ''
+*/
+
+ say l
+
+end
diff --git a/solenv/bin/fix_exp_file.cmd b/solenv/bin/fix_exp_file.cmd
new file mode 100644
index 000000000000..bec416c06e05
--- /dev/null
+++ b/solenv/bin/fix_exp_file.cmd
@@ -0,0 +1,54 @@
+/* os2 build scripts
+
+this script is used to process emxexp results
+
+*/
+
+lmax = 0
+ordinal = 1
+
+do while( lines())
+
+ l = strip(linein())
+ if POS(';', l) > 0 then l = LEFT(l,POS(';', l)-1)
+
+ l = strip(translate(l,'','"'))
+ l = strip(l,,X2C(9))
+
+ /* remove empty lines */
+ if l = '_' then l = ''
+
+ /* remove component_getDescriptionFunc, since it is already added by tg_def */
+ if l = '_component_getDescriptionFunc' then l = ''
+ if l = '_GetVersionInfo' then l = ''
+
+
+ /* remove GLOBAL symbols */
+ if POS('_GLOBAL_', l) > 0 then l = ';'l
+/*
+ if POS('!', l) > 0 then l = ';'l
+ if POS('_ZN4_STL', l) > 0 then l = ';'l
+ if POS('_ZNK4_STL', l) > 0 then l = ';'l
+ if POS('ImplClass', l) > 0 then l = ';'l
+ if POS('ImplHelper', l) > 0 then l = ';'l
+ if POS('UsageHelper', l) > 0 then l = ';'l
+ if POS('com3sun4star3', l) > 0 then l = ';'l
+*/
+ /* if LENGTH(l) > 254 then l = ';(>254)'left(l,100) */
+
+ if POS(';', l) > 0 then l = LEFT(l,POS(';', l)-1)
+
+ IF LENGTH(l)>0 THEN DO
+ say l
+ ordinal = ordinal + 1
+ END
+
+ if LENGTH(l)>lmax then do
+ lmax = LENGTH(l)
+ smax = l
+ end
+
+end
+
+say ';lmax='lmax
+say ';smax='smax
diff --git a/solenv/bin/fix_lin_file.cmd b/solenv/bin/fix_lin_file.cmd
new file mode 100644
index 000000000000..0d074ce9f706
--- /dev/null
+++ b/solenv/bin/fix_lin_file.cmd
@@ -0,0 +1,13 @@
+/* os2 build scripts
+*/
+
+parse arg dir
+
+do while( lines())
+
+ l = linein()
+
+ /* skip empty lines */
+ if l \= '' then say dir || '\' || l
+
+end
diff --git a/solenv/bin/fix_shl.cmd b/solenv/bin/fix_shl.cmd
new file mode 100644
index 000000000000..ca13abb2074e
--- /dev/null
+++ b/solenv/bin/fix_shl.cmd
@@ -0,0 +1,11 @@
+/* os2 build scripts
+
+will return a 8.3 conformant name for modname.
+
+21/02/2006 Actually this is a simple truncation, seems nothing more needed.
+
+*/
+
+parse arg modname
+if pos('.',modname)>0 then modname = left(modname, pos('.',modname)-1)
+say strip(left(modname,8))
diff --git a/solenv/bin/gccinstlib.pl b/solenv/bin/gccinstlib.pl
new file mode 100755
index 000000000000..90c8f02a3e06
--- /dev/null
+++ b/solenv/bin/gccinstlib.pl
@@ -0,0 +1,65 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+$ENV{'LC_MESSAGES'} = 'C';
+
+$Dest = pop(@ARGV) || die "No destination to copy to";
+
+$cc = $ENV{'CC'} || die "No CC environment set";
+
+if ($Dest =~ /--help/ || @ARGV < 1) {
+ print "Syntax:\n gcc-instlib <library-in-libpath ...> <destination-dir>\n";
+ exit (0);
+}
+foreach $File (@ARGV) {
+ my $string;
+
+ open (GCCOut, "LANGUAGE=C LC_ALL=C $cc -print-file-name=$File|") || die "Failed to exec $cc -print-file-name=$File $!";
+ $string=<GCCOut>;
+ chomp ($string);
+ push (@CopySrc, $string);
+ close (GCCOut);
+}
+
+foreach $Src (@CopySrc) {
+ printf "copy $Src to $Dest\n";
+ system ("/bin/cp $Src $Dest") && die "copy failed: $!";
+}
+
+
+foreach $File (@ARGV) {
+ #https://bugzilla.redhat.com/show_bug.cgi?id=149465
+ printf "unprelinking $Dest/$File\n";
+ #If it's already unprelinked .i.e. no .gnu.prelink_undo section, that's fine
+ #If prelink is not installed, it's massively unlikely that it's prelinked
+ system ("prelink -u $Dest/$File > /dev/null 2>&1");
+}
+
+exit (0);
diff --git a/solenv/bin/gen_update_info.pl b/solenv/bin/gen_update_info.pl
new file mode 100644
index 000000000000..ae2aa6f251e0
--- /dev/null
+++ b/solenv/bin/gen_update_info.pl
@@ -0,0 +1,176 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+#*********************************************************************
+#
+# main
+#
+
+my($product, $buildid, $id, $os, $arch, $lstfile, $languages, $productname, $productversion, $productedition);
+
+while ($_ = $ARGV[0], /^-/) {
+ shift;
+ last if /^--$/;
+ if (/^--product/) {
+ $product= $ARGV[0];
+ shift;
+ }
+ if (/^--buildid/) {
+ $buildid = $ARGV[0];
+ shift;
+ }
+ if (/^--os/) {
+ $os = $ARGV[0];
+ shift;
+ }
+ if (/^--arch/) {
+ $arch = $ARGV[0];
+ shift;
+ }
+ if (/^--lstfile/) {
+ $lstfile = $ARGV[0];
+ shift;
+ }
+ if (/^--languages/) {
+ $languages = $ARGV[0];
+ shift;
+ }
+}
+
+$sourcefile = $ARGV[0];
+
+if( $^O =~ /cygwin/i ) {
+ # We might get paths with backslashes, fix that.
+ $lstfile =~ s/\\/\//g;
+ $sourcefile =~ s/\\/\//g;
+}
+
+# read openoffice.lst
+# reading Globals section
+unless(open(LSTFILE, "sed -n \"/^Globals\$/,/^}\$/ p\" $lstfile |")) {
+ print STDERR "Can't open $lstfile file: $!\n";
+ return;
+}
+
+while (<LSTFILE>) {
+ if( /\bPRODUCTNAME / ) {
+ chomp;
+ s/.*PRODUCTNAME //;
+ $productname = $_;
+ }
+ if( /\bPACKAGEVERSION / ) {
+ chomp;
+ s/.*PACKAGEVERSION //;
+ $productversion = $_;
+ }
+ if( /\bPRODUCTEDITION / ) {
+ chomp;
+ s/.*PRODUCTEDITION //;
+ $productedition = $_;
+ }
+}
+
+close(LSTFILE);
+
+### may be hierarchical ...
+if(open(LSTFILE, "sed -n \"/^$product:/,/^}\$/ p\" $lstfile |")) {
+ while (<LSTFILE>) {
+ if ( /^$product\s?:\s?(\w+)$/ ) {
+ $product = $1;
+ }
+ if( /\bPRODUCTEDITION / ) {
+ chomp;
+ s/.*PRODUCTEDITION //;
+ $productedition = $_;
+ }
+ }
+}
+close(LSTFILE);
+
+# Reading product specific settings
+
+unless(open(LSTFILE, "sed -n \"/^$product\$/,/^}\$/ p\" $lstfile |")) {
+ print STDERR "Can't open $lstfile file: $!\n";
+ return;
+}
+
+while (<LSTFILE>) {
+ if( /\bPRODUCTNAME / ) {
+ chomp;
+ s/.*PRODUCTNAME //;
+ $productname = $_;
+ }
+ if( /\bPACKAGEVERSION / ) {
+ chomp;
+ s/.*PACKAGEVERSION //;
+ $productversion = $_;
+ }
+ if( /\bPRODUCTEDITION / ) {
+ chomp;
+ s/.*PRODUCTEDITION //;
+ $productedition = $_;
+ }
+}
+
+close(LSTFILE);
+
+# simulate the behavior of make_installer.pl when writing versionrc
+unless( "$os" eq "Windows" ) {
+ $languages =~ s/_.*//;
+}
+
+$id = $productversion;
+$id =~ s/\..*//;
+$id = $productname . "_" . $id . "_" . $languages;
+
+# open input file
+unless (open(SOURCE, $sourcefile)) {
+ print STDERR "Can't open $sourcefile file: $!\n";
+ return;
+}
+
+while (<SOURCE>) {
+ s/:id></:id>$id</;
+ s/buildid></buildid>$buildid</;
+ s/os></os>$os</;
+ s/arch></arch>$arch</;
+ if ( $productedition ) {
+ s/edition></edition>$productedition</;
+ } else {
+ next if ( /edition></ );
+ }
+ s/version></version>$productversion</;
+ s/name></name>$productname</;
+ print;
+}
+
+close(SOURCE);
diff --git a/solenv/bin/gen_userfeedback_VCL_names.pl b/solenv/bin/gen_userfeedback_VCL_names.pl
new file mode 100755
index 000000000000..e65968e6b6c2
--- /dev/null
+++ b/solenv/bin/gen_userfeedback_VCL_names.pl
@@ -0,0 +1,196 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+#
+# pushids - push HID.LST and *.win files for userexperience feedback
+#
+
+use lib ("$ENV{SOLARENV}/bin/modules", "$ENV{COMMON_ENV_TOOLS}/modules");
+
+use Carp;
+
+sub parse_info($$);
+
+if ( @ARGV != 3 )
+{
+ print "usage: $ARGV[0] <path tp hid.lst> <path to *.win files> <output file>\n";
+ print "example: $ARGV[0] ./hid.lst global/win common/misc/UserFeedbackNames.csv\n\n";
+ die "invalid params";
+}
+
+my ($hid, $winpath, $outfile) = @ARGV;
+
+my @names;
+
+open HID, "<$hid" or die "can't open file $filename $! $^E";
+for (<HID>) {
+ chop;
+ my ($longname, $ID) = split " +";
+ next if ( ! $ID );
+ $upperlongname = $longname;
+ $upperlongname =~ tr/a-z/A-Z/;
+ $undeclared_hids{$upperlongname} = $longname;
+
+ if ( exists $hids{$upperlongname} && ( $hids{$upperlongname} != $ID ) )
+ {
+ print STDERR "errror: unclear definition of longname: $longname = $hids{$upperlongname} or $ID\n";
+ }
+ $hids{$upperlongname} = $ID;
+
+ if ( exists $revhids{ $ID } && ( $revhids{ $ID } ne $upperlongname ) )
+ {
+ print STDERR "warn: two longnames have the same ID: $longname and $revhids{$ID} share ID $ID\n";
+ }
+ $revhids{$ID} = $upperlongname;
+}
+
+close HID;
+
+undef @revhids;
+
+#Add Active
+$hids{"ACTIVE"} = 0;
+
+my %dialogs = ();
+
+foreach ( glob("$winpath/*win") ) {
+ $filename = $_;
+ open WIN, "< $filename" or die "can't open file $filename $! $^E";
+ my $parentinfo = "";
+ my @dialog = ();
+ my $parentshortname = "";
+
+ for ( <WIN> ) {
+ chop;
+
+ s/^ +//;
+ s/ +/ /g;
+
+ next if /^ *'/;
+ next if /^ *$/;
+
+ my $ID = "";
+ my $iteminfo;
+ my ($shortname, $longname) = split " +";
+
+ $shortname = "" if ( !$shortname );
+ $longname = "" if ( !$longname );
+
+ # fake a correct entry if only *active is given and overwrite the attempt to declare it differently
+ if ( $shortname =~ /\*active/i )
+ {
+ $longname = "Active";
+ }
+
+
+# find UNO Names
+ if ( $longname =~ /^(.uno:|http|private:factory|service:|macro:|.HelpId:)/i || $longname =~ s/^sym://i )
+ {
+ $ID = $longname;
+ $longname = "";
+ }
+ else
+ {
+ my $upperlongname = $longname;
+ $upperlongname =~ tr/a-z/A-Z/;
+ if ( $shortname !~ /^[\+\*]/ && !exists $hids{$upperlongname} )
+ {
+ print STDERR "errror: Longname not in hid.lst: $filename $longname\n";
+ }
+ if ( exists $hids{$upperlongname} )
+ {
+ $ID = $hids{$upperlongname};
+ }
+ delete $undeclared_hids{$upperlongname};
+ }
+
+ $iteminfo = "$shortname $longname $ID";
+# print "$iteminfo\n" if ( ! ( $shortname && $longname && $ID ));
+ $iteminfo =~ s/^\*//;
+ $iteminfo =~ s/^\+//;
+
+# find start of deklaration
+ if ( $shortname =~ s/^\+// )
+ {
+ # copy existing dialog
+ if ( exists $dialogs{ $longname } )
+ {
+ my @old = @{$dialogs{ $longname }};
+ my ($oldshort, $oldlong, $oldID ) = split ( " ", shift @old );
+ $iteminfo = "$shortname $oldlong $oldID";
+
+ $parentinfo = $iteminfo;
+ $parentshortname = $shortname;
+ $dialogs{ $parentshortname } = \@dialog;
+ @dialog = (); # break the link
+ push ( @{$dialogs{ $parentshortname }}, $iteminfo );
+ push @names, " $parentinfo";
+
+ for ( @old )
+ {
+ push @names, "$parentinfo $_";
+ }
+ }
+ else
+ { # fake new dialog instead
+ $shortname = "*".$shortname;
+ }
+ }
+ if ( $shortname =~ s/^\*// )
+ {
+ $parentinfo = $iteminfo;
+ $parentshortname = $shortname;
+ $dialogs{ $parentshortname } = \@dialog;
+ @dialog = (); # break the link
+ push ( @{$dialogs{ $parentshortname }}, $iteminfo );
+ push @names, " $parentinfo";
+ }
+ else
+ {
+ push ( @{$dialogs{ $parentshortname }}, $iteminfo );
+ push @names, "$parentinfo $iteminfo";
+ }
+
+ }
+ close WIN;
+}
+
+for ( keys %undeclared_hids ) {
+ $iteminfo = "$undeclared_hids{$_} $undeclared_hids{$_} $hids{$_}";
+ push @names, " $iteminfo";
+}
+
+#----------------------------------------------------------------------------
+# write to files
+
+open HIDS, ">$outfile" or die "can't open file $filename $! $^E";
+print HIDS join "\n", @names;
+print HIDS "\n";
+close HIDS;
+
diff --git a/solenv/bin/genmap b/solenv/bin/genmap
new file mode 100755
index 000000000000..78d67bf6f06f
--- /dev/null
+++ b/solenv/bin/genmap
@@ -0,0 +1 @@
+less $2
diff --git a/solenv/bin/getcompver.awk b/solenv/bin/getcompver.awk
new file mode 100644
index 000000000000..068960481130
--- /dev/null
+++ b/solenv/bin/getcompver.awk
@@ -0,0 +1,79 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+BEGIN {
+ CCversion = 0
+ compiler_matched = 0
+}
+# Sun c++ compiler
+/Sun WorkShop/ || /Forte Developer/ || /Sun/{
+ compiler_matched = 1
+ # version number right after "C++"
+ x = match( $0, /C\+\+ .*/ )
+ btwn = substr( $0, RSTART, RLENGTH)
+ # extract version, whitespaces get striped later
+ x = match( btwn, / .*\..*[ $\t]/)
+ CCversion = substr( btwn, RSTART, RLENGTH)
+}
+# Microsoft c++ compiler
+/Microsoft/ && /..\...\...../ {
+ compiler_matched = 1
+ # match on the format of the ms versions ( dd.dd.dddd )
+ x = match( $0, /..\...\...../ )
+ CCversion = substr( $0, RSTART, RLENGTH)
+}
+# Java
+/java version/ || /openjdk version/ {
+ compiler_matched = 1
+ # match on the format of the java versions ( d[d].d[d].d[d] )
+ x = match( $0, /[0-9]*\.[0-9]*\.[0-9]*/ )
+ CCversion = substr( $0, RSTART, RLENGTH)
+}
+/^[0-9]*[.][0-9]*\x0d*$/ {
+ if ( compiler_matched == 0 ) {
+# need to blow to x.xx.xx for comparing
+ CCversion = $0 ".0"
+ }
+}
+/^[0-9]*[.][0-9]*[.][0-9]*\x0d*$/ {
+ if ( compiler_matched == 0 ) {
+ CCversion = $0
+ }
+}
+/^[0-9]*[.][0-9]*[.][0-9]*-[0-9a-z]*$/ {
+ if ( compiler_matched == 0 ) {
+ CCversion = substr($0, 0, index($0, "-") - 1)
+ }
+}
+END {
+ if ( num == "true" ) {
+ tokencount = split (CCversion,vertoken,".")
+ for ( i = 1 ; i <= tokencount ; i++ ) {
+ printf ("%04d",vertoken[i] )
+ }
+ } else
+ print CCversion
+}
diff --git a/solenv/bin/getcsym.awk b/solenv/bin/getcsym.awk
new file mode 100644
index 000000000000..9490a06b3535
--- /dev/null
+++ b/solenv/bin/getcsym.awk
@@ -0,0 +1,34 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+BEGIN { global_found = "false" }
+/[ \t]*#/ { sub( substr( $0, index($0, "#")),"" ) }
+/[ \t]*local:/ { global_found = "false" }
+/[ \t]*}/ { global_found = "false" }
+/^[ \t]*$/ { next }
+global_found == "true" { print $0 }
+/[ \t]*global:/ { global_found = "true" }
diff --git a/solenv/bin/gsicheck b/solenv/bin/gsicheck
new file mode 100755
index 000000000000..fb2f65cbe01d
--- /dev/null
+++ b/solenv/bin/gsicheck
@@ -0,0 +1,18 @@
+#!/bin/sh
+if [ x${SOLARENV}x = xx ]; then
+ echo No environment found, please use 'setsolar'
+exit 1
+fi
+
+if [ "${OS?}" = MACOSX ]; then
+ export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH:+${DYLD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT}
+else
+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT}
+fi
+
+if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
+ exec $SOLARVERSION/$INPATH/bin/gsicheck "$@"
+else
+ exec $SOLARVERSION/$INPATH/bin$UPDMINOREXT/gsicheck "$@"
+fi
+
diff --git a/solenv/bin/guw.pl b/solenv/bin/guw.pl
new file mode 100755
index 000000000000..c5326204eb49
--- /dev/null
+++ b/solenv/bin/guw.pl
@@ -0,0 +1,347 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+# Description: ??
+
+#---------------------------------------------------------------------------
+# external modules
+use Text::ParseWords;
+
+# global vars
+@params = ();
+
+# set debug mode here:
+#$debug="true";
+#$debug_light="true";
+
+#---------------------------------------------------------------------------
+# Define known parameter exceptions
+%knownpara = ( 'echo', [ '/TEST', 'QQQ', 'CCC', 'uno:' ],
+ 'cl', [ '-clr:', '-Z' ],
+ 'csc', [ '-target:' ],
+ 'lib', [ 'OUT:', 'EXTRACT:','out:', 'def:', 'machine:' ],
+ 'link', [ 'BASE:', 'DEBUG', 'DLL', 'LIBPATH', 'MACHINE:',
+ 'MAP', 'NODEFAULTLIB', 'OPT', 'PDB', 'RELEASE',
+ 'SUBSYSTEM', 'STACK', 'out:', 'map:', 'ENTRY:',
+ 'implib:', 'delayload:', 'def', 'COMMENT:' ],
+ 'regcomp', [ '-env:', 'vnd.sun.star.expand:' , 'vnd.openoffice.pymodule' ],
+ 'regmerge', [ '/UCR' ],
+ 'rc', [ '-D' ],
+ 'rsc', [ '-DOOO_' ] );
+
+#---------------------------------------------------------------------------
+# procedures
+
+
+#----------------------------------------------------------
+# Function name: myCygpath
+# Description: Transform POSIX path to DOS path
+# Arguments: 1. Variable (string) with one token
+# 2. optional - if set remove spaces and shorten to 8.3
+# representation.
+# Return value: Reformatted String
+#----------------------------------------------------------
+sub myCygpath {
+ my $posixpath = shift;
+ my $shortenpath = shift || '';
+
+ my $dospath;
+
+ if ( $posixpath =~ / / and $shortenpath ) {
+ chomp( $dospath = qx{cygpath -d "$posixpath"} );
+ # "cygpath -d" returns "" if the file doesn't exist.
+ if ($dospath eq "") {
+ $dospath = ".";
+ print(STDERR "Error: guw.pl: Path: $posixpath:\nhas a problem! Probably nonexistent filename with space.\n");
+ if ( (defined $debug_light) or (defined $debug) ) {
+ die "exiting ...\n";
+ }
+ }
+ } else {
+ if ( $posixpath =~ /^\// ) {
+ chomp( $dospath = qx{cygpath -w "$posixpath"} );
+ } else {
+ $dospath = $posixpath;
+ $dospath =~ s/\//\\/g;
+ }
+ }
+ return $dospath;
+}
+
+#----------------------------------------------------------
+# Function name: WinFormat
+# Description: Format variables to Windows Format.
+# Arguments: 1. Variable (string) with one token
+# Return value: Reformatted String
+#----------------------------------------------------------
+sub WinFormat {
+ my $variable = shift @_;
+ my( $d1, $d1_prefix, $d2 );
+
+ $variable =~ s/(\$\w+)/$1/eeg ; # expand the variables
+ $variable =~ s/(\$\w+)/$1/eeg ; # expand the variables twice!
+
+ # Include paths or parameters with filenames
+ if ( $variable =~ /\A(-D[\w\.]*=)[\'\"]?((?:\/?[\w\.\-\+ ~]+)+\/?)[\'\"]?\Z/ ) {
+ # This regex evaluates -D<something>=<path>, sometimes with quotes or "/" at the end
+ # option -> $1, filename without quotes -> $2
+ if ( defined $debug ) { print(STDERR "WinFormat:\ninclude (-D<something>=<path>) path:\n$variable\n"); }
+ $d1_prefix = $1;
+ $d1 = $2;
+ $d2 = myCygpath($2,1);
+ if ( $d2 ne "" ) {
+ $d2 =~ s/\\/\\\\/g ;
+ }
+ } elsif ( $variable =~ /\A(-?\w[\w\.]*=)[\'\"]?((?:\/?[\w\.\-\+ ~]+)+\/?)[\'\"]?\Z/ ) {
+ # This regex evaluates [-]X<something>=<path>, sometimes with quotes or "/" at the end
+ # option -> $1, filename without quotes -> $2
+ if ( defined $debug ) { print(STDERR "WinFormat:\ninclude ([-]<something>=<path>) path:\n$variable\n"); }
+ $d1_prefix = $1;
+ $d1 = $2;
+ $d2 = myCygpath($2,1);
+ } elsif ( $variable =~ /\A(--\w[\w\.\-]*=)[\'\"]?((?:\/?[\w\.\-\+ ~]+)+\/?)[\'\"]?\Z/ ) {
+ # This regex evaluates --<something>=<path>, sometimes with quotes or "/" at the end
+ # option -> $1, filename without quotes -> $2
+ if ( defined $debug ) { print(STDERR "WinFormat:\ninclude (--<something>=<path>) path:\n$variable\n"); }
+ $d1_prefix = $1;
+ $d1 = $2;
+ $d2 = myCygpath($2,1);
+ } elsif ( $variable =~ /\A(-\w[\w\.]*:)[\'\"]?((?:\/?[\w\.\-\+ ~]+)+\/?)[\'\"]?\Z/ ) {
+ # This regex evaluates -X<something>:<path>, sometimes with quotes or "/" at the end
+ # option -> $1, filename without quotes -> $2
+ if ( defined $debug ) { print(STDERR "WinFormat:\nFound (-<something>:<path>):\n$variable\n"); }
+ $d1_prefix = $1;
+ $d1 = $2;
+ $d2 = myCygpath($2,1);
+ } elsif ( $variable =~ /\A(-\w+:)(.*)\Z/ ) {
+ # This regex evaluates -X<something>:<NO-path>, and prevents translating of these.
+ # option -> $1, rest -> $2
+ if ( defined $debug ) { print(STDERR "WinFormat:\nFound (-<something>:<no-path>):\n$variable\n"); }
+ $d1_prefix = $1;
+ $d1 = $2;
+ $d2 = myCygpath($2,1);
+ } elsif ( $variable =~ /\A(\w+:)[\'\"]?\/\/\/((?:\/?[\w\.\-\+ ~]+)+\/?)[\'\"]?\Z/ ) {
+ # See iz35982 for the reason for the special treatment of this switch.
+ # This regex evaluates <something>:///<path>, sometimes with quotes or "/" at the end
+ # option -> $1, filename without quotes -> $2
+ if ( defined $debug ) { print(STDERR "WinFormat:\nFound (<something>:///<path>):\n$variable\n"); }
+ $d1_prefix = $1."///";
+ $d1 = $2;
+ $d2 = myCygpath($2,1);
+ $d2 =~ s/\\/\//g ;
+ } elsif ( $variable =~ /\A(-\w)[\'\"]?((?:\/[\w\.\-\+ ~]+)+\/?)[\'\"]?\Z/ ) {
+ # This regex evaluates -X<path>, sometimes with quotes or "/" at the end
+ # option -> $1, filename without quotes -> $2
+ if ( defined $debug ) { print(STDERR "WinFormat:\ninclude (-X<absolute path>) path:\n$variable\n"); }
+ $d1_prefix = $1;
+ $d1 = $2;
+ $d2 = myCygpath($2,1);
+ } elsif ( $variable =~ /\A(-F[ARdemopr])[\'\"]?((?:\/[\w\.\-\+ ~]+)+\/?)[\'\"]?\Z/ ) {
+ # This regex evaluates -FX<path> (MSVC switches for output naming), sometimes with quotes or "/" at the end
+ # option -> $1, filename without quotes -> $2
+ if ( defined $debug ) { print(STDERR "WinFormat:\ncompiler naming (-FX<absolute path>) path:\n$variable\n"); }
+ $d1_prefix = $1;
+ $d1 = $2;
+ $d2 = myCygpath($2,1);
+ } else {
+ $d2 = "";
+ }
+ if ( $d2 ne "" ) {
+ # Found a parameter
+ $d1 =~ s/\+/\\\+/ ;
+ $d1 =~ s/\./\\\./ ;
+ $variable =~ s/$d1/$d2/ ;
+ } else {
+ # Found no parameter, assume a path
+ $variable =~ s/:/;/g;
+ $variable =~ s/([;]|\A)(\w);/$1$2:/g; # get back the drives
+
+ # Search for posix path ;entry; (The regex accepts valid paths with at least one /)
+ # and replace with DOS path, accept quotes.
+ # iz28717 Accept ',' as path seperator.
+ while ( $variable =~ /(?:[;,]|\A)[\'\"]?([\w\.\-\+ ~]*(?:\/[\w\.\-\+ ~]+)+\/?)[\'\"]?(?:[;,]|\Z)/ ) {
+ # Normal paths
+ $d1 = $1;
+ $d2 = myCygpath($d1);
+ if ( defined $debug ) {
+ print(STDERR "WinFormat:\nFull path:\n$variable\nTranslated part:$d2\n");
+ }
+ $d1 =~ s/\+/\\\+/ ;
+ $variable =~ s/$d1/$d2/ ;
+ }
+ }
+
+ # Sanity check for -X<path>
+ if ( $variable =~ /-\w[\'\"]?(?:(?:\/[\w\.\-\+ ~]+)+)/ ) {
+ print(STDERR "Error: guw.pl: WinFormat: Not converted -X/... type switch in :$variable:.\n");
+ if ( (defined $debug_light) or (defined $debug) ) { die "\nNot processed -X/...\n"; }
+ }
+ # Sanity check for [-]X<something>(:|=)<path> case
+ if ( $variable =~ /\A-?\w[\w\.]*[=:][\'\"]?(?:\/[\w\.\-\+ ~]+)+/ ) {
+ print(STDERR "Error: guw.pl: WinFormat: Not converted [-]X<something>(=|:)/<path> type switch in :$variable:.\n");
+ if ( (defined $debug_light) or (defined $debug) ) { die "\nNot processed [-]X<something>(=|:)/...\n"; }
+ }
+
+ if ( defined $debug ) { print(STDERR "WinFormat:\nresult:$variable\n");};
+ return $variable;
+}
+
+#----------------------------------------------------------
+# Function name: replace_cyg
+# Description: Process all arguments and change them to Windows Format.
+# Arguments: Reference to array with arguments
+# Return value: -
+#----------------------------------------------------------
+sub replace_cyg {
+ my $args = shift;
+ my( @cmd_file, @cmd_temp );
+ my $atchars;
+ foreach my $para ( @$args )
+ {
+ if ( $para =~ "^@" ) {
+ # it's a command file
+ if ( defined $debug ) { print(STDERR "----------------------------\n");};
+ # Workaround, iz28717, keep number of @'s.
+ $para =~ s/(^\@+)//;
+ $atchars = $1;
+ $filename = $para;
+ if ( defined $debug ) { print(STDERR "filename = $filename \n");};
+ # open this command file for reading
+ open(CMD, "$filename");
+ while ( <CMD> ) {
+ # Remove DOS lineendings. Bug in Cygwin / Perl?
+ $_ =~ s/\r//g;
+ # Remove lineendings and trailing spaces. ( Needed by &parse_line )
+ $_ =~ s/\n$//g;
+ $_ =~ s/\s+$//g;
+ # Fill all tokens into array
+ @cmd_temp = &parse_line('\s+', 1, $_ );
+ if ( $#cmd_temp > -1 ) {
+ push( @cmd_file, @cmd_temp);
+ }
+ }
+ close(CMD);
+ # reformat all tokens
+ replace_cyg(\@cmd_file);
+ if ( defined $debug ) { print(STDERR "Tokens processed:\n");};
+ foreach $i (@cmd_file) {
+ if ( defined $debug ) { print(STDERR "!".$i."!\n");};
+ }
+ # open this filename for writing (truncate) Textmode?
+ open(CMD, '>', $filename);
+ # write all tokens back into this file
+ print(CMD join(' ', @cmd_file));
+ close(CMD);
+ # convert '@filename' to dos style
+ $para = WinFormat( $para );
+ if ( defined $debug ) { print(STDERR "----------------------------\n");};
+ if ( (defined $debug_light) or (defined $debug) ) { print(STDERR "\nParameter in File:".join(' ', @cmd_file).":\n");}
+ $para = $atchars.$para;
+ } else {
+ # it's just a parameter
+ if ( defined $debug ) { print(STDERR "\nParameter:---${para}---\n");};
+ # If $tmp1 is empty then $para is a parameter.
+ my $is_no_para = 1;
+ # remove .exe and convert to lower case
+ $shortcommand = lc $command ;
+ $shortcommand =~ s/\.exe$//;
+ $shortcommand =~ /([^\/]+$)/;
+ $shortcommand = $1;
+ foreach $i (@{$knownpara{$shortcommand}}) {
+ if( $para =~ /$i/ ) {
+ $is_no_para = 0;
+ if ( defined $debug ) { print(STDERR "Is parameter exception for ${shortcommand}: ${para}:\n" );};
+ last;
+ }
+ }
+ if( $is_no_para ) {
+ $para = WinFormat($para);
+ }
+ if ( defined $debug ) { print(STDERR "Converted line:${para}:\n" );};
+ } # else
+ } # foreach loop
+}
+
+#----------------------------------------------------------
+# Function name: replace_cyg_env
+# Description: Process selected environment variables and change
+# them to Windows Format.
+# Arguments: -
+# Return value: -
+#----------------------------------------------------------
+sub replace_cyg_env {
+ @affected_vars = (
+ 'SOLAR_VERSION',
+ 'SOLARVERSION',
+ 'SOLARVER',
+ 'SRC_ROOT',
+ 'LOCALINI',
+ 'GLOBALINI',
+ 'SOLARENV',
+ 'STAR_INSTPATH',
+ 'STAR_SOLARPATH',
+ 'STAR_PACKMISC',
+ 'STAR_SOLARENVPATH',
+ 'STAR_INITROOT',
+ 'STAR_STANDLST',
+ 'CLASSPATH',
+ 'JAVA_HOME'
+ );
+ foreach my $one_var ( @affected_vars )
+ {
+ my $this_var = $ENV{ $one_var };
+ if ( defined $this_var )
+ {
+ if ( defined $debug ) { print(STDERR "ENV $one_var before: ".$ENV{ $one_var}."\n" );};
+ $ENV{ $one_var } = WinFormat( $this_var );
+ if ( defined $debug ) { print(STDERR "ENV $one_var after : ".$ENV{ $one_var}."\n" );};
+ }
+ }
+
+}
+#---------------------------------------------------------------------------
+# main
+@params = @ARGV;
+
+$command = shift(@params);
+while ( $command =~ /^-/ )
+{
+ if ( $command eq "-env" )
+ {
+ replace_cyg_env;
+ }
+
+ $command = shift(@params);
+}
+if ( (defined $debug_light) or (defined $debug) ) { print( STDERR "Command: $command\n" ); }
+
+replace_cyg(\@params);
+if ( (defined $debug_light) or (defined $debug) ) { print(STDERR "\n---------------------\nExecute: $command @params\n----------------\n");};
+exec( "$command", @params) or die( "\nError: guw.pl: executing $command failed!\n" );
+
diff --git a/solenv/bin/hicontrast-to-theme.pl b/solenv/bin/hicontrast-to-theme.pl
new file mode 100644
index 000000000000..027d7405dab2
--- /dev/null
+++ b/solenv/bin/hicontrast-to-theme.pl
@@ -0,0 +1,125 @@
+:
+ eval 'exec perl -S $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+#
+# Create ordinary theme from HiContrast images.
+#
+
+use File::Copy;
+use File::Find;
+use File::Path;
+use File::Spec;
+
+( $src, $dst ) = @ARGV;
+
+if ( $src eq "" || $dst eq "" ) {
+ print STDERR "Usage: hicontrast-to-theme.pl src dest\n\n";
+ print STDERR "Create ordinary theme from HiContrast images.\n";
+ exit 1;
+}
+
+$dst = File::Spec->rel2abs( $dst );
+
+@hc_table = (
+ [ ".*_h.png", "_h.png", ".png" ],
+ [ ".*_sch.png", "_sch.png", ".png" ],
+ [ ".*_hc.png", "_hc.png", ".png" ],
+ [ "lch_.*.png", "lch_", "lc_" ],
+ [ "sch_.*.png", "sch_", "sc_" ],
+ [ "lch[0-9].*.png", "lch", "lc" ],
+ [ "sch[0-9].*.png", "sch", "sc" ],
+ [ "loh[0-9].*.png", "loh", "lo" ],
+ [ "lxh[0-9].*.png", "lxh", "lx" ],
+ [ "sxh[0-9].*.png", "sxh", "sx" ],
+ [ "avh[0-9].*.png", "avh", "av" ],
+ [ "avlh[0-9].*.png", "avlh", "avl" ],
+ [ "idh[0-9].*.png", "idh", "id" ],
+ [ "imh[0-9].*.png", "imh", "im" ],
+ [ "mih[0-9].*.png", "mih", "mi" ],
+ [ "tbh[0-9].*.png", "tbh", "tb" ],
+ [ "nah[0-9].*.png", "nah", "na" ],
+ [ "nch[0-9].*.png", "nch", "nc" ],
+ [ "nvh[0-9].*.png", "nvh", "nv" ],
+ [ "ouh[0-9].*.png", "ouh", "ou" ],
+ [ "ddh[0-9].*.png", "ddh", "dd" ],
+ [ "sfh[0-9].*.png", "sfh", "sf" ],
+ [ "srh[0-9].*.png", "srh", "sr" ],
+ [ "wrh[0-9].*.png", "wrh", "wr" ],
+ [ "alh[0-9].*.png", "alh", "al" ],
+ [ "ath[0-9].*.png", "ath", "at" ],
+ [ "bih[0-9].*.png", "bih", "bi" ],
+ [ "coh[0-9].*.png", "coh", "co" ],
+ [ "foh[0-9].*.png", "foh", "fo" ],
+ [ "fuh[0-9].*.png", "fuh", "fu" ],
+ [ "oph[0-9].*.png", "oph", "op" ],
+ [ "unh[0-9].*.png", "unh", "un" ],
+ [ "edh[0-9].*.png", "edh", "ed" ],
+ [ "cdh[0-9].*.png", "cdh", "cd" ],
+ [ "frh[0-9].*.png", "frh", "fr" ],
+ [ "fwh[0-9].*.png", "fwh", "fw" ],
+ [ "nuh[0-9].*.png", "nuh", "nu" ],
+ [ "prh[0-9].*.png", "prh", "pr" ],
+ [ "shh[0-9].*.png", "shh", "sh" ],
+ [ "trh[0-9].*.png", "trh", "tr" ],
+ [ "reh[0-9].*.png", "reh", "re" ],
+ [ "joh[0-9].*.png", "joh", "jo" ],
+ [ "fph[0-9].*.png", "fph", "fp" ],
+ [ "dah[0-9].*.png", "dah", "da" ]
+);
+
+my (@from_stat, @to_stat);
+
+sub copy_normalized {
+ $file = $_;
+ for $hc ( @hc_table ) {
+ ( $what, $from, $to ) = @$hc;
+ if ( $file =~ /$what/&&!($file=~/\.svn/) ) {
+ my $dir = File::Spec->catdir( $dst, $File::Find::dir );
+
+ if ( ! -d $dir ) {
+ mkpath( $dir );
+ }
+
+ ( my $copy = $file ) =~ s/$from/$to/;
+ $copy = File::Spec->catfile( $dir, $copy );
+
+ @from_stat = stat($file);
+ @to_stat = stat($copy);
+ if ( $from_stat[9] > $to_stat[9] ) {
+ copy( $file, $copy ) || die $!;
+ utime( $from_stat[9], $from_stat[9], $copy );
+ }
+
+ last;
+ }
+ }
+}
+
+chdir( $src );
+find( \&copy_normalized, '.' );
diff --git a/solenv/bin/image-sort.pl b/solenv/bin/image-sort.pl
new file mode 100755
index 000000000000..16c792608c66
--- /dev/null
+++ b/solenv/bin/image-sort.pl
@@ -0,0 +1,149 @@
+#!/usr/bin/perl -w
+
+my @global_list = ();
+my %global_hash = ();
+my $base_path;
+
+sub read_icons($)
+{
+ my $fname = shift;
+ my $fileh;
+ my @images;
+ open ($fileh, "$base_path/$fname") || die "Can't open $base_path/$fname: $!";
+ while (<$fileh>) {
+ m/xlink:href=\"\.uno:(\S+)\"\s+/ || next;
+ push @images, lc($1);
+ }
+ close ($fileh);
+
+ return @images;
+}
+
+# filter out already seen icons & do prefixing
+sub read_new_icons($$)
+{
+ my $fname = shift;
+ my $prefix = shift;
+ my @images = read_icons ($fname);
+ my @new_icons;
+ my %new_icons;
+ for my $icon (@images) {
+ my $iname = "res/commandimagelist/" . $prefix . $icon . ".png";
+ if (!defined $global_hash{$iname} &&
+ !defined $new_icons{$iname}) {
+ push @new_icons, $iname;
+ $new_icons{$iname} = 1;
+ }
+ }
+ return @new_icons;
+}
+
+sub process_group($@)
+{
+ my $prefix = shift;
+ my @uiconfigs = @_;
+ my %group;
+ my $cur_max = 1.0;
+
+# a very noddy sorting algorithm
+ for my $uiconfig (@uiconfigs) {
+ my @images = read_new_icons ($uiconfig, $prefix);
+ my $prev = '';
+ for my $icon (@images) {
+ if (!defined $group{$icon}) {
+ if (!defined $group{$prev}) {
+ $group{$icon} = $cur_max;
+ $cur_max += 1.0;
+ } else {
+ $group{$icon} = $group{$prev} + (1.0 - 0.5 / $cur_max);
+ }
+ } # else a duplicate
+ }
+ }
+ for my $icon (sort { $group{$a} <=> $group{$b} } keys %group) {
+ push @global_list, $icon;
+ $global_hash{$icon} = 1;
+ }
+}
+
+sub process_file($$)
+{
+ my @images = read_new_icons (shift, shift);
+
+ for my $icon (@images) {
+ push @global_list, $icon;
+ $global_hash{$icon} = 1;
+ }
+}
+
+sub chew_controlfile($)
+{
+ my $fname = shift;
+ my $fileh;
+ my @list;
+ open ($fileh, $fname) || die "Can't open $fname: $!";
+ while (<$fileh>) {
+ /^\#/ && next;
+ s/[\r\n]*$//;
+ /^\s*$/ && next;
+
+ my $line = $_;
+ if ($line =~ s/^-- (\S+)\s*//) {
+ # control code
+ my $code = $1;
+ my $small = (lc ($line) eq 'small');
+ if (lc($code) eq 'group') {
+ if (!$small) { process_group ("lc_", @list); }
+ process_group ("sc_", @list);
+ } elsif (lc ($code) eq 'ordered') {
+ if (!$small) {
+ for my $file (@list) { process_file ($file, "lc_"); }
+ }
+ for my $file (@list) { process_file ($file, "sc_"); }
+ } elsif (lc ($code) eq 'literal') {
+ for my $file (@list) {
+ if (!defined $global_hash{$file}) {
+ push @global_list, $file;
+ $global_hash{$file} = 1;
+ }
+ }
+ } else {
+ die ("Unknown code '$code'");
+ }
+ @list = ();
+ } else {
+ push @list, $line;
+ }
+ }
+ close ($fileh);
+}
+
+if (!@ARGV) {
+ print "image-sort <image-sort.lst> /path/to/OOOo/source/root\n";
+ exit 1;
+}
+
+# where the control file lives
+my $control = shift @ARGV;
+# where the uiconfigs live
+$base_path = shift @ARGV;
+# output
+if (@ARGV) {
+ my $outf = shift @ARGV;
+ open ($output, ">$outf") || die "Can't open $outf: $!";
+ $stdout_out = 0;
+} else {
+ $output = STDOUT;
+ $stdout_out = 1;
+}
+
+chew_controlfile ($control);
+
+for my $icon (@global_list) {
+ print $output $icon . "\n" if (!($icon =~ /^sc_/));
+}
+for my $icon (@global_list) {
+ print $output $icon . "\n" if ($icon =~ /^sc_/);
+}
+
+close $output if (!$stdout_out);
diff --git a/solenv/bin/install-sh b/solenv/bin/install-sh
new file mode 100755
index 000000000000..fb942ef71665
--- /dev/null
+++ b/solenv/bin/install-sh
@@ -0,0 +1,3 @@
+;; This file is automatically created by diff_all_filter.pl
+;; Fri Mar 27 08:02:00 2009
+
diff --git a/solenv/bin/installoffice.oxt b/solenv/bin/installoffice.oxt
new file mode 100644
index 000000000000..feb1d8723078
--- /dev/null
+++ b/solenv/bin/installoffice.oxt
Binary files differ
diff --git a/solenv/bin/installoffice_impress.oxt b/solenv/bin/installoffice_impress.oxt
new file mode 100755
index 000000000000..31c7bfa45c06
--- /dev/null
+++ b/solenv/bin/installoffice_impress.oxt
Binary files differ
diff --git a/solenv/bin/langwrap b/solenv/bin/langwrap
new file mode 100755
index 000000000000..97a50f1762ee
--- /dev/null
+++ b/solenv/bin/langwrap
@@ -0,0 +1,131 @@
+#!/usr/bin/perl -w
+#
+# langwrap - language wrapper for building resources
+#
+# $Id: langwrap,v 1.2 2008-08-18 13:10:41 vg Exp $
+
+use Getopt::Std;
+
+###### globals ######
+
+$is_debug = 0;
+$nfield = 0;
+@LoL = ();
+@command = ();
+
+###### main ######
+
+# Version
+$idStr = ' $Revision: 1.2 $ ';
+$idStr =~ /Revision:\s+(\S+)\s+\$/
+ ? ($langwrapRev = $1) : ($langwrapRev = "-");
+
+print "langwrap -- Version: $langwrapRev\n";
+
+# Options
+&check_options();
+
+# parse command file
+&parse_commandfile($opt_c);
+
+# create list with command lines
+&create_commands();
+
+# finally execute commands
+foreach $cmd (@command) {
+ if ($is_debug) {
+ print $cmd . "\n";
+ } else {
+ system($cmd);
+ $res = $? >> 8;
+ if ($res) {
+ print "langwrap: command execution failed with exitcode $res.\n";
+ exit($res);
+ }
+ }
+}
+
+exit(0);
+
+###### routines ######
+
+### parse_commandfile()
+sub parse_commandfile {
+ my($file) = shift;
+ my(@field);
+
+ open(COMMAND, "<$file") or die "can´t open $file";
+
+ while (<COMMAND>) {
+ $line = $_;
+ chomp($line);
+ if ( ($line =~ //) || ($line =~ /^\r/) || ($line =~ /^#/) ) {
+ next;
+ }
+
+ @field = split " ", $line;
+ push @LoL, [@field];
+ if (!$nfield) {
+ $nfield = $#field + 1;
+ } else {
+ if ( $nfield != ($#field + 1) ) {
+ print "langwrap: error in <cmdfile>: every row must ";
+ print "have the same # of columns.\n";
+ exit(3);
+ }
+ }
+ }
+
+ close(COMMAND);
+}
+
+### create_command()
+sub create_commands() {
+ my($cmd, $cmdline, $arg_string, $ntempl);
+
+ $cmd = shift @ARGV;
+ $arg_string = join(" ", @ARGV);
+ # just count the number of templates
+ $ntempl = ($arg_string =~ s/@\d+@/$&/eg);
+ if ( $ntempl >= $nfield ) {
+ print "lnagwrap: # of templates > # of fields in <cmdfile>.\n";
+ exit(4);
+ }
+
+ # create command lines
+ for $i (0..$#LoL) {
+ $cmdline = $arg_string;
+ $cmdline =~ s/@(\d+)@/$LoL[$i][$1]/eg;
+ push @command, $cmd . " " . $cmdline;
+ }
+}
+
+### check_options()
+sub check_options {
+
+ if ( !getopts('c:') ) {
+ &usage();
+ }
+
+ if ( !$opt_c ) {
+ &usage();
+ }
+
+ if ( ! -r $opt_c ) {
+ print "langwrap: $opt_c is not a readable file.\n";
+ exit(2);
+ }
+
+ if ( $#ARGV < 1 ) {
+ print "langwrap: empty <template_string>.\n";
+ &usage();
+ }
+}
+
+### usage()
+sub usage {
+ print "Usage: langwrap -c cmdfile tool <template_string>\n";
+ print "<template_string> is of form: ...\@1\@ .... \@2\@...\n";
+ print "with \@<n>\@ template #n\n";
+ exit(1);
+}
diff --git a/solenv/bin/leconvert.pl b/solenv/bin/leconvert.pl
new file mode 100755
index 000000000000..dec0d333f99d
--- /dev/null
+++ b/solenv/bin/leconvert.pl
@@ -0,0 +1,91 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+my $target_format = "";
+my @filelist;
+#my $debug=1;
+my $debug=0;
+
+parameter_parse(@ARGV);
+print "@filelist\n" if ( $debug );
+foreach my $onefile ( @filelist ) {
+ convert_file( $onefile );
+}
+
+
+sub convert_file
+{
+ my $filename = shift;
+ if ( $target_format eq "dos" ) {
+ $lineend = "\r\n";
+ } else {
+ $lineend = "\n";
+ }
+ open INFILE, "$filename"or die "ERROR: Couldn\'t open $filename for reading.\n";
+ my @lines = <INFILE>;
+ close INFILE;
+
+ foreach my $oneline ( @lines ) {
+ $oneline =~ s/\r*\n*$/$lineend/;
+ }
+
+ open OUTFILE, ">$filename" or die "ERROR: Couldn\'t open $filename for writing.\n";
+ syswrite OUTFILE, join "", @lines;
+ close OUTFILE;
+
+}
+
+sub parameter_parse
+{
+ if ( $target_format eq "" ) {
+ $target_format = shift ;
+ usage() if ( $target_format ne "unix" && $target_format ne "dos" );
+ usage() if ( $#_ == -1 );
+ }
+ foreach my $param ( @_ ) {
+ if ( $param =~ "^@" ) {
+ my $filename = $param;
+ $filename =~ s/^@//;
+ open CMDFILE, "$filename" or die "ERROR: Couldn\'t open $filename for reading.\n";
+ my @filelist = <CMDFILE>;
+ close CMDFILE;
+ parameter_parse( @filelist );
+ } else {
+ push @filelist, $param;
+ }
+ }
+}
+
+sub usage
+{
+ print "Convert text files to the desired lineend convention:\n";
+ print "$0 <unix|dos> <FILE|\@filelist> [more files/lists]\n";
+ exit 1;
+}
+
diff --git a/solenv/bin/licinserter.pl b/solenv/bin/licinserter.pl
new file mode 100644
index 000000000000..bfb4d1999fe1
--- /dev/null
+++ b/solenv/bin/licinserter.pl
@@ -0,0 +1,138 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#
+# licinserter.pl - create license entries in extension description.xml
+#
+
+use File::Basename;
+
+my $langswitch;
+
+sub usage()
+{
+ print STDERR "\nCreate extension descriptions with license-text entries\n";
+ print STDERR "matching the language activated.\n";
+ print STDERR "\nUsage:\n";
+ print STDERR "\t$0 [--langsplit] infile \"naming pattern\" destination\n\n";
+ print STDERR "\nExample:\n\n";
+ print STDERR "$0 description.xml dir/license_xxx.txt outdir/description.xml\n\n";
+ print STDERR "Creates \"someoutdir/description.xml\" with the license file entries like\n\"dir/license_en.US.txt\" ";
+ print STDERR "for all languages found in the WITH_LANG environment\nvariable\n\n\n";
+ print STDERR "Example2:\n\n";
+ print STDERR "$0 --langsplit description.xml dir/license_xxx.txt someoutdir\n\n";
+ print STDERR "Creates \"someoutdir/<language>/description.xml\" with one license file entry\n\"somedir/license_<language>.txt\" ";
+ print STDERR "for all languages found in the WITH_LANG\nenvironment variable.\n\nNOTE: when using --langsplit \"destination\" needs to be a directory\n";
+}
+
+if ( $ARGV[0] =~ /^-/ ) {
+ $langswitch = shift @ARGV;
+ if ( $langswitch ne "--langsplit" ) {
+ usage();
+ exit 1;
+ }
+ if ( ! -d $ARGV[2] ) {
+ print STDERR "\nERROR - $ARGV[2] is not directory\n";
+ usage();
+ exit 2;
+ }
+}
+
+if ( $#ARGV != 2 ) {
+ print "zzz\n";
+ usage();
+ exit 1;
+}
+
+open INFILE,$ARGV[0] or die "oops - no such file $ARGV[0]!\n";
+
+my @inlines = <INFILE>;
+close INFILE;
+
+chomp @inlines;
+
+# Empty or unset WITH_LANG environment variable is set to default en-US.
+# When WITH_LANG is set but does not contain en-US then that is prepended.
+my $WithLang = $ENV{WITH_LANG};
+if ( ! defined $WithLang || $WithLang eq "")
+{
+ $WithLang = "en-US";
+}
+elsif ($WithLang !~ /\ben-US\b/)
+{
+ $WithLang = "en-US " . $WithLang;
+}
+
+
+if ( $langswitch eq "" ) {
+ my @outlines;
+ foreach my $i (@inlines) {
+ if ( $i =~ /license-text/ ) {
+ my $ii;
+ my $name;
+ foreach my $code ( split(/\s+/,$WithLang) ) {
+ $ii = $i;
+ $name = $ARGV[1];
+ $name =~ s/xxx/$code/;
+ $ii =~ s/isocode/$code/g;
+ $ii =~ s?licensefile?$name?g;
+ push @outlines, "$ii\n";
+ }
+ } else {
+ push @outlines, "$i\n";
+ }
+ }
+ open OUTFILE, ">$ARGV[2]" or die "ooops - can't open $ARGV[2] for writing\n";
+ print OUTFILE @outlines;
+ close OUTFILE or die "ooops - can't write to $ARGV[2]\n";
+} else {
+ my @outlines;
+ my $outname = basename($ARGV[0],());
+ foreach my $code ( split(/\s+/,$ENV{WITH_LANG}) ) {
+ @outlines=();
+ foreach my $i (@inlines) {
+ if ( $i =~ /license-text/ ) {
+ my $name;
+ my $ii = $i;
+ $name = $ARGV[1];
+ $name =~ s/xxx/$code/;
+ $ii =~ s/isocode/$code/g;
+ $ii =~ s?licensefile?$name?g;
+ push @outlines, "$ii\n";
+ } else {
+ push @outlines, "$i\n";
+ }
+ }
+ mkdir "$ARGV[2]/$code";
+ open OUTFILE, ">$ARGV[2]/$code/$outname" or die "ooops - can't open $ARGV[2]/$code/$outname for writing\n";
+ print OUTFILE @outlines;
+ close OUTFILE or die "ooops - can't write to $ARGV[2]/$code/$outname\n";
+ }
+}
diff --git a/solenv/bin/linkoo b/solenv/bin/linkoo
new file mode 100755
index 000000000000..fe75d0d562d4
--- /dev/null
+++ b/solenv/bin/linkoo
@@ -0,0 +1,360 @@
+:
+ eval 'exec perl -S $0 ${1+"$@"}'
+ if 0;
+
+#*************************************************************************
+#
+# This app makes it easy to link a live build
+# set into an install set. Then your devel iteration
+# is: 'build', execute.
+#
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# ends up in program/ooenv
+( $moz_lib = `pkg-config --variable=libdir mozilla-nss` ) =~ tr/\n/:/;
+$env_script = '
+java_path=`./javaldx`
+export LD_LIBRARY_PATH=".:$java_path:' . $moz_lib . '$LD_LIBRARY_PATH"
+ulimit -c unlimited
+export PATH=".:$PATH"
+export GNOME_DISABLE_CRASH_DIALOG=1
+export STAR_RESOURCEPATH=`pwd`/resource
+# debugging assistance
+export OOO_FORCE_SYSALLOC=1
+export MALLOC_CHECK_=2
+export OOO_DISABLE_RECOVERY=1
+';
+
+$program_dir = 'program';
+$program_dir = 'MacOS' if ($ENV{OS} eq 'MACOSX');
+
+my @exceptions = ( 'cppuhelper', 'sunjavaplugin', 'libjvmfwk' );
+
+%replaceable = (
+ $program_dir => '\.so',
+ $program_dir . '/resource' => '\.res$',
+ $program_dir . '/classes' => '\.jar$',
+ 'share/config' => '\.zip$',
+# 'share/uno_packages' => '\.zip$'
+);
+
+# strangely enough, OSX has those small differences...
+$replaceable{$program_dir} = '\.dylib$' if ($ENV{OS} eq 'MACOSX');
+
+@search_dirs = ( 'lib', 'bin', 'class' );
+
+@known_duplicates = ( 'db.jar', 'libi18n' );
+
+sub sniff_target($)
+{
+ my $build_dir = shift;
+ my ($dirhandle, $fname);
+ my ($target, $libver, $lang) = ( 'unxlngi4.pro', '680', 'en-US' ); # defaults
+
+ opendir ($dirhandle, $build_dir) || die "Can't open $build_dir";
+ while ($fname = readdir ($dirhandle)) {
+ $fname =~ /Set.sh$/ || next;
+
+ my $file;
+ open ($file, "$build_dir/$fname") || die "Can't open $build_dir/$fname";
+ while (<$file>) {
+ /\s*(\S+)\s*=\s*\"(\S+)\"/ || next;
+ if ($1 eq 'INPATH') {
+ $target = $2;
+ }
+ if ($1 eq 'UPD') {
+ $libver = $2;
+ }
+ }
+ close ($file);
+ }
+
+ closedir ($dirhandle);
+
+ print "Sniffed target: $target, $libver\n";
+
+ return ($target, $libver, $lang);
+}
+
+sub build_installed_list($)
+{
+ my $path = shift;
+ my %files = ();
+
+ for my $suffix (keys %replaceable) {
+ my $dirname = "$path/$suffix";
+ my $dirhandle;
+ my $pattern = $replaceable{$suffix};
+ if (opendir ($dirhandle, $dirname)) {
+ while (my $fname = readdir ($dirhandle)) {
+ $fname =~ m/$pattern/ || next;
+
+ my $skip = 0;
+ for $pattern (@exceptions) {
+ $fname =~ /$pattern/ || next;
+ $skip = 1;
+ }
+ $files{$fname} = $dirname if !$skip;
+ }
+ closedir ($dirhandle);
+ } else {
+ print "Couldn't find '$dirname': skipping\n";
+ }
+ }
+ return \%files;
+}
+
+sub check_create_linked($)
+{
+ my $path = shift;
+ my $linked_dir = "$path/linked";
+ if (! -d $linked_dir) {
+ mkdir $linked_dir || die "Can't make $linked_dir: $!";
+ }
+}
+
+sub do_link($$$$@)
+{
+ my $src = shift;
+ my $dest = shift;
+ my $src_name = shift;
+ my $dest_name = shift;
+ my $dont_check_link = shift;
+
+ if (-l "$dest/$dest_name" ) {
+ my $link = readlink ("$dest/$dest_name");
+ if ($link =~ /^\//) { # Absolute path
+ if (!$dry_run) {
+ # re-write the link
+ unlink ("$dest/$dest_name");
+ symlink ("$src/$src_name", "$dest/$dest_name") || die "Failed to symlink: $!";
+ print " [$dest_name]";
+ } else {
+ print "re-make link $src/$src_name => $dest/$dest_name\n";
+ }
+ } elsif ($dry_run) {
+ print "skipping symbolic link $dest/$dest_name -> $link\n";
+ }
+ } else {
+ check_create_linked ($dest);
+ if (!$dry_run) {
+ # move / write the link
+ rename ("$dest/$dest_name", "$dest/linked/$dest_name") ||
+ defined $dont_check_link || die "Failed rename of $dest/$dest_name: $!";
+
+ symlink ("$src/$src_name", "$dest/$dest_name") || die "Failed to symlink: $!";
+ print " $dest_name";
+ } else {
+ print "move / symlink $src/$src_name => $dest/$dest_name\n";
+ }
+ }
+}
+
+sub scan_and_link_files($$$)
+{
+ my $build_path = shift;
+ my $installed_files = shift;
+ my $target = shift;
+
+ my @modules = ();
+ my $dirh_toplevel;
+ opendir ($dirh_toplevel, $build_path) || die "Can't open '$build_path': $!";
+ while (my $subdir = readdir ($dirh_toplevel)) {
+ $subdir =~ m/\./ && next; # eg. vcl.old,
+ my $test = "$build_path/$subdir/$target";
+ -d $test || next;
+ push @modules, $test;
+ }
+ closedir ($dirh_toplevel);
+
+# FIXME: re-implement the $product functionality
+ my $module;
+ my %build_files;
+ for $module (@modules) {
+ for $elem (@search_dirs) {
+ my $dirh_module;
+ my $module_path = "$module/$elem";
+ if (opendir ($dirh_module, $module_path)) {
+ while (my $file = readdir($dirh_module)) {
+ if (defined $installed_files->{$file}) {
+ if (defined $build_files{$file}) {
+ my $known = 0;
+ for my $regexp (@known_duplicates) {
+ if ($file =~ m/$regexp/) {
+ $known = 1;
+ }
+ }
+ if (!$known) {
+ print "Unknown duplicate file '$file' in: '" .
+ $build_files{$file} . "' vs '" .
+ $module_path . "' in module $module\n";
+ exit (1);
+ }
+ }
+ $build_files{$file} = $module_path;
+ }
+ }
+ }
+ closedir ($dirh_module);
+ }
+ }
+
+ for my $file (keys %build_files) {
+ my $src = $build_files{$file};
+ my $dest = $installed_files->{$file};
+
+ do_link ($src, $dest, $file, $file);
+ }
+ print "\n";
+}
+
+sub evilness($)
+{
+ my $doit = shift;
+ my $name = 'librecentfile.so';
+ my $src = "$OOO_BUILD/shell/$TARGET/lib/$name";
+ my $dest = "$OOO_BUILD/sfx2/$TARGET/lib/$name";
+
+ if ($doit eq 'undo') {
+ if (-l $dest) {
+ print " unlink $name\n";
+ unlink $dest;
+ }
+ } else {
+ $doit eq 'do' || die;
+ if (-f $src) {
+ print " link $name\n";
+ symlink $src, $dest;
+ }
+ }
+}
+
+sub link_iso_res()
+{
+ print "Special iso.res case: ";
+ my $ooo_res="$OOO_INSTALL/" . $program_dir . "/resource/ooo".$LIBVER.$LANG.".res";
+ my $star_res="$OOO_INSTALL/" . $program_dir . "/resource/iso".$LIBVER.$LANG.".res";
+ if (-l $ooo_res && -l $star_res) {
+ if ($dry_run) {
+ print "link $ooo_res to $star_res";
+ } else {
+ unlink ($star_res);
+ symlink ($ooo_res, $star_res);
+ print "clobbered";
+ }
+ }
+ print "\n";
+}
+
+# Hack for (renamed) types.rdb (types.db)
+sub link_types_rdb()
+{
+ print "Types.rdb case:";
+ my $src = "$OOO_BUILD/offapi/$TARGET/ucr";
+ my $dest = "$OOO_INSTALL/" . $program_dir;
+ do_link ($src, $dest, 'types.db', 'types.rdb');
+ print "\n";
+}
+
+# link installed files back into src tree:
+sub link_soffice_bin_files()
+{
+ my $dest;
+ my $src = "$OOO_INSTALL/" . $program_dir;
+
+ print "soffice files";
+ $dest = "$OOO_BUILD/desktop/$TARGET/bin";
+ do_link ($src, $dest, 'soffice', 'soffice.bin', 1);
+ do_link ($src, $dest, 'bootstraprc', 'bootstraprc', 1);
+ do_link ($src, $dest, 'intro.bmp', 'intro.bmp', 1);
+ do_link ("$OOO_INSTALL", "$OOO_BUILD/desktop/$TARGET", 'share', 'share', 1);
+
+ print "\n";
+}
+
+my $a;
+my $usage = 0;
+for $a (@ARGV) {
+
+# options
+ if ($a =~ /--product/) {
+ $product = 1;
+ } elsif ($a =~ /--dry-run/) {
+ $dry_run = 1;
+ } elsif (($a eq '--help') || ($a eq '-h')) {
+ $usage = 1;
+
+# ordered arguments
+ } elsif (!defined $OOO_INSTALL) {
+ $OOO_INSTALL = $a;
+ } elsif (!defined $OOO_BUILD) {
+ $OOO_BUILD = $a;
+ } else {
+ print "Unknown argument '$a'\n";
+ $usage = 1;
+ }
+}
+
+if (!defined $OOO_BUILD && defined $ENV{SRC_ROOT}) {
+ $OOO_BUILD = $ENV{SRC_ROOT};
+}
+
+if ($usage || !defined $OOO_INSTALL || !defined $OOO_BUILD) {
+ printf "Usage: linkoo </path/to/ooo/install> [</path/to/ooo/build/tree>] [--product] [--dry-run]\n";
+ exit (1);
+}
+
+substr ($OOO_INSTALL, 0, 1) eq '/' || die "linkoo requires absolute paths ($OOO_INSTALL does not qualify)";
+substr ($OOO_BUILD, 0, 1) eq '/' || die "linkoo requires absolute paths ($OOO_BUILD does not qualify)";
+
+-d $OOO_INSTALL || die "No such directory $OOO_INSTALL";
+-w $OOO_INSTALL || die "You need write access to $OOO_INSTALL";
+-d $OOO_BUILD || die "No such directory $OOO_BUILD";
+-d "$OOO_INSTALL/" . $program_dir . "/resource" || die "$OOO_INSTALL doesn't look like an OO install";
+
+($TARGET, $LIBVER, $LANG) = sniff_target ($OOO_BUILD);
+
+evilness ('undo');
+
+my $installed_files = build_installed_list ($OOO_INSTALL);
+
+scan_and_link_files ($OOO_BUILD, $installed_files, $TARGET);
+link_iso_res();
+link_types_rdb();
+link_soffice_bin_files();
+
+if (!-f "$OOO_INSTALL/" . $program_dir . "/ooenv") {
+ print "Creating '$OOO_INSTALL/", $program_dir, "/ooenv'\n";
+ open ($ooenv, ">$OOO_INSTALL/" . $program_dir . "/ooenv") || die "Can't open $OOO_INSTALL/" . $program_dir . "/ooenv: $!";
+ print $ooenv $env_script;
+ close ($ooenv);
+}
+
+evilness ('do');
+
+print "\nlinkoo finished, please don't forget to source ooenv before ./soffice.\n";
diff --git a/solenv/bin/localize b/solenv/bin/localize
new file mode 100755
index 000000000000..ef5550e72e67
--- /dev/null
+++ b/solenv/bin/localize
@@ -0,0 +1,20 @@
+#!/bin/sh
+if [ x${SOLARENV}x = xx ]; then
+ echo No environment found, please use 'setsolar'
+exit 1
+fi
+
+# localize.pl calls localize_sl in solver bin directory which depends on dynamic
+# libraries in solver lib directory but has no correct RPATH (or equivalent):
+if [ "${OS?}" = MACOSX ]; then
+ export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH:+${DYLD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT}
+else
+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT}
+fi
+
+if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
+ exec perl -w $SOLARVERSION/$INPATH/bin/localize.pl "$@"
+else
+ exec perl -w $SOLARVERSION/$INPATH/bin$UPDMINOREXT/localize.pl "$@"
+fi
+
diff --git a/solenv/bin/localize_sl b/solenv/bin/localize_sl
new file mode 100755
index 000000000000..af7f8351406c
--- /dev/null
+++ b/solenv/bin/localize_sl
@@ -0,0 +1,18 @@
+#!/bin/sh
+if [ x${SOLARENV}x = xx ]; then
+ echo No environment found, please use 'setsolar'
+exit 1
+fi
+
+if [ "${OS?}" = MACOSX ]; then
+ export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH:+${DYLD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT}
+else
+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT}
+fi
+
+if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then
+ exec $SOLARVERSION/$INPATH/bin/localize_sl "$@"
+else
+ exec $SOLARVERSION/$INPATH/bin$UPDMINOREXT/localize_sl "$@"
+fi
+
diff --git a/solenv/bin/macosx-change-install-names.pl b/solenv/bin/macosx-change-install-names.pl
new file mode 100644
index 000000000000..05fa12f06070
--- /dev/null
+++ b/solenv/bin/macosx-change-install-names.pl
@@ -0,0 +1,97 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+use lib ("$ENV{SOLARENV}/bin/modules");
+use macosxotoolhelper;
+
+sub action($$$)
+{
+ my %action =
+ ('app/UREBIN/URELIB' => '@executable_path/../lib',
+ 'app/OOO/URELIB' => '@executable_path/../ure-link/lib',
+ 'app/OOO/OOO' => '@executable_path',
+ 'app/SDK/URELIB' => '@executable_path/../../ure-link/lib',
+ 'app/BRAND/URELIB' => '@executable_path/../basis-link/ure-link/lib',
+ 'app/BRAND/OOO' => '@executable_path/../basis-link/program',
+ 'app/NONE/URELIB' => '@__VIA_LIBRARY_PATH__',
+ 'app/NONE/OOO' => '@__VIA_LIBRARY_PATH__',
+ 'app/NONE/NONE' => '@__VIA_LIBRARY_PATH__',
+ 'shl/URELIB/URELIB' => '@loader_path',
+ 'shl/OOO/URELIB' => '@loader_path/../ure-link/lib',
+ 'shl/OOO/OOO' => '@loader_path',
+ 'shl/OXT/URELIB' => '@executable_path/urelibs',
+ 'shl/BOXT/URELIB' => '@executable_path/urelibs',
+ 'shl/BOXT/OOO' => '@loader_path/../../../basis-link/program',
+ 'shl/NONE/URELIB' => '@__VIA_LIBRARY_PATH__',
+ 'shl/NONE/OOO' => '@__VIA_LIBRARY_PATH__',
+ 'shl/NONE/NONE' => '@__VIA_LIBRARY_PATH__');
+ my ($type, $loc1, $loc2) = @_;
+ my $act = $action{"$type/$loc1/$loc2"};
+ die "illegal combination $type/$loc1/$loc2" unless defined $act;
+ return $act;
+}
+
+@ARGV == 3 || @ARGV >= 2 && $ARGV[0] eq "extshl" or die
+ 'Usage: app|shl|extshl UREBIN|URELIB|OOO|SDK|BRAND|OXT|BOXT|NONE <filepath>*';
+$type = shift @ARGV;
+$loc = shift @ARGV;
+if ($type eq "extshl")
+{
+ $type = "shl";
+ my $change = "";
+ my %inames;
+ foreach $file (@ARGV)
+ {
+ my $iname = otoolD($file);
+ (defined $iname ? $iname : $file . "\n") =~ m'^(.*?([^/]+))\n$' or
+ die "unexpected otool -D output";
+ $change .= " -change $1 " . action($type, $loc, $loc) . "/$2";
+ $inames{$file} = $2;
+ }
+ foreach $file (@ARGV)
+ {
+ my $call = "install_name_tool$change -id \@__________________________________________________$loc/$inames{$file} $file";
+ system($call) == 0 or die "cannot $call";
+ }
+}
+foreach $file (@ARGV)
+{
+ my $call = "otool -L $file";
+ open(IN, "-|", $call) or die "cannot $call";
+ my $change = "";
+ while (<IN>)
+ {
+ $change .= " -change $1 " . action($type, $loc, $2) . "$3"
+ if m'^\s*(@_{50}([^/]+)(/.+)) \(compatibility version \d+\.\d+\.\d+, current version \d+\.\d+\.\d+\)\n$';
+ }
+ close(IN);
+ if ($change ne "")
+ {
+ $call = "install_name_tool$change $file";
+ system($call) == 0 or die "cannot $call";
+ }
+}
diff --git a/solenv/bin/macosx-create-bundle b/solenv/bin/macosx-create-bundle
new file mode 100755
index 000000000000..4b03e076f3ae
--- /dev/null
+++ b/solenv/bin/macosx-create-bundle
@@ -0,0 +1,105 @@
+#!/bin/sh
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# Documentation
+# -------------
+#
+# The purpose of this script to take Mac OS X executables and shared libraries
+# and package them into the required Mac OS X bundle format.
+#
+# This script has the following usage:
+# macosx-create-bundle file1 [file2] ... [fileN]
+#
+# Note that file1 through fileN can in either of the following formats:
+# - A file name
+# - A file name and a directory to look for missing files. To use this option,
+# use the following format:
+# filename=directory
+#
+# The file argument is the file that you want to package into a Mac OS X
+# bundle. Currently, this script will only package executables and shared
+# libraries.
+#
+# The output for each executable will be a bundle named <file>.app and
+# the output for each shared library will be a symlink from libfoo.jnilib
+# back to libfoo.dylib.
+# These output directories will be in the same directory as the executable or
+# shared library.
+
+# Code
+# ----
+
+# Parse command line arguments
+if [ $# = 0 ]; then
+ printf "macosx-create-bundle: error: incorrect number of arguments\n" >&2
+ printf "Usage: macosx-create-bundle file1 [file2] ... [fileN]\n" >&2
+ exit 1
+fi
+
+while [ $# != 0 ]; do
+ inputfile=`echo "$1" | awk -F= '{print $1}'`
+ sourcedir=`echo "$1" | awk -F= '{print $2}'`
+
+ shift
+
+ inputfilename=`basename "$inputfile"`
+ outputdir=`dirname "$inputfile"`
+
+ solverlibdir="$SOLARVERSION/$INPATH/lib"
+ locallibdir="../../../../lib"
+
+ solverbindir="$SOLARVERSION/$INPATH/bin"
+ localbindir="../../.."
+
+ # Determine file type
+ filetype=`file -L "$inputfile"`
+
+ # Create bundle based on file type
+ if printf "$filetype" | grep -q 'Mach-O executable'; then
+
+ # Do nothing as this step is obsolete
+ :
+
+ elif printf "$filetype" | grep -q 'Mach-O dynamically linked shared library'; then
+ # Screen out lib\w+static libraries as they are not used directly
+ if ! printf "$inputfilename" | grep -q -x -E 'lib\w+static.*\.dylib'; then
+ # Create jnilib link
+ inputjnilibname="`basename $inputfilename .dylib`.jnilib"
+ if [ ! -L "$outputdir/$inputjnilibname" ]; then
+ rm -Rf "$outputdir/$inputjnilibname"
+ fi
+ # Link jnilib
+ ln -sf "$inputfilename" "$outputdir/$inputjnilibname"
+
+ #printf "macosx-create-bundle: $outputdir/$inputjnilibname successfully created\n"
+ fi
+ else
+ printf "macosx-create-bundle: error: file is not an executable or shared library.\n" >&2
+ exit 1
+ fi
+done
diff --git a/solenv/bin/macosx-dylib-link-list.pl b/solenv/bin/macosx-dylib-link-list.pl
new file mode 100644
index 000000000000..1554bbe56016
--- /dev/null
+++ b/solenv/bin/macosx-dylib-link-list.pl
@@ -0,0 +1,91 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+use lib ("$ENV{SOLARENV}/bin/modules");
+use macosxotoolhelper;
+
+sub locate($)
+{
+ my ($lib) = @_;
+ my $dir;
+ foreach $dir (@dirs)
+ {
+ my $path = "$dir/$lib";
+ if (-e $path)
+ {
+ return $path;
+ }
+ }
+ return;
+}
+
+sub handle($$)
+{
+ my ($from, $to) = @_;
+ # wrap -dylib_file in -Wl so that hopefully any used tool whatsoever (e.g.,
+ # libtool generated from xmlsec1-1.2.6/configure included in
+ # libxmlsec/download/xmlsec1-1.2.6.tar.gz:1.3) passes it through to the
+ # linker:
+ !($from =~ /,/ || $to =~ /,/) or
+ die "$from:$to contains commas and cannot go into -Wl";
+ print " -Wl,-dylib_file,$from:$to";
+ $done{$from} = 1;
+ push(@todo, $to) if (grep {$_ eq $to} @todo) == 0;
+}
+
+foreach (@ARGV) { push(@dirs, $1) if /^-L(.*)$/; }
+foreach (@ARGV)
+{
+ if (/^-l(.*)$/)
+ {
+ my $loc = locate("lib$1.dylib");
+ handle($1, $loc) if defined $loc && otoolD($loc) =~ m'^(@.+/.+)\n$';
+ }
+}
+foreach $file (@todo)
+{
+ my $call = "otool -L $file";
+ open(IN, "-|", $call) or die "cannot $call";
+ while (<IN>)
+ {
+ if (m'^\s*(@.+/([^/]+)) \(compatibility version \d+\.\d+\.\d+, current version \d+\.\d+\.\d+\)\n$')
+ {
+ my $full = $1;
+ my $loc = locate($2);
+ if (defined $loc)
+ {
+ handle($full, $loc) unless defined $done{$full};
+ }
+ else
+ {
+ die "unknown $full (from $file)";
+ }
+ }
+ }
+ close(IN);
+}
+print "\n";
diff --git a/solenv/bin/make_download.pl b/solenv/bin/make_download.pl
new file mode 100644
index 000000000000..dd492ea3bfa1
--- /dev/null
+++ b/solenv/bin/make_download.pl
@@ -0,0 +1,129 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#################
+# use
+#################
+
+use lib ("$ENV{SOLARENV}/bin/modules");
+
+use Cwd;
+use File::Copy;
+use installer::download;
+use installer::downloadsigner;
+use installer::exiter;
+use installer::followme;
+use installer::globals;
+use installer::logger;
+use installer::windows::sign;
+
+#################################################
+# Main program
+#################################################
+
+installer::downloadsigner::getparameter();
+installer::downloadsigner::checkparameter();
+
+my $temppath = installer::downloadsigner::set_temp_path();
+my $infofilelist = installer::downloadsigner::createproductlist();
+installer::downloadsigner::publishproductlist($infofilelist);
+
+foreach my $infofilename ( @{$infofilelist} )
+{
+ installer::logger::starttime();
+
+ my $success = 1;
+ my $do_copy = 1;
+ my $followmeinfohash = installer::followme::read_followme_info($infofilename);
+ installer::downloadsigner::setlogfilename(); # Successful after reading followme file, resetting log file
+ if ( $installer::globals::writetotemp ) { installer::downloadsigner::set_output_pathes_to_temp($followmeinfohash, $temppath); }
+ if ( $installer::globals::useminor ) { installer::downloadsigner::set_minor_into_pathes($followmeinfohash, $temppath); }
+
+ if (( ! $installer::globals::iswindowsbuild ) && ( $installer::globals::dosign ))
+ {
+ installer::logger::print_message( "... WARNING: Signing only for Windows platforms active ...\n" );
+ }
+
+ # installer::logger::include_header_into_logfile("Reading include pathes");
+ # installer::worker::collect_all_files_from_includepathes($followmeinfohash->{'includepatharray'});
+
+ if (( $installer::globals::iswindowsbuild ) && ( $installer::globals::dosign ))
+ {
+ $followmeinfohash->{'finalinstalldir'} = installer::windows::sign::sign_install_set($followmeinfohash, $do_copy, $temppath);
+
+ ($success, $followmeinfohash->{'finalinstalldir'}) = installer::worker::analyze_and_save_logfile($followmeinfohash->{'loggingdir'},
+ $followmeinfohash->{'finalinstalldir'},
+ $followmeinfohash->{'installlogdir'},
+ "",
+ \$followmeinfohash->{'languagestring'},
+ $followmeinfohash->{'currentinstallnumber'});
+
+ if ( ! $success ) { installer::exiter::exit_program("ERROR: Signing installation set failed: $followmeinfohash->{'finalinstalldir'}", "Main"); }
+ }
+
+ if ( ! $installer::globals::nodownload )
+ {
+ $followmeinfohash->{'finalinstalldir'} = installer::download::create_download_sets($followmeinfohash->{'finalinstalldir'},
+ $followmeinfohash->{'includepatharray'},
+ $followmeinfohash->{'allvariableshash'},
+ $followmeinfohash->{'downloadname'},
+ \$followmeinfohash->{'languagestring'},
+ $followmeinfohash->{'languagesarray'});
+
+ ($success, $followmeinfohash->{'finalinstalldir'}) = installer::worker::analyze_and_save_logfile($followmeinfohash->{'loggingdir'},
+ $followmeinfohash->{'finalinstalldir'},
+ $followmeinfohash->{'installlogdir'},
+ "",
+ \$followmeinfohash->{'languagestring'},
+ $followmeinfohash->{'currentinstallnumber'});
+
+ if (( $success ) && ( $installer::globals::iswindowsbuild ) && ( $installer::globals::dosign ))
+ {
+ $do_copy = 0;
+ $followmeinfohash->{'finalinstalldir'} = installer::windows::sign::sign_install_set($followmeinfohash, $do_copy, $temppath);
+
+ ($success, $followmeinfohash->{'finalinstalldir'}) = installer::worker::analyze_and_save_logfile($followmeinfohash->{'loggingdir'},
+ $followmeinfohash->{'finalinstalldir'},
+ $followmeinfohash->{'installlogdir'},
+ "",
+ \$followmeinfohash->{'languagestring'},
+ $followmeinfohash->{'currentinstallnumber'});
+ }
+ }
+
+ if ( $success )
+ {
+ installer::worker::clean_output_tree();
+ if ( $installer::globals::followme_from_directory ) { installer::downloadsigner::rename_followme_infofile($infofilename); }
+ }
+
+ installer::logger::stoptime();
+}
+
+####################################
+# Main program end
+####################################
diff --git a/solenv/bin/make_ext_update_info.pl b/solenv/bin/make_ext_update_info.pl
new file mode 100755
index 000000000000..f350dc489386
--- /dev/null
+++ b/solenv/bin/make_ext_update_info.pl
@@ -0,0 +1,613 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#here the definition for d would be written into dependencies. The reason is that when the event handler
+#for the element is called, we can only find out the namespace but not the prefix. So we cannot
+#distinguish if the namespace is used because the element was prefixed or because it uses the default
+#namespace.
+use warnings;
+use strict;
+
+use XML::Parser;
+use Getopt::Long;
+use Carp;
+
+sub getUpdateInfoFileName($);
+sub writeUpdateInformationData($);
+sub findAttribute($$);
+sub getNotDefPrefs($$$);
+sub collectPrefixes($$$$);
+sub determineNsDefinitions($$$);
+sub determineNsDefinitionForItem($$$);
+
+my $inDescription = 0;
+my $inDependencies = 0;
+my $inIdentifier = 0;
+my $inVersion = 0;
+my $descNS = "http://openoffice.org/extensions/description/2006";
+ my $indent;
+my $identifier;
+my $version;
+
+#contains prefixes and the corresponding namespaces which are used in the <dependencies>
+#element and all children of the description.xml
+my @usedNsInDependencies;
+
+#Maps prefix to namespaces which are valid in <dependencies>. That is, they are
+#either defined in <dependencies> or in the hirarchy above <dependencies>
+my %validPrefsInDep;
+#Contains the prefixes which are defined in <dependencies>
+my @newPrefsInDep;
+#Contains the prefixes/namespaces which need to be defined in <dependencies> but which are currently
+#not. For example a prefix is defined in the parent and is used in a child of <dependencies>
+my %notDefInDep;
+
+#prefix used in start and end element
+my $prefix;
+
+#The default namespace valid in <dependencies>
+my $defNsInDep;
+#The prefix which we use for the default namespace used in <dependencies>
+my $generatedPrefix;
+
+my $helptext =
+"make_ext_update_info.pl produces an update information file for an extension. ".
+"It will use a dummy URL as URL for the extension update unless a URL has been ".
+"provided with the --update_url option. The name of the update ".
+"information file, which must be provided with the --out switch, should be formed ".
+"according to this scheme: \n\n".
+"extension_identifier.update.xml\n\n".
+"extension_identifier should correspond to the extension identifier. In some cases ".
+"this may not be possible because the identifier may contain characters which are not ".
+"allowd in file names.\n\n".
+"usage:\n".
+"perl make_ext_update_info.pl [--help][--update_url url] --out update_information_file description.xml \n\n".
+"Options: \n".
+"--help - prints the help message and exits \n".
+"--out file - the update information file to be written including the path \n".
+"--update-url url - inserts the url under the <update-download> element. It may be necessary to enclose the urls in quotes in case they contain characters such as \"?\". ".
+"It can be used multiple times\n\n";
+
+#handling of arguments
+my $help = 0;
+my $out;
+my @update_urls;
+if (!GetOptions('help|?' => \$help,
+ 'out=s' => \$out,
+ 'update-url=s'=> \@update_urls))
+{
+ print $helptext;
+ exit -1;
+}
+my $cArgs = scalar @ARGV;
+die "You need to provide a description.xml\n\n$helptext" if $cArgs ==0;
+die "You need to provide the name of the update information file ".
+ "with the --out switch.\n" unless ($out);
+die "Too many arguments. \n\n$helptext" if $cArgs > 1;
+print $helptext if $help;
+
+
+#open the update information file for writing
+my $FH;
+open $FH, "> $out" or die $!;
+
+#write the xml header and root element
+print $FH '<?xml version="1.0" encoding="UTF-8"?>', "\n";
+print $FH '<description xmlns="http://openoffice.org/extensions/update/2006"', "\n";
+print $FH ' xmlns:xlink="http://www.w3.org/1999/xlink">', "\n";
+
+#obtain from description.xml the data for the update information
+writeUpdateInformationData($ARGV[0]);
+#We will die if there is no <version> or <identifier> in the description.xml
+die "Error: The description.xml does not contain a <identifier> element.\n" unless $identifier;
+die "Error: The description.xml does not contain a <version> element. \n" unless $version;
+
+#write the write the update-download element and the children.
+#the indention of <update-download> corresponds to that of <version>
+print $FH ' 'x$indent, '<update-download>', "\n";
+#check if update-urls have been provided through --update-url option
+if (scalar @update_urls)
+{
+ my $urlIndent = $indent > 8 ? 8 : 2 * $indent;
+ #use provided urls
+ for (@update_urls)
+ {
+ print $FH ' 'x$urlIndent, '<src xlink:href="'.$_.'" />', "\n";
+ }
+}
+else
+{
+ #use dummy update url
+ print $FH ' 'x8, '<src xlink:href="http://extensions.openoffice.org/testarea/dummy.oxt" />', "\n";
+}
+print $FH ' 'x$indent, '</update-download>', "\n";
+
+print $FH '</description>', "\n";
+close $FH;
+
+exit 0;
+
+
+
+sub start_handler
+{
+ my $parser = shift;
+ my $name = shift;
+
+ if ($name eq "description"
+ && $descNS eq $parser->namespace($name))
+ {
+ $inDescription = 1;
+ }
+ elsif ($inDescription
+ && $name eq "version"
+ && $descNS eq $parser->namespace($name))
+ {
+ $inVersion = 1;
+ $version = 1;
+ $indent = $parser->current_column();
+ print $FH " "x$indent, $parser->original_string();
+ }
+ elsif ($inDescription
+ && $name eq "identifier"
+ && $descNS eq $parser->namespace($name))
+ {
+ $inIdentifier = 1;
+ $identifier = 1;
+ print $FH " "x$parser->current_column(), $parser->original_string();
+ }
+ elsif ($inDescription
+ && $name eq "dependencies"
+ && $descNS eq $parser->namespace($name))
+ {
+ $inDependencies = 1;
+ my $dep = $parser->original_string();
+ #add the additional namespace definitions, which we have discovered during the first
+ #parsing
+ #cut of the closing > or /> from the start element, so we can append the namespace definitions
+ $dep =~ /(\s*<.*) ((\s*\/>)|(\s*>))/x;
+ my $dep1 = $1;
+ $dep1.= " xmlns:".$_.'="'.$notDefInDep{$_}.'"' for (keys %notDefInDep);
+ $dep1.= $2;
+ print $FH " "x$parser->current_column(), $dep1;
+ }
+ elsif ($inDependencies)
+ {
+ #$prefix is global because we need to use it in the end element as well.
+ $prefix = "";
+ my $fullString;
+ my $orig = $parser->original_string();
+ #Split up the string so we can insert the prefix for the element.
+ # <OpenOffice.org-minimal-version>
+ # <d:OpenOffice.org-minimal-version>
+ $orig=~/(\s*<)(.*?)\s/x;
+ #in $2 is the element name, look for the prefix
+ if ($2 !~/(.*?):/ && $parser->namespace($name)) {
+ #no prefix, that is element uses default namespace.
+ #Now check if the default namespace in <dependencies> is the same as the one in this
+ #element. If not, then the default ns was defined "after" <dependencies>. Because all
+ #children of <dependencies> are copied into the update information, so will this default
+ #namespace definition. Hence this element will have the same default namespace in the
+ #update information.
+ my $defNsDep = $validPrefsInDep{"#default"};
+ #we must have #default, see the if statement above
+ my $defNsCur = $parser->expand_ns_prefix("#default");
+
+ if ($defNsDep eq $defNsCur) {
+ #Determine if there is in <dependency> a prefix defined (only valid there and need not
+ #directly defined in this element). If there is no prefix defined then we will
+ #add a new definition to <dependencies>.
+ for (keys %validPrefsInDep) {
+ if (($validPrefsInDep{$_} eq $defNsDep) && $_ ne "#default") {
+ $prefix = $_; last;
+ }
+ }
+ if (! $prefix) {
+ #If there was no prefix, we will add new prefix definition to <dependency>
+ #Which prefix this is has been determined during the first parsing.
+ for (keys %notDefInDep) {
+ if (($notDefInDep{$_} eq $defNsCur) && $_ ne "#default") {
+ $prefix = $_; last;
+ }
+ }
+ }
+ #die if we have no prefix
+ confess "No prefix defined for default namespace " unless $prefix;
+ #get the full part after <
+ $orig=~/(\s*<)(.*)/x;
+ $fullString= $1.$prefix.":".$2;
+ }
+
+ }
+ $fullString = $orig unless $fullString;
+
+ # We record anything within <dependencies> </dependencies>.
+ print $FH $fullString;
+ }
+}
+
+sub end_handler
+{
+ my $parser = shift;
+ my $name = shift;
+
+ if ($name eq "description"
+ && $descNS eq $parser->namespace($name))
+ {
+ $inDescription = 0;
+ }
+ elsif ($inDescription
+ && $name eq "version"
+ && $descNS eq $parser->namespace($name))
+ {
+ $inVersion = 0;
+ print $FH $parser->original_string(), "\n";
+ }
+ elsif ($inDescription
+ && $name eq "identifier"
+ && $descNS eq $parser->namespace($name))
+ {
+ $inIdentifier = 0;
+ print $FH $parser->original_string(), "\n";
+ }
+ elsif($inDescription
+ && $name eq "dependencies"
+ && $descNS eq $parser->namespace($name))
+ {
+ $inDependencies = 0;
+ print $FH $parser->original_string(), "\n";
+ }
+ elsif ($inDependencies)
+ {
+ my $orig = $parser->original_string();
+ #$orig is empty if we have tags like this: <name />
+ if ($orig && $prefix) {
+ $orig=~/(\s*<\/)(.*)/x;
+ $orig= $1.$prefix.":".$2;
+ }
+ print $FH $orig;
+ }
+}
+
+#We write the complete content between start and end tags of
+# <identifier>, <version>, <dependencies>
+sub default_handler
+{
+ my $parser = shift;
+ my $name = shift;
+ if ($inIdentifier || $inVersion) {
+ print $FH $parser->original_string();
+ } elsif ($inDependencies) {
+ print $FH $parser->original_string();
+ }
+
+} # End of default_handler
+
+#sax handler used for the first parsing to recognize the used prefixes in <dependencies > and its
+#children and to find out if we need to define a new prefix for the current default namespace.
+sub start_handler_infos
+{
+ my $parser = shift;
+ my $name = shift;
+ if ($name eq "description"
+ && $descNS eq $parser->namespace($name)) {
+ $inDescription = 1;
+ }
+ elsif ($inDescription
+ && $name eq "dependencies"
+ && $descNS eq $parser->namespace($name)) {
+ $inDependencies = 1;
+ #build the map of prefix/namespace which are valid in <dependencies>
+ my @cur = $parser->current_ns_prefixes();
+ for (@cur) {
+ $validPrefsInDep{$_} = $parser->expand_ns_prefix($_);
+ }
+ #remember the prefixes defined in <dependencies>
+ @newPrefsInDep = $parser->new_ns_prefixes();
+
+ collectPrefixes($parser, $name, \@_, \@usedNsInDependencies);
+ return if $generatedPrefix;
+
+ #determine if need to create a new prefix for the current element if it uses a default ns.
+ #Split up the string so we can see if there is a prefix used
+ # <OpenOffice.org-minimal-version>
+ # <d:OpenOffice.org-minimal-version>
+ my $orig = $parser->original_string();
+ $orig=~/(\s*<)(.*?)\s/x;
+ #in $2 is the element name, look for the prefix
+ if ($2 !~/(.*?):/ && $parser->namespace($name)) {
+ #no prefix, that is element uses default namespace.
+ #Now check if the default namespace in <dependencies> is the same as the one in this
+ #element. If not, then the default ns was defined "after" <dependencies>. Because all
+ #children of <dependencies> are copied into the update information, so will this default
+ #namespace definition. Hence this element will have the same default namespace in the
+ #update information.
+ my $defNsDep = $validPrefsInDep{"#default"};
+ #we must have #default, see the if statement above
+ my $defNsCur = $parser->expand_ns_prefix("#default");
+
+ if ($defNsDep eq $defNsCur) {
+ #Determine if there is in <dependency> a prefix defined (only valid there and need not
+ #directly defined in this element). If there is no prefix defined then we will
+ #add a new definition to <dependencies>.
+ for (keys %validPrefsInDep) {
+ if (($validPrefsInDep{$_} eq $defNsDep) && $_ ne "#default") {
+ $prefix = $_; last;
+ }
+ }
+
+ if (! $prefix) {
+
+ #define a new prefix
+ #actually there can be only onle prefix, which is the case when the element
+ #uses the same default namespace as <dependencies> otherwise, the default
+ #namespace was redefined by the children of <dependencies>. These are completely
+ #copied and still valid in the update information file
+ $generatedPrefix = "a";
+ $defNsInDep = $defNsDep;
+ }
+ }
+ }
+
+ }
+ elsif ($inDependencies) {
+ determineNsDefinitions($parser, $name, \@_);
+ collectPrefixes($parser, $name, \@_, \@usedNsInDependencies);
+ }
+}
+#sax handler used for the first parsing to recognize the used prefixes in <dependencies > and its
+#children
+sub end_handler_infos
+{
+ my $parser = shift;
+ my $name = shift;
+
+ if ($name eq "description"
+ && $descNS eq $parser->namespace($name)) {
+ $inDescription = 0;
+ }
+ elsif($inDescription
+ && $name eq "dependencies"
+ && $descNS eq $parser->namespace($name)) {
+ $inDependencies = 0;
+ }
+}
+
+sub writeUpdateInformationData($)
+{
+ my $desc = shift;
+ {
+ #parse description xml to collect information about all used
+ #prefixes and names within <dependencies>
+
+ my $parser = new XML::Parser(ErrorContext => 2,
+ Namespaces => 1);
+ $parser->setHandlers(Start => \&start_handler_infos,
+ End => \&end_handler_infos);
+
+ $parser->parsefile($desc);
+
+
+ }
+ #remove duplicates in the array containing the prefixes
+ if ($generatedPrefix) {
+ my %hashtmp;
+ @usedNsInDependencies = grep(!$hashtmp{$_}++, @usedNsInDependencies);
+
+ #check that the prefix for the default namespace in <dependencies> does not clash
+ #with any other prefixes
+ my $clash;
+ do {
+ $clash = 0;
+ for (@usedNsInDependencies) {
+ if ($_ eq $generatedPrefix) {
+ $generatedPrefix++;
+ $clash = 1; last;
+ }
+ }
+ } while ($clash);
+ $notDefInDep{$generatedPrefix} = $defNsInDep;
+ }
+ #if $notDefInDep contains the prefix #default then we need to add the generated prefix as well
+
+ #add the special prefix for the default namespace into the map of prefixes that will be
+ #added to the <dependencies> element in the update information file
+
+
+ ($inDependencies, $inDescription) = (0,0);
+ {
+ my $parser = new XML::Parser(ErrorContext => 2,
+ Namespaces => 1);
+ $parser->setHandlers(
+ Start => \&start_handler,
+ End => \&end_handler,
+ Default => \&default_handler);
+ $parser->parsefile($desc);
+ }
+}
+
+# param 1: name of the attribute we look for
+# param 2: array of name value pairs, the first subscript is the attribute and the second
+# is the value.
+sub findAttribute($$)
+{
+ my ($name, $args_r) = @_;
+ my @args = @{$args_r};
+ my $value;
+ while (my $attr = shift(@args))
+ {
+ if ($attr eq $name) {
+ $value = shift(@args);
+ die "href attribut has no valid URL" unless $value;
+ last;
+ } else { # shift away the following value for the attribute
+ shift(@args);
+ }
+ }
+ return $value;
+}
+
+#collect the prefixes used in an xml element
+#param 1: parser,
+#param 2: element name,
+#param 3: array of name and values of attributes
+#param 4: out parameter, the array containing the prefixes
+sub collectPrefixes($$$$)
+{
+ my $parser = shift;
+ my $name = shift;
+ my $attr_r = shift;
+ my $out_r = shift;
+ #get the prefixes which are currently valid
+ my @cur = $parser->current_ns_prefixes();
+ my %map_ns;
+ #get the namespaces for the prefixes
+ for (@cur) {
+ if ($_ eq '#default') {
+ next;
+ }
+ my $ns = $parser->expand_ns_prefix($_);
+ $map_ns{$ns} = $_;
+ }
+ #investigat ns of element
+ my $pref = $map_ns{$parser->namespace($name)};
+ push(@{$out_r}, $pref) if $pref;
+ #now go over the attributes
+
+ while (my $attr = shift(@{$attr_r})) {
+ my $ns = $parser->namespace($attr);
+ if (! $ns) {
+ shift(@{$attr_r});
+ next;
+ }
+ $pref = $map_ns{$ns};
+ push( @{$out_r}, $pref) if $pref;
+ shift(@{$attr_r});
+ }
+ #also add newly defined prefixes
+ my @newNs = $parser->new_ns_prefixes();
+ for (@newNs) {
+ if ($_ eq '#default') {
+ next;
+ }
+ push (@{$out_r}, $_);
+ }
+}
+
+#The function is called for each child element of dependencies. It finds out the prefixes
+#which are used by the children and which are defined by the parents of <dependencies>. These
+#would be lost when copying the children of <dependencies> into the update information file.
+#Therefore these definitions are collected so that they then can be written in the <dependencies>
+#element of the update information file.
+#param 1: parser
+#param 2: namsepace
+#param 3: the @_ received in the start handler
+sub determineNsDefinitions($$$)
+{
+ my ($parser, $name, $attr_r) = @_;
+ my @attr = @{$attr_r};
+
+ determineNsDefinitionForItem($parser, $name, 1);
+
+ while (my $attr = shift(@attr)) {
+ determineNsDefinitionForItem($parser, $attr, 0);
+ shift @attr;
+ }
+}
+
+#do not call this function for the element that does not use a prefix
+#param 1: parser
+#param 2: name of the element or attribute
+#param 3: 1 if called for an elment name and 0 when called for attribue
+sub determineNsDefinitionForItem($$$)
+{
+ my ($parser, $name) = @_;
+ my $ns = $parser->namespace($name);
+ if (! $ns) {
+ return;
+ }
+ #If the namespace was not kwown in <dependencies> then it was defined in one of its children
+ #or in this element. Then we are done since this namespace definition is copied into the
+ #update information.
+ my $bNsKnownInDep;
+ for ( keys %validPrefsInDep) {
+ if ( $validPrefsInDep{$_} eq $ns) {
+ $bNsKnownInDep = 1;
+ last;
+ }
+ }
+ #If the namespace of the current element is known in <dependencies> then check if the same
+ #prefix is used. If not, then the prefix was defined in one of the children of <dependencies>
+ #and was assigned the same namespace. Because we copy of children into the update information,
+ #this definition is also copied.
+ if ($bNsKnownInDep) {
+ #create a map of currently valid prefix/namespace
+ my %curPrefToNs;
+ my @curNs = $parser->current_ns_prefixes();
+ for (@curNs) {
+ $curPrefToNs{$_} = $parser->expand_ns_prefix($_);
+ }
+ #find the prefix used in <dependencies> to define the namespace of the current element
+ my $validDepPref;
+ for (keys %validPrefsInDep) {
+ if ($validPrefsInDep{$_} eq $ns) {
+ #ignore #default
+ next if $_ eq "#default";
+ $validDepPref = $_;
+ last;
+ }
+ }
+ #find the prefix defined in the current element used for the namespace of the element
+ my $curPref;
+ for (keys %curPrefToNs) {
+ if ($curPrefToNs{$_} eq $ns) {
+ #ignore #default
+ next if $_ eq "#default";
+ $curPref = $_;
+ last;
+ }
+ }
+ if ($curPref && $validDepPref && ($curPref eq $validDepPref)) {
+ #If the prefixes and ns are the same, then the prefix definition of <dependencies> or its
+ #parent can be used. However, we need to find out which prefixed are NOT defined in
+ #<dependencies> so we can add them to it when we write the update information.
+ my $bDefined = 0;
+ for (@newPrefsInDep) {
+ if ($curPref eq $_) {
+ $bDefined = 1;
+ last;
+ }
+ }
+ if (! $bDefined) {
+ $notDefInDep{$curPref} = $ns;
+ }
+ }
+ }
+}
diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl
new file mode 100644
index 000000000000..d28a2e7e3fa0
--- /dev/null
+++ b/solenv/bin/make_installer.pl
@@ -0,0 +1,2342 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#################
+# use
+#################
+
+use lib ("$ENV{SOLARENV}/bin/modules");
+
+use Cwd;
+use File::Copy;
+use installer::archivefiles;
+use installer::control;
+use installer::converter;
+use installer::copyproject;
+use installer::download;
+use installer::environment;
+use installer::epmfile;
+use installer::exiter;
+use installer::files;
+use installer::followme;
+use installer::globals;
+use installer::javainstaller;
+use installer::languagepack;
+use installer::languages;
+use installer::logger;
+use installer::mail;
+use installer::packagelist;
+use installer::packagepool;
+use installer::parameter;
+use installer::pathanalyzer;
+use installer::profiles;
+use installer::scppatchsoname;
+use installer::scpzipfiles;
+use installer::scriptitems;
+use installer::setupscript;
+use installer::simplepackage;
+use installer::sorter;
+use installer::strip;
+use installer::substfilenamefiles;
+use installer::upx;
+use installer::systemactions;
+use installer::windows::assembly;
+use installer::windows::binary;
+use installer::windows::component;
+use installer::windows::createfolder;
+use installer::windows::directory;
+use installer::windows::feature;
+use installer::windows::featurecomponent;
+use installer::windows::file;
+use installer::windows::font;
+use installer::windows::icon;
+use installer::windows::idtglobal;
+use installer::windows::inifile;
+use installer::windows::java;
+use installer::windows::media;
+use installer::windows::mergemodule;
+use installer::windows::msiglobal;
+use installer::windows::msp;
+use installer::windows::patch;
+use installer::windows::property;
+use installer::windows::removefile;
+use installer::windows::registry;
+use installer::windows::selfreg;
+use installer::windows::shortcut;
+use installer::windows::strip;
+use installer::windows::update;
+use installer::windows::upgrade;
+use installer::worker;
+use installer::xpdinstaller;
+use installer::ziplist;
+
+#################################################
+# Main program
+#################################################
+
+#################################################
+# Part 1: The platform independent part
+#################################################
+
+#################################################
+# Part 1a: The language independent part
+#################################################
+
+installer::logger::starttime();
+
+#########################################
+# Checking the environment and setting
+# most important variables
+#########################################
+
+installer::logger::print_message( "... checking environment variables ...\n" );
+my $environmentvariableshashref = installer::control::check_system_environment();
+
+installer::environment::set_global_environment_variables($environmentvariableshashref);
+
+#################################
+# Check and output of parameter
+#################################
+
+installer::parameter::saveparameter();
+installer::parameter::getparameter();
+
+# debugging can start after function "getparameter"
+if ( $installer::globals::debug ) { installer::logger::debuginfo("\nPart 1: The platform independent part\n"); }
+if ( $installer::globals::debug ) { installer::logger::debuginfo("\nPart 1a: The language independent part\n"); }
+
+installer::parameter::control_fundamental_parameter();
+installer::parameter::setglobalvariables();
+installer::parameter::control_required_parameter();
+
+if (!($installer::globals::languages_defined_in_productlist)) { installer::languages::analyze_languagelist(); }
+installer::parameter::outputparameter();
+
+installer::control::check_updatepack();
+
+$installer::globals::build = uc($installer::globals::build); # using "SRC680" instead of "src680"
+
+######################################
+# Creating the log directory
+######################################
+
+my $loggingdir = installer::systemactions::create_directories("logging", "");
+$loggingdir = $loggingdir . $installer::globals::separator;
+$installer::globals::exitlog = $loggingdir;
+
+my $installdir = "";
+my $currentdir = cwd();
+my $shipinstalldir = "";
+my $current_install_number = "";
+
+######################################
+# Checking the system requirements
+######################################
+
+installer::logger::print_message( "... checking required files ...\n" );
+installer::control::check_system_path();
+
+my $pathvariableshashref = installer::environment::create_pathvariables($environmentvariableshashref);
+
+###############################################
+# Checking saved setting for Windows patches
+###############################################
+
+if (( $installer::globals::iswindowsbuild ) && ( $installer::globals::prepare_winpatch )) { installer::windows::msiglobal::read_saved_mappings(); }
+
+###################################################
+# Analyzing the settings and variables in zip.lst
+###################################################
+
+installer::logger::globallog("zip list file: $installer::globals::ziplistname");
+
+my $ziplistref = installer::files::read_file($installer::globals::ziplistname);
+
+installer::logger::print_message( "... analyzing $installer::globals::ziplistname ... \n" );
+
+my ($productblockref, $parent) = installer::ziplist::getproductblock($ziplistref, $installer::globals::product, 1); # product block from zip.lst
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "productblock.log" ,$productblockref); }
+
+my ($settingsblockref, undef) = installer::ziplist::getproductblock($productblockref, "Settings", 0); # settings block from zip.lst
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "settingsblock1.log" ,$settingsblockref); }
+
+$settingsblockref = installer::ziplist::analyze_settings_block($settingsblockref); # select data from settings block in zip.lst
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "settingsblock2.log" ,$settingsblockref); }
+
+my $allsettingsarrayref = installer::ziplist::get_settings_from_ziplist($settingsblockref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "allsettings1.log" ,$allsettingsarrayref); }
+
+my $allvariablesarrayref = installer::ziplist::get_variables_from_ziplist($settingsblockref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "allvariables1.log" ,$allvariablesarrayref); }
+
+my ($globalproductblockref, undef) = installer::ziplist::getproductblock($ziplistref, $installer::globals::globalblock, 0); # global product block from zip.lst
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "globalproductblock.log" ,$globalproductblockref); }
+
+while (defined $parent)
+{
+ my $parentproductblockref;
+ ($parentproductblockref, $parent) = installer::ziplist::getproductblock(
+ $ziplistref, $parent, 1);
+ my ($parentsettingsblockref, undef) = installer::ziplist::getproductblock(
+ $parentproductblockref, "Settings", 0);
+ $parentsettingsblockref = installer::ziplist::analyze_settings_block(
+ $parentsettingsblockref);
+ my $allparentsettingsarrayref =
+ installer::ziplist::get_settings_from_ziplist($parentsettingsblockref);
+ my $allparentvariablesarrayref =
+ installer::ziplist::get_variables_from_ziplist($parentsettingsblockref);
+ $allsettingsarrayref =
+ installer::converter::combine_arrays_from_references_first_win(
+ $allsettingsarrayref, $allparentsettingsarrayref)
+ if $#{$allparentsettingsarrayref} > -1;
+ $allvariablesarrayref =
+ installer::converter::combine_arrays_from_references_first_win(
+ $allvariablesarrayref, $allparentvariablesarrayref)
+ if $#{$allparentvariablesarrayref} > -1;
+}
+
+if ( $#{$globalproductblockref} > -1 )
+{
+ my ($globalsettingsblockref, undef) = installer::ziplist::getproductblock($globalproductblockref, "Settings", 0); # settings block from zip.lst
+ if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "globalsettingsblock1.log" ,$globalsettingsblockref); }
+
+ $globalsettingsblockref = installer::ziplist::analyze_settings_block($globalsettingsblockref); # select data from settings block in zip.lst
+ if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "globalsettingsblock2.log" ,$globalsettingsblockref); }
+
+ my $allglobalsettingsarrayref = installer::ziplist::get_settings_from_ziplist($globalsettingsblockref);
+ if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "allglobalsettings1.log" ,$allglobalsettingsarrayref); }
+
+ my $allglobalvariablesarrayref = installer::ziplist::get_variables_from_ziplist($globalsettingsblockref);
+ if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "allglobalvariables1.log" ,$allglobalvariablesarrayref); }
+
+ if ( $#{$allglobalsettingsarrayref} > -1 ) { $allsettingsarrayref = installer::converter::combine_arrays_from_references_first_win($allsettingsarrayref, $allglobalsettingsarrayref); }
+ if ( $#{$allglobalvariablesarrayref} > -1 ) { $allvariablesarrayref = installer::converter::combine_arrays_from_references_first_win($allvariablesarrayref, $allglobalvariablesarrayref); }
+}
+
+$allsettingsarrayref = installer::ziplist::remove_multiples_from_ziplist($allsettingsarrayref); # the settings from the zip.lst
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "allsettings2.log" ,$allsettingsarrayref); }
+
+$allvariablesarrayref = installer::ziplist::remove_multiples_from_ziplist($allvariablesarrayref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "allvariables2.log" ,$allvariablesarrayref); }
+
+installer::ziplist::replace_variables_in_ziplist_variables($allvariablesarrayref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "allvariables2a.log" ,$allvariablesarrayref); }
+
+my $allvariableshashref = installer::converter::convert_array_to_hash($allvariablesarrayref); # the variables from the zip.lst
+if ( $installer::globals::globallogging ) { installer::files::save_hash($loggingdir . "allvariables3.log", $allvariableshashref); }
+
+installer::ziplist::set_default_productversion_if_required($allvariableshashref);
+if ( $installer::globals::globallogging ) { installer::files::save_hash($loggingdir . "allvariables3a.log", $allvariableshashref); }
+
+installer::ziplist::add_variables_to_allvariableshashref($allvariableshashref);
+if ( $installer::globals::globallogging ) { installer::files::save_hash($loggingdir . "allvariables3b.log", $allvariableshashref); }
+
+installer::ziplist::overwrite_ooovendor( $allvariableshashref );
+if ( $installer::globals::globallogging ) { installer::files::save_hash($loggingdir . "allvariables3c.log", $allvariableshashref); }
+
+
+########################################################
+# Check if this is simple packaging mechanism
+########################################################
+
+installer::simplepackage::check_simple_packager_project($allvariableshashref);
+
+####################################################################
+# setting global variables
+####################################################################
+
+installer::control::set_addchildprojects($allvariableshashref);
+installer::control::set_addjavainstaller($allvariableshashref);
+installer::control::set_addsystemintegration($allvariableshashref);
+
+########################################################
+# Re-define logging dir, after all variables are set
+########################################################
+
+my $oldloggingdir = $loggingdir;
+installer::systemactions::remove_empty_directory($oldloggingdir);
+$loggingdir = installer::systemactions::create_directories("logging", "");
+$loggingdir = $loggingdir . $installer::globals::separator;
+$installer::globals::exitlog = $loggingdir;
+
+# checking, whether this is an opensource product
+
+if (!($installer::globals::is_copy_only_project)) { installer::ziplist::set_manufacturer($allvariableshashref); }
+
+##############################################
+# Checking version of makecab.exe
+##############################################
+
+if ( $installer::globals::iswindowsbuild ) { installer::control::check_makecab_version(); }
+
+##########################################################
+# Getting the include path from the settings in zip list
+##########################################################
+
+my $includepathref = installer::ziplist::getinfofromziplist($allsettingsarrayref, "include");
+if ( $$includepathref eq "" )
+{
+ installer::exiter::exit_program("ERROR: Definition for \"include\" not found in $installer::globals::ziplistname", "Main");
+}
+
+my $includepatharrayref = installer::converter::convert_stringlist_into_array($includepathref, ",");
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "allpatharray1.log" ,$includepatharrayref); }
+
+installer::ziplist::replace_all_variables_in_pathes($includepatharrayref, $pathvariableshashref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "allpatharray2.log" ,$includepatharrayref); }
+
+installer::ziplist::replace_minor_in_pathes($includepatharrayref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "allpatharray3.log" ,$includepatharrayref); }
+
+installer::ziplist::replace_packagetype_in_pathes($includepatharrayref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "allpatharray3a.log" ,$includepatharrayref); }
+
+installer::ziplist::resolve_relative_pathes($includepatharrayref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "allpatharray3b.log" ,$includepatharrayref); }
+
+installer::ziplist::remove_ending_separator($includepatharrayref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "allpatharray3c.log" ,$includepatharrayref); }
+
+##############################################
+# Collecting all files from all include
+# pathes in global hashes.
+##############################################
+
+installer::worker::collect_all_files_from_includepathes($includepatharrayref);
+
+##############################################
+# Analyzing languages in zip.lst if required
+# Probably no longer used.
+##############################################
+
+if ($installer::globals::languages_defined_in_productlist) { installer::languages::get_info_about_languages($allsettingsarrayref); }
+
+#####################################
+# Windows requires the encoding list
+#####################################
+
+if ( $installer::globals::iswindowsbuild ) { installer::control::read_encodinglist($includepatharrayref); }
+
+#####################################################################
+# Including additional inc files for variable settings, if defined
+#####################################################################
+
+if ( $allvariableshashref->{'ADD_INCLUDE_FILES'} ) { installer::worker::add_variables_from_inc_to_hashref($allvariableshashref, $includepatharrayref); }
+
+################################################
+# Disable xpd installer, if SOLAR_JAVA not set
+################################################
+
+installer::control::check_java_for_xpd($allvariableshashref);
+
+#####################################
+# Analyzing the setup script
+#####################################
+
+if ($installer::globals::setupscript_defined_in_productlist) { installer::setupscript::set_setupscript_name($allsettingsarrayref, $includepatharrayref); }
+
+installer::logger::globallog("setup script file: $installer::globals::setupscriptname");
+
+installer::logger::print_message( "... analyzing script: $installer::globals::setupscriptname ... \n" );
+
+my $setupscriptref = installer::files::read_file($installer::globals::setupscriptname); # Reading the setup script file
+
+# Resolving variables defined in the zip list file into setup script
+# All the variables are defined in $allvariablesarrayref
+
+installer::scpzipfiles::replace_all_ziplistvariables_in_file($setupscriptref, $allvariableshashref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "setupscript1.log" ,$setupscriptref); }
+
+# Resolving %variables defined in the installation object
+
+my $allscriptvariablesref = installer::setupscript::get_all_scriptvariables_from_installation_object($setupscriptref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "setupscriptvariables1.log" ,$allscriptvariablesref); }
+
+installer::setupscript::add_lowercase_productname_setupscriptvariable($allscriptvariablesref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "setupscriptvariables2.log" ,$allscriptvariablesref); }
+
+installer::setupscript::resolve_lowercase_productname_setupscriptvariable($allscriptvariablesref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "setupscriptvariables3.log" ,$allscriptvariablesref); }
+
+$setupscriptref = installer::setupscript::replace_all_setupscriptvariables_in_script($setupscriptref, $allscriptvariablesref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "setupscript2.log" ,$setupscriptref); }
+
+# Adding all variables defined in the installation object into the hash of all variables.
+# This is needed if variables are defined in the installation object, but not in the zip list file.
+# If there is a definition in the zip list file and in the installation object, the installation object is more important
+
+installer::setupscript::add_installationobject_to_variables($allvariableshashref, $allscriptvariablesref);
+if ( $installer::globals::globallogging ) { installer::files::save_hash($loggingdir . "allvariables4.log", $allvariableshashref); }
+
+# Adding also all variables, that must be included into the $allvariableshashref.
+installer::setupscript::add_forced_properties($allvariableshashref);
+if ( $installer::globals::globallogging ) { installer::files::save_hash($loggingdir . "allvariables5.log", $allvariableshashref); }
+
+# Replacing preset properties, not using the default mechanisms (for example for UNIXPRODUCTNAME)
+installer::setupscript::replace_preset_properties($allvariableshashref);
+if ( $installer::globals::globallogging ) { installer::files::save_hash($loggingdir . "allvariables6.log", $allvariableshashref); }
+
+installer::scpzipfiles::replace_all_ziplistvariables_in_file($setupscriptref, $allvariableshashref);
+if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "setupscript3.log" ,$setupscriptref); }
+
+
+installer::logger::log_hashref($allvariableshashref);
+
+installer::logger::print_message( "... analyzing directories ... \n" );
+
+# Collect all directories in the script to get the destination dirs
+
+my $dirsinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "Directory");
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productdirectories1.log", $dirsinproductarrayref); }
+
+if ( $installer::globals::languagepack ) { installer::scriptitems::use_langpack_hostname($dirsinproductarrayref); }
+if ( $installer::globals::patch ) { installer::scriptitems::use_patch_hostname($dirsinproductarrayref); }
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productdirectories1a.log", $dirsinproductarrayref); }
+
+if ( $allvariableshashref->{'SHIFT_BASIS_INTO_BRAND_LAYER'} ) { $dirsinproductarrayref = installer::scriptitems::shift_basis_directory_parents($dirsinproductarrayref); }
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productdirectories1b.log", $dirsinproductarrayref); }
+if ( $allvariableshashref->{'OFFICEDIRECTORYNAME'} ) { installer::scriptitems::set_officedirectory_name($dirsinproductarrayref, $allvariableshashref->{'OFFICEDIRECTORYNAME'}); }
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productdirectories1b.log", $dirsinproductarrayref); }
+
+
+installer::scriptitems::resolve_all_directory_names($dirsinproductarrayref);
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productdirectories2.log", $dirsinproductarrayref); }
+
+installer::logger::print_message( "... analyzing files ... \n" );
+
+my $filesinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "File");
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles1.log", $filesinproductarrayref); }
+
+$filesinproductarrayref = installer::scriptitems::remove_delete_only_files_from_productlists($filesinproductarrayref);
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles2.log", $filesinproductarrayref); }
+
+if (( ! $installer::globals::iswindowsbuild ) &&
+ ( ! $installer::globals::islinuxrpmbuild ) &&
+ ( ! $installer::globals::islinuxdebbuild ) &&
+ ( ! $installer::globals::issolarispkgbuild ) &&
+ ( $installer::globals::packageformat ne "installed" ) &&
+ ( $installer::globals::packageformat ne "dmg" ) &&
+ ( $installer::globals::packageformat ne "archive" ))
+ { installer::control::check_oxtfiles($filesinproductarrayref); }
+
+if ($installer::globals::product =~ /suite/i ) { $filesinproductarrayref = installer::scriptitems::remove_notinsuite_files_from_productlists($filesinproductarrayref); }
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles2aa.log", $filesinproductarrayref); }
+
+if (! $installer::globals::languagepack)
+{
+ $filesinproductarrayref = installer::scriptitems::remove_Languagepacklibraries_from_Installset($filesinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles2b.log", $filesinproductarrayref); }
+}
+
+if (! $installer::globals::patch)
+{
+ $filesinproductarrayref = installer::scriptitems::remove_patchonlyfiles_from_Installset($filesinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles2c.log", $filesinproductarrayref); }
+}
+
+if (! $installer::globals::tab)
+{
+ $filesinproductarrayref = installer::scriptitems::remove_tabonlyfiles_from_Installset($filesinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles2c.log", $filesinproductarrayref); }
+}
+
+if (( $installer::globals::packageformat ne "installed" ) && ( $installer::globals::packageformat ne "archive" ))
+{
+ $filesinproductarrayref = installer::scriptitems::remove_installedproductonlyfiles_from_Installset($filesinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles2cc.log", $filesinproductarrayref); }
+}
+
+installer::logger::print_message( "... analyzing scpactions ... \n" );
+
+my $scpactionsinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "ScpAction");
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions1.log", $scpactionsinproductarrayref); }
+
+if (( ! $allvariableshashref->{'XPDINSTALLER'} ) || ( ! $installer::globals::isxpdplatform ))
+{
+ $scpactionsinproductarrayref = installer::scriptitems::remove_Xpdonly_Items($scpactionsinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions1a.log", $scpactionsinproductarrayref); }
+}
+
+if ( $installer::globals::languagepack ) { installer::scriptitems::use_langpack_copy_scpaction($scpactionsinproductarrayref); }
+if ( $installer::globals::patch ) { installer::scriptitems::use_patch_copy_scpaction($scpactionsinproductarrayref); }
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions1b.log", $scpactionsinproductarrayref); }
+
+# $scpactionsinproductarrayref = installer::scriptitems::remove_scpactions_without_name($scpactionsinproductarrayref);
+# if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions2.log", $scpactionsinproductarrayref); }
+
+installer::scriptitems::change_keys_of_scpactions($scpactionsinproductarrayref);
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions2.log", $scpactionsinproductarrayref); }
+
+installer::logger::print_message( "... analyzing shortcuts ... \n" );
+
+my $linksinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "Shortcut");
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productlinks1.log", $linksinproductarrayref); }
+
+installer::logger::print_message( "... analyzing unix links ... \n" );
+
+my $unixlinksinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "Unixlink");
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "unixlinks1.log", $unixlinksinproductarrayref); }
+
+# $unixlinksinproductarrayref = installer::scriptitems::filter_layerlinks_from_unixlinks($unixlinksinproductarrayref);
+# if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "unixlinks1b.log", $unixlinksinproductarrayref); }
+
+installer::logger::print_message( "... analyzing profile ... \n" );
+
+my $profilesinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "Profile");
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "profiles1.log", $profilesinproductarrayref); }
+
+installer::logger::print_message( "... analyzing profileitems ... \n" );
+
+my $profileitemsinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "ProfileItem");
+if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "profileitems1.log", $profileitemsinproductarrayref); }
+
+my $folderinproductarrayref;
+my $folderitemsinproductarrayref;
+my $registryitemsinproductarrayref;
+my $windowscustomactionsarrayref;
+my $mergemodulesarrayref;
+
+if ( $installer::globals::iswindowsbuild ) # Windows specific items: Folder, FolderItem, RegistryItem, WindowsCustomAction
+{
+ installer::logger::print_message( "... analyzing folders ... \n" );
+
+ $folderinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "Folder");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "folder1.log", $folderinproductarrayref); }
+
+ installer::logger::print_message( "... analyzing folderitems ... \n" );
+
+ $folderitemsinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "FolderItem");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "folderitems1.log", $folderitemsinproductarrayref); }
+
+ installer::setupscript::add_predefined_folder($folderitemsinproductarrayref, $folderinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "folder1b.log", $folderinproductarrayref); }
+
+ installer::setupscript::prepare_non_advertised_files($folderitemsinproductarrayref, $filesinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles2d.log", $filesinproductarrayref); }
+
+ installer::logger::print_message( "... analyzing registryitems ... \n" );
+
+ $registryitemsinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "RegistryItem");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "registryitems1.log", $registryitemsinproductarrayref); }
+
+ $registryitemsinproductarrayref = installer::scriptitems::remove_uninstall_regitems_from_script($registryitemsinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "registryitems1b.log", $registryitemsinproductarrayref); }
+
+ installer::logger::print_message( "... analyzing Windows custom actions ... \n" );
+
+ $windowscustomactionsarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "WindowsCustomAction");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "windowscustomactions1.log", $windowscustomactionsarrayref); }
+
+ installer::logger::print_message( "... analyzing Windows merge modules ... \n" );
+
+ $mergemodulesarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "MergeModule");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "mergemodules1.log", $mergemodulesarrayref); }
+}
+
+my $modulesinproductarrayref;
+
+if (!($installer::globals::is_copy_only_project))
+{
+ installer::logger::print_message( "... analyzing modules ... \n" );
+
+ $modulesinproductarrayref = installer::setupscript::get_all_items_from_script($setupscriptref, "Module");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "modules1.log", $modulesinproductarrayref); }
+
+ if (( ! $allvariableshashref->{'XPDINSTALLER'} ) || ( ! $installer::globals::isxpdplatform ))
+ {
+ $modulesinproductarrayref = installer::scriptitems::remove_Xpdonly_Items($modulesinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "modules1a.log", $modulesinproductarrayref); }
+ }
+
+ installer::scriptitems::resolve_assigned_modules($modulesinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "modules1b.log", $modulesinproductarrayref); }
+
+ $modulesinproductarrayref = installer::scriptitems::remove_template_modules($modulesinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "modules1c.log", $modulesinproductarrayref); }
+
+ installer::scriptitems::set_children_flag($modulesinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "modules1d.log", $modulesinproductarrayref); }
+
+ installer::scriptitems::collect_all_languagemodules($modulesinproductarrayref);
+
+ # Assigning the modules to the items
+
+ installer::scriptitems::assigning_modules_to_items($modulesinproductarrayref, $filesinproductarrayref, "Files");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles3.log", $filesinproductarrayref); }
+
+ installer::scriptitems::assigning_modules_to_items($modulesinproductarrayref, $unixlinksinproductarrayref, "Unixlinks");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "unixlinks2.log", $unixlinksinproductarrayref); }
+
+ installer::scriptitems::assigning_modules_to_items($modulesinproductarrayref, $dirsinproductarrayref, "Dirs");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productdirectories2aa.log", $dirsinproductarrayref); }
+}
+
+if ( $installer::globals::debug ) { installer::logger::debuginfo("\nEnd of part 1a: The language independent part\n"); }
+
+# saving debug info, before staring part 1b
+if ( $installer::globals::debug ) { installer::logger::savedebug($installer::globals::exitlog); }
+
+#################################################
+# Part 1b: The language dependent part
+# (still platform independent)
+#################################################
+
+# Now starts the language dependent part, if more than one product is defined on the command line
+# Example -l en-US,de#es,fr,it defines two multilingual products
+
+###############################################################################
+# Beginning of language dependent part
+# The for iterates over all products, separated by an # in the language list
+###############################################################################
+
+if ( $installer::globals::debug ) { installer::logger::debuginfo("\nPart 1b: The language dependent part\n"); }
+
+for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ )
+{
+ my $languagesarrayref = installer::languages::get_all_languages_for_one_product($installer::globals::languageproducts[$n], $allvariableshashref);
+ if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "languages.log" ,$languagesarrayref); }
+
+ $installer::globals::alllanguagesinproductarrayref = $languagesarrayref;
+ my $languagestringref = installer::languages::get_language_string($languagesarrayref);
+ installer::logger::print_message( "------------------------------------\n" );
+ installer::logger::print_message( "... languages $$languagestringref ... \n" );
+
+ if ( $installer::globals::patch )
+ {
+ $installer::globals::addlicensefile = 0; # no license files for patches
+ $installer::globals::makedownload = 0;
+ $installer::globals::makejds = 0;
+ }
+
+ if ( $installer::globals::languagepack )
+ {
+ $installer::globals::addchildprojects = 0;
+ $installer::globals::addsystemintegration = 0;
+ $installer::globals::makejds = 0;
+ $installer::globals::addlicensefile = 0;
+
+ if ( $allvariableshashref->{'OPENSOURCE'} ) { $installer::globals::makedownload = 1; }
+ else { $installer::globals::makedownload = 0; }
+ }
+
+ ############################################################
+ # Beginning of language specific logging mechanism
+ # Until now only global logging into default: logfile.txt
+ ############################################################
+
+ @installer::globals::logfileinfo = (); # new logfile array and new logfile name
+ installer::logger::copy_globalinfo_into_logfile();
+ $installer::globals::globalinfo_copied = 1;
+
+ my $logminor = "";
+ if ( $installer::globals::updatepack ) { $logminor = $installer::globals::lastminor; }
+ else { $logminor = $installer::globals::minor; }
+
+ my $loglanguagestring = $$languagestringref;
+ my $loglanguagestring_orig = $loglanguagestring;
+ if (length($loglanguagestring) > $installer::globals::max_lang_length)
+ {
+ my $number_of_languages = installer::systemactions::get_number_of_langs($loglanguagestring);
+ chomp(my $shorter = `echo $loglanguagestring | md5sum | sed -e "s/ .*//g"`);
+ my $id = substr($shorter, 0, 8); # taking only the first 8 digits
+ $loglanguagestring = "lang_" . $number_of_languages . "_id_" . $id;
+ }
+
+ $installer::globals::logfilename = "log_" . $installer::globals::build;
+ if ( $logminor ne "" ) { $installer::globals::logfilename .= "_" . $logminor; }
+ $installer::globals::logfilename .= "_" . $loglanguagestring;
+ $installer::globals::logfilename .= ".log";
+ $loggingdir = $loggingdir . $loglanguagestring . $installer::globals::separator;
+ installer::systemactions::create_directory($loggingdir);
+
+ if ($loglanguagestring ne $loglanguagestring_orig) {
+ (my $dir = $loggingdir) =~ s!/$!!;
+ open(my $F1, "> $dir.dir");
+ open(my $F2, "> " . $loggingdir . $installer::globals::logfilename . '.file');
+ my @s = map { "$_\n" } split('_', $loglanguagestring_orig);
+ print $F1 @s;
+ print $F2 @s;
+ }
+
+ $installer::globals::exitlog = $loggingdir;
+
+ ##############################################################
+ # Determining the ship location, if this is an update pack
+ ##############################################################
+
+ if ( $installer::globals::updatepack ) { $shipinstalldir = installer::control::determine_ship_directory($languagestringref); }
+
+ ###################################################################
+ # Reading an existing msi database, to prepare update and patch
+ ###################################################################
+
+ my $refdatabase = "";
+ my $uniquefilename = "";
+ my $revuniquefilename = "";
+ my $revshortfilename = "";
+ my $allupdatesequences = "";
+ my $allupdatecomponents = "";
+ my $allupdatefileorder = "";
+ my $allupdatecomponentorder = "";
+ my $shortdirname = "";
+ my $componentid = "";
+ my $componentidkeypath = "";
+ my $alloldproperties = "";
+ my $allupdatelastsequences = "";
+ my $allupdatediskids = "";
+
+ if ( $installer::globals::iswindowsbuild )
+ {
+ if ( $allvariableshashref->{'UPDATE_DATABASE'} )
+ {
+ installer::logger::print_message( "... analyzing update database ...\n" );
+ $refdatabase = installer::windows::update::readdatabase($allvariableshashref, $languagestringref, $includepatharrayref);
+
+ if ( $installer::globals::updatedatabase )
+ {
+ ($uniquefilename, $revuniquefilename, $revshortfilename, $allupdatesequences, $allupdatecomponents, $allupdatefileorder, $allupdatecomponentorder, $shortdirname, $componentid, $componentidkeypath, $alloldproperties, $allupdatelastsequences, $allupdatediskids) = installer::windows::update::create_database_hashes($refdatabase);
+ if ( $mergemodulesarrayref > -1 ) { installer::windows::update::readmergedatabase($mergemodulesarrayref, $languagestringref, $includepatharrayref); }
+ }
+ }
+ }
+
+ ##############################################
+ # Setting global code variables for Windows
+ ##############################################
+
+ if (!($installer::globals::is_copy_only_project))
+ {
+ if (( $installer::globals::iswindowsbuild ) && ( $installer::globals::packageformat ne "archive" ) && ( $installer::globals::packageformat ne "installed" ))
+ {
+ installer::windows::msiglobal::set_global_code_variables($languagesarrayref, $languagestringref, $allvariableshashref, $alloldproperties);
+ }
+ }
+
+ ################################################
+ # Resolving include paths (language dependent)
+ ################################################
+
+ $includepatharrayref_lang = installer::ziplist::replace_languages_in_pathes($includepatharrayref, $languagesarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "allpatharray4.log" ,$includepatharrayref_lang); }
+
+ if ( $installer::globals::refresh_includepathes ) { installer::worker::collect_all_files_from_includepathes($includepatharrayref_lang); }
+
+ installer::ziplist::list_all_files_from_include_path($includepatharrayref_lang);
+
+ ##############################################
+ # Analyzing spellchecker languages
+ ##############################################
+
+ if ( $allvariableshashref->{'SPELLCHECKERFILE'} ) { installer::worker::set_spellcheckerlanguages($languagesarrayref, $allvariableshashref); }
+
+ #####################################
+ # Language dependent directory part
+ #####################################
+
+ my $dirsinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($dirsinproductarrayref, $languagesarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productdirectories3.log", $dirsinproductlanguageresolvedarrayref); }
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productdirectories2a.log", $dirsinproductarrayref); }
+
+ # A new directory array is needed ($dirsinproductlanguageresolvedarrayref instead of $dirsinproductarrayref)
+ # because $dirsinproductarrayref is needed in get_Destination_Directory_For_Item_From_Directorylist
+
+ installer::scriptitems::changing_name_of_language_dependent_keys($dirsinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productdirectories4.log", $dirsinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::checking_directories_with_corrupt_hostname($dirsinproductlanguageresolvedarrayref, $languagesarrayref);
+
+ installer::scriptitems::set_global_directory_hostnames($dirsinproductlanguageresolvedarrayref, $allvariableshashref);
+
+ #####################################
+ # files part, language dependent
+ #####################################
+
+ installer::logger::print_message( "... analyzing files ...\n" );
+
+ my $filesinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($filesinproductarrayref, $languagesarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles4.log", $filesinproductlanguageresolvedarrayref); }
+
+ if ( ! $installer::globals::set_office_start_language )
+ {
+ $filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_office_start_language_files($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles4b.log", $filesinproductlanguageresolvedarrayref); }
+ }
+
+ installer::scriptitems::changing_name_of_language_dependent_keys($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles5.log", $filesinproductlanguageresolvedarrayref); }
+
+ if ( $installer::globals::iswin and $^O =~ /MSWin/i ) { installer::converter::convert_slash_to_backslash($filesinproductlanguageresolvedarrayref); }
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles6.log", $filesinproductlanguageresolvedarrayref); }
+
+ $filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_non_existent_languages_in_productlists($filesinproductlanguageresolvedarrayref, $languagestringref, "Name", "file");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles7.log", $filesinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist($filesinproductlanguageresolvedarrayref, $dirsinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles8.log", $filesinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist($filesinproductlanguageresolvedarrayref, $includepatharrayref_lang, $dirsinproductlanguageresolvedarrayref, "Files");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles9.log", $filesinproductlanguageresolvedarrayref); }
+
+ $filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_Files_Without_Sourcedirectory($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles10.log", $filesinproductlanguageresolvedarrayref); }
+
+ if ($installer::globals::languagepack)
+ {
+ $filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_Files_For_Languagepacks($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles10c.log", $filesinproductlanguageresolvedarrayref); }
+ }
+
+
+ if ( ! $allvariableshashref->{'NO_README_IN_ROOTDIR'} )
+ {
+ $filesinproductlanguageresolvedarrayref = installer::scriptitems::add_License_Files_into_Installdir($filesinproductlanguageresolvedarrayref, $dirsinproductlanguageresolvedarrayref, $languagesarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles10b.log", $filesinproductlanguageresolvedarrayref); }
+ }
+
+ $filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_onlyasialanguage_files_from_productlists($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles10d.log", $filesinproductlanguageresolvedarrayref); }
+
+ $filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_onlywesternlanguage_files_from_productlists($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles10e.log", $filesinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::make_filename_language_specific($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles10f.log", $filesinproductlanguageresolvedarrayref); }
+
+ # print "... calculating checksums ...\n";
+ # my $checksumfile = installer::worker::make_checksum_file($filesinproductlanguageresolvedarrayref, $includepatharrayref);
+ # if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . $installer::globals::checksumfilename, $checksumfile); }
+
+ ######################################################################################
+ # Unzipping files with flag ARCHIVE and putting all included files into the file list
+ ######################################################################################
+
+ installer::logger::print_message( "... analyzing files with flag ARCHIVE ...\n" );
+
+ my @additional_paths_from_zipfiles = ();
+
+ $filesinproductlanguageresolvedarrayref = installer::archivefiles::resolving_archive_flag($filesinproductlanguageresolvedarrayref, \@additional_paths_from_zipfiles, $languagestringref, $loggingdir);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles11.log", $filesinproductlanguageresolvedarrayref); }
+ if ( $installer::globals::globallogging ) { installer::files::save_file($loggingdir . "additional_paths.log" ,\@additional_paths_from_zipfiles); }
+
+ # packed files sometimes contain a "$" in their name: HighlightText$1.class. For epm the "$" has to be quoted by "$$"
+
+ if (!( $installer::globals::iswindowsbuild || $installer::globals::simple ) )
+ {
+ installer::scriptitems::quoting_illegal_filenames($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles12.log", $filesinproductlanguageresolvedarrayref); }
+ }
+
+ #####################################
+ # Files with flag SUBST_FILENAME
+ #####################################
+
+ installer::logger::print_message( "... analyzing files with flag SUBST_FILENAME ...\n" );
+
+ installer::substfilenamefiles::resolving_subst_filename_flag($filesinproductlanguageresolvedarrayref, $allvariableshashref, $languagestringref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles12d.log", $filesinproductlanguageresolvedarrayref); }
+
+ #####################################
+ # Files with flag SCPZIP_REPLACE
+ #####################################
+
+ installer::logger::print_message( "... analyzing files with flag SCPZIP_REPLACE ...\n" );
+
+ # Editing files with flag SCPZIP_REPLACE.
+
+ installer::scpzipfiles::resolving_scpzip_replace_flag($filesinproductlanguageresolvedarrayref, $allvariableshashref, "File", $languagestringref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles13.log", $filesinproductlanguageresolvedarrayref); }
+
+ #####################################
+ # Files with flag PATCH_SO_NAME
+ #####################################
+
+ installer::logger::print_message( "... analyzing files with flag PATCH_SO_NAME ...\n" );
+
+ # Editing files with flag PATCH_SO_NAME.
+
+ installer::scppatchsoname::resolving_patchsoname_flag($filesinproductlanguageresolvedarrayref, $allvariableshashref, "File", $languagestringref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles13b.log", $filesinproductlanguageresolvedarrayref); }
+
+ #####################################
+ # Files with flag HIDDEN
+ #####################################
+
+ installer::logger::print_message( "... analyzing files with flag HIDDEN ...\n" );
+
+ installer::worker::resolving_hidden_flag($filesinproductlanguageresolvedarrayref, $allvariableshashref, "File", $languagestringref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles13c.log", $filesinproductlanguageresolvedarrayref); }
+
+ ############################################
+ # Collecting directories for epm list file
+ ############################################
+
+ installer::logger::print_message( "... analyzing all directories for this product ...\n" );
+
+ # There are two ways for a directory to be included into the epm directory list:
+ # 1. Looking for all destination paths in the files array
+ # 2. Looking for directories with CREATE flag in the directory array
+ # Advantage: Many pathes are hidden in zip files, they are not defined in the setup script.
+ # It will be possible, that in the setup script only those directoies have to be defined,
+ # that have a CREATE flag. All other directories are created, if they contain at least one file.
+
+ my ($directoriesforepmarrayref, $alldirectoryhash) = installer::scriptitems::collect_directories_from_filesarray($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist1.log", $directoriesforepmarrayref); }
+
+ ($directoriesforepmarrayref, $alldirectoryhash) = installer::scriptitems::collect_directories_with_create_flag_from_directoryarray($dirsinproductlanguageresolvedarrayref, $alldirectoryhash);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist2.log", $directoriesforepmarrayref); }
+
+ # installer::sorter::sorting_array_of_hashes($directoriesforepmarrayref, "HostName");
+ # if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist3.log", $directoriesforepmarrayref); }
+
+ #########################################################
+ # language dependent scpactions part
+ #########################################################
+
+ my $scpactionsinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($scpactionsinproductarrayref, $languagesarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions3.log", $scpactionsinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::changing_name_of_language_dependent_keys($scpactionsinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions4.log", $scpactionsinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist($scpactionsinproductlanguageresolvedarrayref, $includepatharrayref_lang, $dirsinproductlanguageresolvedarrayref, "ScpActions");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions5.log", $scpactionsinproductlanguageresolvedarrayref); }
+
+ # Editing scpactions with flag SCPZIP_REPLACE and PATCH_SO_NAME.
+
+ installer::scpzipfiles::resolving_scpzip_replace_flag($scpactionsinproductlanguageresolvedarrayref, $allvariableshashref, "ScpAction", $languagestringref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions6.log", $scpactionsinproductlanguageresolvedarrayref); }
+
+ installer::scppatchsoname::resolving_patchsoname_flag($scpactionsinproductlanguageresolvedarrayref, $allvariableshashref, "ScpAction", $languagestringref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions6a.log", $scpactionsinproductlanguageresolvedarrayref); }
+
+ #########################################################
+ # language dependent links part
+ #########################################################
+
+ installer::logger::print_message( "... analyzing links ...\n" );
+
+ my $linksinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($linksinproductarrayref, $languagesarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productlinks2.log", $linksinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::changing_name_of_language_dependent_keys($linksinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productlinks3.log", $linksinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::get_destination_file_path_for_links($linksinproductlanguageresolvedarrayref, $filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productlinks4.log", $linksinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist($linksinproductlanguageresolvedarrayref, $dirsinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productlinks5.log", $linksinproductlanguageresolvedarrayref); }
+
+ # Now taking all links that have no FileID but a ShortcutID, linking to another link
+
+ installer::scriptitems::get_destination_link_path_for_links($linksinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productlinks6.log", $linksinproductlanguageresolvedarrayref); }
+
+ $linksinproductlanguageresolvedarrayref = installer::scriptitems::remove_workstation_only_items($linksinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productlinks7.log", $linksinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::resolve_links_with_flag_relative($linksinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productlinks8.log", $linksinproductlanguageresolvedarrayref); }
+
+ #########################################################
+ # language dependent unix links part
+ #########################################################
+
+ installer::logger::print_message( "... analyzing unix links ...\n" );
+
+ my $unixlinksinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($unixlinksinproductarrayref, $languagesarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "unixlinks3.log", $unixlinksinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::changing_name_of_language_dependent_keys($unixlinksinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "unixlinks4.log", $unixlinksinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist($unixlinksinproductlanguageresolvedarrayref, $dirsinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "unixlinks5.log", $unixlinksinproductlanguageresolvedarrayref); }
+
+ #########################################################
+ # language dependent part for profiles and profileitems
+ #########################################################
+
+ my $profilesinproductlanguageresolvedarrayref;
+ my $profileitemsinproductlanguageresolvedarrayref;
+
+ if ((!($installer::globals::is_copy_only_project)) && (!($installer::globals::product =~ /ada/i )) && (!($installer::globals::languagepack)))
+ {
+ installer::logger::print_message( "... creating profiles ...\n" );
+
+ $profilesinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($profilesinproductarrayref, $languagesarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "profiles2.log", $profilesinproductlanguageresolvedarrayref); }
+
+ $profileitemsinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($profileitemsinproductarrayref, $languagesarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "profileitems2.log", $profilesinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::changing_name_of_language_dependent_keys($profilesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "profiles3.log", $profilesinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::changing_name_of_language_dependent_keys($profileitemsinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "profileitems3.log", $profileitemsinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::replace_setup_variables($profileitemsinproductlanguageresolvedarrayref, $languagestringref, $allvariableshashref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "profileitems4.log", $profileitemsinproductlanguageresolvedarrayref); }
+
+ if ( $installer::globals::patch_user_dir )
+ {
+ installer::scriptitems::replace_userdir_variable($profileitemsinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "profileitems4a.log", $profileitemsinproductlanguageresolvedarrayref); }
+ }
+
+ installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist($profilesinproductlanguageresolvedarrayref, $dirsinproductarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "profiles4.log", $profilesinproductlanguageresolvedarrayref); }
+
+ # Now the Profiles can be created
+
+ installer::profiles::create_profiles($profilesinproductlanguageresolvedarrayref, $profileitemsinproductlanguageresolvedarrayref, $filesinproductlanguageresolvedarrayref, $languagestringref, $allvariableshashref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles15.log", $filesinproductlanguageresolvedarrayref); }
+ }
+
+ my $registryitemsinproductlanguageresolvedarrayref; # cannot be defined in the following "if ( $installer::globals::iswindowsbuild )"
+ my $folderinproductlanguageresolvedarrayref; # cannot be defined in the following "if ( $installer::globals::iswindowsbuild )"
+ my $folderitemsinproductlanguageresolvedarrayref; # cannot be defined in the following "if ( $installer::globals::iswindowsbuild )"
+
+ if ( $installer::globals::iswindowsbuild ) # Windows specific items: Folder, FolderItem, RegistryItem
+ {
+ #########################################################
+ # language dependent part for folder
+ #########################################################
+
+ installer::logger::print_message( "... analyzing folder ...\n" );
+
+ $folderinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($folderinproductarrayref, $languagesarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "folder2.log", $folderinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::changing_name_of_language_dependent_keys($folderinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "folder3.log", $folderinproductlanguageresolvedarrayref); }
+
+ #########################################################
+ # language dependent part for folderitems
+ #########################################################
+
+ installer::logger::print_message( "... analyzing folderitems ...\n" );
+
+ $folderitemsinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($folderitemsinproductarrayref, $languagesarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "folderitems2.log", $folderitemsinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::changing_name_of_language_dependent_keys($folderitemsinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "folderitems3.log", $folderitemsinproductlanguageresolvedarrayref); }
+
+ #########################################################
+ # language dependent part for registryitems
+ #########################################################
+
+ installer::logger::print_message( "... analyzing registryitems ...\n" );
+
+ $registryitemsinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($registryitemsinproductarrayref, $languagesarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "registryitems2.log", $registryitemsinproductlanguageresolvedarrayref); }
+
+ installer::scriptitems::changing_name_of_language_dependent_keys($registryitemsinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "registryitems3.log", $registryitemsinproductlanguageresolvedarrayref); }
+ }
+
+ #########################################################
+ # language dependent part for modules
+ #########################################################
+
+ my $modulesinproductlanguageresolvedarrayref;
+
+ if (!($installer::globals::is_copy_only_project))
+ {
+ installer::logger::print_message( "... analyzing modules ...\n" );
+
+ $modulesinproductlanguageresolvedarrayref = installer::scriptitems::resolving_all_languages_in_productlists($modulesinproductarrayref, $languagesarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes_modules($loggingdir . "modules2.log", $modulesinproductlanguageresolvedarrayref); }
+
+ $modulesinproductlanguageresolvedarrayref = installer::scriptitems::remove_not_required_language_modules($modulesinproductlanguageresolvedarrayref, $languagesarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes_modules($loggingdir . "modules2a.log", $modulesinproductlanguageresolvedarrayref); }
+
+ if ( $installer::globals::analyze_spellcheckerlanguage )
+ {
+ $modulesinproductlanguageresolvedarrayref = installer::scriptitems::remove_not_required_spellcheckerlanguage_modules($modulesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes_modules($loggingdir . "modules3.log", $modulesinproductlanguageresolvedarrayref); }
+
+ $filesinproductlanguageresolvedarrayref = installer::scriptitems::remove_not_required_spellcheckerlanguage_files($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles15b.log", $filesinproductlanguageresolvedarrayref); }
+ }
+
+ installer::scriptitems::changing_name_of_language_dependent_keys($modulesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes_modules($loggingdir . "modules3a.log", $modulesinproductlanguageresolvedarrayref); }
+
+ # installer::scriptitems::collect_language_specific_names($modulesinproductlanguageresolvedarrayref);
+ installer::scriptitems::select_required_language_strings($modulesinproductlanguageresolvedarrayref); # using english strings
+
+ }
+
+ # Copy-only projects can now start to copy all items File and ScpAction
+ if ( $installer::globals::is_copy_only_project ) { installer::copyproject::copy_project($filesinproductlanguageresolvedarrayref, $scpactionsinproductlanguageresolvedarrayref, $loggingdir, $languagestringref, $shipinstalldir, $allsettingsarrayref); }
+
+ # Language pack projects can now start to select the required information
+ if ( $installer::globals::languagepack )
+ {
+ $filesinproductlanguageresolvedarrayref = installer::languagepack::select_language_items($filesinproductlanguageresolvedarrayref, $languagesarrayref, "File");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles16b.log", $filesinproductlanguageresolvedarrayref); }
+ $scpactionsinproductlanguageresolvedarrayref = installer::languagepack::select_language_items($scpactionsinproductlanguageresolvedarrayref, $languagesarrayref, "ScpAction");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions6b.log", $scpactionsinproductlanguageresolvedarrayref); }
+ $linksinproductlanguageresolvedarrayref = installer::languagepack::select_language_items($linksinproductlanguageresolvedarrayref, $languagesarrayref, "Shortcut");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productlinks8b.log", $linksinproductlanguageresolvedarrayref); }
+ $unixlinksinproductlanguageresolvedarrayref = installer::languagepack::select_language_items($unixlinksinproductlanguageresolvedarrayref, $languagesarrayref, "Unixlink");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "unixlinks5.log", $unixlinksinproductlanguageresolvedarrayref); }
+ @{$folderitemsinproductlanguageresolvedarrayref} = (); # no folderitems in languagepacks
+
+ # Collecting the directories again, to include only the language specific directories
+ ($directoriesforepmarrayref, $alldirectoryhash) = installer::scriptitems::collect_directories_from_filesarray($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist3alangpack.log", $directoriesforepmarrayref); }
+ ($directoriesforepmarrayref, $alldirectoryhash) = installer::scriptitems::collect_directories_with_create_flag_from_directoryarray($dirsinproductlanguageresolvedarrayref, $alldirectoryhash);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist3blangpack.log", $directoriesforepmarrayref); }
+ installer::sorter::sorting_array_of_hashes($directoriesforepmarrayref, "HostName");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist3clangpack.log", $directoriesforepmarrayref); }
+
+ if ( $installer::globals::iswindowsbuild )
+ {
+ $registryitemsinproductlanguageresolvedarrayref = installer::worker::select_langpack_items($registryitemsinproductlanguageresolvedarrayref, "RegistryItem");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "registryitems3aa.log", $registryitemsinproductlanguageresolvedarrayref); }
+ }
+
+ }
+
+ # Collecting all files without flag PATCH (for maintenance reasons)
+ if ( $installer::globals::patch ) { installer::worker::collect_all_files_without_patch_flag($filesinproductlanguageresolvedarrayref); }
+
+ # Patch projects can now start to select the required information
+ if (( $installer::globals::patch ) && (( $installer::globals::issolarispkgbuild ) || ( $installer::globals::iswindowsbuild )))
+ {
+ $filesinproductlanguageresolvedarrayref = installer::worker::select_patch_items($filesinproductlanguageresolvedarrayref, "File");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles16patch.log", $filesinproductlanguageresolvedarrayref); }
+ $scpactionsinproductlanguageresolvedarrayref = installer::worker::select_patch_items($scpactionsinproductlanguageresolvedarrayref, "ScpAction");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions6patch.log", $scpactionsinproductlanguageresolvedarrayref); }
+ $linksinproductlanguageresolvedarrayref = installer::worker::select_patch_items($linksinproductlanguageresolvedarrayref, "Shortcut");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productlinks8patch.log", $linksinproductlanguageresolvedarrayref); }
+ $unixlinksinproductlanguageresolvedarrayref = installer::worker::select_patch_items($unixlinksinproductlanguageresolvedarrayref, "Unixlink");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "unixlinks6patch.log", $unixlinksinproductlanguageresolvedarrayref); }
+ $folderitemsinproductlanguageresolvedarrayref = installer::worker::select_patch_items($folderitemsinproductlanguageresolvedarrayref, "FolderItem");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfolderitems1patch.log", $folderitemsinproductlanguageresolvedarrayref); }
+ # @{$folderitemsinproductlanguageresolvedarrayref} = (); # no folderitems in languagepacks
+
+ if ( $installer::globals::iswindowsbuild )
+ {
+ $registryitemsinproductlanguageresolvedarrayref = installer::worker::select_patch_items_without_name($registryitemsinproductlanguageresolvedarrayref, "RegistryItem");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "registryitems3a.log", $registryitemsinproductlanguageresolvedarrayref); }
+
+ installer::worker::prepare_windows_patchfiles($filesinproductlanguageresolvedarrayref, $languagestringref, $allvariableshashref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles16bpatch.log", $filesinproductlanguageresolvedarrayref); }
+
+ # For Windows patches, the directories can now be collected again
+ ($directoriesforepmarrayref, $alldirectoryhash) = installer::scriptitems::collect_directories_from_filesarray($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist4_patch.log", $directoriesforepmarrayref); }
+
+ installer::sorter::sorting_array_of_hashes($directoriesforepmarrayref, "HostName");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist5_patch.log", $directoriesforepmarrayref); }
+ }
+ }
+
+ #########################################################
+ # Collecting all scp actions
+ #########################################################
+
+ installer::worker::collect_scpactions($scpactionsinproductlanguageresolvedarrayref);
+
+ #########################################################
+ # creating inf files for user system integration
+ #########################################################
+
+ if (( $installer::globals::iswindowsbuild ) && ( ! $installer::globals::patch )) # Windows specific items: Folder, FolderItem, RegistryItem
+ {
+ installer::logger::print_message( "... creating inf files ...\n" );
+ installer::worker::create_inf_file($filesinproductlanguageresolvedarrayref, $registryitemsinproductlanguageresolvedarrayref, $folderinproductlanguageresolvedarrayref, $folderitemsinproductlanguageresolvedarrayref, $modulesinproductlanguageresolvedarrayref, $languagesarrayref, $languagestringref, $allvariableshashref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles16c.log", $filesinproductlanguageresolvedarrayref); }
+ }
+
+ ###########################################
+ # Using upx, to decrease file size
+ # Currently only for Windows.
+ ###########################################
+
+ if ( $allvariableshashref->{'UPXPRODUCT'} )
+ {
+ installer::upx::upx_on_libraries($filesinproductlanguageresolvedarrayref, $languagestringref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles16d.log", $filesinproductlanguageresolvedarrayref); }
+ }
+
+ ###########################################################
+ # Simple package projects can now start to create the
+ # installation structure by creating Directories, Files
+ # Links and ScpActions. This is the last platform
+ # independent part.
+ ###########################################################
+
+ if ( $installer::globals::is_simple_packager_project )
+ {
+ installer::simplepackage::create_simple_package($filesinproductlanguageresolvedarrayref, $directoriesforepmarrayref, $scpactionsinproductlanguageresolvedarrayref, $linksinproductlanguageresolvedarrayref, $unixlinksinproductlanguageresolvedarrayref, $loggingdir, $languagestringref, $shipinstalldir, $allsettingsarrayref, $allvariableshashref, $includepatharrayref);
+ next; # ! leaving the current loop, because no further packaging required.
+ }
+
+ ###########################################################
+ # Analyzing the package structure
+ ###########################################################
+
+ installer::logger::print_message( "... analyzing package list ...\n" );
+
+ my $packages = installer::packagelist::collectpackages($modulesinproductlanguageresolvedarrayref, $languagesarrayref);
+ installer::packagelist::check_packagelist($packages);
+
+ $packages = installer::packagelist::analyze_list($packages, $modulesinproductlanguageresolvedarrayref);
+ installer::packagelist::remove_multiple_modules_packages($packages);
+
+ # printing packages content:
+ installer::packagelist::log_packages_content($packages);
+ installer::packagelist::create_module_destination_hash($packages, $allvariableshashref);
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("\nEnd of part 1b: The language dependent part\n"); }
+
+ # saving debug info, before starting part 2
+ if ( $installer::globals::debug ) { installer::logger::savedebug($installer::globals::exitlog); }
+
+ #################################################
+ # Part 2: The platform dependent part
+ #################################################
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("\nPart 2: The platform dependent part\n"); }
+
+ #################################################
+ # Part 2a: All non-Windows platforms
+ #################################################
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("\nPart 2a: All non-Windows platforms\n"); }
+
+ #########################################################
+ # ... creating epm list file ...
+ # Only for non-Windows platforms
+ #########################################################
+
+ if (!( $installer::globals::iswindowsbuild ))
+ {
+ ####################################################
+ # Writing log file before packages are packed
+ ####################################################
+
+ installer::logger::print_message( "... creating log file " . $loggingdir . $installer::globals::logfilename . "\n" );
+ installer::files::save_file($loggingdir . $installer::globals::logfilename, \@installer::globals::logfileinfo);
+
+ ####################################################
+ # Creating directories
+ ####################################################
+
+ $installdir = installer::worker::create_installation_directory($shipinstalldir, $languagestringref, \$current_install_number);
+
+ my $listfiledir = installer::systemactions::create_directories("listfile", $languagestringref);
+ my $installlogdir = installer::systemactions::create_directory_next_to_directory($installdir, "log");
+ # installer::packagelist::add_defaultpathes_into_filescollector($filesinproductlanguageresolvedarrayref);
+ # my $installchecksumdir = installer::systemactions::create_directory_next_to_directory($installdir, "checksum");
+
+ ####################################################
+ # Reading for Solaris all package descriptions
+ # from file defined in property PACKAGEMAP
+ ####################################################
+
+ if ( $installer::globals::issolarisbuild ) { installer::epmfile::read_packagemap($allvariableshashref, $includepatharrayref, $languagesarrayref); }
+
+ my $epmexecutable = "";
+ my $found_epm = 0;
+
+ # shuffle array to reduce parallel packaging process in pool
+ installer::worker::shuffle_array($packages);
+
+ # iterating over all packages
+ for ( my $k = 0; $k <= $#{$packages}; $k++ )
+ {
+ my $onepackage = ${$packages}[$k];
+
+ # checking, if this is a language pack or a project pack.
+ # Creating language packs only, if $installer::globals::languagepack is set. Parameter: -languagepack
+
+ if ( $installer::globals::languagepack ) { installer::languagepack::replace_languagestring_variable($onepackage, $languagestringref); }
+
+ my $onepackagename = $onepackage->{'module'}; # name of the top module (required)
+
+ my $shellscriptsfilename = "";
+ if ( $onepackage->{'script'} ) { $shellscriptsfilename = $onepackage->{'script'}; }
+ # no scripts for Solaris patches!
+ if (( $installer::globals::patch ) && ( $installer::globals::issolarispkgbuild )) { $shellscriptsfilename = ""; }
+
+ ###########################
+ # package name
+ ###########################
+
+ my $packagename = "";
+
+ if ( $installer::globals::issolarisbuild ) # only for Solaris
+ {
+ if ( $onepackage->{'solarispackagename'} ) { $packagename = $onepackage->{'solarispackagename'}; }
+ }
+ else # not Solaris
+ {
+ if ( $onepackage->{'packagename'} ) { $packagename = $onepackage->{'packagename'}; }
+ }
+
+ if (!($packagename eq ""))
+ {
+ installer::packagelist::resolve_packagevariables(\$packagename, $allvariableshashref, 0);
+ }
+
+ # Debian allows no underline in package name
+ if ( $installer::globals::debian ) { $packagename =~ s/_/-/g; }
+
+ # Debian allows no underline in package name
+ if ( $installer::globals::debian ) { $packagename =~ s/_/-/g; }
+
+ my $linkaddon = "";
+ my $linkpackage = 0;
+ $installer::globals::add_required_package = "";
+ $installer::globals::linuxlinkrpmprocess = 0;
+
+ if ( $installer::globals::makelinuxlinkrpm )
+ {
+ my $oldpackagename = $packagename;
+ $installer::globals::add_required_package = $oldpackagename; # the link rpm requires the non-linked version
+ if ( $installer::globals::languagepack ) { $packagename = $packagename . "_u"; }
+ else { $packagename = $packagename . "u"; }
+ my $savestring = $oldpackagename . "\t" . $packagename;
+ push(@installer::globals::linkrpms, $savestring);
+ $linkaddon = "_links";
+ $installer::globals::linuxlinkrpmprocess = 1;
+ $linkpackage = 1;
+ }
+
+ ####################################################
+ # Header for this package into log file
+ ####################################################
+
+ installer::logger::include_header_into_logfile("Creating package: $packagename ($k)");
+
+ ####################################################
+ # Pool check: If package is created at the moment
+ # try it again later.
+ ####################################################
+
+ if (( $installer::globals::patch ) ||
+ ( $installer::globals::languagepack ) ||
+ ( $installer::globals::packageformat eq "native" ) ||
+ ( $installer::globals::packageformat eq "portable" ) ||
+ ( $installer::globals::packageformat eq "osx" )) { $allvariableshashref->{'POOLPRODUCT'} = 0; }
+
+ if ( $allvariableshashref->{'POOLPRODUCT'} )
+ {
+ if ( ! $installer::globals::sessionidset ) { installer::packagepool::set_sessionid(); }
+ if ( ! $installer::globals::poolpathset ) { installer::packagepool::set_pool_path(); }
+ if (( ! $installer::globals::getuidpathset ) && ( $installer::globals::issolarisbuild )) { installer::worker::set_getuid_path($includepatharrayref); }
+
+ my $package_is_creatable = installer::packagepool::check_package_availability($packagename);
+
+ if (( ! $package_is_creatable ) && ( ! exists($installer::globals::poolshiftedpackages{$packagename}) ))
+ {
+ splice(@{$packages}, $k, 1); # removing package ...
+ push(@{$packages}, $onepackage); # ... and adding it to the end
+ $installer::globals::poolshiftedpackages{$packagename} = 1; # only shifting each package once
+ $k--; # decreasing the counter
+ my $localinfoline = "Pool: Package \"$packagename\" cannot be created at the moment. Trying again later (1).\n";
+ installer::logger::print_message($localinfoline);
+ push( @installer::globals::logfileinfo, $localinfoline);
+ next; # repeating this iteration with new package
+ }
+ }
+
+ ###########################################
+ # Root path, can be defined as parameter
+ ###########################################
+
+ my $packagerootpath = "";
+
+ if ($installer::globals::rootpath eq "")
+ {
+ $packagerootpath = $onepackage->{'destpath'};
+ installer::packagelist::resolve_packagevariables(\$packagerootpath, $allvariableshashref, 1);
+ if ( $^O =~ /darwin/i ) { $packagerootpath =~ s/\/opt\//\/Applications\//; }
+ }
+ else
+ {
+ $packagerootpath = $installer::globals::rootpath;
+ }
+
+ #############################################
+ # copying the collectors for each package
+ #############################################
+
+ my $filesinpackage = installer::converter::copy_collector($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "files1_" . $packagename . ".log", $filesinpackage); }
+ my $linksinpackage = installer::converter::copy_collector($linksinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "links1_" . $packagename . ".log", $linksinpackage); }
+ my $unixlinksinpackage = installer::converter::copy_collector($unixlinksinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "unixlinks1_" . $packagename . ".log", $unixlinksinpackage); }
+ my $dirsinpackage = installer::converter::copy_collector($directoriesforepmarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "dirs1_" . $packagename . ".log", $dirsinpackage); }
+
+ ###########################################
+ # setting the root path for the packages
+ ###########################################
+
+ installer::scriptitems::add_rootpath_to_directories($dirsinpackage, $packagerootpath);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "dirs2_" . $packagename . ".log", $dirsinpackage); }
+ installer::scriptitems::add_rootpath_to_files($filesinpackage, $packagerootpath);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "files2_" . $packagename . ".log", $filesinpackage); }
+ installer::scriptitems::add_rootpath_to_links($linksinpackage, $packagerootpath);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "links2_" . $packagename . ".log", $linksinpackage); }
+ installer::scriptitems::add_rootpath_to_files($unixlinksinpackage, $packagerootpath);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "unixlinks2_" . $packagename . ".log", $unixlinksinpackage); }
+
+ #################################
+ # collecting items for package
+ #################################
+
+ $filesinpackage = installer::packagelist::find_files_for_package($filesinpackage, $onepackage);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "files3_" . $packagename . ".log", $filesinpackage); }
+ $unixlinksinpackage = installer::packagelist::find_files_for_package($unixlinksinpackage, $onepackage);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "unixlinks3_" . $packagename . ".log", $unixlinksinpackage); }
+ $linksinpackage = installer::packagelist::find_links_for_package($linksinpackage, $filesinpackage);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "links3_" . $packagename . ".log", $linksinpackage); }
+ $dirsinpackage = installer::packagelist::find_dirs_for_package($dirsinpackage, $onepackage);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "dirs3_" . $packagename . ".log", $dirsinpackage); }
+
+ ###############################################
+ # nothing to do, if $filesinpackage is empty
+ ###############################################
+
+ if ( ! ( $#{$filesinpackage} > -1 ))
+ {
+ push(@installer::globals::emptypackages, $packagename);
+ $infoline = "\n\nNo file in package: $packagename \-\> Skipping\n\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ next; # next package, end of loop !
+ }
+
+ #################################################################
+ # nothing to do for Linux patches, if no file has flag PATCH
+ #################################################################
+
+ # Linux Patch: The complete RPM has to be built, if one file in the RPM has the flag PATCH (also for DEBs)
+ if (( $installer::globals::patch ) && (( $installer::globals::islinuxrpmbuild ) || ( $installer::globals::islinuxdebbuild )))
+ {
+ my $patchfiles = installer::worker::collect_all_items_with_special_flag($filesinpackage ,"PATCH");
+ if ( ! ( $#{$patchfiles} > -1 ))
+ {
+ $infoline = "\n\nLinux Patch: No patch file in package: $packagename \-\> Skipping\n\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ next;
+ }
+ }
+
+ ###########################################
+ # Stripping libraries
+ ###########################################
+
+ # Building for non Windows platforms in cws requires, that all files are stripped before packaging:
+ # 1. copy all files that need to be stripped locally
+ # 2. strip all these files
+
+ if ( $installer::globals::strip )
+ {
+ installer::strip::strip_libraries($filesinpackage, $languagestringref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . $packagename ."_files.log", $filesinpackage); }
+ }
+
+ ###############################################################
+ # Searching for files in $filesinpackage with flag LINUXLINK
+ ###############################################################
+
+ if (( $installer::globals::islinuxbuild ) && ( ! $installer::globals::simple )) # for rpms and debian packages
+ {
+ # special handling for all RPMs in $installer::globals::linuxlinkrpms
+
+ # if (( $installer::globals::linuxlinkrpms =~ /\b$onepackagename\b/ ) || ( $installer::globals::languagepack ))
+ if ( $installer::globals::linuxlinkrpms =~ /\b$onepackagename\b/ )
+ {
+ my $run = 0;
+
+ if (( $installer::globals::makelinuxlinkrpm ) && ( ! $run ))
+ {
+ $filesinpackage = \@installer::globals::linuxpatchfiles;
+ $linksinpackage = \@installer::globals::linuxlinks;
+ $installer::globals::makelinuxlinkrpm = 0;
+ if ( $installer::globals::patch ) { $installer::globals::call_epm = 1; } # enabling packing again
+ $run = 1;
+
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "files3b_" . $packagename . ".log", $filesinpackage); }
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "links3b_" . $packagename . ".log", $linksinpackage); }
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "dirs3b_" . $packagename . ".log", $dirsinpackage); }
+ }
+
+ if (( ! $installer::globals::makelinuxlinkrpm ) && ( ! $run ))
+ {
+ $filesinpackage = installer::worker::prepare_linuxlinkfiles($filesinpackage);
+ $linksinpackage = installer::worker::prepare_forced_linuxlinkfiles($linksinpackage);
+ $installer::globals::makelinuxlinkrpm = 1;
+ if ( $allvariableshashref->{'OPENSOURCE'} ) { $installer::globals::add_required_package = $packagename . "u"; }
+ if ( $installer::globals::patch ) { $installer::globals::call_epm = 0; } # no packing of core module in patch
+ $shellscriptsfilename = ""; # shell scripts only need to be included into the link rpm
+ $run = 1;
+
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "files3a_" . $packagename . ".log", $filesinpackage); }
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "links3a_" . $packagename . ".log", $linksinpackage); }
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "dirs3a_" . $packagename . ".log", $dirsinpackage); }
+ }
+ }
+ }
+
+ ###########################################
+ # Simple installation mechanism
+ ###########################################
+
+ if ( $installer::globals::simple ) { installer::worker::install_simple($onepackagename, $$languagestringref, $dirsinpackage, $filesinpackage, $linksinpackage, $unixlinksinpackage); }
+
+ ###########################################
+ # Checking epm state
+ ###########################################
+
+ if (( $installer::globals::call_epm ) && ( ! $found_epm ))
+ {
+ $epmexecutable = installer::epmfile::find_epm_on_system($includepatharrayref);
+ installer::epmfile::set_patch_state($epmexecutable); # setting $installer::globals::is_special_epm
+ $found_epm = 1; # searching only once
+ }
+
+ ###########################################
+ # Creating epm list file
+ ###########################################
+
+ if ( ! $installer::globals::simple )
+ {
+ # epm list file format:
+ # type mode owner group destination source options
+ # Example for a file: f 755 root sys /usr/bin/foo foo
+ # Example for a directory: d 755 root sys /var/spool/foo -
+ # Example for a link: l 000 root sys /usr/bin/linkname filename
+ # The source field specifies the file to link to
+
+ my $epmfilename = "epm_" . $onepackagename . $linkaddon . ".lst";
+
+ installer::logger::print_message( "... creating epm list file $epmfilename ... \n" );
+
+ my $completeepmfilename = $listfiledir . $installer::globals::separator . $epmfilename;
+
+ my @epmfile = ();
+
+ my $epmheaderref = installer::epmfile::create_epm_header($allvariableshashref, $filesinproductlanguageresolvedarrayref, $languagesarrayref, $onepackage);
+ installer::epmfile::adding_header_to_epm_file(\@epmfile, $epmheaderref);
+
+ if (( $installer::globals::patch ) && ( $installer::globals::issolarispkgbuild ))
+ {
+ $filesinpackage = installer::worker::analyze_patch_files($filesinpackage);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "files4_" . $packagename . ".log", $filesinpackage); }
+
+ if ( ! ( $#{$filesinpackage} > -1 ))
+ {
+ push(@installer::globals::emptypackages, $packagename);
+ $infoline = "\nNo file in package: $packagename \-\> Skipping\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ next; # next package, end of loop !
+ }
+ }
+
+ # adding directories, files and links into epm file
+
+ installer::epmfile::put_directories_into_epmfile($dirsinpackage, \@epmfile, $allvariableshashref, $packagerootpath);
+ installer::epmfile::put_files_into_epmfile($filesinpackage, \@epmfile );
+ installer::epmfile::put_links_into_epmfile($linksinpackage, \@epmfile );
+ installer::epmfile::put_unixlinks_into_epmfile($unixlinksinpackage, \@epmfile );
+
+ if ((!( $shellscriptsfilename eq "" )) && (!($installer::globals::iswindowsbuild))) { installer::epmfile::adding_shellscripts_to_epm_file(\@epmfile, $shellscriptsfilename, $packagerootpath, $allvariableshashref, $filesinpackage); }
+
+ installer::files::save_file($completeepmfilename ,\@epmfile);
+
+ # ... splitting the rootpath into a relocatable part and a static part, if possible
+
+ my $staticpath = "";
+ my $relocatablepath = "";
+ # relocatable path can be defined in package list
+ if ( $onepackage->{'relocatablepath'} ) { $relocatablepath = $onepackage->{'relocatablepath'}; }
+ # setting fix part and variable part of destination path
+ installer::epmfile::analyze_rootpath($packagerootpath, \$staticpath, \$relocatablepath, $allvariableshashref);
+
+ # ... replacing the variable PRODUCTDIRECTORYNAME in the shellscriptfile by $staticpath
+
+ installer::epmfile::resolve_path_in_epm_list_before_packaging(\@epmfile, $completeepmfilename, "PRODUCTDIRECTORYNAME", $staticpath);
+ installer::epmfile::resolve_path_in_epm_list_before_packaging(\@epmfile, $completeepmfilename, "SOLSUREPACKAGEPREFIX", $allvariableshashref->{'SOLSUREPACKAGEPREFIX'});
+ installer::epmfile::resolve_path_in_epm_list_before_packaging(\@epmfile, $completeepmfilename, "UREPACKAGEPREFIX", $allvariableshashref->{'UREPACKAGEPREFIX'});
+ # installer::epmfile::resolve_path_in_epm_list_before_packaging(\@epmfile, $completeepmfilename, "BASISDIRECTORYVERSION", $allvariableshashref->{'OOOBASEVERSION'});
+ installer::files::save_file($completeepmfilename ,\@epmfile);
+
+ #######################################################
+ # Now the complete content of the package is known,
+ # including variables and shell scripts.
+ # Create the package or using the package pool?
+ #######################################################
+
+ my $use_package_from_pool = 0;
+ if ( $allvariableshashref->{'POOLPRODUCT'} ) { $use_package_from_pool = installer::packagepool::package_is_up_to_date($allvariableshashref, $onepackage, $packagename, \@epmfile, $filesinpackage, $installdir, $installer::globals::epmoutpath, $languagestringref); }
+
+ if ( $use_package_from_pool == 3 ) # repeat this package later
+ {
+ my $package_is_creatable = installer::packagepool::check_package_availability($packagename);
+
+ if (( ! $package_is_creatable ) && ( ! exists($installer::globals::poolshiftedpackages{$packagename}) ))
+ {
+ splice(@{$packages}, $k, 1); # removing package ...
+ push(@{$packages}, $onepackage); # ... and adding it to the end
+ $installer::globals::poolshiftedpackages{$packagename} = 1; # only shifting each package once
+ $k--; # decreasing the counter
+ my $localinfoline = "\nPool: Package \"$packagename\" cannot be created at the moment. Trying again later (2).\n";
+ installer::logger::print_message($localinfoline);
+ push( @installer::globals::logfileinfo, $localinfoline);
+ next; # repeating this iteration with new package
+ }
+ }
+
+ if ( $use_package_from_pool == 4 ) # There was a problem with pooling. Repeat this package immediately.
+ {
+ $k--; # decreasing the counter
+ my $localinfoline = "\nPool: Package \"$packagename\" had pooling problems. Repeating packaging immediately (3).\n";
+ installer::logger::print_message($localinfoline);
+ push( @installer::globals::logfileinfo, $localinfoline);
+ next; # repeating this iteration
+ }
+
+ if ( $use_package_from_pool == 0 )
+ {
+ # changing into the "install" directory to create installation sets
+
+ $currentdir = cwd(); # $currentdir is global in this file
+
+ chdir($installdir); # changing into install directory ($installdir is global in this file)
+
+ ###########################################
+ # Starting epm
+ ###########################################
+
+ # With a patched epm, it is now possible to set the relocatable directory, change
+ # the directory in which the packages are created, setting "requires" and "provides"
+ # (Linux) or creating the "depend" file (Solaris) and finally to begin
+ # the packaging process with standard tooling and standard parameter
+ # Linux: Adding into the spec file: Prefix: /opt
+ # Solaris: Adding into the pkginfo file: BASEDIR=/opt
+ # Attention: Changing of the path can influence the shell scripts
+
+ if (( $installer::globals::is_special_epm ) && ( ($installer::globals::islinuxrpmbuild) || ($installer::globals::issolarispkgbuild) )) # special handling only for Linux RPMs and Solaris Packages
+ {
+ if ( $installer::globals::call_epm ) # only do something, if epm is really executed
+ {
+ # ... now epm can be started, to create the installation sets
+
+ installer::logger::print_message( "... starting patched epm ... \n" );
+
+ installer::epmfile::call_epm($epmexecutable, $completeepmfilename, $packagename, $includepatharrayref);
+
+ my $newepmdir = installer::epmfile::prepare_packages($loggingdir, $packagename, $staticpath, $relocatablepath, $onepackage, $allvariableshashref, $filesinpackage, $languagestringref); # adding the line for Prefix / Basedir, include rpmdir
+
+ installer::epmfile::create_packages_without_epm($newepmdir, $packagename, $includepatharrayref, $allvariableshashref, $languagestringref); # start to package
+
+ # finally removing all temporary files
+
+ installer::epmfile::remove_temporary_epm_files($newepmdir, $loggingdir, $packagename);
+
+ # Installation:
+ # Install: pkgadd -a myAdminfile -d ./SUNWso8m34.pkg
+ # Install: rpm -i --prefix=/opt/special --nodeps so8m35.rpm
+
+ installer::epmfile::create_new_directory_structure($newepmdir);
+ $installer::globals::postprocess_specialepm = 1;
+
+ # solaris patch not needed anymore
+ # if (( $installer::globals::patch ) && ( $installer::globals::issolarisx86build )) { installer::worker::fix2_solaris_x86_patch($packagename, $installer::globals::epmoutpath); }
+ }
+ }
+ else # this is the standard epm (not relocatable) or ( nonlinux and nonsolaris )
+ {
+ installer::epmfile::resolve_path_in_epm_list_before_packaging(\@epmfile, $completeepmfilename, "\$\$PRODUCTINSTALLLOCATION", $relocatablepath);
+ installer::files::save_file($completeepmfilename ,\@epmfile); # Warning for pool, content of epm file is changed.
+
+ if ( $installer::globals::call_epm )
+ {
+ # ... now epm can be started, to create the installation sets
+
+ installer::logger::print_message( "... starting unpatched epm ... \n" );
+
+ if ( $installer::globals::call_epm ) { installer::epmfile::call_epm($epmexecutable, $completeepmfilename, $packagename, $includepatharrayref); }
+
+ if (($installer::globals::islinuxrpmbuild) || ($installer::globals::issolarispkgbuild) || ($installer::globals::debian))
+ {
+ $installer::globals::postprocess_standardepm = 1;
+ }
+ }
+ }
+
+ if ( $allvariableshashref->{'POOLPRODUCT'} ) { installer::packagepool::put_content_into_pool($packagename, $installdir, $installer::globals::epmoutpath, $filesinpackage, \@epmfile); }
+
+ chdir($currentdir); # changing back into start directory
+
+ } # end of "if ( ! $use_package_from_pool )
+
+ } # end of "if ( ! $installer::globals::simple )
+
+ ###########################################
+ # xpd installation mechanism
+ ###########################################
+
+ # Creating the xpd file for the package. This has to happen always, not determined by $use_package_from_pool
+
+ if ( $installer::globals::isxpdplatform )
+ {
+ if (( ! $installer::globals::languagepack ) && ( ! $installer::globals::patch ))
+ {
+ if (( $allvariableshashref->{'XPDINSTALLER'} ) && ( $installer::globals::call_epm != 0 ))
+ {
+ installer::xpdinstaller::create_xpd_file($onepackage, $packages, $languagestringref, $allvariableshashref, $modulesinproductarrayref, $installdir, $installer::globals::epmoutpath, $linkpackage, \%installer::globals::xpdpackageinfo);
+ $installer::globals::xpd_files_prepared = 1;
+ %installer::globals::xpdpackageinfo = ();
+ }
+ }
+ }
+
+ if ( $installer::globals::makelinuxlinkrpm ) { $k--; } # decreasing the counter to create the link rpm!
+
+ } # end of "for ( my $k = 0; $k <= $#{$packages}; $k++ )"
+
+ installer::packagepool::log_pool_statistics();
+
+ ##############################################################
+ # Post epm functionality, after the last package is packed
+ ##############################################################
+
+ if ( $installer::globals::postprocess_specialepm )
+ {
+ installer::logger::include_header_into_logfile("Post EPM processes (Patched EPM):");
+
+ chdir($installdir);
+
+ # Copying the cde, kde and gnome packages into the installation set
+ if ( $installer::globals::addsystemintegration ) { installer::epmfile::put_systemintegration_into_installset($installer::globals::epmoutpath, $includepatharrayref, $allvariableshashref, $modulesinproductarrayref); }
+
+ # Adding license and readme into installation set
+ # if ($installer::globals::addlicensefile) { installer::epmfile::put_installsetfiles_into_installset($installer::globals::epmoutpath); }
+ if ($installer::globals::addlicensefile) { installer::worker::put_scpactions_into_installset("."); }
+
+ # Adding child projects to installation dynamically
+ if ($installer::globals::addchildprojects) { installer::epmfile::put_childprojects_into_installset($installer::globals::epmoutpath, $allvariableshashref, $modulesinproductarrayref, $includepatharrayref); }
+
+ # Adding license file into setup
+ if ( $allvariableshashref->{'PUT_LICENSE_INTO_SETUP'} ) { installer::worker::put_license_into_setup(".", $includepatharrayref); }
+
+ # Creating installation set for Unix language packs, that are not part of multi lingual installation sets
+ if ( ( $installer::globals::languagepack ) && ( ! $installer::globals::debian ) && ( ! $installer::globals::makedownload ) ) { installer::languagepack::build_installer_for_languagepack($installer::globals::epmoutpath, $allvariableshashref, $includepatharrayref, $languagesarrayref, $languagestringref); }
+
+ # Finalizing patch installation sets
+ if (( $installer::globals::patch ) && ( $installer::globals::issolarispkgbuild )) { installer::epmfile::finalize_patch($installer::globals::epmoutpath, $allvariableshashref); }
+ if (( $installer::globals::patch ) && ( $installer::globals::islinuxrpmbuild )) { installer::epmfile::finalize_linux_patch($installer::globals::epmoutpath, $allvariableshashref, $includepatharrayref); }
+
+ # Copying the xpd installer into the installation set
+ if (( $allvariableshashref->{'XPDINSTALLER'} ) && ( $installer::globals::isxpdplatform ) && ( $installer::globals::xpd_files_prepared ))
+ {
+ installer::xpdinstaller::create_xpd_installer($installdir, $allvariableshashref, $languagestringref);
+ $installer::globals::addjavainstaller = 0; # only one java installer possible
+ }
+
+ # Copying the java installer into the installation set
+ chdir($currentdir); # changing back into start directory
+ if ( $installer::globals::addjavainstaller ) { installer::javainstaller::create_java_installer($installdir, $installer::globals::epmoutpath, $languagestringref, $languagesarrayref, $allvariableshashref, $includepatharrayref, $modulesinproductarrayref); }
+ }
+
+ if ( $installer::globals::postprocess_standardepm )
+ {
+ installer::logger::include_header_into_logfile("Post EPM processes (Standard EPM):");
+
+ chdir($installdir);
+
+ # determine the destination directory
+ my $newepmdir = installer::epmfile::determine_installdir_ooo();
+
+ # Copying the cde, kde and gnome packages into the installation set
+ if ( $installer::globals::addsystemintegration ) { installer::epmfile::put_systemintegration_into_installset($newepmdir, $includepatharrayref, $allvariableshashref, $modulesinproductarrayref); }
+
+ # Adding license and readme into installation set
+ # if ($installer::globals::addlicensefile) { installer::epmfile::put_installsetfiles_into_installset($newepmdir); }
+ if ($installer::globals::addlicensefile) { installer::worker::put_scpactions_into_installset("."); }
+
+ # Adding license file into setup
+ if ( $allvariableshashref->{'PUT_LICENSE_INTO_SETUP'} ) { installer::worker::put_license_into_setup(".", $includepatharrayref); }
+
+ # Creating installation set for Unix language packs, that are not part of multi lingual installation sets
+ if ( ( $installer::globals::languagepack ) && ( ! $installer::globals::debian ) && ( ! $installer::globals::makedownload ) ) { installer::languagepack::build_installer_for_languagepack($newepmdir, $allvariableshashref, $includepatharrayref, $languagesarrayref, $languagestringref); }
+
+ chdir($currentdir); # changing back into start directory
+ }
+
+ if (( $installer::globals::issolarispkgbuild ) && ( $allvariableshashref->{'COLLECT_PKGMAP'} )) { installer::worker::collectpackagemaps($installdir, $languagestringref, $allvariableshashref); }
+
+ #######################################################
+ # Analyzing the log file
+ #######################################################
+
+ my $is_success = 0;
+ my $finalinstalldir = "";
+
+ installer::worker::clean_output_tree(); # removing directories created in the output tree
+ ($is_success, $finalinstalldir) = installer::worker::analyze_and_save_logfile($loggingdir, $installdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
+ my $downloadname = installer::ziplist::getinfofromziplist($allsettingsarrayref, "downloadname");
+ if ( $is_success ) { installer::followme::save_followme_info($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref, $current_install_number, $loggingdir, $installlogdir); }
+
+ #######################################################
+ # Creating download installation set
+ #######################################################
+
+ if ( $installer::globals::makedownload )
+ {
+ my $create_download = 0;
+ if ( $$downloadname ne "" ) { $create_download = 1; }
+ if (( $is_success ) && ( $create_download ) && ( $ENV{'ENABLE_DOWNLOADSETS'} ))
+ {
+ my $downloaddir = installer::download::create_download_sets($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref);
+ installer::worker::analyze_and_save_logfile($loggingdir, $downloaddir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
+ }
+ }
+
+ #######################################################
+ # Creating jds installation set
+ #######################################################
+
+ if ( $installer::globals::makejds )
+ {
+ my $create_jds = 0;
+
+ if ( $allvariableshashref->{'JDSBUILD'} ) { $create_jds = 1; }
+ if (! $installer::globals::issolarispkgbuild ) { $create_jds = 0; }
+
+ if (( $is_success ) && ( $create_jds ))
+ {
+ if ( ! $installer::globals::jds_language_controlled )
+ {
+ my $correct_language = installer::worker::check_jds_language($allvariableshashref, $languagestringref);
+ $installer::globals::correct_jds_language = $correct_language;
+ $installer::globals::jds_language_controlled = 1;
+ }
+
+ if ( $installer::globals::correct_jds_language )
+ {
+ my $jdsdir = installer::worker::create_jds_sets($finalinstalldir, $allvariableshashref, $languagestringref, $languagesarrayref, $includepatharrayref);
+ installer::worker::clean_jds_temp_dirs();
+ installer::worker::analyze_and_save_logfile($loggingdir, $jdsdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
+ }
+ }
+ }
+
+ } # end of "if (!( $installer::globals::iswindowsbuild ))"
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("\nEnd of part 2a: All non-Windows platforms\n"); }
+
+ #################################################
+ # Part 2b: The Windows platform
+ #################################################
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("\nPart 2b: The Windows platform\n"); }
+
+ #####################################################################
+ # ... creating idt files ...
+ # Only for Windows builds ($installer::globals::compiler is wntmsci)
+ #####################################################################
+
+ if ( $installer::globals::iswindowsbuild )
+ {
+ ###########################################
+ # Stripping libraries
+ ###########################################
+
+ # Building for gcc build in cws requires, that all files are stripped before packaging:
+ # 1. copy all files that need to be stripped locally
+ # 2. strip all these files
+
+ if ( $installer::globals::compiler =~ /wntgcci/ )
+ {
+ installer::windows::strip::strip_binaries($filesinproductlanguageresolvedarrayref, $languagestringref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles16e.log", $filesinproductlanguageresolvedarrayref); }
+ }
+
+ $installdir = installer::worker::create_installation_directory($shipinstalldir, $languagestringref, \$current_install_number);
+
+ my $idtdirbase = installer::systemactions::create_directories("idt_files", $languagestringref);
+ $installer::globals::infodirectory = installer::systemactions::create_directories("info_files", $languagestringref);
+ my $installlogdir = installer::systemactions::create_directory_next_to_directory($installdir, "log");
+ # my $installchecksumdir = installer::systemactions::create_directory_next_to_directory($installdir, "checksum");
+
+ #################################################################################
+ # Preparing cabinet files from package definitions
+ #################################################################################
+
+ # installer::packagelist::prepare_cabinet_files($packages, $allvariableshashref, $$languagestringref);
+ installer::packagelist::prepare_cabinet_files($packages, $allvariableshashref);
+ # printing packages content:
+ installer::packagelist::log_cabinet_assignments();
+
+ #################################################################################
+ # Begin of functions that are used for the creation of idt files (Windows only)
+ #################################################################################
+
+ installer::logger::print_message( "... creating idt files ...\n" );
+
+ installer::logger::include_header_into_logfile("Creating idt files:");
+
+ my $newidtdir = $idtdirbase . $installer::globals::separator . "00"; # new files into language independent directory "00"
+ installer::systemactions::create_directory($newidtdir);
+
+ my @allfilecomponents = ();
+ my @allregistrycomponents = ();
+
+ # Collecting all files with flag "BINARYTABLE"
+ my $binarytablefiles = installer::worker::collect_all_items_with_special_flag($filesinproductlanguageresolvedarrayref ,"BINARYTABLE");
+
+ # Removing all files with flag "BINARYTABLE_ONLY"
+ @installer::globals::binarytableonlyfiles = ();
+ $filesinproductlanguageresolvedarrayref = installer::worker::remove_all_items_with_special_flag($filesinproductlanguageresolvedarrayref ,"BINARYTABLE_ONLY");
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles17.log", $filesinproductlanguageresolvedarrayref); }
+
+ # Collecting all profileitems with flag "INIFILETABLE" for table "IniFile"
+ my $inifiletableentries = installer::worker::collect_all_items_with_special_flag($profileitemsinproductlanguageresolvedarrayref ,"INIFILETABLE");
+
+ # Creating the important dynamic idt files
+ installer::windows::msiglobal::set_msiproductversion($allvariableshashref);
+ installer::windows::msiglobal::put_msiproductversion_into_bootstrapfile($filesinproductlanguageresolvedarrayref);
+
+ # Add cabinet assignments to files
+ installer::windows::file::assign_cab_to_files($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles17a.log", $filesinproductlanguageresolvedarrayref); }
+ installer::windows::file::assign_sequencenumbers_to_files($filesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles17b.log", $filesinproductlanguageresolvedarrayref); }
+
+ # Collection all available directory trees
+ installer::windows::directory::collectdirectorytrees($directoriesforepmarrayref);
+
+ $filesinproductlanguageresolvedarrayref = installer::windows::file::create_files_table($filesinproductlanguageresolvedarrayref, \@allfilecomponents, $newidtdir, $allvariableshashref, $uniquefilename, $allupdatesequences, $allupdatecomponents, $allupdatefileorder);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles17c.log", $filesinproductlanguageresolvedarrayref); }
+ if ( $installer::globals::updatedatabase ) { installer::windows::file::check_file_sequences($allupdatefileorder, $allupdatecomponentorder); }
+
+ installer::windows::directory::create_directory_table($directoriesforepmarrayref, $newidtdir, $allvariableshashref, $shortdirname, $loggingdir);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles18.log", $filesinproductlanguageresolvedarrayref); }
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt1.log", $directoriesforepmarrayref); }
+
+ # Attention: The table "Registry.idt" contains language specific strings -> parameter: $languagesarrayref !
+ installer::windows::registry::create_registry_table($registryitemsinproductlanguageresolvedarrayref, \@allregistrycomponents, $newidtdir, $languagesarrayref, $allvariableshashref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "registryitems4.log", $registryitemsinproductlanguageresolvedarrayref); }
+
+ installer::windows::component::create_component_table($filesinproductlanguageresolvedarrayref, $registryitemsinproductlanguageresolvedarrayref, $directoriesforepmarrayref, \@allfilecomponents, \@allregistrycomponents, $newidtdir, $componentid, $componentidkeypath);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles19.log", $filesinproductlanguageresolvedarrayref); }
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "registryitems5.log", $registryitemsinproductlanguageresolvedarrayref); }
+
+ # Attention: The table "Feature.idt" contains language specific strings -> parameter: $languagesarrayref !
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "modules4.log", $modulesinproductlanguageresolvedarrayref); }
+ installer::windows::feature::add_uniquekey($modulesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "modules4a.log", $modulesinproductlanguageresolvedarrayref); }
+ $modulesinproductlanguageresolvedarrayref = installer::windows::feature::sort_feature($modulesinproductlanguageresolvedarrayref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "modules4b.log", $modulesinproductlanguageresolvedarrayref); }
+ installer::windows::feature::create_feature_table($modulesinproductlanguageresolvedarrayref, $newidtdir, $languagesarrayref, $allvariableshashref);
+
+ installer::windows::featurecomponent::create_featurecomponent_table($filesinproductlanguageresolvedarrayref, $registryitemsinproductlanguageresolvedarrayref, $newidtdir);
+
+ installer::windows::media::create_media_table($filesinproductlanguageresolvedarrayref, $newidtdir, $allvariableshashref, $allupdatelastsequences, $allupdatediskids);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles20.log", $filesinproductlanguageresolvedarrayref); }
+
+ installer::windows::font::create_font_table($filesinproductlanguageresolvedarrayref, $newidtdir);
+
+ # Attention: The table "Shortcut.idt" contains language specific strings -> parameter: $languagesarrayref !
+ # Attention: Shortcuts (Folderitems) have icon files, that have to be copied into the Icon directory (last parameter)
+ my @iconfilecollector = ();
+
+ installer::windows::shortcut::create_shortcut_table($filesinproductlanguageresolvedarrayref, $linksinproductlanguageresolvedarrayref, $folderinproductlanguageresolvedarrayref, $folderitemsinproductlanguageresolvedarrayref, $directoriesforepmarrayref, $newidtdir, $languagesarrayref, $includepatharrayref, \@iconfilecollector);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "folderitems4.log", $folderitemsinproductlanguageresolvedarrayref); }
+
+ installer::windows::inifile::create_inifile_table($inifiletableentries, $filesinproductlanguageresolvedarrayref, $newidtdir);
+
+ installer::windows::icon::create_icon_table(\@iconfilecollector, $newidtdir); # creating the icon table with all iconfiles used as shortcuts (FolderItems)
+
+ installer::windows::createfolder::create_createfolder_table($directoriesforepmarrayref, $filesinproductlanguageresolvedarrayref, $newidtdir, $allvariableshashref);
+
+ installer::windows::upgrade::create_upgrade_table($newidtdir, $allvariableshashref);
+
+ if ( ! $installer::globals::languagepack ) # the following tables not for language packs
+ {
+ installer::windows::removefile::create_removefile_table($folderitemsinproductlanguageresolvedarrayref, $newidtdir);
+
+ installer::windows::selfreg::create_selfreg_table($filesinproductlanguageresolvedarrayref, $newidtdir);
+
+ # Adding Assemblies into the tables MsiAssembly and MsiAssemblyName dynamically
+ installer::windows::assembly::create_msiassembly_table($filesinproductlanguageresolvedarrayref, $newidtdir);
+ installer::windows::assembly::create_msiassemblyname_table($filesinproductlanguageresolvedarrayref, $newidtdir);
+ installer::windows::assembly::add_assembly_condition_into_component_table($filesinproductlanguageresolvedarrayref, $newidtdir);
+ }
+
+ $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ # Localizing the language dependent idt files
+ # For every language there will be a localized msi database
+ # For multilingual installation sets, the differences of this
+ # databases have to be stored in transforms.
+
+ for ( my $m = 0; $m <= $#{$languagesarrayref}; $m++ )
+ {
+ my $onelanguage = ${$languagesarrayref}[$m];
+
+ my $is_bidi = 0;
+ if ( installer::existence::exists_in_array($onelanguage, \@installer::globals::bidilanguages) ) { $is_bidi = 1; }
+
+ my $languageidtdir = $idtdirbase . $installer::globals::separator . $onelanguage;
+ if ( -d $languageidtdir ) { installer::systemactions::remove_complete_directory($languageidtdir, 1); }
+ installer::systemactions::create_directory($languageidtdir);
+
+ # Copy the template idt files and the new created idt files into this language directory
+
+ installer::logger::print_message( "... copying idt files ...\n" );
+
+ installer::logger::include_header_into_logfile("Copying idt files to $languageidtdir:");
+
+ installer::windows::idtglobal::prepare_language_idt_directory($languageidtdir, $newidtdir, $onelanguage, $filesinproductlanguageresolvedarrayref, \@iconfilecollector, $binarytablefiles, $allvariableshashref);
+
+ if ( ! $installer::globals::languagepack )
+ {
+ # For multilingual installation sets, the dialog for the language selection can now be prepared, with
+ # a checkbox for each available language. This has to happen before the following translation.
+ # The new controls have to be added into the Control.idt
+
+ my $controlidttablename = $languageidtdir . $installer::globals::separator . "Control.idt";
+ my $controlidttable = installer::files::read_file($controlidttablename);
+ installer::windows::idtglobal::add_language_checkboxes_to_database($controlidttable, $languagesarrayref);
+ installer::files::save_file($controlidttablename, $controlidttable);
+ $infoline = "Added checkboxes for language selection dialog into table $controlidttablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ # Now all files are copied into a language specific directory
+ # The template idt files can be translated
+
+ installer::logger::print_message( "... localizing idt files (language: $onelanguage) ...\n" );
+
+ installer::logger::include_header_into_logfile("Localizing idt files (Language: $onelanguage):");
+
+ my @translationfiles = (); # all idt files, that need a translation
+ push(@translationfiles, "ActionTe.idt");
+ push(@translationfiles, "Control.idt");
+ push(@translationfiles, "CustomAc.idt");
+ push(@translationfiles, "Error.idt");
+ push(@translationfiles, "LaunchCo.idt");
+ push(@translationfiles, "RadioBut.idt");
+ push(@translationfiles, "Property.idt");
+ push(@translationfiles, "UIText.idt");
+
+ my $oneidtfilename;
+ my $oneidtfile;
+
+ foreach $oneidtfilename (@translationfiles)
+ {
+ my $languagefilename = installer::windows::idtglobal::get_languagefilename($oneidtfilename, $installer::globals::idtlanguagepath);
+ my $languagefile = installer::files::read_file($languagefilename);
+
+ $oneidtfilename = $languageidtdir . $installer::globals::separator . $oneidtfilename;
+ $oneidtfile = installer::files::read_file($oneidtfilename);
+
+ # Now the substitution can start
+ installer::windows::idtglobal::translate_idtfile($oneidtfile, $languagefile, $onelanguage);
+
+ installer::files::save_file($oneidtfilename, $oneidtfile);
+
+ $infoline = "Translated idt file: $oneidtfilename into language $onelanguage\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Used languagefile: $languagefilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ # setting the encoding in every table (replacing WINDOWSENCODINGTEMPLATE)
+
+ installer::windows::idtglobal::setencoding($languageidtdir, $onelanguage);
+
+ # setting bidi attributes, if required
+
+ if ( $is_bidi ) { installer::windows::idtglobal::setbidiattributes($languageidtdir, $onelanguage); }
+
+ # setting the encoding in every table (replacing WINDOWSENCODINGTEMPLATE)
+ installer::windows::idtglobal::set_multilanguageonly_condition($languageidtdir);
+
+ # include the license text into the table Control.idt
+
+ if ( ! $allvariableshashref->{'HIDELICENSEDIALOG'} )
+ {
+ my $licensefilesource = installer::windows::idtglobal::get_rtflicensefilesource($onelanguage, $includepatharrayref_lang);
+ my $licensefile = installer::files::read_file($licensefilesource);
+ installer::scpzipfiles::replace_all_ziplistvariables_in_rtffile($licensefile, $allvariablesarrayref, $onelanguage, $loggingdir);
+ my $controltablename = $languageidtdir . $installer::globals::separator . "Control.idt";
+ my $controltable = installer::files::read_file($controltablename);
+ installer::windows::idtglobal::add_licensefile_to_database($licensefile, $controltable);
+ installer::files::save_file($controltablename, $controltable);
+
+ $infoline = "Added licensefile $licensefilesource into database $controltablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ # include a component into environment table if required
+
+ installer::windows::component::set_component_in_environment_table($languageidtdir, $filesinproductlanguageresolvedarrayref);
+
+ # include the ProductCode and the UpgradeCode from codes-file into the Property.idt
+
+ installer::windows::property::set_codes_in_property_table($languageidtdir);
+
+ # the language specific properties can now be set in the Property.idt
+
+ installer::windows::property::update_property_table($languageidtdir, $onelanguage, $allvariableshashref, $languagestringref);
+
+ # replacing variables in RegLocat.idt
+
+ installer::windows::msiglobal::update_reglocat_table($languageidtdir, $allvariableshashref);
+
+ # replacing variables in RemoveRe.idt (RemoveRegistry.idt)
+
+ installer::windows::msiglobal::update_removere_table($languageidtdir);
+
+ # adding language specific properties for multilingual installation sets
+
+ installer::windows::property::set_languages_in_property_table($languageidtdir, $languagesarrayref);
+
+ # adding settings into CheckBox.idt
+ installer::windows::property::update_checkbox_table($languageidtdir, $allvariableshashref);
+
+ # adding the files from the binary directory into the binary table
+ installer::windows::binary::update_binary_table($languageidtdir, $filesinproductlanguageresolvedarrayref, $binarytablefiles);
+
+ # setting patch codes to detect installed products
+
+ if (( $installer::globals::patch ) || ( $installer::globals::languagepack ) || ( $allvariableshashref->{'PDFCONVERTER'} )) { installer::windows::patch::update_patch_tables($languageidtdir, $allvariableshashref); }
+
+ # Adding Windows Installer CustomActions
+
+ installer::windows::idtglobal::addcustomactions($languageidtdir, $windowscustomactionsarrayref, $filesinproductlanguageresolvedarrayref);
+
+ # Adding child projects if specified
+
+ if ($installer::globals::addchildprojects)
+ {
+ # Adding child projects to installation dynamically (also in feature table)
+ installer::windows::idtglobal::add_childprojects($languageidtdir, $filesinproductlanguageresolvedarrayref, $allvariableshashref);
+ # setting Java variables for Java products
+ if ( $allvariableshashref->{'JAVAPRODUCT'} ) { installer::windows::java::update_java_tables($languageidtdir, $allvariableshashref); }
+ }
+
+ # Then the language specific msi database can be created
+
+ if ( $installer::globals::iswin ) # only possible on a Windows platform
+ {
+ my $msidatabasename = installer::windows::msiglobal::get_msidatabasename($allvariableshashref, $onelanguage);
+ my $msifilename = $languageidtdir . $installer::globals::separator . $msidatabasename;
+
+ installer::logger::print_message( "... creating msi database (language $onelanguage) ... \n" );
+
+ installer::windows::msiglobal::set_uuid_into_component_table($languageidtdir, $allvariableshashref); # setting new GUID for the components using the tool uuidgen.exe
+ installer::windows::msiglobal::create_msi_database($languageidtdir ,$msifilename);
+
+ # validating the database # ToDo
+
+ my $languagefile = installer::files::read_file($installer::globals::idtlanguagepath . $installer::globals::separator . "SIS.mlf");
+ # my $languagefile = installer::files::read_file($installer::globals::idtlanguagepath . $installer::globals::separator . "SIS.ulf");
+
+ installer::windows::msiglobal::write_summary_into_msi_database($msifilename, $onelanguage, $languagefile, $allvariableshashref);
+
+ # if there are Merge Modules, they have to be integrated now
+ $filesinproductlanguageresolvedarrayref = installer::windows::mergemodule::merge_mergemodules_into_msi_database($mergemodulesarrayref, $filesinproductlanguageresolvedarrayref, $msifilename, $languagestringref, $onelanguage, $languagefile, $allvariableshashref, $includepatharrayref, $allupdatesequences, $allupdatelastsequences, $allupdatediskids);
+ if (( $installer::globals::globallogging ) && ($installer::globals::globalloggingform21)) { installer::files::save_array_of_hashes($loggingdir . "productfiles21_" . $onelanguage . ".log", $filesinproductlanguageresolvedarrayref); }
+ $installer::globals::globalloggingform21 = 0;
+ if ( $installer::globals::use_packages_for_cabs ) { installer::windows::media::create_media_table($filesinproductlanguageresolvedarrayref, $newidtdir, $allvariableshashref, $allupdatelastsequences, $allupdatediskids); }
+
+ # copy msi database into installation directory
+
+ my $msidestfilename = $installdir . $installer::globals::separator . $msidatabasename;
+ installer::systemactions::copy_one_file($msifilename, $msidestfilename);
+ }
+ }
+
+ # Creating transforms, if the installation set has more than one language
+ # renaming the msi database and generating the setup.ini file
+
+ my $defaultlanguage = installer::languages::get_default_language($languagesarrayref);
+
+ if ( $installer::globals::iswin ) # only possible on a Windows platform
+ {
+ if ( $#{$languagesarrayref} > 0 )
+ {
+ installer::windows::msiglobal::create_transforms($languagesarrayref, $defaultlanguage, $installdir, $allvariableshashref);
+ }
+
+ installer::windows::msiglobal::rename_msi_database_in_installset($defaultlanguage, $installdir, $allvariableshashref);
+
+ if ( $allvariableshashref->{'ADDLANGUAGEINDATABASENAME'} ) { installer::windows::msiglobal::add_language_to_msi_database($defaultlanguage, $installdir, $allvariableshashref); }
+
+ installer::logger::print_message( "... generating setup.ini ...\n" );
+
+ if ( ! $allvariableshashref->{'NOLOADERREQUIRED'} ) { installer::windows::msiglobal::create_setup_ini($languagesarrayref, $defaultlanguage, $installdir, $allvariableshashref); }
+ }
+
+ # Analyzing the ScpActions and copying the files into the installation set
+ # At least the loader.exe
+
+ installer::logger::print_message( "... copying files into installation set ...\n" );
+
+ # installer::windows::msiglobal::copy_scpactions_into_installset($defaultlanguage, $installdir, $scpactionsinproductlanguageresolvedarrayref);
+ installer::worker::put_scpactions_into_installset($installdir);
+
+ # ... copying the setup.exe
+
+ installer::windows::msiglobal::copy_windows_installer_files_into_installset($installdir, $includepatharrayref, $allvariableshashref);
+
+ # ... copying MergeModules into installation set
+
+ if ( ! $installer::globals::fix_number_of_cab_files ) { installer::windows::msiglobal::copy_merge_modules_into_installset($installdir); }
+
+ # ... copying the child projects
+
+ if ($installer::globals::addchildprojects)
+ {
+ installer::windows::msiglobal::copy_child_projects_into_installset($installdir, $allvariableshashref);
+ }
+
+ installer::logger::print_message( "... creating ddf files ...\n" );
+
+ # Creating all needed ddf files and generating a list
+ # for the package process containing all system calls
+
+ my $ddfdir = installer::systemactions::create_directories("ddf", $languagestringref);
+
+ $installer::globals::packjobref = installer::windows::msiglobal::generate_cab_file_list($filesinproductlanguageresolvedarrayref, $installdir, $ddfdir, $allvariableshashref);
+
+ # Update and patch reasons the pack order needs to be saved
+ installer::windows::msiglobal::save_packorder();
+
+ $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ ####################################
+ # Writing log file
+ # before cab files are packed
+ ####################################
+
+ installer::logger::print_message( "... creating log file $installer::globals::logfilename \n" );
+
+ installer::files::save_file($loggingdir . $installer::globals::logfilename, \@installer::globals::logfileinfo);
+
+ #######################################################
+ # Finally really create the installation packages,
+ # Only for Windows and only on a windows platform.
+ #######################################################
+
+ if ( $installer::globals::iswin ) # only possible on a Windows platform
+ {
+ installer::logger::print_message( "... packaging installation set ... \n" );
+ installer::windows::msiglobal::execute_packaging($installer::globals::packjobref, $loggingdir, $allvariableshashref);
+ if ( $installer::globals::include_cab_in_msi ) { installer::windows::msiglobal::include_cabs_into_msi($installdir); }
+
+ ####################################
+ # Writing log file
+ # after cab files are packed
+ ####################################
+
+ installer::logger::print_message( "\n... creating log file $installer::globals::logfilename \n" );
+ installer::files::save_file($loggingdir . $installer::globals::logfilename, \@installer::globals::logfileinfo);
+ }
+
+ #######################################################
+ # Analyzing the log file
+ #######################################################
+
+ my $is_success = 0;
+ my $finalinstalldir = "";
+ installer::worker::clean_output_tree(); # removing directories created in the output tree
+ ($is_success, $finalinstalldir) = installer::worker::analyze_and_save_logfile($loggingdir, $installdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
+
+ #######################################################
+ # Creating Windows msp patches
+ #######################################################
+
+ if (( $is_success ) && ( $installer::globals::updatedatabase ) && ( $allvariableshashref->{'CREATE_MSP_INSTALLSET'} ))
+ {
+ # Required:
+ # Temp path for administrative installations: $installer::globals::temppath
+ # Path of new installation set: $finalinstalldir
+ # Path of old installation set: $installer::globals::updatedatabasepath
+ my $mspdir = installer::windows::msp::create_msp_patch($finalinstalldir, $includepatharrayref, $allvariableshashref, $languagestringref, $languagesarrayref, $filesinproductlanguageresolvedarrayref);
+ ($is_success, $finalinstalldir) = installer::worker::analyze_and_save_logfile($loggingdir, $mspdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
+ installer::worker::clean_output_tree(); # removing directories created in the output tree
+ }
+
+ #######################################################
+ # Creating download installation set
+ #######################################################
+
+ my $create_download = 0;
+ my $downloadname = installer::ziplist::getinfofromziplist($allsettingsarrayref, "downloadname");
+ if ( $installer::globals::languagepack ) { $downloadname = installer::ziplist::getinfofromziplist($allsettingsarrayref, "langpackdownloadname"); }
+ if ( $installer::globals::patch ) { $downloadname = installer::ziplist::getinfofromziplist($allsettingsarrayref, "patchdownloadname"); }
+
+ if ( $is_success ) { installer::followme::save_followme_info($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref, $current_install_number, $loggingdir, $installlogdir); }
+
+ if ( $$downloadname ne "" ) { $create_download = 1; }
+ if (( $is_success ) && ( $create_download ) && ( $ENV{'ENABLE_DOWNLOADSETS'} ))
+ {
+ my $downloaddir = installer::download::create_download_sets($finalinstalldir, $includepatharrayref, $allvariableshashref, $$downloadname, $languagestringref, $languagesarrayref);
+ installer::worker::analyze_and_save_logfile($loggingdir, $downloaddir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
+ }
+
+ } # end of "if ( $installer::globals::iswindowsbuild )"
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("\nEnd of part 2b: The Windows platform\n"); }
+
+ # saving file_info file for later analysis
+ my $speciallogfilename = "fileinfo_" . $installer::globals::product . "\.log";
+ installer::files::save_array_of_hashes($loggingdir . $speciallogfilename, $filesinproductlanguageresolvedarrayref);
+
+} # end of iteration for one language group
+
+# saving debug info at end
+if ( $installer::globals::debug ) { installer::logger::savedebug($installer::globals::exitlog); }
+
+#######################################################
+# Stopping time
+#######################################################
+
+installer::logger::stoptime();
+
+####################################
+# Main program end
+####################################
diff --git a/solenv/bin/makedepn b/solenv/bin/makedepn
new file mode 100755
index 000000000000..c08ea38d0f30
--- /dev/null
+++ b/solenv/bin/makedepn
@@ -0,0 +1,13 @@
+#!/bin/sh -e
+if [ -z "$1" ]; then
+ exit 1;
+fi
+infile=`echo "$1" | sed 's/^@//'`
+for i in `cat "$infile"`; do
+ i=`echo "$i" | fgrep -- "-O:" | awk -F: '{print $2}'`
+ if [ ! -z "$i" ]; then
+ echo "#" > "$i"
+ exit 0;
+ fi;
+done
+exit 1
diff --git a/solenv/bin/makemani.pl b/solenv/bin/makemani.pl
new file mode 100644
index 000000000000..cdebaab77617
--- /dev/null
+++ b/solenv/bin/makemani.pl
@@ -0,0 +1,112 @@
+#! /usr/bin/perl -w
+ eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
+ if 0; #$running_under_some_shell
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+use strict;
+use File::Find ();
+use Cwd qw (cwd);
+
+my @findlist;
+
+# Set the variable $File::Find::dont_use_nlink if you're using AFS,
+# since AFS cheats.
+
+# for the convenience of &wanted calls, including -eval statements:
+use vars qw/*name *dir *prune/;
+*name = *File::Find::name;
+*dir = *File::Find::dir;
+*prune = *File::Find::prune;
+
+sub wanted;
+
+
+
+sub wanted {
+ /^.*\.xc(s|u)\z/s
+ && ( push @findlist, $name );
+# && ( push @findlist, $name ) && print("$name\n");
+}
+
+sub usage
+{
+ print STDERR "\n$0 - append *.xcu file entries to .oxt manifest.xml\n\n";
+ print STDERR "usage: $0 <static_part> <start dir> <search dir> <destination dir>\n\n";
+ print STDERR " static part - file containig all other content for mainfest.xml\n";
+ print STDERR " start dir - directory to change to before starting search\n";
+ print STDERR " out dir - destination directory to write manifes.xml to\n\n";
+ exit 1;
+}
+
+if ( $#ARGV != 3 ) { usage(); };
+
+my $manifest_head = $ARGV[0];
+my $start_dir = $ARGV[1];
+my $dynamic_dir = $ARGV[2];
+my $out_dir = $ARGV[3];
+
+print "################################################\n";
+print "# #\n";
+print "# just a prototype - for testing purpose only! #\n";
+print "# #\n";
+print "################################################\n\n";
+
+
+# Traverse desired filesystems
+my $work_dir = cwd();
+chdir $start_dir or die "$0: ERROR - cannot change directory to \"$start_dir\"\n";
+File::Find::find({wanted => \&wanted}, $dynamic_dir);
+chdir $work_dir or die "$0: ERROR - oops... cannot change dir to where i came from!\n";
+
+open (HEAD, "$manifest_head") or die "$0: ERROR - Cannot open $manifest_head\n";
+my @headlines = <HEAD>;
+close HEAD;
+chomp @headlines;
+chomp @findlist;
+
+my @bodylines;
+my @taillines = ("</manifest:manifest>");
+
+foreach my $i (@findlist) {
+ if ($i =~ m/^.*\.xcu\z/s) {
+ push @bodylines, " <manifest:file-entry manifest:media-type=\"application/vnd.sun.star.configuration-data\"";
+ } else {
+ push @bodylines, " <manifest:file-entry manifest:media-type=\"application/vnd.sun.star.configuration-schema\"";
+ }
+ push @bodylines, " manifest:full-path=\"$i\"/>";
+}
+
+open (MANIOUT,">$out_dir/manifest.xml") or die "$0: ERROR - cannot open \"$out_dir/manifest.xml\" for writing.\n";
+binmode MANIOUT;
+
+foreach my $j (@headlines, @bodylines, @taillines) {
+ print MANIOUT "$j\n";
+}
+
+close MANIOUT;
+
diff --git a/solenv/bin/mapgen.pl b/solenv/bin/mapgen.pl
new file mode 100644
index 000000000000..48c335c2adba
--- /dev/null
+++ b/solenv/bin/mapgen.pl
@@ -0,0 +1,207 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#
+# mapgen - generate a map file for Unix libraries
+#
+
+#use File::Path;
+#use File::Copy;
+
+#### script id #####
+
+( $script_name = $0 ) =~ s/^.*\b(\w+)\.pl$/$1/;
+
+$id_str = ' $Revision: 1.6 $ ';
+$id_str =~ /Revision:\s+(\S+)\s+\$/
+ ? ($script_rev = $1) : ($script_rev = "-");
+
+print "$script_name -- version: $script_rev\n";
+print "Multi Platform Enabled Edition\n";
+
+#########################
+# #
+# Globale Variablen #
+# #
+#########################
+
+$dump_file = '';
+$flt_file = '';
+$map_file = '';
+$first_string = '';
+$tab = ' ';
+
+#### main ####
+
+&get_options;
+if (!(open (DUMP_FILE, $dump_file))) {
+ &print_error("Unable open $dump_file");
+};
+if (!(open (FLT_FILE, $flt_file))) {
+ close DUMP_FILE;
+ &print_error("Unable open $flt_file");
+};
+unlink $map_file;
+if (!(open (MAP_FILE, ">>$map_file"))) {
+ close DUMP_FILE;
+ close FLT_FILE;
+ &print_error("Unable open $map_file");
+};
+
+if ($ENV{OS} eq 'SOLARIS') {
+ &gen_sol;
+} elsif ($ENV{OS} eq 'LINUX') {
+ &gen_lnx;
+} else {
+ &print_error ('Environment not set!!');
+};
+
+close DUMP_FILE;
+close FLT_FILE;
+close MAP_FILE;
+
+#### end of main procedure ####
+
+#########################
+# #
+# Procedures #
+# #
+#########################
+
+#
+# Generate a map file for solaris
+#
+sub gen_sol {
+ my %symbols = ();
+ foreach (<DUMP_FILE>) {
+ next if (!(/\s*(\S+)\s*\|\s*(\S+)\s*\|\s*(\S+)\s*\|\s*(\S+)\s*\|\s*(\S+)\s*\|\s*(\S+)\s*\|\s*(\S+)\s*\|\s*(\S+)\s*/));
+ next if (($7 =~ /UNDEF/) || ($7 =~ /ABS/));
+ next if ($5 eq 'LOCL');
+ $symbols{$8}++;
+ };
+ &filter_symbols(\%symbols);
+};
+
+#
+# Generate a map file for linux
+#
+sub gen_lnx {
+ my %symbols = ();
+ foreach (<DUMP_FILE>) {
+ next if (!(/^\S+ [A|B|C|D|G|I|N|R|S|T|U|V|W|-|\?|-] (\S+)/));
+ $symbols{$1}++;
+ };
+ &filter_symbols(\%symbols);
+}
+
+#
+# Filter symbols with filters from $flt_file
+#
+sub filter_symbols {
+ my $symbols = shift;
+ my $env_section = '';
+ my @filters = ();
+ my @filtered_symbols = ();
+ while (<FLT_FILE>) {
+ s/\r//;
+ s/\n//;
+ $env_section = '1' and next if ((/^# SOLARIS #$/) && ($ENV{OS} eq 'SOLARIS'));
+ $env_section = '1' and next if ((/^# LINUX #$/) && ($ENV{OS} eq 'LINUX'));
+ $env_section = '1' and next if ((/^# FREEBSD #$/) && ($ENV{OS} eq 'FREEBSD'));
+ last if ($env_section && ((/^# SOLARIS #$/) || (/^# FREEBSD #$/) || (/^# LINUX #$/)));
+ next if (!$_ || /^#/);
+ push(@filters, $_);
+ };
+ foreach my $symbol (keys %$symbols) {
+ my $export = '-';
+ foreach my $filter_str (@filters) {
+ my $add = substr ($filter_str, 0, 1);
+ my $filter = substr($filter_str, 1);
+ if ($symbol =~ /$filter/) {
+ $export = $add;
+ };
+ };
+ if ($export eq '+') {
+ push(@filtered_symbols, $symbol);
+ };
+ };
+ &write_mapfile(\@filtered_symbols);
+};
+
+#
+# Write a map file
+#
+sub write_mapfile {
+ my $symbols = shift;
+ print MAP_FILE $first_string . " {\n$tab" . "global:\n";
+ foreach (@$symbols) {
+ print MAP_FILE "$tab$tab$_\;\n";
+ };
+ print MAP_FILE "$tab" . "local:\n$tab\*\;\n}\;";
+};
+
+#
+# Get all options passed
+#
+sub get_options {
+
+$dump_file = '';
+$flt_file = '';
+$map_file = '';
+ my ($arg);
+ &usage() && exit(0) if ($#ARGV == -1);
+ while ($arg = shift @ARGV) {
+ $arg =~ /^-d$/ and $dump_file = shift @ARGV and next;
+ $arg =~ /^-f$/ and $flt_file = shift @ARGV and next;
+ $arg =~ /^-m$/ and $map_file = shift @ARGV and next;
+ $arg =~ /^-h$/ and &usage and exit(0);
+ $arg =~ /^--help$/ and &usage and exit(0);
+ $arg =~ /^-s$/ and $first_string = shift @ARGV and next;
+ };
+ if (!$dump_file ||
+ !$flt_file ||
+ !$first_string ||
+ !$map_file) {
+ &usage;
+ exit(1);
+ };
+};
+
+sub print_error {
+ my $message = shift;
+ print STDERR "\nERROR: $message\n";
+ exit(1)
+};
+
+sub usage {
+ print STDERR "\nmapgen:\n";
+ print STDERR "Syntax: mapgen -d dump_file -s first_string -f filter_file -m map_file [-h|--help]\n";
+};
+
diff --git a/solenv/bin/mkdir.btm b/solenv/bin/mkdir.btm
new file mode 100644
index 000000000000..5b610c829e52
--- /dev/null
+++ b/solenv/bin/mkdir.btm
@@ -0,0 +1,6 @@
+rem @echo off
+iff "%PERL%" == "" then
+ call perl5 %SOLARENV%\bin\mkdir.pl %1&
+else
+ call %PERL% %SOLARENV%\bin\mkdir.pl %1&
+endiff
diff --git a/solenv/bin/mkdir.pl b/solenv/bin/mkdir.pl
new file mode 100755
index 000000000000..85c2cc78f199
--- /dev/null
+++ b/solenv/bin/mkdir.pl
@@ -0,0 +1,65 @@
+: # -*- perl -*-
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#
+# mkdir - a perl script to substitute mkdir -p
+# accepts "/", ":", and "\" as delimiters of subdirectories
+# options -p (for compatibility)
+# -mode mode
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+
+use Cwd;
+
+$currdir = cwd;
+
+$MODE = 00777 ;
+
+while ( $#ARGV >= 0 ) {
+ if ( $ARGV[0] eq "-mode" ) {
+ $MODE = oct $ARGV[1] ;
+ shift @ARGV ;
+ shift @ARGV ;
+ }
+ elsif ( $ARGV[0] eq "-p" ) {
+ shift @ARGV ;
+ # -p does not do anything, it's supported just for compatibility
+ }
+ else {
+
+ $ARGV[0] =~ s?\\|:?/?g ;
+ @SUBDIRS = split "/", $ARGV[0] ;
+
+ # absolute path UNIX
+ if ( $SUBDIRS[0] eq "" ) {
+ chdir '/' ;
+ shift @SUBDIRS ;
+ }
+ # absolute path WINDOWS
+ if ( $#SUBDIRS > 1 ) {
+ if ( $SUBDIRS[1] eq "" ) {
+ if ( $SUBDIRS[0] =~ /\w/ ) {
+ chdir "$SUBDIRS[0]:\\" ;
+ shift @SUBDIRS ;
+ shift @SUBDIRS ;
+ } ;
+ } ;
+ }
+
+ while (@SUBDIRS) {
+ if ( -e $SUBDIRS[0] ) {
+ if ( ! -d $SUBDIRS[0] ) {
+ die "file exists\n"
+ }
+ }
+ else {
+ mkdir $SUBDIRS[0], $MODE or die "Can't create directory $SUBDIRS[0]"
+ }
+ chdir $SUBDIRS[0] or die "Can't cd to $SUBDIRS[0]" ;
+ shift @SUBDIRS ;
+ } ;
+
+ shift @ARGV ;
+ } ;
+ chdir $currdir;
+}
diff --git a/solenv/bin/mkout.pl b/solenv/bin/mkout.pl
new file mode 100755
index 000000000000..4839b8525bb9
--- /dev/null
+++ b/solenv/bin/mkout.pl
@@ -0,0 +1,162 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#
+# mkout.pl - create output tree
+#
+
+use Cwd;
+use Getopt::Std;
+use File::Path;
+
+#### script id #####
+
+( $script_name = $0 ) =~ s/^.*\b(\w+)\.pl$/$1/;
+
+$id_str = ' $Revision: 1.8 $ ';
+$id_str =~ /Revision:\s+(\S+)\s+\$/
+ ? ($script_rev = $1) : ($script_rev = "-");
+
+print "$script_name -- version: $script_rev\n";
+
+#### globals ####
+
+$is_debug = 0;
+
+$base_dir = 0; # path to module base directory
+$dir_mode = 0755; # default directory creation mode
+
+$envpath = 0; # platform/product combination
+$opt_r = 0; # create 'remote' subdirs
+
+%sub_dirs = (
+# dirname remote(yes/no)
+ 'bin' => 1,
+ 'class' => 0,
+ 'inc' => 0,
+ 'lib' => 1,
+ 'misc/logs' => 1,
+ 'obj' => 1,
+ 'res' => 1,
+ 'slb' => 1,
+ 'slo' => 1,
+ 'srs' => 1
+ );
+
+#### main ####
+
+parse_options();
+init_globals();
+create_dirs();
+
+exit(0);
+
+#### subroutines #####
+
+sub parse_options {
+ my $rc;
+
+ $rc = getopts('r');
+
+ if ( !$rc || $#ARGV > 0 ) {
+ usage();
+ exit(1);
+ }
+ $envpath = $ARGV[0] if defined($ARGV[0]);
+}
+
+sub init_globals {
+ my $umask;
+ $base_dir = get_base();
+ print "Base_Diri=$base_dir\n" if $is_debug;
+
+ $umask = umask();
+ if ( defined($umask) ) {
+ $dir_mode = 0777 - $umask;
+ }
+ $envpath = $ENV{INPATH} unless $envpath;
+
+ if ( !$envpath ) {
+ print_error("can't determine platform/environment");
+ exit(3);
+ }
+ print "Platform/Environment: $envpath\n" if $is_debug;
+}
+
+sub get_base {
+ # a module base dir contains a subdir 'prj'
+ # which in turn contains a file 'd.lst'
+ my (@field, $base, $dlst);
+ my $path = cwd();
+
+ @field = split(/\//, $path);
+
+ while ( $#field != -1 ) {
+ $base = join('/', @field);
+ $dlst = $base . '/prj/d.lst';
+ last if -e $dlst;
+ pop @field;
+ }
+
+ if ( $#field == -1 ) {
+ print_error("can't determine module");
+ exit(2);
+ }
+ else {
+ return $base;
+ }
+}
+
+sub create_dirs {
+ foreach $dir ( keys %sub_dirs ) {
+ $path = $base_dir . '/' . $envpath . '/' . $dir;
+ if ( $opt_r && $sub_dirs{$dir} ) {
+ $path .= "/remote";
+ }
+ eval { mkpath($path, 0, $dir_mode) };
+ if ( $@ ) {
+ print_error( "$@" );
+ }
+ print "Create path: $path\n" if $is_debug;
+ }
+}
+
+sub print_error {
+ my $message = shift;
+
+ print STDERR "$script_name: ERROR: $message\n";
+}
+
+sub usage {
+ print STDERR "Usage:\n$script_name [-r] [platform/environment]\n";
+ print STDERR "Options:\n -r create 'remote' directories\n";
+}
+
+# vim: set ts=4 shiftwidth=4 expandtab syntax=perl:
diff --git a/solenv/bin/modules/CreatePDBRelocators.pm b/solenv/bin/modules/CreatePDBRelocators.pm
new file mode 100644
index 000000000000..753075a2bfea
--- /dev/null
+++ b/solenv/bin/modules/CreatePDBRelocators.pm
@@ -0,0 +1,233 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#*************************************************************************
+#
+# createPDBRelocators - create for pdb relocator files
+# PDB relocator files are used to find debug infos
+# for analysis of creash reports
+#
+# usage: create_pdb_relocators($inpath, $milestoneext, $pre);
+#
+#*************************************************************************
+
+package CreatePDBRelocators;
+
+use strict;
+use File::Basename;
+use SourceConfig;
+
+sub new
+{
+ my $Object = shift;
+ my $solarversion = shift;
+ my $workdir;
+ my $relworkdir;
+ my $self = {};
+ my @basedirs;
+ my @repos;
+
+ if (!defined ($solarversion)) {
+ $solarversion = $ENV{SOLARVERSION};
+ }
+ if ( !$solarversion ) {
+ print STDERR "can't determine SOLARVERSION.\n";
+ exit (1);
+ }
+
+ $self->{SOLARVERSION} = $solarversion;
+
+ $workdir = $ENV{WORKDIR};
+ if ( !$workdir ) {
+ print STDERR "can't determine WORKDIR.\n";
+ exit (1);
+ }
+
+ if ( $workdir =~ /^$solarversion/ ) {
+ $relworkdir = $workdir;
+ $relworkdir =~ s/^$solarversion\///;
+ } else {
+ print STDERR "ERROR: workdir outside $solarversion unsupported\n";
+ exit (2);
+ }
+ my $SourceConfigObj = SourceConfig->new();
+ @repos = $SourceConfigObj->get_repositories();
+ if ( defined $ENV{UPDMINOREXT} ) {
+ foreach my $onedir ( @repos ) {
+ push( @basedirs, $onedir.$ENV{UPDMINOREXT} );
+ }
+ }
+ # basdirs is repositories (dmake) + workdir (gnu make)
+ push(@basedirs, $relworkdir);
+ if (!scalar @basedirs) {
+ print STDERR "no basedir and no working directory found.\n";
+ exit (2);
+ }
+ $self->{BASEDIRS} = \@basedirs;
+ bless($self, $Object);
+ return $self;
+}
+
+sub create_pdb_relocators
+{
+ my $self = shift;
+ my $inpath = shift;
+ my $milestoneext = shift;
+ my $pre = shift;
+
+ my $solarversion = $self->{SOLARVERSION};
+ my $root_dir = "$solarversion/$inpath";
+
+ # sanitize path
+ $root_dir =~ s/\\/\//g;
+ my $o =~ s/\\/\//g;
+ my $premilestoneext = $milestoneext;
+ if ( $pre ne "" ) {
+ $premilestoneext = ~ s/^\.//;
+ $premilestoneext = ".pre$premilestoneext";
+ }
+ my $pdb_dir = $root_dir . "/pdb$premilestoneext";
+ my $pdb_so_dir = $root_dir . "/pdb$premilestoneext/so";
+
+ # create pdb directories if necessary
+ if ( ! -d $pdb_dir ) {
+ if ( !mkdir($pdb_dir, 0775) ) {
+ print STDERR "can't create directory '$pdb_dir'\n";
+ return undef;
+ }
+ }
+ if ( ! -d $pdb_so_dir ) {
+ if ( !mkdir($pdb_so_dir, 0775) ) {
+ print STDERR "can't create directory '$pdb_so_dir'\n";
+ return undef;
+ }
+ }
+
+ # collect files
+ foreach my $basedir (@{$self->{BASEDIRS}}) {
+ my @pdb_files;
+ my $o = $self->{SOLARVERSION} . "/$basedir";
+ $basedir =~ s/(.*?)\.(.*)/$1/;
+ $self->collect_files( $o, $inpath, \@pdb_files);
+
+ foreach (@pdb_files) {
+ my $relocator = basename($_) . ".location";
+ /$o\/(.*)/i;
+
+ my $src_location = $1;
+
+ my $location = "";
+ my $target = "";
+ if ( $src_location =~ /\/so\// )
+ {
+ $location = "../../../$basedir$milestoneext/" . $src_location;
+ $target = "$pdb_dir/so/$relocator";
+ }
+ else
+ {
+ $location = "../../$basedir$milestoneext/" . $src_location;
+ $target = "$pdb_dir/$relocator";
+ }
+
+ if ( !open(RELOCATOR, ">$target") ) {
+ print STDERR "can't write file '$target'\n";
+ return undef;
+ }
+ print RELOCATOR "$location\n";
+ close(RELOCATOR);
+ }
+ }
+ return 1;
+}
+
+sub collect_files_from_all_basedirs
+{
+ my $self = shift;
+ my ($platform, $filesref) = @_;
+ my $basedir;
+ my $ret;
+ foreach $basedir (@{$self->{BASEDIRS}}) {
+ my $srcdir = $self->{SOLARVERSION} . "/$basedir";
+ $ret |= $self->collect_files ($srcdir, $platform, $filesref);
+ }
+ return $ret;
+}
+
+sub collect_files
+{
+ my $self = shift;
+ my ($srcdir, $platform, $filesref) = @_;
+ my $template = "$srcdir/*/$platform";
+ my $template2 = "$srcdir/LinkTarget";
+ if ( $ENV{GUI} eq "WNT" ) {
+ # collect all pdb files on o:
+ # regular glob does not work with two wildcard on WNT
+ my @bin = glob("$template/bin/*.pdb");
+ my @bin_so = glob("$template/bin/so/*.pdb");
+ my @workdir = glob("$template2/*/*.pdb");
+ # we are only interested in pdb files which are accompanied by
+ # .exe or .dll which the same name
+ foreach (@bin, @bin_so, @workdir) {
+ my $dir = dirname($_);
+ my $base = basename($_, ".pdb");
+ my $exe = "$dir/$base.exe";
+ my $dll = "$dir/$base.dll";
+ if ( -e $exe || -e $dll ) {
+ push(@$filesref, $_);
+ }
+ }
+ }
+ else {
+ # collect all shared libraries on o:
+ my @lib = glob("$template/lib/*.so*");
+ my @workdir_lib = glob("$template2/Library/*.so*");
+ my @lib_so = glob("$template/lib/so/*.so*");
+ my @mac_lib = glob("$template/lib/*.dylib*");
+ my @mac_workdir_lib = glob("$template2/Library/*.dylib*");
+ my @mac_lib_so = glob("$template/lib/so/*.dylib*");
+ # collect all binary executables on o:
+ my @bin = $self->find_binary_execs("$template/bin");
+ my @workdir_bin = $self->find_binary_execs("$template2/Executable");
+ my @bin_so = $self->find_binary_execs("$template/bin/so");
+ push(@$filesref, (@lib, @lib_so, @workdir_lib, @mac_lib, @mac_workdir_lib, @mac_lib_so, @bin, @workdir_bin, @bin_so));
+ }
+ return 1;
+}
+
+sub find_binary_execs
+{
+ my $self = shift;
+ my $path = shift;
+ my @files = glob("$path/*");
+ my @execs = grep(-x $_, @files);
+ my @elf_files = grep(`file $_` =~ /ELF/, @execs);
+ my @MachO_files = grep(`file $_` =~ /Mach\-O/, @execs);
+ return ( @elf_files, @MachO_files );
+}
+
+1; # required
+
diff --git a/solenv/bin/modules/Cws.pm b/solenv/bin/modules/Cws.pm
new file mode 100755
index 000000000000..6948c21d554e
--- /dev/null
+++ b/solenv/bin/modules/Cws.pm
@@ -0,0 +1,2153 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+#
+# Cws.pm - package for accessing/manipulating child workspaces
+#
+
+# TODO: needs some cleanup
+
+package Cws;
+use strict;
+
+use Eis;
+use CwsConfig;
+use Carp;
+use URI::Escape;
+
+my $config = CwsConfig::get_config();
+
+##### class data #####
+
+my %CwsClassData = (
+ # EIS database connectivity
+ EIS_URI => 'urn:ChildWorkspaceDataService',
+ EIS_PROXY_LIST => $config->cws_db_url_list_ref(),
+ NET_PROXY => $config->net_proxy(),
+ EIS => undef
+);
+
+##### ctor #####
+
+sub new
+{
+ my $invocant = shift;
+ my $class = ref($invocant) || $invocant;
+ my $self = {};
+ # instance data
+ # initialize CWS name from environment
+ $self->{CHILD} = undef; # name of child workspace
+ $self->{MASTER} = undef; # name of master workspace
+ $self->{EIS_ID} = undef; # id of child workspace in EIS
+ $self->{FILES} = undef; # list of files registered with child
+ # any file can be registered multiple times
+ $self->{PATCH_FILES} = undef # list of product patch files registered with
+ # child, each file can be added only once
+ $self->{MILESTONE} = undef; # master milestone to which child is related
+ $self->{MODULES} = undef; # list of modules belonging to child
+ $self->{INCOMPATIBLE_MODULES} = undef; # list of modules belonging to child
+ $self->{NEW_MODULES} = undef; # list of public new modules belonging to child
+ $self->{NEW_MODULES_PRIV} = undef; # list of private new modules belonging to child
+ $self->{TASKIDS} = undef; # list of tasks registered with child
+ $self->{_CACHED_TAGS} = undef; # list of cached tags (tags are looked up frequently)
+ bless($self, $class);
+ return $self;
+}
+
+#### methods to access instance data ####
+
+# Get the EIS ID for child workspace,
+# return value: undef => not yet asked EIS for ID
+# or connection failed
+# 0 => queried EIS but didn't find such
+# a child workspace for this master
+# silently ignore any parameter, only the EIS database,
+# hands out EIS IDs.
+sub eis_id
+{
+ my $self = shift;
+ if ( !defined($self->{EIS_ID} ) ) {
+ $self->{EIS_ID} = $self->get_eis_id();
+ }
+ return $self->{EIS_ID};
+}
+
+# Generate remaining instance data accessor methods;
+# if this looks strange see 'perldoc perltootc'
+
+# Accessor methods for single value instance data
+for my $datum (qw(master milestone)) {
+ no strict "refs";
+ *$datum = sub {
+ my $self = shift;
+ my $ucdatum = uc($datum);
+ if ( @_ ) {
+ # set item in database
+ my $item = shift;
+ # if we already have a valid EIS registered CWS then reset EIS value
+ # otherwise just set member to the given value
+ if ( !$self->{uc($datum)} # keep order of evaluation
+ || !$self->eis_id()
+ || $self->set_item_in_eis($datum, $item) )
+ {
+ $self->{uc($datum)} = $item;
+
+ }
+ }
+ else {
+ if ( !defined($self->{$ucdatum} ) ) {
+ # fetch item from database
+ $self->{$ucdatum} = $self->fetch_item_from_eis($datum);
+ }
+ }
+ return $self->{uc($datum)};
+ }
+}
+
+# Accessor methods for instance data consisting of item lists
+# like modules and taskids
+for my $datum (qw(files patch_files modules incompatible_modules new_modules new_modules_priv taskids)) {
+ no strict "refs";
+ *$datum = sub {
+ # get current item list
+ # fetch list from EIS database if called the first time
+ my $self = shift;
+ my $ucdatum = uc($datum);
+ if ( !defined($self->{$ucdatum}) ) {
+ # fetch item list from databse
+ $self->{$ucdatum} = $self->fetch_items_from_eis($datum);
+ return undef if !defined($self->{$ucdatum});
+ }
+ return wantarray ? @{$self->{$ucdatum}} : $self->{$ucdatum}
+ }
+}
+
+for my $datum (qw(child)) {
+ no strict "refs";
+ *$datum = sub {
+ my $self = shift;
+ $self->{uc($datum)} = shift if @_;
+ return $self->{uc($datum)};
+ }
+}
+
+
+#### additional public methods ####
+
+# For resync: Sets master and milestone simultaneously
+# In case of a cross master resync it does not make sense to
+# change both items separately
+sub set_master_and_milestone
+{
+ my $self = shift;
+ my $master = shift or return undef;
+ my $milestone = shift or return undef;
+
+ # if we do not yet have a valid EIS registered CWS use the above more basic methods
+ if ( !$self->master()
+ || !$self->milestone()
+ || !$self->eis_id() )
+ {
+ $self->master($master);
+ $self->milestone($milestone);
+ } else {
+ if ( $self->set_master_and_milestone_in_eis($master, $milestone) ) {
+ $self->{'MASTER'} = $self->fetch_item_from_eis('master');
+ $self->{'MILESTONE'} = $self->fetch_item_from_eis('milestone');
+ }
+ }
+ my @retarray = ($self->{'MASTER'}, $self->{'MILESTONE'});
+ return wantarray ? @retarray : \@retarray;
+}
+
+# Query if CWS name is still available. Does not yet register
+# anything with EIS.
+sub is_cws_name_available
+{
+ my $self = shift;
+
+ my $is_available = $self->is_cws_name_available_in_eis();
+ return $is_available;
+}
+
+# Register new child workspace with the EIS database.
+sub register
+{
+ my $self = shift;
+ my $vcsid = shift;
+ my $location = shift;
+
+ my $child_id = $self->register_child_with_eis($vcsid, $location);
+ return $child_id;
+}
+
+# Promote a child workspace with status 'planned' to a full CWS
+sub promote
+{
+ my $self = shift;
+ my $vcsid = shift;
+ my $location = shift;
+
+ my $rc = $self->promote_child_in_eis($vcsid, $location);
+ return $rc;
+}
+
+# New style add_module method. Takes an additional bool indicating if
+# a module is public or private. Obsoletes add_modules()
+sub add_module
+{
+ my $self = shift;
+ my $module = shift;
+ my $public = shift;
+
+ my $items_ref = $self->add_items('modules', $public, $module);
+ if (defined ($items_ref->[0]) && ($items_ref->[0] eq $module)) {
+ return 1; # module has been added
+ }
+ elsif ( defined($items_ref) ) {
+ return 0; # module was already add
+ }
+ return undef; # something went wrong
+}
+
+# Add module to modules list.
+sub add_modules
+{
+ my $self = shift;
+
+ my $items_ref = $self->add_items('modules', undef, @_);
+ return undef unless defined($items_ref);
+ return wantarray ? @{$items_ref} : $items_ref;
+}
+
+# Add tasksids to taskids list.
+sub add_taskids
+{
+ my $self = shift;
+ my $vcsid = shift;
+
+ my $items_ref = $self->add_items('taskids', $vcsid, @_);
+ return undef unless defined($items_ref);
+ return wantarray ? @{$items_ref} : $items_ref;
+}
+
+# Add a file to the files list.
+sub add_file
+{
+ my $self = shift;
+ my $module = shift;
+ my $file = shift;
+ my $revision = shift;
+ my $authors_ref = shift;
+ my $taskids_ref = shift;
+ my $archive_path = shift;
+
+ my $files_ref = $self->files();
+
+ if ( $self->add_file_to_eis($module, $file, $revision,
+ $authors_ref, $taskids_ref, $archive_path) )
+ {
+ push(@{$files_ref}, $file);
+ return 1;
+ }
+ return 0;
+}
+
+# Add a file to the patch file list.
+sub add_patch_file
+{
+ my $self = shift;
+ my $file = shift;
+
+ my $patch_files_ref = $self->patch_files();
+
+ foreach (@{$patch_files_ref}) {
+ return 0 if $file eq $_;
+ }
+
+ if ( $self->add_patch_file_to_eis($file) )
+ {
+ push(@{$patch_files_ref}, $file);
+ return 1;
+ }
+ return 0;
+}
+
+#
+# Procedure retrieves the workspace which
+# is based on cvs head (not branch)
+#
+sub get_cvs_head {
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->getCVSHead() };
+ if ( $@ ) {
+ carp("ERROR: get_eis_id(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+};
+
+#### public class methods ####
+
+sub get_master_tag {
+ my ($self, $master, $milestone) = @_;
+ $master = $self->master() if (!defined $master);
+ $milestone = $self->milestone() if (!defined $milestone);
+ return uc($master) . '_' . lc($milestone);
+};
+
+sub get_master_branch_tag {
+ my ($self, $master) = @_;
+ $master = $self->master() if (!defined $master);
+ # check in environment if master is on the the HEAD branch
+ my $cvs_head = get_cvs_head();
+ if ( $master eq $cvs_head ) {
+ return undef;
+ }
+ else {
+ return 'mws_' . lc($master);
+ }
+};
+
+sub get_mws {
+ my $self = shift;
+ my $eis = Cws::eis();
+ my $masters;
+ my $child = Eis::to_string($self->child());
+ eval { $masters = $eis->getMastersForCWS($child) };
+ if ( $@ ) {
+ carp("ERROR: get_eis_id(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $$masters[0];
+};
+
+# Returns the branch and root tags for child workspace.
+sub get_tags
+{
+ my $self = shift;
+
+ # look up if tags have already been retrieved
+ if ( defined($self->{_CACHED_TAGS}) ) {
+ return @{$self->{_CACHED_TAGS}};
+ }
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $childws = $self->child();
+ # check if child workspace is a clone,
+ if ( $childws =~ /(\w+)_[[:upper:]]{3}\d{3}/ ) {
+ $childws = $1;
+ }
+
+ # check in environment if master is on the the HEAD branch
+ my $cvs_head = get_cvs_head();
+ my $current_master = $self->master();
+ my $creation_master = $self->get_creation_master();
+ if ( !$creation_master ) {
+ carp("ERROR: Can't determine creation MWS.\n");
+ return undef;
+ }
+ my $milestone = $self->milestone();
+
+ my $master_branch_tag
+ = (lc($current_master) eq lc($cvs_head)) ? '' : 'mws_' . lc($current_master);
+ my $cws_branch_tag = 'cws_' . lc($creation_master) . '_' . lc($childws);
+ my $cws_root_tag = uc($cws_branch_tag) . "_ANCHOR";
+ my $master_milestone_tag = uc($current_master) . "_" . $milestone;
+
+ $self->{_CACHED_TAGS} = [$master_branch_tag, $cws_branch_tag, $cws_root_tag, $master_milestone_tag];
+ return @{$self->{_CACHED_TAGS}};
+}
+
+# Get childworkspace owner
+sub get_owner
+{
+ my $self = shift;
+
+ return $self->get_owner_from_eis();
+}
+
+# get childworkspace qarep
+sub get_qarep
+{
+ my $self = shift;
+
+ return $self->get_qarep_from_eis();
+}
+
+# store an Attachment to a given CWS
+sub save_attachment
+{
+ my $self = shift;
+ my $name = shift;
+ my $mediatype = shift;
+ my $data = shift;
+
+ return $self->save_attachment_in_eis($name, $mediatype, $data);
+}
+
+# Get child workspace approval status,
+# return values can be:
+# 'planned', 'new', 'nominated', 'integrated'
+# and undef in case of error.
+sub get_approval
+{
+ my $self = shift;
+
+ return $self->get_status_from_eis();
+}
+
+# Set child workspace approval status
+# to 'integrated'. Return true if successful
+# or undef in case of error
+sub set_integrated
+{
+ my $self = shift;
+
+ return $self->set_status_in_eis();
+}
+
+# Set child workspace integration milestone
+# Return true if successful or undef in case of error
+sub set_integration_milestone
+{
+ my $self = shift;
+ my $milestone = shift;
+ my $buildid = shift;
+
+ return $self->set_integration_milestone_in_eis($milestone, $buildid);
+}
+
+# Get the MWS on which a CWS was created
+sub get_creation_master
+{
+ my $self = shift;
+
+ return $self->get_creation_master_from_eis();
+}
+
+# Get the 'public' flag indicating whether a CWS is visible on OOo
+sub get_public_flag
+{
+ my $self = shift;
+
+ return $self->get_public_flag_from_eis();
+}
+
+
+# Get the 'publicmaster' flag indicating whether a MWS is visible on OOo
+sub get_publicmaster_flag
+{
+ my $self = shift;
+
+ return $self->get_publicmaster_flag_from_eis();
+}
+
+
+sub get_subversion_flag {
+
+ my $self = shift;
+
+ return $self->get_subversion_flag_from_eis();
+}
+
+sub set_subversion_flag {
+
+ my $self = shift;
+ my $value = shift;
+
+ return $self->set_subversion_flag_in_eis($value);
+}
+
+sub get_scm {
+ my $self = shift;
+
+ return $self->get_scm_from_eis();
+}
+
+sub set_scm {
+ my $self = shift;
+ my $scm_name = shift;
+
+ return $self->set_scm_in_eis($scm_name);
+}
+
+
+# Check if milestone exists
+sub is_milestone
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+
+ return $self->is_milestone_registered_with_eis($master, $milestone);
+}
+
+# Check if this cws contains new ui
+sub is_uirelevant
+{
+ my $self = shift;
+
+ return $self->is_uirelevant_from_eis();
+}
+
+# Check if this cws contains new online help
+sub is_helprelevant
+{
+ my $self = shift;
+
+ return $self->is_helprelevant_from_eis();
+}
+
+# Set the l10n status
+sub set_l10n_status
+{
+ my $self = shift;
+ my $status = shift;
+
+ return $self->set_l10n_status_in_eis( $status );
+}
+
+# Get the l10n status
+sub get_l10n_status
+{
+ my $self = shift;
+
+ return $self->get_l10n_status_from_eis();
+}
+sub set_word_count
+{
+ my $self = shift;
+ my $language = shift;
+ my $wordcount = shift;
+
+ return $self->set_word_count_in_eis( $language , $wordcount );
+}
+
+
+# Get target release for CWS
+sub get_release
+{
+ my $self = shift;
+
+ return $self->get_release_from_eis();
+}
+
+# Get due date
+sub get_due_date
+{
+ my $self = shift;
+
+ return $self->get_due_date_from_eis();
+}
+
+# Get due date QA
+sub get_due_date_qa
+{
+ my $self = shift;
+
+ return $self->get_due_date_qa_from_eis();
+}
+
+# Query master milestone combination for being used by an
+# active CWS
+sub is_milestone_used
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+
+ return $self->get_is_milestone_used_from_eis($master, $milestone);
+}
+
+# Set current milestone for MWS.
+sub set_current_milestone
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+
+ return $self->set_current_milestone_in_eis($master, $milestone);
+}
+
+# Get current milestone for MWS.
+sub get_current_milestone
+{
+ my $self = shift;
+ my $master = shift;
+
+ return $self->get_current_milestone_from_eis($master);
+}
+
+sub get_milestone_integrated
+{
+ my $self = shift;
+
+ return $self->get_milestone_integrated_from_eis();
+}
+
+# Get masters
+sub get_masters
+{
+
+ my $self = shift;
+
+ return $self->get_masters_from_eis();
+}
+
+# Get milestones for MWS.
+sub get_milestones
+{
+ my $self = shift;
+ my $master = shift;
+
+ return $self->get_milestones_from_eis($master);
+}
+# get build string for CWS
+
+sub get_build
+{
+ my $self = shift;
+ my $master = $self->master();
+ my $milestone = $self->milestone();
+ if ( ! defined($milestone) ) {
+ return undef;
+ }
+ my $bid=$self->get_buildid($master,$milestone);
+ if ( ! defined($bid) ) {
+ return undef;
+ }
+ return $self->expand_buildid($bid);
+}
+
+
+
+# expand build for given cwsname
+sub expand_buildid
+{
+ my $self = shift;
+ my $bid = shift;
+ return $self->expand_buildid_in_eis($bid);
+}
+
+
+# Set BuildID of milestone
+sub set_milestone_buildid
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+ my $buildid = shift;
+
+ return $self->set_milestone_buildid_in_eis($master, $milestone, $buildid);
+}
+
+# Declare milestone 'removed'
+# This triggers EIS to send emails to all (SO-internal) CWS owners
+# with living CWSs based on that milestone.
+sub milestone_removed
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+
+ return $self->set_milestone_removed_in_eis($master, $milestone);
+}
+
+
+# Get all child workspaces which have been integrated on a
+# given master and milestone.
+sub get_integrated_cws
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+
+ my $childworkspaces_arrref = $self->get_childworkspaces_for_milestone($master, $milestone);
+ if ( !$childworkspaces_arrref ) {
+ $childworkspaces_arrref = [];
+ }
+ return wantarray ? @$childworkspaces_arrref : $childworkspaces_arrref;
+}
+
+
+# Get builid for given master and milestone.
+sub get_buildid
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+
+ return $self->get_buildid_for_milestone($master, $milestone);
+}
+
+#
+# Get all cws' with a status passed
+#
+sub get_cws_with_state
+{
+ my $self = shift;
+ my $mws = shift;
+ my $status = shift;
+
+ return wantarray ? @{$self->get_cws_with_state_from_eis($mws, $status)}
+ : $self->get_cws_with_state_from_eis($mws, $status);
+}
+
+sub get_task_prio_cws
+{
+ my $self = shift;
+ my $ref_taskids = shift;
+ return @{$self->get_task_prios_of_tasks($ref_taskids)};
+}
+
+# Check is CWS is cloneable for specified master
+sub is_cws_cloneable
+{
+ my $self = shift;
+ my $master = shift;
+
+ return $self->get_is_cws_cloneable_from_eis($master);
+}
+
+# Clone CWS for specified master
+sub clone_cws
+{
+ my $self = shift;
+ my $master = shift;
+
+ return $self->clone_cws_in_eis($master);
+}
+
+sub set_log_entry
+{
+ my $self = shift;
+ my $commandline = shift;
+ my $vcsid = shift;
+ my $start = shift;
+ my $stop = shift;
+ my $comment = shift;
+ return $self->set_log_entry_in_eis($commandline, $vcsid, $start, $stop, $comment);
+}
+
+sub set_log_entry_extended
+{
+ my $self = shift;
+ my $commandname = shift;
+ my $parameter = shift;
+ my $vcsid = shift;
+ my $start = shift;
+ my $stop = shift;
+ my $comment = shift;
+ my $mastername = shift;
+ my $childname = shift;
+#set_log_entry_extended_in_eis($commandname, $parameter, $vcsid, $start, $stop, $comment, $mastername, $childname);
+ return $self->set_log_entry_extended_in_eis($commandname, $parameter, $vcsid, $start, $stop, $comment, $mastername, $childname);
+}
+
+
+#### private ####
+
+# class data accessor methods
+sub eis
+{
+ shift; # ignore calling class/object
+ $CwsClassData{EIS} = shift if @_;
+ if ( !defined($CwsClassData{EIS}) ) {
+ $CwsClassData{EIS} = init_eis_connector();
+ }
+ return $CwsClassData{EIS};
+}
+
+# generate remaining class data accessor methods
+# if this looks strange see 'perldoc perltootc'
+for my $datum (qw(eis_uri eis_proxy_list net_proxy)) {
+ no strict "refs";
+ *$datum = sub {
+ shift; # ignore calling class/object
+ return $CwsClassData{uc($datum)};
+ }
+}
+
+#### helper methods ####
+
+# instance methods
+
+# Add item to items list,
+# update eis database,
+# returns a list of newly added items,
+# specifying an existing item is not an
+# error, but it want appear in the return list.
+sub add_items
+{
+ my $self = shift;
+ my $type = shift;
+ my $optional_data = shift;
+
+ my $items_ref;
+ if ( $type eq 'modules' ) {
+ $items_ref = $self->modules();
+ }
+ elsif ( $type eq 'taskids' ) {
+ $items_ref = $self->taskids();
+ }
+ else {
+ # fall through, can't happen
+ carp("ERROR: wrong item type\n");
+ return undef;
+ }
+
+ my $item;
+ my @new_items = ();
+ return undef if !defined($items_ref);
+ # find which items which are not already in items list
+ ITEM: while ( $item = shift ) {
+ foreach ( @{$items_ref} ) {
+ next ITEM if $_ eq $item;
+ }
+ push(@new_items, $item);
+ }
+ if ( $#new_items > -1 ) {
+ # add items to database
+ if ( $self->add_items_to_eis($type, $optional_data, \@new_items) ) {
+ push(@{$items_ref}, @new_items);
+ }
+ else {
+ # something went wrong
+ return undef;
+ }
+ }
+ return \@new_items;
+}
+
+# Get EIS id for workspace from EIS database
+sub get_eis_id
+{
+ my $self = shift;
+ my $eis = Cws::eis();
+
+ # It's not an error if one of these is unset, so don't carp().
+ if ( !$self->master() || !$self->child() ) {
+ return undef;
+ }
+
+ my $master = Eis::to_string($self->master());
+ my $child = Eis::to_string($self->child());
+
+ my $result;
+ eval { $result = int($eis->getChildWorkspaceId($master, $child)) };
+ if ( $@ ) {
+ carp("ERROR: get_eis_id(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub fetch_item_from_eis
+{
+ my $self = shift;
+ my $type = shift;
+
+ my $eis = Cws::eis();
+ my $id = $self->eis_id();
+
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $result;
+ if ( $type eq 'milestone' ) {
+ eval { $result = $eis->getMilestone($id) };
+ }
+ elsif ( $type eq 'master' ) {
+ # master can't be queried from the EIS database,
+ # just return what already in member
+ return $self->{MASTER}
+ }
+ else {
+ # fall through, can't happen
+ carp("ERROR: wrong item type\n");
+ return undef;
+ }
+ if ( $@ ) {
+ carp("ERROR: fetch_item(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub set_item_in_eis
+{
+ my $self = shift;
+ my $type = shift;
+ my $item = shift;
+
+ my $eis = Cws::eis();
+ my $id = $self->eis_id();
+
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ # make certain that the item is a string, otherwise
+ # autotyping will occasionally choose the wrong type
+ $item = Eis::to_string($item);
+
+ my $result;
+ if ( $type eq 'milestone' ) {
+ # this operation invalidates the cached tags list
+ $self->{_CACHED_TAGS} = undef;
+ eval { $result = $eis->setMilestone($id, $item) };
+ }
+ elsif ( $type eq 'master' ) {
+ # this operation invalidates the cached tags list
+ $self->{_CACHED_TAGS} = undef;
+ eval { $result = $eis->setMasterWorkspace($id, $item) };
+ }
+ else {
+ # fall through, can't happen
+ carp("ERROR: wrong item type\n");
+ return 0;
+ }
+
+ if ( $@ ) {
+ carp("ERROR: set_item(): EIS database transaction failed. Reason:\n$@\n");
+ return undef;
+ }
+ return 1 if $result;
+ return 0;
+}
+
+sub set_master_and_milestone_in_eis
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+
+ my $eis = Cws::eis();
+ my $id = $self->eis_id();
+
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ # make certain that the item is a string, otherwise
+ # autotyping will occasionally choose the wrong type
+ $master = Eis::to_string($master);
+ $milestone = Eis::to_string($milestone);
+
+ my $result;
+ # this operation invalidates the cached tags list
+ $self->{_CACHED_TAGS} = undef;
+ eval { $result = $eis->setMasterWorkspaceAndMilestone($id, $master, $milestone) };
+
+ if ( $@ ) {
+ carp("ERROR: set_master_and_milestone(): EIS database transaction failed. Reason:\n$@\n");
+ return undef;
+ }
+ return 1 if $result;
+ return 0;
+}
+
+sub fetch_items_from_eis
+{
+ my $self = shift;
+ my $type = shift;
+
+ my $eis = Cws::eis();
+ my $id = $self->eis_id();
+
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $result;
+ if ( $type eq 'modules' ) {
+ eval { $result = $eis->getModules($id) };
+ }
+ elsif ( $type eq 'incompatible_modules' ) {
+ eval { $result = $eis->getIncompatibleModules($id) };
+ }
+ elsif ( $type eq 'new_modules' ) {
+ eval { $result = $eis->getNewModules($id) };
+ }
+ elsif ( $type eq 'new_modules_priv' ) {
+ eval { $result = $eis->getNewModulesPriv($id) };
+ }
+ elsif ( $type eq 'taskids' ) {
+ eval { $result = $eis->getTaskIds($id) };
+ }
+ elsif ( $type eq 'files' ) {
+ eval { $result = $eis->getFiles($id) };
+ }
+ elsif ( $type eq 'patch_files' ) {
+ eval { $result = $eis->getOutputFiles($id) };
+ }
+ else {
+ # fall through, can't happen
+ carp("ERROR: wrong item type\n");
+ return undef;
+ }
+ if ( $@ ) {
+ carp("ERROR: fetch_item(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub add_items_to_eis
+{
+ my $self = shift;
+ my $type = shift;
+ my $optional_data = shift;
+ my $item_ref = shift;
+
+ my $eis = Cws::eis();
+ my $id = $self->eis_id();
+
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ # make certain that all items are strings, otherwise
+ # autotyping will occasionally choose the wrong type
+ my @items = ();
+ foreach ( @{$item_ref} ) {
+ push(@items, Eis::to_string($_));
+ }
+
+ my $result;
+ if ( $type eq 'modules' ) {
+ if ( defined($optional_data) ) {
+ # add a module new style, with public attribute
+ eval { $result = $eis->addModule($id, $items[0], $optional_data) };
+ }
+ else {
+ # old style, add a list of modules
+ eval { $result = $eis->addModules($id, \@items) };
+ }
+ }
+ elsif ( $type eq 'taskids' ) {
+ eval { $result = $eis->addTaskIds($id, \@items, $optional_data) };
+ }
+ else {
+ # fall through, can't happen
+ carp("ERROR: wrong item type\n");
+ return 0;
+ }
+
+ if ( $@ ) {
+ carp("ERROR: add_item(): EIS database transaction failed. Reason:\n$@\n");
+ return undef;
+ }
+ return 1 if $result;
+ return 0;
+}
+
+sub add_file_to_eis
+{
+ my $self = shift;
+ my $module = shift;
+ my $file = shift;
+ my $revision = shift;
+ my $authors_ref = shift;
+ my $taskids_ref = shift;
+ my $archive_path = shift;
+
+
+ my $eis = Cws::eis();
+ my $id = $self->eis_id();
+
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ # make certain that all task_ids are strings, otherwise
+ # autotyping will choose the wrong type
+ # Note: I think typing just the first element should suffice, but ...
+ my @taskids = ();
+ foreach ( @{$taskids_ref} ) {
+ push(@taskids, Eis::to_string($_));
+ }
+ # HACK Its possible that we get no valid taskid.
+ # Autotyping will fail for a list without elements;
+ if ( !@taskids ) {
+ push(@taskids, Eis::to_string(''));
+ }
+
+ # same for revision
+ $revision = Eis::to_string($revision);
+
+ if ( !$archive_path ) {
+ $archive_path = Eis::to_string('');
+ }
+
+ my $result;
+ eval {
+ $result = $eis->addFile($id, $module, $file, $archive_path,
+ $revision, $authors_ref, \@taskids)
+ };
+ if ( $@ ) {
+ carp("ERROR: add_file(): EIS database transaction failed. Reason:\n$@\n");
+ return undef;
+ }
+ return 1 if $result;
+ return 0;
+}
+
+sub add_patch_file_to_eis
+{
+ my $self = shift;
+ my $file = shift;
+
+ my $eis = Cws::eis();
+ my $id = $self->eis_id();
+
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $result;
+ eval { $result = $eis->addOutputFile($id, $file) };
+ if ( $@ ) {
+ carp("ERROR: add_patch_file(): EIS database transaction failed. Reason:\n$@\n");
+ return undef;
+ }
+ return $1;# appOutputFile has void as return value ...
+}
+
+sub is_cws_name_available_in_eis
+{
+ my $self = shift;
+
+ if ( !$self->master() ) {
+ carp("ERROR: master workspace name not set\n");
+ return undef;
+ }
+
+ if ( !$self->child() ) {
+ carp("ERROR: child workspace name not set\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $master = Eis::to_string($self->master());
+ my $child = Eis::to_string($self->child());
+
+ my $result;
+ eval { $result = $eis->isChildWorkspaceUnique($master, $child) };
+ if ( $@ ) {
+ carp("ERROR: is_cws_name_available(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub register_child_with_eis
+{
+ my $self = shift;
+ my $vcsid = shift;
+ my $location = shift;
+
+ if ( !$self->master() ) {
+ carp("ERROR: master workspace name not set\n");
+ return undef;
+ }
+
+ if ( !$self->milestone() ) {
+ carp("ERROR: master milestone not set\n");
+ return undef;
+ }
+
+ if ( !$self->child() ) {
+ carp("ERROR: child workspace name not set\n");
+ return undef;
+ }
+
+ $vcsid = '' unless $vcsid;
+ $location = '' unless $location;
+
+ my $eis = Cws::eis();
+ my $master = Eis::to_string($self->master());
+ my $milestone = Eis::to_string($self->milestone());
+ my $child = Eis::to_string($self->child());
+
+ $vcsid = Eis::to_string($vcsid);
+ $location = Eis::to_string($location);
+
+ my $result;
+ eval {
+ $result = $eis->createChildWorkspace($master, $milestone, $child,
+ $vcsid, $location)
+ };
+
+ if ( $@ ) {
+ carp("ERROR: create_child_workspace(): EIS database transaction failed. Reason:\n$@\n");
+ return undef;
+ }
+ # set EIS_ID directly, since $self->eis_id() is not
+ # supposed to take parameters.
+ $self->{EIS_ID} = $result;
+ return $result;
+}
+
+sub promote_child_in_eis
+{
+ my $self = shift;
+ my $vcsid = shift;
+ my $location = shift;
+
+ my $eis = Cws::eis();
+ my $id = $self->eis_id();
+
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ if ( !$self->milestone() ) {
+ carp("ERROR: master milestone not set\n");
+ return undef;
+ }
+
+ my $milestone = Eis::to_string($self->milestone());
+
+ $vcsid = '' unless $vcsid;
+ $location = '' unless $location;
+
+ $vcsid = Eis::to_string($vcsid);
+ $location = Eis::to_string($location);
+
+ my $result;
+ eval {
+ $result = $eis->initializeChildWorkspace($id, $milestone, $vcsid, $location)
+ };
+
+ eval { $result = $eis->getStatus($id) };
+ if ( $@ ) {
+ carp("ERROR: promote(): EIS database transaction failed. Reason:\n$@\n");
+ return 0;
+ }
+ return 1;
+}
+
+# Get child workspace owner from EIS,
+# return undef in case of error.
+sub get_owner_from_eis
+{
+ my $self = shift;
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->getOwnerEmail($id) };
+ if ( $@ ) {
+ carp("ERROR: get_OwnerEmail(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+# Get child workspace qarep from EIS,
+# return undef in case of error.
+sub get_qarep_from_eis
+{
+ my $self = shift;
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->getQARepresentativeEmail($id) };
+ if ( $@ ) {
+ carp("ERROR: get_qarep(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+# store an attachment to a given CWS
+# return undef in case of error.
+sub save_attachment_in_eis
+{
+ my $self = shift;
+ my $name = shift;
+ my $mediatype = shift;
+ my $text = shift;
+
+ # check if child workspace is valid
+ my $eisid = $self->eis_id();
+ if ( !$eisid )
+ {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eisname = Eis::to_string($name);
+ my $eismediatype = Eis::to_string($mediatype);
+ my $eistextstring = Eis::to_string($text);
+
+ my $eis = Cws::eis();
+ my $result;
+
+ eval { $result = $eis->saveAttachment($eisid, $eisname, $eismediatype, $eistextstring ) };
+ if ( $@ ) {
+ carp("ERROR: save_attachment_in_eis(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+# Get child workspace approval status from EIS,
+# return undef in case of error.
+sub get_status_from_eis
+{
+ my $self = shift;
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->getStatus($id) };
+ if ( $@ ) {
+ carp("ERROR: get_status(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+# Get child workspace approval status from EIS,
+# return undef in case of error.
+sub set_status_in_eis
+{
+ my $self = shift;
+ my $status = shift;
+ my $method = 'set';
+ $method .= (defined $status) ? $status : 'Integrated';
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+ my $eis = Cws::eis();
+ my $result;
+ if (defined $status) {
+ eval { $result = $eis->setFixedOnMaster($id) };
+ } else {
+ eval { $result = $eis->setIntegrated($id) };
+ }
+ if ( $@ ) {
+ carp("ERROR: $method(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+# Get child workspace approval status from EIS,
+# return undef in case of error.
+sub set_integration_milestone_in_eis
+{
+ my $self = shift;
+ my $milestone = shift;
+ my $buildid = shift;
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+
+ # just in case ...
+ if ( !defined($milestone) ) {
+ $milestone = Eis::to_string('');
+ }
+ # $buildid must be transfered as string
+ if ( !defined($buildid) ) {
+ $buildid = Eis::to_string('');
+ }
+ else {
+ $buildid = Eis::to_string($buildid);
+ }
+
+ my $result;
+ eval { $result = $eis->setIntegrationMilestone($id, $milestone, $buildid) };
+ if ( $@ ) {
+ carp("ERROR: set_integration_milestone(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub set_milestone_buildid_in_eis
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+ my $buildid = shift;
+
+ $master = Eis::to_string($master);
+ $milestone = Eis::to_string($milestone);
+ $buildid = Eis::to_string($buildid);
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->setMilestoneBuild( $master, $milestone, $buildid ) };
+ if ( $@ ) {
+ carp("ERROR: set_milestone_buildid(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub set_current_milestone_in_eis
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+
+ $master = Eis::to_string($master);
+ $milestone = Eis::to_string($milestone);
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->setCurrentMilestone( $master, $milestone ) };
+ if ( $@ ) {
+ carp("ERROR: set_current_milestone(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub get_current_milestone_from_eis
+{
+ my $self = shift;
+ my $master = shift;
+
+ $master = Eis::to_string($master);
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->getCurrentMilestone( $master ) };
+ if ( $@ ) {
+ carp("ERROR: get_current_milestone(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub get_masters_from_eis
+{
+ my $self = shift;
+
+ my $eis = Cws::eis();
+ my @result;
+ eval { @result = $eis->getMasterWorkspaces() };
+ if ( $@ ) {
+ carp("ERROR: get_masters(): EIS database transaction failed. Reason:\n$@\n");
+ }
+
+ my @result2=();
+ my $i=0;
+ while ( defined($result[0][$i]) ) {
+ push @result2,$result[0][$i];
+ $i++;
+ }
+ return @result2;
+}
+
+
+sub get_milestones_from_eis
+{
+ my $self = shift;
+ my $master = shift;
+
+ $master = Eis::to_string($master);
+
+ my $eis = Cws::eis();
+ my @result;
+ eval { @result = $eis->getMilestones( $master ) };
+ if ( $@ ) {
+ carp("ERROR: get_milestones(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ my @result2=();
+ my $i=0;
+ while ( defined($result[0][$i]) ) {
+ push @result2,$result[0][$i];
+ $i++;
+ }
+ return @result2;
+}
+
+# Get child workspace owner from EIS,
+# return undef in case of error.
+sub expand_buildid_in_eis
+{
+ my $self = shift;
+ my $bid = shift;
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $name = $self->child();
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->expandBuildId($bid, $name) };
+ if ( $@ ) {
+ carp("ERROR: expand_builid(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub set_milestone_removed_in_eis
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+
+ $master = Eis::to_string($master);
+ $milestone = Eis::to_string($milestone);
+
+ my $eis = Cws::eis();
+ eval { $eis->minorRemoved( $master, $milestone ) };
+ if ( $@ ) {
+ carp("ERROR: set_current_milestone(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return;
+}
+
+sub is_milestone_registered_with_eis
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+
+ $master = Eis::to_string($master);
+ $milestone = Eis::to_string($milestone);
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->isMilestoneValid($master, $milestone) };
+ if ( $@ ) {
+ carp("ERROR: is_milestone(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub get_is_milestone_used_from_eis
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+
+ $master = Eis::to_string($master);
+ $milestone = Eis::to_string($milestone);
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->isMilestoneInUse($master, $milestone) };
+ if ( $@ ) {
+ carp("ERROR: is_milestone_used(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub get_buildid_for_milestone
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+
+ $master = Eis::to_string($master);
+ $milestone = Eis::to_string($milestone);
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->getMilestoneBuild($master, $milestone) };
+ if ( $@ ) {
+ carp("ERROR: get_buildid_for_milestone(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub get_childworkspaces_for_milestone
+{
+ my $self = shift;
+ my $master = shift;
+ my $milestone = shift;
+
+ $master = Eis::to_string($master);
+ $milestone = Eis::to_string($milestone);
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->searchChildWorkspacesForMilestone($master, $milestone) };
+ if ( $@ ) {
+ carp("ERROR: get_childworkspaces_for_milestone(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub get_cws_with_state_from_eis {
+ my $self = shift;
+ my $mws = shift;
+ my $status = shift;
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->getCWSWithState($mws, $status) };
+ if ( $@ ) {
+ carp("ERROR: get_cws_with_state_from_eis(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub get_task_prios_of_tasks
+{
+ my $self = shift;
+ my $ref_taskids = shift;
+
+ my $eis = Cws::eis();
+ my $result;
+ my @items = ();
+ foreach ( @{$ref_taskids} ) {
+ push(@items, Eis::to_string($_));
+ }
+
+ eval { $result = $eis->getTasksPriorities( \@items ) };
+ if ( $@ ) {
+ carp("ERROR: get_task_prios_of_tasks(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub get_creation_master_from_eis
+{
+ my $self = shift;
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->getCreationMasterWorkspace($id) };
+ if ( $@ ) {
+ carp("ERROR: get_creation_master(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+
+}
+
+sub get_milestone_integrated_from_eis
+{
+ my $self = shift;
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->getMilestoneIntegrated($id) };
+ if ( $@ ) {
+ carp("ERROR: get_milestone_integrated(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+
+}
+
+# get isPublic flag from eis
+sub get_public_flag_from_eis
+{
+ my $self = shift;
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->isPublic($id) };
+ if ( $@ ) {
+ carp("ERROR: get_public_flag(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+# get isPublicMaster flag from eis
+sub get_publicmaster_flag_from_eis
+{
+ my $self = shift;
+
+ # check if child workspace is valid
+ my $master = $self->master();
+ if ( !$master ) {
+ carp("ERROR: MasterWorkspace not defined.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->isPublicMaster($master) };
+ if ( $@ ) {
+ carp("ERROR: get_publicmaster_flag(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+# get isSubVersion flag from eis
+sub get_subversion_flag_from_eis
+{
+ my $self = shift;
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->isSubVersion($id) };
+ if ( $@ ) {
+ carp("ERROR: get_subversion_flag(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+# set isSubVersion flag in eis
+sub set_subversion_flag_in_eis
+{
+ my $self=shift;
+ my $status=shift;
+
+ my $bool_status=SOAP::Data->type(boolean => $status);
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->setSubVersion($id,$bool_status) };
+ if ( $@ ) {
+ carp("ERROR: get_subversion_flag(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub get_scm_from_eis
+{
+ my $self = shift;
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->getSCMName($id) };
+ if ( $@ ) {
+ carp("ERROR: get_scm_from_eis(): EIS database transaction failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+sub set_scm_in_eis
+{
+ my $self = shift;
+ my $scm_name = shift;
+
+ $scm_name = Eis::to_string($scm_name);
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ eval { $eis->setSCMName($id, $scm_name) };
+ if ( $@ ) {
+ carp("ERROR: set_scm_in_eis(): EIS database transaction failed. Reason:\n$@\n");
+ return 0;
+ }
+ return 1;
+}
+
+sub is_uirelevant_from_eis
+{
+ my $self = shift;
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->isUIRelevant($id) };
+ if ( $@ ) {
+ carp("ERROR: is_uirelevant_from_eis(): EIS database transaction failed. Reason:\n$@\n");
+ }
+
+ return $result;
+}
+
+sub is_helprelevant_from_eis
+{
+ my $self = shift;
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->isHelpRelevant( $id ) };
+ if ( $@ ) {
+ carp("ERROR: is_helprelevant_from_eis(): EIS database transaction failed. Reason:\n$@\n");
+ }
+
+ return $result;
+}
+sub set_word_count_in_eis
+{
+ my $self = shift;
+ my $language = shift;
+ my $wordcount = shift;
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->setWordCount( $id , $language , $wordcount ) };
+ if ( $@ ) {
+ carp("ERROR: set_word_count_from_eis(): EIS database transaction failed. Reason:\n$@\n");
+ }
+
+ return $result;
+}
+
+
+sub get_l10n_status_from_eis
+{
+ my $self = shift;
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->getL10n( $id ) };
+ if ( $@ ) {
+ carp("ERROR: get_l10n_status_from_eis(): EIS database transaction failed. Reason:\n$@\n");
+ }
+
+ return $result;
+}
+
+sub set_l10n_status_in_eis
+{
+ my $self = shift;
+ my $status = Eis::to_string( shift );
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+
+ eval { $result = $eis->setL10n( $id , $status ) };
+ if ( $@ ) {
+ carp("ERROR: set_l10n_status_in_eis(): EIS database transaction failed. Reason:\n$@\n");
+ }
+
+ return $result;
+}
+
+sub get_is_cws_cloneable_from_eis
+{
+ my $self = shift;
+ my $master = Eis::to_string( shift );
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+
+ eval { $result = $eis->isClonableForMaster($id, $master) };
+ if ( $@ ) {
+ carp("ERROR: get_is_cws_cloneable_from_eis(): EIS database transaction failed. Reason:\n$@\n");
+ }
+
+ return $result;
+}
+
+sub clone_cws_in_eis
+{
+ my $self = shift;
+ my $master = Eis::to_string( shift );
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+
+ eval { $eis->cloneForMaster($id, $master) };
+ if ( $@ ) {
+ carp("ERROR: clone_cws_in_eis(): EIS database transaction failed. Reason:\n$@\n");
+ return 0;
+ }
+
+ return 1;
+}
+
+sub get_release_from_eis
+{
+ my $self = shift;
+ my $master = Eis::to_string( shift );
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+
+ eval { $result = $eis->getRelease($id) };
+ if ( $@ ) {
+ carp("ERROR: get_release_from_eis(): EIS database transaction failed. Reason:\n$@\n");
+ }
+
+ return $result;
+}
+
+sub get_due_date_from_eis
+{
+ my $self = shift;
+ my $master = Eis::to_string( shift );
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+
+ eval { $result = $eis->getDueDate($id) };
+ if ( $@ ) {
+ carp("ERROR: get_due_date_from_eis(): EIS database transaction failed. Reason:\n$@\n");
+ }
+
+ return $result;
+}
+
+sub get_due_date_qa_from_eis
+{
+ my $self = shift;
+ my $master = Eis::to_string( shift );
+
+ # check if child workspace is valid
+ my $id = $self->eis_id();
+ if ( !$id ) {
+ carp("ERROR: Childworkspace not (yet) registered with EIS.\n");
+ return undef;
+ }
+
+ my $eis = Cws::eis();
+ my $result;
+
+ eval { $result = $eis->getDueDateQA($id) };
+ if ( $@ ) {
+ carp("ERROR: get_due_date_qa_from_eis(): EIS database transaction failed. Reason:\n$@\n");
+ }
+
+ return $result;
+}
+
+
+#logging
+sub set_log_entry_in_eis
+{
+ my $self = shift;
+ my $commandline = shift;
+ my $vcsid = shift;
+ my $start = shift;
+ my $end = shift;
+ my $comment = shift;
+
+ $commandline = SOAP::Data->type(string => $commandline);
+ $comment = SOAP::Data->type(string => $comment);
+
+ # *format* for $start and $end = "2003-05-28 12:34:59";
+
+#=====================================================
+ #TO DO:
+ #experimenell für saubere schnittstelle
+ #$start = SOAP::Data->type(dateTime => $start);
+ #$end = SOAP::Data->type(dateTime => $end);
+#=====================================================
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->storeCommandLogEntry( $commandline, $vcsid, $start, $end, $comment ) };
+ if ( $@ ) {
+ carp("ERROR: set_log_entry(): Logging failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+#set_log_entry_extended_in_eis($commandname, $parameter, $vcsid, $start, $stop, $comment, $mastername, $childname);
+sub set_log_entry_extended_in_eis
+{
+ my $self = shift;
+ my $commandname = shift;
+ my $parameter = shift;
+ my $vcsid = shift;
+ my $start = shift;
+ my $end = shift;
+ my $comment = shift;
+ my $mastername = shift;
+ my $childname = shift;
+
+ $commandname = SOAP::Data->type(string => $commandname);
+ $parameter = SOAP::Data->type(string => $parameter);
+ $comment = SOAP::Data->type(string => $comment);
+ $mastername = SOAP::Data->type(string => $mastername);
+ $childname = SOAP::Data->type(string => $childname);
+
+ # *format* for $start and $end = "2003-05-28 12:34:59";
+
+#=====================================================
+ #TO DO:
+ #experimenell für saubere schnittstelle
+ #$start = SOAP::Data->type(dateTime => $start);
+ #$end = SOAP::Data->type(dateTime => $end);
+#=====================================================
+
+ my $eis = Cws::eis();
+ my $result;
+ eval { $result = $eis->storeCommandLogEntry($commandname, $parameter, $vcsid, $start, $end, $comment, $mastername, $childname) };
+ if ( $@ ) {
+ carp("ERROR: set_log_entry_extended(): Logging failed. Reason:\n$@\n");
+ }
+ return $result;
+}
+
+
+#### class methods ####
+
+sub init_eis_connector
+{
+ my $eis = Eis->new( uri => Cws::eis_uri(),
+ proxy_list => Cws::eis_proxy_list(),
+ net_proxy => Cws::net_proxy()
+ );
+ return $eis;
+}
+
+####
+
+1; # needed by "use" or "require"
+# vim: set ts=4 shiftwidth=4 expandtab syntax=perl:
diff --git a/solenv/bin/modules/CwsConfig.pm b/solenv/bin/modules/CwsConfig.pm
new file mode 100644
index 000000000000..6121691e1e7f
--- /dev/null
+++ b/solenv/bin/modules/CwsConfig.pm
@@ -0,0 +1,576 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+#
+# CwsConfig.pm - package for read CWS config data
+#
+
+package CwsConfig;
+use strict;
+
+use Carp;
+use URI::Escape;
+
+##### ctor ####
+
+sub new
+{
+ my $invocant = shift;
+ my $class = ref($invocant) || $invocant;
+ my $self = {};
+ $self->{_CONFIG_FILE} = undef; # config file
+ $self->{_GLOBAL} = undef; # is it a global config file?
+ $self->{VCSID} = undef; # VCSID
+ $self->{CWS_DB_URL_LIST_REF} = undef; # list of CWS DB servers
+ $self->{NET_PROXY} = undef; # network proxy
+ $self->{CWS_SERVER_ROOT} = undef; # cvs server
+ $self->{CWS_MIRROR_ROOT} = undef; # mirror of cvs server
+ $self->{CWS_LOCAL_ROOT} = undef; # local cvs server
+ $self->{PUBLIC_SVN_SERVER} = undef; # public svn server
+ $self->{PRIVATE_SVN_SERVER} = undef; # private svn server
+ bless ($self, $class);
+ return $self;
+}
+
+sub vcsid
+{
+ my $self = shift;
+
+ if ( !defined($self->{VCSID}) ) {
+ # environment overrides config file
+ my $vcsid = $ENV{VCSID};
+ if ( !defined($vcsid) ) {
+ # check config file
+ my $config_file = $self->get_config_file();
+ $vcsid = $config_file->{CWS_CONFIG}->{'CVS_ID'};
+ if ( !defined($vcsid) ) {
+ # give up
+ croak("ERROR: no CVS_ID entry found in '\$HOME/.cwsrc'.\n" );
+ }
+ }
+ $self->{VCSID} = $vcsid;
+ }
+ return $self->{VCSID};
+}
+
+sub cws_db_url_list_ref
+{
+ my $self = shift;
+
+ if ( !defined($self->{CWS_DB_URL_LIST_REF}) ) {
+ my $config_file = $self->get_config_file();
+
+ my $i = 1;
+ my @cws_db_servers;
+
+ while ( 1 ) {
+ my $val = $config_file->{CWS_CONFIG}->{"CWS_DB_SERVER_$i"};
+ last if !defined($val);
+ push(@cws_db_servers, $val);
+ $i++;
+ }
+
+ if ( !@cws_db_servers) {
+ croak("ERROR: no CWS_DB_SERVER_* entry found in '\$HOME/.cwsrc'.\n" );
+ }
+
+ if ( $cws_db_servers[0] =~ /^https:\/\// ) {
+ my $id = $self->vcsid();
+ my $password = $config_file->{CWS_CONFIG}->{'CVS_PASSWORD'};
+
+ if ( !defined($password) ) {
+ croak("ERROR: no CVS_PASSWORD entry found in '\$HOME/.cwsrc'.\n" );
+ }
+
+ # *i49473* - do not accept scrambled passwords ending with a space
+ if ( $password =~ / $/) {
+ croak("ERROR: The (scrambled) CVS_PASSWORD ends with a space. This is known to cause problems when connecting to the OpenOffice.org EIS database. Please change your OOo account's password" );
+ }
+
+ # We are going to stuff $id and $password in an URL, do proper escaping.
+ $id = uri_escape($id);
+ $password = uri_escape($password);
+
+ foreach ( @cws_db_servers ) {
+ s/^https:\/\//https:\/\/$id:$password@/;
+ }
+ }
+
+ $self->{CWS_DB_URL_LIST_REF} = \@cws_db_servers;
+ }
+ return $self->{CWS_DB_URL_LIST_REF};
+}
+
+sub net_proxy
+{
+ my $self = shift;
+
+ if ( !defined($self->{NET_PROXY}) ) {
+ my $config_file = $self->get_config_file();
+ my $net_proxy = $config_file->{CWS_CONFIG}->{'PROXY'};
+ if ( !defined($net_proxy) ) {
+ $net_proxy = "";
+ }
+ $self->{NET_PROXY} = $net_proxy;
+ }
+ return $self->{NET_PROXY} ? $self->{NET_PROXY} : undef;
+}
+
+sub cvs_binary
+{
+ my $self = shift;
+
+ if ( !defined($self->{CVS_BINARY}) ) {
+ my $config_file = $self->get_config_file();
+ my $cvs_binary = $config_file->{CWS_CONFIG}->{'CVS_BINARY'};
+ if ( !defined($cvs_binary) ) {
+ # defaults
+ $cvs_binary = ($^O eq 'MSWin32') ? 'cvs.exe' : 'cvs';
+ }
+ # special case, don't ask
+ if ( $self->{_GLOBAL} && $cvs_binary =~ /cvs.clt2/ && $^O eq 'MSWin32' ) {
+ $cvs_binary = 'cvsclt2.exe';
+ }
+ $self->{CVS_BINARY} = $cvs_binary;
+ }
+ return $self->{CVS_BINARY};
+}
+
+sub cvs_server_root
+{
+ my $self = shift;
+
+ if ( !defined($self->{CVS_SERVER_ROOT}) ) {
+ my $config_file = $self->get_config_file();
+ my $cvs_server_root = $config_file->{CWS_CONFIG}->{'CVS_SERVER_ROOT'};
+ if ( !defined($cvs_server_root) ) {
+ # give up, this is a mandatory entry
+ croak("ERROR: can't parse CVS_SERVER_ROOT entry in '\$HOME/.cwsrc'.\n");
+ }
+ if ( $self->{_GLOBAL} ) {
+ # a global config file will almost always have the wrong vcsid in
+ # the cvsroot -> substitute vcsid
+ my $id = $self->vcsid();
+ $cvs_server_root =~ s/:pserver:\w+@/:pserver:$id@/;
+ }
+ $self->{CVS_SERVER_ROOT} = $cvs_server_root;
+ }
+ return $self->{CVS_SERVER_ROOT};
+}
+
+sub cvs_mirror_root
+{
+ my $self = shift;
+
+ if ( !defined($self->{CVS_MIRROR_ROOT}) ) {
+ my $config_file = $self->get_config_file();
+ my $cvs_mirror_root = $config_file->{CWS_CONFIG}->{'CVS_MIRROR_ROOT'};
+ if ( !defined($cvs_mirror_root) ) {
+ $cvs_mirror_root = "";
+ }
+ $self->{CVS_MIRROR_ROOT} = $cvs_mirror_root;
+ }
+ return $self->{CVS_MIRROR_ROOT} ? $self->{CVS_MIRROR_ROOT} : undef;
+}
+
+sub cvs_local_root
+{
+ my $self = shift;
+
+ if ( !defined($self->{CVS_LOCAL_ROOT}) ) {
+ my $config_file = $self->get_config_file();
+ my $cvs_local_root = $config_file->{CWS_CONFIG}->{'CVS_LOCAL_ROOT'};
+ if ( !defined($cvs_local_root) ) {
+ $cvs_local_root = "";
+ }
+ $self->{CVS_LOCAL_ROOT} = $cvs_local_root;
+ }
+ return $self->{CVS_LOCAL_ROOT} ? $self->{CVS_LOCAL_ROOT} : undef;
+}
+
+sub get_cvs_server
+{
+ my $self = shift;
+
+ my ($method, $id, $server, $repository) = CwsConfig::split_root($self->cvs_server_root(), 'SERVER');
+ return $server;
+}
+
+sub get_cvs_mirror
+{
+ my $self = shift;
+
+ my ($method, $id, $server, $repository) = CwsConfig::split_root($self->cvs_mirror_root(), 'MIRROR');
+ return $server;
+}
+
+sub get_cvs_local
+{
+ my $self = shift;
+
+ my ($method, $id, $server, $repository) = CwsConfig::split_root($self->cvs_local_root(), 'LOCAL');
+ return $server;
+}
+
+sub get_cvs_server_method
+{
+ my $self = shift;
+
+ my ($method, $id, $server, $repository) = CwsConfig::split_root($self->cvs_server_root(), 'SERVER');
+ return $method;
+}
+
+sub get_cvs_mirror_method
+{
+ my $self = shift;
+
+ my ($method, $id, $server, $repository) = CwsConfig::split_root($self->cvs_mirror_root(), 'MIRROR');
+ return $method;
+}
+
+sub get_cvs_local_method
+{
+ my $self = shift;
+
+ my ($method, $id, $server, $repository) = CwsConfig::split_root($self->cvs_local_root(), 'LOCAL');
+ return $method;
+}
+
+sub get_cvs_server_repository
+{
+ my $self = shift;
+
+ my ($method, $id, $server, $repository) = CwsConfig::split_root($self->cvs_server_root(), 'SERVER');
+ return $repository;
+}
+
+sub get_cvs_mirror_repository
+{
+ my $self = shift;
+
+ my ($method, $id, $server, $repository) = CwsConfig::split_root($self->cvs_mirror_root(), 'MIRROR');
+ return $repository;
+}
+
+sub get_cvs_local_repository
+{
+ my $self = shift;
+
+ my ($method, $id, $server, $repository) = CwsConfig::split_root($self->cvs_local_root(), 'LOCAL');
+ return $repository;
+}
+
+sub get_cvs_server_id
+{
+ my $self = shift;
+
+ my ($method, $id, $server, $repository) = CwsConfig::split_root($self->cvs_server_root(), 'SERVER');
+ return $id;
+}
+
+sub get_cvs_mirror_id
+{
+ my $self = shift;
+
+ my ($method, $id, $server, $repository) = CwsConfig::split_root($self->cvs_mirror_root(), 'MIRROR');
+ return $id;
+}
+
+sub get_cvs_local_id
+{
+ my $self = shift;
+
+ my ($method, $id, $server, $repository) = CwsConfig::split_root($self->cvs_local_root(), 'LOCAL');
+ return $id;
+}
+
+#### SVN methods ####
+
+sub get_ooo_svn_server
+{
+ my $self = shift;
+
+ if ( !defined($self->{SVN_SERVER}) ) {
+ my $config_file = $self->get_config_file();
+ my $ooo_svn_server = $config_file->{CWS_CONFIG}->{'SVN_SERVER'};
+ if ( !defined($ooo_svn_server) ) {
+ $ooo_svn_server = "";
+ }
+ $self->{SVN_SERVER} = $ooo_svn_server;
+ }
+ return $self->{SVN_SERVER} ? $self->{SVN_SERVER} : undef;
+}
+
+sub get_so_svn_server
+{
+ my $self = shift;
+
+ if ( !defined($self->{SO_SVN_SERVER}) ) {
+ my $config_file = $self->get_config_file();
+ my $so_svn_server = $config_file->{CWS_CONFIG}->{'SO_SVN_SERVER'};
+ if ( !defined($so_svn_server) ) {
+ $so_svn_server = "";
+ }
+ $self->{SO_SVN_SERVER} = $so_svn_server;
+ }
+ return $self->{SO_SVN_SERVER} ? $self->{SO_SVN_SERVER} : undef;
+}
+
+#### HG methods ####
+
+sub get_ooo_hg_local_source
+{
+ my $self = shift;
+
+ if ( !defined($self->{HG_LOCAL_SOURCE}) ) {
+ my $config_file = $self->get_config_file();
+ my $source = $config_file->{CWS_CONFIG}->{'HG_LOCAL_SOURCE'};
+ if ( !defined($source) ) {
+ $source = "";
+ }
+ $self->{HG_LOCAL_SOURCE} = $source;
+ }
+ return $self->{HG_LOCAL_SOURCE} ? $self->{HG_LOCAL_SOURCE} : undef;
+}
+
+sub get_ooo_hg_lan_source
+{
+ my $self = shift;
+
+ if ( !defined($self->{HG_LAN_SOURCE}) ) {
+ my $config_file = $self->get_config_file();
+ my $source = $config_file->{CWS_CONFIG}->{'HG_LAN_SOURCE'};
+ if ( !defined($source) ) {
+ $source = "";
+ }
+ $self->{HG_LAN_SOURCE} = $source;
+ }
+ return $self->{HG_LAN_SOURCE} ? $self->{HG_LAN_SOURCE} : undef;
+}
+
+sub get_ooo_hg_remote_source
+{
+ my $self = shift;
+
+ if ( !defined($self->{HG_REMOTE_SOURCE}) ) {
+ my $config_file = $self->get_config_file();
+ my $source = $config_file->{CWS_CONFIG}->{'HG_REMOTE_SOURCE'};
+ if ( !defined($source) ) {
+ $source = "";
+ }
+ $self->{HG_REMOTE_SOURCE} = $source;
+ }
+ return $self->{HG_REMOTE_SOURCE} ? $self->{HG_REMOTE_SOURCE} : undef;
+}
+
+sub get_so_hg_local_source
+{
+ my $self = shift;
+
+ if ( !defined($self->{SO_HG_LOCAL_SOURCE}) ) {
+ my $config_file = $self->get_config_file();
+ my $source = $config_file->{CWS_CONFIG}->{'SO_HG_LOCAL_SOURCE'};
+ if ( !defined($source) ) {
+ $source = "";
+ }
+ $self->{SO_HG_LOCAL_SOURCE} = $source;
+ }
+ return $self->{SO_HG_LOCAL_SOURCE} ? $self->{SO_HG_LOCAL_SOURCE} : undef;
+}
+
+sub get_so_hg_lan_source
+{
+ my $self = shift;
+
+ if ( !defined($self->{SO_HG_LAN_SOURCE}) ) {
+ my $config_file = $self->get_config_file();
+ my $source = $config_file->{CWS_CONFIG}->{'SO_HG_LAN_SOURCE'};
+ if ( !defined($source) ) {
+ $source = "";
+ }
+ $self->{SO_HG_LAN_SOURCE} = $source;
+ }
+ return $self->{SO_HG_LAN_SOURCE} ? $self->{SO_HG_LAN_SOURCE} : undef;
+}
+
+sub get_so_hg_remote_source
+{
+ my $self = shift;
+
+ if ( !defined($self->{SO_HG_REMOTE_SOURCE}) ) {
+ my $config_file = $self->get_config_file();
+ my $source = $config_file->{CWS_CONFIG}->{'SO_HG_REMOTE_SOURCE'};
+ if ( !defined($source) ) {
+ $source = "";
+ }
+ $self->{SO_HG_REMOTE_SOURCE} = $source;
+ }
+ return $self->{SO_HG_REMOTE_SOURCE} ? $self->{SO_HG_REMOTE_SOURCE} : undef;
+}
+
+#### Prebuild binaries configuration ####
+
+sub get_prebuild_binaries_location
+{
+ my $self = shift;
+
+ if ( !defined($self->{PREBUILD_BINARIES}) ) {
+ my $config_file = $self->get_config_file();
+ my $pre_build_binaries = $config_file->{CWS_CONFIG}->{'PREBUILD_BINARIES'};
+ if ( !defined($pre_build_binaries) ) {
+ $pre_build_binaries = "";
+ }
+ $self->{PREBUILD_BINARIES} = $pre_build_binaries;
+ }
+ return $self->{PREBUILD_BINARIES} ? $self->{PREBUILD_BINARIES} : undef;
+}
+
+
+
+#### class methods #####
+sub get_config
+{
+ my $config = CwsConfig->new();
+ return $config;
+}
+
+sub split_root
+{
+ my $root = shift;
+ my $type = shift;
+
+ if ( !defined($root) ) {
+ return (undef, undef, undef, undef);
+ }
+
+ my ($dummy, $method, $id_at_host, $repository) = split(/:/, $root);
+ $repository =~ s/^\d*//;
+ my ($id, $server);
+ if ( $id_at_host ) {
+ ($id, $server) = split(/@/, $id_at_host);
+ }
+ if ( !defined($method) || !defined($id) || !defined($server) || !defined($repository) ) {
+ # give up
+ print "$method, $id, $server, $repository\n";
+ croak("ERROR: can't parse CVS_".$type."_ROOT entry in '\$HOME/.cwsrc'.\n");
+ }
+ return ($method, $id, $server, $repository);
+}
+
+#### private helper methods ####
+
+sub get_config_file
+{
+ my $self = shift;
+
+ if ( !defined $self->{_CONFIG_FILE} ) {
+ $self->parse_config_file();
+ }
+ return $self->{_CONFIG_FILE};
+}
+
+sub read_config
+{
+ my $self = shift;
+ my $fname = shift;
+ my $fhandle;
+ my $section = '';
+ my %config;
+
+ open ($fhandle, $fname) || croak("ERROR: Can't open '$fname': $!");
+ while ( <$fhandle> ) {
+ tr/\r\n//d; # win32 pain
+ # Issue #i62815#: Scrambled CVS passwords may contain one or more '#'.
+ # Ugly special case needed: still allow in-line (perl style) comments
+ # elsewhere because existing configuration files may depend on them.
+ if ( !/^\s*CVS_PASSWORD/ ) {
+ s/\#.*//; # kill comments
+ }
+ /^\s*$/ && next;
+
+ if (/\[\s*(\S+)\s*\]/) {
+ $section = $1;
+ if (!defined $config{$section}) {
+ $config{$section} = {};
+ }
+ }
+ defined $config{$section} || croak("ERROR: unknown / no section '$section'\n");
+ if ( m/(\w[\w\d]*)=(.*)/ ) {
+ my $var = $1;
+ my $val = $2;
+ # New style value strings may be surrounded by quotes
+ if ( $val =~ s/\s*(['"])(.*)\1\s*$/$2/ ) {
+ my $quote = $1;
+ # If and only if the value string is surrounded by quotes we
+ # can expect that \" or \' are escaped characters. In an unquoted
+ # old style value string they could mean exactly what is standing there
+ #
+ # Actually the RE above works without quoting the quote character
+ # (either " or ') inside the value string but users will probably
+ # expect that they need to be escaped if quotes are used.
+ #
+ # This is still not completly correct for all thinkable situations but
+ # should be good enough for all practical use cases.
+ $val =~ s/\\($quote)/$1/g;
+ }
+ $config{$section}->{$var} = $val;
+ # print "Set '$var' to '$val'\n";
+ }
+ }
+ close ($fhandle) || croak("ERROR: Failed to close: $!");
+
+ $self->{_CONFIG_FILE} = \%config;
+}
+
+sub parse_config_file
+{
+ my $self = shift;
+
+ my $config_file;
+ # check for config files
+ if ( -e "$ENV{HOME}/.cwsrc" ) {
+ $self->read_config("$ENV{HOME}/.cwsrc");
+ $self->{_GLOBAL} = 0;
+ }
+ elsif ( -e "$ENV{COMMON_ENV_TOOLS}/cwsrc" ) {
+ $self->read_config("$ENV{COMMON_ENV_TOOLS}/cwsrc");
+ $self->{_GLOBAL} = 1;
+ }
+ else {
+ croak("ERROR: can't find CWS config file '\$HOME/.cwsrc'.\n");
+ }
+}
+
+sub sointernal
+{
+ my $self = shift;
+ my $config_file = $self->get_config_file();
+ my $val = ($config_file->{CWS_CONFIG}->{"SO_INTERNAL"}) ? 1 : 0;
+ return $val;
+}
+1; # needed by "use" or "require"
diff --git a/solenv/bin/modules/Eis.pm b/solenv/bin/modules/Eis.pm
new file mode 100755
index 000000000000..696595f5af71
--- /dev/null
+++ b/solenv/bin/modules/Eis.pm
@@ -0,0 +1,220 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+#
+# Eis.pm - package for accessing/manipulating the EIS database via SOAP
+#
+
+package Eis;
+use strict;
+
+use SOAP::Lite;
+use Class::Struct;
+use Carp;
+
+# Declaration of class Eis together with ctor and accessors.
+# See 'perldoc Class::Struct' for details
+
+struct Eis => [
+ # public members
+ uri => '$', # name of webservice
+ proxy_list => '@', # list of proxy URLs
+ current_proxy => '$', # current proxy (index in proxy_list)
+ net_proxy => '$', # network proxy to pass through firewall
+ # private members
+ eis_connector => '$' # SOAP connector to EIS database
+];
+
+#### public methods ####
+
+# Any not predeclared method call to this package is
+# interpreted as a SOAP method call. We use the AUTOLOAD
+# mechanism to intercept these calls and delgate them
+# to the eis_connector.
+# See the 'Camel Book', 3rd edition, page 337 for an
+# explanation of the AUTOLOAD mechanism.
+sub AUTOLOAD
+{
+ my $self = shift;
+ my $callee = $Eis::AUTOLOAD; # $callee now holds the name of
+ # called subroutine
+ #
+ return if $callee =~ /::DESTROY$/;
+ $callee = substr($callee, 5);
+
+ my $sl = $self->eis_connector();
+ if ( !$sl ) {
+ $sl = $self->init_eis_connector();
+ $self->eis_connector($sl);
+ }
+
+ my $response;
+ while ( 1 ) {
+ # Call callee() on web service.
+ eval { $response = $sl->$callee(@_) };
+ if ( $@ ) {
+ # Transport error (server not available, timeout, etc).
+ # Use backup server.
+ print STDERR ("Warning: web service unavailable. Trying backup server.\n");
+ if ( !$self->set_next_proxy() ) {
+ # All proxies tried, out of luck
+ carp("ERROR: Connection to EIS database failed.\n");
+ return undef;
+ }
+ }
+ else {
+ last;
+ }
+ }
+
+ if ( $response->fault() ) {
+ my $fault_msg = get_soap_fault_message($response);
+ die $fault_msg; # throw $fault_msg as exception
+ }
+ else {
+ return $response->result();
+ }
+}
+
+#### public class methods ####
+
+# Turn scalar into SOAP string.
+sub to_string
+{
+ my $value = shift;
+
+ return SOAP::Data->type(string => $value);
+}
+
+#### non public instance methods ####
+
+# Initialize SOAP connection to EIS.
+sub init_eis_connector
+{
+ my $self = shift;
+
+ # Init current_proxy with first element of the proxy list.
+ my $current = $self->current_proxy(0);
+
+ if ( !$self->uri() ) {
+ carp("ERROR: web service URI not set.");
+ return undef;
+ }
+
+ if ( !$self->proxy_list->[$current] ) {
+ carp("ERROR: proxy list not proper initialized.");
+ return undef;
+ }
+
+ # might be needed to get through a firewall
+ if ( defined($self->net_proxy()) ) {
+ $ENV{HTTPS_PROXY}=$self->net_proxy();
+ }
+
+ my $proxy = $self->proxy_list()->[$current];
+ if ( $proxy =~ /^\s*https\:\/\// ) {
+ # SOAP::Lite does not complain if Crypt::SSLeay is not available,
+ # but crypted connections will just not work. Force the detection of
+ # Crypt::SSLeay for https connections and fail with a meaningful
+ # message if it's not available.
+ require Crypt::SSLeay;
+ }
+ return create_eis_connector($self->uri(), $proxy);
+}
+
+# Advance one entry in proxy list.
+sub set_next_proxy
+{
+ my $self = shift;
+
+ my @proxies = @{$self->proxy_list()};
+ my $current = $self->current_proxy();
+
+ if ( $current == $#proxies ) {
+ return 0;
+ }
+ else {
+ $self->current_proxy(++$current);
+ my $next_proxy = $self->proxy_list()->[$current];
+ $self->eis_connector()->proxy($next_proxy);
+ return 1;
+ }
+}
+
+#### misc ####
+
+# Create new SOAP EIS conector.
+sub create_eis_connector
+{
+ my $uri = shift;
+ my $proxy = shift;
+
+ my $sl;
+
+ # With version 0.66 of SOAP::Lite the uri() method
+ # has been deprecated in favour of ns(). There
+ # seems to be no way to switch of the deprecation warning
+ # (which may be a bug in this version of SOAP::Lite).
+ # Since older versions do not support the ns() method we
+ # either force everyone to upgrade now, or make the following
+ # dependent on the SOAP::Lite version.
+ my ($vmaj, $vmin) = (0, 0);
+ if( $SOAP::Lite::VERSION =~ m/([0-9]*)\.([0-9]*)/ ) {
+ $vmaj = $1;
+ $vmin = $2;
+ if ( $vmaj > 0 || ( $vmaj == 0 && $vmin >= 66 ) ) {
+ $sl = SOAP::Lite
+ -> ns($uri)
+ -> proxy($proxy);
+ }
+ else {
+ $sl = SOAP::Lite
+ -> uri($uri)
+ -> proxy($proxy);
+ }
+ }
+ else {
+ carp("ERROR: Can't determine SOAP::Lite version.");
+ }
+
+ return $sl;
+}
+
+# Retrieve SOAP fault message.
+sub get_soap_fault_message
+{
+ my $faulty_response = shift;
+ my $fault_msg = join(', ', $faulty_response->faultcode(),
+ $faulty_response->faultstring(),
+ $faulty_response->faultdetail());
+ return $fault_msg;
+}
+
+####
+
+1; # needed by "use" or "require"
diff --git a/solenv/bin/modules/GenInfoParser.pm b/solenv/bin/modules/GenInfoParser.pm
new file mode 100644
index 000000000000..2671da13a69d
--- /dev/null
+++ b/solenv/bin/modules/GenInfoParser.pm
@@ -0,0 +1,296 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#*************************************************************************
+#
+# GenInfoParser - Perl extension for parsing general info databases
+#
+# usage: see below
+#
+#*************************************************************************
+
+package GenInfoParser;
+
+use strict;
+
+use Carp;
+
+##### profiling #####
+# use Benchmark;
+
+##### ctor #####
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = {};
+ $self->{'LIST'} = undef;
+ $self->{'DATA'} = {};
+ bless ($self, $class);
+ return $self;
+}
+
+##### methods #####
+
+sub load_list
+{
+ # load list into memory
+ my $self = shift;
+ my $list_file = shift;
+
+ if ( $self->parse_list($list_file) ) {
+ return 1;
+ }
+ return 0;
+}
+
+sub get_keys
+{
+ # return a sorted list of keys, the sorting is case insensitive
+ my $self = shift;
+ my $access_path = shift;
+
+ my ($key, $value, $sub_data_ref) = $self->walk_accesspath($access_path);
+
+ my @keys = ();
+ if ( $sub_data_ref ) {
+ my @normalized_keys = keys %$sub_data_ref;
+ foreach my $normalized_key (sort keys %$sub_data_ref) {
+ push(@keys, $$sub_data_ref{$normalized_key}[0]);
+ }
+ } elsif ( $value ) {
+ chomp $value;
+ push @keys, ($value);
+ }
+ return @keys;
+}
+
+sub get_key
+{
+ # returns the key corresponding to the access_path
+ my $self = shift;
+ my $access_path = shift;
+
+ my ($key, $value, $sub_data_ref) = $self->walk_accesspath($access_path);
+ return undef if !$key;
+ return $key;
+}
+
+sub get_value
+{
+ # returns the value corresponding to the access_path
+ my $self = shift;
+ my $access_path = shift;
+
+ my ($key, $value, $sub_data_ref) = $self->walk_accesspath($access_path);
+ return undef if !$key;
+ $value = "" if !defined($value);
+ # trim line ends
+ $value =~ tr/\r\n//d;
+ # trim trailing whitespace
+ $value =~ s/\s+$//;
+ return $value;
+}
+
+##### private methods #####
+
+sub parse_list
+{
+ # parse complete list
+ my $self = shift;
+ my $list_file = shift;
+ my @list_data;
+
+ return 0 if ! -r $list_file;
+
+ open(FILE, "<$list_file") or croak("can't open $list_file: $!");
+ # my $t0 = new Benchmark;
+ $self->parse_block(\*FILE, $self->{'DATA'});
+ # my $t1 = new Benchmark;
+ # print STDERR "parsing $list_file took: ", timestr(timediff($t1, $t0)), "\n";
+ close(FILE);
+}
+
+sub parse_block
+{
+ # parse each sub block and place it in a hash
+ # used data structure:
+ # $hash{$normalized_key} = [ $key, $value, 0 | $sub_hash_ref ]
+ my $self = shift;
+ my $glob_ref = shift;
+ my $data_ref = shift;
+
+ my $current_key = 0;
+ my $line;
+ while( $line = <$glob_ref> ) {
+ # this is the inner loop, any additional pattern matching will
+ # have a notable affect on runtime behavior
+ # clean up of $value is done in get_value()
+ my ($key, $value) = split(' ', $line, 2);
+ next if !$key; # skip empty lines
+ my $chr = substr($key, 0, 1);
+ next if $chr eq '#'; # skip comment lines
+ last if $chr eq '}'; # return from block;
+ if ( $chr eq '{' ) {
+ if ( !$current_key ) {
+ croak("unexpected block start");
+ }
+ else {
+ # create empty hash and start sub block parse
+ $$data_ref{$current_key}[2] = {};
+ $self->parse_block($glob_ref, $$data_ref{$current_key}[2]);
+ next;
+ }
+ }
+ # sanity check
+ croak("key $key is not well formed") if $key =~ /\//;
+ # normalize key for hash lookup
+ $current_key = lc($key);
+ # but we have to keep the original - not normalized - key, too
+ $$data_ref{($current_key)} = [$key, $value, 0];
+ }
+}
+
+sub walk_accesspath
+{
+ # returns the key, value and sub_data_ref which
+ # corresponds to the access_path
+
+ my $self = shift;
+ my $access_path = shift;
+
+ my $sub_data_ref = $self->{'DATA'};
+
+ if ( $access_path ) {
+ my $lookup_ref = 0;
+ # normalize key
+ $access_path = lc($access_path);
+ my @key_sequence = split(/\//, $access_path);
+ foreach my $key_element (@key_sequence) {
+ # at least one more key element, but no sub_hash, accesspath invalid
+ return () if !$sub_data_ref;
+ $lookup_ref = $$sub_data_ref{$key_element};
+ # lookup failed, accesspath invalid
+ return () if !defined($lookup_ref);
+ # we've got a valid key
+ $sub_data_ref = $$lookup_ref[2];
+ }
+ return ($$lookup_ref[0], $$lookup_ref[1], $sub_data_ref);
+ }
+ else {
+ # empty access path is only vlaid for getting top level key list
+ return ( undef, undef, $sub_data_ref );
+ }
+}
+
+##### finish #####
+
+1; # needed by use or require
+
+__END__
+
+=head1 NAME
+
+GenInfoParser - Perl extension for parsing general info databases
+
+=head1 SYNOPSIS
+
+ # example that will load a general info database called 'stand.lst'
+
+ use GenInfoParser;
+
+ # Create a new instance of the parser:
+ $a = GenInfoParser->new();
+
+ # Load the database into the parser:
+ $a->load_list('ssrc633.ini');
+
+ # get top level keys from database
+ @top_level_keys = $a->get_keys();
+
+ # get sub list keys
+ @sub_list_keys = $a->get_keys('src633/Drives/o:/Projects');
+
+ # get key/value pair
+ $key = $a->get_key('src633/Comment/build');
+ $value = $a->get_value('src633/Comment/build');
+
+=head1 DESCRIPTION
+
+GenInfoParser is a perl extension to load and parse General Info Databses.
+It uses a simple object oriented interface to retrieve the information stored
+in the database.
+
+Methods:
+
+GenInfoParser::new()
+
+Creates a new instance of the parser. Can't fail.
+
+
+GenInfoParser::load_list($database)
+
+Loads and parses $database. Returns 1 on success and 0 on failure
+
+
+GenInfoParser::get_keys($path)
+
+Returns a sorted list of keys from the path $path. Returns an emtpy list if $path
+has no sublist. If there is no $path spcified, the method will return the
+primary key list. $path can be specified case insensitive. Sorting is done case
+insensitive.
+
+GenInfoParser::get_key($path)
+
+Returns the key to $path or 'undef' if an invalid path is given.
+Example: $path = 'src633/comment/build' will return 'Build' as key.
+Note: $path can be specified case insensitive, but the returned key will
+have the exact case as in the database.
+
+GenInfoParser::get_value($path)
+
+Returns the value to $path or 'undef' is invalid path is given.
+
+
+=head2 EXPORT
+
+GenInfoParser::new()
+GenInfoParser::load_list($database)
+GenInfoParser::get_keys($path)
+GenInfoParser::get_key($path)
+GenInfoParser::get_value($path)
+
+
+=head1 AUTHOR
+
+Jens-Heiner Rechtien, rechtien@sun.com
+
+=head1 SEE ALSO
+
+perl(1).
+
+=cut
diff --git a/solenv/bin/modules/RepositoryHelper.pm b/solenv/bin/modules/RepositoryHelper.pm
new file mode 100644
index 000000000000..8ea7996f6bc6
--- /dev/null
+++ b/solenv/bin/modules/RepositoryHelper.pm
@@ -0,0 +1,210 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#*************************************************************************
+#
+# RepositoryHelper - Perl for working with repositories and underlying SCM
+#
+# usage: see below
+#
+#*************************************************************************
+
+package RepositoryHelper;
+
+use strict;
+
+
+use Carp;
+use Cwd qw (cwd);
+use File::Basename;
+#use File::Temp qw(tmpnam);
+
+my $debug = 0;
+
+##### profiling #####
+
+##### ctor #####
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $initial_directory = shift;
+ if ($initial_directory) {
+ $initial_directory = Cwd::realpath($initial_directory);
+ } else {
+ if ( defined $ENV{PWD} ) {
+ $initial_directory = $ENV{PWD};
+ } elsif (defined $ENV{_cwd}) {
+ $initial_directory = $ENV{_cwd};
+ } else {
+ $initial_directory = cwd();
+ };
+ };
+ my $self = {};
+ $self->{INITIAL_DIRECTORY} = $initial_directory;
+ $self->{REPOSITORY_ROOT} = undef;
+ $self->{REPOSITORY_NAME} = undef;
+ $self->{SCM_NAME} = undef;
+ detect_repository($self);
+ bless($self, $class);
+ return $self;
+}
+
+##### methods #####
+sub get_repository_root
+{
+ my $self = shift;
+ return $self->{REPOSITORY_ROOT};
+}
+
+sub get_initial_directory
+{
+ my $self = shift;
+ return $self->{INITIAL_DIRECTORY};
+}
+
+sub get_scm_name
+{
+ my $self = shift;
+ return$self->{SCM_NAME};
+}
+
+##### private methods #####
+sub search_for_hg {
+ my $self = shift;
+ my $hg_root;
+ my $scm_name = 'hg';
+ if (open(COMMAND, "$scm_name root 2>&1 |")) {
+ foreach (<COMMAND>) {
+ next if (/^Not trusting file/);
+ chomp;
+ $hg_root = $_;
+ last;
+ };
+ close COMMAND;
+ chomp $hg_root;
+ if ($hg_root !~ /There is no Mercurial repository here/) {
+ $self->{REPOSITORY_ROOT} = $hg_root;
+ $self->{SCM_NAME} = $scm_name;
+ return 1;
+ };
+ };
+ return 0;
+};
+
+sub search_via_build_lst {
+ my $self = shift;
+# my @possible_build_lists = ('build.lst', 'build.xlist'); # build lists names
+ my @possible_build_lists = ('build.lst'); # build lists names
+ my $previous_dir = '';
+ my $rep_root_candidate = $self->{INITIAL_DIRECTORY};
+ do {
+ foreach (@possible_build_lists) {
+ my $test_file;
+ if ($rep_root_candidate eq '/') {
+ $test_file = '/prj/' . $_;
+ } else {
+ $test_file = $rep_root_candidate . '/prj/' . $_;
+ };
+ if (-e $test_file) {
+ $self->{REPOSITORY_ROOT} = File::Basename::dirname($rep_root_candidate);
+ return 1;
+ };
+ };
+ $previous_dir = $rep_root_candidate;
+ $rep_root_candidate = File::Basename::dirname(Cwd::realpath($rep_root_candidate));
+ return 0 if ((!$rep_root_candidate) || ($rep_root_candidate eq $previous_dir));
+ }
+ while (chdir "$rep_root_candidate");
+};
+
+sub detect_repository {
+ my $self = shift;
+ return if (search_via_build_lst($self));
+ chdir $self->{INITIAL_DIRECTORY};
+ return if (search_for_hg($self));
+ croak('Cannot determine source directory/repository for ' . $self->{INITIAL_DIRECTORY});
+};
+
+##### finish #####
+
+1; # needed by use or require
+
+__END__
+
+=head1 NAME
+
+RepositoryHelper - Perl module for working with repositories and underlying SCM
+
+=head1 SYNOPSIS
+
+ # example that will analyze sources and return the source root directory
+
+ use RepositoryHelper;
+
+ # Create a new instance:
+ $a = RepositoryHelper->new();
+
+ # Get repositories for the actual workspace:
+ $a->get_repository_root();
+
+
+=head1 DESCRIPTION
+
+RepositoryHelper is a perlPerl module for working with repositories and underlying SCM
+in the database.
+
+Methods:
+
+RepositoryHelper::new()
+
+Creates a new instance of RepositoryHelper. Can be initialized by: some path which likely to belong to a repository, default - empty, the current dir will be taken.
+
+RepositoryHelper::get_repository_root()
+
+Returns the repository root, retrieved by SCM methods or on educated guess...
+
+RepositoryHelper::get_initial_directory()
+
+Returns full path to the initialistion directory.
+
+=head2 EXPORT
+
+RepositoryHelper::new()
+RepositoryHelper::get_repository_root()
+RepositoryHelper::get_scm_name()
+RepositoryHelper::get_initial_directory()
+
+=head1 AUTHOR
+
+Vladimir Glazunov, vg@openoffice.org
+
+=head1 SEE ALSO
+
+perl(1).
+
+=cut
diff --git a/solenv/bin/modules/SourceConfig.pm b/solenv/bin/modules/SourceConfig.pm
new file mode 100755
index 000000000000..e7b526e2cfca
--- /dev/null
+++ b/solenv/bin/modules/SourceConfig.pm
@@ -0,0 +1,669 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#*************************************************************************
+#
+# SourceConfig - Perl extension for parsing general info databases
+#
+# usage: see below
+#
+#*************************************************************************
+
+package SourceConfig;
+
+use strict;
+
+use constant SOURCE_CONFIG_FILE_NAME => 'source_config';
+use constant SOURCE_CONFIG_VERSION => 3;
+
+use Carp;
+use Cwd;
+use RepositoryHelper;
+use File::Basename;
+use File::Temp qw(tmpnam);
+
+my $debug = 0;
+
+##### profiling #####
+
+##### ctor #####
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $source_root = shift;
+ my $self = {};
+ $self->{USER_SOURCE_ROOT} = undef;
+ $self->{SOURCE_CONFIG_FILE} = undef;
+ if (defined $source_root) {
+ $source_root = Cwd::realpath($source_root);
+ $source_root =~ s/\\|\/$//;
+ if (-f $source_root) {
+ # We have path to source_config
+ if (File::Basename::basename($source_root) eq 'source_config') {
+ # We have path to source_config
+ $self->{SOURCE_CONFIG_FILE} = $source_root;
+ $source_root = File::Basename::dirname($source_root);
+ } else {
+ croak("$source_root is not a source_config file");
+ };
+ } else {
+ $self->{USER_SOURCE_ROOT} = $source_root;
+ $source_root .= '/..';
+ }
+ } else {
+ $source_root = $ENV{SOURCE_ROOT_DIR};
+ };
+ $source_root = Cwd::realpath($source_root);
+ $self->{SOURCE_ROOT} = $source_root;
+ $self->{DEBUG} = 0;
+ $self->{VERBOSE} = 0;
+ $self->{REPOSITORIES} = {};
+ $self->{ACTIVATED_REPOSITORIES} = {};
+ $self->{MODULE_PATHS} = {};
+ $self->{MODULE_BUILD_LIST_PATHS} = {};
+ $self->{ACTIVATED_MODULES} = {};
+ $self->{MODULE_REPOSITORY} = {};
+ $self->{REAL_MODULES} = {};
+ $self->{NEW_MODULES} = [];
+ $self->{REMOVE_MODULES} = {};
+ $self->{REMOVE_REPOSITORIES} = {};
+ $self->{NEW_REPOSITORIES} = [];
+ $self->{WARNINGS} = [];
+ $self->{REPORT_MESSAGES} = [];
+ $self->{CONFIG_FILE_CONTENT} = [];
+ if (defined $self->{USER_SOURCE_ROOT}) {
+ ${$self->{REPOSITORIES}}{File::Basename::basename($self->{USER_SOURCE_ROOT})} = $self->{USER_SOURCE_ROOT};
+ };
+ $self->{SOURCE_CONFIG_FILE} = get_config_file($self->{SOURCE_ROOT}) if (!defined $self->{SOURCE_CONFIG_FILE});
+ $self->{SOURCE_CONFIG_DEFAULT} = $self->{SOURCE_ROOT} .'/'.SOURCE_CONFIG_FILE_NAME;
+ if (defined $self->{USER_SOURCE_ROOT}) {
+ ${$self->{REPOSITORIES}}{File::Basename::basename($self->{USER_SOURCE_ROOT})} = $self->{USER_SOURCE_ROOT};
+ };
+ read_config_file($self);
+ get_module_paths($self);
+ bless($self, $class);
+ return $self;
+}
+
+##### methods #####
+
+sub get_version {
+ return SOURCE_CONFIG_VERSION;
+};
+
+sub get_repositories
+{
+ my $self = shift;
+ return sort keys %{$self->{REPOSITORIES}};
+}
+
+sub add_repository
+{
+ my $self = shift;
+ my $new_rep_path = shift;
+ $new_rep_path = Cwd::realpath($new_rep_path);
+ my $new_rep_name = File::Basename::basename($new_rep_path);
+ if (defined ${$self->{REPOSITORIES}}{$new_rep_name}) {
+ croak("Repository $new_rep_name is already defined!!");
+ };
+ ${$self->{REPOSITORIES}}{$new_rep_name} = $new_rep_path;
+ $self -> get_repository_module_paths($new_rep_name);
+}
+
+sub get_config_file_default_path {
+ my $self = shift;
+ return $self->{SOURCE_CONFIG_DEFAULT};
+}
+
+sub get_config_file_path {
+ my $self = shift;
+ return $self->{SOURCE_CONFIG_FILE};
+}
+
+sub get_module_repository {
+ my $self = shift;
+ my $module = shift;
+ if (defined ${$self->{MODULE_REPOSITORY}}{$module}) {
+ return ${$self->{MODULE_REPOSITORY}}{$module};
+ } else {
+ Carp::cluck("No such module $module in active repositories!!\n");
+ return undef;
+ };
+}
+
+sub get_module_path {
+ my $self = shift;
+ my $module = shift;
+ if (defined ${$self->{MODULE_PATHS}}{$module}) {
+ return ${$self->{MODULE_PATHS}}{$module};
+ } else {
+ Carp::cluck("No path for module $module in active repositories!!\n") if ($debug);
+ return undef;
+ };
+}
+
+sub get_module_build_list {
+ my $self = shift;
+ my $module = shift;
+ if (defined ${$self->{MODULE_BUILD_LIST_PATHS}}{$module}) {
+ return ${$self->{MODULE_BUILD_LIST_PATHS}}{$module};
+ } else {
+ my @possible_build_lists = ('build.lst', 'build.xlist'); # build lists names
+ foreach (@possible_build_lists) {
+ my $possible_path = ${$self->{MODULE_PATHS}}{$module} . "/prj/$_";
+ if (-e $possible_path) {
+ ${$self->{MODULE_BUILD_LIST_PATHS}}{$module} = $possible_path;
+ return $possible_path;
+ };
+ };
+ Carp::cluck("No build list in module $module found!!\n") if ($self->{DEBUG});
+ return undef;
+ };
+}
+
+sub get_all_modules
+{
+ my $self = shift;
+ my $module = shift;
+ return sort keys %{$self->{MODULE_PATHS}};
+};
+
+sub get_active_modules
+{
+ my $self = shift;
+ if (scalar keys %{$self->{ACTIVATED_MODULES}}) {
+ return sort keys %{$self->{ACTIVATED_MODULES}};
+ }
+ return sort keys %{$self->{REAL_MODULES}};
+}
+
+sub is_active
+{
+ my $self = shift;
+ my $module = shift;
+ if (scalar keys %{$self->{ACTIVATED_MODULES}}) {
+ return exists ($self->{ACTIVATED_MODULES}{$module});
+ }
+ return exists ($self->{REAL_MODULES}{$module});
+}
+
+##### private methods #####
+
+sub get_repository_module_paths {
+ my $self = shift;
+ my $repository = shift;
+ my $repository_path = ${$self->{REPOSITORIES}}{$repository};
+ if (opendir DIRHANDLE, $repository_path) {
+ foreach my $module (readdir(DIRHANDLE)) {
+ next if (($module =~ /^\.+/) || (!-d "$repository_path/$module"));
+ my $module_entry = $module;
+ if (($module !~ s/\.lnk$//) && ($module !~ s/\.link$//)) {
+ $self->{REAL_MODULES}{$module}++;
+ }
+ my $possible_path = "$repository_path/$module_entry";
+ if (-d $possible_path) {
+ if (defined ${$self->{MODULE_PATHS}}{$module}) {
+ close DIRHANDLE;
+ croak("Ambiguous paths for module $module: $possible_path and " . ${$self->{MODULE_PATHS}}{$module});
+ };
+ ${$self->{MODULE_PATHS}}{$module} = $possible_path;
+ ${$self->{MODULE_REPOSITORY}}{$module} = $repository;
+ }
+ };
+ close DIRHANDLE;
+ } else {
+ croak("Cannot read $repository_path repository content");
+ };
+};
+
+sub get_module_paths {
+ my $self = shift;
+ foreach my $repository (keys %{$self->{REPOSITORIES}}) {
+ get_repository_module_paths($self, $repository);
+ };
+ my @false_actives = ();
+ foreach (keys %{$self->{ACTIVATED_MODULES}}) {
+ push(@false_actives, $_) if (!defined ${$self->{MODULE_PATHS}}{$_});
+ };
+ croak("Error!! Activated module(s): @false_actives\nnot found in the active repositories!! Please check your " . $self->{SOURCE_CONFIG_FILE} . "\n") if (scalar @false_actives);
+ croak("No modules found!") if (!scalar keys %{$self->{MODULE_PATHS}});
+};
+
+sub get_config_file {
+ my $source_root = shift;
+ my $possible_path = $source_root . '/' . SOURCE_CONFIG_FILE_NAME;
+ return $possible_path if (-f $possible_path);
+ return '';
+};
+
+#
+# Fallback - fallback repository is based on RepositoryHelper educated guess
+#
+sub get_fallback_repository {
+ my $self = shift;
+ my $repository_root = RepositoryHelper->new()->get_repository_root();
+ ${$self->{REPOSITORIES}}{File::Basename::basename($repository_root)} = $repository_root;
+};
+
+sub read_config_file {
+ my $self = shift;
+ if (!$self->{SOURCE_CONFIG_FILE}) {
+ if (!defined $self->{USER_SOURCE_ROOT}) {
+ get_fallback_repository($self);
+ };
+ return;
+ };
+ my $repository_section = 0;
+ my $module_section = 0;
+ my $line = 0;
+ my @file_content = ();
+
+ if (open(SOURCE_CONFIG_FILE, $self->{SOURCE_CONFIG_FILE})) {
+ foreach (<SOURCE_CONFIG_FILE>) {
+ push (@{$self->{CONFIG_FILE_CONTENT}}, $_);
+ $line++;
+ chomp;
+ next if (!/^\S+/);
+ next if (/^\s*#+/);
+ s/\r\n//;
+ if (/^\[repositories\]\s*(\s+#)*/) {
+ $module_section = 0;
+ $repository_section = 1;
+ next;
+ };
+ if (/^\[modules\]\s*(\s+#)*/) {
+ $module_section = 1;
+ $repository_section = 0;
+ next;
+ };
+ next if (!$repository_section && !$module_section);
+ if (/\s*(\S+)=active\s*(\s+#)*/) {
+ if ($repository_section) {
+ my $repository_source_path = $self->{SOURCE_ROOT} . "/$1";
+ if (defined $ENV{UPDMINOREXT}) {
+ $repository_source_path .= $ENV{UPDMINOREXT};
+ if (defined ${$self->{REPOSITORIES}}{$1.$ENV{UPDMINOREXT}}) {
+ delete ${$self->{REPOSITORIES}}{$1.$ENV{UPDMINOREXT}};
+ };
+ };
+ ${$self->{REPOSITORIES}}{$1} = $repository_source_path;
+ ${$self->{ACTIVATED_REPOSITORIES}}{$1}++;
+ next;
+ }
+ if ($module_section) {
+ ${$self->{ACTIVATED_MODULES}}{$1}++;
+ next;
+ };
+ };
+ croak("Line $line in " . $self->{SOURCE_CONFIG_FILE} . ' violates format. Please make your checks!');
+ };
+ close SOURCE_CONFIG_FILE;
+ if (!scalar keys %{$self->{REPOSITORIES}}) {
+ get_fallback_repository($self);
+ };
+ } else {
+ croak('Cannot open ' . $self->{SOURCE_CONFIG_FILE} . ' for reading');
+ };
+};
+
+sub remove_all_activated_repositories {
+ my $self = shift;
+ $self->remove_activated_repositories([keys %{$self->{ACTIVATED_REPOSITORIES}}]);
+};
+
+sub remove_activated_repositories {
+ my $self = shift;
+ my $new_repositories_ref = shift;
+ push(@{$self->{WARNINGS}}, "\nWARNING: Empty repository list passed for removing from source_config\n") if (!scalar @$new_repositories_ref);
+ $self->{VERBOSE} = shift;
+ $self->{REMOVE_REPOSITORIES} = {};
+ foreach (@$new_repositories_ref) {
+ if (!defined ${$self->{ACTIVATED_REPOSITORIES}}{$_}) {
+ push (@{$self->{WARNINGS}}, "\nWARNING: repository $_ is not activated in ". $self->get_config_file_default_path()."\n");
+ } else {
+ ${$self->{REMOVE_REPOSITORIES}}{$_}++;
+ delete ${$self->{ACTIVATED_REPOSITORIES}}{$_};
+ };
+ };
+ generate_config_file($self);
+};
+
+sub remove_all_activated_modules {
+ my $self = shift;
+ $self->remove_activated_modules([keys %{$self->{ACTIVATED_MODULES}}]);
+};
+
+sub remove_activated_modules {
+ my $self = shift;
+ my $new_modules_ref = shift;
+ push(@{$self->{WARNINGS}}, "\nWARNING: Empty module list passed for removing from source_config\n") if (!scalar @$new_modules_ref);
+ $self->{VERBOSE} = shift;
+ $self->{REMOVE_MODULES} = {};
+ foreach (@$new_modules_ref) {
+ if (!defined ${$self->{ACTIVATED_MODULES}}{$_}) {
+ push (@{$self->{WARNINGS}}, "\nWARNING: module $_ is not activated in ". $self->get_config_file_default_path()."\n");
+ } else {
+ ${$self->{REMOVE_MODULES}}{$_}++;
+ delete ${$self->{ACTIVATED_MODULES}}{$_};
+ };
+ };
+ generate_config_file($self);
+};
+
+sub add_active_repositories {
+ my $self = shift;
+ $self->{NEW_REPOSITORIES} = shift;
+ croak('Empty repository list passed for addition to source_config') if (!scalar @{$self->{NEW_REPOSITORIES}});
+ $self->{VERBOSE} = shift;
+ foreach (@{$self->{NEW_REPOSITORIES}}) {
+ $self->add_repository($_);
+ };
+ generate_config_file($self);
+};
+
+sub add_active_modules {
+ my $self = shift;
+ my $module_list_ref = shift;
+ my $ignored_modules_string = '';
+ my @real_modules = ();
+ foreach my $module (sort @$module_list_ref) {
+ if ($self->get_module_path($module)) {
+ push(@real_modules, $module);
+ } else {
+ $ignored_modules_string .= " $module";
+ };
+ };
+ push (@{$self->{WARNINGS}}, "\nWARNING: following modules are not found in active repositories, and have not been added to the " . $self->get_config_file_default_path() . ":$ignored_modules_string\n") if ($ignored_modules_string);
+ $self->{NEW_MODULES} = \@real_modules;
+ croak('Empty module list passed for addition to source_config') if (!scalar @{$self->{NEW_MODULES}});
+ $self->{VERBOSE} = shift;
+ generate_config_file($self);
+};
+
+sub add_content {
+ my $self = shift;
+ my $content = shift;
+ my $entries_to_add = shift;
+ return if (!scalar @$entries_to_add);
+ my $message;
+ my $message_part1;
+ my $warning_message;
+ my $activated_entries;
+
+ if ($entries_to_add == $self->{NEW_MODULES}) {
+ $self->{NEW_MODULES} = [];
+ $message_part1 = "Module(s):\n";
+ $activated_entries = $self->{ACTIVATED_MODULES};
+ } elsif ($entries_to_add == $self->{NEW_REPOSITORIES}) {
+ $self->{NEW_REPOSITORIES} = [];
+ $message_part1 = "Repositories:\n";
+ $activated_entries = $self->{ACTIVATED_REPOSITORIES};
+ };
+ foreach my $entry (@$entries_to_add) {
+ if (defined $$activated_entries{$entry}) {
+ $warning_message .= "$entry "
+ } else {
+ push(@$content, "$entry=active\n");
+ ${$activated_entries}{$entry}++;
+ $message .= "$entry "
+ };
+ };
+
+ push(@{$self->{REPORT_MESSAGES}}, "\n$message_part1 $message\nhave been added to the ". $self->get_config_file_default_path()."\n") if ($message);
+ push (@{$self->{WARNINGS}}, "\nWARNING: $message_part1 $warning_message\nare already added to the ". $self->get_config_file_default_path()."\n") if ($warning_message);
+};
+
+sub generate_config_file {
+ my $self = shift;
+ my @config_content_new = ();
+ my ($module_section, $repository_section);
+ my %removed_modules = ();
+ my %removed_repositories = ();
+ foreach (@{$self->{CONFIG_FILE_CONTENT}}) {
+ if (/^\[repositories\]\s*(\s+#)*/) {
+ if ($module_section) {
+ $self->add_content(\@config_content_new, $self->{NEW_MODULES});
+ };
+ $module_section = 0;
+ $repository_section = 1;
+ };
+ if (/^\[modules\]\s*(\s+#)*/) {
+ if ($repository_section) {
+ $self->add_content(\@config_content_new, $self->{NEW_REPOSITORIES});
+ };
+ $module_section = 1;
+ $repository_section = 0;
+ };
+ if ($module_section && /\s*(\S+)=active\s*(\s+#)*/) {
+ if (defined ${$self->{REMOVE_MODULES}}{$1}) {
+ $removed_modules{$1}++;
+ next;
+ };
+ }
+ if ($repository_section && /\s*(\S+)=active\s*(\s+#)*/) {
+ if (defined ${$self->{REMOVE_REPOSITORIES}}{$1}) {
+ $removed_repositories{$1}++;
+ next;
+ };
+ }
+ push(@config_content_new, $_);
+ };
+ if (scalar @{$self->{NEW_MODULES}}) {
+ push(@config_content_new, "[modules]\n") if (!$module_section);
+ $self->add_content(\@config_content_new, $self->{NEW_MODULES});
+ };
+ if (scalar @{$self->{NEW_REPOSITORIES}}) {
+ push(@config_content_new, "[repositories]\n") if (!$repository_section);
+ $self->add_content(\@config_content_new, $self->{NEW_REPOSITORIES});
+ };
+ if (scalar keys %removed_modules) {
+ my @deleted_modules = keys %removed_modules;
+ push(@{$self->{REPORT_MESSAGES}}, "\nModules: @deleted_modules\nhave been removed from the ". $self->get_config_file_default_path()."\n");
+
+ };
+ if (scalar keys %removed_repositories) {
+ my @deleted_repositories = keys %removed_repositories;
+ push(@{$self->{REPORT_MESSAGES}}, "\nRepositories: @deleted_repositories\nhave been removed from the ". $self->get_config_file_default_path()."\n");
+
+ };
+
+ # Writing file, printing warnings and reports
+
+ #check if we need to write a new file
+ my $write_needed = 0;
+ if ((scalar @{$self->{CONFIG_FILE_CONTENT}}) != (scalar @config_content_new)) {
+ $write_needed++;
+ } else {
+ foreach my $i (0 .. $#{$self->{CONFIG_FILE_CONTENT}}) {
+ if (${$self->{CONFIG_FILE_CONTENT}}[$i] ne $config_content_new[$i]) {
+ $write_needed++;
+ last;
+ };
+ };
+ };
+ if ($write_needed) {
+ my $temp_config_file = File::Temp::tmpnam($ENV{TMP});
+ die("Cannot open $temp_config_file") if (!open(NEW_CONFIG, ">$temp_config_file"));
+ print NEW_CONFIG $_ foreach (@config_content_new);
+ close NEW_CONFIG;
+ rename($temp_config_file, $self->get_config_file_default_path()) or system("mv", $temp_config_file, $self->get_config_file_default_path());
+ if (-e $temp_config_file) {
+ system("rm -rf $temp_config_file") if (!unlink $temp_config_file);
+ };
+ $self->{CONFIG_FILE_CONTENT} = \@config_content_new;
+ };
+ if ($self->{VERBOSE}) {
+ print $_ foreach (@{$self->{WARNINGS}});
+ $self->{VERBOSE} = 0;
+ };
+ $self->{WARNINGS} = [];
+ print $_ foreach (@{$self->{REPORT_MESSAGES}});
+ $self->{REPORT_MESSAGES} = [];
+};
+
+##### finish #####
+
+1; # needed by use or require
+
+__END__
+
+=head1 NAME
+
+SourceConfig - Perl extension for parsing general info databases
+
+=head1 SYNOPSIS
+
+ # example that will read source_config file and return the active repositories
+
+ use SourceConfig;
+
+ # Create a new instance of the parser:
+ $a = SourceConfig->new();
+
+ # Get repositories for the actual workspace:
+ $a->get_repositories();
+
+ # Add a repository new_repository for the actual workspace (via full path):
+ $a->add_repository(/DEV300/new_repository);
+
+=head1 DESCRIPTION
+
+SourceConfig is a perl extension to load and parse General Info Databses.
+It uses a simple object oriented interface to retrieve the information stored
+in the database.
+
+Methods:
+
+SourceConfig::new()
+
+Creates a new instance of SourceConfig. Can be initialized by: path to the default repository, path to the source_config, default - empty, the source_config will be taken from the environment
+
+
+SourceConfig::get_version()
+
+Returns version number of the module. Can't fail.
+
+
+SourceConfig::get_repositories()
+
+Returns sorted list of active repositories for the actual workspace
+
+
+SourceConfig::add_repository(REPOSITORY_PATH)
+
+Adds a repository to the list of active repositories
+
+
+SourceConfig::get_active_modules()
+
+Returns a sorted list of active modules
+
+SourceConfig::get_all_modules()
+
+Returns sorted list of all modules in active repositories.
+
+SourceConfig::get_module_path($module)
+
+Returns absolute module path
+
+SourceConfig::get_module_build_list($module)
+
+Returns absolute module build list path
+
+SourceConfig::get_module_repository($module)
+
+Returns the module's repository
+
+SourceConfig::get_config_file_path()
+
+Returns absolute module to the source configuration file
+
+SourceConfig::get_config_file_default_path()
+
+Returns default path for source configuration file
+
+SourceConfig::is_active()
+
+Returns 1 (TRUE) if a module is active
+Returns 0 (FALSE) if a module is not active
+
+SourceConfig::add_active_modules($module_array_ref)
+
+Adds modules from the @$module_array_ref as active to the source_config file
+
+SourceConfig::add_active_repositories($repository_array_ref)
+
+Adds repositories from the @$repository_array_ref as active to the source_config file
+
+SourceConfig::remove_activated_modules($module_array_ref)
+
+Removes modules from the @$module_array_ref from the source_config file
+
+SourceConfig::remove_all_activated_modules()
+
+Removes all activated modules from the source_config file
+
+SourceConfig::remove_activated_repositories($repository_array_ref)
+
+Removes repositories from the @$repository_array_ref from the source_config file
+
+SourceConfig::remove_all_activated_repositories()
+
+Removes all activated repositories from the source_config file
+
+
+=head2 EXPORT
+
+SourceConfig::new()
+SourceConfig::get_version()
+SourceConfig::get_repositories()
+SourceConfig::add_repository()
+SourceConfig::get_active_modules()
+SourceConfig::get_all_modules()
+SourceConfig::get_module_path($module)
+SourceConfig::get_module_build_list($module)
+SourceConfig::get_module_repository($module)
+SourceConfig::get_config_file_path()
+SourceConfig::get_config_file_default_path()
+SourceConfig::is_active($module)
+SourceConfig::add_active_modules($module_array_ref)
+SourceConfig::add_active_repositories($repository_array_ref)
+SourceConfig::remove_activated_modules($module_array_ref)
+SourceConfig::remove_all_activated_modules()
+SourceConfig::remove_activated_repositories($repository_array_ref)
+SourceConfig::remove_all_activated_repositories()
+
+=head1 AUTHOR
+
+Vladimir Glazunov, vg@openoffice.org
+
+=head1 SEE ALSO
+
+perl(1).
+
+=cut
diff --git a/solenv/bin/modules/SourceConfigHelper.pm b/solenv/bin/modules/SourceConfigHelper.pm
new file mode 100644
index 000000000000..84ffbe0ca3f7
--- /dev/null
+++ b/solenv/bin/modules/SourceConfigHelper.pm
@@ -0,0 +1,422 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#*************************************************************************
+#
+# SourceConfigHelper - Perl extension for parsing general info databases
+#
+# usage: see below
+#
+#*************************************************************************
+
+package SourceConfigHelper;
+
+use strict;
+
+use RepositoryHelper;
+use SourceConfig;
+use Cwd qw (cwd);
+use Carp;
+
+my $debug = 0;
+my @source_config_list; # array of sourceconfig objects
+
+#-----------------------------------------------------------------------
+# Constants
+#-----------------------------------------------------------------------
+
+use constant SOURCE_CONFIG_NONE => 0;
+use constant SOURCE_CONFIG_CURRENT_FIRST => 1;
+use constant SOURCE_CONFIG_ENVIRONMENT_FIRST => 2;
+use constant SOURCE_CONFIG_CURRENT_ONLY => 3;
+use constant SOURCE_CONFIG_ENVIRONMENT_ONLY => 4;
+
+use constant SOURCE_CONFIG_DEFAULT => SOURCE_CONFIG_CURRENT_FIRST;
+
+##### profiling #####
+
+##### ctor #####
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $init_action = shift;
+ my $self = {};
+ my $SourceConfigCurrent;
+ my $SourceConfigEnvironment;
+
+ $init_action = SOURCE_CONFIG_DEFAULT if (!defined ($init_action));
+ if (!eval ($init_action) or ($init_action < SOURCE_CONFIG_NONE) or ($init_action > SOURCE_CONFIG_ENVIRONMENT_ONLY)) {
+ croak("wrong initial parameter: $init_action\n");
+ }
+
+ if ($init_action != SOURCE_CONFIG_NONE) {
+ my $repositoryHash_ref = {};
+ if ($init_action != SOURCE_CONFIG_ENVIRONMENT_ONLY) {
+ my $initial_directory = cwd();
+ my $result = is_repository($initial_directory, $repositoryHash_ref);
+ if ($result) {
+ $SourceConfigCurrent = SourceConfig->new($repositoryHash_ref->{REPOSITORY_ROOT});
+ }
+ }
+ if ($init_action != SOURCE_CONFIG_CURRENT_ONLY) {
+ my $source_config = $ENV{SOURCE_ROOT_DIR} . '/' . SourceConfig::SOURCE_CONFIG_FILE_NAME;
+ if (-f $source_config) {
+ $SourceConfigEnvironment = SourceConfig->new($source_config);
+ }
+ }
+
+ # fill array
+
+ if (($init_action == SOURCE_CONFIG_CURRENT_FIRST) or ($init_action == SOURCE_CONFIG_CURRENT_ONLY)) {
+ if (defined ($SourceConfigCurrent)) {
+ push (@source_config_list, $SourceConfigCurrent);
+ }
+ if ($init_action == SOURCE_CONFIG_CURRENT_FIRST) {
+ if (defined ($SourceConfigEnvironment)) {
+ push (@source_config_list, $SourceConfigEnvironment);
+ }
+ }
+ }
+ elsif (($init_action == SOURCE_CONFIG_ENVIRONMENT_FIRST) or ($init_action == SOURCE_CONFIG_ENVIRONMENT_ONLY)) {
+ if (defined ($SourceConfigEnvironment)) {
+ push (@source_config_list, $SourceConfigEnvironment);
+ }
+ if ($init_action == SOURCE_CONFIG_ENVIRONMENT_FIRST) {
+ if (defined ($SourceConfigCurrent)) {
+ push (@source_config_list, $SourceConfigCurrent);
+ }
+ }
+ }
+ }
+
+ $self->{SOURCE_CONFIG_LIST} = \@source_config_list;
+
+ bless($self, $class);
+ return $self;
+}
+
+##### methods #####
+
+############################################################################################
+
+sub add_SourceConfig {
+ my $self = shift;
+ my $source_config = shift;
+ push (@{$self->{SOURCE_CONFIG_LIST}}, $source_config);
+}
+
+############################################################################################
+
+sub get_SourceConfigList {
+ my $self = shift;
+ return @{$self->{SOURCE_CONFIG_LIST}};
+}
+
+############################################################################################
+
+sub has_SourceConfig {
+ my $self = shift;
+ my $result = 0;
+ my $count = @{$self->{SOURCE_CONFIG_LIST}};
+ $result = 1 if ($count > 0);
+ return $result;
+}
+
+############################################################################################
+
+sub get_module_path {
+ my $self = shift;
+ my $module = shift;
+ my $function = \&SourceConfig::get_module_path;
+ my $result;
+ $result = $self->get_StringResult ($function, $module);
+ return $result;
+}
+
+############################################################################################
+
+sub get_active_modules {
+ my $self = shift;
+ my $parameter; # empty
+ my $function = \&SourceConfig::get_active_modules;
+ my $array_ref;
+ $array_ref = $self->get_ArrayResult ($function, $parameter);
+ return @$array_ref;
+}
+
+############################################################################################
+
+sub get_repositories {
+ my $self = shift;
+ my $parameter; # empty
+ my $function = \&SourceConfig::get_repositories;
+ my $array_ref;
+ $array_ref = $self->get_ArrayResult ($function, $parameter);
+ return @$array_ref;
+}
+
+############################################################################################
+
+sub get_module_repository {
+ my $self = shift;
+ my $module = shift;
+ my $function = \&SourceConfig::get_module_repository;
+ my $result;
+ $result = $self->get_StringResult ($function, $module);
+ return $result;
+}
+
+############################################################################################
+
+sub is_active {
+ my $self = shift;
+ my $module = shift;
+ my $function = \&SourceConfig::is_active;
+ my $result_ref;
+ my $is_active = 0;
+ $result_ref = $self->get_ResultOfList ($function, $module);
+ my $count = @$result_ref;
+ if ($count>0) {
+ foreach my $active (@$result_ref) {
+ if ($active) {
+ $is_active = $active;
+ }
+ }
+ }
+ return $is_active;
+}
+
+##### private methods #####
+
+############################################################################################
+#
+# is_repository () : check if the directory is a valid repository
+#
+# input: - directory
+# - hash reference, where the output will be stored
+#
+# output: 0 = FALSE, the directory is no valid repository
+# 1 = TRUE, the repository root can be found in $repositoryHash_ref->{REPOSITORY_ROOT}
+#
+############################################################################################
+
+sub is_repository {
+ my $directory = shift;
+ my $repositoryHash_ref = shift;
+ $repositoryHash_ref->{INITIAL_DIRECTORY} = $directory;
+ $repositoryHash_ref->{REPOSITORY_ROOT} = undef;
+ $repositoryHash_ref->{REPOSITORY_NAME} = undef;
+ my $result = RepositoryHelper::search_via_build_lst($repositoryHash_ref);
+ chdir $repositoryHash_ref->{INITIAL_DIRECTORY};
+ if (!$result) {
+ $result = RepositoryHelper::search_for_hg($repositoryHash_ref);
+ }
+ return $result;
+}
+
+############################################################################################
+#
+# get_ResultOfList(): give back an array reference from all SourceConfig Objects results
+#
+# input: - function : reference to the called function of each SourceConfig Object
+# - parameter : parameter for the called function
+#
+# output: result : array of all results
+#
+############################################################################################
+
+sub get_ResultOfList {
+ my $self = shift;
+ my $function = shift;
+ my $parameter = shift;
+ my @result;
+ foreach my $source_config (@{$self->{SOURCE_CONFIG_LIST}}) {
+ push (@result, &$function ($source_config, $parameter));
+ }
+ return \@result;
+}
+
+############################################################################################
+#
+# get_StringResult(): give back the first defined result from all SourceConfig Objects
+#
+# input: - function : reference to the called function of each SourceConfig Object
+# - parameter : parameter for the called function
+#
+# output: result : scalar variable (string), undef if no result
+#
+############################################################################################
+
+sub get_StringResult {
+ my $self = shift;
+ my $function = shift;
+ my $parameter = shift;
+ my $result_ref;
+ $result_ref = $self->get_ResultOfList ($function, $parameter);
+ my $count = @$result_ref;
+ if ($count>0) {
+ my $value;
+ my $i = 0;
+ while (($i < $count) and !defined ($value)) { # search the first defined result
+ $value = $$result_ref[$i];
+ $i++;
+ }
+ return $value;
+ }
+ return undef;
+}
+
+############################################################################################
+#
+# get_StringResult(): give back a sorted and uniqe array reference of the results
+# from all SourceConfig Objects
+#
+# input: - function : reference to the called function of each SourceConfig Object
+# - parameter : parameter for the called function
+#
+# output: result : sorted and uniqe array reference
+#
+############################################################################################
+
+sub get_ArrayResult {
+ my $self = shift;
+ my $function = shift;
+ my $parameter = shift;
+ my $result_ref;
+ my @modules;
+ $result_ref = $self->get_ResultOfList ($function, $parameter);
+ my $count = @$result_ref;
+ if ($count>0) {
+ my %moduleHash;
+ foreach my $module (@$result_ref) {
+ $moduleHash{$module}++;
+ }
+ @modules = sort keys %moduleHash;
+ }
+ return \@modules;
+}
+
+ ##### finish #####
+
+1; # needed by use or require
+
+__END__
+
+=head1 NAME
+
+SourceConfigHelper - Perl extension for handling with SourceConfigObjetcs
+
+=head1 SYNOPSIS
+
+ # example that will read source_config file and return the active repositories
+
+ use SourceConfigHelper;
+
+ # Create a new instance:
+ $a = SourceConfigHelper->new();
+
+ # Get repositories for the actual workspace:
+ $a->get_repositories();
+
+=head1 DESCRIPTION
+
+SourceConfigHelper is a perl extension to handle more than one objects of SourceConfig
+to set up a search order for modules.
+
+Methods:
+
+SourceConfigHelper::new()
+
+Creates a new instance of SourceConfigHelper. Can be initialized by: default - empty or with a constant of search order. default: the source_config will be taken first from the current repository and second from the environment
+Possible parameters are:
+SourceConfigHelper::SOURCE_CONFIG_NONE - no SourceConfig Object will be created
+SourceConfigHelper::SOURCE_CONFIG_CURRENT_FIRST - use the current repository first
+SourceConfigHelper::SOURCE_CONFIG_ENVIRONMENT_FIRST - use the repository of the environment first
+SourceConfigHelper::SOURCE_CONFIG_CURRENT_ONLY - use only the current repository
+SourceConfigHelper::SOURCE_CONFIG_ENVIRONMENT_ONLY - use only the repository of the environment
+
+SourceConfigHelper::get_repositories()
+
+Returns sorted list of active repositories for the actual workspace
+
+SourceConfigHelper::get_active_modules()
+
+Returns a sorted list of active modules
+
+SourceConfigHelper::get_all_modules()
+
+Returns sorted list of all modules in active repositories.
+
+SourceConfigHelper::get_module_path($module)
+
+Returns absolute module path. If the module is not active or don't exists, "undef" will be returned.
+
+SourceConfigHelper::get_module_repository($module)
+
+Returns the module's repository. If the module is not active or don't exists, "undef" will be returned.
+
+SourceConfigHelper::is_active()
+
+Returns 1 (TRUE) if a module is active
+Returns 0 (FALSE) if a module is not active
+
+SourceConfigHelper::add_SourceConfig($SourceConfigObject)
+
+Add the SourceConfigObject to the end of the list
+
+SourceConfigHelper::get_SourceConfigList()
+
+Return an array of SourceConfigObjects
+
+SourceConfigHelper::has_SourceConfig()
+
+Returns 1 (TRUE) if one or more SourceConfig Objects is in the list
+Returns 0 (FALSE) if no SourceConfig Object is in the list (can happen if there is no valid repository)
+
+=head2 EXPORT
+
+SourceConfigHelper::new()
+SourceConfigHelper::get_repositories()
+SourceConfigHelper::get_active_modules()
+SourceConfigHelper::get_all_modules()
+SourceConfigHelper::get_module_path($module)
+SourceConfigHelper::get_module_repository($module)
+SourceConfigHelper::is_active($module)
+SourceConfigHelper::add_SourceConfig($SourceConfigObject)
+SourceConfigHelper::get_SourceConfigList()
+SourceConfigHelper::has_SourceConfig()
+
+=head1 AUTHOR
+
+Kurt Zenker, kz@openoffice.org
+
+=head1 SEE ALSO
+
+perl(1).
+
+=cut
diff --git a/solenv/bin/modules/installer/archivefiles.pm b/solenv/bin/modules/installer/archivefiles.pm
new file mode 100644
index 000000000000..e85903c699aa
--- /dev/null
+++ b/solenv/bin/modules/installer/archivefiles.pm
@@ -0,0 +1,565 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::archivefiles;
+
+use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
+use installer::converter;
+use installer::existence;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::systemactions;
+
+#################################################################
+# Changing the name for files with flag RENAME_TO_LANGUAGE
+#################################################################
+
+sub put_language_into_name
+{
+ my ( $oldname, $onelanguage ) = @_;
+
+ my $newname = "";
+
+ my $filename = "";
+ my $extension = "";
+
+ if ( $oldname =~ /en-US/ ) # files, that contain the language in the file name
+ {
+ $newname = $oldname;
+ $newname =~ s/en-US/$onelanguage/;
+ }
+ else # files, that do not contain the language in the file name
+ {
+ if ( $oldname =~ /^\s*(.*)(\..*?)\s*$/ ) # files with extension
+ {
+ $filename = $1;
+ $extension = $2;
+ }
+ else
+ {
+ $filename = $oldname;
+ $extension = "";
+ }
+
+ $newname = $1 . "_" . $onelanguage . $2;
+ }
+
+ return $newname;
+}
+
+#################################################################
+# Converting patchfiles string into array
+#################################################################
+
+sub get_patch_file_list
+{
+ my ( $patchfilestring ) = @_;
+
+ $patchfilestring =~ s/^\s*\(?//;
+ $patchfilestring =~ s/\)?\s*$//;
+ $patchfilestring =~ s/^\s*\///;
+ $patchfilestring =~ s/^\s*\\//;
+
+ my $patchfilesarray = installer::converter::convert_stringlist_into_array_without_linebreak_and_quotes(\$patchfilestring, ",");
+
+ return $patchfilesarray;
+}
+
+#################################################################
+# Reading all executables in the "manifest.xml"
+#################################################################
+
+sub get_all_executables_from_manifest
+{
+ my ($unzipdir, $manifestfile, $executable_files_in_extensions) = @_;
+
+ my $is_executable = 0;
+
+ for ( my $i = 0; $i <= $#{$manifestfile}; $i++ )
+ {
+ my $line = ${$manifestfile}[$i];
+
+ if ( $line =~ /\"application\/vnd\.sun\.star\.executable\"/ ) { $is_executable = 1; }
+
+ if (( $line =~ /manifest\:full\-path=\"(.*?)\"/ ) && ( $is_executable ))
+ {
+ my $filename = $unzipdir . $installer::globals::separator . $1;
+ # making only slashes for comparison reasons
+ $filename =~ s/\\/\//g;
+ $executable_files_in_extensions->{$filename} = 1;
+ }
+
+ if ( $line =~ /\/\>/ ) { $is_executable = 0; }
+ }
+}
+
+#################################################################
+# Reading the "manifest.xml" in extensions and determine, if
+# there are executable files
+#################################################################
+
+sub collect_all_executable_files_in_extensions
+{
+ my ($unzipdir, $executable_files_in_extensions) = @_;
+
+ $unzipdir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ my $manifestfilename = $unzipdir . $installer::globals::separator . "META-INF" . $installer::globals::separator . "manifest.xml";
+
+ if ( -f $manifestfilename )
+ {
+ my $manifestfile = installer::files::read_file($manifestfilename);
+ get_all_executables_from_manifest($unzipdir, $manifestfile, $executable_files_in_extensions);
+ }
+}
+
+#################################################################
+# Analyzing files with flag ARCHIVE
+#################################################################
+
+sub resolving_archive_flag
+{
+ my ($filesarrayref, $additionalpathsref, $languagestringref, $loggingdir) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::archivefiles::resolving_archive_flag : $#{$filesarrayref} : $#{$additionalpathsref} : $$languagestringref : $loggingdir"); }
+
+ my @newallfilesarray = ();
+
+ my ($systemcall, $returnvalue, $infoline);
+
+ my $unziplistfile = $loggingdir . "unziplist_" . $installer::globals::build . "_" . $installer::globals::compiler . "_" . $$languagestringref . ".txt";
+
+ my $platformunzipdirbase = installer::systemactions::create_directories("zip", $languagestringref);
+ push(@installer::globals::removedirs, $platformunzipdirbase);
+
+ installer::logger::include_header_into_logfile("Files with flag ARCHIVE:");
+
+ my $repeat_unzip = 0;
+ my $maxcounter = 0;
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ if ( $repeat_unzip ) { $i--; } # decreasing the counter
+
+ my $onefile = ${$filesarrayref}[$i];
+ my $styles = "";
+
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+
+ if ( $styles =~ /\bARCHIVE\b/ ) # copying, unzipping and changing the file list
+ {
+ my $iscommonfile = 0;
+ my $sourcepath = $onefile->{'sourcepath'};
+
+ if ( $sourcepath =~ /\Q$installer::globals::separator\E\bcommon$installer::globals::productextension\Q$installer::globals::separator\E/ ) # /common/ or /common.pro/
+ {
+ $iscommonfile = 1;
+ }
+
+ my $use_internal_rights = 0;
+ if ( $styles =~ /\bUSE_INTERNAL_RIGHTS\b/ ) { $use_internal_rights = 1; } # using the rights used inside the zip file
+
+ my $rename_to_language = 0;
+ if ( $styles =~ /\bRENAME_TO_LANGUAGE\b/ ) { $rename_to_language = 1; } # special handling for renamed files (scriptitems.pm)
+
+ my %executable_files_in_extensions = ();
+ my $set_executable_privileges = 0; # setting privileges for exectables is required for oxt files
+ if ( $onefile->{'Name'} =~ /\.oxt\s*$/ ) { $set_executable_privileges = 1; }
+
+ # mechanism to select files from an archive files
+ my $select_files = 0;
+ my $selectlistfiles = "";
+ my @keptfiles = ();
+ if ( $onefile->{'Selectfiles'} )
+ {
+ $select_files = 1;
+ $selectlistfiles = get_patch_file_list( $onefile->{'Selectfiles'} );
+ $infoline = "Selected file list defined at file: $onefile->{'Name'} :\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ for ( my $k = 0; $k <= $#{$selectlistfiles}; $k++ )
+ {
+ $infoline = "\"${$selectlistfiles}[$k]\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ if ( $onefile->{'Selectfiles'} ) { $onefile->{'Selectfiles'} = ""; } # Selected files list no longer required
+
+ # mechanism to define patch files inside an archive files
+ my $select_patch_files = 0;
+ my $patchlistfiles = "";
+ my @keptpatchflags = ();
+ if (( $styles =~ /\bPATCH\b/ ) && ( $onefile->{'Patchfiles'} ) && ( $installer::globals::patch ))
+ {
+ $select_patch_files = 1; # special handling if a Patchlist is defined
+ $patchlistfiles = get_patch_file_list( $onefile->{'Patchfiles'} );
+ $infoline = "Patch file list defined at file: $onefile->{'Name'} :\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ for ( my $k = 0; $k <= $#{$patchlistfiles}; $k++ )
+ {
+ $infoline = "\"${$patchlistfiles}[$k]\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ if ( $onefile->{'Patchfiles'} ) { $onefile->{'Patchfiles'} = ""; } # Patch file list no longer required
+
+ # creating directories
+
+ my $onelanguage = $onefile->{'specificlanguage'};
+
+ # files without language into directory "00"
+
+ if ($onelanguage eq "") { $onelanguage = "00"; }
+
+ my $unzipdir;
+
+ # if ($iscommonfile) { $unzipdir = $commonunzipdirbase . $installer::globals::separator . $onelanguage . $installer::globals::separator; }
+ # else { $unzipdir = $platformunzipdirbase . $installer::globals::separator . $onelanguage . $installer::globals::separator; }
+
+ $unzipdir = $platformunzipdirbase . $installer::globals::separator . $onelanguage . $installer::globals::separator;
+
+ installer::systemactions::create_directory($unzipdir); # creating language specific subdirectories
+
+ my $onefilename = $onefile->{'Name'};
+ $onefilename =~ s/\./\_/g; # creating new directory name
+ $onefilename =~ s/\//\_/g; # only because of /letter/fontunxpsprint.zip, the only zip file with path
+ $unzipdir = $unzipdir . $onefilename . $installer::globals::separator;
+
+ if ( $installer::globals::dounzip ) { installer::systemactions::create_directory($unzipdir); } # creating subdirectories with the names of the zipfiles
+
+ my $zip = Archive::Zip->new();
+ if ( $zip->read($sourcepath) != AZ_OK )
+ {
+ $infoline = "ERROR: Could not unzip $sourcepath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ my $counter = 0;
+ my $contains_dll = 0;
+ foreach my $member ( $zip->memberNames() )
+ {
+ $counter++;
+ if ( $member =~ /.dll\s*$/ ) { $contains_dll = 1; }
+ }
+
+ if (! ( $counter > 0 )) # the zipfile is empty
+ {
+ $infoline = "ERROR: Could not unzip $sourcepath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ }
+ else
+ {
+ if ( $installer::globals::dounzip ) # really unpacking the files
+ {
+ if ( $zip->extractTree("", $unzipdir) != AZ_OK ) { installer::exiter::exit_program("ERROR: $infoline", "resolving_archive_flag"); }
+
+ if (( $^O =~ /cygwin/i ) && ( $contains_dll ))
+ {
+ # Make dll's executable
+ $systemcall = "cd $unzipdir; find . -name \\*.dll -exec chmod 775 \{\} \\\;";
+ $returnvalue = system($systemcall);
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ if ( ! $installer::globals::iswindowsbuild )
+ {
+ # Setting unix rights to "775" for all created directories inside the package
+
+ $systemcall = "cd $unzipdir; find . -type d -exec chmod 775 \{\} \\\;";
+ $returnvalue = system($systemcall);
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ # Selecting names of executable files in extensions
+ if ( $set_executable_privileges )
+ {
+ collect_all_executable_files_in_extensions($unzipdir, \%executable_files_in_extensions);
+ }
+ }
+
+ my $zipfileref = \@zipfile;
+ my $unziperror = 0;
+
+ foreach my $zipname ( $zip->memberNames() )
+ {
+ # Format from Archive:::Zip :
+ # dir1/
+ # dir1/so7drawing.desktop
+
+ # some directories and files (from the help) start with "./simpress.idx"
+
+ $zipname =~ s/^\s*\.\///;
+
+ if ($installer::globals::iswin and $^O =~ /MSWin/i) { $zipname =~ s/\//\\/g; }
+
+ if ( $zipname =~ /\Q$installer::globals::separator\E\s*$/ ) # slash or backslash at the end characterizes a directory
+ {
+ $zipname = $zipname . "\n";
+ push(@{$additionalpathsref}, $zipname);
+
+ # Also needed here:
+ # Name
+ # Language
+ # ismultilingual
+ # Basedirectory
+
+ # This is not needed, because the list of all directories for the
+ # epm list file is generated from the destination directories of the
+ # files included in the product!
+ }
+ else
+ {
+ my %newfile = ();
+ %newfile = %{$onefile};
+ $newfile{'Name'} = $zipname;
+ my $destination = $onefile->{'destination'};
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
+ $newfile{'destination'} = $destination . $zipname;
+ $newfile{'sourcepath'} = $unzipdir . $zipname;
+ $newfile{'zipfilename'} = $onefile->{'Name'};
+ $newfile{'zipfilesource'} = $onefile->{'sourcepath'};
+ $newfile{'zipfiledestination'} = $onefile->{'destination'};
+
+ if (( $use_internal_rights ) && ( ! $installer::globals::iswin ))
+ {
+ my $value = sprintf("%o", (stat($newfile{'sourcepath'}))[2]);
+ $newfile{'UnixRights'} = substr($value, 3);
+ $infoline = "Setting unix rights for \"$newfile{'sourcepath'}\" to \"$newfile{'UnixRights'}\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( $set_executable_privileges )
+ {
+ # All pathes to executables are saved in the hash %executable_files_in_extensions
+ my $compare_path = $newfile{'sourcepath'};
+ $compare_path =~ s/\\/\//g; # contains only slashes for comparison reasons
+ if ( exists($executable_files_in_extensions{$compare_path}) )
+ {
+ $newfile{'UnixRights'} = "775";
+ $infoline = "Executable in Extension: Setting unix rights for \"$newfile{'sourcepath'}\" to \"$newfile{'UnixRights'}\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ if ( $select_files )
+ {
+ if ( ! installer::existence::exists_in_array($zipname,$selectlistfiles) )
+ {
+ $infoline = "Removing from ARCHIVE file $onefilename: $zipname\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ next; # ignoring files, that are not included in $selectlistfiles
+ }
+ else
+ {
+ $infoline = "Keeping from ARCHIVE file $onefilename: $zipname\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ push( @keptfiles, $zipname); # collecting all kept files
+ }
+ }
+
+ if ( $select_patch_files )
+ {
+ # Is this file listed in the Patchfile list?
+ # $zipname (filename including path in zip file has to be listed in patchfile list
+
+ if ( ! installer::existence::exists_in_array($zipname,$patchlistfiles) )
+ {
+ $newfile{'Styles'} =~ s/\bPATCH\b//; # removing the flag PATCH
+ $newfile{'Styles'} =~ s/\,\s*\,/\,/;
+ $newfile{'Styles'} =~ s/\(\s*\,/\(/;
+ $newfile{'Styles'} =~ s/\,\s*\)/\)/;
+ # $infoline = "Removing PATCH flag from: $zipname\n";
+ # push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ # $infoline = "Keeping PATCH flag at: $zipname\n";
+ # push( @installer::globals::logfileinfo, $infoline);
+ push( @keptpatchflags, $zipname); # collecting all PATCH flags
+ }
+ }
+
+ if ( $rename_to_language )
+ {
+ my $newzipname = put_language_into_name($zipname, $onelanguage);
+ my $oldfilename = $unzipdir . $zipname;
+ my $newfilename = $unzipdir . $newzipname;
+
+ installer::systemactions::copy_one_file($oldfilename, $newfilename);
+
+ $newfile{'Name'} = $newzipname;
+ $newfile{'destination'} = $destination . $newzipname;
+ $newfile{'sourcepath'} = $unzipdir . $newzipname;
+
+ $infoline = "RENAME_TO_LANGUAGE: Using $newzipname instead of $zipname!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ my $sourcefiletest = $unzipdir . $zipname;
+ if ( ! -f $sourcefiletest )
+ {
+ $infoline = "ATTENTION: Unzip failed for $sourcefiletest!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $unziperror = 1;
+ }
+
+ # only adding the new line into the files array, if not in repeat modus
+
+ if ( ! $repeat_unzip ) { push(@newallfilesarray, \%newfile); }
+ }
+ }
+
+ # Comparing the content of @keptfiles and $selectlistfiles
+ # Do all files from the list of selected files are stored in @keptfiles ?
+ # @keptfiles contains only files included in $selectlistfiles. But are all
+ # files from $selectlistfiles included in @keptfiles?
+
+ if ( $select_files )
+ {
+ my $number = $#{$selectlistfiles} + 1;
+ $infoline = "SELECTLIST: Number of files in file selection list: $number\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $number = $#keptfiles + 1;
+ $infoline = "SELECTLIST: Number of kept files: $number\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $k = 0; $k <= $#keptfiles; $k++ )
+ {
+ $infoline = "KEPT FILES: $keptfiles[$k]\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ my @warningfiles = ();
+
+ for ( my $k = 0; $k <= $#{$selectlistfiles}; $k++ )
+ {
+ if ( ! installer::existence::exists_in_array(${$selectlistfiles}[$k],\@keptfiles) )
+ {
+ push(@warningfiles, ${$selectlistfiles}[$k]);
+ }
+ }
+
+ for ( my $k = 0; $k <= $#warningfiles; $k++ )
+ {
+ $infoline = "WARNING: $warningfiles[$k] not included in install set (does not exist in zip file)!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ }
+
+ # Comparing the content of @keptpatchflags and $patchlistfiles
+ # Do all files from the patch list have a PATCH flag ?
+ # @keptpatchflags contains only files included in $patchlistfiles. But are all
+ # files from $patchlistfiles included in @keptpatchflags?
+
+ if ( $select_patch_files )
+ {
+ my $number = $#{$patchlistfiles} + 1;
+ $infoline = "PATCHLIST: Number of files in patch list: $number\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $number = $#keptpatchflags + 1;
+ $infoline = "PATCHLIST: Number of kept PATCH flags: $number\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $k = 0; $k <= $#keptpatchflags; $k++ )
+ {
+ $infoline = "KEPT PATCH FLAGS: $keptpatchflags[$k]\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ my @warningfiles = ();
+
+ for ( my $k = 0; $k <= $#{$patchlistfiles}; $k++ )
+ {
+ if ( ! installer::existence::exists_in_array(${$patchlistfiles}[$k],\@keptpatchflags) )
+ {
+ push(@warningfiles, ${$patchlistfiles}[$k]);
+ }
+ }
+
+ for ( my $k = 0; $k <= $#warningfiles; $k++ )
+ {
+ $infoline = "WARNING: $warningfiles[$k] did not keep PATCH flag (does not exist in zip file)!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ if ( $unziperror )
+ {
+ installer::logger::print_warning( "Repeating to unpack $sourcepath! \n" );
+ $infoline = "ATTENTION: Repeating to unpack $sourcepath !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $repeat_unzip = 1;
+ $maxcounter++;
+
+ if ( $maxcounter == 5 ) # exiting the program
+ {
+ installer::exiter::exit_program("ERROR: Failed to unzip $sourcepath !", "resolving_archive_flag");
+ }
+ }
+ else
+ {
+ $infoline = "Info: $sourcepath unpacked without problems !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $repeat_unzip = 0;
+ $maxcounter = 0;
+ }
+ }
+ }
+ else # nothing to do here, no zipped file (no ARCHIVE flag)
+ {
+ push(@newallfilesarray, $onefile);
+ }
+ }
+
+ $infoline = "\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return \@newallfilesarray;
+}
+
+
+1;
diff --git a/solenv/bin/modules/installer/configuration.pm b/solenv/bin/modules/installer/configuration.pm
new file mode 100644
index 000000000000..4aa82d25b5b2
--- /dev/null
+++ b/solenv/bin/modules/installer/configuration.pm
@@ -0,0 +1,901 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::configuration;
+
+use Cwd;
+use installer::converter;
+use installer::existence;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::remover;
+use installer::systemactions;
+
+################################################################################
+# Getting package from configurationitem (for instance: org.openoffice.Office)
+# Getting name from configurationitem (for instance: Common)
+################################################################################
+
+sub analyze_path_of_configurationitem
+{
+ my ($configurationitemsref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::configuration::analyze_path_of_configurationitem : $#{$configurationitemsref}"); }
+
+ my ($startpath, $nodes, $name, $packagename, $onenode, $first, $second, $third, $bracketnode);
+
+ for ( my $i = 0; $i <= $#{$configurationitemsref}; $i++ )
+ {
+ my $oneconfig = ${$configurationitemsref}[$i];
+ my $path = $oneconfig->{'Path'};
+
+ installer::remover::remove_leading_and_ending_slashes(\$path); # in scp are some path beginning with "/"
+
+ if ( $path =~ /^\s*(.*?)\/(.*)\s*$/ )
+ {
+ $startpath = $1;
+ $nodes = $2;
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: Unknown format of ConfigurationItem path: $path", "analyze_path_of_configurationitem");
+ }
+
+ # Startpath is now: org.openoffice.Setup
+ # Nodes is now: Office/Factories/com.sun.star.chart.ChartDocument
+
+ # Dividing the startpath into package (org.openoffic) and name (Setup).
+
+ $oneconfig->{'startpath'} = $startpath; # saving the startpath into the hash
+
+ if ( $startpath =~ /^\s*(\S*)\.(\S*?)\s*$/ )
+ {
+ $packagename = $1;
+ $name = $2;
+ $oneconfig->{'name'} = $name;
+ $oneconfig->{'packagename'} = $packagename;
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: Unknown format of ConfigurationItem startpath: $startpath", "analyze_path_of_configurationitem");
+ }
+
+ # Collecting all nodes
+
+ installer::remover::remove_leading_and_ending_slashes(\$nodes);
+
+ my $counter = 1;
+
+ # Attention: Do not trust the slash
+ # Filters/Filter['StarWriter 5.0 Vorlage/Template']
+ # Menus/New/*['m10']/Title
+
+ if ( $nodes =~ /^(.*\[\')(.*\/.*)(\'\].*)$/ )
+ {
+ $first = $1;
+ $second = $2;
+ $third = $3;
+
+ $second =~ s/\//SUBSTITUTEDSLASH/g; # substituting "/" to "SUBSTITUTEDSLASH"
+ $nodes = $first . $second . $third;
+ }
+
+ while ( $nodes =~ /\// )
+ {
+ if ($nodes =~ /^\s*(.*?)\/(.*)\s*$/ )
+ {
+ $onenode = $1;
+ $nodes = $2;
+ $nodename = "node". $counter;
+
+ # Special handling for filters. Difference between:
+ # Filter['StarWriter 5.0 Vorlage/Template'] without oor:op="replace"
+ # *['m10'] with oor:op="replace"
+
+ if ( $onenode =~ /^\s*Filter\[\'(.*)\'\].*$/ ) { $oneconfig->{'isfilter'} = 1; }
+
+ # Changing the nodes with brackets:
+ # Filter['StarWriter 5.0 Vorlage/Template']
+ # *['m10']
+
+ if ( $onenode =~ /^.*\[\'(.*)\'\].*$/ )
+ {
+ $onenode = $1;
+ $bracketnode = "bracket_" . $nodename;
+ $oneconfig->{$bracketnode} = 1;
+ }
+
+ $onenode =~ s/SUBSTITUTEDSLASH/\//g; # substituting "SUBSTITUTEDSLASH" to "/"
+ $oneconfig->{$nodename} = $onenode;
+
+ # special handling for nodes "Factories"
+
+ if ( $onenode eq "Factories" ) { $oneconfig->{'factoriesnode'} = $counter; }
+ else { $oneconfig->{'factoriesnode'} = -99; }
+ }
+
+ $counter++
+ }
+
+ # and the final node
+
+ if ( $nodes =~ /^\s*Filter\[\'(.*)\'\].*$/ ) { $oneconfig->{'isfilter'} = 1; }
+
+ $nodename = "node". $counter;
+
+ if ( $nodes =~ /^.*\[\'(.*)\'\].*$/ )
+ {
+ $nodes = $1;
+ $bracketnode = "bracket_" . $nodename;
+ $oneconfig->{$bracketnode} = 1;
+ }
+
+ $nodes =~ s/SUBSTITUTEDSLASH/\//g; # substituting "SUBSTITUTEDSLASH" to "/"
+
+ if (($nodes eq "Name") || ($nodes eq "Title")) # isocodes below "Name" or "Title"
+ {
+ # if the last node $nodes is "Name" or "Title", it is a Property, not a name! See Common.xcu
+
+ $oneconfig->{'isisocode'} = 1;
+
+ if ( $nodes eq "Name" ) { $oneconfig->{'isname'} = 1; }
+ if ( $nodes eq "Title" ) { $oneconfig->{'istitle'} = 1; }
+ $counter--; # decreasing the counter, because "Name" and "Title" are no nodes
+ }
+ else
+ {
+ $oneconfig->{$nodename} = $nodes;
+ $oneconfig->{'isisocode'} = 0;
+ }
+
+ # special handling for nodes "Factories"
+
+ if ( $onenode eq "Factories" ) { $oneconfig->{'factoriesnode'} = $counter; }
+ else { $oneconfig->{'factoriesnode'} = -99; }
+
+ # saving the number of nodes
+
+ $oneconfig->{'nodenumber'} = $counter;
+ }
+}
+
+####################################################################
+# Inserting the start block into a configuration file
+####################################################################
+
+sub insert_start_block_into_configfile
+{
+ my ($configfileref, $oneconfig) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::configuration::insert_start_block_into_configfile : $#{$configfileref} : $oneconfig->{'name'}"); }
+
+ my $line = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
+ push( @{$configfileref}, $line);
+
+ $line = '<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:install="http://openoffice.org/2004/installation" oor:name="FILENAME" oor:package="PACKAGENAME">' . "\n";
+ my $packagename = $oneconfig->{'packagename'};
+ my $name = $oneconfig->{'name'};
+ $line =~ s/PACKAGENAME/$packagename/g;
+ $line =~ s/FILENAME/$name/g;
+ push( @{$configfileref}, $line);
+
+ $line = "\n";
+ push( @{$configfileref}, $line);
+}
+
+####################################################################
+# Inserting the end block into a configuration file
+####################################################################
+
+sub insert_end_block_into_configfile
+{
+ my ($configfileref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::configuration::insert_end_block_into_configfile : $#{$configfileref}"); }
+
+ my $line = "\n" . '</oor:component-data>' . "\n";
+ push( @{$configfileref}, $line);
+}
+
+##############################################################
+# Getting the content of a node
+##############################################################
+
+sub get_node_content
+{
+ my ($nodeline) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::configuration::get_node_content : $nodeline"); }
+
+ my $content = "";
+
+ if ( $nodeline =~ /name\=\"(.*?)\"/ )
+ {
+ $content = $1;
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: Impossible error in function get_node_content!", "get_node_content");
+ }
+
+ return \$content;
+}
+
+##############################################################
+# Getting the line number of an existing node
+# Return "-1" if node does not exist
+##############################################################
+
+sub get_node_line_number
+{
+ my ($nodecount, $oneconfig, $oneconfigfileref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::configuration::get_node_line_number : $nodecount : $oneconfig->{'name'} : $#{$oneconfigfileref}"); }
+
+ my $linenumber = -1; # the node does not exists, if returnvalue is "-1"
+
+ # Attention: Take care of the two title nodes:
+ # Path=org.openoffice.Office.Common/Menus/Wizard/*['m14']/Title
+ # Path=org.openoffice.Office.Common/Menus/Wizard/*['m15']/Title
+ # -> every subnode has to be identical
+
+ # creating the allnodes string from $oneconfig
+
+ my $allnodes = "";
+
+ for ( my $i = 1; $i <= $nodecount; $i++ )
+ {
+ my $nodename = "node" . $i;
+ $allnodes .= $oneconfig->{$nodename} . "/";
+ }
+
+ installer::remover::remove_leading_and_ending_slashes(\$allnodes); # exactly this string has to be found in the following iteration
+
+ # Iterating over the already built configuration file
+
+ my @allnodes = ();
+
+ for ( my $i = 0; $i <= $#{$oneconfigfileref}; $i++ )
+ {
+ my $line = ${$oneconfigfileref}[$i];
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ my $nodechanged = 0;
+
+ if ( $line =~ /^\s*\<node/ ) # opening node
+ {
+ $nodechanged = 1;
+ my $nodecontentref = get_node_content($line);
+ push(@allnodes, $$nodecontentref); # collecting all nodes in an array
+ }
+
+ if ( $line =~ /^\s*\<\/node/ ) # ending node
+ {
+ $nodechanged = 1;
+ pop(@allnodes); # removing the last node from the array
+ }
+
+ if (( $nodechanged ) && ($#allnodes > -1)) # a node was found and the node array is not empty
+ {
+ # creating the string to compare with the string $allnodes
+
+ my $nodestring = "";
+
+ for ( my $j = 0; $j <= $#allnodes; $j++ )
+ {
+ $nodestring .= $allnodes[$j] . "/";
+ }
+
+ installer::remover::remove_leading_and_ending_slashes(\$nodestring);
+
+ if ( $nodestring eq $allnodes )
+ {
+ # that is exactly the same node
+
+ $linenumber = $i;
+ $linenumber++; # increasing the linenumber
+ last;
+
+ }
+ }
+ }
+
+ return $linenumber;
+}
+
+##############################################################
+# Inserting one configurationitem into the configurationfile
+##############################################################
+
+sub insert_into_config_file
+{
+ my ($oneconfig, $oneconfigfileref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::configuration::insert_into_config_file : $oneconfig->{'nodenumber'} : $#{$oneconfigfileref}"); }
+
+ my ($nodename, $nodecontent, $newnodeline, $bracketkey, $line, $insertline);
+
+ # interpreting the nodes, keys and values
+
+ my $nodeline = '<node oor:name="NODECONTENT" REPLACEPART >' . "\n";
+ my $propline = '<prop oor:name="KEYCONTENT" REPLACEPART TYPEPART>' . "\n";
+ my $valueline = '<value SEPARATORPART>VALUECONTENT</value>' . "\n";
+ my $langvalueline = '<value xml:lang="SAVEDLANGUAGE">VALUECONTENT</value>' . "\n";
+ my $propendline = '</prop>' . "\n";
+ my $nodeendline = '</node>' . "\n";
+
+ my $replacepart = 'oor:op="replace"';
+ my $typepart = 'oor:type="xs:VALUETYPE"'; # VALUETYPE can be "string", "boolean", ...
+
+ my $nodecount = $oneconfig->{'nodenumber'};
+ my $styles = $oneconfig->{'Styles'};
+
+ for ( my $i = 1; $i <= $nodecount; $i++ )
+ {
+ $insertline = get_node_line_number($i, $oneconfig, $oneconfigfileref);
+
+ if ( $insertline == -1) # if true, the node does not exist
+ {
+ $nodename = "node" . $i;
+ $nodecontent = $oneconfig->{$nodename};
+ $newnodeline = $nodeline;
+
+ $newnodeline =~ s/NODECONTENT/$nodecontent/g;
+
+ # Case1:
+ # Nodes with brackets, need the replacepart 'oor:op="replace"'
+ # Bracket node is set for each node with: bracket_node1=1, bracket_node2=1, ...
+ # Case a: <node oor:name="m0" oor:op="replace"> (Common.xcu needs oor:op="replace")
+ # Case b: <node oor:name="Ami Pro 1.x-3.1 (W4W)"> (TypeDetection.xcu does not need oor:op="replace")
+ # For case b introducting a special case for Filters
+
+ $bracketkey = "bracket_" . $nodename;
+
+ my $localbracketkey = 0;
+
+ if ( $oneconfig->{$bracketkey} ) { $localbracketkey = $oneconfig->{$bracketkey}; }
+
+ if ( $localbracketkey == 1 ) # 'oor:op="replace"' is needed
+ {
+ my $isfilter = 0;
+ if ( $oneconfig->{'isfilter'} ) { $isfilter = $oneconfig->{'isfilter'}; }
+
+ if ( $isfilter == 1 ) # this is a filter
+ {
+ $newnodeline =~ s/REPLACEPART//;
+ }
+ else
+ {
+ $newnodeline =~ s/REPLACEPART/$replacepart/;
+ }
+
+ $newnodeline =~ s/\s*\>/\>/; # removing resulting whitespaces
+ }
+
+ # Case2:
+ # Nodes below a Node "Factories", also need the replacepart 'oor:op="replace"'
+ # This is saved in $oneconfig->{'factoriesnode'}. If not set, the value is "-99"
+
+ if ( $i == $oneconfig->{'factoriesnode'} )
+ {
+ $newnodeline =~ s/REPLACEPART/$replacepart/;
+ $newnodeline =~ s/\s*\>/\>/; # removing resulting whitespaces
+ }
+
+ # Case3:
+ # In all other cases, REPLACEPART in nodes can be removed
+
+ $newnodeline =~ s/REPLACEPART//;
+ $newnodeline =~ s/\s*\>/\>/; # removing resulting whitespaces
+
+ # Finding the correct place for inserting the node
+
+ if ( $i == 1 ) # this is a toplevel node
+ {
+ push(@{$oneconfigfileref}, $newnodeline);
+ push(@{$oneconfigfileref}, $nodeendline);
+ }
+ else
+ {
+ # searching for the parent node
+
+ my $parentnumber = $i-1;
+ $insertline = get_node_line_number($parentnumber, $oneconfig, $oneconfigfileref);
+ splice(@{$oneconfigfileref}, $insertline, 0, ($newnodeline, $nodeendline));
+ }
+ }
+ }
+
+ # Setting variables $isbracketnode and $isfactorynode for the properties
+
+
+ my $isbracketnode = 0;
+ my $isfactorynode = 0;
+
+ for ( my $i = 1; $i <= $nodecount; $i++ )
+ {
+ $nodename = "node" . $i;
+ $bracketkey = "bracket_" . $nodename;
+
+ my $localbracketkey = 0;
+ if ( $oneconfig->{$bracketkey} ) { $localbracketkey = $oneconfig->{$bracketkey}; }
+
+ if ( $localbracketkey == 1 ) { $isbracketnode = 1; }
+ if ( $i == $oneconfig->{'factoriesnode'} ) { $isfactorynode = 1; }
+ }
+
+ # now all nodes exist, and the key and value can be inserted into the configfile
+ # the next line contains the key, for instance: <prop oor:name="UseDefaultMailer" oor:type="xs:boolean">
+ # my $propline = '<prop oor:name="KEYCONTENT" REPLACEPART TYPEPART>' . "\n";
+ # The type is only needed, if a replace is set.
+
+ my $newpropline = $propline;
+
+ # Replacement of KEYCONTENT, REPLACEPART and TYPEPART
+
+ # Case 1:
+ # Properties with oor:name="Name" (Common.xcu) are simply <prop oor:name="Name">
+ # The information about such a property is stored in $oneconfig->{'isisocode'}
+
+ if ( $oneconfig->{'isisocode'} )
+ {
+ if ( $oneconfig->{'isname'} ) { $newpropline =~ s/KEYCONTENT/Name/; } # The property name is always "Name"
+ if ( $oneconfig->{'istitle'} ) { $newpropline =~ s/KEYCONTENT/Title/; } # The property name is always "Title"
+ $newpropline =~ s/REPLACEPART//;
+ $newpropline =~ s/TYPEPART//;
+ $newpropline =~ s/\s*\>/\>/; # removing resulting whitespaces
+ }
+
+ # Begin of all other cases
+
+ my $key = $oneconfig->{'Key'};
+ $newpropline =~ s/KEYCONTENT/$key/;
+
+ my $valuetype;
+
+ if ( $styles =~ /CFG_STRING\b/ ) { $valuetype = "string"; }
+ elsif ( $styles =~ /CFG_NUMERIC/ ) { $valuetype = "int"; }
+ elsif ( $styles =~ /CFG_BOOLEAN/ ) { $valuetype = "boolean"; }
+ elsif ( $styles =~ /CFG_STRINGLIST/ ) { $valuetype = "string-list"; }
+# elsif ( $styles =~ /CFG_STRINGLIST/ ) { $valuetype = "string-list oor:separator=\"\|\""; }
+ else
+ {
+ installer::exiter::exit_program("ERROR: Unknown configuration value type: $styles", "insert_into_config_file");
+ }
+
+ # Case 2:
+ # Properties below a node "Factories" do not need a 'oor:op="replace"' and a 'oor:type="xs:VALUETYPE"'
+
+ if ( $isfactorynode )
+ {
+ $newpropline =~ s/REPLACEPART//;
+ $newpropline =~ s/TYPEPART//;
+ $newpropline =~ s/\s*\>/\>/; # removing resulting whitespaces
+ }
+
+ # Case 3:
+ # Properties below a "bracket" node do not need a 'oor:op="replace"', except they are iso-codes
+ # Assumption here: They are multilingual
+
+ if ( $isbracketnode )
+ {
+ my $localtypepart = $typepart;
+ $localtypepart =~ s/VALUETYPE/$valuetype/;
+ $newpropline =~ s/TYPEPART/$localtypepart/;
+
+ if ( $oneconfig->{'ismultilingual'} ) # This is solved by "Name" and "Title"
+ {
+ $newpropline =~ s/REPLACEPART/$replacepart/;
+ }
+ else
+ {
+ $newpropline =~ s/REPLACEPART//;
+ }
+
+ $newpropline =~ s/\s*\>/\>/; # removing resulting whitespaces
+ }
+
+ # Case 4:
+ # if the flag CREATE is set, the properties get 'oor:op="replace"' and 'oor:type="xs:VALUETYPE"'
+
+ if (( $styles =~ /\bCREATE\b/ ) && (!($isbracketnode)))
+ {
+ # my $typepart = 'oor:type="xs:VALUETYPE"'; # VALUETYPE can be "string", "boolean", ...
+
+ my $localtypepart = $typepart;
+ $localtypepart =~ s/VALUETYPE/$valuetype/;
+
+ $newpropline =~ s/TYPEPART/$localtypepart/;
+ $newpropline =~ s/REPLACEPART/$replacepart/;
+ $newpropline =~ s/\s*\>/\>/; # removing resulting whitespaces
+ }
+
+ # Case 5:
+ # all other ConfigurationItems do not need 'oor:op="replace"' and 'oor:type="xs:VALUETYPE"'
+
+ $newpropline =~ s/REPLACEPART//;
+ $newpropline =~ s/TYPEPART//;
+ $newpropline =~ s/\s*\>/\>/; # removing resulting whitespaces
+
+ # finally the value can be set
+
+ my $value = $oneconfig->{'Value'};
+
+ # Some values in setup script are written during installation process by the setup. These
+ # have values like "<title>". This will lead to an error, because of the brackets. Therefore the
+ # brackets have to be removed.
+
+ # ToDo: Substituting the setup replace variables
+
+ # replace_setting_variables();
+
+ $value =~ s/^\s*\<//;
+ $value =~ s/\>\s*$//;
+
+ # Deal with list separators
+ my $separatorpart = '';
+ if ( ($valuetype eq "string-list") && ($value =~ /\|/) )
+ {
+ $separatorpart = 'oor:separator="|"';
+ }
+
+ # Fake: substituting german umlauts
+
+ $value =~ s/\ä/ae/;
+ $value =~ s/\ö/oe/;
+ $value =~ s/\ü/ue/;
+ $value =~ s/\Ä/AE/;
+ $value =~ s/\Ö/OE/;
+ $value =~ s/\Ü/UE/;
+
+ my $newvalueline;
+
+ if (!($oneconfig->{'isisocode'} )) # this is the simpe case
+ {
+ # my $valueline = '<value SEPARATORPART>VALUECONTENT</value>' . "\n";
+ $newvalueline = $valueline;
+ $newvalueline =~ s/VALUECONTENT/$value/g;
+ $newvalueline =~ s/SEPARATORPART/$separatorpart/;
+ }
+ else
+ {
+ # my $langvalueline = '<value xml:lang="SAVEDLANGUAGE">VALUECONTENT</value>' . "\n";
+ $newvalueline = $langvalueline;
+ $newvalueline =~ s/VALUECONTENT/$value/;
+ my $savedlanguage = $oneconfig->{'Key'};
+ $newvalueline =~ s/SAVEDLANGUAGE/$savedlanguage/;
+ }
+
+ # For language dependent values, it is possible, that the property already exist.
+ # In this case the prop must not be created again and only the value has to be included:
+ # <prop oor:name="Name">
+ # <value xml:lang="de">OpenOffice.org 2.0 Diagramm</value>
+ # <value xml:lang="en-US">OpenOffice.org 2.0 Chart</value>
+ # </prop>
+
+ # The key has to be written after the line, containing the complete node
+
+ $insertline = get_node_line_number($nodecount, $oneconfig, $oneconfigfileref);
+
+ if ( $oneconfig->{'ismultilingual'} )
+ {
+ if ( $newpropline eq ${$oneconfigfileref}[$insertline] )
+ {
+ if (!($newvalueline eq ${$oneconfigfileref}[$insertline+1])) # only include, if the value not already exists (example: value="FALSE" for many languages)
+ {
+ splice(@{$oneconfigfileref}, $insertline+1, 0, ($newvalueline)); # only the value needs to be added
+ }
+ }
+ else
+ {
+ splice(@{$oneconfigfileref}, $insertline, 0, ($newpropline, $newvalueline, $propendline));
+ }
+ }
+ else
+ {
+ splice(@{$oneconfigfileref}, $insertline, 0, ($newpropline, $newvalueline, $propendline));
+ }
+
+ return $oneconfigfileref;
+}
+
+##########################################################
+# Inserting tabs for better view into configuration file
+##########################################################
+
+sub insert_tabs_into_configfile
+{
+ my ($configfileref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::configuration::insert_tabs_into_configfile : $#{$configfileref}"); }
+
+ my $counter = 0;
+
+ for ( my $i = 0; $i <= $#{$configfileref}; $i++ )
+ {
+ my $line = ${$configfileref}[$i];
+ my $linebefore = ${$configfileref}[$i-1];
+
+ if (( $line =~ /^\s*\<node/ ) || ( $line =~ /^\s*\<prop/ ))
+ {
+ if ((!( $linebefore =~ /^\s*\<\/node/ )) && (!( $linebefore =~ /^\s*\<\/prop/ ))) # do not increase after "</node" and after "</prop"
+ {
+ $counter++;
+ }
+ }
+
+ if ( $line =~ /^\s*\<value/ )
+ {
+ if (!($linebefore =~ /^\s*\<value/ )) # do not increase counter with "<value>" after "<value>" (multilingual configitems)
+ {
+ $counter++;
+ }
+ }
+
+ if (( $line =~ /^\s*\<\/node\>/ ) || ( $line =~ /^\s*\<\/prop\>/ ))
+ {
+ if ((!( $linebefore =~ /^\s*\<node/ )) && (!( $linebefore =~ /^\s*\<prop/ ))) # do not decrease after "<node" and after "<prop"
+ {
+ $counter--;
+ }
+ }
+
+ if ($counter > 0)
+ {
+ for ( my $j = 0; $j < $counter; $j++ )
+ {
+ $line = "\t" . $line;
+ }
+ }
+
+ ${$configfileref}[$i] = $line;
+ }
+}
+
+######################################################################
+# Collecting all different configuration items (Files and Modules)
+######################################################################
+
+sub collect_all_configuration_items
+{
+ my ($configurationitemsref, $item) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::configuration::collect_all_configuration_items : $#{$configurationitemsref} : $item"); }
+
+ my @allitems = ();
+
+ for ( my $i = 0; $i <= $#{$configurationitemsref}; $i++ )
+ {
+ my $oneconfig = ${$configurationitemsref}[$i];
+
+ if (! installer::existence::exists_in_array($oneconfig->{$item}, \@allitems))
+ {
+ push(@allitems, $oneconfig->{$item});
+ }
+ }
+
+ return \@allitems;
+}
+
+######################################################################
+# Collecting all module specific configuration items
+######################################################################
+
+sub get_all_configitems_at_module
+{
+ my ($moduleid, $configurationitemsref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::configuration::get_all_configitems_at_module : $moduleid : $#{$configurationitemsref}"); }
+
+ my @moduleconfigurationitems = ();
+
+ for ( my $i = 0; $i <= $#{$configurationitemsref}; $i++ )
+ {
+ my $oneconfig = ${$configurationitemsref}[$i];
+
+ if ( $oneconfig->{'ModuleID'} eq $moduleid )
+ {
+ push(@moduleconfigurationitems, $oneconfig);
+ }
+ }
+
+ return \@moduleconfigurationitems;
+}
+
+#######################################################
+# Saving and zipping the created configurationfile
+#######################################################
+
+sub save_and_zip_configfile
+{
+ my ($oneconfigfileref, $onefile, $onemodule, $configdir) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::configuration::save_and_zip_configfile : $#{$oneconfigfileref} : $onefile : $onemodule : $configdir"); }
+
+ my $savefilename = $onefile;
+ $savefilename =~ s/\./\_/g;
+ $savefilename = $savefilename . "_" . $onemodule;
+ $savefilename = $savefilename . ".xcu";
+ my $shortsavefilename = $savefilename;
+
+ $savefilename = $configdir . $installer::globals::separator . $savefilename;
+
+ installer::files::save_file($savefilename, $oneconfigfileref);
+
+ # zipping the configfile
+
+ my $returnvalue = 1;
+
+ my $zipfilename = $shortsavefilename;
+ $zipfilename =~ s/\.xcu/\.zip/;
+
+ my $currentdir = cwd();
+ if ( $installer::globals::iswin ) { $currentdir =~ s/\//\\/g; }
+
+ chdir($configdir);
+
+ my $systemcall = "$installer::globals::zippath -q -m $zipfilename $shortsavefilename";
+ $returnvalue = system($systemcall);
+
+ chdir($currentdir);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not zip $savefilename to $zipfilename\n";
+ }
+ else
+ {
+ $infoline = "SUCCESS: Zipped file $savefilename to $zipfilename\n";
+ }
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return $zipfilename;
+}
+
+#####################################################################
+# Adding the newly created configuration file into the file list
+#####################################################################
+
+sub add_zipfile_into_filelist
+{
+ my ($zipfilename, $configdir, $filesarrayref, $onemodule) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::configuration::add_zipfile_into_filelist: $zipfilename : $configdir : $#{$filesarrayref} : $onemodule"); }
+
+ my $longzipfilename = $configdir . $installer::globals::separator . $zipfilename;
+ my $gid = "gid_" . $zipfilename;
+ $gid =~ s/\./\_/g;
+
+ my %configfile = ();
+
+ # Taking the base data from the "gid_File_Lib_Vcl"
+
+ my $vclgid = "gid_File_Lib_Vcl";
+ my $vclfile = installer::existence::get_specified_file($filesarrayref, $vclgid);
+
+ # copying all base data
+ installer::converter::copy_item_object($vclfile, \%configfile);
+
+ # and overriding all new data
+ $configfile{'ismultilingual'} = 0;
+ $configfile{'sourcepath'} = $longzipfilename;
+ $configfile{'Name'} = $zipfilename;
+ $configfile{'UnixRights'} = "644";
+ $configfile{'gid'} = $gid;
+ $configfile{'Dir'} = "gid_Dir_Share_Uno_Packages";
+ $configfile{'destination'} = "share" . $installer::globals::separator . "uno_packages" . $installer::globals::separator . $zipfilename;
+ $configfile{'modules'} = $onemodule; # assigning the file to the correct module!
+
+ push(@{$filesarrayref}, \%configfile);
+}
+
+#######################################################
+# Creating configuration files from configurationitems
+#######################################################
+
+sub create_configuration_files
+{
+ my ($configurationitemsref, $filesarrayref, $languagestringref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::configuration::create_configuration_files: $#{$configurationitemsref} : $#{$filesarrayref} : $$languagestringref"); }
+
+ installer::logger::include_header_into_logfile("Creating configuration files:");
+
+ # creating the directory
+
+ my $configdir = installer::systemactions::create_directories("configfiles", $languagestringref);
+
+ $configdir = installer::converter::make_path_conform($configdir);
+
+ # collecting an array of all modules
+ my $allmodules = collect_all_configuration_items($configurationitemsref, "ModuleID");
+
+ # iterating over all modules
+
+ for ( my $i = 0; $i <= $#{$allmodules}; $i++ )
+ {
+ my $onemodule = ${$allmodules}[$i];
+
+ my $moduleconfigitems = get_all_configitems_at_module($onemodule, $configurationitemsref);
+
+ # collecting an array of all "startpath". This are all different files (org.openoffice.Office.Common).
+ my $allfiles = collect_all_configuration_items($moduleconfigitems, "startpath");
+
+ # iteration over all files
+
+ for ( my $j = 0; $j <= $#{$allfiles}; $j++ )
+ {
+ my $onefile = ${$allfiles}[$j];
+
+ my @oneconfigfile = ();
+ my $oneconfigfileref = \@oneconfigfile;
+
+ my $startblockwritten = 0;
+
+ for ( my $k = 0; $k <= $#{$moduleconfigitems}; $k++ )
+ {
+ my $oneconfig = ${$moduleconfigitems}[$k];
+
+ my $startpath = $oneconfig->{'startpath'};
+
+ if ($startpath eq $onefile)
+ {
+ if (!($startblockwritten)) # writing some global lines into the xcu file
+ {
+ insert_start_block_into_configfile($oneconfigfileref, $oneconfig);
+ $startblockwritten = 1;
+ }
+
+ $oneconfigfileref = insert_into_config_file($oneconfig, $oneconfigfileref);
+ }
+ }
+
+ insert_end_block_into_configfile($oneconfigfileref);
+
+ # inserting tabs for nice appearance
+ insert_tabs_into_configfile($oneconfigfileref);
+
+ # saving the configfile
+ my $zipfilename = save_and_zip_configfile($oneconfigfileref, $onefile, $onemodule, $configdir);
+
+ # adding the zipped configfile to the list of installed files
+ # Some data are set now, others are taken from the file "soffice.exe" ("soffice.bin")
+
+ add_zipfile_into_filelist($zipfilename, $configdir, $filesarrayref, $onemodule);
+ }
+ }
+
+ my $infoline = "\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+}
+
+1;
diff --git a/solenv/bin/modules/installer/control.pm b/solenv/bin/modules/installer/control.pm
new file mode 100644
index 000000000000..20bc2efdcf4f
--- /dev/null
+++ b/solenv/bin/modules/installer/control.pm
@@ -0,0 +1,759 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::control;
+
+use Cwd;
+use installer::converter;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::pathanalyzer;
+use installer::scriptitems;
+use installer::systemactions;
+
+#########################################################
+# Function that can be used for additional controls.
+# Search happens in $installer::globals::patharray.
+#########################################################
+
+sub check_needed_files_in_path
+{
+ my ( $filesref ) = @_;
+
+ foreach $onefile ( @{$filesref} )
+ {
+ installer::logger::print_message( "...... searching $onefile ..." );
+
+ my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$onefile, $installer::globals::patharray , 0);
+
+ if ( $$fileref eq "" )
+ {
+ $error = 1;
+ installer::logger::print_error( "$onefile not found\n" );
+ }
+ else
+ {
+ installer::logger::print_message( "\tFound: $$fileref\n" );
+ }
+ }
+
+ if ( $error )
+ {
+ installer::exiter::exit_program("ERROR: Could not find all needed files in path!", "check_needed_files_in_path");
+ }
+}
+
+#########################################################
+# Checking the local system
+# Checking existence of needed files in include path
+#########################################################
+
+sub check_system_path
+{
+ # The following files have to be found in the environment variable PATH
+ # All platforms: zip
+ # Windows only: msvcp70.dll, msvcr70.dll for regcomp.exe
+ # Windows only: "msiinfo.exe", "msidb.exe", "uuidgen.exe", "makecab.exe", "msitran.exe", "expand.exe" for msi database and packaging
+
+ my $onefile;
+ my $error = 0;
+ my $pathvariable = $ENV{'PATH'};
+ my $local_pathseparator = $installer::globals::pathseparator;
+
+ if( $^O =~ /cygwin/i )
+ { # When using cygwin's perl the PATH variable is POSIX style and ...
+ $pathvariable = qx{cygpath -mp "$pathvariable"} ;
+ # has to be converted to DOS style for further use.
+ $local_pathseparator = ';';
+ }
+ my $patharrayref = installer::converter::convert_stringlist_into_array(\$pathvariable, $local_pathseparator);
+
+ $installer::globals::patharray = $patharrayref;
+
+ my @needed_files_in_path = ();
+
+ if (($installer::globals::iswin) && ($installer::globals::iswindowsbuild))
+ {
+ @needed_files_in_path = ("zip.exe", "msiinfo.exe", "msidb.exe", "uuidgen.exe", "makecab.exe", "msitran.exe", "expand.exe");
+
+ if ( $installer::globals::compiler eq "wntmsci8" )
+ {
+ push(@needed_files_in_path, "msvcp70.dll");
+ push(@needed_files_in_path, "msvcr70.dll");
+ }
+
+ if ( $installer::globals::compiler eq "wntmsci10" )
+ {
+ push(@needed_files_in_path, "msvcp71.dll");
+ push(@needed_files_in_path, "msvcr71.dll");
+ }
+
+ }
+ elsif ($installer::globals::iswin)
+ {
+ @needed_files_in_path = ("zip.exe");
+ }
+ else
+ {
+ @needed_files_in_path = ("zip");
+ }
+
+ foreach $onefile ( @needed_files_in_path )
+ {
+ installer::logger::print_message( "...... searching $onefile ..." );
+
+ my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$onefile, $patharrayref , 0);
+
+ if ( $$fileref eq "" )
+ {
+ $error = 1;
+ installer::logger::print_error( "$onefile not found\n" );
+ }
+ else
+ {
+ installer::logger::print_message( "\tFound: $$fileref\n" );
+ # Saving the absolut path for msitran.exe. This is required for the determination of the checksum.
+ if ( $onefile eq "msitran.exe" ) { $installer::globals::msitranpath = $$fileref; }
+ }
+ }
+
+ if ( $error )
+ {
+ installer::exiter::exit_program("ERROR: Could not find all needed files in path!", "check_system_path");
+ }
+
+ # checking for epm, which has to be in the path or in the solver
+
+ if (( $installer::globals::call_epm ) && (!($installer::globals::iswindowsbuild)))
+ {
+ my $onefile = "epm";
+ my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$onefile, $patharrayref , 0);
+ if (!( $$fileref eq "" ))
+ {
+ $installer::globals::epm_in_path = 1;
+
+ if ( $$fileref =~ /^\s*\.\/epm\s*$/ )
+ {
+ my $currentdir = cwd();
+ $$fileref =~ s/\./$currentdir/;
+ }
+
+ $installer::globals::epm_path = $$fileref;
+ }
+ }
+
+ # checking, if upx can be found in path
+
+ if ( $installer::globals::iswindowsbuild ) { $installer::globals::upxfile = "upx.exe"; }
+ else { $installer::globals::upxfile = "upx"; }
+
+ my $upxfilename = $installer::globals::upxfile;
+ my $upxfileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$upxfilename, $patharrayref , 0);
+
+ if (!( $$upxfileref eq "" ))
+ {
+ $installer::globals::upx_in_path = 1;
+ $installer::globals::upxfile = $$upxfileref;
+ installer::logger::print_message( "\tFound: $$upxfileref\n" );
+ }
+
+}
+
+######################################################################
+# Determining the version of file makecab.exe
+######################################################################
+
+sub get_makecab_version
+{
+ my $makecabversion = -1;
+
+ my $systemcall = "makecab.exe |";
+ my @makecaboutput = ();
+
+ open (CAB, $systemcall);
+ while (<CAB>) { push(@makecaboutput, $_); }
+ close (CAB);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ my $versionline = "";
+
+ for ( my $i = 0; $i <= $#makecaboutput; $i++ )
+ {
+ if ( $makecaboutput[$i] =~ /\bVersion\b/i )
+ {
+ $versionline = $makecaboutput[$i];
+ last;
+ }
+ }
+
+ $infoline = $versionline;
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ if ( $versionline =~ /\bVersion\b\s+(\d+[\d\.]+\d+)\s+/ )
+ {
+ $makecabversion = $1;
+ }
+
+ # Only using the first number
+
+ if ( $makecabversion =~ /^\s*(\d+?)\D*/ )
+ {
+ $makecabversion = $1;
+ }
+
+ $infoline = "Using version: " . $makecabversion . "\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ }
+
+ return $makecabversion;
+}
+
+######################################################################
+# Checking the version of file makecab.exe
+######################################################################
+
+sub check_makecab_version
+{
+ # checking version of makecab.exe
+ # Now it is guaranteed, that makecab.exe is in the path
+
+ my $do_check = 1;
+
+ my $makecabversion = get_makecab_version();
+
+ my $infoline = "Tested version: " . $installer::globals::controlledmakecabversion . "\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ if ( $makecabversion < 0 ) { $do_check = 0; } # version could not be determined
+
+ if ( $do_check )
+ {
+ if ( $makecabversion < $installer::globals::controlledmakecabversion )
+ {
+ # warning for OOo, error for inhouse products
+ if ( $installer::globals::isopensourceproduct )
+ {
+ installer::logger::print_warning("Old version of makecab.exe. Found version: \"$makecabversion\", tested version: \"$installer::globals::controlledmakecabversion\"!\n");
+ }
+ else
+ {
+ installer::exiter::exit_program("makecab.exe too old. Found version: \"$makecabversion\", required version: \"$installer::globals::controlledmakecabversion\"!", "check_makecab_version");
+ }
+ }
+ }
+ else
+ {
+ $infoline = "Warning: No version check of makecab.exe\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ }
+}
+
+######################################################################
+# Reading the environment variables for the pathes in ziplist.
+# solarpath, solarenvpath, solarcommonpath, os, osdef, pmiscpath
+######################################################################
+
+sub check_system_environment
+{
+ my %variables = ();
+ my $key;
+ my $error = 0;
+
+ foreach $key ( @installer::globals::environmentvariables )
+ {
+ my $value = "";
+ if ( $ENV{$key} ) { $value = $ENV{$key}; }
+ $variables{$key} = $value;
+
+ if ( $value eq "" )
+ {
+ installer::logger::print_error( "$key not set in environment\n" );
+ $error = 1;
+ }
+ }
+
+ if ( $error )
+ {
+ installer::exiter::exit_program("ERROR: Environment variable not set!", "check_system_environment");
+ }
+
+ return \%variables;
+}
+
+#############################################################
+# Controlling the log file at the end of the
+# packaging process
+#############################################################
+
+sub check_logfile
+{
+ my ($logfile) = @_;
+
+ my @errors = ();
+ my @output = ();
+ my $contains_error = 0;
+
+ my $ignore_error = 0;
+ my $make_error_to_warning = 0;
+
+ if (( ! $installer::globals::pro ) && ( $installer::globals::ignore_error_in_logfile )) { $ignore_error = 1; }
+
+ for ( my $i = 0; $i <= $#{$logfile}; $i++ )
+ {
+ my $line = ${$logfile}[$i];
+
+ # Errors are all errors, but not the Windows installer table "Error.idt"
+
+ my $compareline = $line;
+ $compareline =~ s/Error\.idt//g; # removing all occurences of "Error.idt"
+ $compareline =~ s/Error\.mlf//g; # removing all occurences of "Error.mlf"
+ $compareline =~ s/Error\.ulf//g; # removing all occurences of "Error.ulf"
+ $compareline =~ s/Error\.idl//g; # removing all occurences of "Error.idl"
+ $compareline =~ s/Error\.html//g; # removing all occurences of "Error.html"
+
+ if ( $compareline =~ /\bError\b/i )
+ {
+ $contains_error = 1;
+ push(@errors, $line);
+
+ if ( $ignore_error )
+ {
+ $contains_error = 0;
+ $make_error_to_warning = 1;
+ }
+ }
+ }
+
+ if ($contains_error)
+ {
+ my $line = "\n*********************************************************************\n";
+ push(@output, $line);
+ $line = "ERROR: The following errors occured in packaging process:\n\n";
+ push(@output, $line);
+
+ for ( my $i = 0; $i <= $#errors; $i++ )
+ {
+ $line = "$errors[$i]";
+ push(@output, $line);
+ }
+
+ $line = "*********************************************************************\n";
+ push(@output, $line);
+# exit(-1);
+ }
+ else
+ {
+ my $line = "";
+
+ if ( $make_error_to_warning )
+ {
+ $line = "\n*********************************************************************\n";
+ push(@output, $line);
+ $line = "The following errors in the log file were ignored:\n\n";
+ push(@output, $line);
+
+ for ( my $i = 0; $i <= $#errors; $i++ )
+ {
+ $line = "$errors[$i]";
+ push(@output, $line);
+ }
+
+ $line = "*********************************************************************\n";
+ push(@output, $line);
+ }
+
+ $line = "\n***********************************************************\n";
+ push(@output, $line);
+ $line = "Successful packaging process!\n";
+ push(@output, $line);
+ $line = "***********************************************************\n";
+ push(@output, $line);
+ }
+
+ # printing the output file and adding it to the logfile
+
+ installer::logger::include_header_into_logfile("Summary:");
+
+ my $force = 1; # print this message even in 'quiet' mode
+ for ( my $i = 0; $i <= $#output; $i++ )
+ {
+ my $line = "$output[$i]";
+ installer::logger::print_message( "$line", $force );
+ push( @installer::globals::logfileinfo, $line);
+ push( @installer::globals::errorlogfileinfo, $line);
+ }
+
+ return $contains_error;
+}
+
+#############################################################
+# Determining the ship installation directory
+#############################################################
+
+sub determine_ship_directory
+{
+ my ($languagesref) = @_;
+
+ if (!( $ENV{'SHIPDRIVE'} )) { installer::exiter::exit_program("ERROR: SHIPDRIVE must be set for updater!", "determine_ship_directory"); }
+
+ my $shipdrive = $ENV{'SHIPDRIVE'};
+
+ my $languagestring = $$languagesref;
+
+ if (length($languagestring) > $installer::globals::max_lang_length )
+ {
+ my $number_of_languages = installer::systemactions::get_number_of_langs($languagestring);
+ chomp(my $shorter = `echo $languagestring | md5sum | sed -e "s/ .*//g"`);
+ # $languagestring = $shorter;
+ my $id = substr($shorter, 0, 8); # taking only the first 8 digits
+ $languagestring = "lang_" . $number_of_languages . "_id_" . $id;
+ }
+
+ my $productstring = $installer::globals::product;
+ my $productsubdir = "";
+
+ if ( $productstring =~ /^\s*(.+?)\_\_(.+?)\s*$/ )
+ {
+ $productstring = $1;
+ $productsubdir = $2;
+ }
+
+ if ( $installer::globals::languagepack ) { $productstring = $productstring . "_languagepack"; }
+ if ( $installer::globals::patch ) { $productstring = $productstring . "_patch"; }
+
+ my $destdir = $shipdrive . $installer::globals::separator . $installer::globals::compiler .
+ $installer::globals::productextension . $installer::globals::separator .
+ $productstring . $installer::globals::separator;
+
+ if ( $productsubdir ) { $destdir = $destdir . $productsubdir . $installer::globals::separator; }
+
+ $destdir = $destdir . $installer::globals::installertypedir . $installer::globals::separator .
+ $installer::globals::build . "_" . $installer::globals::lastminor . "_" .
+ "native_inprogress-number_" . $languagestring . "\." . $installer::globals::buildid;
+
+ my $infoline = "\nSetting ship directory: $destdir\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ return $destdir;
+}
+
+#############################################################
+# Controlling if this is an official RE pack process
+#############################################################
+
+sub check_updatepack
+{
+ my $shipdrive = "";
+ my $filename = "";
+ my $infoline = "";
+
+ if ( $ENV{'UPDATER'} ) # the environment variable UPDATER has to be set
+ {
+ $infoline = "\nEnvironment variable UPDATER set\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ if ( ! $ENV{'CWS_WORK_STAMP'} ) # the environment variable CWS_WORK_STAMP must not be set (set only in CWS)
+ {
+ $infoline = "Environment variable CWS_WORK_STAMP not set\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ if ( $ENV{'SHIPDRIVE'} ) # the environment variable SHIPDRIVE must be set
+ {
+ $shipdrive = $ENV{'SHIPDRIVE'};
+ $infoline = "Ship drive defined: $shipdrive\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ if ( -d $shipdrive ) # SHIPDRIVE must be a directory
+ {
+ $infoline = "Ship drive exists\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ # try to write into $shipdrive
+
+ $directory = $installer::globals::product . "_" . $installer::globals::compiler . "_" . $installer::globals::buildid . "_" . $installer::globals::languageproducts[0] . "_test_$$";
+ $directory =~ s/\,/\_/g; # for the list of languages
+ $directory =~ s/\-/\_/g; # for en-US, pt-BR, ...
+ $directory = $shipdrive . $installer::globals::separator . $directory;
+
+ $infoline = "Try to create directory: $directory\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ # saving this directory for later removal
+ $installer::globals::shiptestdirectory = $directory;
+
+ if ( installer::systemactions::try_to_create_directory($directory))
+ {
+ $infoline = "Write access on Ship drive\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+ $infoline = "Ship test directory $installer::globals::shiptestdirectory was successfully created\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+ my $systemcall = "rmdir $directory";
+ my $returnvalue = system($systemcall);
+
+ # 5th condition: No local build environment.
+ # In this case the content of SOLARENV starts with the content of SOL_TMP
+
+ my $solarenv = "";
+ my $sol_tmp;
+ if ( $ENV{'SOLARENV'} ) { $solarenv = $ENV{'SOLARENV'}; }
+
+ $infoline = "Environment variable SOLARENV: $solarenv\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ if ( $ENV{'SOL_TMP'} )
+ {
+ $sol_tmp = $ENV{'SOL_TMP'};
+ $infoline = "Environment variable SOL_TMP: $sol_tmp\n";
+ } else {
+ $infoline = "Environment variable SOL_TMP not set\n";
+ }
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ if ( defined $sol_tmp && ( $solarenv =~ /^\s*\Q$sol_tmp\E/ ))
+ {
+ $infoline = "Content of SOLARENV starts with the content of SOL_TMP\: Local environment -\> No Updatepack\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Content of SOLARENV does not start with the content of SOL_TMP: No local environment\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ $installer::globals::updatepack = 1; # That's it
+ }
+
+ # Additional logging information for the temporary ship directory
+
+ if ( -d $installer::globals::shiptestdirectory )
+ {
+ $infoline = "Ship test directory $installer::globals::shiptestdirectory still exists. Trying removal later again.\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Ship test directory $installer::globals::shiptestdirectory was successfully removed.\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+ }
+ }
+ else
+ {
+ $infoline = "No write access on Ship drive\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+ $infoline = "Failed to create directory $directory\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+ if ( defined $ENV{'BSCLIENT'} && ( uc $ENV{'BSCLIENT'} eq 'TRUE' ) ) {
+ installer::exiter::exit_program("ERROR: No write access to SHIPDRIVE allthough BSCLIENT is set.", "check_updatepack");
+ }
+ }
+ }
+ else
+ {
+ $infoline = "Ship drive not found: No updatepack\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+ }
+ }
+ else
+ {
+ $infoline = "Environment variable SHIPDRIVE not set: No updatepack\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+ }
+ }
+ else
+ {
+ $infoline = "Environment variable CWS_WORK_STAMP defined: No updatepack\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+ }
+ }
+
+ if ( $installer::globals::updatepack ) { $infoline = "Setting updatepack true\n\n"; }
+ else { $infoline = "\nNo updatepack\n"; }
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+}
+
+#############################################################
+# Reading the Windows list file for language encodings
+#############################################################
+
+sub read_encodinglist
+{
+ my ($patharrayref) = @_;
+
+ my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$installer::globals::encodinglistname, $patharrayref , 0);
+
+ if ( $$fileref eq "" ) { installer::exiter::exit_program("ERROR: Did not find Windows encoding list $installer::globals::encodinglistname!", "read_encodinglist"); }
+
+ my $infoline = "Found encoding file: $$fileref\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ my $encodinglist = installer::files::read_file($$fileref);
+
+ my %msiencoding = ();
+ my %msilanguage = ();
+
+ # Controlling the encoding list
+
+ for ( my $i = 0; $i <= $#{$encodinglist}; $i++ )
+ {
+ my $line = ${$encodinglist}[$i];
+
+ if ( $line =~ /^\s*\#/ ) { next; } # this is a comment line
+
+ if ( $line =~ /^(.*?)(\#.*)$/ ) { $line = $1; } # removing comments after "#"
+
+ if ( $line =~ /^\s*([\w-]+)\s*(\d+)\s*(\d+)\s*$/ )
+ {
+ my $onelanguage = $1;
+ my $codepage = $2;
+ my $windowslanguage = $3;
+
+ $msiencoding{$onelanguage} = $codepage;
+ $msilanguage{$onelanguage} = $windowslanguage;
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: Wrong syntax in Windows encoding list $installer::globals::encodinglistname : en-US 1252 1033 !", "read_encodinglist");
+ }
+ }
+
+ $installer::globals::msiencoding = \%msiencoding;
+ $installer::globals::msilanguage = \%msilanguage;
+
+ # my $key;
+ # foreach $key (keys %{$installer::globals::msiencoding}) { print "A Key: $key : Value: $installer::globals::msiencoding->{$key}\n"; }
+ # foreach $key (keys %{$installer::globals::msilanguage}) { print "B Key: $key : Value: $installer::globals::msilanguage->{$key}\n"; }
+
+}
+
+#############################################################
+# Only for Windows and Linux (RPM)there is currently
+# a reliable mechanism to register extensions during
+# installation process. Therefore it is for all other
+# platforms forbidden to install oxt files into that
+# directory, in which they are searched for registration.
+#############################################################
+
+sub check_oxtfiles
+{
+ my ( $filesarray ) = @_;
+
+ for ( my $i = 0; $i <= $#{$filesarray}; $i++ )
+ {
+ my $onefile = ${$filesarray}[$i];
+
+ if (( $onefile->{'Name'} ) && ( $onefile->{'Dir'} ))
+ {
+ if (( $onefile->{'Name'} =~ /\.oxt\s*$/ ) && ( $onefile->{'Dir'} eq $installer::globals::extensioninstalldir ))
+ {
+ installer::exiter::exit_program("There is currently only for Linux (RPM) and Windows a reliable mechanism to register extensions during installation.\nPlease remove file \"$onefile->{'gid'}\" from your installation set!\nYou can use \"\#ifdef WNT\" and \"\#ifdef LINUX\" in scp.", "check_oxtfiles");
+ }
+ }
+ }
+}
+
+#############################################################
+# Check if Java is available to create xpd installer
+#############################################################
+
+sub check_java_for_xpd
+{
+ my ( $allvariables ) = @_;
+
+ if ( ! $installer::globals::solarjavaset ) { $allvariables->{'XPDINSTALLER'} = 0; }
+}
+
+####################################################################
+# Setting global variable "$installer::globals::addchildprojects"
+####################################################################
+
+sub set_addchildprojects
+{
+ my ($allvariables) = @_;
+
+ if (( $allvariables->{'JAVAPRODUCT'} ) ||
+ ( $allvariables->{'ADAPRODUCT'} ) ||
+ ( $allvariables->{'UREPRODUCT'} ) ||
+ ( $allvariables->{'ADDREQUIREDPACKAGES'} )) { $installer::globals::addchildprojects = 1; }
+
+ if ( $installer::globals::patch )
+ {
+ $installer::globals::addchildprojects = 0; # no child projects for patches
+ }
+
+ my $infoline = "Value of \$installer::globals::addchildprojects: $installer::globals::addchildprojects\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+}
+
+####################################################################
+# Setting global variable "$installer::globals::addjavainstaller"
+####################################################################
+
+sub set_addjavainstaller
+{
+ my ($allvariables) = @_;
+
+ if ( $allvariables->{'JAVAINSTALLER'} ) { $installer::globals::addjavainstaller = 1; }
+
+ if ( $installer::globals::patch ) { $installer::globals::addjavainstaller = 0; }
+ if ( $installer::globals::languagepack ) { $installer::globals::addjavainstaller = 0; }
+ if ( $allvariableshashref->{'XPDINSTALLER'} ) { $installer::globals::addjavainstaller = 0; }
+
+ my $infoline = "Value of \$installer::globals::addjavainstaller: $installer::globals::addjavainstaller\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+}
+
+#######################################################################
+# Setting global variable "$installer::globals::addsystemintegration"
+#######################################################################
+
+sub set_addsystemintegration
+{
+ my ($allvariables) = @_;
+
+ if ( $allvariables->{'ADDSYSTEMINTEGRATION'} ) { $installer::globals::addsystemintegration = 1; }
+
+ if ( $installer::globals::patch ) { $installer::globals::addsystemintegration = 0; }
+ if ( $installer::globals::languagepack ) { $installer::globals::addsystemintegration = 0; }
+ if (( $installer::globals::packageformat eq "native" ) || ( $installer::globals::packageformat eq "portable" )) { $installer::globals::addsystemintegration = 0; }
+
+ my $infoline = "Value of \$installer::globals::addsystemintegration: $installer::globals::addsystemintegration\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/converter.pm b/solenv/bin/modules/installer/converter.pm
new file mode 100644
index 000000000000..beeec52b71ac
--- /dev/null
+++ b/solenv/bin/modules/installer/converter.pm
@@ -0,0 +1,462 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::converter;
+
+use installer::globals;
+
+#############################
+# Converter
+#############################
+
+sub convert_array_to_hash
+{
+ my ($arrayref) = @_;
+
+ my %newhash = ();
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ my $line = ${$arrayref}[$i];
+
+ if ( $line =~ /^\s*([\w-]+?)\s+(.*?)\s*$/ )
+ {
+ my $key = $1;
+ my $value = $2;
+ $newhash{$key} = $value;
+ }
+ }
+
+ return \%newhash;
+}
+
+sub convert_hash_into_array
+{
+ my ($hashref) = @_;
+
+ my @array = ();
+ my $key;
+
+ foreach $key (keys %{$hashref})
+ {
+ my $value = $hashref->{$key};
+ my $input = "$key = $value\n";
+ push(@array ,$input);
+ }
+
+ return \@array
+}
+
+#############################################################################
+# Converting a string list with separator $listseparator
+# into an array
+#############################################################################
+
+sub convert_stringlist_into_array_without_linebreak_and_quotes
+{
+ my ( $includestringref, $listseparator ) = @_;
+
+ my @newarray = ();
+ my $first;
+ my $last = ${$includestringref};
+
+ while ( $last =~ /^\s*(.+?)\Q$listseparator\E(.+)\s*$/) # "$" for minimal matching
+ {
+ $first = $1;
+ $last = $2;
+ $first =~ s/\"//g;
+ push(@newarray, $first);
+ }
+
+ $last =~ s/\"//g;
+ push(@newarray, $last);
+
+ return \@newarray;
+}
+
+#############################################################################
+# Converting a string list with separator $listseparator
+# into an array
+#############################################################################
+
+sub convert_stringlist_into_array
+{
+ my ( $includestringref, $listseparator ) = @_;
+
+ my @newarray = ();
+ my $first;
+ my $last = ${$includestringref};
+
+ while ( $last =~ /^\s*(.+?)\Q$listseparator\E(.+)\s*$/) # "$" for minimal matching
+ {
+ $first = $1;
+ $last = $2;
+ # Problem with two directly following listseparators. For example a path with two ";;" directly behind each other
+ $first =~ s/^$listseparator//;
+ push(@newarray, "$first\n");
+ }
+
+ push(@newarray, "$last\n");
+
+ return \@newarray;
+}
+
+#############################################################################
+# Converting a string list with separator $listseparator
+# into an array
+#############################################################################
+
+sub convert_stringlist_into_array_without_newline
+{
+ my ( $includestringref, $listseparator ) = @_;
+
+ my @newarray = ();
+ my $first;
+ my $last = ${$includestringref};
+
+ while ( $last =~ /^\s*(.+?)\Q$listseparator\E(.+)\s*$/) # "$" for minimal matching
+ {
+ $first = $1;
+ $last = $2;
+ push(@newarray, "$first");
+ }
+
+ push(@newarray, "$last");
+
+ return \@newarray;
+}
+
+#############################################################################
+# Converting a string list with separator $listseparator
+# into a hash with values 1.
+#############################################################################
+
+sub convert_stringlist_into_hash
+{
+ my ( $includestringref, $listseparator ) = @_;
+
+ my %newhash = ();
+ my $first;
+ my $last = ${$includestringref};
+
+ while ( $last =~ /^\s*(.+?)\Q$listseparator\E(.+)\s*$/) # "$" for minimal matching
+ {
+ $first = $1;
+ $last = $2;
+ $newhash{$first} = 1;
+ }
+
+ $newhash{$last} = 1;
+
+ return \%newhash;
+}
+
+#############################################################################
+# Converting a string list with separator $listseparator
+# into an array
+#############################################################################
+
+sub convert_whitespace_stringlist_into_array
+{
+ my ( $includestringref ) = @_;
+
+ my @newarray = ();
+ my $first;
+ my $last = ${$includestringref};
+
+ while ( $last =~ /^\s*(\S+?)\s+(\S+)\s*$/) # "$" for minimal matching
+ {
+ $first = $1;
+ $last = $2;
+ push(@newarray, "$first\n");
+ }
+
+ push(@newarray, "$last\n");
+
+ return \@newarray;
+}
+
+#############################################################################
+# Converting an array into a comma separated string
+#############################################################################
+
+sub convert_array_to_comma_separated_string
+{
+ my ( $arrayref ) = @_;
+
+ my $newstring = "";
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ my $arrayentry = ${$arrayref}[$i];
+ $arrayentry =~ s/\s*$//;
+ $newstring = $newstring . $arrayentry . ",";
+ }
+
+ $newstring =~ s/\,\s*$//;
+
+ return $newstring;
+}
+
+#############################################################################
+# Converting an array into a space separated string
+#############################################################################
+
+sub convert_array_to_space_separated_string
+{
+ my ( $arrayref ) = @_;
+
+ my $newstring = "";
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ my $arrayentry = ${$arrayref}[$i];
+ $arrayentry =~ s/\s*$//;
+ $newstring = $newstring . $arrayentry . " ";
+ }
+
+ $newstring =~ s/\s*$//;
+
+ return $newstring;
+}
+
+#############################################################################
+# The file name contains for some files "/". If this programs runs on
+# a windows platform, this has to be converted to "\".
+#############################################################################
+
+sub convert_slash_to_backslash
+{
+ my ($filesarrayref) = @_;
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ if ( $onefile->{'Name'} ) { $onefile->{'Name'} =~ s/\//\\/g; }
+ }
+}
+
+############################################################################
+# Creating a copy of an existing file object
+# No converter
+############################################################################
+
+sub copy_item_object
+{
+ my ($olditemhashref, $newitemhashref) = @_;
+
+ foreach $key (keys %{$olditemhashref})
+ {
+ my $value = $olditemhashref->{$key};
+ $newitemhashref->{$key} = $value;
+ }
+}
+
+#################################################################
+# Windows pathes must not contain the following structure:
+# c:\dirA\dirB\..\dirC
+# This has to be exchanged to
+# c:\dirA\dirC
+#################################################################
+
+sub make_path_conform
+{
+ my ( $path ) = @_;
+
+ my $oldpath = $path;
+
+ while ( $path =~ /(^.*)(\Q$installer::globals::separator\E.*?[^\.])(\Q$installer::globals::separator\E\.\.)(\Q$installer::globals::separator\E.*$)/ )
+ {
+ my $part1 = $1;
+ my $part2 = $4;
+
+ # $2 must not end with a "." ! Problem with "..\.."
+
+ $path = $part1 . $part2;
+ }
+
+ return $path;
+}
+
+#################################################################
+# Copying an item collector
+# A reference to an array consisting of references to hashes.
+#################################################################
+
+sub copy_collector
+{
+ my ( $oldcollector ) = @_;
+
+ my @newcollector = ();
+
+ for ( my $i = 0; $i <= $#{$oldcollector}; $i++ )
+ {
+ my %newhash = ();
+ my $key;
+
+ foreach $key (keys %{${$oldcollector}[$i]})
+ {
+ $newhash{$key} = ${$oldcollector}[$i]->{$key};
+ }
+
+ push(@newcollector, \%newhash);
+ }
+
+ return \@newcollector;
+}
+
+#################################################################
+# Copying an array
+#################################################################
+
+sub copy_array_from_references
+{
+ my ( $arrayref ) = @_;
+
+ my @newarray = ();
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ push(@newarray, ${$arrayref}[$i]);
+ }
+
+ return \@newarray;
+}
+
+###########################################################
+# Copying a hash
+###########################################################
+
+sub copy_hash_from_references
+{
+ my ($hashref) = @_;
+
+ my %newhash = ();
+ my $key;
+
+ foreach $key (keys %{$hashref})
+ {
+ $newhash{$key} = $hashref->{$key};
+ }
+
+ return \%newhash;
+}
+
+#################################################################
+# Combining two arrays, first wins
+#################################################################
+
+sub combine_arrays_from_references_first_win
+{
+ my ( $arrayref1, $arrayref2 ) = @_;
+
+ my $hashref1 = convert_array_to_hash($arrayref1);
+ my $hashref2 = convert_array_to_hash($arrayref2);
+ my %commonhash = ();
+ my @newarray = ();
+
+ # starting with second hash
+ foreach my $key ( keys %{$hashref2} ) { $commonhash{$key} = $hashref2->{$key}; }
+ # overwriting with first hash
+ foreach my $key ( keys %{$hashref1} ) { $commonhash{$key} = $hashref1->{$key}; }
+
+ # Creating the new array
+ foreach my $key ( keys %commonhash ) { push(@newarray, "$key $commonhash{$key}\n"); }
+
+ return \@newarray;
+}
+
+#################################################################
+# Combining two arrays
+#################################################################
+
+sub combine_arrays_from_references
+{
+ my ( $arrayref1, $arrayref2 ) = @_;
+
+ my @newarray = ();
+
+ for ( my $i = 0; $i <= $#{$arrayref1}; $i++ )
+ {
+ push(@newarray, ${$arrayref1}[$i]);
+ }
+
+ for ( my $i = 0; $i <= $#{$arrayref2}; $i++ )
+ {
+ push(@newarray, ${$arrayref2}[$i]);
+ }
+
+ return \@newarray;
+}
+
+#################################################################
+# Returning the current ending number of a directory
+#################################################################
+
+sub get_number_from_directory
+{
+ my ( $directory ) = @_;
+
+ my $number = 0;
+
+ if ( $directory =~ /\_(\d+)\s*$/ )
+ {
+ $number = $1;
+ }
+
+ return $number;
+}
+
+#################################################################
+# Replacing separators, that are included into quotes
+#################################################################
+
+sub replace_masked_separator
+{
+ my ($string, $separator, $replacementstring) = @_;
+
+ $string =~ s/\\\Q$separator\E/$replacementstring/g;
+
+ return $string;
+}
+
+#################################################################
+# Resolving separators, that were replaced
+# in function mask_separator_in_quotes
+#################################################################
+
+sub resolve_masked_separator
+{
+ my ($arrayref, $separator, $replacementstring) = @_;
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ ${$arrayref}[$i] =~ s/$replacementstring/$separator/g
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/installer/copyproject.pm b/solenv/bin/modules/installer/copyproject.pm
new file mode 100644
index 000000000000..5db9cf7f8b04
--- /dev/null
+++ b/solenv/bin/modules/installer/copyproject.pm
@@ -0,0 +1,118 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::copyproject;
+
+use installer::control;
+use installer::converter;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::mail;
+use installer::systemactions;
+use installer::worker;
+
+####################################################
+# Including header files into the logfile
+####################################################
+
+sub copy_project
+{
+ my ( $filesref, $scpactionsref, $loggingdir, $languagestringref, $shipinstalldir, $allsettingsarrayref ) = @_;
+
+ # Creating directories
+
+ installer::logger::include_header_into_logfile("Creating installation directory");
+
+ my $current_install_number = "";
+
+ my $installdir = installer::worker::create_installation_directory($shipinstalldir, $languagestringref, \$current_install_number);
+
+ my $installlogdir = installer::systemactions::create_directory_next_to_directory($installdir, "log");
+
+ # Copy files and ScpActions
+
+ installer::logger::include_header_into_logfile("Copying files:");
+
+ # copy Files
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+
+ my $source = $onefile->{'sourcepath'};
+ my $destination = $installdir . $installer::globals::separator . $onefile->{'Name'};
+
+ installer::systemactions::copy_one_file($source, $destination);
+
+ if ( $destination =~ /install\s*$/ )
+ {
+ my $localcall = "chmod 775 $destination \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+
+ if ( $onefile->{'UnixRights'} )
+ {
+ my $localcall = "chmod $onefile->{'UnixRights'} $destination \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ }
+
+ # copy ScpActions
+
+ for ( my $i = 0; $i <= $#{$scpactionsref}; $i++ )
+ {
+ my $onefile = ${$scpactionsref}[$i];
+
+ my $source = $onefile->{'sourcepath'};
+ my $destination = $installdir . $installer::globals::separator . $onefile->{'DestinationName'};
+
+ installer::systemactions::copy_one_file($source, $destination);
+
+ if ( $destination =~ /install\s*$/ )
+ {
+ my $localcall = "chmod 775 $destination \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+
+ if ( $onefile->{'UnixRights'} )
+ {
+ my $localcall = "chmod $onefile->{'UnixRights'} $destination \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ }
+
+ # Analyzing the log file
+
+ installer::worker::analyze_and_save_logfile($loggingdir, $installdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
+
+ # That's all
+
+ exit(0);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm
new file mode 100644
index 000000000000..34f228c791f7
--- /dev/null
+++ b/solenv/bin/modules/installer/download.pm
@@ -0,0 +1,2180 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::download;
+
+use File::Spec;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::remover;
+use installer::systemactions;
+
+BEGIN { # This is needed so that cygwin's perl evaluates ACLs
+ # (needed for correctly evaluating the -x test.)
+ if( $^O =~ /cygwin/i ) {
+ require filetest; import filetest "access";
+ }
+}
+
+##################################################################
+# Including the lowercase product name into the script template
+##################################################################
+
+sub put_productname_into_script
+{
+ my ($scriptfile, $variableshashref) = @_;
+
+ my $productname = $variableshashref->{'PRODUCTNAME'};
+ $productname = lc($productname);
+ $productname =~ s/\.//g; # openoffice.org -> openofficeorg
+ $productname =~ s/\s*//g;
+
+ my $infoline = "Adding productname $productname into download shell script\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
+ {
+ ${$scriptfile}[$i] =~ s/PRODUCTNAMEPLACEHOLDER/$productname/;
+ }
+}
+
+#########################################################
+# Including the linenumber into the script template
+#########################################################
+
+sub put_linenumber_into_script
+{
+ my ( $scriptfile ) = @_;
+
+ my $linenumber = $#{$scriptfile} + 2;
+
+ my $infoline = "Adding linenumber $linenumber into download shell script\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
+ {
+ ${$scriptfile}[$i] =~ s/LINENUMBERPLACEHOLDER/$linenumber/;
+ }
+}
+
+#########################################################
+# Determining the name of the new scriptfile
+#########################################################
+
+sub determine_scriptfile_name
+{
+ my ( $filename ) = @_;
+
+ $installer::globals::downloadfileextension = ".sh";
+ $filename = $filename . $installer::globals::downloadfileextension;
+ $installer::globals::downloadfilename = $filename;
+
+ my $infoline = "Setting download shell script file name to $filename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return $filename;
+}
+
+#########################################################
+# Saving the script file in the installation directory
+#########################################################
+
+sub save_script_file
+{
+ my ($directory, $newscriptfilename, $scriptfile) = @_;
+
+ $newscriptfilename = $directory . $installer::globals::separator . $newscriptfilename;
+ installer::files::save_file($newscriptfilename, $scriptfile);
+
+ my $infoline = "Saving script file $newscriptfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( ! $installer::globals::iswindowsbuild )
+ {
+ my $localcall = "chmod 775 $newscriptfilename \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+
+ return $newscriptfilename;
+}
+
+#########################################################
+# Including checksum and size into script file
+#########################################################
+
+sub put_checksum_and_size_into_script
+{
+ my ($scriptfile, $sumout) = @_;
+
+ my $checksum = "";
+ my $size = "";
+
+ if ( $sumout =~ /^\s*(\d+)\s+(\d+)\s*$/ )
+ {
+ $checksum = $1;
+ $size = $2;
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: Incorrect return value from /usr/bin/sum: $sumout", "put_checksum_and_size_into_script");
+ }
+
+ my $infoline = "Adding checksum $checksum and size $size into download shell script\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
+ {
+ ${$scriptfile}[$i] =~ s/CHECKSUMPLACEHOLDER/$checksum/;
+ ${$scriptfile}[$i] =~ s/DISCSPACEPLACEHOLDER/$size/;
+ }
+
+}
+
+#########################################################
+# Calling md5sum
+#########################################################
+
+sub call_md5sum
+{
+ my ($filename) = @_;
+
+ $md5sumfile = "/usr/bin/md5sum";
+
+ if ( ! -f $md5sumfile ) { installer::exiter::exit_program("ERROR: No file /usr/bin/md5sum", "call_md5sum"); }
+
+ my $systemcall = "$md5sumfile $filename |";
+
+ my $md5sumoutput = "";
+
+ open (SUM, "$systemcall");
+ $md5sumoutput = <SUM>;
+ close (SUM);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return $md5sumoutput;
+}
+
+#########################################################
+# Calling md5sum
+#########################################################
+
+sub get_md5sum
+{
+ ($md5sumoutput) = @_;
+
+ my $md5sum;
+
+ if ( $md5sumoutput =~ /^\s*(\w+?)\s+/ )
+ {
+ $md5sum = $1;
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: Incorrect return value from /usr/bin/md5sum: $md5sumoutput", "get_md5sum");
+ }
+
+ my $infoline = "Setting md5sum: $md5sum\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return $md5sum;
+}
+
+#########################################################
+# Determining checksum and size of tar file
+#########################################################
+
+sub call_sum
+{
+ my ($filename, $getuidlibrary) = @_;
+
+ my $systemcall = "/usr/bin/sum $filename |";
+
+ my $sumoutput = "";
+
+ open (SUM, "$systemcall");
+ $sumoutput = <SUM>;
+ close (SUM);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ $sumoutput =~ s/\s+$filename\s$//;
+ return $sumoutput;
+}
+
+#########################################################
+# Searching for the getuid.so in the solver
+#########################################################
+
+sub get_path_for_library
+{
+ my ($includepatharrayref) = @_;
+
+ my $getuidlibraryname = "getuid.so";
+
+ my $getuidlibraryref = "";
+
+ if ( $installer::globals::include_pathes_read )
+ {
+ $getuidlibraryref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$getuidlibraryname, $includepatharrayref, 0);
+ }
+ else
+ {
+ $getuidlibraryref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$getuidlibraryname, $includepatharrayref, 0);
+ }
+
+ if ($$getuidlibraryref eq "") { installer::exiter::exit_program("ERROR: Could not find $getuidlibraryname!", "get_path_for_library"); }
+
+ return $$getuidlibraryref;
+}
+
+#########################################################
+# Include the tar file into the script
+#########################################################
+
+sub include_tar_into_script
+{
+ my ($scriptfile, $temporary_tarfile) = @_;
+
+ my $systemcall = "cat $temporary_tarfile >> $scriptfile && rm $temporary_tarfile";
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ return $returnvalue;
+}
+
+#########################################################
+# Create a tar file from the binary package
+#########################################################
+
+sub tar_package
+{
+ my ( $installdir, $tarfilename, $getuidlibrary) = @_;
+
+ my $ldpreloadstring = "";
+ if ( $getuidlibrary ne "" ) { $ldpreloadstring = "LD_PRELOAD=" . $getuidlibrary; }
+
+ my $systemcall = "cd $installdir; $ldpreloadstring tar -cf - * > $tarfilename";
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ my $localcall = "chmod 775 $tarfilename \>\/dev\/null 2\>\&1";
+ $returnvalue = system($localcall);
+
+ return ( -s $tarfilename );
+}
+
+#########################################################
+# Creating a tar.gz file
+#########################################################
+
+sub create_tar_gz_file_from_package
+{
+ my ($installdir, $getuidlibrary) = @_;
+
+ my $infoline = "";
+ my $alldirs = installer::systemactions::get_all_directories($installdir);
+ my $onedir = ${$alldirs}[0];
+ $installdir = $onedir;
+
+ my $allfiles = installer::systemactions::get_all_files_from_one_directory($installdir);
+
+ for ( my $i = 0; $i <= $#{$allfiles}; $i++ )
+ {
+ my $onefile = ${$allfiles}[$i];
+ my $systemcall = "cd $installdir; rm $onefile";
+ my $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ $alldirs = installer::systemactions::get_all_directories($installdir);
+ $packagename = ${$alldirs}[0]; # only taking the first Solaris package
+ if ( $packagename eq "" ) { installer::exiter::exit_program("ERROR: Could not find package in directory $installdir!", "determine_packagename"); }
+
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$packagename);
+
+ $installer::globals::downloadfileextension = ".tar.gz";
+ my $targzname = $packagename . $installer::globals::downloadfileextension;
+ $installer::globals::downloadfilename = $targzname;
+ my $ldpreloadstring = "";
+ if ( $getuidlibrary ne "" ) { $ldpreloadstring = "LD_PRELOAD=" . $getuidlibrary; }
+
+ $systemcall = "cd $installdir; $ldpreloadstring tar -cf - $packagename | gzip > $targzname";
+ print "... $systemcall ...\n";
+
+ my $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+#########################################################
+# Setting type of installation
+#########################################################
+
+sub get_installation_type
+{
+ my $type = "";
+
+ if ( $installer::globals::languagepack ) { $type = "langpack"; }
+ else { $type = "install"; }
+
+ return $type;
+}
+
+#########################################################
+# Setting installation languages
+#########################################################
+
+sub get_downloadname_language
+{
+ my ($languagestringref) = @_;
+
+ my $languages = $$languagestringref;
+
+ if ( $installer::globals::added_english )
+ {
+ $languages =~ s/en-US_//;
+ $languages =~ s/_en-US//;
+ }
+
+ # en-US is default language and can be removed therefore
+ # for one-language installation sets
+
+ # if ( $languages =~ /^\s*en-US\s*$/ )
+ # {
+ # $languages = "";
+ # }
+
+ if ( length ($languages) > $installer::globals::max_lang_length )
+ {
+ $languages = 'multi';
+ }
+
+ return $languages;
+}
+
+#########################################################
+# Setting download name
+#########################################################
+
+sub get_downloadname_productname
+{
+ my ($allvariables) = @_;
+
+ my $start = "OOo";
+
+ if ( $allvariables->{'PRODUCTNAME'} eq "OpenOffice.org" ) { $start = "OOo"; }
+
+ if ( $allvariables->{'PRODUCTNAME'} eq "OOo-dev" ) { $start = "OOo-Dev"; }
+
+ if (( $allvariables->{'PRODUCTNAME'} eq "OpenOffice.org" ) && ( $allvariables->{'POSTVERSIONEXTENSION'} eq "SDK" )) { $start = "OOo-SDK"; }
+
+ if (( $allvariables->{'PRODUCTNAME'} eq "OOo-dev" ) && ( $allvariables->{'POSTVERSIONEXTENSION'} eq "SDK" )) { $start = "OOo-Dev-SDK"; }
+
+ if ( $allvariables->{'PRODUCTNAME'} eq "URE" ) { $start = "OOo-URE"; }
+
+ if ( $allvariables->{'PRODUCTNAME'} eq "BrOffice.org" ) { $start = "BrOo"; }
+
+ if ( $allvariables->{'PRODUCTNAME'} eq "BrOo-dev" ) { $start = "BrOo-Dev"; }
+
+ if (( $allvariables->{'PRODUCTNAME'} eq "BrOffice.org" ) && ( $allvariables->{'POSTVERSIONEXTENSION'} eq "SDK" )) { $start = "BrOo-SDK"; }
+
+ if (( $allvariables->{'PRODUCTNAME'} eq "BrOo-dev" ) && ( $allvariables->{'POSTVERSIONEXTENSION'} eq "SDK" )) { $start = "BrOo-Dev-SDK"; }
+
+ return $start;
+}
+
+#########################################################
+# Setting download version
+#########################################################
+
+sub get_download_version
+{
+ my ($allvariables) = @_;
+
+ my $version = "";
+
+ my $devproduct = 0;
+ if (( $allvariables->{'DEVELOPMENTPRODUCT'} ) && ( $allvariables->{'DEVELOPMENTPRODUCT'} == 1 )) { $devproduct = 1; }
+
+ my $cwsproduct = 0;
+ # the environment variable CWS_WORK_STAMP is set only in CWS
+ if ( $ENV{'CWS_WORK_STAMP'} ) { $cwsproduct = 1; }
+
+ if (( $cwsproduct ) || ( $devproduct )) # use "DEV300m75"
+ {
+ my $source = uc($installer::globals::build); # DEV300
+ my $localminor = "";
+ if ( $installer::globals::minor ne "" ) { $localminor = $installer::globals::minor; }
+ else { $localminor = $installer::globals::lastminor; }
+ $version = $source . $localminor;
+ }
+ else # use 3.2.0rc1
+ {
+ $version = $allvariables->{'PRODUCTVERSION'};
+ if (( $allvariables->{'ABOUTBOXPRODUCTVERSION'} ) && ( $allvariables->{'ABOUTBOXPRODUCTVERSION'} ne "" )) { $version = $allvariables->{'ABOUTBOXPRODUCTVERSION'}; }
+ if (( $allvariables->{'SHORT_PRODUCTEXTENSION'} ) && ( $allvariables->{'SHORT_PRODUCTEXTENSION'} ne "" )) { $version = $version . $allvariables->{'SHORT_PRODUCTEXTENSION'}; }
+ }
+
+ return $version;
+}
+
+###############################################################
+# Set date string, format: yymmdd
+###############################################################
+
+sub set_date_string
+{
+ my ($allvariables) = @_;
+
+ my $datestring = "";
+
+ my $devproduct = 0;
+ if (( $allvariables->{'DEVELOPMENTPRODUCT'} ) && ( $allvariables->{'DEVELOPMENTPRODUCT'} == 1 )) { $devproduct = 1; }
+
+ my $cwsproduct = 0;
+ # the environment variable CWS_WORK_STAMP is set only in CWS
+ if ( $ENV{'CWS_WORK_STAMP'} ) { $cwsproduct = 1; }
+
+ my $releasebuild = 1;
+ if (( $allvariables->{'SHORT_PRODUCTEXTENSION'} ) && ( $allvariables->{'SHORT_PRODUCTEXTENSION'} ne "" )) { $releasebuild = 0; }
+
+ if (( ! $devproduct ) && ( ! $cwsproduct ) && ( ! $releasebuild ))
+ {
+ my @timearray = localtime(time);
+
+ my $day = $timearray[3];
+ my $month = $timearray[4] + 1;
+ my $year = $timearray[5] + 1900;
+
+ if ( $month < 10 ) { $month = "0" . $month; }
+ if ( $day < 10 ) { $day = "0" . $day; }
+
+ $datestring = $year . $month . $day;
+ }
+
+ return $datestring;
+}
+
+#################################################################
+# Setting the platform name for download
+#################################################################
+
+sub get_download_platformname
+{
+ my $platformname = "";
+
+ if ( $installer::globals::islinuxbuild )
+ {
+ $platformname = "Linux";
+ }
+ elsif ( $installer::globals::issolarisbuild )
+ {
+ $platformname = "Solaris";
+ }
+ elsif ( $installer::globals::iswindowsbuild )
+ {
+ $platformname = "Win";
+ }
+ elsif ( $installer::globals::isfreebsdbuild )
+ {
+ $platformname = "FreeBSD";
+ }
+ elsif ( $installer::globals::ismacbuild )
+ {
+ $platformname = "MacOS";
+ }
+ else
+ {
+ # $platformname = $installer::globals::packageformat;
+ $platformname = $installer::globals::compiler;
+ }
+
+ return $platformname;
+}
+
+#########################################################
+# Setting the architecture for the download name
+#########################################################
+
+sub get_download_architecture
+{
+ my $arch = "";
+
+ if ( $installer::globals::compiler =~ /unxlngi/ )
+ {
+ $arch = "x86";
+ }
+ elsif ( $installer::globals::compiler =~ /unxlngppc/ )
+ {
+ $arch = "PPC";
+ }
+ elsif ( $installer::globals::compiler =~ /unxlngx/ )
+ {
+ $arch = "x86-64";
+ }
+ elsif ( $installer::globals::issolarissparcbuild )
+ {
+ $arch = "Sparc";
+ }
+ elsif ( $installer::globals::issolarisx86build )
+ {
+ $arch = "x86";
+ }
+ elsif ( $installer::globals::iswindowsbuild )
+ {
+ $arch = "x86";
+ }
+ elsif ( $installer::globals::compiler =~ /^unxmacxi/ )
+ {
+ $arch = "x86";
+ }
+ elsif ( $installer::globals::compiler =~ /^unxmacxp/ )
+ {
+ $arch = "PPC";
+ }
+
+ return $arch;
+}
+
+#########################################################
+# Setting the installation type for the download name
+#########################################################
+
+sub get_install_type
+{
+ my ($allvariables) = @_;
+
+ my $type = "";
+
+ if ( $installer::globals::languagepack )
+ {
+ $type = "langpack";
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ $type = $type . "-rpm";
+ }
+
+ if ( $installer::globals::islinuxdebbuild )
+ {
+ $type = $type . "-deb";
+ }
+
+ if ( $installer::globals::packageformat eq "archive" )
+ {
+ $type = $type . "-arc";
+ }
+ }
+ else
+ {
+ $type = "install";
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ $type = $type . "-rpm";
+ }
+
+ if ( $installer::globals::islinuxdebbuild )
+ {
+ $type = $type . "-deb";
+ }
+
+ if ( $installer::globals::packageformat eq "archive" )
+ {
+ $type = $type . "-arc";
+ }
+
+ if (( $allvariables->{'WITHJREPRODUCT'} ) && ( $allvariables->{'WITHJREPRODUCT'} == 1 ))
+ {
+ $type = $type . "-wJRE";
+ }
+
+ }
+
+ return $type;
+}
+
+#########################################################
+# Setting installation addons
+#########################################################
+
+sub get_downloadname_addon
+{
+ my $addon = "";
+
+ if ( $installer::globals::islinuxdebbuild ) { $addon = $addon . "_deb"; }
+
+ if ( $installer::globals::product =~ /_wJRE\s*$/ ) { $addon = "_wJRE"; }
+
+ return $addon;
+}
+
+#########################################################
+# Looking for versionstring in version.info
+# This has to be the only content of this file.
+#########################################################
+
+sub get_versionstring
+{
+ my ( $versionfile ) = @_;
+
+ my $versionstring = "";
+
+ for ( my $i = 0; $i <= $#{$versionfile}; $i++ )
+ {
+ my $oneline = ${$versionfile}[$i];
+
+ if ( $oneline =~ /^\s*\#/ ) { next; } # comment line
+ if ( $oneline =~ /^\s*\"\s*(.*?)\s*\"\s*$/ )
+ {
+ $versionstring = $1;
+ last;
+ }
+ }
+
+ return $versionstring;
+}
+
+#########################################################
+# Returning the current product version
+# This has to be defined in file "version.info"
+# in directory $installer::globals::ooouploaddir
+#########################################################
+
+sub get_current_version
+{
+ my $infoline = "";
+ my $versionstring = "";
+ my $filename = "version.info";
+ # $filename = $installer::globals::ooouploaddir . $installer::globals::separator . $filename;
+
+ if ( -f $filename )
+ {
+ $infoline = "File $filename exists. Trying to find current version.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ my $versionfile = installer::files::read_file($filename);
+ $versionstring = get_versionstring($versionfile);
+ $infoline = "Setting version string: $versionstring\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "File $filename does not exist. No version setting in download file name.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ $installer::globals::oooversionstring = $versionstring;
+
+ return $versionstring;
+}
+
+###############################################################################################
+# Setting the download file name
+# Syntax:
+# (PRODUCTNAME)_(VERSION)_(TIMESTAMP)_(OS)_(ARCH)_(INSTALLTYPE)_(LANGUAGE).(FILEEXTENSION)
+# Rules:
+# Timestamp only for Beta and Release Candidate
+###############################################################################################
+
+sub set_download_filename
+{
+ my ($languagestringref, $allvariables) = @_;
+
+ my $start = get_downloadname_productname($allvariables);
+ my $versionstring = get_download_version($allvariables);
+ my $date = set_date_string($allvariables);
+ my $platform = get_download_platformname();
+ my $architecture = get_download_architecture();
+ my $type = get_install_type($allvariables);
+ my $language = get_downloadname_language($languagestringref);
+
+ # Setting the extension happens automatically
+
+ my $filename = $start . "_" . $versionstring . "_" . $date . "_" . $platform . "_" . $architecture . "_" . $type . "_" . $language;
+
+ $filename =~ s/\_\_/\_/g; # necessary, if $versionstring or $platform or $language are empty
+ $filename =~ s/\_\s*$//; # necessary, if $language and $addon are empty
+
+ $installer::globals::ooodownloadfilename = $filename;
+
+ return $filename;
+}
+
+#########################################################
+# Creating a tar.gz file
+#########################################################
+
+sub create_tar_gz_file_from_directory
+{
+ my ($installdir, $getuidlibrary, $downloaddir, $downloadfilename) = @_;
+
+ my $infoline = "";
+
+ my $packdir = $installdir;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$packdir);
+ my $changedir = $installdir;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$changedir);
+
+ my $ldpreloadstring = "";
+ if ( $getuidlibrary ne "" ) { $ldpreloadstring = "LD_PRELOAD=" . $getuidlibrary; }
+
+ $installer::globals::downloadfileextension = ".tar.gz";
+ $installer::globals::downloadfilename = $downloadfilename . $installer::globals::downloadfileextension;
+ my $targzname = $downloaddir . $installer::globals::separator . $installer::globals::downloadfilename;
+
+ $systemcall = "cd $changedir; $ldpreloadstring tar -cf - $packdir | gzip > $targzname";
+
+ my $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return $targzname;
+}
+
+#########################################################
+# Setting the variables in the download name
+#########################################################
+
+sub resolve_variables_in_downloadname
+{
+ my ($allvariables, $downloadname, $languagestringref) = @_;
+
+ # Typical name: soa-{productversion}-{extension}-bin-{os}-{languages}
+
+ my $productversion = "";
+ if ( $allvariables->{'PRODUCTVERSION'} ) { $productversion = $allvariables->{'PRODUCTVERSION'}; }
+ $downloadname =~ s/\{productversion\}/$productversion/;
+
+ my $ppackageversion = "";
+ if ( $allvariables->{'PACKAGEVERSION'} ) { $packageversion = $allvariables->{'PACKAGEVERSION'}; }
+ $downloadname =~ s/\{packageversion\}/$packageversion/;
+
+ my $extension = "";
+ if ( $allvariables->{'SHORT_PRODUCTEXTENSION'} ) { $extension = $allvariables->{'SHORT_PRODUCTEXTENSION'}; }
+ $extension = lc($extension);
+ $downloadname =~ s/\{extension\}/$extension/;
+
+ my $os = "";
+ if ( $installer::globals::iswindowsbuild ) { $os = "windows"; }
+ elsif ( $installer::globals::issolarissparcbuild ) { $os = "solsparc"; }
+ elsif ( $installer::globals::issolarisx86build ) { $os = "solia"; }
+ elsif ( $installer::globals::islinuxbuild ) { $os = "linux"; }
+ elsif ( $installer::globals::compiler =~ /unxmacxi/ ) { $os = "macosxi"; }
+ elsif ( $installer::globals::compiler =~ /unxmacxp/ ) { $os = "macosxp"; }
+ else { $os = ""; }
+ $downloadname =~ s/\{os\}/$os/;
+
+ my $languages = $$languagestringref;
+ $downloadname =~ s/\{languages\}/$languages/;
+
+ $downloadname =~ s/\-\-\-/\-/g;
+ $downloadname =~ s/\-\-/\-/g;
+ $downloadname =~ s/\-\s*$//;
+
+ return $downloadname;
+}
+
+##################################################################
+# Windows: Replacing one placeholder with the specified value
+##################################################################
+
+sub replace_one_variable
+{
+ my ($templatefile, $placeholder, $value) = @_;
+
+ my $infoline = "Replacing $placeholder by $value in nsi file\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $i = 0; $i <= $#{$templatefile}; $i++ )
+ {
+ ${$templatefile}[$i] =~ s/$placeholder/$value/g;
+ }
+
+}
+
+########################################################################################
+# Converting a string to a unicode string
+########################################################################################
+
+sub convert_to_unicode
+{
+ my ($string) = @_;
+
+ my $unicodestring = "";
+
+ my $stringlength = length($string);
+
+ for ( my $i = 0; $i < $stringlength; $i++ )
+ {
+ $unicodestring = $unicodestring . substr($string, $i, 1);
+ $unicodestring = $unicodestring . chr(0);
+ }
+
+ return $unicodestring;
+}
+
+##################################################################
+# Windows: Setting nsis version is necessary because of small
+# changes in nsis from version 2.0.4 to 2.3.1
+##################################################################
+
+sub set_nsis_version
+{
+ my ($nshfile) = @_;
+
+ my $searchstring = "\$\{LangFileString\}"; # occurs only in nsis 2.3.1 or similar
+
+ for ( my $i = 0; $i <= $#{$nshfile}; $i++ )
+ {
+ if ( ${$nshfile}[$i] =~ /\Q$searchstring\E/ )
+ {
+ # this is nsis 2.3.1 or similar
+ $installer::globals::nsis231 = 1;
+ $installer::globals::unicodensis = 0;
+ last;
+ }
+ }
+
+ # checking unicode version
+ $searchstring = convert_to_unicode($searchstring);
+
+ for ( my $i = 0; $i <= $#{$nshfile}; $i++ )
+ {
+ if ( ${$nshfile}[$i] =~ /\Q$searchstring\E/ )
+ {
+ # this is nsis 2.3.1 or similar
+ $installer::globals::nsis231 = 1;
+ $installer::globals::unicodensis = 1;
+ last;
+ }
+ }
+
+ if ( ! $installer::globals::nsis231 ) { $installer::globals::nsis204 = 1; }
+}
+
+##################################################################
+# Windows: Including the product name into nsi template
+##################################################################
+
+sub put_windows_productname_into_template
+{
+ my ($templatefile, $variableshashref) = @_;
+
+ my $productname = $variableshashref->{'PRODUCTNAME'};
+ $productname =~ s/\.//g; # OpenOffice.org -> OpenOfficeorg
+
+ replace_one_variable($templatefile, "PRODUCTNAMEPLACEHOLDER", $productname);
+}
+
+##################################################################
+# Windows: Including the path to the banner.bmp into nsi template
+##################################################################
+
+sub put_banner_bmp_into_template
+{
+ my ($templatefile, $includepatharrayref, $allvariables) = @_;
+
+ # my $filename = "downloadbanner.bmp";
+ if ( ! $allvariables->{'DOWNLOADBANNER'} ) { installer::exiter::exit_program("ERROR: DOWNLOADBANNER not defined in product definition!", "put_banner_bmp_into_template"); }
+ my $filename = $allvariables->{'DOWNLOADBANNER'};
+
+ my $completefilenameref = "";
+
+ if ( $installer::globals::include_pathes_read )
+ {
+ $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 0);
+ }
+ else
+ {
+ $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$filename, $includepatharrayref, 0);
+ }
+
+ if ($$completefilenameref eq "") { installer::exiter::exit_program("ERROR: Could not find download file $filename!", "put_banner_bmp_into_template"); }
+
+ if ( $^O =~ /cygwin/i ) { $$completefilenameref =~ s/\//\\/g; }
+
+ replace_one_variable($templatefile, "BANNERBMPPLACEHOLDER", $$completefilenameref);
+}
+
+##################################################################
+# Windows: Including the path to the welcome.bmp into nsi template
+##################################################################
+
+sub put_welcome_bmp_into_template
+{
+ my ($templatefile, $includepatharrayref, $allvariables) = @_;
+
+ # my $filename = "downloadbitmap.bmp";
+ if ( ! $allvariables->{'DOWNLOADBITMAP'} ) { installer::exiter::exit_program("ERROR: DOWNLOADBITMAP not defined in product definition!", "put_welcome_bmp_into_template"); }
+ my $filename = $allvariables->{'DOWNLOADBITMAP'};
+
+ my $completefilenameref = "";
+
+ if ( $installer::globals::include_pathes_read )
+ {
+ $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 0);
+ }
+ else
+ {
+ $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$filename, $includepatharrayref, 0);
+ }
+
+ if ($$completefilenameref eq "") { installer::exiter::exit_program("ERROR: Could not find download file $filename!", "put_welcome_bmp_into_template"); }
+
+ if ( $^O =~ /cygwin/i ) { $$completefilenameref =~ s/\//\\/g; }
+
+ replace_one_variable($templatefile, "WELCOMEBMPPLACEHOLDER", $$completefilenameref);
+}
+
+##################################################################
+# Windows: Including the path to the setup.ico into nsi template
+##################################################################
+
+sub put_setup_ico_into_template
+{
+ my ($templatefile, $includepatharrayref, $allvariables) = @_;
+
+ # my $filename = "downloadsetup.ico";
+ if ( ! $allvariables->{'DOWNLOADSETUPICO'} ) { installer::exiter::exit_program("ERROR: DOWNLOADSETUPICO not defined in product definition!", "put_setup_ico_into_template"); }
+ my $filename = $allvariables->{'DOWNLOADSETUPICO'};
+
+ my $completefilenameref = "";
+
+ if ( $installer::globals::include_pathes_read )
+ {
+ $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 0);
+ }
+ else
+ {
+ $completefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$filename, $includepatharrayref, 0);
+ }
+
+ if ($$completefilenameref eq "") { installer::exiter::exit_program("ERROR: Could not find download file $filename!", "put_setup_ico_into_template"); }
+
+ if ( $^O =~ /cygwin/i ) { $$completefilenameref =~ s/\//\\/g; }
+
+ replace_one_variable($templatefile, "SETUPICOPLACEHOLDER", $$completefilenameref);
+}
+
+##################################################################
+# Windows: Including the publisher into nsi template
+##################################################################
+
+sub put_publisher_into_template
+{
+ my ($templatefile) = @_;
+
+ my $publisher = "Sun Microsystems, Inc.";
+
+ replace_one_variable($templatefile, "PUBLISHERPLACEHOLDER", $publisher);
+}
+
+##################################################################
+# Windows: Including the web site into nsi template
+##################################################################
+
+sub put_website_into_template
+{
+ my ($templatefile) = @_;
+
+ my $website = "http\:\/\/www\.sun\.com\/staroffice";
+
+ replace_one_variable($templatefile, "WEBSITEPLACEHOLDER", $website);
+}
+
+##################################################################
+# Windows: Including the Java file name into nsi template
+##################################################################
+
+sub put_javafilename_into_template
+{
+ my ($templatefile, $variableshashref) = @_;
+
+ my $javaversion = "";
+
+ if ( $variableshashref->{'WINDOWSJAVAFILENAME'} ) { $javaversion = $variableshashref->{'WINDOWSJAVAFILENAME'}; }
+
+ replace_one_variable($templatefile, "WINDOWSJAVAFILENAMEPLACEHOLDER", $javaversion);
+}
+
+##################################################################
+# Windows: Including the product version into nsi template
+##################################################################
+
+sub put_windows_productversion_into_template
+{
+ my ($templatefile, $variableshashref) = @_;
+
+ my $productversion = $variableshashref->{'PRODUCTVERSION'};
+
+ replace_one_variable($templatefile, "PRODUCTVERSIONPLACEHOLDER", $productversion);
+}
+
+##################################################################
+# Windows: Including the product version into nsi template
+##################################################################
+
+sub put_windows_productpath_into_template
+{
+ my ($templatefile, $variableshashref, $languagestringref, $localnsisdir) = @_;
+
+ my $productpath = $variableshashref->{'PROPERTYTABLEPRODUCTNAME'};
+
+ my $locallangs = $$languagestringref;
+ $locallangs =~ s/_/ /g;
+ if (length($locallangs) > $installer::globals::max_lang_length) { $locallangs = "multi lingual"; }
+
+ if ( ! $installer::globals::languagepack ) { $productpath = $productpath . " (" . $locallangs . ")"; }
+
+ # if (( $installer::globals::languagepack ) && ( $installer::globals::unicodensis )) { $productpath = convert_textstring_to_utf16($productpath, $localnsisdir, "stringhelper.txt"); }
+
+ replace_one_variable($templatefile, "PRODUCTPATHPLACEHOLDER", $productpath);
+}
+
+##################################################################
+# Windows: Including download file name into nsi template
+##################################################################
+
+sub put_outputfilename_into_template
+{
+ my ($templatefile, $downloadname) = @_;
+
+ $installer::globals::downloadfileextension = ".exe";
+ $downloadname = $downloadname . $installer::globals::downloadfileextension;
+ $installer::globals::downloadfilename = $downloadname;
+
+ replace_one_variable($templatefile, "DOWNLOADNAMEPLACEHOLDER", $downloadname);
+}
+
+##################################################################
+# Windows: Generating the file list in nsi file format
+##################################################################
+
+sub get_file_list
+{
+ my ( $basedir ) = @_;
+
+ my @filelist = ();
+
+ my $alldirs = installer::systemactions::get_all_directories($basedir);
+ unshift(@{$alldirs}, $basedir); # $basedir is the first directory in $alldirs
+
+ for ( my $i = 0; $i <= $#{$alldirs}; $i++ )
+ {
+ my $onedir = ${$alldirs}[$i];
+
+ # Syntax:
+ # SetOutPath "$INSTDIR"
+
+ my $relativedir = $onedir;
+ $relativedir =~ s/\Q$basedir\E//;
+
+ my $oneline = " " . "SetOutPath" . " " . "\"\$INSTDIR" . $relativedir . "\"" . "\n";
+
+ if ( $^O =~ /cygwin/i ) {
+ $oneline =~ s/\//\\/g;
+ }
+ push(@filelist, $oneline);
+
+ # Collecting all files in the specific directory
+
+ my $files = installer::systemactions::get_all_files_from_one_directory($onedir);
+
+ for ( my $j = 0; $j <= $#{$files}; $j++ )
+ {
+ my $onefile = ${$files}[$j];
+
+ my $fileline = " " . "File" . " " . "\"" . $onefile . "\"" . "\n";
+
+ if ( $^O =~ /cygwin/i ) {
+ $fileline =~ s/\//\\/g;
+ }
+ push(@filelist, $fileline);
+ }
+ }
+
+ return \@filelist;
+}
+
+##################################################################
+# Windows: Including list of all files into nsi template
+##################################################################
+
+sub put_filelist_into_template
+{
+ my ($templatefile, $installationdir) = @_;
+
+ my $filelist = get_file_list($installationdir);
+
+ my $filestring = "";
+
+ for ( my $i = 0; $i <= $#{$filelist}; $i++ )
+ {
+ $filestring = $filestring . ${$filelist}[$i];
+ }
+
+ $filestring =~ s/\s*$//;
+
+ replace_one_variable($templatefile, "ALLFILESPLACEHOLDER", $filestring);
+}
+
+##################################################################
+# Windows: NSIS uses specific language names
+##################################################################
+
+sub nsis_language_converter
+{
+ my ($language) = @_;
+
+ my $nsislanguage = "";
+
+ # Assign language used by NSIS.
+ # The files "$nsislanguage.nsh" and "$nsislanguage.nlf"
+ # are needed in the NSIS environment.
+ # Directory: <NSIS-Dir>/Contrib/Language files
+ if ( $language eq "en-US" ) { $nsislanguage = "English"; }
+ elsif ( $language eq "sq" ) { $nsislanguage = "Albanian"; }
+ elsif ( $language eq "ar" ) { $nsislanguage = "Arabic"; }
+ elsif ( $language eq "bg" ) { $nsislanguage = "Bulgarian"; }
+ elsif ( $language eq "ca" ) { $nsislanguage = "Catalan"; }
+ elsif ( $language eq "hr" ) { $nsislanguage = "Croatian"; }
+ elsif ( $language eq "cs" ) { $nsislanguage = "Czech"; }
+ elsif ( $language eq "da" ) { $nsislanguage = "Danish"; }
+ elsif ( $language eq "nl" ) { $nsislanguage = "Dutch"; }
+ elsif ( $language eq "de" ) { $nsislanguage = "German"; }
+ elsif ( $language eq "de-LU" ) { $nsislanguage = "Luxembourgish"; }
+ elsif ( $language eq "et" ) { $nsislanguage = "Estonian"; }
+ elsif ( $language eq "fa" ) { $nsislanguage = "Farsi"; }
+ elsif ( $language eq "el" ) { $nsislanguage = "Greek"; }
+ elsif ( $language eq "fi" ) { $nsislanguage = "Finnish"; }
+ elsif ( $language eq "fr" ) { $nsislanguage = "French"; }
+ elsif ( $language eq "hu" ) { $nsislanguage = "Hungarian"; }
+ elsif ( $language eq "he" ) { $nsislanguage = "Hebrew"; }
+ elsif ( $language eq "is" ) { $nsislanguage = "Icelandic"; }
+ elsif ( $language eq "id" ) { $nsislanguage = "Indonesian"; }
+ elsif ( $language eq "it" ) { $nsislanguage = "Italian"; }
+ elsif ( $language eq "lv" ) { $nsislanguage = "Latvian"; }
+ elsif ( $language eq "lt" ) { $nsislanguage = "Lithuanian"; }
+ elsif ( $language eq "mk" ) { $nsislanguage = "Macedonian"; }
+ elsif ( $language eq "mn" ) { $nsislanguage = "Mongolian"; }
+ elsif ( $language eq "no" ) { $nsislanguage = "Norwegian"; }
+ elsif ( $language eq "no-NO" ) { $nsislanguage = "Norwegian"; }
+ elsif ( $language eq "es" ) { $nsislanguage = "Spanish"; }
+ elsif ( $language eq "sl" ) { $nsislanguage = "Slovenian"; }
+ elsif ( $language eq "sv" ) { $nsislanguage = "Swedish"; }
+ elsif ( $language eq "sk" ) { $nsislanguage = "Slovak"; }
+ elsif ( $language eq "pl" ) { $nsislanguage = "Polish"; }
+ elsif ( $language eq "pt-BR" ) { $nsislanguage = "PortugueseBR"; }
+ elsif ( $language eq "pt" ) { $nsislanguage = "Portuguese"; }
+ elsif ( $language eq "ro" ) { $nsislanguage = "Romanian"; }
+ elsif ( $language eq "ru" ) { $nsislanguage = "Russian"; }
+ elsif ( $language eq "sh" ) { $nsislanguage = "SerbianLatin"; }
+ elsif ( $language eq "sr" ) { $nsislanguage = "Serbian"; }
+ elsif ( $language eq "sr-SP" ) { $nsislanguage = "Serbian"; }
+ elsif ( $language eq "uk" ) { $nsislanguage = "Ukrainian"; }
+ elsif ( $language eq "tr" ) { $nsislanguage = "Turkish"; }
+ elsif ( $language eq "ja" ) { $nsislanguage = "Japanese"; }
+ elsif ( $language eq "ko" ) { $nsislanguage = "Korean"; }
+ elsif ( $language eq "th" ) { $nsislanguage = "Thai"; }
+ elsif ( $language eq "vi" ) { $nsislanguage = "Vietnamese"; }
+ elsif ( $language eq "zh-CN" ) { $nsislanguage = "SimpChinese"; }
+ elsif ( $language eq "zh-TW" ) { $nsislanguage = "TradChinese"; }
+ else {
+ my $infoline = "NSIS language_converter : Could not find nsis language for $language!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $nsislanguage = "English";
+ # installer::exiter::exit_program("ERROR: Could not find nsis language for $language!", "nsis_language_converter");
+ }
+
+ return $nsislanguage;
+}
+
+##################################################################
+# Windows: Including list of all languages into nsi template
+##################################################################
+
+sub put_language_list_into_template
+{
+ my ($templatefile, $languagesarrayref) = @_;
+
+ my $alllangstring = "";
+ my %nsislangs;
+
+ for ( my $i = 0; $i <= $#{$languagesarrayref}; $i++ )
+ {
+ my $onelanguage = ${$languagesarrayref}[$i];
+ my $nsislanguage = nsis_language_converter($onelanguage);
+ $nsislangs{$nsislanguage}++;
+ }
+
+ foreach my $nsislanguage ( keys(%nsislangs) )
+ {
+ # Syntax: !insertmacro MUI_LANGUAGE "English"
+ my $langstring = "\!insertmacro MUI_LANGUAGE_PACK " . $nsislanguage . "\n";
+ if ( $nsislanguage eq "English" )
+ {
+ $alllangstring = $langstring . $alllangstring;
+ }
+ else
+ {
+ $alllangstring = $alllangstring . $langstring;
+ }
+ }
+
+ $alllangstring =~ s/\s*$//;
+
+ replace_one_variable($templatefile, "ALLLANGUAGESPLACEHOLDER", $alllangstring);
+}
+
+##################################################################
+# Windows: Collecting all identifier from mlf file
+##################################################################
+
+sub get_identifier
+{
+ my ( $mlffile ) = @_;
+
+ my @identifier = ();
+
+ for ( my $i = 0; $i <= $#{$mlffile}; $i++ )
+ {
+ my $oneline = ${$mlffile}[$i];
+
+ if ( $oneline =~ /^\s*\[(.+)\]\s*$/ )
+ {
+ my $identifier = $1;
+ push(@identifier, $identifier);
+ }
+ }
+
+ return \@identifier;
+}
+
+##############################################################
+# Returning the complete block in all languages
+# for a specified string
+##############################################################
+
+sub get_language_block_from_language_file
+{
+ my ($searchstring, $languagefile) = @_;
+
+ my @language_block = ();
+
+ for ( my $i = 0; $i <= $#{$languagefile}; $i++ )
+ {
+ if ( ${$languagefile}[$i] =~ /^\s*\[\s*$searchstring\s*\]\s*$/ )
+ {
+ my $counter = $i;
+
+ push(@language_block, ${$languagefile}[$counter]);
+ $counter++;
+
+ while (( $counter <= $#{$languagefile} ) && (!( ${$languagefile}[$counter] =~ /^\s*\[/ )))
+ {
+ push(@language_block, ${$languagefile}[$counter]);
+ $counter++;
+ }
+
+ last;
+ }
+ }
+
+ return \@language_block;
+}
+
+##############################################################
+# Returning a specific language string from the block
+# of all translations
+##############################################################
+
+sub get_language_string_from_language_block
+{
+ my ($language_block, $language) = @_;
+
+ my $newstring = "";
+
+ for ( my $i = 0; $i <= $#{$language_block}; $i++ )
+ {
+ if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
+ {
+ $newstring = $1;
+ last;
+ }
+ }
+
+ if ( $newstring eq "" )
+ {
+ $language = "en-US"; # defaulting to english
+
+ for ( my $i = 0; $i <= $#{$language_block}; $i++ )
+ {
+ if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
+ {
+ $newstring = $1;
+ last;
+ }
+ }
+ }
+
+ return $newstring;
+}
+
+##################################################################
+# Windows: Replacing strings in NSIS nsh file
+# nsh file syntax:
+# !define MUI_TEXT_DIRECTORY_TITLE "Zielverzeichnis auswählen"
+##################################################################
+
+sub replace_identifier_in_nshfile
+{
+ my ( $nshfile, $identifier, $newstring, $nshfilename, $onelanguage ) = @_;
+
+ if ( $installer::globals::nsis231 )
+ {
+ $newstring =~ s/\\r/\$\\r/g; # \r -> $\r in modern nsis versions
+ $newstring =~ s/\\n/\$\\n/g; # \n -> $\n in modern nsis versions
+ }
+
+ for ( my $i = 0; $i <= $#{$nshfile}; $i++ )
+ {
+ if ( ${$nshfile}[$i] =~ /\s+\Q$identifier\E\s+\"(.+)\"\s*$/ )
+ {
+ my $oldstring = $1;
+ ${$nshfile}[$i] =~ s/\Q$oldstring\E/$newstring/;
+ my $infoline = "NSIS replacement in $nshfilename ($onelanguage): $oldstring \-\> $newstring\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+}
+
+##################################################################
+# Windows: Replacing strings in NSIS nlf file
+# nlf file syntax (2 lines):
+# # ^DirSubText
+# Zielverzeichnis
+##################################################################
+
+sub replace_identifier_in_nlffile
+{
+ my ( $nlffile, $identifier, $newstring, $nlffilename, $onelanguage ) = @_;
+
+ for ( my $i = 0; $i <= $#{$nlffile}; $i++ )
+ {
+ if ( ${$nlffile}[$i] =~ /^\s*\#\s+\^\s*\Q$identifier\E\s*$/ )
+ {
+ my $next = $i+1;
+ my $oldstring = ${$nlffile}[$next];
+ ${$nlffile}[$next] = $newstring . "\n";
+ $oldstring =~ s/\s*$//;
+ my $infoline = "NSIS replacement in $nlffilename ($onelanguage): $oldstring \-\> $newstring\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+}
+
+##################################################################
+# Windows: Translating the NSIS nsh and nlf file
+##################################################################
+
+sub translate_nsh_nlf_file
+{
+ my ($nshfile, $nlffile, $mlffile, $onelanguage, $nshfilename, $nlffilename, $nsislanguage) = @_;
+
+ # Analyzing the mlf file, collecting all Identifier
+ my $allidentifier = get_identifier($mlffile);
+
+ $onelanguage = "en-US" if ( $nsislanguage eq "English" && $onelanguage ne "en-US");
+ for ( my $i = 0; $i <= $#{$allidentifier}; $i++ )
+ {
+ my $identifier = ${$allidentifier}[$i];
+ my $language_block = get_language_block_from_language_file($identifier, $mlffile);
+ my $newstring = get_language_string_from_language_block($language_block, $onelanguage);
+
+ # removing mask
+ $newstring =~ s/\\\'/\'/g;
+
+ replace_identifier_in_nshfile($nshfile, $identifier, $newstring, $nshfilename, $onelanguage);
+ replace_identifier_in_nlffile($nlffile, $identifier, $newstring, $nlffilename, $onelanguage);
+ }
+}
+
+##################################################################
+# Converting utf 16 file to utf 8
+##################################################################
+
+sub convert_utf16_to_utf8
+{
+ my ( $filename ) = @_;
+
+ my @localfile = ();
+
+ my $savfilename = $filename . "_before.utf16";
+ installer::systemactions::copy_one_file($filename, $savfilename);
+
+# open( IN, "<:utf16", $filename ) || installer::exiter::exit_program("ERROR: Cannot open file $filename for reading", "convert_utf16_to_utf8");
+# open( IN, "<:para:crlf:uni", $filename ) || installer::exiter::exit_program("ERROR: Cannot open file $filename for reading", "convert_utf16_to_utf8");
+ open( IN, "<:encoding(UTF16-LE)", $filename ) || installer::exiter::exit_program("ERROR: Cannot open file $filename for reading", "convert_utf16_to_utf8");
+ while ( $line = <IN> ) {
+ push @localfile, $line;
+ }
+ close( IN );
+
+ if ( open( OUT, ">:utf8", $filename ) )
+ {
+ print OUT @localfile;
+ close(OUT);
+ }
+
+ $savfilename = $filename . "_before.utf8";
+ installer::systemactions::copy_one_file($filename, $savfilename);
+}
+
+##################################################################
+# Converting utf 8 file to utf 16
+##################################################################
+
+sub convert_utf8_to_utf16
+{
+ my ( $filename ) = @_;
+
+ my @localfile = ();
+
+ my $savfilename = $filename . "_after.utf8";
+ installer::systemactions::copy_one_file($filename, $savfilename);
+
+ open( IN, "<:utf8", $filename ) || installer::exiter::exit_program("ERROR: Cannot open file $filename for reading", "convert_utf8_to_utf16");
+ while ( $line = <IN> ) {
+ push @localfile, $line;
+ }
+ close( IN );
+
+ if ( open( OUT, ">:raw:encoding(UTF16-LE):crlf:utf8", $filename ) )
+ {
+ print OUT @localfile;
+ close(OUT);
+ }
+
+ $savfilename = $filename . "_after.utf16";
+ installer::systemactions::copy_one_file($filename, $savfilename);
+}
+
+##################################################################
+# Converting text string to utf 16
+##################################################################
+
+sub convert_textstring_to_utf16
+{
+ my ( $textstring, $localnsisdir, $shortfilename ) = @_;
+
+ my $filename = $localnsisdir . $installer::globals::separator . $shortfilename;
+ my @filecontent = ();
+ push(@filecontent, $textstring);
+ installer::files::save_file($filename, \@filecontent);
+ convert_utf8_to_utf16($filename);
+ my $newfile = installer::files::read_file($filename);
+ my $utf16string = "";
+ if ( ${$newfile}[0] ne "" ) { $utf16string = ${$newfile}[0]; }
+
+ return $utf16string;
+}
+
+##################################################################
+# Windows: Copying NSIS language files to local nsis directory
+##################################################################
+
+sub copy_and_translate_nsis_language_files
+{
+ my ($nsispath, $localnsisdir, $languagesarrayref, $allvariables) = @_;
+
+ my $nlffilepath = $nsispath . $installer::globals::separator . "Contrib" . $installer::globals::separator . "Language\ files" . $installer::globals::separator;
+ my $nshfilepath = $nsispath . $installer::globals::separator . "Contrib" . $installer::globals::separator . "Modern\ UI" . $installer::globals::separator . "Language files" . $installer::globals::separator;
+
+ my $infoline = "";
+
+ for ( my $i = 0; $i <= $#{$languagesarrayref}; $i++ )
+ {
+ my $onelanguage = ${$languagesarrayref}[$i];
+ my $nsislanguage = nsis_language_converter($onelanguage);
+
+ # Copying the nlf file
+ my $sourcepath = $nlffilepath . $nsislanguage . "\.nlf";
+ if ( ! -f $sourcepath ) { installer::exiter::exit_program("ERROR: Could not find nsis file: $sourcepath!", "copy_and_translate_nsis_language_files"); }
+ my $nlffilename = $localnsisdir . $installer::globals::separator . $nsislanguage . "_pack.nlf";
+ if ( $^O =~ /cygwin/i ) { $nlffilename =~ s/\//\\/g; }
+ installer::systemactions::copy_one_file($sourcepath, $nlffilename);
+
+ # Copying the nsh file
+ # In newer nsis versions, the nsh file is located next to the nlf file
+ $sourcepath = $nshfilepath . $nsislanguage . "\.nsh";
+ if ( ! -f $sourcepath )
+ {
+ # trying to find the nsh file next to the nlf file
+ $sourcepath = $nlffilepath . $nsislanguage . "\.nsh";
+ if ( ! -f $sourcepath )
+ {
+ installer::exiter::exit_program("ERROR: Could not find nsis file: $sourcepath!", "copy_and_translate_nsis_language_files");
+ }
+ }
+ my $nshfilename = $localnsisdir . $installer::globals::separator . $nsislanguage . "_pack.nsh";
+ if ( $^O =~ /cygwin/i ) { $nshfilename =~ s/\//\\/g; }
+ installer::systemactions::copy_one_file($sourcepath, $nshfilename);
+
+ # Changing the macro name in nsh file: MUI_LANGUAGEFILE_BEGIN -> MUI_LANGUAGEFILE_PACK_BEGIN
+ my $nshfile = installer::files::read_file($nshfilename);
+ set_nsis_version($nshfile);
+
+ if ( $installer::globals::unicodensis )
+ {
+ $infoline = "This is Unicode NSIS!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ convert_utf16_to_utf8($nshfilename);
+ convert_utf16_to_utf8($nlffilename);
+ $nshfile = installer::files::read_file($nshfilename); # read nsh file again
+ }
+
+ replace_one_variable($nshfile, "MUI_LANGUAGEFILE_BEGIN", "MUI_LANGUAGEFILE_PACK_BEGIN");
+
+ # find the ulf file for translation
+ my $mlffile = get_translation_file($allvariables);
+
+ # Translate the files
+ my $nlffile = installer::files::read_file($nlffilename);
+ translate_nsh_nlf_file($nshfile, $nlffile, $mlffile, $onelanguage, $nshfilename, $nlffilename, $nsislanguage);
+
+ installer::files::save_file($nshfilename, $nshfile);
+ installer::files::save_file($nlffilename, $nlffile);
+
+ if ( $installer::globals::unicodensis )
+ {
+ convert_utf8_to_utf16($nshfilename);
+ convert_utf8_to_utf16($nlffilename);
+ }
+ }
+
+}
+
+##################################################################
+# Windows: Including the nsis path into the nsi template
+##################################################################
+
+sub put_nsis_path_into_template
+{
+ my ($templatefile, $nsisdir) = @_;
+
+ replace_one_variable($templatefile, "NSISPATHPLACEHOLDER", $nsisdir);
+}
+
+##################################################################
+# Windows: Including the output path into the nsi template
+##################################################################
+
+sub put_output_path_into_template
+{
+ my ($templatefile, $downloaddir) = @_;
+
+ if ( $^O =~ /cygwin/i ) { $downloaddir =~ s/\//\\/g; }
+
+ replace_one_variable($templatefile, "OUTPUTDIRPLACEHOLDER", $downloaddir);
+}
+
+##################################################################
+# Windows: Only allow specific code for nsis 2.0.4 or nsis 2.3.1
+##################################################################
+
+sub put_version_specific_code_into_template
+{
+ my ($templatefile) = @_;
+
+ my $subst204 = "";
+ my $subst231 = "";
+
+ if ( $installer::globals::nsis204 )
+ {
+ $subst231 = ";";
+ }
+ else
+ {
+ $subst204 = ";";
+ }
+
+ replace_one_variable($templatefile, "\#204\#", $subst204);
+ replace_one_variable($templatefile, "\#231\#", $subst231);
+}
+
+##################################################################
+# Windows: Finding the path to the nsis SDK
+##################################################################
+
+sub get_path_to_nsis_sdk
+{
+ my $vol;
+ my $dir;
+ my $file;
+ my $nsispath = "";
+
+ if ( $ENV{'NSIS_PATH'} ) {
+ $nsispath = $ENV{'NSIS_PATH'};
+ } elsif ( $ENV{'SOLARROOT'} ) {
+ $nsispath = $ENV{'SOLARROOT'} . $installer::globals::separator . "NSIS";
+ } else {
+ # do we have nsis already in path ?
+ @paths = split(/:/, $ENV{'PATH'});
+ foreach $paths (@paths) {
+ $paths =~ s/[\/\\]+$//; # remove trailing slashes;
+ $nsispath = $paths . "/nsis";
+
+ if ( -x $nsispath ) {
+ $nsispath = $paths;
+ last;
+ }
+ else {
+ $nsispath = "";
+ }
+ }
+ }
+ if ( $ENV{'NSISSDK_SOURCE'} ) {
+ installer::logger::print_warning( "NSISSDK_SOURCE is deprecated. use NSIS_PATH instead.\n" );
+ $nsispath = $ENV{'NSISSDK_SOURCE'}; # overriding the NSIS SDK with NSISSDK_SOURCE
+ }
+
+# if( ($^O =~ /cygwin/i) and $nsispath =~ /\\/ ) {
+# # We need a POSIX path for W32-4nt-cygwin-perl
+# $nsispath =~ s/\\/\\\\/g;
+# chomp( $nsispath = qx{cygpath -u "$nsispath"} );
+# }
+
+ if ( $nsispath eq "" )
+ {
+ installer::logger::print_message( "... no Environment variable \"SOLARROOT\", \"NSIS_PATH\" or \"NSISSDK_SOURCE\" found and NSIS not found in path!", "get_path_to_nsis_sdk");
+ } elsif ( ! -d $nsispath )
+ {
+ installer::exiter::exit_program("ERROR: NSIS path $nsispath does not exist!", "get_path_to_nsis_sdk");
+ }
+
+ return $nsispath;
+}
+
+##################################################################
+# Windows: Executing NSIS to create the installation set
+##################################################################
+
+sub call_nsis
+{
+ my ( $nsispath, $nsifile ) = @_;
+
+ my $makensisexe = $nsispath . $installer::globals::separator . "makensis.exe";
+
+ installer::logger::print_message( "... starting $makensisexe ... \n" );
+
+ if( $^O =~ /cygwin/i ) { $nsifile =~ s/\\/\//g; }
+
+ my $systemcall = "$makensisexe $nsifile |";
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my @nsisoutput = ();
+
+ open (NSI, "$systemcall");
+ while (<NSI>) {push(@nsisoutput, $_); }
+ close (NSI);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: $systemcall !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ for ( my $i = 0; $i <= $#nsisoutput; $i++ ) { push( @installer::globals::logfileinfo, "$nsisoutput[$i]"); }
+
+}
+
+#################################################################################
+# Replacing one variable in one files
+#################################################################################
+
+sub replace_one_variable_in_translationfile
+{
+ my ($translationfile, $variable, $searchstring) = @_;
+
+ for ( my $i = 0; $i <= $#{$translationfile}; $i++ )
+ {
+ ${$translationfile}[$i] =~ s/\%$searchstring/$variable/g;
+ }
+}
+
+#################################################################################
+# Replacing the variables in the translation file
+#################################################################################
+
+sub replace_variables
+{
+ my ($translationfile, $variableshashref) = @_;
+
+ foreach $key (keys %{$variableshashref})
+ {
+ my $value = $variableshashref->{$key};
+
+ # special handling for PRODUCTVERSION, if $allvariables->{'POSTVERSIONEXTENSION'}
+ if (( $key eq "PRODUCTVERSION" ) && ( $variableshashref->{'POSTVERSIONEXTENSION'} )) { $value = $value . " " . $variableshashref->{'POSTVERSIONEXTENSION'}; }
+
+ replace_one_variable_in_translationfile($translationfile, $value, $key);
+ }
+}
+
+#########################################################
+# Getting the translation file for the nsis installer
+#########################################################
+
+sub get_translation_file
+{
+ my ($allvariableshashref) = @_;
+ my $translationfilename = $installer::globals::idtlanguagepath . $installer::globals::separator . $installer::globals::nsisfilename;
+ if ( $installer::globals::unicodensis ) { $translationfilename = $translationfilename . ".uulf"; }
+ else { $translationfilename = $translationfilename . ".mlf"; }
+ if ( ! -f $translationfilename ) { installer::exiter::exit_program("ERROR: Could not find language file $translationfilename!", "get_translation_file"); }
+ my $translationfile = installer::files::read_file($translationfilename);
+ replace_variables($translationfile, $allvariableshashref);
+
+ my $infoline = "Reading translation file: $translationfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return $translationfile;
+}
+
+####################################################
+# Removing english, if it was added before
+####################################################
+
+sub remove_english_for_nsis_installer
+{
+ my ($languagestringref, $languagesarrayref) = @_;
+
+ # $$languagestringref =~ s/en-US_//;
+ # shift(@{$languagesarrayref});
+
+ @{$languagesarrayref} = ("en-US"); # only english for NSIS installer!
+}
+
+####################################################
+# Creating link tree for upload
+####################################################
+
+sub create_link_tree
+{
+ my ($sourcedownloadfile, $destfilename, $versionstring) = @_;
+
+ if ( ! $installer::globals::ooouploaddir ) { installer::exiter::exit_program("ERROR: Directory for OOo upload not defined!", "create_link_tree"); }
+ my $versiondir = $installer::globals::ooouploaddir . $installer::globals::separator . $versionstring;
+ my $infoline = "Directory for the link: $versiondir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ if ( ! -d $versiondir ) { installer::systemactions::create_directory_structure($versiondir); }
+
+ # inside directory $versiondir all links have to be created
+ my $linkdestination = $versiondir . $installer::globals::separator . $destfilename;
+
+ # If there is an older version of this file (link), it has to be removed
+ if ( -f $linkdestination ) { unlink($linkdestination); }
+
+ $infoline = "Creating hard link from $sourcedownloadfile to $linkdestination\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ installer::systemactions::hardlink_one_file($sourcedownloadfile, $linkdestination);
+}
+
+#######################################################
+# Setting supported platform for Sun OpenOffice.org
+# builds
+#######################################################
+
+sub is_supported_platform
+{
+ my $is_supported = 0;
+
+ if (( $installer::globals::islinuxrpmbuild ) ||
+ ( $installer::globals::issolarissparcbuild ) ||
+ ( $installer::globals::issolarisx86build ) ||
+ ( $installer::globals::iswindowsbuild ))
+ {
+ $is_supported = 1;
+ }
+
+ return $is_supported;
+}
+
+####################################################
+# Creating download installation sets
+####################################################
+
+sub create_download_sets
+{
+ my ($installationdir, $includepatharrayref, $allvariableshashref, $downloadname, $languagestringref, $languagesarrayref) = @_;
+
+ my $infoline = "";
+
+ my $force = 1; # print this message even in 'quiet' mode
+ installer::logger::print_message( "\n******************************************\n" );
+ installer::logger::print_message( "... creating download installation set ...\n", $force );
+ installer::logger::print_message( "******************************************\n" );
+
+ installer::logger::include_header_into_logfile("Creating download installation sets:");
+
+ # special handling for installation sets, to which english was added automatically
+ if ( $installer::globals::added_english ) { remove_english_for_nsis_installer($languagestringref, $languagesarrayref); }
+
+ my $firstdir = $installationdir;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$firstdir);
+
+ my $lastdir = $installationdir;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$lastdir);
+
+ if ( $lastdir =~ /\./ ) { $lastdir =~ s/\./_download_inprogress\./ }
+ else { $lastdir = $lastdir . "_download_inprogress"; }
+
+ # removing existing directory "_native_packed_inprogress" and "_native_packed_witherror" and "_native_packed"
+
+ my $downloaddir = $firstdir . $lastdir;
+
+ if ( -d $downloaddir ) { installer::systemactions::remove_complete_directory($downloaddir); }
+
+ my $olddir = $downloaddir;
+ $olddir =~ s/_inprogress/_witherror/;
+ if ( -d $olddir ) { installer::systemactions::remove_complete_directory($olddir); }
+
+ $olddir = $downloaddir;
+ $olddir =~ s/_inprogress//;
+ if ( -d $olddir ) { installer::systemactions::remove_complete_directory($olddir); }
+
+ # creating the new directory
+
+ installer::systemactions::create_directory($downloaddir);
+
+ $installer::globals::saveinstalldir = $downloaddir;
+
+ # evaluating the name of the download file
+
+ if ( $allvariableshashref->{'OOODOWNLOADNAME'} ) { $downloadname = set_download_filename($languagestringref, $allvariableshashref); }
+ else { $downloadname = resolve_variables_in_downloadname($allvariableshashref, $downloadname, $languagestringref); }
+
+ if ( ! $installer::globals::iswindowsbuild ) # Unix specific part
+ {
+
+ # getting the path of the getuid.so (only required for Solaris and Linux)
+ my $getuidlibrary = "";
+ if (( $installer::globals::issolarisbuild ) || ( $installer::globals::islinuxbuild )) { $getuidlibrary = get_path_for_library($includepatharrayref); }
+
+ if ( $allvariableshashref->{'OOODOWNLOADNAME'} )
+ {
+ my $downloadfile = create_tar_gz_file_from_directory($installationdir, $getuidlibrary, $downloaddir, $downloadname);
+ }
+ else
+ {
+ # find and read setup script template
+ my $scriptfilename = "downloadscript.sh";
+
+ my $scriptref = "";
+
+ if ( $installer::globals::include_pathes_read )
+ {
+ $scriptref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$scriptfilename, $includepatharrayref, 0);
+ }
+ else
+ {
+ $scriptref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$scriptfilename, $includepatharrayref, 0);
+ }
+
+ if ($$scriptref eq "") { installer::exiter::exit_program("ERROR: Could not find script file $scriptfilename!", "create_download_sets"); }
+ my $scriptfile = installer::files::read_file($$scriptref);
+
+ $infoline = "Found script file $scriptfilename: $$scriptref \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # add product name into script template
+ put_productname_into_script($scriptfile, $allvariableshashref);
+
+ # replace linenumber in script template
+ put_linenumber_into_script($scriptfile);
+
+ # create tar file
+ my $temporary_tarfile_name = $downloaddir . $installer::globals::separator . 'installset.tar';
+ my $size = tar_package($installationdir, $temporary_tarfile_name, $getuidlibrary);
+ installer::exiter::exit_program("ERROR: Could not create tar file $temporary_tarfile_name!", "create_download_sets") unless $size;
+
+ # calling sum to determine checksum and size of the tar file
+ my $sumout = call_sum($temporary_tarfile_name);
+
+ # writing checksum and size into scriptfile
+ put_checksum_and_size_into_script($scriptfile, $sumout);
+
+ # saving the script file
+ my $newscriptfilename = determine_scriptfile_name($downloadname);
+ $newscriptfilename = save_script_file($downloaddir, $newscriptfilename, $scriptfile);
+
+ installer::logger::print_message( "... including installation set into $newscriptfilename ... \n" );
+ # Append tar file to script
+ include_tar_into_script($newscriptfilename, $temporary_tarfile_name);
+ }
+ }
+ else # Windows specific part
+ {
+ my $localnsisdir = installer::systemactions::create_directories("nsis", $languagestringref);
+ # push(@installer::globals::removedirs, $localnsisdir);
+
+ # find nsis in the system
+ my $nsispath = get_path_to_nsis_sdk();
+
+ if ( $nsispath eq "" ) {
+ # If nsis is not found just skip the rest of this function
+ # and do not create the NSIS file.
+ $infoline = "\nNo NSIS SDK found. Skipping the generation of NSIS file.\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ installer::logger::print_message( "... no NSIS SDK found. Skipping the generation of NSIS file ... \n" );
+ return $downloaddir;
+ }
+
+ # copy language files into nsis directory and translate them
+ copy_and_translate_nsis_language_files($nsispath, $localnsisdir, $languagesarrayref, $allvariableshashref);
+
+ # find and read the nsi file template
+ my $templatefilename = "downloadtemplate.nsi";
+
+ my $templateref = "";
+
+ if ( $installer::globals::include_pathes_read )
+ {
+ $templateref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$templatefilename, $includepatharrayref, 0);
+ }
+ else
+ {
+ $templateref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$templatefilename, $includepatharrayref, 0);
+ }
+
+ if ($$templateref eq "") { installer::exiter::exit_program("ERROR: Could not find nsi template file $templatefilename!", "create_download_sets"); }
+ my $templatefile = installer::files::read_file($$templateref);
+
+ # add product name into script template
+ put_windows_productname_into_template($templatefile, $allvariableshashref);
+ put_banner_bmp_into_template($templatefile, $includepatharrayref, $allvariableshashref);
+ put_welcome_bmp_into_template($templatefile, $includepatharrayref, $allvariableshashref);
+ put_setup_ico_into_template($templatefile, $includepatharrayref, $allvariableshashref);
+ put_publisher_into_template($templatefile);
+ put_website_into_template($templatefile);
+ put_javafilename_into_template($templatefile, $allvariableshashref);
+ put_windows_productversion_into_template($templatefile, $allvariableshashref);
+ put_windows_productpath_into_template($templatefile, $allvariableshashref, $languagestringref, $localnsisdir);
+ put_outputfilename_into_template($templatefile, $downloadname);
+ put_filelist_into_template($templatefile, $installationdir);
+ put_language_list_into_template($templatefile, $languagesarrayref);
+ put_nsis_path_into_template($templatefile, $localnsisdir);
+ put_output_path_into_template($templatefile, $downloaddir);
+ put_version_specific_code_into_template($templatefile);
+
+ my $nsifilename = save_script_file($localnsisdir, $templatefilename, $templatefile);
+
+ installer::logger::print_message( "... created NSIS file $nsifilename ... \n" );
+
+ # starting the NSIS SDK to create the download file
+ call_nsis($nsispath, $nsifilename);
+ }
+
+ return $downloaddir;
+}
+
+####################################################
+# Creating OOo upload tree
+####################################################
+
+sub create_download_link_tree
+{
+ my ($downloaddir, $languagestringref, $allvariableshashref) = @_;
+
+ my $infoline;
+
+ installer::logger::print_message( "\n******************************************\n" );
+ installer::logger::print_message( "... creating download hard link ...\n" );
+ installer::logger::print_message( "******************************************\n" );
+
+ installer::logger::include_header_into_logfile("Creating download hard link:");
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Creating hard link, start");
+
+ if ( is_supported_platform() )
+ {
+ my $versionstring = "";
+ # Already defined $installer::globals::oooversionstring and $installer::globals::ooodownloadfilename ?
+
+ if ( ! $installer::globals::oooversionstring ) { $versionstring = get_current_version(); }
+ else { $versionstring = $installer::globals::oooversionstring; }
+
+ # Is $versionstring empty? If yes, there is nothing to do now.
+
+ $infoline = "Version string is set to: $versionstring\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $versionstring )
+ {
+ # Now the downloadfilename has to be set (if not already done)
+ my $destdownloadfilename = "";
+ if ( ! $installer::globals::ooodownloadfilename ) { $destdownloadfilename = set_download_filename($languagestringref, $versionstring, $allvariableshashref); }
+ else { $destdownloadfilename = $installer::globals::ooodownloadfilename; }
+
+ if ( $destdownloadfilename )
+ {
+ $destdownloadfilename = $destdownloadfilename . $installer::globals::downloadfileextension;
+
+ $infoline = "Setting destination download file name: $destdownloadfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $sourcedownloadfile = $downloaddir . $installer::globals::separator . $installer::globals::downloadfilename;
+
+ $infoline = "Setting source download file name: $sourcedownloadfile\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ create_link_tree($sourcedownloadfile, $destdownloadfilename, $versionstring);
+ # my $md5sumoutput = call_md5sum($downloadfile);
+ # my $md5sum = get_md5sum($md5sumoutput);
+
+ }
+ }
+ else
+ {
+ $infoline = "Version string is empty. Nothing to do!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ else
+ {
+ $infoline = "Platform not used for hard linking. Nothing to do!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: Creating hard link, stop");
+}
+
+1;
diff --git a/solenv/bin/modules/installer/downloadsigner.pm b/solenv/bin/modules/installer/downloadsigner.pm
new file mode 100644
index 000000000000..aa3bbb25a484
--- /dev/null
+++ b/solenv/bin/modules/installer/downloadsigner.pm
@@ -0,0 +1,585 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::downloadsigner;
+
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::pathanalyzer;
+
+############################################
+# Parameter Operations
+############################################
+
+sub usage
+{
+ print <<Ende;
+--------------------------------------------------------------------------------
+make_download V1.0
+The following parameter are needed:
+-d: Full path to the file containing the follow-me info or to a directory
+ containing the follow-me info files. In the latter case, all follow-me
+ info files are evaluated. If a directory is used, the successfully used
+ follow-me info files are renamed using a string "success". Files with
+ this string are ignored in repeated processes using "-d" with a
+ directory.
+
+The following parameter are optional:
+-nodownload: Only signing, no creation of download sets (Windows only)
+-useminor: Important for installation sets, created without minor set
+-writetotemp: Necessary, if you do not want to write into solver
+ This can be caused by missing privileges (Windows only)
+-internalcabinet: Not only the cabinet files are signed, but also all
+ files included in the cabinet files (Windows only).
+
+-sign: Uses signing mechanism to sign installation sets
+If \"-sign\" is set, the following two parameter are required:
+-pfx: Full path to the pfx file
+-pw: Full path to the file, containing the pfx password.
+
+Examples:
+
+Specifying an installation set (with "-d"):
+
+perl make_download.pl -d <followmeinfofilename>
+
+perl make_download.pl -d <followmeinfofilename>
+ -sign
+ -pfx <pfxfilename>
+ -pw <passwordfilename>
+
+or without specifying an installation set:
+
+perl make_download.pl -d <followmedirectory>
+ -sign
+ -pfx <pfxfilename>
+ -pw <passwordfilename>
+--------------------------------------------------------------------------------
+Ende
+ exit(-1);
+}
+
+#####################################
+# Reading parameter
+#####################################
+
+sub getparameter
+{
+ # installer::logger::print_message("Checking parameter");
+
+ while ( $#ARGV >= 0 )
+ {
+ my $param = shift(@ARGV);
+
+ if ($param eq "-d") { $installer::globals::followmeinfofilename = shift(@ARGV); }
+ elsif ($param eq "-pw") { $installer::globals::pwfile = shift(@ARGV); }
+ elsif ($param eq "-pfx") { $installer::globals::pfxfile = shift(@ARGV); }
+ elsif ($param eq "-sign") { $installer::globals::dosign = 1; }
+ elsif ($param eq "-nodownload") { $installer::globals::nodownload = 1; }
+ elsif ($param eq "-writetotemp") { $installer::globals::writetotemp = 1; }
+ elsif ($param eq "-useminor") { $installer::globals::useminor = 1; }
+ elsif ($param eq "-internalcabinet") { $installer::globals::internal_cabinet_signing = 1; }
+ else
+ {
+ installer::logger::print_error( "unknown parameter: $param" );
+ usage();
+ exit(-1);
+ }
+ }
+}
+
+#####################################
+# Controlling required parameter
+#####################################
+
+sub checkparameter
+{
+ if ( $installer::globals::followmeinfofilename eq "" )
+ {
+ installer::logger::print_error( "Error: Required parameter is missing: -d\n" );
+ usage();
+ exit(-1);
+ }
+
+ if ( $installer::globals::dosign )
+ {
+ # -pfx and -pw have to be set
+ if ( $installer::globals::pfxfile eq "" )
+ {
+ installer::logger::print_error( "Error: If \"-sign\" is set, a pfx file has to be specified: -pfx\n" );
+ usage();
+ exit(-1);
+ }
+
+ # -pfx and -pw have to be set
+ if ( $installer::globals::pwfile eq "" )
+ {
+ installer::logger::print_error( "Error: If \"-sign\" is set, a password file has to be specified: -pw\n" );
+ usage();
+ exit(-1);
+ }
+
+ # and both files have to exist
+ if ( ! -f $installer::globals::pfxfile )
+ {
+ installer::logger::print_error( "Error: pfx file \"$installer::globals::pfxfile\" does not exist.\n" );
+ usage();
+ exit(-1);
+ }
+
+ if ( ! -f $installer::globals::pwfile )
+ {
+ installer::logger::print_error( "Error: Password file \"$installer::globals::pwfile\" does not exist (-pw).\n" );
+ usage();
+ exit(-1);
+ }
+ }
+}
+
+#############################################
+# Setting the temporary path for the download
+# and signing process
+#############################################
+
+sub set_temp_path
+{
+ my $temppath = "";
+ my $pid = $$; # process id
+ my $time = time(); # time
+ my $helperdir = "unpackdir_" . $pid . $time;
+
+ if (( $ENV{'TMP'} ) || ( $ENV{'TEMP'} ))
+ {
+ if ( $ENV{'TMP'} ) { $temppath = $ENV{'TMP'}; }
+ elsif ( $ENV{'TEMP'} ) { $temppath = $ENV{'TEMP'}; }
+ $temppath =~ s/\Q$installer::globals::separator\E\s*$//; # removing ending slashes and backslashes
+ $temppath = $temppath . $installer::globals::separator . $helperdir;
+
+ if( $^O =~ /cygwin/i )
+ {
+ $temppath = qx{cygpath -w "$temppath"};
+ $temppath =~ s/\\/\//g;
+ $temppath =~ s/\s*$//g;
+ }
+
+ installer::systemactions::create_directory_structure($temppath);
+ }
+ else
+ {
+ installer::logger::print_error( "Error: TMP and TEMP not defined. This is required for this process.\n" );
+ usage();
+ exit(-1);
+ }
+
+ installer::logger::print_message( "\n... using output path: $temppath ...\n" );
+
+ push(@installer::globals::removedirs, $temppath);
+
+ return $temppath;
+}
+
+#############################################
+# Setting output pathes to temp directory
+# This are the:
+# unpackpath and the loggingdir
+#############################################
+
+sub set_output_pathes_to_temp
+{
+ my ($followmeinfohash, $temppath) = @_;
+
+ $followmeinfohash->{'loggingdir'} = $temppath . $installer::globals::separator;
+ $installer::globals::unpackpath = $temppath;
+}
+
+#############################################
+# Setting the minor into the pathes. This is
+# required, if the original installation set
+# was created without minor
+# Value is always saved in
+# $installer::globals::lastminor
+# which is saved in the follow_me file
+#############################################
+
+sub set_minor_into_pathes
+{
+ my ($followmeinfohash, $temppath) = @_;
+
+ installer::logger::print_message( "\n... forcing into minor: $installer::globals::lastminor ...\n" );
+
+ my @pathnames = ("bin", "doc", "inc", "lib", "pck", "res", "xml");
+ my $sourcename = "src";
+ my $srcpath = $installer::globals::separator . $sourcename . $installer::globals::separator;
+
+ if ( $installer::globals::minor ne "" )
+ {
+ installer::logger::print_message( "\n... already defined minor: $installer::globals::minor -> ignoring parameter \"-useminor\" ...\n" );
+ return;
+ }
+
+ # Affected pathes:
+ # $contenthash{'installlogdir'}
+ # $contenthash{'includepatharray'}
+ # $installer::globals::unpackpath
+ # $installer::globals::idttemplatepath
+ # $installer::globals::idtlanguagepath
+
+ installer::logger::include_header_into_logfile("Changing saved pathes to add the minor");
+ my $infoline = "Old pathes:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$followmeinfohash->{'installlogdir'}: $followmeinfohash->{'installlogdir'}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$installer::globals::unpackpath: $installer::globals::unpackpath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$installer::globals::idttemplatepath: $installer::globals::idttemplatepath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$installer::globals::idtlanguagepath: $installer::globals::idtlanguagepath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "Include pathes:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ foreach my $path ( @{$followmeinfohash->{'includepatharray'}} ) { push( @installer::globals::logfileinfo, $path); }
+
+ foreach $onepath ( @pathnames )
+ {
+ my $oldvalue = $installer::globals::separator . $onepath . $installer::globals::separator;
+ my $newvalue = $installer::globals::separator . $onepath . "\." . $installer::globals::lastminor . $installer::globals::separator;
+
+ if (( $followmeinfohash->{'installlogdir'} =~ /\Q$oldvalue\E/ ) && ( ! ( $followmeinfohash->{'installlogdir'} =~ /\Q$srcpath\E/ ))) { $followmeinfohash->{'installlogdir'} =~ s/\Q$oldvalue\E/$newvalue/; }
+ if (( $installer::globals::unpackpath =~ /\Q$oldvalue\E/ ) && ( ! ( $installer::globals::unpackpath =~ /\Q$srcpath\E/ ))) { $installer::globals::unpackpath =~ s/\Q$oldvalue\E/$newvalue/; }
+ if (( $installer::globals::idttemplatepath =~ /\Q$oldvalue\E/ ) && ( ! ( $installer::globals::idttemplatepath =~ /\Q$srcpath\E/ ))) { $installer::globals::idttemplatepath =~ s/\Q$oldvalue\E/$newvalue/; }
+ if (( $installer::globals::idtlanguagepath =~ /\Q$oldvalue\E/ ) && ( ! ( $installer::globals::idtlanguagepath =~ /\Q$srcpath\E/ ))) { $installer::globals::idtlanguagepath =~ s/\Q$oldvalue\E/$newvalue/; }
+ foreach my $path ( @{$followmeinfohash->{'includepatharray'}} ) { if (( $path =~ /\Q$oldvalue\E/ ) && ( ! ( $path =~ /\Q$srcpath\E/ ))) { $path =~ s/\Q$oldvalue\E/$newvalue/; } }
+
+ # Checking for the end of the path
+ $oldvalue = $installer::globals::separator . $onepath;
+ $newvalue = $installer::globals::separator . $onepath . "\." . $installer::globals::lastminor;
+
+ if (( $followmeinfohash->{'installlogdir'} =~ /\Q$oldvalue\E\s*$/ ) && ( ! ( $followmeinfohash->{'installlogdir'} =~ /\Q$srcpath\E/ ))) { $followmeinfohash->{'installlogdir'} =~ s/\Q$oldvalue\E\s*$/$newvalue/; }
+ if (( $installer::globals::unpackpath =~ /\Q$oldvalue\E\s*$/ ) && ( ! ( $installer::globals::unpackpath =~ /\Q$srcpath\E/ ))) { $installer::globals::unpackpath =~ s/\Q$oldvalue\E\s*$/$newvalue/; }
+ if (( $installer::globals::idttemplatepath =~ /\Q$oldvalue\E\s*$/ ) && ( ! ( $installer::globals::idttemplatepath =~ /\Q$srcpath\E/ ))) { $installer::globals::idttemplatepath =~ s/\Q$oldvalue\E\s*$/$newvalue/; }
+ if (( $installer::globals::idtlanguagepath =~ /\Q$oldvalue\E\s*$/ ) && ( ! ( $installer::globals::idtlanguagepath =~ /\Q$srcpath\E/ ))) { $installer::globals::idtlanguagepath =~ s/\Q$oldvalue\E\s*$/$newvalue/; }
+ foreach my $path ( @{$followmeinfohash->{'includepatharray'}} )
+ {
+ if (( $path =~ /\Q$oldvalue\E\s*$/ ) && ( ! ( $path =~ /\Q$srcpath\E/ )))
+ {
+ $path =~ s/\Q$oldvalue\E\s*$/$newvalue/;
+ $path = $path . "\n";
+ }
+ }
+ }
+
+ # And now can follow the replacement for the source path "src". Subdirs like "bin" in the source tree
+ # must not get the minor. This is instead "src.m9/instsetoo_native/common.pro/bin/..."
+ # Directory "src" can never be the end of the path
+
+ my $newsrcpath = $installer::globals::separator . $sourcename . "\." . $installer::globals::lastminor . $installer::globals::separator;
+
+ if ( $followmeinfohash->{'installlogdir'} =~ /\Q$srcpath\E/ ) { $followmeinfohash->{'installlogdir'} =~ s/\Q$srcpath\E/$newsrcpath/; }
+ if ( $installer::globals::unpackpath =~ /\Q$srcpath\E/ ) { $installer::globals::unpackpath =~ s/\Q$srcpath\E/$newsrcpath/; }
+ if ( $installer::globals::idttemplatepath =~ /\Q$srcpath\E/ ) { $installer::globals::idttemplatepath =~ s/\Q$srcpath\E/$newsrcpath/; }
+ if ( $installer::globals::idtlanguagepath =~ /\Q$srcpath\E/ ) { $installer::globals::idtlanguagepath =~ s/\Q$srcpath\E/$newsrcpath/; }
+ foreach my $path ( @{$followmeinfohash->{'includepatharray'}} ) { if ( $path =~ /\Q$srcpath\E/ ) { $path =~ s/\Q$srcpath\E/$newsrcpath/; } }
+
+ $infoline = "\nNew pathes:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$followmeinfohash->{'installlogdir'}: $followmeinfohash->{'installlogdir'}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$installer::globals::unpackpath: $installer::globals::unpackpath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$installer::globals::idttemplatepath: $installer::globals::idttemplatepath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "\$installer::globals::idtlanguagepath: $installer::globals::idtlanguagepath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "Include pathes:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ foreach my $path ( @{$followmeinfohash->{'includepatharray'}} ) { push( @installer::globals::logfileinfo, $path); }
+}
+
+#############################################
+# Setting the name of the log file
+#############################################
+
+sub setlogfilename
+{
+ if ( $installer::globals::dosign ) { $installer::globals::logfilename = "sign_and_download_" . $installer::globals::logfilename; }
+ else { $installer::globals::logfilename = "download_" . $installer::globals::logfilename; }
+ # reset the log file
+ @installer::globals::logfileinfo = ();
+}
+
+#########################################################
+# Checking, if this is a task in a cws or
+# on the master. Simple check of naming schema:
+# CWS: follow_me_DEV300_m40_de.log
+# Master: follow_me_4_DEV300_m40_en-US.log
+#########################################################
+
+sub check_cws_build
+{
+ my ( $filename ) = @_;
+
+ my $iscws = 1;
+
+ if ( $filename =~ /follow_me_\d+_/ ) { $iscws = 0; }
+ # if ( $filename =~ /log_\d+_/ ) { $iscws = 0; }
+
+ return $iscws;
+}
+
+#########################################################
+# Reading a specific key from a follow-me file
+#########################################################
+
+sub get_property_from_file
+{
+ my ($followmefile, $key) = @_;
+
+ my $value = "";
+
+ my $filecontent = installer::files::read_file($followmefile);
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( ${$filecontent}[$i] =~ /^\s*\Q$key\E\s*\:\s*(.*?)\s*$/ )
+ {
+ $value = $1;
+ last;
+ }
+ }
+
+ return $value;
+}
+
+#########################################################
+# Publishing the content of the product list
+#########################################################
+
+sub publishproductlist
+{
+ my ($infofilelist) = @_;
+
+ installer::logger::print_message( "\n... found products: ...\n" );
+
+ for ( my $i = 0; $i <= $#{$infofilelist}; $i++ )
+ {
+ my $onefile = ${$infofilelist}[$i];
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$onefile);
+ installer::logger::print_message( "...... $onefile ...\n" );
+ }
+
+ installer::logger::print_message( "\n" );
+}
+
+#########################################################
+# Filtering all files, that have correct minor
+# and work stamp.
+# Master: follow_me_4_DEV300_m40_en-US.log
+#########################################################
+
+sub filter_all_files_with_correct_settings
+{
+ my ($allfollowmefiles) = @_;
+
+ my @allfiles = ();
+ my @allfiles2 = ();
+ my $maxhash = ();
+
+ my $minor = "";
+ my $workstamp = "";
+
+ if ( $ENV{'WORK_STAMP'} ) { $workstamp = $ENV{'WORK_STAMP'}; }
+ if ( $ENV{'UPDMINOR'} ) { $minor = $ENV{'UPDMINOR'}; }
+
+ if ( $minor eq "" ) { installer::exiter::exit_program("ERROR: Environment variable \"UPDMINOR\" not set!", "filter_all_files_with_correct_settings"); }
+ if ( $workstamp eq "" ) { installer::exiter::exit_program("ERROR: Environment variable \"WORK_STAMP\" not set!", "filter_all_files_with_correct_settings"); }
+
+ foreach my $onefile ( @{$allfollowmefiles} )
+ {
+ if (( $onefile =~ /_\Q$minor\E_/i ) && ( $onefile =~ /_\Q$workstamp\E_/i ))
+ {
+ push(@allfiles, $onefile);
+
+ # also collecting maximum hash
+
+ if ( $onefile =~ /follow_me_(\d+)_\Q$workstamp\E_\Q$minor\E_([-\w]+)\.log\s*$/i )
+ {
+ my $sequence = $1;
+ my $lang = $2;
+
+ if (( ! exists($maxhash{$lang})) || ( $maxhash{$lang} < $sequence )) { $maxhash{$lang} = $sequence; }
+ }
+ }
+ }
+
+ # second run, because of sequence numbers
+
+ foreach my $onefile ( @allfiles )
+ {
+ if ( $onefile =~ /follow_me_(\d+)_\Q$workstamp\E_\Q$minor\E_([-\w]+)\.log\s*$/i )
+ {
+ my $sequence = $1;
+ my $lang = $2;
+
+ if ( $sequence == $maxhash{$lang} ) { push(@allfiles2, $onefile); }
+ }
+ }
+
+ return ( \@allfiles2 );
+}
+
+#########################################################
+# Creating a list of products, that need to be signed
+# or for which download sets need to be created.
+#########################################################
+
+sub createproductlist
+{
+ # If "-d" specifies an installation set, there is only one product
+
+ my @infofilelist = ();
+ my @infofilelist2 = ();
+
+ if ( -f $installer::globals::followmeinfofilename )
+ {
+ push(@infofilelist, $installer::globals::followmeinfofilename);
+ # Saving info, that this is a file
+ $installer::globals::followme_from_directory = 0;
+ }
+ elsif ( -d $installer::globals::followmeinfofilename )
+ {
+ installer::logger::print_message( "\n... reading directory: $installer::globals::followmeinfofilename ...\n" );
+ $installer::globals::followmeinfofilename =~ s/$installer::globals::separator\s*$//;
+ my $allfollowmefiles = installer::systemactions::find_file_with_file_extension("log", $installer::globals::followmeinfofilename);
+
+ if ( ! ( $#{$allfollowmefiles} > -1 ))
+ {
+ installer::logger::print_error( "Error: Nothing to do! No follow-me file in directory \"$installer::globals::followmeinfofilename\"!.\n" );
+ usage();
+ exit(-1);
+ }
+
+ # Saving info, that this is a directory
+ $installer::globals::followme_from_directory = 1;
+
+ # Collect all possible installation sets
+ # CWS: All installation sets
+ # Master: All installation sets with same major, minor and buildid. Additionally using the highest number.
+
+ my $iscws = check_cws_build(${$allfollowmefiles}[0]);
+
+ if ( $iscws )
+ {
+ # Simply read all follow-me files and check existence of installation sets
+ foreach my $onefile ( @{$allfollowmefiles} )
+ {
+ my $fullfilename = $installer::globals::followmeinfofilename . $installer::globals::separator . $onefile;
+ my $installdir = get_property_from_file($fullfilename, "finalinstalldir");
+ if (( $installdir ne "" ) && ( -d $installdir )) { push(@infofilelist2, $fullfilename); }
+ }
+ }
+ else
+ {
+ $allfollowmefiles = filter_all_files_with_correct_settings($allfollowmefiles);
+
+ foreach my $onefile ( @{$allfollowmefiles} )
+ {
+ my $fullfilename = $installer::globals::followmeinfofilename . $installer::globals::separator . $onefile;
+ # Check, if installation set still exists
+ my $installdir = get_property_from_file($fullfilename, "finalinstalldir");
+ if (( $installdir ne "" ) && ( -d $installdir )) { push(@infofilelist2, $fullfilename); }
+ }
+ }
+
+ # Removing all files, starting with "follow_me_success_" in their names. This have already been used successfully.
+
+ foreach my $onefile ( @infofilelist2 )
+ {
+ if ( $onefile =~ /follow_me_success_/ ) { next; }
+ push(@infofilelist, $onefile);
+ }
+
+ # Checking, if there is content in the list
+ if ( ! ( $#infofilelist > -1 ))
+ {
+ installer::logger::print_error( "Error: Nothing to do! No installation set found for follow-me files in directory \"$installer::globals::followmeinfofilename\"!.\n" );
+ usage();
+ exit(-1);
+ }
+ }
+ else
+ {
+ installer::logger::print_error( "Error: Nothing to do! \"$installer::globals::followmeinfofilename\" is no file and no directory (-d).\n" );
+ usage();
+ exit(-1);
+ }
+
+ return \@infofilelist;
+}
+
+#############################################
+# Logging the content of the download hash
+#############################################
+
+sub logfollowmeinfohash
+{
+ my ( $followmehash ) = @_;
+
+ print "\n*****************************************\n";
+ print "Content of follow-me info file:\n";
+ print "finalinstalldir: $followmehash->{'finalinstalldir'}\n";
+ print "downloadname: $followmehash->{'downloadname'}\n";
+ print "languagestring: $followmehash->{'languagestring'}\n";
+ foreach my $lang ( @{$followmehash->{'languagesarray'}} ) { print "languagesarray: $lang\n"; }
+ foreach my $path ( @{$followmehash->{'includepatharray'}} ) { print "includepatharray: $path"; }
+ foreach my $key ( sort keys %{$followmehash->{'allvariableshash'}} ) { print "allvariableshash: $key : $followmehash->{'allvariableshash'}->{$key}\n"; }
+}
+
+########################################################################
+# Renaming the follow me info file, if it was successfully used.
+# This can only be done, if the parameter "-d" was used with a
+# directory, not a name. In this case the repeated use of parameter
+# "-d" with this directory has to ignore this already successfully
+# used file.
+########################################################################
+
+sub rename_followme_infofile
+{
+ my ( $filename ) = @_;
+
+ my $newfilename = $filename;
+ $newfilename =~ s/follow_me_/follow_me_success_/; # including "_success" after "follow_me"
+
+ if ( $filename ne $newfilename )
+ {
+ my $returnvalue = rename($filename, $newfilename);
+ if ( $returnvalue ) { installer::logger::print_message( "\n... renamed file \"$filename\" to \"$newfilename\" ...\n" ); }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/installer/environment.pm b/solenv/bin/modules/installer/environment.pm
new file mode 100644
index 000000000000..c0d166081032
--- /dev/null
+++ b/solenv/bin/modules/installer/environment.pm
@@ -0,0 +1,139 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::environment;
+
+use installer::exiter;
+use installer::globals;
+
+######################################################
+# Create path variables from environment variables
+######################################################
+
+sub create_pathvariables
+{
+ my ($environment) = @_;
+
+ my %variables = ();
+
+ # The following variables are needed in the path file list
+ # solarpath, solarenvpath, solarcommonpath, os, osdef, pmiscpath
+
+ my $solarpath = $environment->{'SOLARVERSION'} . $installer::globals::separator . $installer::globals::compiler . $installer::globals::productextension;
+ $variables{'solarpath'} = $solarpath;
+
+ my $solarcommonpath = $environment->{'SOLARVERSION'} . $installer::globals::separator . "common" . $installer::globals::productextension;
+ # my $solarcommonpath = $environment->{'SOLARVERSION'} . $installer::globals::separator . $environment->{'COMMON_OUTDIR'} . $installer::globals::productextension;
+ $variables{'solarcommonpath'} = $solarcommonpath;
+
+ my $osdef = lc($environment->{'GUI'});
+ $variables{'osdef'} = $osdef;
+
+ $variables{'os'} = $installer::globals::compiler;
+
+ my $solarenvpath = "";
+
+ if ( $ENV{'SO_PACK'} ) { $solarenvpath = $ENV{'SO_PACK'}; }
+ # overriding with STAR_INSTPATH, if set
+ if ( $ENV{'STAR_INSTPATH'} ) { $solarenvpath = $ENV{'STAR_INSTPATH'}; }
+
+ $variables{'solarenvpath'} = $solarenvpath;
+
+ my $localpath = $environment->{'LOCAL_OUT'};
+ $variables{'localpath'} = $localpath;
+
+ my $localcommonpath = $environment->{'LOCAL_COMMON_OUT'};
+ $variables{'localcommonpath'} = $localcommonpath;
+
+ my $platformname = $environment->{'OUTPATH'};
+ $variables{'platformname'} = $platformname;
+
+ return \%variables;
+}
+
+##################################################
+# Replacing tilde in pathes, because of
+# problem with deep recursion (task 104830)
+##################################################
+
+sub check_tilde_in_directory
+{
+ if ( $ENV{'HOME'} )
+ {
+ my $home = $ENV{'HOME'};
+ $home =~ s/\Q$installer::globals::separator\E\s*$//;
+ $installer::globals::localinstalldir =~ s/~/$home/;
+ my $infoline = "Info: Changing LOCALINSTALLDIR to $installer::globals::localinstalldir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ # exit, because "~" is not allowed, if HOME is not set
+ my $infoline = "ERROR: If \"~\" is used in \"LOCALINSTALLDIR\", environment variable \"HOME\" needs to be defined!\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: If \"~\" is used in \"LOCALINSTALLDIR\", environment variable \"HOME\" needs to be defined!", "check_tilde_in_directory");
+ }
+}
+
+##################################################
+# Setting some fundamental global variables.
+# All these variables can be overwritten
+# by parameters.
+##################################################
+
+sub set_global_environment_variables
+{
+ my ( $environment ) = @_;
+
+ $installer::globals::build = $environment->{'WORK_STAMP'};
+ # $installer::globals::minor = $environment->{'UPDMINOR'};
+ $installer::globals::compiler = $environment->{'OUTPATH'};
+
+ if ( $ENV{'UPDMINOR'} ) { $installer::globals::minor = $ENV{'UPDMINOR'}; }
+ if ( $ENV{'LAST_MINOR'} ) { $installer::globals::lastminor = $ENV{'LAST_MINOR'}; }
+
+ if ( $ENV{'PROEXT'} ) { $installer::globals::pro = 1; }
+
+ if ( $ENV{'VERBOSE'} && ( (lc $ENV{'VERBOSE'}) eq "false" ) ) { $installer::globals::quiet = 1; }
+ if ( $ENV{'PREPARE_WINPATCH'} ) { $installer::globals::prepare_winpatch = 1; }
+ if ( $ENV{'PREVIOUS_IDT_DIR'} ) { $installer::globals::previous_idt_dir = $ENV{'PREVIOUS_IDT_DIR'}; }
+ if ( $ENV{'LOCALINSTALLDIR'} ) { $installer::globals::localinstalldir = $ENV{'LOCALINSTALLDIR'}; }
+ if ( $ENV{'LOCALUNPACKDIR'} ) { $installer::globals::localunpackdir = $ENV{'LOCALUNPACKDIR'}; }
+ if ( $ENV{'MAX_LANG_LENGTH'} ) { $installer::globals::max_lang_length = $ENV{'MAX_LANG_LENGTH'}; }
+
+ if ( $ENV{'SOLAR_JAVA'} ) { $installer::globals::solarjavaset = 1; }
+ if ( $ENV{'RPM'} ) { $installer::globals::rpm = $ENV{'RPM'}; }
+ if ( $ENV{'DONTCOMPRESS'} ) { $installer::globals::solarisdontcompress = 1; }
+ if ( $ENV{'IGNORE_ERROR_IN_LOGFILE'} ) { $installer::globals::ignore_error_in_logfile = 1; }
+ if (( $ENV{'DISABLE_STRIP'} ) && ( $ENV{'DISABLE_STRIP'} ne '' )) { $installer::globals::strip = 0; }
+
+ if ( $installer::globals::localinstalldir ) { $installer::globals::localinstalldirset = 1; }
+ # Special handling, if LOCALINSTALLDIR contains "~" in the path
+ if ( $installer::globals::localinstalldir =~ /^\s*\~/ ) { check_tilde_in_directory(); }
+}
+
+1;
diff --git a/solenv/bin/modules/installer/epmfile.pm b/solenv/bin/modules/installer/epmfile.pm
new file mode 100644
index 000000000000..8b828b85335f
--- /dev/null
+++ b/solenv/bin/modules/installer/epmfile.pm
@@ -0,0 +1,3454 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::epmfile;
+
+use Cwd;
+use installer::converter;
+use installer::existence;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::packagelist;
+use installer::pathanalyzer;
+use installer::remover;
+use installer::scriptitems;
+use installer::systemactions;
+use installer::worker;
+use POSIX;
+
+############################################################################
+# Reading the package map to find Solaris package names for
+# the corresponding abbreviations
+############################################################################
+
+sub read_packagemap
+{
+ my ($allvariables, $includepatharrayref, $languagesarrayref) = @_;
+
+ my $packagemapname = "";
+ if ( $allvariables->{'PACKAGEMAP'} ) { $packagemapname = $allvariables->{'PACKAGEMAP'}; }
+ if ( $packagemapname eq "" ) { installer::exiter::exit_program("ERROR: Property PACKAGEMAP must be defined!", "read_packagemap"); }
+
+ my $infoline = "\n\nCollected abbreviations and package names:\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ # Can be a comma separated list. All files have to be found in include pathes
+ my $allpackagemapnames = installer::converter::convert_stringlist_into_hash(\$packagemapname, ",");
+ foreach my $onepackagemapname ( keys %{$allpackagemapnames} )
+ {
+ my $packagemapref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$onepackagemapname, $includepatharrayref, 0);
+
+ if ( $$packagemapref eq "" ) { installer::exiter::exit_program("ERROR: Could not find package map file \"$onepackagemapname\" (propery PACKAGEMAP)!", "read_packagemap"); }
+
+ my $packagemapcontent = installer::files::read_file($$packagemapref);
+
+ for ( my $i = 0; $i <= $#{$packagemapcontent}; $i++ )
+ {
+ my $line = ${$packagemapcontent}[$i];
+
+ if ( $line =~ /^\s*\#/ ) { next; } # comment line
+ if ( $line =~ /^\s*$/ ) { next; } # empty line
+
+ if ( $line =~ /^\s*(.*?)\t(.*?)\s*$/ )
+ {
+ my $abbreviation = $1;
+ my $packagename = $2;
+ installer::packagelist::resolve_packagevariables(\$abbreviation, $allvariables, 0);
+ installer::packagelist::resolve_packagevariables(\$packagename, $allvariables, 0);
+
+ # Special handling for language strings %LANGUAGESTRING
+
+ if (( $abbreviation =~ /\%LANGUAGESTRING/ ) || ( $packagename =~ /\%LANGUAGESTRING/ ))
+ {
+ foreach my $onelang ( @{$languagesarrayref} )
+ {
+ my $local_abbreviation = $abbreviation;
+ my $local_packagename = $packagename;
+ $local_abbreviation =~ s/\%LANGUAGESTRING/$onelang/g;
+ $local_packagename =~ s/\%LANGUAGESTRING/$onelang/g;
+
+ # Logging all abbreviations and packagenames
+ $infoline = "$onelang : $local_abbreviation : $local_packagename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ if ( exists($installer::globals::dependfilenames{$local_abbreviation}) )
+ {
+ installer::exiter::exit_program("ERROR: Packagename for Solaris package $local_abbreviation already defined ($installer::globals::dependfilenames{$local_abbreviation})!", "read_packagemap");
+ }
+ else
+ {
+ $installer::globals::dependfilenames{$local_abbreviation} = $local_packagename;
+ }
+ }
+ }
+ else
+ {
+ # Logging all abbreviations and packagenames
+ $infoline = "$abbreviation : $packagename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ if ( exists($installer::globals::dependfilenames{$abbreviation}) )
+ {
+ installer::exiter::exit_program("ERROR: Packagename for Solaris package $abbreviation already defined ($installer::globals::dependfilenames{$abbreviation})!", "read_packagemap");
+ }
+ else
+ {
+ $installer::globals::dependfilenames{$abbreviation} = $packagename;
+ }
+ }
+ }
+ else
+ {
+ my $errorline = $i + 1;
+ installer::exiter::exit_program("ERROR: Wrong syntax in file \"$onepackagemapname\" (line $errorline)!", "read_packagemap");
+ }
+ }
+ }
+
+ $infoline = "\n\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+############################################################################
+# The header file contains the strings for the epm header in all languages
+############################################################################
+
+sub get_string_from_headerfile
+{
+ my ($searchstring, $language, $fileref) = @_;
+
+ my $returnstring = "";
+ my $onestring = "";
+ my $englishstring = "";
+ my $foundblock = 0;
+ my $foundstring = 0;
+ my $foundenglishstring = 0;
+ my $englishidentifier = "01";
+
+ $searchstring = "[" . $searchstring . "]";
+
+ for ( my $i = 0; $i <= $#{$fileref}; $i++ )
+ {
+ my $line = ${$fileref}[$i];
+
+ if ( $line =~ /^\s*\Q$searchstring\E\s*$/ )
+ {
+ $foundblock = 1;
+ my $counter = $i + 1;
+
+ $line = ${$fileref}[$counter];
+
+ # Beginning of the next block oder Dateiende
+
+ while ((!($line =~ /^\s*\[\s*\w+\s*\]\s*$/ )) && ( $counter <= $#{$fileref} ))
+ {
+ if ( $line =~ /^\s*\Q$language\E\s+\=\s*\"(.*)\"\s*$/ )
+ {
+ $onestring = $1;
+ $foundstring = 1;
+ last;
+ }
+
+ if ( $line =~ /^\s*\Q$englishidentifier\E\s+\=\s*\"(.*)\"\s*$/ )
+ {
+ $englishstring = $1;
+ $foundenglishstring = 1;
+ }
+
+ $counter++;
+ $line = ${$fileref}[$counter];
+ }
+ }
+ }
+
+ if ( $foundstring )
+ {
+ $returnstring = $onestring;
+ }
+ else
+ {
+ if ( $foundenglishstring )
+ {
+ $returnstring = $englishstring;
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: No string found for $searchstring in epm header file (-h)", "get_string_from_headerfile");
+ }
+ }
+
+ return \$returnstring;
+}
+
+##########################################################
+# Filling the epm file with directories, files and links
+##########################################################
+
+sub put_directories_into_epmfile
+{
+ my ($directoriesarrayref, $epmfileref, $allvariables, $packagerootpath) = @_;
+ my $group = "bin";
+
+ if ( $installer::globals::islinuxbuild )
+ {
+ $group = "root";
+ }
+
+ for ( my $i = 0; $i <= $#{$directoriesarrayref}; $i++ )
+ {
+ my $onedir = ${$directoriesarrayref}[$i];
+ my $dir = "";
+
+ if ( $onedir->{'Dir'} ) { $dir = $onedir->{'Dir'}; }
+
+ # if (!($dir =~ /\bPREDEFINED_/ ))
+ if ((!($dir =~ /\bPREDEFINED_/ )) || ( $dir =~ /\bPREDEFINED_PROGDIR\b/ ))
+ {
+ my $hostname = $onedir->{'HostName'};
+
+ # not including simple directory "/opt"
+ # if (( $allvariables->{'SETSTATICPATH'} ) && ( $hostname eq $packagerootpath )) { next; }
+
+ my $line = "d 755 root $group $hostname -\n";
+
+ push(@{$epmfileref}, $line)
+ }
+ }
+}
+
+sub put_files_into_epmfile
+{
+ my ($filesinproductarrayref, $epmfileref) = @_;
+
+ for ( my $i = 0; $i <= $#{$filesinproductarrayref}; $i++ )
+ {
+ my $onefile = ${$filesinproductarrayref}[$i];
+
+ my $unixrights = $onefile->{'UnixRights'};
+ my $destination = $onefile->{'destination'};
+ my $sourcepath = $onefile->{'sourcepath'};
+
+ my $filetype = "f";
+ my $styles = "";
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+ if ( $styles =~ /\bCONFIGFILE\b/ ) { $filetype = "c"; }
+
+ my $group = "bin";
+ if ( $installer::globals::islinuxbuild ) { $group = "root"; }
+ if (( $installer::globals::issolarisbuild ) && ( $onefile->{'SolarisGroup'} )) { $group = $onefile->{'SolarisGroup'}; }
+
+ my $line = "$filetype $unixrights root $group $destination $sourcepath\n";
+
+ push(@{$epmfileref}, $line);
+ }
+}
+
+sub put_links_into_epmfile
+{
+ my ($linksinproductarrayref, $epmfileref) = @_;
+ my $group = "bin";
+
+ if ( $installer::globals::islinuxbuild )
+ {
+ $group = "root";
+ }
+
+
+ for ( my $i = 0; $i <= $#{$linksinproductarrayref}; $i++ )
+ {
+ my $onelink = ${$linksinproductarrayref}[$i];
+ my $destination = $onelink->{'destination'};
+ my $destinationfile = $onelink->{'destinationfile'};
+
+ my $line = "l 000 root $group $destination $destinationfile\n";
+
+ push(@{$epmfileref}, $line)
+ }
+}
+
+sub put_unixlinks_into_epmfile
+{
+ my ($unixlinksinproductarrayref, $epmfileref) = @_;
+ my $group = "bin";
+
+ if ( $installer::globals::islinuxbuild ) { $group = "root"; }
+
+ for ( my $i = 0; $i <= $#{$unixlinksinproductarrayref}; $i++ )
+ {
+ my $onelink = ${$unixlinksinproductarrayref}[$i];
+ my $destination = $onelink->{'destination'};
+ my $target = $onelink->{'Target'};
+
+ my $line = "l 000 root $group $destination $target\n";
+
+ push(@{$epmfileref}, $line)
+ }
+}
+
+###############################################
+# Creating epm header file
+###############################################
+
+sub create_epm_header
+{
+ my ($variableshashref, $filesinproduct, $languagesref, $onepackage) = @_;
+
+ my @epmheader = ();
+
+ my ($licensefilename, $readmefilename);
+
+ my $foundlicensefile = 0;
+ my $foundreadmefile = 0;
+
+ my $line = "";
+ my $infoline = "";
+
+ # %product OpenOffice.org Software
+ # %version 2.0
+ # %description A really great software
+ # %copyright 1999-2003 by OOo
+ # %vendor OpenOffice.org
+ # %license /test/replace/01/LICENSE01
+ # %readme /test/replace/01/README01
+ # %requires foo
+ # %provides bar
+
+ # The first language in the languages array determines the language of license and readme file
+
+ my $searchlanguage = ${$languagesref}[0];
+
+ # using the description for the %product line in the epm list file
+
+ my $productnamestring = $onepackage->{'description'};
+ installer::packagelist::resolve_packagevariables(\$productnamestring, $variableshashref, 0);
+ if ( $variableshashref->{'PRODUCTEXTENSION'} ) { $productnamestring = $productnamestring . " " . $variableshashref->{'PRODUCTEXTENSION'}; }
+
+ $line = "%product" . " " . $productnamestring . "\n";
+ push(@epmheader, $line);
+
+ # Determining the release version
+ # This release version has to be listed in the line %version : %version versionnumber releasenumber
+
+ # if ( $variableshashref->{'PACKAGEVERSION'} ) { $installer::globals::packageversion = $variableshashref->{'PACKAGEVERSION'}; }
+ if ( ! $onepackage->{'packageversion'} ) { installer::exiter::exit_program("ERROR: No packageversion defined for package: $onepackage->{'module'}!", "create_epm_header"); }
+ $installer::globals::packageversion = $onepackage->{'packageversion'};
+ installer::packagelist::resolve_packagevariables(\$installer::globals::packageversion, $variableshashref, 0);
+ if ( $variableshashref->{'PACKAGEREVISION'} ) { $installer::globals::packagerevision = $variableshashref->{'PACKAGEREVISION'}; }
+
+ $line = "%version" . " " . $installer::globals::packageversion . "\n";
+ push(@epmheader, $line);
+
+ $line = "%release" . " " . $installer::globals::packagerevision . "\n";
+ if ( $installer::globals::islinuxrpmbuild ) { $line = "%release" . " " . $installer::globals::buildid . "\n"; }
+ push(@epmheader, $line);
+
+ # Description, Copyright and Vendor are multilingual and are defined in
+ # the string file for the header file ($headerfileref)
+
+ my $descriptionstring = $onepackage->{'description'};
+ installer::packagelist::resolve_packagevariables(\$descriptionstring, $variableshashref, 0);
+ $line = "%description" . " " . $descriptionstring . "\n";
+ push(@epmheader, $line);
+
+ my $copyrightstring = $onepackage->{'copyright'};
+ installer::packagelist::resolve_packagevariables(\$copyrightstring, $variableshashref, 0);
+ $line = "%copyright" . " " . $copyrightstring . "\n";
+ push(@epmheader, $line);
+
+ my $vendorstring = $onepackage->{'vendor'};
+ installer::packagelist::resolve_packagevariables(\$vendorstring, $variableshashref, 0);
+ $line = "%vendor" . " " . $vendorstring . "\n";
+ push(@epmheader, $line);
+
+ # License and Readme file can be included automatically from the file list
+
+ if ( $installer::globals::iswindowsbuild )
+ {
+ $licensefilename = "license.txt";
+ $readmefilename = "readme.txt";
+ }
+ else
+ {
+ $licensefilename = "LICENSE";
+ $readmefilename = "README";
+ }
+
+ if (( $installer::globals::languagepack ) # in language packs the files LICENSE and README are removed, because they are not language specific
+ || ( $variableshashref->{'NO_README_IN_ROOTDIR'} ))
+ {
+ if ( $installer::globals::iswindowsbuild )
+ {
+ $licensefilename = "license_$searchlanguage.txt";
+ $readmefilename = "readme_$searchlanguage.txt";
+ }
+ else
+ {
+ $licensefilename = "LICENSE_$searchlanguage";
+ $readmefilename = "README_$searchlanguage";
+ }
+ }
+
+ my $license_in_package_defined = 0;
+
+ if ( $installer::globals::issolarisbuild )
+ {
+ if ( $onepackage->{'solariscopyright'} )
+ {
+ $licensefilename = $onepackage->{'solariscopyright'};
+ $license_in_package_defined = 1;
+ }
+ }
+
+ # Process for Linux packages, in which only a very basic license file is
+ # included into the package.
+
+ if ( $installer::globals::islinuxbuild )
+ {
+ if ( $variableshashref->{'COPYRIGHT_INTO_LINUXPACKAGE'} )
+ {
+ $licensefilename = "linuxcopyrightfile";
+ $license_in_package_defined = 1;
+ }
+ }
+ # searching for and readme file
+
+ for ( my $i = 0; $i <= $#{$filesinproduct}; $i++ )
+ {
+ my $onefile = ${$filesinproduct}[$i];
+ my $filename = $onefile->{'Name'};
+ if ( $filename eq $readmefilename )
+ {
+ $foundreadmefile = 1;
+ $line = "%readme" . " " . $onefile->{'sourcepath'} . "\n";
+ push(@epmheader, $line);
+ last;
+ }
+ }
+
+ # searching for and license file
+
+ if ( $license_in_package_defined )
+ {
+ my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$licensefilename, "" , 0);
+
+ if ( $$fileref eq "" ) { installer::exiter::exit_program("ERROR: Could not find license file $licensefilename (A)!", "create_epm_header"); }
+
+ # Special handling to add the content of the file "license_en-US" to the solaris copyrightfile. But not for all products
+
+ if (( $installer::globals::issolarispkgbuild ) && ( ! $variableshashref->{'NO_LICENSE_INTO_COPYRIGHT'} ))
+ {
+ if ( ! $installer::globals::englishlicenseset ) { installer::worker::set_english_license() }
+
+ # The location for the new file
+ my $languagestring = "";
+ for ( my $i = 0; $i <= $#{$languagesref}; $i++ ) { $languagestring = $languagestring . "_" . ${$languagesref}[$i]; }
+ $languagestring =~ s/^\s*_//;
+
+ my $copyrightdir = installer::systemactions::create_directories("copyright", \$languagestring);
+
+ my $copyrightfile = installer::files::read_file($$fileref);
+
+ # Adding license content to copyright file
+ push(@{$copyrightfile}, "\n");
+ for ( my $i = 0; $i <= $#{$installer::globals::englishlicense}; $i++ ) { push(@{$copyrightfile}, ${$installer::globals::englishlicense}[$i]); }
+
+ # New destination for $$fileref
+ $$fileref = $copyrightdir . $installer::globals::separator . "solariscopyrightfile_" . $onepackage->{'module'};
+ if ( -f $$fileref ) { unlink $$fileref; }
+ installer::files::save_file($$fileref, $copyrightfile);
+ }
+
+ $infoline = "Using license file: \"$$fileref\"!\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ $foundlicensefile = 1;
+ $line = "%license" . " " . $$fileref . "\n";
+ push(@epmheader, $line);
+ }
+ else
+ {
+ for ( my $i = 0; $i <= $#{$filesinproduct}; $i++ )
+ {
+ my $onefile = ${$filesinproduct}[$i];
+ my $filename = $onefile->{'Name'};
+
+ if ( $filename eq $licensefilename )
+ {
+ $foundlicensefile = 1;
+ $line = "%license" . " " . $onefile->{'sourcepath'} . "\n";
+ push(@epmheader, $line);
+ last;
+ }
+ }
+ }
+
+ if (!($foundlicensefile))
+ {
+ installer::exiter::exit_program("ERROR: Could not find license file $licensefilename (B)", "create_epm_header");
+ }
+
+ if (!($foundreadmefile))
+ {
+ installer::exiter::exit_program("ERROR: Could not find readme file $readmefilename (C)", "create_epm_header");
+ }
+
+ # including %replaces
+
+ my $replaces = "";
+
+ if (( $installer::globals::issolarispkgbuild ) && ( ! $installer::globals::patch ))
+ {
+ $replaces = "solarisreplaces"; # the name in the packagelist
+ }
+ elsif (( $installer::globals::islinuxbuild ) && ( ! $installer::globals::patch ))
+ {
+ $replaces = "linuxreplaces"; # the name in the packagelist
+ }
+
+ if (( $replaces ) && ( ! $installer::globals::patch ))
+ {
+ if ( $onepackage->{$replaces} )
+ {
+ my $replacesstring = $onepackage->{$replaces};
+
+ my $allreplaces = installer::converter::convert_stringlist_into_array(\$replacesstring, ",");
+
+ for ( my $i = 0; $i <= $#{$allreplaces}; $i++ )
+ {
+ my $onereplaces = ${$allreplaces}[$i];
+ $onereplaces =~ s/\s*$//;
+ installer::packagelist::resolve_packagevariables(\$onereplaces, $variableshashref, 1);
+ if ( $installer::globals::linuxlinkrpmprocess ) { $onereplaces = $onereplaces . "u"; }
+ $line = "%replaces" . " " . $onereplaces . "\n";
+ push(@epmheader, $line);
+
+ # Force the openofficeorg packages to get removed,
+ # see http://www.debian.org/doc/debian-policy/ch-relationships.html
+ # 7.5.2 Replacing whole packages, forcing their removal
+
+ if ( $installer::globals::debian )
+ {
+ $line = "%incompat" . " " . $onereplaces . "\n";
+ push(@epmheader, $line);
+ }
+ }
+
+ if ( $installer::globals::debian && $variableshashref->{'UNIXPRODUCTNAME'} eq 'openoffice.org' )
+ {
+ $line = "%provides" . " openoffice.org-unbundled\n";
+ push(@epmheader, $line);
+ $line = "%incompat" . " openoffice.org-bundled\n";
+ push(@epmheader, $line);
+ }
+ }
+ }
+
+ # including the directives for %requires and %provides
+
+ my $provides = "";
+ my $requires = "";
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ $provides = "solarisprovides"; # the name in the packagelist
+ $requires = "solarisrequires"; # the name in the packagelist
+ }
+ elsif ( $installer::globals::isfreebsdpkgbuild )
+ {
+ $provides = "freebsdprovides"; # the name in the packagelist
+ $requires = "freebsdrequires"; # the name in the packagelist
+ }
+ elsif (( $installer::globals::islinuxrpmbuild ) &&
+ ( $installer::globals::patch ) &&
+ ( exists($onepackage->{'linuxpatchrequires'}) ))
+ {
+ $provides = "provides"; # the name in the packagelist
+ $requires = "linuxpatchrequires"; # the name in the packagelist
+ }
+ else
+ {
+ $provides = "provides"; # the name in the packagelist
+ $requires = "requires"; # the name in the packagelist
+ }
+
+ # if ( $installer::globals::patch )
+ # {
+ # $onepackage->{$provides} = "";
+ my $isdict = 0;
+ if ( $onepackage->{'packagename'} =~ /-dict-/ ) { $isdict = 1; }
+
+ # $onepackage->{$requires} = "";
+ # }
+
+ if ( $onepackage->{$provides} )
+ {
+ my $providesstring = $onepackage->{$provides};
+
+ my $allprovides = installer::converter::convert_stringlist_into_array(\$providesstring, ",");
+
+ for ( my $i = 0; $i <= $#{$allprovides}; $i++ )
+ {
+ my $oneprovides = ${$allprovides}[$i];
+ $oneprovides =~ s/\s*$//;
+ installer::packagelist::resolve_packagevariables(\$oneprovides, $variableshashref, 1);
+ if ( $installer::globals::linuxlinkrpmprocess ) { $oneprovides = $oneprovides . "u"; }
+ $line = "%provides" . " " . $oneprovides . "\n";
+ push(@epmheader, $line);
+ }
+ }
+
+ if ( $onepackage->{$requires} )
+ {
+ my $requiresstring = $onepackage->{$requires};
+
+ if ( $installer::globals::add_required_package ) { $requiresstring = $requiresstring . "," . $installer::globals::add_required_package; }
+
+ # The requires string can contain the separator "," in the names (descriptions) of the packages
+ # (that are required for Solaris depend files). Therefore "," inside such a description has to
+ # masked with a backslash.
+ # This masked separator need to be found and replaced, before the stringlist is converted into an array.
+ # This replacement has to be turned back after the array is created.
+
+ my $replacementstring = "COMMAREPLACEMENT";
+ $requiresstring = installer::converter::replace_masked_separator($requiresstring, ",", "$replacementstring");
+
+ my $allrequires = installer::converter::convert_stringlist_into_array(\$requiresstring, ",");
+
+ installer::converter::resolve_masked_separator($allrequires, ",", $replacementstring);
+
+ for ( my $i = 0; $i <= $#{$allrequires}; $i++ )
+ {
+ my $onerequires = ${$allrequires}[$i];
+ $onerequires =~ s/\s*$//;
+ installer::packagelist::resolve_packagevariables2(\$onerequires, $variableshashref, 0, $isdict);
+
+ # Special handling for Solaris. In depend files, the names of the packages are required, not
+ # only the abbreviation. Therefore there is a special syntax for names in packagelist:
+ # solarisrequires = "SUNWcar (Name="Package name of SUNWcar"),SUNWkvm (Name="Package name of SUNWcar"), ...
+ # if ( $installer::globals::issolarispkgbuild )
+ # {
+ # if ( $onerequires =~ /^\s*(.*?)\s+\(\s*Name\s*=\s*\"(.*?)\"\s*\)\s*$/ )
+ # {
+ # $onerequires = $1;
+ # $packagename = $2;
+ # $installer::globals::dependfilenames{$onerequires} = $packagename;
+ # }
+ # }
+
+ $line = "%requires" . " " . $onerequires . "\n";
+ push(@epmheader, $line);
+ }
+ }
+ else
+ {
+ if ( $installer::globals::add_required_package )
+ {
+ my $requiresstring = $installer::globals::add_required_package;
+
+ my $replacementstring = "COMMAREPLACEMENT";
+ $requiresstring = installer::converter::replace_masked_separator($requiresstring, ",", "$replacementstring");
+ my $allrequires = installer::converter::convert_stringlist_into_array(\$requiresstring, ",");
+ installer::converter::resolve_masked_separator($allrequires, ",", $replacementstring);
+
+ for ( my $i = 0; $i <= $#{$allrequires}; $i++ )
+ {
+ my $onerequires = ${$allrequires}[$i];
+ $onerequires =~ s/\s*$//;
+ installer::packagelist::resolve_packagevariables(\$onerequires, $variableshashref, 0);
+
+ # Special handling for Solaris. In depend files, the names of the packages are required, not
+ # only the abbreviation. Therefore there is a special syntax for names in packagelist:
+ # solarisrequires = "SUNWcar (Name="Package name of SUNWcar"),SUNWkvm (Name="Package name of SUNWcar"), ...
+ # if ( $installer::globals::issolarispkgbuild )
+ # {
+ # if ( $onerequires =~ /^\s*(.*?)\s+\(\s*Name\s*=\s*\"(.*?)\"\s*\)\s*$/ )
+ # {
+ # $onerequires = $1;
+ # $packagename = $2;
+ # $installer::globals::dependfilenames{$onerequires} = $packagename;
+ # }
+ # }
+
+ $line = "%requires" . " " . $onerequires . "\n";
+ push(@epmheader, $line);
+ }
+ }
+ }
+
+ return \@epmheader;
+}
+
+#######################################
+# Adding header to epm file
+#######################################
+
+sub adding_header_to_epm_file
+{
+ my ($epmfileref, $epmheaderref) = @_;
+
+ for ( my $i = 0; $i <= $#{$epmheaderref}; $i++ )
+ {
+ push( @{$epmfileref}, ${$epmheaderref}[$i] );
+ }
+
+ push( @{$epmfileref}, "\n\n" );
+}
+
+#####################################################
+# Replace one in shell scripts ( ${VARIABLENAME} )
+#####################################################
+
+sub replace_variable_in_shellscripts
+{
+ my ($scriptref, $variable, $searchstring) = @_;
+
+ for ( my $i = 0; $i <= $#{$scriptref}; $i++ )
+ {
+ ${$scriptref}[$i] =~ s/\$\{$searchstring\}/$variable/g;
+ }
+}
+
+###################################################
+# Replace one in shell scripts ( %VARIABLENAME )
+###################################################
+
+sub replace_percent_variable_in_shellscripts
+{
+ my ($scriptref, $variable, $searchstring) = @_;
+
+ for ( my $i = 0; $i <= $#{$scriptref}; $i++ )
+ {
+ ${$scriptref}[$i] =~ s/\%$searchstring/$variable/g;
+ }
+}
+
+################################################
+# Replacing many variables in shell scripts
+################################################
+
+sub replace_many_variables_in_shellscripts
+{
+ my ($scriptref, $variableshashref) = @_;
+
+ my $key;
+
+ foreach $key (keys %{$variableshashref})
+ {
+ my $value = $variableshashref->{$key};
+ # $value = lc($value); # lowercase !
+ # if ( $installer::globals::issolarisbuild) { $value =~ s/\.org/org/g; } # openofficeorg instead of openoffice.org
+ replace_variable_in_shellscripts($scriptref, $value, $key);
+ }
+}
+
+#######################################
+# Adding shell scripts to epm file
+#######################################
+
+sub adding_shellscripts_to_epm_file
+{
+ my ($epmfileref, $shellscriptsfilename, $localrootpath, $allvariableshashref, $filesinpackage) = @_;
+
+ # $installer::globals::shellscriptsfilename
+
+ push( @{$epmfileref}, "\n\n" );
+
+ my $shellscriptsfileref = installer::files::read_file($shellscriptsfilename);
+
+ replace_variable_in_shellscripts($shellscriptsfileref, $localrootpath, "rootpath");
+
+ replace_many_variables_in_shellscripts($shellscriptsfileref, $allvariableshashref);
+
+ for ( my $i = 0; $i <= $#{$shellscriptsfileref}; $i++ )
+ {
+ push( @{$epmfileref}, ${$shellscriptsfileref}[$i] );
+ }
+
+ push( @{$epmfileref}, "\n" );
+}
+
+#################################################
+# Determining the epm on the system
+#################################################
+
+sub find_epm_on_system
+{
+ my ($includepatharrayref) = @_;
+
+ installer::logger::include_header_into_logfile("Check epm on system");
+
+ my $epmname = "epm";
+
+ # epm should be defined through the configure script but we need to
+ # check for it to be defined because of the Sun environment.
+ # Check the environment variable first and if it is not defined,
+ # or if it is but the location is not executable, search further.
+ # It has to be found in the solver or it has to be in the path
+ # (saved in $installer::globals::epm_in_path) or we get the specified
+ # one through the environment (i.e. when --with-epm=... is specified)
+
+ if ($ENV{'EPM'})
+ {
+ if (($ENV{'EPM'} ne "") && (-x "$ENV{'EPM'}"))
+ {
+ $epmname = $ENV{'EPM'};
+ }
+ elsif ( ($ENV{'EPM'} eq "no") || ($ENV{'EPM'} eq "internal") )
+ {
+ $epmname = "epm";
+ my $epmref = installer::scriptitems::get_sourcepath_from_filename_and_includepath( \$epmname, $includepatharrayref, 0);
+ if ($$epmref eq "") { installer::exiter::exit_program("ERROR: Could not find program $epmname (EPM set to \"internal\" or \"no\")!", "find_epm_on_system"); }
+ $epmname = $$epmref;
+ }
+ else
+ {
+ installer::exiter::exit_program("Environment variable EPM set (\"$ENV{'EPM'}\"), but file does not exist or is not executable!", "find_epm_on_system");
+ }
+ }
+ else
+ {
+ my $epmfileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$epmname, $includepatharrayref, 0);
+
+ if (($$epmfileref eq "") && (!($installer::globals::epm_in_path))) { installer::exiter::exit_program("ERROR: Could not find program $epmname!", "find_epm_on_system"); }
+ if (($$epmfileref eq "") && ($installer::globals::epm_in_path)) { $epmname = $installer::globals::epm_path; }
+ if (!($$epmfileref eq "")) { $epmname = $$epmfileref; }
+ }
+
+ my $infoline = "Using epmfile: $epmname\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return $epmname;
+}
+
+#################################################
+# Determining the epm patch state
+# saved in $installer::globals::is_special_epm
+#################################################
+
+sub set_patch_state
+{
+ my ($epmexecutable) = @_;
+
+ my $infoline = "";
+
+ my $systemcall = "$epmexecutable |";
+ open (EPMPATCH, "$systemcall");
+
+ while (<EPMPATCH>)
+ {
+ chop;
+ if ( $_ =~ /Patched for OpenOffice.org/ ) { $installer::globals::is_special_epm = 1; }
+ }
+
+ close (EPMPATCH);
+
+ if ( $installer::globals::is_special_epm )
+ {
+ $infoline = "\nPatch state: This is a patched version of epm!\n\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "\nPatch state: This is an unpatched version of epm!\n\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( ( $installer::globals::is_special_epm ) && (($installer::globals::islinuxrpmbuild) || ($installer::globals::issolarispkgbuild)) )
+ {
+ # Special postprocess handling only for Linux RPM and Solaris packages
+ $installer::globals::postprocess_specialepm = 1;
+ $installer::globals::postprocess_standardepm = 0;
+ }
+ else
+ {
+ $installer::globals::postprocess_specialepm = 0;
+ $installer::globals::postprocess_standardepm = 1;
+ }
+}
+
+#################################################
+# LD_PRELOAD string for Debian packages
+#################################################
+
+sub get_ld_preload_string
+{
+ my ($includepatharrayref) = @_;
+
+ my $getuidlibraryname = "getuid.so";
+
+ my $getuidlibraryref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$getuidlibraryname, $includepatharrayref, 0);
+ if ($$getuidlibraryref eq "") { installer::exiter::exit_program("ERROR: Could not find $getuidlibraryname!", "get_ld_preload_string"); }
+
+ my $ldpreloadstring = "LD_PRELOAD=" . $$getuidlibraryref;
+
+ return $ldpreloadstring;
+}
+
+#################################################
+# Calling epm to create the installation sets
+#################################################
+
+sub call_epm
+{
+ my ($epmname, $epmlistfilename, $packagename, $includepatharrayref) = @_;
+
+ installer::logger::include_header_into_logfile("epm call for $packagename");
+
+ my $packageformat = $installer::globals::packageformat;
+
+ my $localpackagename = $packagename;
+ # Debian allows only lowercase letters in package name
+ if ( $installer::globals::debian ) { $localpackagename = lc($localpackagename); }
+
+ my $outdirstring = "";
+ if ( $installer::globals::epmoutpath ne "" ) { $outdirstring = " --output-dir $installer::globals::epmoutpath"; }
+
+ # Debian package build needs a LD_PRELOAD for correct rights
+
+ my $ldpreloadstring = "";
+
+ if ( $installer::globals::debian ) { $ldpreloadstring = get_ld_preload_string($includepatharrayref) . " "; }
+
+ my $extraflags = "";
+ if ($ENV{'EPM_FLAGS'}) { $extraflags = $ENV{'EPM_FLAGS'}; }
+
+ my $systemcall = $ldpreloadstring . $epmname . " -f " . $packageformat . " " . $extraflags . " " . $localpackagename . " " . $epmlistfilename . $outdirstring . " -v " . " 2\>\&1 |";
+
+ installer::logger::print_message( "... $systemcall ...\n" );
+
+ my $maxepmcalls = 3;
+
+ for ( my $i = 1; $i <= $maxepmcalls; $i++ )
+ {
+ my @epmoutput = ();
+
+ open (EPM, "$systemcall");
+ while (<EPM>) {push(@epmoutput, $_); }
+ close (EPM);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ my $infoline = "Systemcall (Try $i): $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $j = 0; $j <= $#epmoutput; $j++ )
+ {
+ if ( $i < $maxepmcalls ) { $epmoutput[$j] =~ s/\bERROR\b/PROBLEM/ig; }
+ push( @installer::globals::logfileinfo, "$epmoutput[$j]");
+ }
+
+ if ($returnvalue)
+ {
+ $infoline = "Try $i : Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ if ( $i == $maxepmcalls ) { installer::exiter::exit_program("ERROR: \"$systemcall\"!", "call_epm"); }
+ }
+ else
+ {
+ installer::logger::print_message( "Success (Try $i): \"$systemcall\"\n" );
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ last;
+ }
+ }
+}
+
+#####################################################################
+# Adding the new line for relocatables into pkginfo file (Solaris)
+# or spec file (Linux) created by epm
+#####################################################################
+
+sub add_one_line_into_file
+{
+ my ($file, $insertline, $filename) = @_;
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ push(@{$file}, $insertline); # simply adding at the end of pkginfo file
+ }
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ # Adding behind the line beginning with: Group:
+
+ my $inserted_line = 0;
+
+ for ( my $i = 0; $i <= $#{$file}; $i++ )
+ {
+ if ( ${$file}[$i] =~ /^\s*Group\:\s*/ )
+ {
+ splice(@{$file},$i+1,0,$insertline);
+ $inserted_line = 1;
+ last;
+ }
+ }
+
+ if (! $inserted_line) { installer::exiter::exit_program("ERROR: Did not find string \"Group:\" in file: $filename", "add_one_line_into_file"); }
+ }
+
+ $insertline =~ s/\s*$//; # removing line end for correct logging
+ my $infoline = "Success: Added line $insertline into file $filename!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+#####################################################################
+# Setting the revision VERSION=1.9,REV=66 .
+# Also adding the new line: "AutoReqProv: no"
+#####################################################################
+
+sub set_revision_in_pkginfo
+{
+ my ($file, $filename, $variables, $packagename) = @_;
+
+ my $revisionstring = "\,REV\=" . $installer::globals::packagerevision;
+
+ # Adding also a time string to the revision. Syntax: VERSION=8.0.0,REV=66.2005.01.24
+
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+
+ $mday = $mday;
+ $mon = $mon + 1;
+ $year = $year + 1900;
+
+ if ( $mday < 10 ) { $mday = "0" . $mday; }
+ if ( $mon < 10 ) { $mon = "0" . $mon; }
+ $datestring = $year . "." . $mon . "." . $mday;
+ $revisionstring = $revisionstring . "." . $datestring;
+
+ for ( my $i = 0; $i <= $#{$file}; $i++ )
+ {
+ if ( ${$file}[$i] =~ /^\s*(VERSION\=.*?)\s*$/ )
+ {
+ my $oldstring = $1;
+ my $newstring = $oldstring . $revisionstring; # also adding the date string
+ ${$file}[$i] =~ s/$oldstring/$newstring/;
+ my $infoline = "Info: Changed in $filename file: \"$oldstring\" to \"$newstring\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ last;
+ }
+ }
+
+ # For Update and Patch reasons, this string can also be kept constant
+
+ my $pkgversion = "SOLSPARCPKGVERSION";
+ if ( $installer::globals::issolarisx86build ) { $pkgversion = "SOLIAPKGVERSION"; }
+
+ if (( $variables->{$pkgversion} ) && ( $variables->{$pkgversion} ne "" ))
+ {
+ if ( $variables->{$pkgversion} ne "FINALVERSION" )
+ {
+ # In OOo 3.x timeframe, this string is no longer unique for all packages, because of the three layer.
+ # In the string: "3.0.0,REV=9.2008.09.30" only the part "REV=9.2008.09.30" can be unique for all packages
+ # and therefore be set as $pkgversion.
+ # The first part "3.0.0" has to be derived from the
+
+ my $version = $installer::globals::packageversion;
+ if ( $version =~ /^\s*(\d+)\.(\d+)\.(\d+)\s*$/ )
+ {
+ my $major = $1;
+ my $minor = $2;
+ my $micro = $3;
+
+ my $finalmajor = $major;
+ my $finalminor = $minor;
+ my $finalmicro = 0;
+
+ # if (( $packagename =~ /-ure\s*$/ ) && ( $finalmajor == 1 )) { $finalminor = 4; }
+
+ $version = "$finalmajor.$finalminor.$finalmicro";
+ }
+
+ my $versionstring = "$version,$variables->{$pkgversion}";
+
+ for ( my $i = 0; $i <= $#{$file}; $i++ )
+ {
+ if ( ${$file}[$i] =~ /^\s*(VERSION\=).*?\s*$/ )
+ {
+ my $start = $1;
+ my $newstring = $start . $versionstring . "\n"; # setting the complete new string
+ my $oldstring = ${$file}[$i];
+ ${$file}[$i] = $newstring;
+ $oldstring =~ s/\s*$//;
+ $newstring =~ s/\s*$//;
+ my $infoline = "Info: Changed in $filename file: \"$oldstring\" to \"$newstring\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ last;
+ }
+ }
+ }
+ }
+}
+
+########################################################
+# Setting Patch information for Respin versions
+# into pkginfo file. This prevents Respin versions
+# from patching.
+########################################################
+
+sub set_patchlist_in_pkginfo_for_respin
+{
+ my ($changefile, $filename, $allvariables, $packagename) = @_;
+
+ my $patchlistname = "SOLSPARCPATCHLISTFORRESPIN";
+ if ( $installer::globals::issolarisx86build ) { $patchlistname = "SOLIAPATCHLISTFORRESPIN"; }
+
+ if ( $allvariables->{$patchlistname} )
+ {
+ # patchlist separator is a blank
+ my $allpatchesstring = $allvariables->{$patchlistname};
+ my @usedpatches = ();
+
+ # Analyzing the patchlist
+ # Syntax: 120186-10 126411-01(+core-01) -> use 126411-01 only for core-01
+ # Syntax: 120186-10 126411-01(-core-01) -> use 126411-01 for all packages except for core-01
+ my $allpatches = installer::converter::convert_whitespace_stringlist_into_array(\$allpatchesstring);
+
+ for ( my $i = 0; $i <= $#{$allpatches}; $i++ )
+ {
+ my $patchdefinition = ${$allpatches}[$i];
+
+ my $patchid = "";
+ my $symbol = "";
+ my $constraint = "";
+ my $isusedpatch = 0;
+
+ if ( $patchdefinition =~ /^\s*(.+)\(([+-])(.+)\)\s*$/ )
+ {
+ $patchid = $1;
+ $symbol = $2;
+ $constraint = $3;
+ }
+ elsif (( $patchdefinition =~ /\(/ ) || ( $patchdefinition =~ /\)/ )) # small syntax check
+ {
+ # if there is a bracket in the $patchdefinition, but it does not
+ # match the if-condition, this is an erroneous definition.
+ installer::exiter::exit_program("ERROR: Unknown patch string: $patchdefinition", "set_patchlist_in_pkginfo_for_respin");
+ }
+ else
+ {
+ $patchid = $patchdefinition;
+ $isusedpatch = 1; # patches without constraint are always included
+ }
+
+ if ( $symbol ne "" )
+ {
+ if ( $symbol eq "+" )
+ {
+ if ( $packagename =~ /^.*\Q$constraint\E\s*$/ ) { $isusedpatch = 1; }
+ }
+
+ if ( $symbol eq "-" )
+ {
+ if ( ! ( $packagename =~ /^.*\Q$constraint\E\s*$/ )) { $isusedpatch = 1; }
+ }
+ }
+
+ if ( $isusedpatch ) { push(@usedpatches, $patchid); }
+ }
+
+ if ( $#usedpatches > -1 )
+ {
+ my $patchstring = installer::converter::convert_array_to_space_separated_string(\@usedpatches);
+
+ my $newline = "PATCHLIST=" . $patchstring . "\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+
+ # Adding patch info for each used patch in the patchlist
+
+ for ( my $i = 0; $i <= $#usedpatches; $i++ )
+ {
+ my $patchid = $usedpatches[$i];
+ my $key = "PATCH_INFO_" . $patchid;
+ $key =~ s/\s*$//;
+
+ if ( ! $allvariables->{$key} ) { installer::exiter::exit_program("ERROR: No Patch info available in zip list file for $key", "set_patchlist_in_pkginfo"); }
+ my $value = set_timestamp_in_patchinfo($allvariables->{$key});
+ $newline = $key . "=" . $value . "\n";
+
+ add_one_line_into_file($changefile, $newline, $filename);
+ }
+ }
+ }
+}
+
+########################################################
+# Solaris requires, that the time of patch installation
+# must not be empty.
+# Format: Mon Mar 24 11:20:56 PDT 2008
+# Log file: Tue Apr 29 23:26:19 2008 (04:31 min.)
+# Replace string: ${TIMESTAMP}
+########################################################
+
+sub set_timestamp_in_patchinfo
+{
+ my ($value) = @_;
+
+ my $currenttime = localtime();
+
+ if ( $currenttime =~ /^\s*(.+?)(\d\d\d\d)\s*$/ )
+ {
+ my $start = $1;
+ my $year = $2;
+ $currenttime = $start . "CET " . $year;
+ }
+
+ $value =~ s/\$\{TIMESTAMP\}/$currenttime/;
+
+ return $value;
+}
+
+########################################################
+# Setting MAXINST=1000 into the pkginfo file.
+########################################################
+
+sub set_maxinst_in_pkginfo
+{
+ my ($changefile, $filename) = @_;
+
+ my $newline = "MAXINST\=1000\n";
+
+ add_one_line_into_file($changefile, $newline, $filename);
+}
+
+#############################################################
+# Setting several Solaris variables into the pkginfo file.
+#############################################################
+
+sub set_solaris_parameter_in_pkginfo
+{
+ my ($changefile, $filename, $allvariables) = @_;
+
+ my $newline = "";
+
+ # SUNW_PRODNAME
+ # SUNW_PRODVERS
+ # SUNW_PKGVERS
+ # Not: SUNW_PKGTYPE
+ # HOTLINE
+ # EMAIL
+
+ my $productname = $allvariables->{'PRODUCTNAME'};
+ $newline = "SUNW_PRODNAME=$productname\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+
+ my $productversion = "";
+ if ( $allvariables->{'PRODUCTVERSION'} )
+ {
+ $productversion = $allvariables->{'PRODUCTVERSION'};
+ if ( $allvariables->{'PRODUCTEXTENSION'} ) { $productversion = $productversion . "/" . $allvariables->{'PRODUCTEXTENSION'}; }
+ }
+ $newline = "SUNW_PRODVERS=$productversion\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+
+ $newline = "SUNW_PKGVERS=1\.0\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+
+ if ( $allvariables->{'SUNW_PKGTYPE'} )
+ {
+ $newline = "SUNW_PKGTYPE=$allvariables->{'SUNW_PKGTYPE'}\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+ }
+ else
+ {
+ $newline = "SUNW_PKGTYPE=\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+ }
+
+ $newline = "HOTLINE=Please contact your local service provider\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+
+ $newline = "EMAIL=\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+
+}
+
+#####################################################################
+# epm uses as archtecture for Solaris x86 "i86pc". This has to be
+# changed to "i386".
+#####################################################################
+
+sub fix_architecture_setting
+{
+ my ($changefile) = @_;
+
+ for ( my $i = 0; $i <= $#{$changefile}; $i++ )
+ {
+ if ( ${$changefile}[$i] =~ /^\s*ARCH=i86pc\s*$/ )
+ {
+ ${$changefile}[$i] =~ s/i86pc/i386/;
+ last;
+ }
+
+ }
+}
+
+#####################################################################
+# Adding a new line for topdir into specfile, removing old
+# topdir if set.
+#####################################################################
+
+sub set_topdir_in_specfile
+{
+ my ($changefile, $filename, $newepmdir) = @_;
+
+ # $newepmdir =~ s/^\s*\.//; # removing leading "."
+ $newepmdir = cwd() . $installer::globals::separator . $newepmdir; # only absolute path allowed
+
+ # removing "%define _topdir", if existing
+
+ for ( my $i = 0; $i <= $#{$changefile}; $i++ )
+ {
+ if ( ${$changefile}[$i] =~ /^\s*\%define _topdir\s+/ )
+ {
+ my $removeline = ${$changefile}[$i];
+ $removeline =~ s/\s*$//;
+ splice(@{$changefile},$i,1);
+ my $infoline = "Info: Removed line \"$removeline\" from file $filename!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ last;
+ }
+ }
+
+ # Adding "topdir" behind the line beginning with: Group:
+
+ my $inserted_line = 0;
+
+ my $topdirline = "\%define _topdir $newepmdir\n";
+
+ for ( my $i = 0; $i <= $#{$changefile}; $i++ )
+ {
+ if ( ${$changefile}[$i] =~ /^\s*Group\:\s*/ )
+ {
+ splice(@{$changefile},$i+1,0,$topdirline);
+ $inserted_line = 1;
+ $topdirline =~ s/\s*$//;
+ my $infoline = "Success: Added line $topdirline into file $filename!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ if (! $inserted_line) { installer::exiter::exit_program("ERROR: Did not find string \"Group:\" in file: $filename", "set_topdir_in_specfile"); }
+
+}
+
+#####################################################################
+# Setting the packager in the spec file
+# Syntax: Packager: abc@def
+#####################################################################
+
+sub set_packager_in_specfile
+{
+ my ($changefile) = @_;
+
+ my $packager = $installer::globals::longmanufacturer;
+
+ for ( my $i = 0; $i <= $#{$changefile}; $i++ )
+ {
+ if ( ${$changefile}[$i] =~ /^\s*Packager\s*:\s*(.+?)\s*$/ )
+ {
+ my $oldstring = $1;
+ ${$changefile}[$i] =~ s/\Q$oldstring\E/$packager/;
+ my $infoline = "Info: Changed Packager in spec file from $oldstring to $packager!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ last;
+ }
+ }
+}
+
+#####################################################################
+# Setting the requirements in the spec file (i81494)
+# Syntax: PreReq: "requirements" (only for shared extensions)
+#####################################################################
+
+sub set_prereq_in_specfile
+{
+ my ($changefile) = @_;
+
+ my $prereq = "PreReq:";
+
+ for ( my $i = 0; $i <= $#{$changefile}; $i++ )
+ {
+ if ( ${$changefile}[$i] =~ /^\s*Requires:\s*(.+?)\s*$/ )
+ {
+ my $oldstring = ${$changefile}[$i];
+ ${$changefile}[$i] =~ s/Requires:/$prereq/;
+ my $infoline = "Info: Changed requirements in spec file from $oldstring to ${$changefile}[$i]!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+}
+
+#####################################################################
+# Setting the Auto[Req]Prov line and __find_requires
+#####################################################################
+
+sub set_autoprovreq_in_specfile
+{
+ my ($changefile, $findrequires, $bindir) = @_;
+
+ my $autoreqprovline;
+
+ if ( $findrequires )
+ {
+ $autoreqprovline = "AutoProv\: no\n%define __find_requires $bindir/$findrequires\n";
+ }
+ else
+ {
+ $autoreqprovline = "AutoReqProv\: no\n";
+ }
+
+ $autoreqprovline .= "%define _binary_filedigest_algorithm 1\n%define _binary_payload w9.gzdio\n";
+
+ for ( my $i = 0; $i <= $#{$changefile}; $i++ )
+ {
+ # Adding "autoreqprov" behind the line beginning with: Group:
+ if ( ${$changefile}[$i] =~ /^\s*Group\:\s*/ )
+ {
+ splice(@{$changefile},$i+1,0,$autoreqprovline);
+ $autoreqprovline =~ s/\s*$//;
+ $infoline = "Success: Added line $autoreqprovline into spec file!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ last;
+ }
+ }
+}
+
+#####################################################################
+# Replacing Copyright with License in the spec file
+# Syntax: License: LGPL, SISSL
+#####################################################################
+
+sub set_license_in_specfile
+{
+ my ($changefile, $variableshashref) = @_;
+
+ my $license = $variableshashref->{'LICENSENAME'};
+
+ for ( my $i = 0; $i <= $#{$changefile}; $i++ )
+ {
+ if ( ${$changefile}[$i] =~ /^\s*Copyright\s*:\s*(.+?)\s*$/ )
+ {
+ ${$changefile}[$i] = "License: $license\n";
+ my $infoline = "Info: Replaced Copyright with License: $license !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ last;
+ }
+ }
+}
+
+#########################################################
+# Building relocatable Solaris packages means:
+# 1. Add "BASEDIR=/opt" into pkginfo
+# 2. Remove "/opt/" from all objects in prototype file
+# For step2 this function exists
+# Sample: d none /opt/openofficeorg20/help 0755 root other
+# -> d none openofficeorg20/help 0755 root other
+#########################################################
+
+sub make_prototypefile_relocatable
+{
+ my ($prototypefile, $relocatablepath) = @_;
+
+ for ( my $i = 0; $i <= $#{$prototypefile}; $i++ )
+ {
+ if ( ${$prototypefile}[$i] =~ /^\s*\w\s+\w+\s+\/\w+/ ) # this is an object line
+ {
+ ${$prototypefile}[$i] =~ s/$relocatablepath//; # Important: $relocatablepath has a "/" at the end. Example "/opt/"
+ }
+ }
+
+ # If the $relocatablepath is "/opt/openoffice20/" the line "d none /opt/openoffice20" was not changed.
+ # This line has to be removed now
+
+ if ( $relocatablepath ne "/" ) { $relocatablepath =~ s/\/\s*$//; } # removing the ending slash
+
+ for ( my $i = 0; $i <= $#{$prototypefile}; $i++ )
+ {
+ if ( ${$prototypefile}[$i] =~ /^\s*d\s+\w+\s+\Q$relocatablepath\E/ )
+ {
+ my $line = ${$prototypefile}[$i];
+ splice(@{$prototypefile},$i,1); # removing the line
+ $line =~ s/\s*$//;
+ my $infoline = "Info: Removed line \"$line\" from prototype file!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ last;
+ }
+ }
+
+ # Making "\$" to "$" in prototype file. "\$" was created by epm.
+
+ for ( my $i = 0; $i <= $#{$prototypefile}; $i++ )
+ {
+ if ( ${$prototypefile}[$i] =~ /\\\$/ )
+ {
+ ${$prototypefile}[$i] =~ s/\\\$/\$/g;
+ my $infoline2 = "Info: Changed line in prototype file: ${$prototypefile}[$i] !\n";
+ push( @installer::globals::logfileinfo, $infoline2);
+ }
+ }
+}
+
+
+#########################################################################
+# In scp the flag VOLATEFILE can be used. This shall lead to style "v"
+# in Solaris prototype file. This is not supported by epm and has
+# therefore to be included in prototypefile, not in epm list file.
+#########################################################################
+
+sub set_volatilefile_into_prototypefile
+{
+ my ($prototypefile, $filesref) = @_;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+
+ my $styles = "";
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+
+ if ( $styles =~ /\bVOLATILEFILE\b/ )
+ {
+ my $sourcepath = $onefile->{'sourcepath'};
+
+ for ( my $j = 0; $j <= $#{$prototypefile}; $j++ )
+ {
+ if (( ${$prototypefile}[$j] =~ /^\s*f\s+none\s+/ ) && ( ${$prototypefile}[$j] =~ /\=\Q$sourcepath\E\s+/ ))
+ {
+ my $oldline = ${$prototypefile}[$j];
+ ${$prototypefile}[$j] =~ s/^\s*f/v/;
+ my $newline = ${$prototypefile}[$j];
+ $oldline =~ s/\s*$//;
+ $newline =~ s/\s*$//;
+ my $infoline = "Volatile file: Changing content from \"$oldline\" to \"$newline\" .\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ last;
+ }
+ }
+ }
+ }
+}
+
+#########################################################################
+# Replacing the variables in the Solaris patch shell scripts.
+# Taking care, that multiple slashes are not always removed.
+#########################################################################
+
+sub replace_variables_in_shellscripts_for_patch
+{
+ my ($scriptfile, $scriptfilename, $oldstring, $newstring) = @_;
+
+ for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
+ {
+ if ( ${$scriptfile}[$i] =~ /\Q$oldstring\E/ )
+ {
+ my $oldline = ${$scriptfile}[$i];
+ if (( $oldstring eq "PRODUCTDIRECTORYNAME" ) && ( $newstring eq "" )) { $oldstring = $oldstring . "/"; }
+ ${$scriptfile}[$i] =~ s/\Q$oldstring\E/$newstring/g;
+ my $infoline = "Info: Substituting in $scriptfilename $oldstring by $newstring\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+}
+
+#########################################################################
+# Replacing the variables in the shell scripts or in the epm list file
+# Linux: spec file
+# Solaris: preinstall, postinstall, preremove, postremove
+# If epm is used in the original version (not relocatable)
+# the variables have to be exchanged in the list file,
+# created for epm.
+#########################################################################
+
+sub replace_variables_in_shellscripts
+{
+ my ($scriptfile, $scriptfilename, $oldstring, $newstring) = @_;
+
+ my $debug = 0;
+ if ( $oldstring eq "PRODUCTDIRECTORYNAME" ) { $debug = 1; }
+
+ for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
+ {
+ if ( ${$scriptfile}[$i] =~ /\Q$oldstring\E/ )
+ {
+ my $oldline = ${$scriptfile}[$i];
+ ${$scriptfile}[$i] =~ s/\Q$oldstring\E/$newstring/g;
+ ${$scriptfile}[$i] =~ s/\/\//\//g; # replacing "//" by "/" , if path $newstring is empty!
+ my $infoline = "Info: Substituting in $scriptfilename $oldstring by $newstring\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ if ( $debug )
+ {
+ $infoline = "Old Line: $oldline";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "New Line: ${$scriptfile}[$i]";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+}
+
+############################################################
+# Determinig the directory created by epm, in which the
+# RPMS or Solaris packages are created.
+############################################################
+
+sub determine_installdir_ooo
+{
+ # A simple "ls" command returns the directory name
+
+ my $dirname = "";
+
+ my $systemcall = "ls |";
+ open (LS, "$systemcall");
+ $dirname = <LS>;
+ close (LS);
+
+ $dirname =~ s/\s*$//;
+
+ my $infoline = "Info: Directory created by epm: $dirname\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ return $dirname;
+}
+
+############################################################
+# Setting the tab content into the file container
+############################################################
+
+sub set_tab_into_datafile
+{
+ my ($changefile, $filesref) = @_;
+
+ my @newclasses = ();
+ my $newclassesstring = "";
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+
+ if ( $onefile->{'SolarisClass'} )
+ {
+ my $sourcepath = $onefile->{'sourcepath'};
+
+ for ( my $j = 0; $j <= $#{$changefile}; $j++ )
+ {
+ if (( ${$changefile}[$j] =~ /^\s*f\s+none\s+/ ) && ( ${$changefile}[$j] =~ /\=\Q$sourcepath\E\s+/ ))
+ {
+ my $oldline = ${$changefile}[$j];
+ ${$changefile}[$j] =~ s/f\s+none/e $onefile->{'SolarisClass'}/;
+ my $newline = ${$changefile}[$j];
+ $oldline =~ s/\s*$//;
+ $newline =~ s/\s*$//;
+
+ my $infoline = "TAB: Changing content from \"$oldline\" to \"$newline\" .\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ # collecting all new classes
+ if (! installer::existence::exists_in_array($onefile->{'SolarisClass'}, \@newclasses))
+ {
+ push(@newclasses, $onefile->{'SolarisClass'});
+ }
+
+ last;
+ }
+ }
+ }
+ }
+
+ $newclassesstring = installer::converter::convert_array_to_space_separated_string(\@newclasses);
+ }
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+
+ if ( $onefile->{'SpecFileContent'} )
+ {
+ my $destination = $onefile->{'destination'};
+
+ for ( my $j = 0; $j <= $#{$changefile}; $j++ )
+ {
+ if ( ${$changefile}[$j] =~ /^\s*(\%attr\(.*\))\s+(\".*?\Q$destination\E\"\s*)$/ )
+ {
+ my $begin = $1;
+ my $end = $2;
+
+ my $oldline = ${$changefile}[$j];
+ ${$changefile}[$j] = $begin . " " . $onefile->{'SpecFileContent'} . " " . $end;
+ my $newline = ${$changefile}[$j];
+
+ $oldline =~ s/\s*$//;
+ $newline =~ s/\s*$//;
+
+ my $infoline = "TAB: Changing content from \"$oldline\" to \"$newline\" .\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ last;
+ }
+ }
+ }
+ }
+ }
+
+ return $newclassesstring;
+}
+
+############################################################
+# Including additional classes into the pkginfo file
+############################################################
+
+sub include_classes_into_pkginfo
+{
+ my ($changefile, $classesstring) = @_;
+
+ for ( my $i = 0; $i <= $#{$changefile}; $i++ )
+ {
+ if ( ${$changefile}[$i] =~ /^\s*CLASSES\=none/ )
+ {
+ ${$changefile}[$i] =~ s/\s*$//;
+ my $oldline = ${$changefile}[$i];
+ ${$changefile}[$i] = ${$changefile}[$i] . " " . $classesstring . "\n";
+ my $newline = ${$changefile}[$i];
+ $newline =~ s/\s*$//;
+
+ my $infoline = "pkginfo file: Changing content from \"$oldline\" to \"$newline\" .\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+}
+
+##########################################################################################
+# Checking, if an extension is included into the package (Linux).
+# All extension files have to be installed into directory
+# share/extension/install
+# %attr(0444,root,root) "/opt/staroffice8/share/extension/install/SunSearchToolbar.oxt"
+##########################################################################################
+
+sub is_extension_package
+{
+ my ($specfile) = @_;
+
+ my $is_extension_package = 0;
+
+ for ( my $i = 0; $i <= $#{$specfile}; $i++ )
+ {
+ my $line = ${$specfile}[$i];
+ if ( $line =~ /share\/extension\/install\/.*?\.oxt\"\s*$/ )
+ {
+ $is_extension_package = 1;
+ last;
+ }
+ }
+
+ return $is_extension_package;
+}
+
+######################################################################
+# Checking, if an extension is included into the package (Solaris).
+# All extension files have to be installed into directory
+# share/extension/install
+######################################################################
+
+sub contains_extension_dir
+{
+ my ($prototypefile) = @_;
+
+ my $contains_extension_dir = 0;
+
+ # d none opt/openoffice.org3/share/extensions/
+
+ for ( my $i = 0; $i <= $#{$prototypefile}; $i++ )
+ {
+ my $line = ${$prototypefile}[$i];
+ if ( $line =~ /^\s*d\s+none\s.*\/share\/extensions\// )
+ {
+ $contains_extension_dir = 1;
+ last;
+ }
+ }
+
+ return $contains_extension_dir;
+}
+
+############################################################
+# A Solaris patch contains 7 specific scripts
+############################################################
+
+sub add_scripts_into_prototypefile
+{
+ my ($prototypefile, $prototypefilename, $languagestringref, $staticpath) = @_;
+
+ # The files are stored in the directory $installer::globals::patchincludepath
+ # The file names are available via @installer::globals::solarispatchscripts
+
+ my $path = $installer::globals::patchincludepath;
+ $path =~ s/\/\s*$//;
+ $path = $path . $installer::globals::separator;
+
+ my @newlines = ();
+ my $is_extension_package = contains_extension_dir($prototypefile);
+
+ if ( $is_extension_package )
+ {
+ for ( my $i = 0; $i <= $#installer::globals::solarispatchscriptsforextensions; $i++ )
+ {
+ my $sourcefilename = $path . $installer::globals::solarispatchscriptsforextensions[$i];
+ my $destfile = $installer::globals::solarispatchscriptsforextensions[$i];
+
+ # If the sourcepath has "_extension" in its name, this has to be removed
+ $destfile =~ s/_extensions\s*$//; # hard coded renaming of script name
+
+ # Creating unique directory name with $prototypefilename
+ my $extensiondir = installer::systemactions::create_directories("extensionscripts", $languagestringref);
+
+ if ( $prototypefilename =~ /\/(\S*?)\s*$/ ) { $prototypefilename = $1; }
+ $prototypefilename =~ s/\./_/g;
+ my $destdir = $extensiondir . $installer::globals::separator . $prototypefilename;
+ if ( ! -d $destdir ) { installer::systemactions::create_directory($destdir); }
+ my $destpath = $destdir . $installer::globals::separator . $destfile;
+ if ( -f $destpath ) { unlink($destpath); }
+
+ # Reading file
+ my $scriptfile = installer::files::read_file($sourcefilename);
+
+ # Replacing variables
+ my $oldstring = "PRODUCTDIRECTORYNAME";
+ replace_variables_in_shellscripts_for_patch($scriptfile, $destpath, $oldstring, $staticpath);
+
+ # Saving file
+ installer::files::save_file($destpath, $scriptfile);
+
+ # Writing file destination into prototype file
+ my $line = "i $destfile=" . $destpath . "\n";
+ push(@newlines, $line);
+ }
+ }
+ else
+ {
+ for ( my $i = 0; $i <= $#installer::globals::solarispatchscripts; $i++ )
+ {
+ my $line = "i $installer::globals::solarispatchscripts[$i]=" . $path . $installer::globals::solarispatchscripts[$i] . "\n";
+ push(@newlines, $line);
+ }
+ }
+
+ # Including the new lines after the last line starting with "i"
+
+ for ( my $i = 0; $i <= $#{$prototypefile}; $i++ )
+ {
+ if ( ${$prototypefile}[$i] =~ /^\s*i\s+copyright/ )
+ {
+ splice(@{$prototypefile}, $i, 1); # ignoring old copyright text, using patch standard
+ next;
+ }
+ if ( ${$prototypefile}[$i] =~ /^\s*i\s+/ ) { next; }
+ splice(@{$prototypefile}, $i, 0, @newlines);
+ last;
+ }
+}
+
+############################################################
+# Adding patch infos in pkginfo file
+############################################################
+
+sub include_patchinfos_into_pkginfo
+{
+ my ( $changefile, $filename, $variableshashref ) = @_;
+
+ # SUNW_PATCHID=101998-10
+ # SUNW_OBSOLETES=114999-01 113999-01
+ # SUNW_PKGTYPE=usr
+ # SUNW_PKGVERS=1.0
+ # SUNW_REQUIRES=126411-01
+
+ my $patchidname = "SOLSPARCPATCHID";
+ if ( $installer::globals::issolarisx86build ) { $patchidname = "SOLIAPATCHID"; }
+
+ if ( ! $variableshashref->{$patchidname} ) { installer::exiter::exit_program("ERROR: Variable $patchidname not defined in zip list file!", "include_patchinfos_into_pkginfo"); }
+
+ my $newline = "SUNW_PATCHID=" . $variableshashref->{$patchidname} . "\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+
+ my $patchobsoletesname = "SOLSPARCPATCHOBSOLETES";
+ if ( $installer::globals::issolarisx86build ) { $patchobsoletesname = "SOLIAPATCHOBSOLETES"; }
+
+ my $obsoletes = "";
+ if ( $variableshashref->{$patchobsoletesname} ) { $obsoletes = $variableshashref->{$patchobsoletesname}; }
+ $newline = "SUNW_OBSOLETES=" . $obsoletes . "\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+
+ my $patchrequiresname = "SOLSPARCPATCHREQUIRES";
+ if ( $installer::globals::issolarisx86build ) { $patchrequiresname = "SOLIAPATCHREQUIRES"; }
+
+ if ( $variableshashref->{$patchrequiresname} )
+ {
+ my $requires = $variableshashref->{$patchrequiresname};
+ $newline = "SUNW_REQUIRES=" . $requires . "\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+ }
+ $newline = "SUNW_PATCH_PROPERTIES=\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+ # $newline = "SUNW_PKGTYPE=usr\n";
+ # add_one_line_into_file($changefile, $newline, $filename);
+
+ # $newline = "SUNW_PKGVERS=1.0\n";
+ # add_one_line_into_file($changefile, $newline, $filename);
+}
+
+############################################################
+# Setting the correct Solaris locales
+############################################################
+
+sub get_solaris_language_for_langpack
+{
+ my ( $onelanguage ) = @_;
+
+ my $sollanguage = $onelanguage;
+ $sollanguage =~ s/\-/\_/;
+
+ if ( $sollanguage eq "de" ) { $sollanguage = "de"; }
+ elsif ( $sollanguage eq "en_US" ) { $sollanguage = "en_AU,en_CA,en_GB,en_IE,en_MT,en_NZ,en_US,en_US.UTF-8"; }
+ elsif ( $sollanguage eq "es" ) { $sollanguage = "es"; }
+ elsif ( $sollanguage eq "fr" ) { $sollanguage = "fr"; }
+ elsif ( $sollanguage eq "hu" ) { $sollanguage = "hu_HU"; }
+ elsif ( $sollanguage eq "it" ) { $sollanguage = "it"; }
+ elsif ( $sollanguage eq "nl" ) { $sollanguage = "nl_BE,nl_NL"; }
+ elsif ( $sollanguage eq "pl" ) { $sollanguage = "pl_PL"; }
+ elsif ( $sollanguage eq "sv" ) { $sollanguage = "sv"; }
+ elsif ( $sollanguage eq "pt" ) { $sollanguage = "pt_PT"; }
+ elsif ( $sollanguage eq "pt_BR" ) { $sollanguage = "pt_BR"; }
+ elsif ( $sollanguage eq "ru" ) { $sollanguage = "ru_RU"; }
+ elsif ( $sollanguage eq "ja" ) { $sollanguage = "ja,ja_JP,ja_JP.PCK,ja_JP.UTF-8"; }
+ elsif ( $sollanguage eq "ko" ) { $sollanguage = "ko,ko.UTF-8"; }
+ elsif ( $sollanguage eq "zh_CN" ) { $sollanguage = "zh,zh.GBK,zh_CN.GB18030,zh.UTF-8"; }
+ elsif ( $sollanguage eq "zh_TW" ) { $sollanguage = "zh_TW,zh_TW.BIG5,zh_TW.UTF-8,zh_HK.BIG5HK,zh_HK.UTF-8"; }
+
+ return $sollanguage;
+}
+
+############################################################
+# Adding language infos in pkginfo file
+############################################################
+
+sub include_languageinfos_into_pkginfo
+{
+ my ( $changefile, $filename, $languagestringref, $onepackage, $variableshashref ) = @_;
+
+ # SUNWPKG_LIST=core01
+ # SUNW_LOC=de
+
+ my $locallang = $onepackage->{'language'};
+ my $solarislanguage = get_solaris_language_for_langpack($locallang);
+
+ my $newline = "SUNW_LOC=" . $solarislanguage . "\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+
+ # SUNW_PKGLIST is required, if SUNW_LOC is defined.
+ if ( $onepackage->{'pkg_list_entry'} )
+ {
+ my $packagelistentry = $onepackage->{'pkg_list_entry'};
+ installer::packagelist::resolve_packagevariables(\$packagelistentry, $variableshashref, 1);
+ $newline = "SUNW_PKGLIST=" . $packagelistentry . "\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+ }
+ else
+ {
+ # Using default package ooobasis30-core01.
+ my $packagelistentry = "%BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01";
+ installer::packagelist::resolve_packagevariables(\$packagelistentry, $variableshashref, 1);
+ $newline = "SUNW_PKGLIST=" . $packagelistentry . "\n";
+ add_one_line_into_file($changefile, $newline, $filename);
+ }
+}
+
+############################################################
+# Collecting all files included in patch in
+# @installer::globals::patchfilecollector
+############################################################
+
+sub collect_patch_files
+{
+ my ($file, $packagename, $prefix) = @_;
+
+ # $file is the spec file or the prototypefile
+
+ $prefix = $prefix . "/";
+ my $packagenamestring = "Package " . $packagename . " \:\n";
+ push(@installer::globals::patchfilecollector, $packagenamestring);
+
+ for ( my $i = 0; $i <= $#{$file}; $i++ )
+ {
+ my $line = ${$file}[$i];
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ # %attr(0444,root,root) "/opt/openofficeorg20/program/about.bmp"
+
+ if ( $line =~ /^\s*\%attr\(.*\)\s*\"(.*?)\"\s*$/ )
+ {
+ my $filename = $1 . "\n";
+ $filename =~ s/^\s*\Q$prefix\E//;
+ push(@installer::globals::patchfilecollector, $filename);
+ }
+ }
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ # f none program/msomrl.rdb=/ab/SRC680/unxsols4.pro/bin/msomrl.rdb 0444 root bin
+
+ if ( $line =~ /^\s*f\s+\w+\s+(.*?)\=/ )
+ {
+ my $filename = $1 . "\n";
+ push(@installer::globals::patchfilecollector, $filename);
+ }
+ }
+ }
+
+ push(@installer::globals::patchfilecollector, "\n");
+
+}
+
+############################################################
+# Including package names into the depend files.
+# The package names have to be included into
+# packagelist. They are already saved in
+# %installer::globals::dependfilenames.
+############################################################
+
+sub put_packagenames_into_dependfile
+{
+ my ( $file ) = @_;
+
+ for ( my $i = 0; $i <= $#{$file}; $i++ )
+ {
+ my $line = ${$file}[$i];
+ if ( $line =~ /^\s*\w\s+(.*?)\s*$/ )
+ {
+ my $abbreviation = $1;
+
+ if ( $abbreviation =~ /\%/ ) { installer::exiter::exit_program("ERROR: Could not resolve all properties in Solaris package abbreviation \"$abbreviation\"!", "read_packagemap"); }
+
+ if ( exists($installer::globals::dependfilenames{$abbreviation}) )
+ {
+ my $packagename = $installer::globals::dependfilenames{$abbreviation};
+ if ( $packagename =~ /\%/ ) { installer::exiter::exit_program("ERROR: Could not resolve all properties in Solaris package name \"$packagename\"!", "read_packagemap"); }
+
+ $line =~ s/\s*$//;
+ ${$file}[$i] = $line . "\t" . $packagename . "\n";
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: Missing packagename for Solaris package \"$abbreviation\"!", "put_packagenames_into_dependfile");
+ }
+ }
+ }
+}
+
+############################################################
+# Including the relocatable directory into
+# spec file and pkginfo file
+# Linux: set topdir in specfile
+# Solaris: remove $relocatablepath (/opt/)
+# for all objects in prototype file
+# and changing "topdir" for Linux
+############################################################
+
+sub prepare_packages
+{
+ my ($loggingdir, $packagename, $staticpath, $relocatablepath, $onepackage, $variableshashref, $filesref, $languagestringref) = @_;
+
+ my $filename = "";
+ my $newline = "";
+ my $newepmdir = $installer::globals::epmoutpath . $installer::globals::separator;
+
+ my $localrelocatablepath = $relocatablepath;
+ if ( $localrelocatablepath ne "/" ) { $localrelocatablepath =~ s/\/\s*$//; }
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ $filename = $packagename . ".pkginfo";
+ $newline = "BASEDIR\=" . $localrelocatablepath . "\n";
+ }
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ # if ( $localrelocatablepath =~ /^\s*$/ ) { $localrelocatablepath = "/"; }; # at least the "/"
+ $filename = $packagename . ".spec";
+ $newline = "Prefix\:\ " . $localrelocatablepath . "\n";
+ }
+
+ my $completefilename = $newepmdir . $filename;
+
+ if ( ! -f $completefilename) { installer::exiter::exit_program("ERROR: Did not find file: $completefilename", "prepare_packages"); }
+ my $changefile = installer::files::read_file($completefilename);
+ if ( $newline ne "" )
+ {
+ add_one_line_into_file($changefile, $newline, $filename);
+ installer::files::save_file($completefilename, $changefile);
+ }
+
+ # my $newepmdir = $completefilename;
+ # installer::pathanalyzer::get_path_from_fullqualifiedname(\$newepmdir);
+
+ # adding new "topdir" and removing old "topdir" in specfile
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ set_topdir_in_specfile($changefile, $filename, $newepmdir);
+ set_autoprovreq_in_specfile($changefile, $onepackage->{'findrequires'}, "$installer::globals::unpackpath" . "/bin");
+ set_packager_in_specfile($changefile);
+ if ( is_extension_package($changefile) ) { set_prereq_in_specfile($changefile); }
+ set_license_in_specfile($changefile, $variableshashref);
+ set_tab_into_datafile($changefile, $filesref);
+ # check_requirements_in_specfile($changefile);
+ installer::files::save_file($completefilename, $changefile);
+ if ( $installer::globals::patch ) { collect_patch_files($changefile, $packagename, $localrelocatablepath); }
+ }
+
+ # removing the relocatable path in prototype file
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ set_revision_in_pkginfo($changefile, $filename, $variableshashref, $packagename);
+ set_maxinst_in_pkginfo($changefile, $filename);
+ set_solaris_parameter_in_pkginfo($changefile, $filename, $variableshashref);
+ if ( $installer::globals::issolarisx86build ) { fix_architecture_setting($changefile); }
+ if ( ! $installer::globals::patch ) { set_patchlist_in_pkginfo_for_respin($changefile, $filename, $variableshashref, $packagename); }
+ if ( $installer::globals::patch ) { include_patchinfos_into_pkginfo($changefile, $filename, $variableshashref); }
+ if (( $onepackage->{'language'} ) && ( $onepackage->{'language'} ne "" ) && ( $onepackage->{'language'} ne "en-US" )) { include_languageinfos_into_pkginfo($changefile, $filename, $languagestringref, $onepackage, $variableshashref); }
+ installer::files::save_file($completefilename, $changefile);
+
+ my $prototypefilename = $packagename . ".prototype";
+ $prototypefilename = $newepmdir . $prototypefilename;
+ if (! -f $prototypefilename) { installer::exiter::exit_program("ERROR: Did not find prototype file: $prototypefilename", "prepare_packages"); }
+
+ my $prototypefile = installer::files::read_file($prototypefilename);
+ make_prototypefile_relocatable($prototypefile, $relocatablepath);
+ set_volatilefile_into_prototypefile($prototypefile, $filesref);
+ my $classesstring = set_tab_into_datafile($prototypefile, $filesref);
+ if ($classesstring)
+ {
+ include_classes_into_pkginfo($changefile, $classesstring);
+ installer::files::save_file($completefilename, $changefile);
+ }
+
+ if ( $installer::globals::patch ) { add_scripts_into_prototypefile($prototypefile, $prototypefilename, $languagestringref, $staticpath); }
+
+ installer::files::save_file($prototypefilename, $prototypefile);
+ if ( $installer::globals::patch ) { collect_patch_files($prototypefile, $packagename, ""); }
+
+ # Adding package names into depend files for Solaris (not supported by epm)
+ my $dependfilename = $packagename . ".depend";
+ $dependfilename = $newepmdir . $dependfilename;
+ if ( -f $dependfilename)
+ {
+ my $dependfile = installer::files::read_file($dependfilename);
+ put_packagenames_into_dependfile($dependfile);
+ installer::files::save_file($dependfilename, $dependfile);
+ }
+ }
+
+ return $newepmdir;
+}
+
+############################################################
+# Linux requirement for perl is changed by epm from
+# /usr/bin/perl to perl .
+# Requires: perl
+############################################################
+
+sub check_requirements_in_specfile
+{
+ my ( $specfile ) = @_;
+
+ for ( my $i = 0; $i <= $#{$specfile}; $i++ )
+ {
+ if (( ${$specfile}[$i] =~ /^\s*Requires/ ) && ( ${$specfile}[$i] =~ /\bperl\b/ ) && ( ! ( ${$specfile}[$i] =~ /\/usr\/bin\/perl\b/ )))
+ {
+ my $oldline = ${$specfile}[$i];
+ ${$specfile}[$i] =~ s/perl/\/usr\/bin\/perl/;
+ my $newline = ${$specfile}[$i];
+
+ $oldline =~ s/\s*$//;
+ $newline =~ s/\s*$//;
+ my $infoline = "Spec File: Changing content from \"$oldline\" to \"$newline\".\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+}
+
+###############################################################################
+# Replacement of PRODUCTINSTALLLOCATION and PRODUCTDIRECTORYNAME in the
+# epm list file.
+# The complete rootpath is stored in $installer::globals::rootpath
+# or for each package in $onepackage->{'destpath'}
+# The static rootpath is stored in $staticpath
+# The relocatable path is stored in $relocatablepath
+# PRODUCTINSTALLLOCATION is the relocatable part ("/opt") and
+# PRODUCTDIRECTORYNAME the static path ("openofficeorg20").
+# In standard epm process:
+# No usage of package specific variables like $BASEDIR, because
+# 1. These variables would be replaced in epm process
+# 2. epm version 3.7 does not support relocatable packages
+###############################################################################
+
+sub resolve_path_in_epm_list_before_packaging
+{
+ my ($listfile, $listfilename, $variable, $path) = @_;
+
+ installer::logger::include_header_into_logfile("Replacing variables in epm list file:");
+
+ $path =~ s/\/\s*$//;
+ replace_variables_in_shellscripts($listfile, $listfilename, $variable, $path);
+
+}
+
+#################################################################
+# Determining the rpm version. Beginning with rpm version 4.0
+# the tool to create RPMs is "rpmbuild" and no longer "rpm"
+#################################################################
+
+sub determine_rpm_version
+{
+ my $rpmversion = 0;
+ my $rpmout = "";
+ my $systemcall = "";
+
+ # my $systemcall = "rpm --version |";
+ # "rpm --version" has problems since LD_LIBRARY_PATH was removed. Therefore the content of $RPM has to be called.
+ # "rpm --version" and "rpmbuild --version" have the same output. Therefore $RPM can be used. Its value
+ # is saved in $installer::globals::rpm
+
+ if ( $installer::globals::rpm ne "" )
+ {
+ $systemcall = "$installer::globals::rpm --version |";
+ }
+ else
+ {
+ $systemcall = "rpm --version |";
+ }
+
+ open (RPM, "$systemcall");
+ $rpmout = <RPM>;
+ close (RPM);
+
+ if ( $rpmout ne "" )
+ {
+ $rpmout =~ s/\s*$//g;
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $rpmout eq "" ) { $infoline = "ERROR: Could not find file \"rpm\" !\n"; }
+ else { $infoline = "Success: rpm version: $rpmout\n"; }
+
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $rpmout =~ /(\d+)\.(\d+)\.(\d+)/ ) { $rpmversion = $1; }
+ elsif ( $rpmout =~ /(\d+)\.(\d+)/ ) { $rpmversion = $1; }
+ elsif ( $rpmout =~ /(\d+)/ ) { $rpmversion = $1; }
+ else { installer::exiter::exit_program("ERROR: Unknown format: $rpmout ! Expected: \"a.b.c\", or \"a.b\", or \"a\"", "determine_rpm_version"); }
+ }
+
+ return $rpmversion;
+}
+
+####################################################
+# Writing some info about rpm into the log file
+####################################################
+
+sub log_rpm_info
+{
+ my $systemcall = "";
+ my $infoline = "";
+
+ $infoline = "\nLogging rpmrc content using --showrc\n\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $installer::globals::rpm ne "" )
+ {
+ $systemcall = "$installer::globals::rpm --showrc |";
+ }
+ else
+ {
+ $systemcall = "rpm --showrc |";
+ }
+
+ my @fullrpmout = ();
+
+ open (RPM, "$systemcall");
+ while (<RPM>) {push(@fullrpmout, $_); }
+ close (RPM);
+
+ if ( $#fullrpmout > -1 )
+ {
+ for ( my $i = 0; $i <= $#fullrpmout; $i++ )
+ {
+ my $rpmout = $fullrpmout[$i];
+ $rpmout =~ s/\s*$//g;
+
+ $infoline = "$rpmout\n";
+ $infoline =~ s/error/e_r_r_o_r/gi; # avoiding log problems
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ else
+ {
+ $infoline = "Problem in systemcall: $systemcall : No return value\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ $infoline = "End of logging rpmrc\n\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+#################################################
+# Systemcall to start the packaging process
+#################################################
+
+sub create_packages_without_epm
+{
+ my ($epmdir, $packagename, $includepatharrayref, $allvariables, $languagestringref) = @_;
+
+ # Solaris: pkgmk -o -f solaris-2.8-sparc/SUNWso8m34.prototype -d solaris-2.8-sparc
+ # Solaris: pkgtrans solaris-2.8-sparc SUNWso8m34.pkg SUNWso8m34
+ # Solaris: tar -cf - SUNWso8m34 | gzip > SUNWso8m34.tar.gz
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ my $prototypefile = $epmdir . $packagename . ".prototype";
+ if (! -f $prototypefile) { installer::exiter::exit_program("ERROR: Did not find file: $prototypefile", "create_packages_without_epm"); }
+
+ my $destinationdir = $prototypefile;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$destinationdir);
+ $destinationdir =~ s/\/\s*$//; # removing ending slashes
+
+ # my $systemcall = "pkgmk -o -f $prototypefile -d $destinationdir \> /dev/null 2\>\&1";
+ my $systemcall = "pkgmk -l 1073741824 -o -f $prototypefile -d $destinationdir 2\>\&1 |";
+ installer::logger::print_message( "... $systemcall ...\n" );
+
+ my $maxpkgmkcalls = 3;
+
+ for ( my $i = 1; $i <= $maxpkgmkcalls; $i++ )
+ {
+ my @pkgmkoutput = ();
+
+ open (PKGMK, "$systemcall");
+ while (<PKGMK>) {push(@pkgmkoutput, $_); }
+ close (PKGMK);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ my $infoline = "Systemcall (Try $i): $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $j = 0; $j <= $#pkgmkoutput; $j++ )
+ {
+ if ( $i < $maxpkgmkcalls ) { $pkgmkoutput[$j] =~ s/\bERROR\b/PROBLEM/ig; }
+ push( @installer::globals::logfileinfo, "$pkgmkoutput[$j]");
+ }
+
+ if ($returnvalue)
+ {
+ $infoline = "Try $i : Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ if ( $i == $maxpkgmkcalls ) { installer::exiter::exit_program("ERROR: \"$systemcall\"!", "create_packages_without_epm"); }
+ }
+ else
+ {
+ installer::logger::print_message( "Success (Try $i): \"$systemcall\"\n" );
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ last;
+ }
+ }
+
+ # It might be necessary to save uncompressed Solaris packages
+
+ if ( $allvariables->{'JDSBUILD'} )
+ {
+ if ( ! $installer::globals::jds_language_controlled )
+ {
+ my $correct_language = installer::worker::check_jds_language($allvariables, $languagestringref);
+ $installer::globals::correct_jds_language = $correct_language;
+ $installer::globals::jds_language_controlled = 1;
+ }
+
+ if ( $installer::globals::correct_jds_language )
+ {
+ if ( $installer::globals::saved_packages_path eq "" )
+ {
+ $packagestempdir = installer::systemactions::create_directories("jds", $languagestringref);
+ $installer::globals::saved_packages_path = $packagestempdir;
+ push(@installer::globals::jdsremovedirs, $packagestempdir);
+ }
+
+ $systemcall = "cd $destinationdir; cp -p -R $packagename $installer::globals::saved_packages_path;";
+ make_systemcall($systemcall);
+ installer::logger::print_message( "... $systemcall ...\n" );
+
+ # Setting unix rights to "775" for all created directories inside the package,
+ # that is saved in temp directory
+
+ $systemcall = "cd $packagestempdir; find $packagename -type d -exec chmod 775 \{\} \\\;";
+ installer::logger::print_message( "... $systemcall ...\n" );
+
+ $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+
+ # compressing packages
+
+ if ( ! $installer::globals::solarisdontcompress )
+ {
+ my $faspac = "faspac-so.sh";
+
+ my $compressorref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$faspac, $includepatharrayref, 0);
+ if ($$compressorref ne "")
+ {
+ # Saving original pkginfo, to set time stamp later
+ my $pkginfoorig = "$destinationdir/$packagename/pkginfo";
+ my $pkginfotmp = "$destinationdir/$packagename" . ".pkginfo.tmp";
+ $systemcall = "cp -p $pkginfoorig $pkginfotmp";
+ make_systemcall($systemcall);
+
+ $faspac = $$compressorref;
+ $infoline = "Found compressor: $faspac\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ installer::logger::print_message( "... $faspac ...\n" );
+ installer::logger::include_timestamp_into_logfile("Starting $faspac");
+
+ $systemcall = "/bin/sh $faspac -a -q -d $destinationdir $packagename"; # $faspac has to be the absolute path!
+ make_systemcall($systemcall);
+
+ # Setting time stamp for pkginfo, because faspac-so.sh changed the pkginfo file,
+ # updated the size and checksum, but not the time stamp.
+ $systemcall = "touch -r $pkginfotmp $pkginfoorig";
+ make_systemcall($systemcall);
+ if ( -f $pkginfotmp ) { unlink($pkginfotmp); }
+
+ installer::logger::include_timestamp_into_logfile("End of $faspac");
+ }
+ else
+ {
+ $infoline = "Not found: $faspac\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ # Setting unix rights to "775" for all created directories inside the package
+
+ $systemcall = "cd $destinationdir; find $packagename -type d -exec chmod 775 \{\} \\\;";
+ installer::logger::print_message( "... $systemcall ...\n" );
+
+ $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ ######################
+ # making pkg files
+ ######################
+
+ # my $streamname = $packagename . ".pkg";
+ # $systemcall = "pkgtrans $destinationdir $streamname $packagename";
+ # print "... $systemcall ...\n";
+
+ # $returnvalue = system($systemcall);
+
+ # $infoline = "Systemcall: $systemcall\n";
+ # push( @installer::globals::logfileinfo, $infoline);
+
+ # if ($returnvalue)
+ # {
+ # $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ # push( @installer::globals::logfileinfo, $infoline);
+ # }
+ # else
+ # {
+ # $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ # push( @installer::globals::logfileinfo, $infoline);
+ # }
+
+ #########################
+ # making tar.gz files
+ #########################
+
+ # my $targzname = $packagename . ".tar.gz";
+ # $systemcall = "cd $destinationdir; tar -cf - $packagename | gzip > $targzname";
+ # print "... $systemcall ...\n";
+
+ # $returnvalue = system($systemcall);
+
+ # $infoline = "Systemcall: $systemcall\n";
+ # push( @installer::globals::logfileinfo, $infoline);
+
+ # if ($returnvalue)
+ # {
+ # $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ # push( @installer::globals::logfileinfo, $infoline);
+ # }
+ # else
+ # {
+ # $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ # push( @installer::globals::logfileinfo, $infoline);
+ # }
+ }
+
+ # Linux: rpm -bb so8m35.spec ( -> dependency check abklemmen? )
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ my $specfilename = $epmdir . $packagename . ".spec";
+ if (! -f $specfilename) { installer::exiter::exit_program("ERROR: Did not find file: $specfilename", "create_packages_without_epm"); }
+
+ # my $rpmcommand = "rpm";
+ my $rpmcommand = $installer::globals::rpm;
+ my $rpmversion = determine_rpm_version();
+
+ # if ( $rpmversion >= 4 ) { $rpmcommand = "rpmbuild"; }
+
+ # saving globally for later usage
+ $installer::globals::rpmcommand = $rpmcommand;
+ $installer::globals::rpmquerycommand = "rpm";
+
+ my $target = "";
+ if ( $installer::globals::compiler =~ /unxlngi/) { $target = "i586"; }
+ elsif ( $installer::globals::compiler =~ /unxlng/) {$target = (POSIX::uname())[4]; }
+
+ # rpm 4.6 ignores buildroot tag in spec file
+
+ my $buildrootstring = "";
+
+ if ( $rpmversion >= 4 )
+ {
+ my $dir = getcwd;
+ my $buildroot = $dir . "/" . $epmdir . "buildroot/";
+ $buildrootstring = "--buildroot=$buildroot";
+ mkdir($buildroot = $dir . "/" . $epmdir . "BUILD/");
+ }
+
+ if ( ! $installer::globals::rpminfologged )
+ {
+ log_rpm_info();
+ $installer::globals::rpminfologged = 1;
+ }
+
+ my $systemcall = "$rpmcommand -bb --define \"_unpackaged_files_terminate_build 0\" $specfilename --target $target $buildrootstring 2\>\&1 |";
+
+ installer::logger::print_message( "... $systemcall ...\n" );
+
+ my $maxrpmcalls = 3;
+ my $rpm_failed = 0;
+
+ for ( my $i = 1; $i <= $maxrpmcalls; $i++ )
+ {
+ my @rpmoutput = ();
+
+ open (RPM, "$systemcall");
+ while (<RPM>) {push(@rpmoutput, $_); }
+ close (RPM);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ my $infoline = "Systemcall (Try $i): $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $j = 0; $j <= $#rpmoutput; $j++ )
+ {
+ # if ( $i < $maxrpmcalls ) { $rpmoutput[$j] =~ s/\bERROR\b/PROBLEM/ig; }
+ $rpmoutput[$j] =~ s/\bERROR\b/PROBLEM/ig;
+ push( @installer::globals::logfileinfo, "$rpmoutput[$j]");
+ }
+
+ if ($returnvalue)
+ {
+ $infoline = "Try $i : Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $rpm_failed = 1;
+ }
+ else
+ {
+ installer::logger::print_message( "Success (Try $i): \"$systemcall\"\n" );
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $rpm_failed = 0;
+ last;
+ }
+ }
+
+ if ( $rpm_failed )
+ {
+ # Because of the problems with LD_LIBARY_PATH, a direct call of local "rpm" or "rpmbuild" might be successful
+ my $rpmprog = "";
+ if ( -f "/usr/bin/rpmbuild" ) { $rpmprog = "/usr/bin/rpmbuild"; }
+ elsif ( -f "/usr/bin/rpm" ) { $rpmprog = "/usr/bin/rpm"; }
+
+ if ( $rpmprog ne "" )
+ {
+ installer::logger::print_message( "... $rpmprog ...\n" );
+
+ my $helpersystemcall = "$rpmprog -bb $specfilename --target $target $buildrootstring 2\>\&1 |";
+
+ my @helperrpmoutput = ();
+
+ open (RPM, "$helpersystemcall");
+ while (<RPM>) {push(@helperrpmoutput, $_); }
+ close (RPM);
+
+ my $helperreturnvalue = $?; # $? contains the return value of the systemcall
+
+ $infoline = "\nLast try: Using $rpmprog directly (problem with LD_LIBARY_PATH)\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ $infoline = "\nSystemcall: $helpersystemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $j = 0; $j <= $#helperrpmoutput; $j++ ) { push( @installer::globals::logfileinfo, "$helperrpmoutput[$j]"); }
+
+ if ($helperreturnvalue)
+ {
+ $infoline = "Could not execute \"$helpersystemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ installer::logger::print_message( "Success: \"$helpersystemcall\"\n" );
+ $infoline = "Success: Executed \"$helpersystemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $rpm_failed = 0;
+ }
+ }
+
+ # Now it is really time to exit this packaging process, if the error still occurs
+ if ( $rpm_failed ) { installer::exiter::exit_program("ERROR: \"$systemcall\"!", "create_packages_without_epm"); }
+ }
+ }
+}
+
+#################################################
+# Removing all temporary files created by epm
+#################################################
+
+sub remove_temporary_epm_files
+{
+ my ($epmdir, $loggingdir, $packagename) = @_;
+
+ # saving the files into the loggingdir
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ my @extensions = ();
+ push(@extensions, ".pkginfo");
+ push(@extensions, ".prototype");
+ push(@extensions, ".postinstall");
+ push(@extensions, ".postremove");
+ push(@extensions, ".preinstall");
+ push(@extensions, ".preremove");
+ push(@extensions, ".depend");
+
+ for ( my $i = 0; $i <= $#extensions; $i++ )
+ {
+ my $removefile = $epmdir . $packagename . $extensions[$i];
+ my $destfile = $loggingdir . $packagename . $extensions[$i] . ".log";
+
+ if (! -f $removefile) { next; }
+
+ my $systemcall = "mv -f $removefile $destfile";
+ system($systemcall); # ignoring the return value
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ # removing the package
+
+# my $removedir = $epmdir . $packagename;
+#
+# my $systemcall = "rm -rf $removedir";
+#
+# print "... $systemcall ...\n";
+#
+# my $returnvalue = system($systemcall);
+#
+# my $infoline = "Systemcall: $systemcall\n";
+# push( @installer::globals::logfileinfo, $infoline);
+#
+# if ($returnvalue)
+# {
+# $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+# push( @installer::globals::logfileinfo, $infoline);
+# }
+# else
+# {
+# $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+# push( @installer::globals::logfileinfo, $infoline);
+# }
+ }
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ my $removefile = $epmdir . $packagename . ".spec";
+ my $destfile = $loggingdir . $packagename . ".spec.log";
+
+ # if (! -f $removefile) { next; }
+
+ my $systemcall = "mv -f $removefile $destfile";
+ system($systemcall); # ignoring the return value
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # removing the directory "buildroot"
+
+ my $removedir = $epmdir . "buildroot";
+
+ $systemcall = "rm -rf $removedir";
+
+ installer::logger::print_message( "... $systemcall ...\n" );
+
+ my $returnvalue = system($systemcall);
+
+ $removedir = $epmdir . "BUILD";
+
+ $systemcall = "rm -rf $removedir";
+
+ installer::logger::print_message( "... $systemcall ...\n" );
+
+ $returnvalue = system($systemcall);
+
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+}
+
+######################################################
+# Making the systemcall
+######################################################
+
+sub make_systemcall
+{
+ my ($systemcall) = @_;
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+###########################################################
+# Creating a better directory structure in the solver.
+###########################################################
+
+sub create_new_directory_structure
+{
+ my ($newepmdir) = @_;
+
+ my $newdir = $installer::globals::epmoutpath;
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ my $rpmdir;
+ my $machine = "";
+ if ( $installer::globals::compiler =~ /unxlngi/) {
+ $rpmdir = "$installer::globals::epmoutpath/RPMS/i586";
+ }
+ elsif ( $installer::globals::compiler =~ /unxlng/) {
+ $machine = (POSIX::uname())[4];
+ $rpmdir = "$installer::globals::epmoutpath/RPMS/$machine";
+ }
+ else { installer::exiter::exit_program("ERROR: rpmdir undefined !", "create_new_directory_structure"); }
+
+ my $systemcall = "mv $rpmdir/* $newdir"; # moving the rpms into the directory "RPMS"
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not move content of \"$rpmdir\" to \"$newdir\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Moved content of \"$rpmdir\" to \"$newdir\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ # and removing the empty directory
+
+ if ( $machine ne "" )
+ {
+ installer::systemactions::remove_empty_directory("$installer::globals::epmoutpath/RPMS/$machine");
+ }
+ installer::systemactions::remove_empty_directory("$installer::globals::epmoutpath/RPMS/x86_64");
+ installer::systemactions::remove_empty_directory("$installer::globals::epmoutpath/RPMS/i586");
+ installer::systemactions::remove_empty_directory("$installer::globals::epmoutpath/RPMS/i386");
+ installer::systemactions::remove_empty_directory("$installer::globals::epmoutpath/RPMS");
+
+ }
+
+ # Setting unix rights to "775" for $newdir ("RPMS" or "packages")
+
+ my $localcall = "chmod 775 $newdir \>\/dev\/null 2\>\&1";
+ my $callreturnvalue = system($localcall);
+
+ my $callinfoline = "Systemcall: $localcall\n";
+ push( @installer::globals::logfileinfo, $callinfoline);
+
+ if ($callreturnvalue)
+ {
+ $callinfoline = "ERROR: Could not execute \"$localcall\"!\n";
+ push( @installer::globals::logfileinfo, $callinfoline);
+ }
+ else
+ {
+ $callinfoline = "Success: Executed \"$localcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $callinfoline);
+ }
+}
+
+######################################################
+# Collect modules with product specific styles.
+######################################################
+
+sub collect_modules_with_style
+{
+ my ($style, $modulesarrayref) = @_;
+
+ my @allmodules = ();
+
+ for ( my $i = 0; $i <= $#{$modulesarrayref}; $i++ )
+ {
+ my $onemodule = ${$modulesarrayref}[$i];
+ my $styles = "";
+ if ( $onemodule->{'Styles'} ) { $styles = $onemodule->{'Styles'}; }
+ if ( $styles =~ /\b\Q$style\E\b/ )
+ {
+ push(@allmodules, $onemodule);
+ }
+ }
+
+ return \@allmodules;
+}
+
+######################################################
+# Remove modules without packagecontent.
+######################################################
+
+sub remove_modules_without_package
+{
+ my ($allmodules) = @_;
+
+ my @allmodules = ();
+
+ for ( my $i = 0; $i <= $#{$allmodules}; $i++ )
+ {
+ my $onemodule = ${$allmodules}[$i];
+ my $packagename = "";
+ if ( $onemodule->{'PackageName'} ) { $packagename = $onemodule->{'PackageName'}; }
+ if ( $packagename ne "" )
+ {
+ push(@allmodules, $onemodule);
+ }
+ }
+
+ return \@allmodules;
+}
+
+######################################################
+# Unpacking tar.gz file and setting new packagename.
+######################################################
+
+sub unpack_tar_gz_file
+{
+ my ($packagename, $destdir) = @_;
+
+ my $newpackagename = "";
+
+ if ( $packagename =~ /\.tar\.gz\s*$/ )
+ {
+ # Collecting all packages in directory "packages"
+ my $oldcontent = installer::systemactions::read_directory($destdir);
+
+ # unpacking gunzip
+ my $systemcall = "cd $destdir; cat $packagename | gunzip | tar -xf -";
+ make_systemcall($systemcall);
+
+ # deleting the tar.gz files
+ $systemcall = "cd $destdir; rm -f $packagename";
+ make_systemcall($systemcall);
+
+ # Finding new content -> that is the package name
+ my ($newcontent, $allcontent ) = installer::systemactions::find_new_content_in_directory($destdir, $oldcontent);
+ $newpackagename = ${$newcontent}[0];
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$newpackagename);
+ }
+
+ if ( $newpackagename ne "" ) { $packagename = $newpackagename; }
+
+ return $packagename;
+}
+
+######################################################
+# Copying files of child projects.
+######################################################
+
+sub copy_childproject_files
+{
+ my ($allmodules, $sopackpath, $destdir, $modulesarrayref, $allvariables, $subdir, $includepatharrayref, $use_sopackpath) = @_;
+
+ for ( my $i = 0; $i <= $#{$allmodules}; $i++ )
+ {
+ my $localdestdir = $destdir;
+ my $onemodule = ${$allmodules}[$i];
+ my $packagename = $onemodule->{'PackageName'};
+ my $sourcefile = "";
+ if ( $use_sopackpath )
+ {
+ $sourcefile = $sopackpath . $installer::globals::separator . $installer::globals::compiler . $installer::globals::separator . $subdir . $installer::globals::separator . $packagename;
+ }
+ else
+ {
+ my $sourcepathref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$packagename, $includepatharrayref, 1);
+ $sourcefile = $$sourcepathref;
+ }
+
+ if ( ! -f $sourcefile ) { installer::exiter::exit_program("ERROR: File not found: $sourcefile ($packagename) !", "copy_childproject_files"); }
+ if ( $onemodule->{'Subdir'} )
+ {
+ $localdestdir = $localdestdir . $installer::globals::separator . $onemodule->{'Subdir'};
+ if ( ! -d $localdestdir ) { installer::systemactions::create_directory($localdestdir); }
+ }
+ installer::systemactions::copy_one_file($sourcefile, $localdestdir);
+ # Solaris: unpacking tar.gz files and setting new packagename
+ if ( $installer::globals::issolarispkgbuild ) { $packagename = unpack_tar_gz_file($packagename, $localdestdir); }
+
+ if (( $installer::globals::isxpdplatform ) && ( $allvariables->{'XPDINSTALLER'} ))
+ {
+ installer::xpdinstaller::create_xpd_file_for_childproject($onemodule, $localdestdir, $packagename, $allvariableshashref, $modulesarrayref);
+ }
+ }
+
+}
+
+######################################################
+# Copying files for system integration.
+######################################################
+
+sub copy_and_unpack_tar_gz_files
+{
+ my ($sourcefile, $destdir) = @_;
+
+ my $systemcall = "cd $destdir; cat $sourcefile | gunzip | tar -xf -";
+ make_systemcall($systemcall);
+}
+
+######################################################
+# Including child packages into the
+# installation set.
+######################################################
+
+sub put_childprojects_into_installset
+{
+ my ($newdir, $allvariables, $modulesarrayref, $includepatharrayref) = @_;
+
+ my $infoline = "";
+
+ my $sopackpath = "";
+ if ( $ENV{'SO_PACK'} ) { $sopackpath = $ENV{'SO_PACK'}; }
+ else { installer::exiter::exit_program("ERROR: Environment variable SO_PACK not set!", "put_childprojects_into_installset"); }
+
+ my $destdir = "$newdir";
+
+ # adding Java
+
+ my $sourcefile = "";
+
+ # Finding the modules defined in scp (with flag JAVAMODULE, ADAMODULE, ...)
+ # Getting name of package from scp-Module
+ # Copy file into installation set
+ # Create xpd file and put it into xpd directory
+ # xpd file has to be created completely from module and package itself (-> no packagelist!)
+
+ if ( $allvariables->{'JAVAPRODUCT'} )
+ {
+ # Collect all modules with flag "JAVAMODULE"
+ my $allmodules = collect_modules_with_style("JAVAMODULE", $modulesarrayref);
+ $allmodules = remove_modules_without_package($allmodules);
+ copy_childproject_files($allmodules, $sopackpath, $destdir, $modulesarrayref, $allvariables, "jre", $includepatharrayref, 1);
+ }
+
+ # Adding additional required packages (freetype).
+ # This package names are stored in global array @installer::globals::requiredpackages
+
+ if ( $allvariables->{'ADDREQUIREDPACKAGES'} )
+ {
+ # Collect all modules with flag "REQUIREDPACKAGEMODULE"
+ my $allmodules = collect_modules_with_style("REQUIREDPACKAGEMODULE", $modulesarrayref);
+ $allmodules = remove_modules_without_package($allmodules);
+ copy_childproject_files($allmodules, $sopackpath, $destdir, $modulesarrayref, $allvariables, "requiredpackages", $includepatharrayref, 1);
+ }
+
+ # Collect all modules with flag "USERLANDMODULE"
+ my $alluserlandmodules = collect_modules_with_style("USERLANDMODULE", $modulesarrayref);
+ $alluserlandmodules = remove_modules_without_package($alluserlandmodules);
+ copy_childproject_files($alluserlandmodules, $sopackpath, $destdir, $modulesarrayref, $allvariables, "", $includepatharrayref, 0);
+
+}
+
+######################################################
+# Checking whether the new content is a directory and
+# not a package. If it is a directory, the complete
+# content of the directory has to be added to the
+# array newcontent.
+######################################################
+
+sub control_subdirectories
+{
+ my ($content, $subdir) = @_;
+
+ my @newcontent = ();
+
+ for ( my $i = 0; $i <= $#{$content}; $i++ )
+ {
+ if ( -d ${$content}[$i] )
+ {
+ $subdir = ${$content}[$i];
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$subdir);
+ my $allpackages = installer::systemactions::read_directory(${$content}[$i]);
+ for ( my $j = 0; $j <= $#{$allpackages}; $j++ )
+ {
+ # Currently only Linux rpm is supported, debian packages cannot be installed via xpd installer
+ if (( $installer::globals::islinuxbuild ) && ( ! ( ${$allpackages}[$j] =~ /\.rpm\s*$/ ))) { next; }
+ push(@newcontent, ${$allpackages}[$j]);
+ }
+ }
+ else
+ {
+ push(@newcontent, ${$content}[$i]);
+ }
+ }
+
+ return (\@newcontent, $subdir);
+}
+
+######################################################
+# Including the system integration files into the
+# installation sets.
+######################################################
+
+sub put_systemintegration_into_installset
+{
+ my ($newdir, $includepatharrayref, $allvariables, $modulesarrayref) = @_;
+
+ my $destdir = $newdir;
+
+ # adding System integration files
+
+ my $sourcefile = "";
+
+ # Finding the modules defined in scp (with flag SYSTEMMODULE)
+ # Getting name of package from scp-Module
+ # Search package in list off all include files
+ # Copy file into installation set and unpack it (always tar.gz)
+ # Create xpd file and put it into xpd directory
+ # tar.gz can contain a different number of packages -> automatically create hidden sub modules
+ # xpd file has to be created completely from module and package itself (-> no packagelist!)
+
+ # Collect all modules with flag "SYSTEMMODULE"
+ my $allmodules = collect_modules_with_style("SYSTEMMODULE", $modulesarrayref);
+ $allmodules = remove_modules_without_package($allmodules);
+
+ for ( my $i = 0; $i <= $#{$allmodules}; $i++ )
+ {
+ my $onemodule = ${$allmodules}[$i];
+ my $packagetarfilename = $onemodule->{'PackageName'};
+
+ my $infoline = "Including into installation set: $packagetarfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $sourcepathref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$packagetarfilename, $includepatharrayref, 1);
+ if ( $$sourcepathref eq "" ) { installer::exiter::exit_program("ERROR: Source path not found for $packagetarfilename!", "copy_systemintegration_files"); }
+
+ # Collecting all packages in directory "packages" or "RPMS"
+ my $oldcontent = installer::systemactions::read_directory($destdir);
+
+ copy_and_unpack_tar_gz_files($$sourcepathref, $destdir);
+
+ # Finding new content -> that is the package name
+ my ($newcontent, $allcontent ) = installer::systemactions::find_new_content_in_directory($destdir, $oldcontent);
+
+ # special handling, if new content is a directory
+ my $subdir = "";
+ if ( ! $installer::globals::issolarispkgbuild ) { ($newcontent, $subdir) = control_subdirectories($newcontent); }
+
+ # Adding license content into Solaris packages
+ if (( $installer::globals::issolarispkgbuild ) && ( $installer::globals::englishlicenseset ) && ( ! $variableshashref->{'NO_LICENSE_INTO_COPYRIGHT'} )) { installer::worker::add_license_into_systemintegrationpackages($destdir, $newcontent); }
+
+ if (( $installer::globals::isxpdplatform ) && ( $allvariables->{'XPDINSTALLER'} ))
+ {
+ installer::xpdinstaller::create_xpd_file_for_systemintegration($onemodule, $newcontent, $modulesarrayref, $subdir);
+ }
+ }
+}
+
+######################################################
+# Analyzing the Unix installation path.
+# From the installation path /opt/openofficeorg20
+# is the part /opt relocatable and the part
+# openofficeorg20 static.
+######################################################
+
+sub analyze_rootpath
+{
+ my ($rootpath, $staticpathref, $relocatablepathref, $allvariables) = @_;
+
+ $rootpath =~ s/\/\s*$//; # removing ending slash
+
+ ##############################################################
+ # Version 1: "/opt" is variable and "openofficeorg20" fixed
+ ##############################################################
+
+ # my $staticpath = $rootpath;
+ # installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$staticpath);
+ # $$staticpathref = $staticpath; # will be "openofficeorg20"
+
+ # my $relocatablepath = $rootpath;
+ # installer::pathanalyzer::get_path_from_fullqualifiedname(\$relocatablepath);
+ # $$relocatablepathref = $relocatablepath; # will be "/opt/"
+
+ ##############################################################
+ # Version 2: "/opt/openofficeorg20" is variable and "" fixed
+ ##############################################################
+
+ # if ( $$relocatablepathref eq "" ) # relocatablepath is not defined in package list
+ # {
+ # $$staticpathref = ""; # will be ""
+ # $$relocatablepathref = $rootpath . "\/"; # relocatable path must end with "/", will be "/opt/openofficeorg20/"
+ # # setting the static path to the hostname of the directory with style OFFICEDIRECTORY
+ # if ( $allvariables->{'SETSTATICPATH'} ) { $$staticpathref = $installer::globals::officedirhostname; }
+ #
+ # }
+ # else # relocatablepath is defined in package list
+ # {
+ # $$relocatablepathref =~ s/\/\s*$//; # removing ending slash
+ # $$relocatablepathref = $$relocatablepathref . "\/"; # relocatable path must end with "/"
+ # my $staticpath = $rootpath;
+ # $staticpath =~ s/\Q$$relocatablepathref\E//;
+ # $staticpath =~ s/\/\s*$//;
+ # $$staticpathref = $staticpath;
+ # }
+
+ ##############################################################
+ # Version 3: "/" is variable and "/opt/openofficeorg20" fixed
+ ##############################################################
+
+ $$relocatablepathref = "/";
+ # Static path has to contain the office directory name. This is replaced in shellscripts.
+ $$staticpathref = $rootpath . $installer::globals::separator . $installer::globals::officedirhostname;
+ # For RPM version 3.x it is required, that Prefix is not "/" in spec file. In this case --relocate will not work,
+ # because RPM 3.x says, that the package is not relocatable. Therefore we have to use Prefix=/opt and for
+ # all usages of --relocate this path has to be on both sides of the "=": --relocate /opt=<myselectdir>/opt .
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ $$relocatablepathref = $rootpath . "\/"; # relocatable path must end with "/", will be "/opt/"
+ $$staticpathref = $installer::globals::officedirhostname; # to be used as replacement in shell scripts
+ }
+
+ if ( $installer::globals::islinuxdebbuild )
+ {
+ $$relocatablepathref = "";
+ # $$staticpathref is already "/opt/openoffice.org3", no additional $rootpath required.
+ # $$staticpathref = $rootpath . $installer::globals::separator . $$staticpathref; # no relocatibility for Debian
+ }
+
+}
+
+######################################################
+# Including license and readme into
+# Unix installation sets.
+######################################################
+
+sub put_installsetfiles_into_installset
+{
+ my ($destdir) = @_;
+
+ # All files for the installation set are saved in the global
+ # array @installer::globals::installsetfiles
+
+ for ( my $i = 0; $i <= $#installer::globals::installsetfiles; $i++ )
+ {
+ my $onefile = $installer::globals::installsetfiles[$i];
+ my $sourcefile = $onefile->{'sourcepath'};
+ my $destfile = "";
+ if ( $installer::globals::addjavainstaller ) { $destfile = $onefile->{'Name'}; }
+ else { $destfile = $destdir . $installer::globals::separator . $onefile->{'Name'}; }
+ installer::systemactions::copy_one_file($sourcefile, $destfile);
+
+ my $infoline = "Adding to installation set \"$destfile\" from source \"$sourcefile\".\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+######################################################
+# Replacing one variable in patchinfo file
+######################################################
+
+sub replace_one_variable_in_file
+{
+ my ( $file, $placeholder, $value ) = @_;
+
+ for ( my $i = 0; $i <= $#{$file}; $i++ )
+ {
+ ${$file}[$i] =~ s/$placeholder/$value/g;
+ }
+}
+
+######################################################
+# Setting variables in the patchinfo file
+######################################################
+
+sub set_patchinfo
+{
+ my ( $patchinfofile, $patchid, $allvariables ) = @_;
+
+ # Setting: PATCHIDPLACEHOLDER and ARCHITECTUREPLACEHOLDER and PATCHCORRECTSPLACEHOLDER
+
+ replace_one_variable_in_file($patchinfofile, "PATCHIDPLACEHOLDER", $patchid);
+
+ my $architecture = "";
+ if ( $installer::globals::issolarissparcbuild ) { $architecture = "sparc"; }
+ if ( $installer::globals::issolarisx86build ) { $architecture = "i386"; }
+
+ replace_one_variable_in_file($patchinfofile, "ARCHITECTUREPLACEHOLDER", $architecture);
+
+ if ( ! $allvariables->{'SOLARISPATCHCORRECTS'} ) { installer::exiter::exit_program("ERROR: No setting for PATCH_CORRECTS in zip list file!", "set_patchinfo"); }
+ my $patchcorrects = $allvariables->{'SOLARISPATCHCORRECTS'};
+
+ replace_one_variable_in_file($patchinfofile, "PATCHCORRECTSPLACEHOLDER", $patchcorrects);
+
+ # Setting also PATCH_REQUIRES in patch info file, if entry in zip list file exists
+ my $requiresstring = "";
+ if ( $installer::globals::issolarissparcbuild ) { $requiresstring = "SOLSPARCPATCHREQUIRES"; }
+ if ( $installer::globals::issolarisx86build ) { $requiresstring = "SOLIAPATCHREQUIRES"; }
+
+ if ( $allvariables->{$requiresstring} )
+ {
+ my $newline = "PATCH_REQUIRES=\"" . $allvariables->{$requiresstring} . "\"" . "\n";
+ push(@{$patchinfofile}, $newline);
+ }
+}
+
+######################################################
+# Finalizing patch: Renaming directory and
+# including additional patch files.
+######################################################
+
+sub finalize_patch
+{
+ my ( $newepmdir, $allvariables ) = @_;
+
+ my $patchidname = "SOLSPARCPATCHID";
+ if ( $installer::globals::issolarisx86build ) { $patchidname = "SOLIAPATCHID"; }
+
+ if ( ! $allvariables->{$patchidname} ) { installer::exiter::exit_program("ERROR: Variable $patchidname not defined in zip list file!", "finalize_patch"); }
+ my $patchid = $allvariables->{$patchidname};
+ installer::systemactions::rename_directory($newepmdir, $patchid);
+
+ # Copying all typical patch files into the patch directory
+ # All patch file names are stored in @installer::globals::solarispatchfiles
+ # Location of the file is $installer::globals::patchincludepath
+
+ my $sourcepath = $installer::globals::patchincludepath;
+ $sourcepath =~ s/\/\s*$//;
+
+ for ( my $i = 0; $i <= $#installer::globals::solarispatchfiles; $i++ )
+ {
+ my $sourcefile = $sourcepath . $installer::globals::separator . $installer::globals::solarispatchfiles[$i];
+ my $destfile = $patchid . $installer::globals::separator . $installer::globals::solarispatchfiles[$i];
+ installer::systemactions::copy_one_file($sourcefile, $destfile);
+ }
+
+ # And editing the patchinfo file
+
+ my $patchinfofilename = $patchid . $installer::globals::separator . "patchinfo";
+ my $patchinfofile = installer::files::read_file($patchinfofilename);
+ set_patchinfo($patchinfofile, $patchid, $allvariables);
+ installer::files::save_file($patchinfofilename, $patchinfofile);
+}
+
+######################################################
+# Finalizing Linux patch: Renaming directory and
+# including additional patch files.
+######################################################
+
+sub finalize_linux_patch
+{
+ my ( $newepmdir, $allvariables, $includepatharrayref ) = @_;
+
+ # Copying the setup into the patch directory
+ # and including the list of RPMs into it
+
+ print "... creating patch setup ...\n";
+
+ installer::logger::include_header_into_logfile("Creating Linux patch setup:");
+
+ # find and read setup script template
+
+ my $scriptfilename = "linuxpatchscript.sh";
+ my $scriptref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$scriptfilename, $includepatharrayref, 0);
+ if ($$scriptref eq "") { installer::exiter::exit_program("ERROR: Could not find patch script template $scriptfilename!", "finalize_linux_patch"); }
+ my $scriptfile = installer::files::read_file($$scriptref);
+
+ my $infoline = "Found script file $scriptfilename: $$scriptref \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Collecting all RPMs in the patch directory
+
+ my $fileextension = "rpm";
+ my $rpmfiles = installer::systemactions::find_file_with_file_extension($fileextension, $newepmdir);
+ if ( ! ( $#{$rpmfiles} > -1 )) { installer::exiter::exit_program("ERROR: Could not find rpm in directory $newepmdir!", "finalize_linux_patch"); }
+ for ( my $i = 0; $i <= $#{$rpmfiles}; $i++ ) { installer::pathanalyzer::make_absolute_filename_to_relative_filename(\${$rpmfiles}[$i]); }
+
+# my $installline = "";
+#
+# for ( my $i = 0; $i <= $#{$rpmfiles}; $i++ )
+# {
+# $installline = $installline . " rpm --prefix \$PRODUCTINSTALLLOCATION -U $newepmdir/${$rpmfiles}[$i]\n";
+# }
+#
+# $installline =~ s/\s*$//;
+#
+# for ( my $j = 0; $j <= $#{$scriptfile}; $j++ )
+# {
+# ${$scriptfile}[$j] =~ s/INSTALLLINES/$installline/;
+# }
+
+ # Searching packagename containing -core01
+ my $found_package = 0;
+ my $searchpackagename = "";
+ for ( my $i = 0; $i <= $#{$rpmfiles}; $i++ )
+ {
+ if ( ${$rpmfiles}[$i] =~ /-core01-/ )
+ {
+ $searchpackagename = ${$rpmfiles}[$i];
+ $found_package = 1;
+ if ( $searchpackagename =~ /^\s*(.*?-core01)-.*/ ) { $searchpackagename = $1; }
+ last;
+ }
+ }
+
+ if ( ! $found_package ) { installer::exiter::exit_program("ERROR: No package containing \"-core01\" found in directory \"$newepmdir\"", "finalize_linux_patch"); }
+
+ # Replacing the searchpackagename
+ for ( my $j = 0; $j <= $#{$scriptfile}; $j++ ) { ${$scriptfile}[$j] =~ s/SEARCHPACKAGENAMEPLACEHOLDER/$searchpackagename/; }
+
+ # Setting the PRODUCTDIRECTORYNAME to $installer::globals::officedirhostname
+ for ( my $j = 0; $j <= $#{$scriptfile}; $j++ ) { ${$scriptfile}[$j] =~ s/PRODUCTDIRECTORYNAME/$installer::globals::officedirhostname/; }
+
+ # Replacing the productname
+ my $productname = $allvariables->{'PRODUCTNAME'};
+ $productname = lc($productname);
+ $productname =~ s/ /_/g; # abc office -> abc_office
+# $productname =~ s/\.//g; # openoffice.org -> openofficeorg
+
+ $infoline = "Adding productname $productname into Linux patch script\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $j = 0; $j <= $#{$scriptfile}; $j++ ) { ${$scriptfile}[$j] =~ s/PRODUCTNAMEPLACEHOLDER/$productname/; }
+
+ # Saving the file
+
+ my $newscriptfilename = "setup"; # $newepmdir . $installer::globals::separator . "setup";
+ installer::files::save_file($newscriptfilename, $scriptfile);
+
+ $infoline = "Saved Linux patch setup $newscriptfilename \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Setting unix rights 755
+ my $localcall = "chmod 775 $newscriptfilename \>\/dev\/null 2\>\&1";
+ system($localcall);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/existence.pm b/solenv/bin/modules/installer/existence.pm
new file mode 100644
index 000000000000..1ecf9ce9965b
--- /dev/null
+++ b/solenv/bin/modules/installer/existence.pm
@@ -0,0 +1,190 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::existence;
+
+#############################
+# Test of existence
+#############################
+
+sub exists_in_array
+{
+ my ($searchstring, $arrayref) = @_;
+
+ my $alreadyexists = 0;
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ if ( ${$arrayref}[$i] eq $searchstring)
+ {
+ $alreadyexists = 1;
+ last;
+ }
+ }
+
+ return $alreadyexists;
+}
+
+sub exists_in_array_of_hashes
+{
+ my ($searchkey, $searchvalue, $arrayref) = @_;
+
+ my $valueexists = 0;
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ my $hashref = ${$arrayref}[$i];
+
+ if ( $hashref->{$searchkey} eq $searchvalue )
+ {
+ $valueexists = 1;
+ last;
+ }
+ }
+
+ return $valueexists;
+}
+
+#####################################################################
+# Returning a specified file as base for the new
+# configuration file, defined by its "gid"
+#####################################################################
+
+sub get_specified_file
+{
+ my ($filesarrayref, $searchgid) = @_;
+
+ my $foundfile = 0;
+ my $onefile;
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ $onefile = ${$filesarrayref}[$i];
+ my $filegid = $onefile->{'gid'};
+
+ if ( $filegid eq $searchgid )
+ {
+ $foundfile = 1;
+ last;
+ }
+ }
+
+ my $errorline = "ERROR: Could not find file $searchgid in list of files!";
+
+ if ( $installer::globals::patch) { $errorline = "ERROR: Could not find file $searchgid in list of files! intro.bmp must be part of every patch. Please assign the flag PATCH in scp2 project."; }
+
+ if (!($foundfile))
+ {
+ installer::exiter::exit_program($errorline, "get_specified_file");
+ }
+
+ return $onefile;
+}
+
+#####################################################################
+# Returning a specified file as base for a new file,
+# defined by its "Name"
+#####################################################################
+
+sub get_specified_file_by_name
+{
+ my ($filesarrayref, $searchname) = @_;
+
+ my $foundfile = 0;
+ my $onefile;
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ $onefile = ${$filesarrayref}[$i];
+ my $filename = $onefile->{'Name'};
+
+ if ( $filename eq $searchname )
+ {
+ $foundfile = 1;
+ last;
+ }
+ }
+
+ if (!($foundfile))
+ {
+ installer::exiter::exit_program("ERROR: Could not find file $searchname in list of files!", "get_specified_file_by_name");
+ }
+
+ return $onefile;
+}
+
+#####################################################################
+# Checking existence of a specific file, defined by its "Name"
+#####################################################################
+
+sub filename_exists_in_filesarray
+{
+ my ($filesarrayref, $searchname) = @_;
+
+ my $foundfile = 0;
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $filename = $onefile->{'Name'};
+
+ if ( $filename eq $searchname )
+ {
+ $foundfile = 1;
+ last;
+ }
+ }
+
+ return $foundfile;
+}
+
+#####################################################################
+# Checking existence of a specific file, defined by its "gid"
+#####################################################################
+
+sub filegid_exists_in_filesarray
+{
+ my ($filesarrayref, $searchgid) = @_;
+
+ my $foundfile = 0;
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $filegid = $onefile->{'gid'};
+
+ if ( $filegid eq $searchgid )
+ {
+ $foundfile = 1;
+ last;
+ }
+ }
+
+ return $foundfile;
+}
+
+1;
diff --git a/solenv/bin/modules/installer/exiter.pm b/solenv/bin/modules/installer/exiter.pm
new file mode 100644
index 000000000000..d5976f428b93
--- /dev/null
+++ b/solenv/bin/modules/installer/exiter.pm
@@ -0,0 +1,113 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::exiter;
+
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::systemactions;
+use installer::worker;
+
+############################################
+# Exiting the program with an error
+# This function is used instead of "die"
+############################################
+
+sub exit_program
+{
+ my ($message, $function) = @_;
+
+ # If an installation set is currently created, the directory name is saved in $installer::globals::saveinstalldir
+ # If this directory name matches with "_inprogress", it has to be renamed into "_witherror"
+
+ if ( $installer::globals::saveinstalldir =~ /_inprogress/ ) { installer::systemactions::rename_string_in_directory($installer::globals::saveinstalldir, "_inprogress", "_witherror"); }
+
+ # Cleaning files from pool tooling
+ if ( $installer::globals::processhaspoolcheckfile ) { unlink $installer::globals::poolcheckfilename; }
+ if ( $installer::globals::processhaspoollockfile ) { unlink $installer::globals::poollockfilename; }
+
+ installer::worker::clean_output_tree(); # removing directories created in the output tree
+
+ # If @installer::globals::logfileinfo is not empty, it can be used.
+ # Otherwise the content of @installer::globals::globallogfileinfo has to be used.
+
+ my $infoline;
+
+ $installer::globals::logfilename = $installer::globals::exitlog . $installer::globals::logfilename;
+
+ if ( ! $installer::globals::globalinfo_copied ) { installer::logger::copy_globalinfo_into_logfile(); }
+
+ if ( $#installer::globals::logfileinfo > -1 )
+ {
+ $infoline = "\n***************************************************************\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ $infoline = "$message\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ $infoline = "in function: $function\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ $infoline = "***************************************************************\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ installer::files::save_file($installer::globals::logfilename ,\@installer::globals::logfileinfo);
+ }
+ else
+ {
+ $infoline = "\n***************************************************************\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ $infoline = "$message\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ $infoline = "in function: $function\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ $infoline = "***************************************************************\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ installer::files::save_file($installer::globals::logfilename ,\@installer::globals::globallogfileinfo);
+ }
+ installer::logger::print_error("$message\nin function: $function");
+ installer::logger::print_error("Saved logfile: $installer::globals::logfilename\n");
+
+ # Saving the debug info
+
+ if ( $installer::globals::debug ) { installer::logger::savedebug($installer::globals::exitlog); }
+
+ installer::logger::stoptime();
+
+ if (defined($installer::globals::exithandler)) {
+ &$installer::globals::exithandler;
+ }
+
+ exit(-1);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/files.pm b/solenv/bin/modules/installer/files.pm
new file mode 100644
index 000000000000..73ea26738b05
--- /dev/null
+++ b/solenv/bin/modules/installer/files.pm
@@ -0,0 +1,219 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::files;
+
+use installer::exiter;
+use installer::logger;
+
+############################################
+# File Operations
+############################################
+
+sub check_file
+{
+ my ($arg) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::files::check_file : $arg"); }
+
+ if(!( -f $arg ))
+ {
+ installer::exiter::exit_program("ERROR: Cannot find file $arg", "check_file");
+ }
+}
+
+sub read_file
+{
+ my ($localfile) = @_;
+ my @localfile = ();
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::files::read_file : $localfile"); }
+
+ open( IN, "<$localfile" ) || installer::exiter::exit_program("ERROR: Cannot open file $localfile for reading", "read_file");
+
+# Don't use "my @localfile = <IN>" here, because
+# perl has a problem with the internal "large_and_huge_malloc" function
+# when calling perl using MacOS 10.5 with a perl built with MacOS 10.4
+ while ( $line = <IN> ) {
+ push @localfile, $line;
+ }
+
+ close( IN );
+
+ return \@localfile;
+}
+
+###########################################
+# Saving files, arrays and hashes
+###########################################
+
+sub save_file
+{
+ my ($savefile, $savecontent) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::files::save_file : $savefile : $#{$savecontent}"); }
+
+ if ( open( OUT, ">$savefile" ) )
+ {
+ print OUT @{$savecontent};
+ close( OUT);
+ }
+ else
+ {
+ # it is useless to save a log file, if there is no write access
+
+ if ( $savefile =~ /\.log/ )
+ {
+ print "\n*************************************************\n";
+ print "ERROR: Cannot write log file: $savefile";
+ print "\n*************************************************\n";
+ exit(-1); # exiting the program to avoid endless loops
+ }
+
+ installer::exiter::exit_program("ERROR: Cannot open file $savefile for writing", "save_file");
+ }
+}
+
+sub save_hash
+{
+ my ($savefile, $hashref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::files::save_hash : $savefile"); }
+
+ my @printcontent = ();
+
+ my $itemkey;
+
+ foreach $itemkey ( keys %{$hashref} )
+ {
+ my $line = "";
+ my $itemvalue = $hashref->{$itemkey};
+ $line = $itemkey . "=" . $itemvalue . "\n";
+ push(@printcontent, $line);
+ }
+
+ open( OUT, ">$savefile" ) || installer::exiter::exit_program("ERROR: Cannot open file $savefile for writing", "save_hash");
+ print OUT @printcontent;
+ close( OUT);
+}
+
+sub save_array_of_hashes
+{
+ my ($savefile, $arrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::files::save_array_of_hashes : $savefile : $#{$arrayref}"); }
+
+ my @printcontent = ();
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ my $line = "";
+ my $hashref = ${$arrayref}[$i];
+ my $itemkey;
+
+ foreach $itemkey ( keys %{$hashref} )
+ {
+ my $itemvalue = $hashref->{$itemkey};
+ $line = $line . $itemkey . "=" . $itemvalue . "\t";
+ }
+
+ $line = $line . "\n";
+
+ push(@printcontent, $line);
+ }
+
+ open( OUT, ">$savefile" ) || installer::exiter::exit_program("ERROR: Cannot open file $savefile for writing", "save_array_of_hashes");
+ print OUT @printcontent;
+ close( OUT);
+}
+
+sub save_array_of_hashes_modules
+{
+ my ($savefile, $arrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::files::save_array_of_hashes : $savefile : $#{$arrayref}"); }
+
+ my @printcontent = ();
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ my $line = "***************************************************\n";
+ my $hashref = ${$arrayref}[$i];
+ my $itemkey;
+
+ foreach $itemkey ( keys %{$hashref} )
+ {
+ my $itemvalue = $hashref->{$itemkey};
+ $line = $line . $itemkey . "=" . $itemvalue . "\n";
+ }
+
+ $line = $line . "\n";
+
+ push(@printcontent, $line);
+ }
+
+ open( OUT, ">$savefile" ) || installer::exiter::exit_program("ERROR: Cannot open file $savefile for writing", "save_array_of_hashes");
+ print OUT @printcontent;
+ close( OUT);
+}
+
+###########################################
+# Binary file operations
+###########################################
+
+sub read_binary_file
+{
+ my ($filename) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::files::read_binary_file : $filename"); }
+
+ my $file;
+
+ open( IN, "<$filename" ) || installer::exiter::exit_program("ERROR: Cannot open file $filename for reading", "read_binary_file");
+ binmode IN;
+ seek IN, 0, 2;
+ my $length = tell IN;
+ seek IN, 0, 0;
+ read IN, $file, $length;
+ close IN;
+
+ return $file;
+}
+
+sub save_binary_file
+{
+ my ($file, $filename) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::files::save_binary_file : $filename"); }
+
+ open( OUT, ">$filename" ) || installer::exiter::exit_program("ERROR: Cannot open file $filename for writing", "save_binary_file");
+ binmode OUT;
+ print OUT $file;
+ close OUT;
+}
+
+1;
diff --git a/solenv/bin/modules/installer/followme.pm b/solenv/bin/modules/installer/followme.pm
new file mode 100644
index 000000000000..1abc035d5615
--- /dev/null
+++ b/solenv/bin/modules/installer/followme.pm
@@ -0,0 +1,215 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::followme;
+
+use File::Spec;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::systemactions;
+
+####################################################
+# Creating a file, that contains all information
+# to create a follow up process.
+####################################################
+
+sub save_followme_info
+{
+ my ($finalinstalldir, $includepatharrayref, $allvariableshashref, $downloadname, $languagestringref, $languagesarrayref, $current_install_number, $loggingdir, $installlogdir) = @_;
+
+ my $downloadinfofilename = $installer::globals::logfilename;
+ if ( $installer::globals::updatepack ) { $downloadinfofilename =~ s/log_/log_$current_install_number\_/; }
+ $downloadinfofilename =~ s/log_/follow_me_/;
+
+ # Creating directory
+ my $downloadinfodir = installer::systemactions::create_directory_next_to_directory($finalinstalldir, "follow_me");
+
+ my @filecontent = ();
+
+ push(@filecontent, "finalinstalldir: $finalinstalldir\n");
+ push(@filecontent, "downloadname: $downloadname\n");
+ push(@filecontent, "currentinstallnumber: $current_install_number\n");
+ push(@filecontent, "loggingdir: $loggingdir\n");
+ push(@filecontent, "installlogdir: $installlogdir\n");
+ push(@filecontent, "languagestring: $$languagestringref\n");
+ foreach my $element ( @{$languagesarrayref} ) { push(@filecontent, "languagesarray: $element\n"); }
+ foreach my $path ( @{$includepatharrayref} ) { push(@filecontent, "includepatharray: $path"); }
+ foreach my $key ( sort keys %{$allvariableshashref} ) { push(@filecontent, "allvariableshash: $key : $allvariableshashref->{$key}\n"); }
+ push(@filecontent, "globals:updatepack: $installer::globals::updatepack\n");
+ push(@filecontent, "globals:added_english: $installer::globals::added_english\n");
+ push(@filecontent, "globals:iswindowsbuild: $installer::globals::iswindowsbuild\n");
+ push(@filecontent, "globals:issolarisbuild: $installer::globals::issolarisbuild\n");
+ push(@filecontent, "globals:issolarispkgbuild: $installer::globals::issolarispkgbuild\n");
+ push(@filecontent, "globals:issolarissparcbuild: $installer::globals::issolarissparcbuild\n");
+ push(@filecontent, "globals:issolarisx86build: $installer::globals::issolarisx86build\n");
+ push(@filecontent, "globals:isfreebsdpkgbuild: $installer::globals::isfreebsdpkgbuild\n");
+ push(@filecontent, "globals:islinuxbuild: $installer::globals::islinuxbuild\n");
+ push(@filecontent, "globals:islinuxrpmbuild: $installer::globals::islinuxrpmbuild\n");
+ push(@filecontent, "globals:islinuxintelrpmbuild: $installer::globals::islinuxintelrpmbuild\n");
+ push(@filecontent, "globals:islinuxppcrpmbuild: $installer::globals::islinuxppcrpmbuild\n");
+ push(@filecontent, "globals:islinuxx86_64rpmbuild: $installer::globals::islinuxx86_64rpmbuild\n");
+ push(@filecontent, "globals:islinuxdebbuild: $installer::globals::islinuxdebbuild\n");
+ push(@filecontent, "globals:islinuxinteldebbuild: $installer::globals::islinuxinteldebbuild\n");
+ push(@filecontent, "globals:islinuxppcdebbuild: $installer::globals::islinuxppcdebbuild\n");
+ push(@filecontent, "globals:islinuxx86_64debbuild: $installer::globals::islinuxx86_64debbuild\n");
+ push(@filecontent, "globals:issolaris: $installer::globals::issolaris\n");
+ push(@filecontent, "globals:islinux: $installer::globals::islinux\n");
+ push(@filecontent, "globals:unpackpath: $installer::globals::unpackpath\n");
+ push(@filecontent, "globals:idttemplatepath: $installer::globals::idttemplatepath\n");
+ push(@filecontent, "globals:idtlanguagepath: $installer::globals::idtlanguagepath\n");
+ push(@filecontent, "globals:logfilename: $installer::globals::logfilename\n");
+ push(@filecontent, "globals:product: $installer::globals::product\n");
+ push(@filecontent, "globals:patch: $installer::globals::patch\n");
+ push(@filecontent, "globals:languagepack: $installer::globals::languagepack\n");
+ push(@filecontent, "globals:installertypedir: $installer::globals::installertypedir\n");
+ push(@filecontent, "globals:max_lang_length: $installer::globals::max_lang_length\n");
+ push(@filecontent, "globals:compiler: $installer::globals::compiler\n");
+ push(@filecontent, "globals:product: $installer::globals::product\n");
+ push(@filecontent, "globals:minor: $installer::globals::minor\n");
+ push(@filecontent, "globals:lastminor: $installer::globals::lastminor\n");
+ push(@filecontent, "globals:nsisfilename: $installer::globals::nsisfilename\n");
+
+ # Saving file
+ installer::files::save_file($downloadinfodir . $installer::globals::separator . $downloadinfofilename, \@filecontent);
+ installer::logger::print_message( "... creating \"follow me\" info file $downloadinfofilename.\n" );
+}
+
+####################################################
+# Reading the file, that contains all information
+# to create a follow up process.
+####################################################
+
+sub read_followme_info
+{
+ my ( $filename ) = @_;
+
+ if ( ! -f $filename ) { installer::exiter::exit_program("ERROR: Could not find file: $filename", "read_download_info"); }
+
+ installer::logger::print_message( "\n... reading \"follow me\" info file $filename\n" );
+
+ my %contenthash = ();
+
+ my $finalinstalldir = "";
+ my $downloadname = "";
+ my $currentinstallnumber = "";
+ my $loggingdir = "";
+ my $installlogdir = "";
+ my $languagestring = "";
+ my @includepatharray = ();
+ my @languagesarray = ();
+ my %allvariableshash = ();
+
+ # Global variables can be set directly
+
+ my $filecontent = installer::files::read_file($filename);
+
+ # First line has to contain the string "finalinstalldir:".
+ # Otherwise this is not a correct file.
+
+
+ if ( ! ( ${$filecontent}[0] =~ /s*finalinstalldir:\s*(.*?)\s*$/ )) { installer::exiter::exit_program("ERROR: Not a correct download info file: $filename", "read_download_info"); }
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ my $line = ${$filecontent}[$i];
+
+ if ( $line =~ /^\s*finalinstalldir:\s*(.*?)\s*$/ ) { $finalinstalldir = $1; }
+ if( $^O =~ /cygwin/i ) { $finalinstalldir =~ s/\\/\//; }
+ if ( $line =~ /^\s*downloadname:\s*(.*?)\s*$/ ) { $downloadname = $1; }
+ if ( $line =~ /^\s*currentinstallnumber:\s*(.*?)\s*$/ ) { $currentinstallnumber = $1; }
+ if ( $line =~ /^\s*loggingdir:\s*(.*?)\s*$/ ) { $loggingdir = $1; }
+ if( $^O =~ /cygwin/i ) { $loggingdir =~ s/\\/\//; }
+ if ( $line =~ /^\s*installlogdir:\s*(.*?)\s*$/ ) { $installlogdir = $1; }
+ if( $^O =~ /cygwin/i ) { $installlogdir =~ s/\\/\//; }
+ if ( $line =~ /^\s*languagestring:\s*(.*?)\s*$/ ) { $languagestring = $1; }
+ if ( $line =~ /^\s*languagesarray:\s*(.*?)\s*$/ ) { push(@languagesarray, $1); }
+ if ( $line =~ /^\s*includepatharray:\s*(.*?)\s*$/ )
+ {
+ my $path = $1;
+ if( $^O =~ /cygwin/i ) { $path =~ s/\\/\//; }
+ push(@includepatharray, $path . "\n");
+ }
+ if ( $line =~ /^\s*allvariableshash:\s*(.*?)\s*:\s*(.*?)\s*$/ ) { $allvariableshash{$1} = $2; }
+ if ( $line =~ /^\s*globals:(.*?)\s*:\s*(.*?)\s*$/ )
+ {
+ my $name = $1;
+ my $value = $2;
+ if ( $name eq "updatepack" ) { $installer::globals::updatepack = $value; }
+ if ( $name eq "added_english" ) { $installer::globals::added_english = $value; }
+ if ( $name eq "iswindowsbuild" ) { $installer::globals::iswindowsbuild = $value; }
+ if ( $name eq "issolarisbuild" ) { $installer::globals::issolarisbuild = $value; }
+ if ( $name eq "issolarispkgbuild" ) { $installer::globals::issolarispkgbuild = $value; }
+ if ( $name eq "issolarissparcbuild" ) { $installer::globals::issolarissparcbuild = $value; }
+ if ( $name eq "issolarisx86build" ) { $installer::globals::issolarisx86build = $value; }
+ if ( $name eq "isfreebsdpkgbuild" ) { $installer::globals::isfreebsdpkgbuild = $value; }
+ if ( $name eq "islinuxbuild" ) { $installer::globals::islinuxbuild = $value; }
+ if ( $name eq "islinuxrpmbuild" ) { $installer::globals::islinuxrpmbuild = $value; }
+ if ( $name eq "islinuxintelrpmbuild" ) { $installer::globals::islinuxintelrpmbuild = $value; }
+ if ( $name eq "islinuxppcrpmbuild" ) { $installer::globals::islinuxppcrpmbuild = $value; }
+ if ( $name eq "islinuxx86_64rpmbuild" ) { $installer::globals::islinuxx86_64rpmbuild = $value; }
+ if ( $name eq "islinuxdebbuild" ) { $installer::globals::islinuxdebbuild = $value; }
+ if ( $name eq "islinuxinteldebbuild" ) { $installer::globals::islinuxinteldebbuild = $value; }
+ if ( $name eq "islinuxppcdebbuild" ) { $installer::globals::islinuxppcdebbuild = $value; }
+ if ( $name eq "islinuxx86_64debbuild" ) { $installer::globals::islinuxx86_64debbuild = $value; }
+ if ( $name eq "issolaris" ) { $installer::globals::issolaris = $value; }
+ if ( $name eq "islinux" ) { $installer::globals::islinux = $value; }
+ if ( $name eq "unpackpath" ) { $installer::globals::unpackpath = $value; }
+ if( $^O =~ /cygwin/i ) { $installer::globals::unpackpath =~ s/\\/\//; }
+ if ( $name eq "idttemplatepath" ) { $installer::globals::idttemplatepath = $value; }
+ if( $^O =~ /cygwin/i ) { $installer::globals::idttemplatepath =~ s/\\/\//; }
+ if ( $name eq "idtlanguagepath" ) { $installer::globals::idtlanguagepath = $value; }
+ if( $^O =~ /cygwin/i ) { $installer::globals::idtlanguagepath =~ s/\\/\//; }
+ if ( $name eq "logfilename" ) { $installer::globals::logfilename = $value; }
+ if ( $name eq "product" ) { $installer::globals::product = $value; }
+ if ( $name eq "patch" ) { $installer::globals::patch = $value; }
+ if ( $name eq "languagepack" ) { $installer::globals::languagepack = $value; }
+ if ( $name eq "installertypedir" ) { $installer::globals::installertypedir = $value; }
+ if ( $name eq "max_lang_length" ) { $installer::globals::max_lang_length = $value; }
+ if ( $name eq "compiler" ) { $installer::globals::compiler = $value; }
+ if ( $name eq "product" ) { $installer::globals::product = $value; }
+ if ( $name eq "minor" ) { $installer::globals::minor = $value; }
+ if ( $name eq "lastminor" ) { $installer::globals::lastminor = $value; }
+ if ( $name eq "nsisfilename" ) { $installer::globals::nsisfilename = $value; }
+ }
+ }
+
+ $contenthash{'finalinstalldir'} = $finalinstalldir;
+ $contenthash{'downloadname'} = $downloadname;
+ $contenthash{'currentinstallnumber'} = $currentinstallnumber;
+ $contenthash{'loggingdir'} = $loggingdir;
+ $contenthash{'installlogdir'} = $installlogdir;
+ $contenthash{'languagestring'} = $languagestring;
+ $contenthash{'languagesarray'} = \@languagesarray;
+ $contenthash{'includepatharray'} = \@includepatharray;
+ $contenthash{'allvariableshash'} = \%allvariableshash;
+
+ return \%contenthash;
+}
+
+1;
diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm
new file mode 100644
index 000000000000..144cf4c88a4b
--- /dev/null
+++ b/solenv/bin/modules/installer/globals.pm
@@ -0,0 +1,536 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::globals;
+
+############################################
+# Global settings
+############################################
+
+BEGIN
+{
+ $prog="make_installer.pl";
+
+ @noMSLocaleLangs = (
+ "br",
+ "bs",
+ "dz",
+ "gu",
+ "km",
+ "nr",
+ "ns",
+ "rw",
+ "ss",
+ "st",
+ "tg",
+ "ts",
+ "tn",
+ "ve",
+ "xh",
+ "zu",
+ "ne",
+ "bn",
+ "bn-BD",
+ "bn-IN",
+ "lo",
+ "cy",
+ "ku",
+ "as-IN",
+ "te-IN",
+ "ml-IN",
+ "mr-IN",
+ "ur-IN",
+ "ta-IN",
+ "or-IN",
+ "ti-ER",
+ "eo",
+ "ka",
+ "ga",
+ "uk",
+ "gd",
+ "my",
+ "mai",
+ "brx",
+ "dgo",
+ "kok",
+ "mni",
+ "ca-XV",
+ "sat",
+ "ug",
+ "om",
+ "si",
+ "or",
+ "oc",
+ "ml",
+ "as",
+ "ast"
+ );
+ @items_at_modules = ("Files", "Dirs", "Unixlinks");
+ @asianlanguages = ("ja", "ko", "zh-CN", "zh-TW");
+ @bidilanguages = ("ar", "he");
+
+ $ziplistname = "";
+ $pathfilename = "";
+ $setupscriptname = "";
+ $headerfilename = "";
+ $shellscriptsfilename = "";
+ $product = "";
+ $languagelist = "";
+ $added_english = 0;
+ $set_office_start_language = 0;
+ $solarjavaset = 0;
+
+ $destdir = "";
+ $rootpath = "";
+
+ $required_dotnet_version = "2.0.0.0";
+ $productextension = "";
+ @languageproducts = ();
+ $build = "";
+ $minor = "";
+ $lastminor = "";
+ $compiler = "";
+ $pro = 0;
+ $dounzip = 1;
+ $languages_defined_in_productlist = 0;
+ $setupscript_defined_in_productlist = 0;
+ $islinux = 0;
+ $issolaris = 0;
+ $ismacosx = 0;
+ $iswindowsbuild = 0;
+ $islinuxbuild = 0;
+ $islinuxrpmbuild = 0;
+ $islinuxdebbuild = 0;
+ $islinuxintelrpmbuild = 0;
+ $islinuxppcrpmbuild = 0;
+ $islinuxinteldebbuild = 0;
+ $islinuxppcdebbuild = 0;
+ $islinuxx86_64rpmbuild = 0;
+ $islinuxx86_64debbuild = 0;
+ $issolarisbuild = 0;
+ $issolarispkgbuild = 0;
+ $issolarissparcbuild = 0;
+ $issolarisx86build = 0;
+ $isfreebsdbuild = 0;
+ $isfreebsdpkgbuild = 0;
+ $ismacbuild = 0;
+ $ismacdmgbuild = 0;
+ $unpackpath = "";
+ $idttemplatepath = "";
+ $idtlanguagepath = "";
+ $packjobref = "";
+ $buildid = "Not set";
+ $guidcounter = 1000; # for uniqueness of guids
+ $fontsfolder = "FontsFolder";
+ $fontsfoldername = "Fonts";
+ $fontsdirparent = "";
+ $fontsdirname = "";
+ $fontsdirhostname = "truetype";
+ $officefolder = "OfficeFolder";
+ $officemenufolder = "OfficeMenuFolder";
+ $startupfolder = "StartupFolder";
+ $startmenufolder = "StartMenuFolder";
+ $desktopfolder = "DesktopFolder";
+ $programfilesfolder = "ProgramFilesFolder";
+ $commonfilesfolder = "CommonFilesFolder";
+ $commonappdatafolder = "CommonAppDataFolder";
+ $localappdatafolder = "LocalAppDataFolder";
+ $templatefolder = "TemplateFolder";
+ $templatefoldername = "Templates";
+ $programmenufolder = "ProgramMenuFolder";
+ $systemfolder = "SystemFolder";
+ $encodinglistname = "msi-encodinglist.txt";
+ $msiencoding = ""; # hash reference for msi encodings
+ $msilanguage = ""; # hash reference for msi languages LCID
+ $sofficeiconadded = 0;
+ $temppath = "";
+ $globaltempdirname = "ooopackaging";
+ $cyg_temppath = "";
+ $temppathdefined = 0;
+ $jdstemppathdefined = 0;
+ $packageversion = 1;
+ $packagerevision = 1;
+ $rpm = "";
+ $rpmcommand = "";
+ $rpmquerycommand = "";
+ $rpminfologged = 0;
+ $debian = "";
+ $installertypedir = "";
+ $controlledmakecabversion = "5";
+ $saved_packages_path = "";
+ $max_lang_length = 50;
+ $globalblock = "Globals";
+ $rootmodulegid = "";
+ %alllangmodules = ();
+ $englishlicenseset = 0;
+ $englishlicense = "";
+ $englishsolarislicensename = "LICENSE_en-US";
+ $solarisdontcompress = 0;
+ $patharray = "";
+
+ $is_special_epm = 0;
+ $epm_in_path = 0;
+ $epm_path = "";
+ $epmoutpath = "";
+ $upx_in_path = 0;
+ $upxfile = "";
+ $simple = 0;
+ $simpledefaultuserdir = "\$ORIGIN/..";
+ $call_epm = 1;
+ $packageformat = "";
+ $packagename = "";
+ $packagelist = "";
+ $addpackagelist = "";
+ $is_unix_multi = 0;
+ $unixmultipath = "";
+ $unixmultipath_orig = "";
+ $alllanguagesinproductarrayref = "";
+ $shiptestdirectory = "";
+ $makelinuxlinkrpm = 0;
+ $linuxlinkrpmprocess = 0;
+ $add_required_package = "";
+ $linuxrespin = 0;
+ @linuxpatchfiles = ();
+ $linuxlibrarybaselevel = "1";
+ $linuxlibrarypatchlevel = "1.1";
+ @linuxlinks = ();
+ @linkrpms = ();
+ $archiveformat = "";
+ $minorupgradekey = "";
+ $updatelastsequence = 0;
+ $updatesequencecounter = 0;
+ $updatedatabase = 0;
+ $updatedatabasepath = "";
+ $pfffileexists = 0;
+ $pffcabfilename = "ooobasis3.0_pff.cab";
+ $mergemodulenumber = 0;
+ %allmergemodulefilesequences = ();
+ %newupdatefiles = ();
+ %allusedupdatesequences = ();
+ %mergemodulefiles = ();
+ $mergefiles_added_into_collector = 0;
+ $creating_windows_installer_patch = 0;
+
+ $strip = 1;
+
+ $globallogging = 0;
+ $globalloggingform21 = 1;
+ $logfilename = "logfile.log"; # the default logfile name for global errors
+ @logfileinfo = ();
+ @errorlogfileinfo = ();
+ @globallogfileinfo = ();
+ $ignore_error_in_logfile = 0;
+ $exitlog = "";
+ $globalinfo_copied = 0;
+ $quiet = 0;
+ $nodownload = 0;
+ $writetotemp = 0;
+ $useminor = 0;
+ $followme_from_directory = 0;
+ $internal_cabinet_signing = 0;
+
+ $debug = 0;
+ $debugfilename = "debug.txt";
+ $checksumfilename = "checksum.txt";
+ @functioncalls = ();
+
+ $ismultilingual = 0;
+ @multilanguagemodules = ();
+ $languagemodulesbase = "gid_Module_Root_";
+ %alluniquefilenames = ();
+ %alllcuniquefilenames = ();
+ %uniquefilenamesequence = ();
+ %dependfilenames = ();
+ $isopensourceproduct = 1;
+ $manufacturer = "";
+ $longmanufacturer = "";
+ $sundirname = "Oracle";
+ $codefilename = "codes.txt";
+ $componentfilename = "components.txt";
+ $productcode = "";
+ $upgradecode = "";
+ $msiproductversion = "";
+ $msimajorproductversion = "";
+ $created_new_component_guid = 0;
+ @allddffiles = ();
+ $infodirectory = "";
+ @currentcontent = ();
+ @installsetcontent = ();
+ %xpdpackageinfo = ();
+ $signfiles_checked = 0;
+ $dosign = 0;
+ $pwfile = "";
+ $pwfile = "";
+ $pfxfile = "";
+
+ %mergemodules = ();
+ %merge_media_line = ();
+ %merge_allfeature_hash = ();
+ %merge_alldirectory_hash = ();
+ %copy_msm_files = ();
+ $mergefeaturecollected = 0;
+ $mergedirectoriescollected = 0;
+ $lastsequence_before_merge = 0;
+ $lastcabfilename = "";
+
+ $createdxpddefaultlang = 0;
+ $xpddir = "";
+ $productxpdfile = "setup.xpd";
+ $xpd_files_prepared = 0;
+ $defaultlanguage = "";
+ # @emptyxpdparents = ();
+ @createdxpdfiles = ();
+ @allxpdfiles = ();
+ $isxpdplatform = 0;
+ $javalanguagepath = "";
+ $javasettozero = 0;
+ $addlicensefile = 1;
+ $addsystemintegration = 0;
+ $addjavainstaller = 0;
+ $added_directories = 0;
+ $makedownload = 1;
+ $makejds = 1;
+ $jdsexcludefilename = "";
+ $jds_language_controlled = 0;
+ $correct_jds_language = 0;
+ @installsetfiles = ();
+ @binarytableonlyfiles = ();
+ @allscpactions = ();
+ $languagepackaddon = "LanguagePack";
+ $patchaddon = "Patch";
+ $ooodownloadfilename = "";
+ $downloadfilename = "";
+ $downloadfileextension = "";
+ $followmeinfofilename = "";
+ $oooversionstring = "";
+ $shellnewfilesadded = 0;
+ %multilingual_only_modules = ();
+ %application_modules = ();
+ $defaultinstallorder = 1000;
+ $defaultsystemintinstallorder = 1200;
+
+ $is_copy_only_project = 0;
+ $is_simple_packager_project = 0;
+ $patch_user_dir = 0;
+ $addchildprojects = 0;
+ $languagepack = 0;
+ $tab = 0;
+ $patch = 0;
+ $patchincludepath = "";
+ $refresh_includepathes = 0;
+ $include_pathes_read = 0;
+ $patchfilelistname = "patchfilelist.txt";
+ @patchfilecollector = ();
+ $nopatchfilecollector = "";
+ @userregistrycollector = ();
+ $addeduserregitrykeys = 0;
+ $poolpathset = 0;
+ $poolpath = 0;
+ $poollockfilename = "";
+ $poolcheckfilename = "";
+ %poolshiftedpackages = ();
+ %poolpackages = ();
+ %createpackages = ();
+ $processhaspoolcheckfile = 0;
+ $processhaspoollockfile = 0;
+ $newpcfcontentcalculated = 0;
+ $sessionid = 0;
+ $sessionidset = 0;
+ $savelockfilecontent = "";
+ $savelockfilename = "";
+ $getuidpath = "";
+ $getuidpathset = 0;
+ $newpcfcontent = "";
+ %pcfdifflist = ();
+ @pcfdiffcomment = ();
+ @epmdifflist = ();
+ $desktoplinkexists = 0;
+ $sundirexists = 0;
+ $analyze_spellcheckerlanguage = 0;
+ %spellcheckerlanguagehash = ();
+ %spellcheckerfilehash = ();
+ $registryrootcomponent = "";
+
+ $installlocationdirectory = "";
+ $installlocationdirectoryset = 0;
+ $vendordirectory = "";
+ $vendordirectoryset = 0;
+ $officeinstalldirectory = "";
+ $officeinstalldirectoryset = 0;
+ $basisinstalldirectory = "";
+ $basisinstalldirectoryset = 0;
+ $ureinstalldirectory = "";
+ $ureinstalldirectoryset = 0;
+ $rootbrandpackage = "";
+ $rootbrandpackageset = 0;
+ $officedirhostname = "";
+ $basisdirhostname = "";
+ $uredirhostname = "";
+ $sundirhostname = "";
+ $officedirgid = "";
+ $basisdirgid = "";
+ $uredirgid = "";
+ $sundirgid = "";
+
+ %sign_extensions = ("dll" => "1", "exe" => "1", "cab" => "1");
+ %treestyles = ();
+ %installlocations = ("INSTALLLOCATION" => "1");
+ %treelayername = ();
+ %hostnametreestyles = ();
+ %treeconditions = ();
+ %usedtreeconditions = ();
+ %moduledestination = ();
+
+ $one_cab_file = 0;
+ $fix_number_of_cab_files = 1;
+ $cab_file_per_component = 0;
+ $cabfilecompressionlevel = 2;
+ $number_of_cabfiles = 1; # only for $fix_number_of_cab_files = 1
+ $include_cab_in_msi = 0;
+ $use_packages_for_cabs = 0;
+ $msidatabasename = "";
+ $prepare_winpatch = 0;
+ $previous_idt_dir = "";
+ $updatepack = 0;
+ $msitranpath = "";
+ $insert_file_at_end = 0;
+ $newfilesexist = 0;
+ $usesharepointpath = 0;
+ %newfilescollector = ();
+
+ $saveinstalldir = "";
+ $csp_installdir = ""; # global installdir of createsimplepackage() in simplepackage.pm
+ $csp_installlogdir = ""; # global installlogdir of createsimplepackage() in simplepackage.pm
+ $csp_languagestring = ""; # global languagestring of createsimplepackage() in simplepackage.pm
+ $localunpackdir = "";
+ $localinstalldirset = 0;
+ $localinstalldir = "";
+
+ $javafilename = "";
+ $javafilename2 = "";
+ $javafilename3 = "";
+ $javafile = "";
+ $urefile = "";
+
+ $postprocess_specialepm = 0;
+ $postprocess_standardepm = 0;
+ $mergemodules_analyzed = 0;
+
+ $starttime = "";
+
+ @solarispatchscripts = ("checkinstall", "copyright", "patch_checkinstall", "patch_postinstall", "postinstall", "preinstall", "i.none");
+ @solarispatchscriptsforextensions = ("checkinstall", "copyright", "patch_checkinstall", "patch_postinstall_extensions", "postinstall_extensions", "preinstall", "i.none");
+ @solarispatchfiles = (".diPatch", "patchinfo");
+ @environmentvariables = ( "SOLARVERSION", "GUI", "WORK_STAMP", "OUTPATH", "LOCAL_OUT", "LOCAL_COMMON_OUT" );
+ @packagelistitems = ("module", "solarispackagename", "packagename", "copyright", "vendor", "description" );
+ @languagepackfeature =();
+ @featurecollector =();
+ $msiassemblyfiles = "";
+ $nsisfilename = "Nsis";
+ $macinstallfilename = "macinstall.ulf";
+ $nsis204 = 0;
+ $nsis231 = 0;
+ $unicodensis = 0;
+ $linuxlinkrpms = "";
+ $extensioninstalldir = "gid_Dir_Share_Extension_Install";
+ @languagenames = ();
+ @requiredpackages = ();
+ %componentcondition = ();
+ %componentid = ();
+ %comparecomponentname = ();
+ %languageproperties = ();
+ %allcabinets = ();
+ %allcabinetassigns = ();
+ %cabfilecounter = ();
+ %lastsequence = ();
+ %dontdeletecomponents = ();
+ %allcalculated_guids = ();
+ %calculated_component_guids = ();
+ %base_independent_components = ();
+ %all_english_languagestrings = ();
+ %all_required_english_languagestrings = ();
+
+ @forced_properties = ("SERVICETAG_PRODUCTNAME", "SERVICETAG_PRODUCTVERSION", "SERVICETAG_PARENTNAME", "SERVICETAG_SOURCE", "SERVICETAG_URN");
+
+ @removedirs = ();
+ @jdsremovedirs = ();
+ @emptypackages = ();
+ %fontpackageexists = ();
+
+ $exithandler = undef;
+
+ $plat = $^O;
+
+ if ( $plat =~ /cygwin/i )
+ {
+ $zippath = "zip"; # Has to be in the path: /usr/bin/zip
+ $checksumfile = "so_checksum";
+ $unopkgfile = "unopkg.exe";
+ $separator = "/";
+ $pathseparator = "\:";
+ $libextension = "\.dll";
+ $isunix = 0;
+ $iswin = 1;
+ $archiveformat = ".zip";
+ %savedmapping = ();
+ %savedrevmapping = ();
+ %savedrev83mapping = ();
+ %saved83dirmapping = ();
+ }
+ else
+ {
+ $zippath = "zip"; # Has to be in the path: /usr/bin/zip
+ $checksumfile = "so_checksum";
+ $unopkgfile = "unopkg";
+ $separator = "/";
+ $pathseparator = "\:";
+ if ( $plat =~ /darwin/i )
+ {
+ $libextension = "\.dylib";
+ }
+ else
+ {
+ $libextension = "\.so";
+ }
+ $archiveformat = ".tar.gz";
+ $isunix = 1;
+ $iswin = 0;
+ }
+ # WRAPCMD is gone - remove this and all related
+ # $installer::globals::wrapcmd entries
+ $wrapcmd = "";
+
+ if ( $plat =~ /linux/i ) { $islinux = 1; }
+ if ( $plat =~ /kfreebsd/i ) { $islinux = 1; }
+ if ( $plat =~ /solaris/i ) { $issolaris = 1; }
+ if ( $plat =~ /darwin/i ) { $ismacosx = 1; }
+
+ # ToDo: Needs to be expanded for additional platforms
+
+}
+
+1;
diff --git a/solenv/bin/modules/installer/javainstaller.pm b/solenv/bin/modules/installer/javainstaller.pm
new file mode 100644
index 000000000000..f68346bdcce2
--- /dev/null
+++ b/solenv/bin/modules/installer/javainstaller.pm
@@ -0,0 +1,1885 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+package installer::javainstaller;
+
+use Cwd;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::languages;
+use installer::pathanalyzer;
+use installer::scriptitems;
+use installer::systemactions;
+use installer::worker;
+use installer::logger;
+
+##############################################################
+# Returning a specific language string from the block
+# of all translations
+##############################################################
+
+sub get_language_string_from_language_block
+{
+ my ($language_block, $language, $oldstring) = @_;
+
+ my $newstring = "";
+
+ for ( my $i = 0; $i <= $#{$language_block}; $i++ )
+ {
+ if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
+ {
+ $newstring = $1;
+ last;
+ }
+ }
+
+ if ( $newstring eq "" )
+ {
+ $language = "en-US"; # defaulting to english
+
+ for ( my $i = 0; $i <= $#{$language_block}; $i++ )
+ {
+ if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
+ {
+ $newstring = $1;
+ last;
+ }
+ }
+ }
+
+ return $newstring;
+}
+
+##############################################################
+# Returning the complete block in all languages
+# for a specified string
+##############################################################
+
+sub get_language_block_from_language_file
+{
+ my ($searchstring, $languagefile) = @_;
+
+ my @language_block = ();
+
+ for ( my $i = 0; $i <= $#{$languagefile}; $i++ )
+ {
+ if ( ${$languagefile}[$i] =~ /^\s*\[\s*$searchstring\s*\]\s*$/ )
+ {
+ my $counter = $i;
+
+ push(@language_block, ${$languagefile}[$counter]);
+ $counter++;
+
+ while (( $counter <= $#{$languagefile} ) && (!( ${$languagefile}[$counter] =~ /^\s*\[/ )))
+ {
+ push(@language_block, ${$languagefile}[$counter]);
+ $counter++;
+ }
+
+ last;
+ }
+ }
+
+ return \@language_block;
+}
+
+#######################################################
+# Searching for the module name and description in the
+# modules collector
+#######################################################
+
+sub get_module_name_description
+{
+ my ($modulesarrayref, $onelanguage, $gid, $type) = @_;
+
+ my $found = 0;
+
+ my $newstring = "";
+
+ for ( my $i = 0; $i <= $#{$modulesarrayref}; $i++ )
+ {
+ my $onemodule = ${$modulesarrayref}[$i];
+
+ if ( $onemodule->{'gid'} eq $gid )
+ {
+ my $typestring = $type . " " . "(" . $onelanguage . ")";
+ if ( $onemodule->{$typestring} ) { $newstring = $onemodule->{$typestring}; }
+ $found = 1;
+ }
+
+ if ( $found ) { last; }
+ }
+
+ # defaulting to english
+
+ if ( ! $found )
+ {
+ my $defaultlanguage = "en-US";
+
+ for ( my $i = 0; $i <= $#{$modulesarrayref}; $i++ )
+ {
+ my $onemodule = ${$modulesarrayref}[$i];
+
+ if ( $onemodule->{'gid'} eq $gid )
+ {
+ my $typestring = $type . " " . "(" . $defaultlanguage . ")";
+ if ( $onemodule->{$typestring} ) { $newstring = $onemodule->{$typestring}; }
+ $found = 1;
+ }
+
+ if ( $found ) { last; }
+ }
+ }
+
+ return $newstring;
+}
+
+#######################################################
+# Setting the productname and productversion
+#######################################################
+
+sub set_productname_and_productversion
+{
+ my ($templatefile, $variableshashref) = @_;
+
+ my $infoline = "\nSetting product name and product version in Java template file\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $productname = $variableshashref->{'PRODUCTNAME'};
+ my $productversion = $variableshashref->{'PRODUCTVERSION'};
+
+ for ( my $i = 0; $i <= $#{$templatefile}; $i++ )
+ {
+ ${$templatefile}[$i] =~ s/\{PRODUCTNAME\}/$productname/g;
+ ${$templatefile}[$i] =~ s/\{PRODUCTVERSION\}/$productversion/g;
+ }
+
+ $infoline = "End of: Setting product name and product version in Java template file\n\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+#######################################################
+# Setting the localized Module name and description
+#######################################################
+
+sub set_component_name_and_description
+{
+ my ($templatefile, $modulesarrayref, $onelanguage) = @_;
+
+ my $infoline = "\nSetting component names and description in Java template file\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $i = 0; $i <= $#{$templatefile}; $i++ )
+ {
+ # OOO_gid_Module_Prg_Wrt_Name
+ # OOO_gid_Module_Prg_Wrt_Description
+
+ my $oneline = ${$templatefile}[$i];
+ my $oldstring = "";
+ my $gid = "";
+ my $type = "";
+
+ if ( $oneline =~ /\b(OOO_gid_\w+)\b/ )
+ {
+ $oldstring = $1;
+
+ $infoline = "Found: $oldstring\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $oldstring =~ /^\s*OOO_(gid_\w+)_(\w+?)\s*$/ )
+ {
+ $gid = $1;
+ $type = $2;
+ }
+
+ my $newstring = get_module_name_description($modulesarrayref, $onelanguage, $gid, $type);
+
+ $infoline = "\tReplacing (language $onelanguage): OLDSTRING: $oldstring NEWSTRING $newstring\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ ${$templatefile}[$i] =~ s/$oldstring/$newstring/; # always substitute, even if $newstring eq ""
+ }
+ }
+
+ $infoline = "End of: Setting component names and description in Java template file\n\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+#######################################################
+# Translating the Java file
+#######################################################
+
+sub translate_javafile
+{
+ my ($templatefile, $languagefile, $onelanguage) = @_;
+
+ for ( my $i = 0; $i <= $#{$templatefile}; $i++ )
+ {
+ my @allstrings = ();
+
+ my $oneline = ${$templatefile}[$i];
+
+ while ( $oneline =~ /\b(OOO_\w+)\b/ )
+ {
+ my $replacestring = $1;
+ push(@allstrings, $replacestring);
+ $oneline =~ s/$replacestring//;
+ }
+
+ my $oldstring;
+
+ foreach $oldstring (@allstrings)
+ {
+ my $language_block = get_language_block_from_language_file($oldstring, $languagefile);
+ my $newstring = get_language_string_from_language_block($language_block, $onelanguage, $oldstring);
+
+ $newstring =~ s/\"/\\\"/g; # masquerading the "
+ $newstring =~ s/\\\\\"/\\\"/g; # unmasquerading if \" was converted to \\" (because " was already masked)
+
+ # if (!( $newstring eq "" )) { ${$idtfile}[$i] =~ s/$oldstring/$newstring/; }
+ ${$templatefile}[$i] =~ s/$oldstring/$newstring/; # always substitute, even if $newstring eq ""
+ }
+ }
+}
+
+###########################################################
+# Returning the license file name for a defined language
+###########################################################
+
+sub get_licensefilesource
+{
+ my ($language, $includepatharrayref) = @_;
+
+ my $licensefilename = "LICENSE_" . $language;
+
+ my $licenseref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$licensefilename, $includepatharrayref, 0);
+ if ($$licenseref eq "") { installer::exiter::exit_program("ERROR: Could not find License file $licensefilename!", "get_licensefilesource"); }
+
+ my $infoline = "Found licensefile $licensefilename: $$licenseref \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return $$licenseref;
+}
+
+#######################################################
+# Converting the license string into the
+# Java specific encoding.
+#######################################################
+
+sub convert_licenstring
+{
+ my ($licensefile, $includepatharrayref, $javadir, $onelanguage) = @_;
+
+ my $licensedir = $javadir . $installer::globals::separator . "license";
+ installer::systemactions::create_directory($licensedir);
+
+ # saving the original license file
+
+ my $licensefilename = $licensedir . $installer::globals::separator . "licensefile.txt";
+ installer::files::save_file($licensefilename, $licensefile);
+
+ # creating the ulf file from the license file
+
+ $licensefilename = $licensedir . $installer::globals::separator . "licensefile.ulf";
+ my @licensearray = ();
+
+ my $section = "\[TRANSLATE\]\n";
+ push(@licensearray, $section);
+
+ for ( my $i = 0; $i <= $#{$licensefile}; $i++ )
+ {
+ my $oneline = ${$licensefile}[$i];
+
+ if ($i == 0) { $oneline =~ s/^\s*\ï\»\¿//; }
+
+ $oneline =~ s/\s*$//;
+ $oneline =~ s/\"/\\\"/g; # masquerading the "
+ $oneline =~ s/\'/\\\'/g; # masquerading the '
+
+ $oneline =~ s/\$\{/\{/g; # replacement of variables, only {PRODUCTNAME}, not ${PRODUCTNAME}
+
+ my $ulfstring = $onelanguage . " = " . "\"" . $oneline . "\"\n";
+ push(@licensearray, $ulfstring);
+ }
+
+ installer::files::save_file($licensefilename, \@licensearray);
+
+ # converting the ulf file to the jlf file with ulfconv
+
+ @licensearray = ();
+
+ my $converter = "ulfconv";
+
+ my $converterref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$converter, $includepatharrayref, 0);
+ if ($$converterref eq "") { installer::exiter::exit_program("ERROR: Could not find converter $converter!", "convert_licenstring"); }
+
+ my $infoline = "Found converter file $converter: $$converterref \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $systemcall = "$$converterref $licensefilename |";
+ open (CONV, "$systemcall");
+ @licensearray = <CONV>;
+ close (CONV);
+
+ $licensefilename = $licensedir . $installer::globals::separator . "licensefile.jlf";
+ installer::files::save_file($licensefilename, \@licensearray);
+
+ # creating the license string from the jlf file
+
+ $licensestring = "";
+
+ for ( my $i = 1; $i <= $#licensearray; $i++ ) # not the first line!
+ {
+ my $oneline = $licensearray[$i];
+ $oneline =~ s/^\s*$onelanguage\s*\=\s*\"//;
+ $oneline =~ s/\"\s*$//;
+ $licensestring = $licensestring . $oneline . "\\n";
+ }
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $licensestring eq "" )
+ {
+ $infoline = "ERROR: Could not convert $licensefilename !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return $licensestring;
+}
+
+#######################################################
+# Adding the license file into the java file
+# In the template java file there are two
+# occurences of INSTALLSDK_GUI_LICENSE
+# and INSTALLSDK_CONSOLE_LICENSE
+#######################################################
+
+sub add_license_file_into_javafile
+{
+ my ( $templatefile, $licensefile, $includepatharrayref, $javadir, $onelanguage ) = @_;
+
+ my $licensestring = convert_licenstring($licensefile, $includepatharrayref, $javadir, $onelanguage);
+
+ # saving the licensestring in an ulf file
+ # converting the file using "ulfconv license.ulf"
+ # including the new string into the java file
+
+ for ( my $i = 0; $i <= $#{$templatefile}; $i++ )
+ {
+ ${$templatefile}[$i] =~ s/INSTALLSDK_GUI_LICENSE/$licensestring/;
+ ${$templatefile}[$i] =~ s/INSTALLSDK_CONSOLE_LICENSE/$licensestring/;
+ }
+}
+
+#######################################################
+# Executing one system call
+#######################################################
+
+sub make_systemcall
+{
+ my ( $systemcall, $logreturn ) = @_;
+
+ my @returns = ();
+
+ installer::logger::print_message( "... $systemcall ...\n" );
+
+ open (REG, "$systemcall");
+ while (<REG>) {push(@returns, $_); }
+ close (REG);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $logreturn )
+ {
+ for ( my $j = 0; $j <= $#returns; $j++ ) { push( @installer::globals::logfileinfo, "$returns[$j]"); }
+ }
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $error_occured = 1;
+ }
+ else
+ {
+ $infoline = "SUCCESS: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return \@returns;
+}
+
+#######################################################
+# Setting the class path for the Installer SDK
+#######################################################
+
+sub set_classpath_for_install_sdk
+{
+ my ( $directory ) = @_;
+
+ my $installsdk = "";
+ my $solarVersion = "";
+ my $inPath = "";
+ my $updMinorExt = "";
+
+ if ( defined( $ENV{ 'SOLARVERSION' } ) ) { $solarVersion = $ENV{'SOLARVERSION'}; }
+ else { installer::exiter::exit_program("ERROR: Environment variable \"SOLARVERSION\" not set!", "set_classpath_for_install_sdk"); }
+
+ if ( defined( $ENV{ 'INPATH' } ) ) { $inPath = $ENV{'INPATH'}; }
+ else { installer::exiter::exit_program("ERROR: Environment variable \"INPATH\" not set!", "set_classpath_for_install_sdk"); }
+
+ if ( defined( $ENV{ 'UPDMINOREXT' } ) ) { $updMinorExt = $ENV{'UPDMINOREXT'}; }
+
+ $installsdk = $solarVersion . $installer::globals::separator . $inPath . $installer::globals::separator . "bin" . $updMinorExt;
+ $installsdk = $installsdk . $installer::globals::separator . "javainstaller";
+
+ if ( $ENV{'INSTALLSDK_SOURCE'} ) { $installsdk = $ENV{'INSTALLSDK_SOURCE'}; } # overriding the Install SDK with INSTALLSDK_SOURCE
+
+ # The variable CLASSPATH has to contain:
+ # $installsdk/classes:$installsdk/classes/setupsdk.jar:
+ # $installsdk/classes/parser.jar:$installsdk/classes/jaxp.jar:
+ # $installsdk/classes/ldapjdk.jar:$directory
+
+ my @additional_classpath = ();
+ push(@additional_classpath, "$installsdk\/classes");
+ push(@additional_classpath, "$installsdk\/installsdk.jar");
+ push(@additional_classpath, "$installsdk\/classes\/parser.jar");
+ push(@additional_classpath, "$installsdk\/classes\/jaxp.jar");
+ push(@additional_classpath, "$directory");
+
+ my $newclasspathstring = "";
+ my $oldclasspathstring = "";
+ if ( $ENV{'CLASSPATH'} ) { $oldclasspathstring = $ENV{'CLASSPATH'}; }
+ else { $oldclasspathstring = "\."; }
+
+ for ( my $i = 0; $i <= $#additional_classpath; $i++ )
+ {
+ $newclasspathstring = $newclasspathstring . $additional_classpath[$i] . ":";
+ }
+
+ $newclasspathstring = $newclasspathstring . $oldclasspathstring;
+
+ $ENV{'CLASSPATH'} = $newclasspathstring;
+
+ my $infoline = "Setting CLASSPATH to $ENV{'CLASSPATH'}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+#######################################################
+# Setting the class file name in the Java locale file
+#######################################################
+
+sub set_classfilename
+{
+ my ($templatefile, $classfilename, $searchstring) = @_;
+
+ for ( my $j = 0; $j <= $#{$templatefile}; $j++ )
+ {
+ if ( ${$templatefile}[$j] =~ /\Q$searchstring\E/ )
+ {
+ ${$templatefile}[$j] =~ s/$searchstring/$classfilename/;
+ last;
+ }
+ }
+}
+
+#######################################################
+# Substituting one variable in the xml file
+#######################################################
+
+sub replace_one_variable
+{
+ my ($xmlfile, $variable, $searchstring) = @_;
+
+ for ( my $i = 0; $i <= $#{$xmlfile}; $i++ )
+ {
+ ${$xmlfile}[$i] =~ s/\$\{$searchstring\}/$variable/g;
+ }
+}
+
+#######################################################
+# Substituting the variables in the xml file
+#######################################################
+
+sub substitute_variables
+{
+ my ($xmlfile, $variableshashref) = @_;
+
+ my $key;
+
+ foreach $key (keys %{$variableshashref})
+ {
+ my $value = $variableshashref->{$key};
+ replace_one_variable($xmlfile, $value, $key);
+ }
+}
+
+##########################################################
+# Finding the line number in xml file of a special
+# component
+##########################################################
+
+sub find_component_line
+{
+ my ($xmlfile, $componentname) = @_;
+
+ my $linenumber = 0;
+
+ for ( my $i = 0; $i <= $#{$xmlfile}; $i++ )
+ {
+ if ( ${$xmlfile}[$i] =~ /name\s*\=\'\s*$componentname/ )
+ {
+ $linenumber = $i;
+ last;
+ }
+ }
+
+ return $linenumber;
+}
+
+##########################################################
+# Removing one package from the xml file
+##########################################################
+
+sub remove_package
+{
+ my ($xmlfile, $packagename) = @_;
+
+ my $searchstring = $packagename;
+ if ( $searchstring =~ /\-(\S+?)\s*$/ ) { $searchstring = $1; } # "SUNW%PRODUCTNAME-mailcap" -> "mailcap"
+
+ my $packagestring = "";
+ my $namestring = "";
+ my $infoline = "";
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ $packagestring = "\<pkgunit";
+ $namestring = "pkgName";
+ }
+ elsif ( $installer::globals::islinuxrpmbuild )
+ {
+ $packagestring = "\<rpmunit";
+ $namestring = "rpmUniqueName";
+ }
+
+ my $removed_packge = 0;
+
+ for ( my $i = 0; $i <= $#{$xmlfile}; $i++ )
+ {
+ if ( ${$xmlfile}[$i] =~ /^\s*\Q$packagestring\E/ )
+ {
+ # this is a package, but is it the correct one?
+
+ my $do_delete = 0;
+ my $linecounter = 1;
+ my $startline = $i+1;
+ my $line = ${$xmlfile}[$startline];
+ if (($line =~ /^\s*\Q$namestring\E\s*\=/) && ($line =~ /\-\Q$searchstring\E/)) { $do_delete = 1; }
+
+ # but not deleting fonts package in language packs
+ if ( $line =~ /-ONELANGUAGE-/ ) { $do_delete = 0; }
+
+ my $endcounter = 0;
+
+ while ((!( $line =~ /\/\>/ )) && ( $startline <= $#{$xmlfile} ))
+ {
+ $linecounter++;
+ $startline++;
+ $line = ${$xmlfile}[$startline];
+ if (($line =~ /^\s*\Q$namestring\E\s*\=/) && ($line =~ /\-\Q$searchstring\E/)) { $do_delete = 1; }
+ }
+
+ $linecounter = $linecounter + 1;
+
+ if ( $do_delete )
+ {
+ my $infoline = "\tReally removing package $packagename from xml file.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ splice(@{$xmlfile},$i, $linecounter); # removing $linecounter lines, beginning in line $i
+ $removed_packge = 1;
+ last;
+ }
+ }
+ }
+
+ if ( $removed_packge )
+ {
+ $infoline = "Package $packagename successfully removed from xml file.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Did not find package $packagename in xml file.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+}
+
+##########################################################
+# Removing one component from the xml file
+##########################################################
+
+sub remove_component
+{
+ my ($xmlfile, $componentname) = @_;
+
+ my @removed_lines = ();
+
+ push(@removed_lines, "\n");
+
+ for ( my $i = 0; $i <= $#{$xmlfile}; $i++ )
+ {
+ if ( ${$xmlfile}[$i] =~ /name\s*\=\'\s*$componentname/ )
+ {
+ # Counting the lines till the second "</component>"
+
+ push(@removed_lines, ${$xmlfile}[$i]);
+ my $linecounter = 1;
+ my $startline = $i+1;
+ my $line = ${$xmlfile}[$startline];
+ push(@removed_lines, $line);
+ my $endcounter = 0;
+
+ while ((!( $line =~ /^\s*\<\/component\>\s*$/ )) && ( $startline <= $#{$xmlfile} ))
+ {
+ $linecounter++;
+ $startline++;
+ $line = ${$xmlfile}[$startline];
+ push(@removed_lines, $line);
+ }
+
+ $linecounter = $linecounter + 2; # last line and following empty line
+
+ splice(@{$xmlfile},$i, $linecounter); # removing $linecounter lines, beginning in line $i
+ last;
+ }
+ }
+
+ return \@removed_lines;
+}
+
+##########################################################
+# If this is an installation set without language packs
+# the language pack module can be removed
+##########################################################
+
+sub remove_languagepack_from_xmlfile
+{
+ my ($xmlfile) = @_;
+
+ # Component begins with "<component selected="true" name='module_languagepacks' componentVersion="${PRODUCTVERSION}">"
+ # and ends with "</component>" (the second "</component>" !)
+
+ remove_component($xmlfile, "languagepack_DEFAULT");
+ remove_component($xmlfile, "languagepack_ONELANGUAGE");
+ remove_component($xmlfile, "module_languagepacks");
+}
+
+##########################################################
+# Duplicating a component
+##########################################################
+
+sub duplicate_component
+{
+ my ( $arrayref ) = @_;
+
+ @newarray = ();
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ push(@newarray, ${$arrayref}[$i]);
+ }
+
+ return \@newarray;
+}
+
+##########################################################
+# Including a component into the xml file
+# at a specified line
+##########################################################
+
+sub include_component_at_specific_line
+{
+ my ($xmlfile, $unit, $line) = @_;
+
+ splice(@{$xmlfile},$line, 0, @{$unit});
+}
+
+##########################################################
+# Font packages do not exist for all languages.
+##########################################################
+
+sub remove_font_package_from_unit
+{
+ my ( $unitcopy, $onelanguage ) = @_;
+
+ my $searchstring = "-fonts";
+
+ my $packagestring = "";
+ my $namestring = "";
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ $packagestring = "\<pkgunit";
+ $namestring = "pkgName";
+ }
+ elsif ( $installer::globals::islinuxrpmbuild )
+ {
+ $packagestring = "\<rpmunit";
+ $namestring = "rpmUniqueName";
+ }
+
+ for ( my $i = 0; $i <= $#{$unitcopy}; $i++ )
+ {
+ if ( ${$unitcopy}[$i] =~ /^\s*\Q$packagestring\E/ )
+ {
+ # this is a package, but is it the correct one?
+
+ my $do_delete = 0;
+ my $linecounter = 1;
+ my $startline = $i+1;
+ my $line = ${$unitcopy}[$startline];
+ if (($line =~ /^\s*\Q$namestring\E\s*\=/) && ($line =~ /\Q$searchstring\E/)) { $do_delete = 1; }
+
+ my $endcounter = 0;
+
+ while ((!( $line =~ /\/\>/ )) && ( $startline <= $#{$unitcopy} ))
+ {
+ $linecounter++;
+ $startline++;
+ $line = ${$unitcopy}[$startline];
+ if (($line =~ /^\s*\Q$namestring\E\s*\=/) && ($line =~ /\Q$searchstring\E/)) { $do_delete = 1; }
+ }
+
+ $linecounter = $linecounter + 1;
+
+ if ( $do_delete )
+ {
+ splice(@{$unitcopy},$i, $linecounter); # removing $linecounter lines, beginning in line $i
+ last;
+ }
+ }
+ }
+}
+
+##########################################################
+# If this is an installation set with language packs,
+# modules for each language pack have to be created
+# dynamically
+##########################################################
+
+sub duplicate_languagepack_in_xmlfile
+{
+ my ($xmlfile, $languagesarrayref) = @_;
+
+ my $unit = remove_component($xmlfile, "languagepack_ONELANGUAGE");
+ my $startline = find_component_line($xmlfile, "module_languagepacks");
+ my $infoline = "";
+ $startline = $startline + 1;
+
+ for ( my $i = 0; $i <= $#{$languagesarrayref}; $i++ )
+ {
+ my $onelanguage = ${$languagesarrayref}[$i];
+ my $unitcopy = duplicate_component($unit);
+
+ # replacing string ONELANGUAGE in the unit copy
+ for ( my $j = 0; $j <= $#{$unitcopy}; $j++ ) { ${$unitcopy}[$j] =~ s/ONELANGUAGE/$onelanguage/g; }
+
+ # including the unitcopy into the xml file
+ include_component_at_specific_line($xmlfile, $unitcopy, $startline);
+ $startline = $startline + $#{$unitcopy} + 1;
+ }
+
+ # adding the default language as language pack, too
+ $unit = remove_component($xmlfile, "languagepack_DEFAULT");
+ $startline = find_component_line($xmlfile, "module_languagepacks");
+ $startline = $startline + 1;
+
+ $onelanguage = ${$languagesarrayref}[0];
+ $unitcopy = duplicate_component($unit);
+
+ # replacing string DEFAULT in the unit copy
+ for ( my $j = 0; $j <= $#{$unitcopy}; $j++ ) { ${$unitcopy}[$j] =~ s/DEFAULT/$onelanguage/g; }
+
+ # including the unitcopy into the xml file
+ include_component_at_specific_line($xmlfile, $unitcopy, $startline);
+ $startline = $startline + $#{$unitcopy} + 1;
+}
+
+#######################################################
+# Removing empty packages from xml file. The names
+# are stored in @installer::globals::emptypackages
+#######################################################
+
+sub remove_empty_packages_in_xmlfile
+{
+ my ($xmlfile) = @_;
+
+ for ( my $i = 0; $i <= $#installer::globals::emptypackages; $i++ )
+ {
+ my $packagename = $installer::globals::emptypackages[$i];
+ my $infoline = "Try to remove package $packagename from xml file.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ remove_package($xmlfile, $packagename);
+ }
+}
+
+#######################################################
+# Preparing the language packs in the xml file
+#######################################################
+
+sub prepare_language_pack_in_xmlfile
+{
+ my ($xmlfile, $languagesarrayref) = @_;
+
+ # if ( ! $installer::globals::is_unix_multi )
+ # {
+ # remove_languagepack_from_xmlfile($xmlfile);
+ # }
+ # else
+ # {
+ duplicate_languagepack_in_xmlfile($xmlfile, $languagesarrayref);
+ # }
+
+}
+
+#######################################################
+# Returning a rpm unit from a xml file
+#######################################################
+
+sub get_rpm_unit_from_xmlfile
+{
+ my ($rpmname, $xmlfile) = @_;
+
+ my $infoline = "Searching for $rpmname in xml file.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my @rpmunit = ();
+ my $includeline = 0;
+ my $record = 0;
+ my $foundrpm = 0;
+
+ for ( my $i = 0; $i <= $#{$xmlfile}; $i++ )
+ {
+ my $oneline = ${$xmlfile}[$i];
+
+ if ( $oneline =~ /^\s*\<rpmunit/ ) { $record = 1; }
+
+ if ( $record ) { push(@rpmunit, $oneline); }
+
+ if ( $oneline =~ /^\s*rpmUniqueName\s*=\s*\"\Q$rpmname\E\"\s*$/ ) { $foundrpm = 1; }
+
+ if (( $record ) && ( $oneline =~ /\/\>\s*$/ )) { $record = 0; }
+
+ if (( ! $foundrpm ) && ( ! $record )) { @rpmunit = (); }
+
+ if (( $foundrpm ) && ( ! $record )) { $includeline = $i + 1; }
+
+ if (( $foundrpm ) && ( ! $record )) { last; }
+ }
+
+ if ( ! $foundrpm ) { installer::exiter::exit_program("ERROR: Did not find rpmunit $rpmname in xml file!", "get_rpm_unit_from_xmlfile"); }
+
+ $infoline = "Found $rpmname in xml file. Returning block lines: $#rpmunit + 1. Includeline: $includeline \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return (\@rpmunit, $includeline);
+}
+
+#######################################################
+# Exchanging package names in xml file
+#######################################################
+
+sub exchange_name_in_rpmunit
+{
+ my ($rpmunit, $oldpackagename, $newpackagename) = @_;
+
+ for ( my $i = 0; $i <= $#{$rpmunit}; $i++ )
+ {
+ ${$rpmunit}[$i] =~ s/$oldpackagename/$newpackagename/;
+ }
+}
+
+#######################################################
+# Preparing link RPMs in the xml file
+#######################################################
+
+sub prepare_linkrpm_in_xmlfile
+{
+ my ($xmlfile, $rpmlist) = @_;
+
+ for ( my $i = 0; $i <= $#{$rpmlist}; $i++ )
+ {
+ my $oldpackagename = "";
+ my $newpackagename = "";
+
+ my $rpmline = ${$rpmlist}[$i];
+
+ my $infoline = "Preparing link/patch RPM: $rpmline\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $rpmline =~ /^\s*(\S.*?\S)\s+(\S.*?\S)\s*$/ )
+ {
+ $oldpackagename = $1;
+ $newpackagename = $2;
+ }
+
+ my ($rpmunit, $includeline) = get_rpm_unit_from_xmlfile($oldpackagename, $xmlfile);
+ exchange_name_in_rpmunit($rpmunit, $oldpackagename, $newpackagename);
+ include_component_at_specific_line($xmlfile, $rpmunit, $includeline);
+ }
+}
+
+#######################################################################
+# Removing w4w filter module from xml file for Solaris x86 and Linux
+#######################################################################
+
+sub remove_w4w_from_xmlfile
+{
+ my ($xmlfile) = @_;
+
+ # Component begins with "<component selected='true' name='gid_Module_Prg_Wrt_Flt_W4w' componentVersion="8">"
+ # and ends with "</component>"
+
+ for ( my $i = 0; $i <= $#{$xmlfile}; $i++ )
+ {
+ if ( ${$xmlfile}[$i] =~ /name\s*\=\'\s*gid_Module_Prg_Wrt_Flt_W4w/ )
+ {
+ # Counting the lines till "</component>"
+
+ my $linecounter = 1;
+ my $startline = $i+1;
+ my $line = ${$xmlfile}[$startline];
+
+ while ((!( $line =~ /^\s*\<\/component\>\s*$/ )) && ( $startline <= $#{$xmlfile} ))
+ {
+ $linecounter++;
+ $startline++;
+ $line = ${$xmlfile}[$startline];
+ }
+
+ $linecounter = $linecounter + 2; # last line and following empty line
+
+ splice(@{$xmlfile},$i, $linecounter); # removing $linecounter lines, beginning in line $i
+ last;
+ }
+ }
+}
+
+#######################################################################
+# Removing module from xml file, if not defined in scp
+#######################################################################
+
+sub remove_scpgid_from_xmlfile
+{
+ my ($xmlfile, $scpgid) = @_;
+
+ # Component begins with "<component selected='true' name='$scpgid' componentVersion="8">"
+ # and ends with "</component>"
+
+ my $successfully_removed = 0;
+
+ for ( my $i = 0; $i <= $#{$xmlfile}; $i++ )
+ {
+ if ( ${$xmlfile}[$i] =~ /name\s*\=\'\s*\Q$scpgid\E/ )
+ {
+ # Counting the lines till "</component>"
+
+ my $linecounter = 1;
+ my $startline = $i+1;
+ my $line = ${$xmlfile}[$startline];
+
+ while ((!( $line =~ /^\s*\<\/component\>\s*$/ )) && ( $startline <= $#{$xmlfile} ))
+ {
+ $linecounter++;
+ $startline++;
+ $line = ${$xmlfile}[$startline];
+ }
+
+ $linecounter = $linecounter + 2; # last line and following empty line
+
+ splice(@{$xmlfile},$i, $linecounter); # removing $linecounter lines, beginning in line $i
+ $successfully_removed = 1;
+ last;
+ }
+ }
+
+ my $infoline = "";
+ if ($successfully_removed)
+ {
+ $infoline = "Module $scpgid successfully removed from xml file.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Module $scpgid not found in xml file (no problem).\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+#######################################################################
+# Special mechanism for removing modules for xml file, if they are
+# not defined in scp (introduced for onlineupdate module).
+#######################################################################
+
+sub remove_module_if_not_defined
+{
+ my ($xmlfile, $modulesarrayref, $scpgid) = @_;
+
+ my $infoline = "Checking existence of $scpgid in scp definition\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $found = 0;
+
+ for ( my $i = 0; $i <= $#{$modulesarrayref}; $i++ )
+ {
+ my $onemodule = ${$modulesarrayref}[$i];
+ if ( $onemodule->{'gid'} eq $scpgid ) { $found = 1; }
+ if ( $found ) { last; }
+ }
+
+ if ( ! $found )
+ {
+ $infoline = "Module $scpgid not found -> Removing from xml file.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ remove_scpgid_from_xmlfile($xmlfile, $scpgid);
+ }
+}
+
+###########################################################
+# Preparing the package subdirectory
+###########################################################
+
+sub create_empty_packages
+{
+ my ( $xmlfile ) = @_;
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ my $path = "";
+
+ for ( my $i = 0; $i <= $#{$xmlfile}; $i++ )
+ {
+ if ( ${$xmlfile}[$i] =~ /pkgRelativePath\s*\=\s*\'(.*?)\'\s*$/ )
+ {
+ $path = $1;
+ installer::systemactions::create_directory_structure($path);
+ last; # only creating one path
+ }
+ }
+
+ for ( my $i = 0; $i <= $#{$xmlfile}; $i++ )
+ {
+ if ( ${$xmlfile}[$i] =~ /pkgName\s*\=\s*\'(.*?)\'\s*$/ )
+ {
+ my $pkgname = $1;
+ if ( $path ne "" ) { $pkgname = $path . $installer::globals::separator . $pkgname; }
+ installer::systemactions::create_directory_structure($pkgname);
+ }
+ }
+ }
+
+ # "-novalidate" does not work for Linux RPMs
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ for ( my $i = 0; $i <= $#{$xmlfile}; $i++ )
+ {
+ if ( ${$xmlfile}[$i] =~ /rpmPath\s*\=\s*\"(.*?)\"\s*$/ )
+ {
+ my $rpmpath = $1;
+ my $path = "";
+
+ if ( $rpmpath =~ /^\s*(.*)\/(.*?)\s*$/ )
+ {
+ $path = $1;
+ }
+
+ if ( $path ne "" ) { installer::systemactions::create_directory_structure($path); }
+
+ my $systemcall = "touch $rpmpath"; # creating empty rpm
+ system($systemcall);
+ }
+ }
+ }
+}
+
+###########################################################
+# Reading the archive file name from the xml file
+###########################################################
+
+sub get_archivefilename
+{
+ my ( $xmlfile ) = @_;
+
+ my $archivefilename = "";
+
+ for ( my $j = 0; $j <= $#{$xmlfile}; $j++ )
+ {
+ if ( ${$xmlfile}[$j] =~ /archiveFileName\s*=\s*\'(.*?)\'/ )
+ {
+ $archivefilename = $1;
+ last;
+ }
+ }
+
+ return $archivefilename;
+}
+
+#######################################################
+# Copying the loader locally
+#######################################################
+
+sub copy_setup_locally
+{
+ my ($includepatharrayref, $loadername, $newname) = @_;
+
+ my $loadernameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$loadername, $includepatharrayref, 0);
+
+ if ($$loadernameref eq "") { installer::exiter::exit_program("ERROR: Could not find Java loader $loadername!", "copy_setup_locally"); }
+
+ installer::systemactions::copy_one_file($$loadernameref, $newname);
+ my $localcall = "chmod 775 $newname \>\/dev\/null 2\>\&1";
+ system($localcall);
+}
+
+
+#######################################################
+# Copying the loader into the installation set
+#######################################################
+
+sub put_loader_into_installset
+{
+ my ($installdir, $filename) = @_;
+
+ my $installname = $installdir . $installer::globals::separator . $filename;
+
+ installer::systemactions::copy_one_file($filename, $installname);
+
+ my $localcall = "chmod 775 $installname \>\/dev\/null 2\>\&1";
+ system($localcall);
+}
+
+#################################################################
+# Setting for Solaris the package names in the Java translation
+# file. The name is used for the
+# This name is displayed tools like prodreg.
+# Unfortunately this name in the component is also used
+# in the translation template file for the module name
+# and module description translations.
+#################################################################
+
+sub replace_component_name_in_java_file
+{
+ my ($alljavafiles, $oldname, $newname) = @_;
+
+ # The new name must not contain white spaces
+
+ $newname =~ s/ /\_/g;
+
+ for ( my $i = 0; $i <= $#{$alljavafiles}; $i++ )
+ {
+ my $javafilename = ${$alljavafiles}[$i];
+ my $javafile = installer::files::read_file($javafilename);
+
+ my $oldstring = "ComponentDescription-" . $oldname;
+ my $newstring = "ComponentDescription-" . $newname;
+
+ for ( my $j = 0; $j <= $#{$javafile}; $j++ ) { ${$javafile}[$j] =~ s/\b$oldstring\b/$newstring/; }
+
+ $oldstring = $oldname . "-install-DisplayName";
+ $newstring = $newname . "-install-DisplayName";
+
+ for ( my $j = 0; $j <= $#{$javafile}; $j++ ) { ${$javafile}[$j] =~ s/\b$oldstring\b/$newstring/; }
+
+ $oldstring = $oldname . "-uninstall-DisplayName";
+ $newstring = $newname . "-uninstall-DisplayName";
+
+ for ( my $j = 0; $j <= $#{$javafile}; $j++ ) { ${$javafile}[$j] =~ s/\b$oldstring\b/$newstring/; }
+
+ installer::files::save_file($javafilename, $javafile);
+ $infoline = "Changes in Java file: $javafilename : $oldname \-\> $newname\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+#################################################################
+# Some module names are not defined in the scp project.
+# The names for this modules are searched in the base Java
+# translation file.
+#################################################################
+
+sub get_module_name_from_basejavafile
+{
+ my ($componentname, $javatemplateorigfile, $ulffile) = @_;
+
+ my $searchname = $componentname . "-install-DisplayName";
+ my $modulename = "";
+ my $replacename = "";
+
+ # line content: { "coremodule-install-DisplayName", "OOO_INSTALLSDK_117" },
+
+ for ( my $i = 0; $i <= $#{$javatemplateorigfile}; $i++ )
+ {
+ if ( ${$javatemplateorigfile}[$i] =~ /\"\s*\Q$searchname\E\s*\"\s*\,\s*\"\s*(.*?)\s*\"\s*\}\s*\,\s*$/ )
+ {
+ $replacename = $1;
+ last;
+ }
+ }
+
+ if ( $replacename ne "" )
+ {
+ my $language_block = get_language_block_from_language_file($replacename, $ulffile);
+ $modulename = get_language_string_from_language_block($language_block, "en-US", $replacename);
+ }
+
+ return $modulename;
+}
+
+#################################################################
+# Setting for Solaris the package names in the xml file.
+# This name is displayed tools like prodreg.
+# Unfortunately this name in the component is also used
+# in the translation template file for the module name
+# and module description translations.
+#################################################################
+
+sub replace_component_names
+{
+ my ($xmlfile, $templatefilename, $modulesarrayref, $javatemplateorigfile, $ulffile) = @_;
+
+ # path in which all java languages files are located
+
+ my $javafilesdir = $templatefilename;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$javafilesdir);
+ my $alljavafiles = installer::systemactions::find_file_with_file_extension("java", $javafilesdir);
+ for ( my $i = 0; $i <= $#{$alljavafiles}; $i++ ) { ${$alljavafiles}[$i] = $javafilesdir . ${$alljavafiles}[$i]; }
+
+ # analyzing the xml file
+
+ for ( my $i = 0; $i <= $#{$xmlfile}; $i++ )
+ {
+ my $newstring = "";
+ my $componentname = "";
+
+ if ( ${$xmlfile}[$i] =~ /\bcomponent\b.*\bname\s*\=\'\s*(.*?)\s*\'/ )
+ {
+ $componentname = $1;
+
+ # Getting module name from the scp files in $modulesarrayref
+
+ my $onelanguage = "en-US";
+ my $gid = $componentname;
+ my $type = "Name";
+
+ my $modulename = "";
+ $modulename = get_module_name_description($modulesarrayref, $onelanguage, $gid, $type);
+
+ if ( $modulename eq "" )
+ {
+ $infoline = "Info: Modulename for $gid not defined in modules collector. Looking in Java ulf file.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( $modulename eq "" ) # the modulename can also be set in the Java ulf file
+ {
+ $modulename = get_module_name_from_basejavafile($componentname, $javatemplateorigfile, $ulffile);
+ }
+
+ if ( $modulename ne "" ) # only do something, if the modulename was found
+ {
+ ${$xmlfile}[$i] =~ s/$componentname/$modulename/;
+
+ $infoline = "Replacement in xml file (Solaris): $componentname \-\> $modulename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Replacement has to be done in all Java language files
+ replace_component_name_in_java_file($alljavafiles, $componentname, $modulename);
+ }
+
+ if ( $modulename eq "" ) # the modulename can also be set in the Java ulf file
+ {
+ $infoline = "WARNING: No replacement in xml file for component: $componentname\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+}
+
+#############################################################################
+# Collecting all packages or rpms located in the installation directory
+#############################################################################
+
+sub get_all_packages_in_installdir
+{
+ my ($installdir, $subdir) = @_;
+
+ my $infoline = "";
+
+ my @allrpms = (); # not needed for Solaris at the moment
+ my $allrpms = \@allrpms;
+
+ $installdir =~ s/\Q$installer::globals::separator\E\s*$//;
+ my $directory = $installdir . $installer::globals::separator . $subdir;
+ $directory =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ $allrpms = installer::systemactions::find_file_with_file_extension("rpm", $directory);
+
+ # collecting rpms with the complete path
+
+ for ( my $i = 0; $i <= $#{$allrpms}; $i++ )
+ {
+ ${$allrpms}[$i] = $directory . $installer::globals::separator . ${$allrpms}[$i];
+ $infoline = "Found RPM: ${$allrpms}[$i]\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ return $allrpms;
+}
+
+#######################################################
+# Adding the values of the array
+#######################################################
+
+sub do_sum
+{
+ my ( $allnumbers ) = @_;
+
+ my $sum = 0;
+
+ for ( my $i = 0; $i <= $#{$allnumbers}; $i++ )
+ {
+ $sum = $sum + ${$allnumbers}[$i];
+ }
+
+ return $sum;
+}
+
+#######################################################
+# Setting the filesize for the RPMs in the xml file
+#######################################################
+
+sub set_filesize_in_xmlfile
+{
+ my ($filesize, $rpmname, $xmlfile) = @_;
+
+ my $infoline = "";
+ my $foundrpm = 0;
+ my $filesizeset = 0;
+
+ for ( my $i = 0; $i <= $#{$xmlfile}; $i++ )
+ {
+ my $line = ${$xmlfile}[$i];
+
+ # searching for "rpmPath="RPMS/${UNIXPRODUCTNAME}-core01-${PACKAGEVERSION}-${PACKAGEREVISION}.i586.rpm""
+
+ if (( $line =~ /rpmPath\s*=/ ) && ( $line =~ /\Q$rpmname\E\"\s*$/ ))
+ {
+ $foundrpm = 1;
+
+ my $number = $i;
+ $number++;
+
+ while ( ! ( ${$xmlfile}[$number] =~ /\/\>\s*$/ ))
+ {
+ if ( ${$xmlfile}[$number] =~ /FILESIZEPLACEHOLDER/ )
+ {
+ ${$xmlfile}[$number] =~ s/FILESIZEPLACEHOLDER/$filesize/;
+ $filesizeset = 1;
+ $infoline = "Setting filesize for $rpmname : $filesize\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ last;
+ }
+
+ $number++;
+ }
+
+ last;
+ }
+ }
+
+ if ( ! $foundrpm )
+ {
+ $infoline = "ERROR: Did not find $rpmname in xml file !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( ! $filesizeset )
+ {
+ $infoline = "ERROR: Did not set filesize for $rpmname in xml file !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+############################################################
+# Collecting all rpmUniqueName in xml file.
+############################################################
+
+sub collect_uniquenames_in_xmlfile
+{
+ my ($xmlfile) = @_;
+
+ my @rpmuniquenames = ();
+
+ for ( my $i = 0; $i <= $#{$xmlfile}; $i++ )
+ {
+ my $oneline = ${$xmlfile}[$i];
+
+ if ( $oneline =~ /^\s*rpmUniqueName\s*\=\s*\"(.*)\"\s*$/ )
+ {
+ my $rpmuniquename = $1;
+ push(@rpmuniquenames, $rpmuniquename)
+ }
+ }
+
+ return \@rpmuniquenames;
+}
+
+############################################################
+# Searching for the corresponding rpm, that fits to
+# the unique rpm name.
+# Simple mechanism: The name of the rpm starts with the
+# unique rpm name followed by a "-".
+############################################################
+
+sub find_rpmname_to_uniquename
+{
+ my ($uniquename, $listofpackages) = @_;
+
+ my @all_correct_rpms = ();
+ my $infoline = "";
+
+ # special handling for java RPMs, which have a very strange naming schema
+ my $localuniquename = $uniquename;
+ if ( $uniquename =~ /^\s*jre\-/ ) { $localuniquename = "jre"; }
+
+ for ( my $i = 0; $i <= $#{$listofpackages}; $i++ )
+ {
+ my $completerpmname = ${$listofpackages}[$i];
+ my $rpmname = $completerpmname;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$rpmname);
+
+ if ( $rpmname =~ /^\s*\Q$localuniquename\E\-\d/ ) { push(@all_correct_rpms, $rpmname); }
+ }
+
+ # @all_correct_rpms has to contain exactly one value
+
+ if ( $#all_correct_rpms > 0 )
+ {
+ my $number = $#all_correct_rpms + 1;
+ $infoline = "There are $number RPMs for the unique name \"$uniquename\" :\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ my $allrpmstring = "";
+ for ( my $i = 0; $i <= $#all_correct_rpms; $i++ ) { $allrpmstring = $allrpmstring . $all_correct_rpms[$i] . "\n"; }
+ push( @installer::globals::logfileinfo, $allrpmstring);
+ installer::exiter::exit_program("ERROR: Found $number RPMs that start with unique name \"$uniquename\". Only one allowed!", "find_rpmname_to_uniquename");
+ }
+
+ if ( $#all_correct_rpms < 0 )
+ {
+ $infoline = "There is no rpm for the unique name \"$uniquename\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: There is no RPM that start with unique name \"$uniquename\"!", "find_rpmname_to_uniquename");
+ }
+
+ if ( $#all_correct_rpms == 0 )
+ {
+ $infoline = "Found one rpm for the unique name \"$uniquename\" : $all_correct_rpms[0]\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return $all_correct_rpms[0];
+}
+
+#######################################################
+# Including the complete RPM name into the xml file
+#######################################################
+
+sub set_rpmname_into_xmlfile
+{
+ my ($rpmname, $uniquename, $xmlfile) = @_;
+
+ my $foundrpm = 0;
+ my $rpmnameset = 0;
+
+ for ( my $i = 0; $i <= $#{$xmlfile}; $i++ )
+ {
+ my $oneline = ${$xmlfile}[$i];
+
+ if ( $oneline =~ /^\s*rpmUniqueName\s*\=\s*\"\Q$uniquename\E\"\s*$/ )
+ {
+ $foundrpm = 1;
+
+ my $number = $i;
+ $number++;
+
+ while ( ! ( ${$xmlfile}[$number] =~ /\/\>\s*$/ ))
+ {
+ if ( ${$xmlfile}[$number] =~ /RPMFILENAMEPLACEHOLDER/ )
+ {
+ ${$xmlfile}[$number] =~ s/RPMFILENAMEPLACEHOLDER/$rpmname/;
+ $rpmnameset = 1;
+ $infoline = "Setting RPM name for $uniquename : $rpmname\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ last;
+ }
+
+ $number++;
+ }
+
+ last;
+ }
+ }
+
+ if ( ! $foundrpm )
+ {
+ $infoline = "ERROR: Did not find $rpmname in xml file !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( ! $rpmnameset )
+ {
+ $infoline = "ERROR: Did not set rpm name for $uniquename in xml file !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+}
+
+############################################################
+# Including the rpm path dynamically into the xml file.
+# This is introduced, because system integration has
+# variable PackageVersion and PackageRevision in xml file.
+############################################################
+
+sub put_rpmpath_into_xmlfile
+{
+ my ($xmlfile, $listofpackages) = @_;
+
+ my $infoline = "";
+
+ my $alluniquenames = collect_uniquenames_in_xmlfile($xmlfile);
+
+ my $number = $#{$listofpackages} + 1;
+ $infoline = "Number of packages in installation set: $number\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $number = $#{$alluniquenames} + 1;
+ $infoline = "Number of unique RPM names in xml file: $number\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ $infoline = "\nPackages in installation set:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ for ( my $i = 0; $i <= $#{$listofpackages}; $i++ )
+ {
+ $infoline = "${$listofpackages}[$i]\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ $infoline = "\nUnique RPM names in xml file:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ for ( my $i = 0; $i <= $#{$alluniquenames}; $i++ )
+ {
+ $infoline = "${$alluniquenames}[$i]\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( $#{$alluniquenames} != $#{$listofpackages} ) { installer::exiter::exit_program("ERROR: xml file contains $#{$alluniquenames} unique names, but there are $#{$listofpackages} packages in installation set!", "put_rpmpath_into_xmlfile"); }
+
+ for ( my $i = 0; $i <= $#{$alluniquenames}; $i++ )
+ {
+ my $uniquename = ${$alluniquenames}[$i];
+ my $rpmname = find_rpmname_to_uniquename($uniquename, $listofpackages);
+ set_rpmname_into_xmlfile($rpmname, $uniquename, $xmlfile);
+ }
+}
+
+#######################################################
+# Including the file size of the rpms into the
+# xml file
+#######################################################
+
+sub put_filesize_into_xmlfile
+{
+ my ($xmlfile, $listofpackages) = @_;
+
+ my $infoline = "";
+
+ for ( my $i = 0; $i <= $#{$listofpackages}; $i++ )
+ {
+ my $completerpmname = ${$listofpackages}[$i];
+ my $rpmname = $completerpmname;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$rpmname);
+
+ if ( ! $installer::globals::rpmquerycommand ) { installer::exiter::exit_program("ERROR: rpm not found for querying packages!", "put_filesize_into_xmlfile"); }
+ my $systemcall = "$installer::globals::rpmquerycommand -qp --queryformat \"\[\%\{FILESIZES\}\\n\]\" $completerpmname 2\>\&1 |";
+ my $rpmout = make_systemcall($systemcall, 0);
+ my $filesize = do_sum($rpmout);
+
+ $infoline = "Filesize $rpmname : $filesize\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ set_filesize_in_xmlfile($filesize, $rpmname, $xmlfile);
+ }
+}
+
+#######################################################
+# Creating the java installer class file dynamically
+#######################################################
+
+sub create_java_installer
+{
+ my ( $installdir, $newdir, $languagestringref, $languagesarrayref, $allvariableshashref, $includepatharrayref, $modulesarrayref ) = @_;
+
+ installer::logger::include_header_into_logfile("Creating Java installer:");
+
+ my $infoline = "";
+
+ # collecting all packages or rpms located in the installation directory
+ my $listofpackages = get_all_packages_in_installdir($installdir, $newdir);
+
+ # creating the directory
+ my $javadir = installer::systemactions::create_directories("javainstaller", $languagestringref);
+ $javadir =~ s/\/\s*$//;
+# push(@installer::globals::removedirs, $javadir);
+
+ # copying the content from directory install_sdk into the java directory
+
+ my $projectroot = "";
+ if ( $ENV{'PRJ'} ) { $projectroot = $ENV{'PRJ'}; }
+ else { installer::exiter::exit_program("ERROR: Environment variable PRJ not set", "create_java_installer"); }
+
+ $projectroot =~ s/\/\s*$//;
+ my $sourcedir = "$projectroot/inc_global/unix/install_sdk";
+ installer::systemactions::copy_complete_directory_without_cvs($sourcedir, $javadir);
+
+ # determining the java template file
+
+ my $templatefilename = $javadir . $installer::globals::separator . "locale/resources/MyResources_template.java";
+
+ # Saving the content of the template file. It is used in the xml files
+
+ my $javatemplateorigfile = installer::files::read_file($templatefilename);
+
+ # determining the ulf language file
+
+ # my $ulffilename = "installsdk.ulf";
+ my $ulffilename = "installsdk.jlf";
+ $ulffilename = $installer::globals::javalanguagepath . $installer::globals::separator . $ulffilename;
+ my $ulffile = installer::files::read_file($ulffilename);
+
+ $infoline = "\nReading ulf file: $ulffilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ $infoline = "Translating the Java template file\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $i = 0; $i <= $#{$languagesarrayref}; $i++ )
+ {
+ my $onelanguage = ${$languagesarrayref}[$i];
+
+ # replacing all strings in the Java file with content of ulf files
+
+ my $templatefile = installer::files::read_file($templatefilename);
+
+ set_component_name_and_description($templatefile, $modulesarrayref, $onelanguage);
+ translate_javafile($templatefile, $ulffile, $onelanguage);
+
+ # adding the license file into the Java file
+
+ my $licensefilesource = get_licensefilesource($onelanguage, $includepatharrayref);
+ my $licensefile = installer::files::read_file($licensefilesource);
+ add_license_file_into_javafile($templatefile, $licensefile, $includepatharrayref, $javadir, $onelanguage);
+
+ # setting productname and productversion
+
+ set_productname_and_productversion($templatefile, $allvariableshashref);
+
+ # setting the class name in the java file ( "MyResources_TEMPLATE" -> "MyResources_en" )
+
+ # if ( $onelanguage =~ /^\s*(\w+)\-(\w+)\s*$/ ) { $onelanguage = $1; }
+ $onelanguage =~ s/en-US/en/; # java file name and class name contain only "_en"
+ $onelanguage =~ s/\-/\_/; # "pt-BR" -> "pt_BR"
+ my $classfilename = "MyResources_" . $onelanguage;
+ set_classfilename($templatefile, $classfilename, "MyResources_TEMPLATE");
+
+ # saving the new file
+
+ my $newfilename = $templatefilename;
+ $newfilename =~ s/_template\.java\s*$/_$onelanguage\.java/;
+
+ installer::files::save_file($newfilename, $templatefile);
+
+ $infoline = "Saving Java file: $newfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ # renaming one language java file to "MyResources.java"
+
+ my $baselanguage = installer::languages::get_default_language($languagesarrayref);
+ $baselanguage =~ s/\-/\_/; # "pt-BR" -> "pt_BR"
+ $baselanguage =~ s/en_US/en/; # java file name and class name contain only "_en"
+ # if ( $baselanguage =~ /^\s*(\w+)\-(\w+)\s*$/ ) { $baselanguage = $1; } # java file name and class name contain only "_en"
+ # $baselanguage =~ s/en-US/en/; # java file name and class name contain only "_en"
+ my $baselanguagefilename = $javadir . $installer::globals::separator . "locale/resources/MyResources_" . $baselanguage . "\.java";
+ my $basedestfilename = $javadir . $installer::globals::separator . "locale/resources/MyResources.java";
+ installer::systemactions::copy_one_file($baselanguagefilename, $basedestfilename);
+
+ # setting the class file name also for the base class
+
+ my $basetemplatefile = installer::files::read_file($basedestfilename);
+ my $oldclassfilename = $baselanguagefilename;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$oldclassfilename);
+ $oldclassfilename =~ s/\.java//;
+ my $newclassfilename = $basedestfilename;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$newclassfilename);
+ $newclassfilename =~ s/\.java//;
+
+ set_classfilename($basetemplatefile, $newclassfilename, $oldclassfilename);
+
+ installer::files::save_file($basedestfilename, $basetemplatefile);
+
+ $infoline = "Created base Java file: $basedestfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # deleting the template file
+
+ unlink($templatefilename);
+
+ $infoline = "Deleted template Java resource file: $templatefilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # changing into Java directory
+
+ my $from = cwd();
+
+ chdir($javadir);
+
+ $infoline = "Changing into directory: $javadir\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # preparing the xml file
+
+ my $xmlfilename = "";
+ my $subdir = "";
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ $xmlfilename = "pkgUnit.xml";
+ }
+ elsif ( $installer::globals::islinuxrpmbuild )
+ {
+ $xmlfilename = "rpmUnit.xml";
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: No platform for Install SDK", "create_java_installer");
+ }
+
+ # reading, editing and saving the xmlfile
+
+ my $xmlfile = installer::files::read_file($xmlfilename);
+ prepare_language_pack_in_xmlfile($xmlfile, $languagesarrayref);
+ my $xmlfilename2 = $xmlfilename . ".test2";
+ installer::files::save_file($xmlfilename2, $xmlfile);
+ remove_empty_packages_in_xmlfile($xmlfile);
+ my $xmlfilename3 = $xmlfilename . ".test3";
+ installer::files::save_file($xmlfilename3, $xmlfile);
+ substitute_variables($xmlfile, $allvariableshashref);
+ if (( $installer::globals::islinuxrpmbuild ) && ( $#installer::globals::linkrpms > -1 )) { prepare_linkrpm_in_xmlfile($xmlfile,\@installer::globals::linkrpms); }
+ if ( $installer::globals::issolarisx86build || $installer::globals::islinuxbuild ) { remove_w4w_from_xmlfile($xmlfile); }
+ remove_module_if_not_defined($xmlfile, $modulesarrayref, "gid_Module_Optional_Onlineupdate");
+ replace_component_names($xmlfile, $templatefilename, $modulesarrayref, $javatemplateorigfile, $ulffile);
+ my $xmlfilename4 = $xmlfilename . ".test4";
+ installer::files::save_file($xmlfilename4, $xmlfile);
+ if ( $installer::globals::islinuxrpmbuild ) { put_rpmpath_into_xmlfile($xmlfile, $listofpackages); }
+ if ( $installer::globals::islinuxrpmbuild ) { put_filesize_into_xmlfile($xmlfile, $listofpackages); }
+ installer::files::save_file($xmlfilename, $xmlfile);
+ $infoline = "Saving xml file: $xmlfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Setting the classpath and starting compiler
+
+ set_classpath_for_install_sdk($javadir);
+
+ # creating class files:
+ # language class file, dialog class files, installer class file
+
+ my $jdkpath = "";
+ if ( $ENV{'JDKPATH'} ) { $jdkpath = $ENV{'JDKPATH'}; }
+
+ my $javac = "javac";
+ if ( $jdkpath ) { $javac = $jdkpath . $installer::globals::separator . $javac; }
+
+ my $systemcall = "$javac locale\/resources\/\*\.java 2\>\&1 |";
+ make_systemcall($systemcall, 1);
+
+ $systemcall = "$javac com\/sun\/staroffice\/install\/\*\.java 2\>\&1 |";
+ make_systemcall($systemcall, 1);
+
+ # making subdirectory creating empty packages
+ create_empty_packages($xmlfile);
+
+ # Copy "jresetup" from solver locally to include it into the classfile
+ # Copy "jresetup" from solver to installdir
+
+ my $setupname = "jresetup";
+ my $newname = "setup";
+ copy_setup_locally($includepatharrayref, $setupname, $newname);
+
+ my $java = "java";
+ if ( $jdkpath ) { $java = $jdkpath . $installer::globals::separator . $java; }
+
+ $systemcall = "$java com.sun.setup.builder.InstallBuilder $xmlfilename -novalidate 2\>\&1 |";
+ make_systemcall($systemcall, 1);
+
+ # copying the newly created classfile into the installation set
+
+ my $archivefilename = get_archivefilename($xmlfile);
+ $archivefilename = $archivefilename . ".class";
+
+ if ( ! -f $archivefilename ) { installer::exiter::exit_program("ERROR: Could not find Java class file $archivefilename!", "create_java_installer"); }
+
+ installer::systemactions::copy_one_file($archivefilename, $installdir);
+
+ # Adding the loader into the installation set. The name of the loader is setup.
+ put_loader_into_installset($installdir, $newname);
+
+ chdir($from);
+
+ $infoline = "Changing into directory: $from\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/languagepack.pm b/solenv/bin/modules/installer/languagepack.pm
new file mode 100644
index 000000000000..ded5bc3d2e21
--- /dev/null
+++ b/solenv/bin/modules/installer/languagepack.pm
@@ -0,0 +1,565 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::languagepack;
+
+use installer::converter;
+use installer::existence;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::scpzipfiles;
+use installer::scriptitems;
+use installer::systemactions;
+use installer::worker;
+
+####################################################
+# Selecting all files with the correct language
+####################################################
+
+sub select_language_items
+{
+ my ( $itemsref, $languagesarrayref, $itemname ) = @_;
+
+ installer::logger::include_header_into_logfile("Selecting languages for language pack. Item: $itemname");
+
+ my @itemsarray = ();
+
+ for ( my $i = 0; $i <= $#{$itemsref}; $i++ )
+ {
+ my $oneitem = ${$itemsref}[$i];
+
+ my $ismultilingual = $oneitem->{'ismultilingual'};
+
+ if (!($ismultilingual))
+ {
+ # Files with style "LANGUAGEPACK" and "FORCELANGUAGEPACK" also have to be included into the language pack.
+ # Files with style "LANGUAGEPACK" are only included into language packs.
+ # Files with style "FORCELANGUAGEPACK" are included into language packs and non language packs. They are
+ # forced, because otherwise they not not be included into languagepacks.
+
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
+
+ if (( $styles =~ /\bLANGUAGEPACK\b/ ) || ( $styles =~ /\bFORCELANGUAGEPACK\b/ )) { push(@itemsarray, $oneitem); }
+
+ next; # single language files are not included into language pack
+ }
+
+ my $specificlanguage = "";
+ if ( $oneitem->{'specificlanguage'} ) { $specificlanguage = $oneitem->{'specificlanguage'}; }
+
+ for ( my $j = 0; $j <= $#{$languagesarrayref}; $j++ ) # iterating over all languages
+ {
+ my $onelanguage = ${$languagesarrayref}[$j];
+ my $locallang = $onelanguage;
+ $locallang =~ s/-/_/;
+
+ if ( $specificlanguage eq $onelanguage )
+ {
+ # $oneitem->{'modules'} = $installer::globals::rootmodulegid; # all files in a language pack are root files
+ # Using $installer::globals::languagemodulesbase (?)
+
+# # no more automatic change of module assignments
+# $oneitem->{'modules'} = $installer::globals::rootmodulegid . "_$locallang"; # all files in a language pack are root files
+#
+# if (( $installer::globals::islinuxbuild ) || ( $installer::globals::issolarispkgbuild ))
+# {
+# if ( $oneitem->{'Dir'} )
+# {
+# if ( $oneitem->{'Dir'} eq "gid_Dir_Fonts_Truetype" ) { $oneitem->{'modules'} = "gid_Module_Langpack_Fonts_$locallang"; }
+# if ( $oneitem->{'Dir'} eq "gid_Dir_Resource" ) { $oneitem->{'modules'} = "gid_Module_Langpack_Resource_$locallang"; }
+# if ( $oneitem->{'Dir'} eq "gid_Dir_Help_Isolanguage" ) { $oneitem->{'modules'} = "gid_Module_Langpack_Help_$locallang"; }
+# }
+# }
+
+ # preparing different modules for Windows Installer language packs
+ # my $underlinelanguage = $specificlanguage;
+ # $underlinelanguage =~ s/-/_/;
+ # if ( $installer::globals::iswindowsbuild ) { $oneitem->{'modules'} = $installer::globals::languagemodulesbase . $underlinelanguage; }
+
+# # no more collecting of language pack feature
+# if (! installer::existence::exists_in_array($oneitem->{'modules'}, \@installer::globals::languagepackfeature))
+# {
+# push(@installer::globals::languagepackfeature, $oneitem->{'modules'}); # Collecting all language pack feature
+# }
+
+ push(@itemsarray, $oneitem);
+ }
+ }
+ }
+
+ return \@itemsarray;
+}
+
+sub replace_languagestring_variable
+{
+ my ($onepackageref, $languagestringref) = @_;
+
+ my $key;
+
+ foreach $key (keys %{$onepackageref})
+ {
+ my $value = $onepackageref->{$key};
+ $value =~ s/\%LANGUAGESTRING/$$languagestringref/g;
+ $onepackageref->{$key} = $value;
+ }
+}
+
+#########################################################
+# Including the license text into the script template
+#########################################################
+
+sub put_license_file_into_script
+{
+ my ($scriptfile, $licensefile) = @_;
+
+ my $infoline = "Adding licensefile into language pack script\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $includestring = "";
+
+ for ( my $i = 0; $i <= $#{$licensefile}; $i++ )
+ {
+ $includestring = $includestring . ${$licensefile}[$i];
+ }
+
+ for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
+ {
+ ${$scriptfile}[$i] =~ s/LICENSEFILEPLACEHOLDER/$includestring/;
+ }
+}
+
+#########################################################
+# Creating a tar.gz file from a Solaris package
+#########################################################
+
+sub create_tar_gz_file
+{
+ my ($installdir, $packagename, $packagestring) = @_;
+
+ $packagename =~ s/\.rpm\s*$//;
+ my $targzname = $packagename . ".tar.gz";
+ $systemcall = "cd $installdir; tar -cf - $packagestring | gzip > $targzname";
+ installer::logger::print_message( "... $systemcall ...\n" );
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return $targzname;
+}
+
+#########################################################
+# Determining the name of the package file
+#########################################################
+
+sub get_packagename_from_packagelist
+{
+ my ( $alldirs, $allvariables, $languagestringref ) = @_;
+
+ # my $packagename = "";
+
+ # for ( my $i = 0; $i <= $#{$alldirs}; $i++ )
+ # {
+ # if ( ${$alldirs}[$i] =~ /-fonts/ ) { next; }
+ # if ( ${$alldirs}[$i] =~ /-help/ ) { next; }
+ # if ( ${$alldirs}[$i] =~ /-res/ ) { next; }
+ #
+ # $packagename = ${$alldirs}[$i];
+ # last;
+ # }
+
+ # if ( $packagename eq "" ) { installer::exiter::exit_program("ERROR: Could not find base package in directory $installdir!", "get_packagename_from_packagelist"); }
+
+ my $localproductname = $allvariables->{'PRODUCTNAME'};
+ $localproductname = lc($localproductname);
+ $localproductname =~ s/ //g;
+ $localproductname =~ s/-/_/g;
+
+ my $packagename = $localproductname . "_" . $$languagestringref;
+
+ return $packagename;
+}
+
+#########################################################
+# Determining the name of the package file or the rpm
+# in the installation directory. For language packs
+# there is only one file in this directory
+#########################################################
+
+sub determine_packagename
+{
+ my ( $installdir, $allvariables, $languagestringref ) = @_;
+
+ my $packagename = "";
+ my $allnames = "";
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ # determining the rpm file in directory $installdir
+
+ my $fileextension = "rpm";
+ my $rpmfiles = installer::systemactions::find_file_with_file_extension($fileextension, $installdir);
+ if ( ! ( $#{$rpmfiles} > -1 )) { installer::exiter::exit_program("ERROR: Could not find package in directory $installdir!", "determine_packagename"); }
+ my $rpmsav = installer::converter::copy_array_from_references($rpmfiles);
+ for ( my $i = 0; $i <= $#{$rpmfiles}; $i++ ) { installer::pathanalyzer::make_absolute_filename_to_relative_filename(\${$rpmfiles}[$i]); }
+
+ $packagename = get_packagename_from_packagelist($rpmfiles, $allvariables, $languagestringref);
+
+ my $packagestring = installer::converter::convert_array_to_space_separated_string($rpmfiles);
+ $packagename = create_tar_gz_file($installdir, $packagename, $packagestring); # only one file
+ for ( my $i = 0; $i <= $#{$rpmsav}; $i++ )
+ {
+ my $onefile = $installdir . $installer::globals::separator . ${$rpmsav}[$i];
+ unlink($onefile);
+ }
+
+ $allnames = $rpmfiles;
+ }
+
+ if ( $installer::globals::issolarisbuild )
+ {
+ # determining the Solaris package file in directory $installdir
+ my $alldirs = installer::systemactions::get_all_directories($installdir);
+
+ if ( ! ( $#{$alldirs} > -1 )) { installer::exiter::exit_program("ERROR: Could not find package in directory $installdir!", "determine_packagename"); }
+ my $alldirssav = installer::converter::copy_array_from_references($alldirs);
+ for ( my $i = 0; $i <= $#{$alldirs}; $i++ ) { installer::pathanalyzer::make_absolute_filename_to_relative_filename(\${$alldirs}[$i]); }
+
+ $packagename = get_packagename_from_packagelist($alldirs, $allvariables, $languagestringref);
+ my $packagestring = installer::converter::convert_array_to_space_separated_string($alldirs);
+ $packagename = create_tar_gz_file($installdir, $packagename, $packagestring); # only a file (not a directory) can be included into the shell script
+ for ( my $i = 0; $i <= $#{$alldirssav}; $i++ ) { installer::systemactions::remove_complete_directory(${$alldirssav}[$i], 1); }
+ $allnames = $alldirs;
+ }
+
+ my $infoline = "Found package in installation directory $installdir : $packagename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return ( $packagename, $allnames);
+}
+
+#########################################################
+# Including the name of the package file or the rpm
+# into the script template
+#########################################################
+
+sub put_packagename_into_script
+{
+ my ($scriptfile, $packagename, $allnames) = @_;
+
+ my $localpackagename = $packagename;
+ $localpackagename =~ s/\.tar\.gz//; # making "OOOopenoffice-it-ea.tar.gz" to "OOOopenoffice-it-ea"
+ my $infoline = "Adding packagename $localpackagename into language pack script\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $installline = "";
+
+ if ( $installer::globals::issolarisbuild ) { $installline = " /usr/sbin/pkgadd -d \$outdir -a \$adminfile"; }
+
+ if ( $installer::globals::islinuxrpmbuild ) { $installline = " rpm --prefix \$PRODUCTINSTALLLOCATION --replacepkgs -i"; }
+
+ for ( my $i = 0; $i <= $#{$allnames}; $i++ )
+ {
+ if ( $installer::globals::issolarisbuild ) { $installline = $installline . " ${$allnames}[$i]"; }
+
+ if ( $installer::globals::islinuxrpmbuild ) { $installline = $installline . " \$outdir/${$allnames}[$i]"; }
+ }
+
+ for ( my $j = 0; $j <= $#{$scriptfile}; $j++ )
+ {
+ ${$scriptfile}[$j] =~ s/INSTALLLINES/$installline/;
+ }
+}
+
+##################################################################
+# Including the lowercase product name into the script template
+##################################################################
+
+sub put_productname_into_script
+{
+ my ($scriptfile, $variableshashref) = @_;
+
+ my $productname = $variableshashref->{'PRODUCTNAME'};
+ $productname = lc($productname);
+ $productname =~ s/\.//g; # openoffice.org -> openofficeorg
+
+ my $infoline = "Adding productname $productname into language pack script\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
+ {
+ ${$scriptfile}[$i] =~ s/PRODUCTNAMEPLACEHOLDER/$productname/;
+ }
+}
+
+##################################################################
+# Including the full product name into the script template
+# (name and version)
+##################################################################
+
+sub put_fullproductname_into_script
+{
+ my ($scriptfile, $variableshashref) = @_;
+
+ my $productname = $variableshashref->{'PRODUCTNAME'};
+ my $productversion = "";
+ if ( $variableshashref->{'PRODUCTVERSION'} ) { $productversion = $variableshashref->{'PRODUCTVERSION'}; };
+ my $fullproductname = $productname . " " . $productversion;
+
+ my $infoline = "Adding full productname \"$fullproductname\" into language pack script\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
+ {
+ ${$scriptfile}[$i] =~ s/FULLPRODUCTNAMELONGPLACEHOLDER/$fullproductname/;
+ }
+}
+
+##################################################################
+# Including the name of the search package (-core01)
+# into the script template
+##################################################################
+
+sub put_searchpackage_into_script
+{
+ my ($scriptfile, $variableshashref) = @_;
+
+ my $basispackageprefix = $variableshashref->{'BASISPACKAGEPREFIX'};
+ my $basispackageversion = $variableshashref->{'OOOBASEVERSION'};
+
+ if ( $installer::globals::issolarisbuild ) { $basispackageversion =~ s/\.//g; } # "3.0" -> "30"
+
+ my $infoline = "Adding basis package prefix $basispackageprefix into language pack script\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ $infoline = "Adding basis package version $basispackageversion into language pack script\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
+ {
+ ${$scriptfile}[$i] =~ s/BASISPACKAGEPREFIXPLACEHOLDER/$basispackageprefix/;
+ ${$scriptfile}[$i] =~ s/OOOBASEVERSIONPLACEHOLDER/$basispackageversion/;
+ }
+
+}
+
+#########################################################
+# Including the linenumber into the script template
+#########################################################
+
+sub put_linenumber_into_script
+{
+ my ( $scriptfile, $licensefile, $allnames ) = @_;
+
+ my $linenumber = $#{$scriptfile} + $#{$licensefile} + 3; # also adding the content of the license file!
+
+ my $infoline = "Adding linenumber $linenumber into language pack script\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
+ {
+ ${$scriptfile}[$i] =~ s/LINENUMBERPLACEHOLDER/$linenumber/;
+ }
+}
+
+#########################################################
+# Determining the name of the new scriptfile
+#########################################################
+
+sub determine_scriptfile_name
+{
+ my ( $packagename ) = @_;
+
+ my $scriptfilename = $packagename;
+
+# if ( $installer::globals::islinuxrpmbuild ) { $scriptfilename =~ s/\.rpm\s*$/\.sh/; }
+# if ( $installer::globals::issolarisbuild ) { $scriptfilename =~ s/\.tar\.gz\s*$/\.sh/; }
+
+ $scriptfilename =~ s/\.tar\.gz\s*$/\.sh/;
+
+ my $infoline = "Setting language pack script file name to $scriptfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return $scriptfilename;
+}
+
+#########################################################
+# Saving the script file in the installation directory
+#########################################################
+
+sub save_script_file
+{
+ my ($installdir, $newscriptfilename, $scriptfile) = @_;
+
+ $newscriptfilename = $installdir . $installer::globals::separator . $newscriptfilename;
+ installer::files::save_file($newscriptfilename, $scriptfile);
+
+ my $infoline = "Saving script file $newscriptfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return $newscriptfilename;
+}
+
+#########################################################
+# Including the binary package into the script
+#########################################################
+
+sub include_package_into_script
+{
+ my ( $scriptfilename, $installdir, $packagename ) = @_;
+
+ my $longpackagename = $installdir . $installer::globals::separator . $packagename;
+ my $systemcall = "cat $longpackagename >>$scriptfilename";
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ my $localcall = "chmod 775 $scriptfilename \>\/dev\/null 2\>\&1";
+ system($localcall);
+
+}
+
+#########################################################
+# Removing the binary package
+#########################################################
+
+sub remove_package
+{
+ my ( $installdir, $packagename ) = @_;
+
+ my $remove_package = 1;
+
+ if ( $ENV{'DONT_REMOVE_PACKAGE'} ) { $remove_package = 0; }
+
+ if ( $remove_package )
+ {
+ my $longpackagename = $installdir . $installer::globals::separator . $packagename;
+ unlink $longpackagename;
+
+ my $infoline = "Removing package: $longpackagename \n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+####################################################
+# Unix language packs, that are not part of
+# multilingual installation sets, need a
+# shell script installer
+####################################################
+
+sub build_installer_for_languagepack
+{
+ my ($installdir, $allvariableshashref, $includepatharrayref, $languagesarrayref, $languagestringref) = @_;
+
+ installer::logger::print_message( "... creating shell script installer ...\n" );
+
+ installer::logger::include_header_into_logfile("Creating shell script installer:");
+
+ # find and read setup script template
+
+ my $scriptfilename = "langpackscript.sh";
+ my $scriptref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$scriptfilename, $includepatharrayref, 0);
+ if ($$scriptref eq "") { installer::exiter::exit_program("ERROR: Could not find script file $scriptfilename!", "build_installer_for_languagepack"); }
+ my $scriptfile = installer::files::read_file($$scriptref);
+
+ my $infoline = "Found script file $scriptfilename: $$scriptref \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # find and read english license file
+ my $licenselanguage = "en-US"; # always english !
+ my $licensefilename = "LICENSE_" . $licenselanguage;
+ my $licenseincludepatharrayref = installer::worker::get_language_specific_include_pathes($includepatharrayref, $licenselanguage);
+
+ my $licenseref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$licensefilename, $licenseincludepatharrayref, 0);
+ if ($$licenseref eq "") { installer::exiter::exit_program("ERROR: Could not find License file $licensefilename!", "build_installer_for_languagepack"); }
+ my $licensefile = installer::files::read_file($$licenseref);
+
+ $infoline = "Found licensefile $licensefilename: $$licenseref \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # including variables into license file
+ installer::scpzipfiles::replace_all_ziplistvariables_in_file($licensefile, $allvariableshashref);
+
+ # add license text into script template
+ put_license_file_into_script($scriptfile, $licensefile);
+
+ # add rpm or package file name into script template
+ my ( $packagename, $allnames) = determine_packagename($installdir, $allvariableshashref, $languagestringref);
+ put_packagename_into_script($scriptfile, $packagename, $allnames);
+
+ # add product name into script template
+ put_productname_into_script($scriptfile, $allvariableshashref);
+
+ # add product name into script template
+ put_fullproductname_into_script($scriptfile, $allvariableshashref);
+
+ # add product name into script template
+ put_searchpackage_into_script($scriptfile, $allvariableshashref);
+
+ # replace linenumber in script template
+ put_linenumber_into_script($scriptfile, $licensefile, $allnames);
+
+ # saving the script file
+ my $newscriptfilename = determine_scriptfile_name($packagename);
+ $newscriptfilename = save_script_file($installdir, $newscriptfilename, $scriptfile);
+
+ # include rpm or package into script
+ include_package_into_script($newscriptfilename, $installdir, $packagename);
+
+ # remove rpm or package
+ remove_package($installdir, $packagename);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/languages.pm b/solenv/bin/modules/installer/languages.pm
new file mode 100644
index 000000000000..7070b09f80b8
--- /dev/null
+++ b/solenv/bin/modules/installer/languages.pm
@@ -0,0 +1,379 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::languages;
+
+use installer::converter;
+use installer::existence;
+use installer::exiter;
+use installer::globals;
+use installer::remover;
+use installer::ziplist;
+
+#############################################################################
+# Analyzing the laguage list parameter and language list from zip list file
+#############################################################################
+
+sub analyze_languagelist
+{
+ my $first = $installer::globals::languagelist;
+
+ $first =~ s/\_/\,/g; # substituting "_" by ",", in case of dmake definition 01_49
+
+ # Products are separated by a "#", if defined in zip-list by a "|". But "get_info_about_languages"
+ # substitutes already "|" to "#". This procedure only knows "#" as product separator.
+ # Different languages for one product are separated by ",". But on the command line the "_" is used.
+ # Therefore "_" is replaced by "," at the beginning of this procedure.
+
+ while ($first =~ /^(\S+)\#(\S+?)$/) # Minimal matching, to keep the order of languages
+ {
+ $first = $1;
+ my $last = $2;
+ unshift(@installer::globals::languageproducts, $last);
+ }
+
+ unshift(@installer::globals::languageproducts, $first);
+}
+
+####################################################
+# Reading languages from zip list file
+####################################################
+
+sub get_info_about_languages
+{
+ my ( $allsettingsarrayref ) = @_;
+
+ my $languagelistref;
+
+ $languagelistref = installer::ziplist::getinfofromziplist($allsettingsarrayref, "languages");
+ $installer::globals::languagelist = $$languagelistref;
+
+ if ( $installer::globals::languagelist eq "" ) # not defined on command line and not in product list
+ {
+ installer::exiter::exit_program("ERROR: Languages not defined on command line (-l) and not in product list!", "get_info_about_languages");
+ }
+
+ # Adapting the separator format from zip list.
+ # | means new product, , (comma) means more than one language in one product
+ # On the command line, | is difficult to use. Therefore this script uses hashes
+
+ $installer::globals::languagelist =~ s/\|/\#/g;
+
+ analyze_languagelist();
+}
+
+#############################################################################
+# Checking whether all elements of an array A are also member of array B
+#############################################################################
+
+sub all_elements_of_array1_in_array2
+{
+ my ($array1, $array2) = @_;
+
+ my $array2_contains_all_elements_of_array1 = 1;
+
+ for ( my $i = 0; $i <= $#{$array1}; $i++ )
+ {
+ if (! installer::existence::exists_in_array(${$array1}[$i], $array2))
+ {
+ $array2_contains_all_elements_of_array1 = 0;
+ last;
+ }
+ }
+
+ return $array2_contains_all_elements_of_array1;
+}
+
+#############################################
+# All languages defined for one product
+#############################################
+
+sub get_all_languages_for_one_product
+{
+ my ( $languagestring, $allvariables ) = @_;
+
+ my @languagearray = ();
+
+ my $last = $languagestring;
+
+ $installer::globals::ismultilingual = 0; # setting the global variable $ismultilingual !
+ if ( $languagestring =~ /\,/ ) { $installer::globals::ismultilingual = 1; }
+
+ while ( $last =~ /^\s*(.+?)\,(.+)\s*$/) # "$" for minimal matching, comma separated list
+ {
+ my $first = $1;
+ $last = $2;
+ installer::remover::remove_leading_and_ending_whitespaces(\$first);
+ push(@languagearray, "$first");
+ }
+
+ installer::remover::remove_leading_and_ending_whitespaces(\$last);
+ push(@languagearray, "$last");
+
+ if ( $installer::globals::iswindowsbuild )
+ {
+ my $furthercheck = 1;
+
+ # For some languages (that are not supported by Windows, english needs to be added to the installation set
+ # Languages saved in "@installer::globals::noMSLocaleLangs"
+
+ if ( all_elements_of_array1_in_array2(\@languagearray, \@installer::globals::noMSLocaleLangs) )
+ {
+ my $officestartlanguage = $languagearray[0];
+ unshift(@languagearray, "en-US"); # am Anfang einfügen!
+ $installer::globals::ismultilingual = 1;
+ $installer::globals::added_english = 1;
+ $installer::globals::set_office_start_language = 1;
+ # setting the variable PRODUCTLANGUAGE, needed for Linguistic-ForceDefaultLanguage.xcu
+ $allvariables->{'PRODUCTLANGUAGE'} = $officestartlanguage;
+ $furthercheck = 0;
+ }
+
+ # In bilingual installation sets, in which english is the first language,
+ # the Office start language shall be the second language.
+
+ if ( $furthercheck )
+ {
+ if (( $#languagearray == 1 ) && ( $languagearray[0] eq "en-US" ))
+ {
+ my $officestartlanguage = $languagearray[1];
+ $installer::globals::set_office_start_language = 1;
+ # setting the variable PRODUCTLANGUAGE, needed for Linguistic-ForceDefaultLanguage.xcu
+ $allvariables->{'PRODUCTLANGUAGE'} = $officestartlanguage;
+ }
+ }
+ }
+
+ return \@languagearray;
+}
+
+####################################################################################
+# FAKE: The languages string may contain only "de", "en-US", instead of "01", ...
+# But this has to be removed as soon as possible.
+# In the future the languages are determined with "en-US" instead "01"
+# already on the command line and in the zip list file.
+####################################################################################
+
+sub fake_languagesstring
+{
+ my ($stringref) = @_;
+
+ # ATTENTION: This function has to be removed as soon as possible!
+
+ $$stringref =~ s/01/en-US/;
+ $$stringref =~ s/03/pt/;
+ $$stringref =~ s/07/ru/;
+ $$stringref =~ s/30/el/;
+ $$stringref =~ s/31/nl/;
+ $$stringref =~ s/33/fr/;
+ $$stringref =~ s/34/es/;
+ $$stringref =~ s/35/fi/;
+ $$stringref =~ s/36/hu/;
+ $$stringref =~ s/37/ca/;
+ $$stringref =~ s/39/it/;
+ $$stringref =~ s/42/cs/;
+ $$stringref =~ s/43/sk/;
+ $$stringref =~ s/44/en-GB/;
+ $$stringref =~ s/45/da/;
+ $$stringref =~ s/46/sv/;
+ $$stringref =~ s/47/no/;
+ $$stringref =~ s/48/pl/;
+ $$stringref =~ s/49/de/;
+ $$stringref =~ s/55/pt-BR/;
+ $$stringref =~ s/66/th/;
+ $$stringref =~ s/77/et/;
+ $$stringref =~ s/81/ja/;
+ $$stringref =~ s/82/ko/;
+ $$stringref =~ s/86/zh-CN/;
+ $$stringref =~ s/88/zh-TW/;
+ $$stringref =~ s/90/tr/;
+ $$stringref =~ s/91/hi-IN/;
+ $$stringref =~ s/96/ar/;
+ $$stringref =~ s/97/he/;
+}
+
+##########################################################
+# Converting the language array into a string for output
+##########################################################
+
+sub get_language_string
+{
+ my ($languagesref) = @_;
+
+ my $newstring = "";
+
+ for ( my $i = 0; $i <= $#{$languagesref}; $i++ )
+ {
+ $newstring = $newstring . ${$languagesref}[$i] . "_";
+ }
+
+ # remove ending underline
+
+ $newstring =~ s/\_\s*$//;
+
+ return \$newstring;
+}
+
+##########################################################
+# Analyzing the languages in the languages array and
+# returning the most important language
+##########################################################
+
+sub get_default_language
+{
+ my ($languagesref) = @_;
+
+ return ${$languagesref}[0]; # ToDo, only returning the first language
+}
+
+#############################################################
+# Contains the installation set one of the asian languages?
+#############################################################
+
+sub detect_asian_language
+{
+ my ($languagesref) = @_;
+
+ my $containsasia = 0;
+
+ for ( my $i = 0; $i <= $#{$languagesref}; $i++ )
+ {
+ my $onelang = ${$languagesref}[$i];
+ $onelang =~ s/\s*$//;
+
+ for ( my $j = 0; $j <= $#installer::globals::asianlanguages; $j++ )
+ {
+ my $asialang = $installer::globals::asianlanguages[$j];
+ $asialang =~ s/\s*$//;
+
+ if ( $onelang eq $asialang )
+ {
+ $containsasia = 1;
+ last;
+ }
+ }
+
+ if ( $containsasia ) { last; }
+ }
+
+ return $containsasia;
+}
+
+#############################################################
+# Contains the installation set only asian languages?
+#############################################################
+
+sub contains_only_asian_languages
+{
+ my ($languagesref) = @_;
+
+ my $onlyasian = 1;
+
+ for ( my $i = 0; $i <= $#{$languagesref}; $i++ )
+ {
+ my $onelang = ${$languagesref}[$i];
+ $onelang =~ s/\s*$//;
+
+ if (! installer::existence::exists_in_array($onelang, \@installer::globals::asianlanguages))
+ {
+ $onlyasian = 0;
+ last;
+ }
+ }
+
+ return $onlyasian;
+}
+
+################################################################
+# Contains the installation set one of the western languages
+################################################################
+
+sub detect_western_language
+{
+ my ($languagesref) = @_;
+
+ my $containswestern = 1;
+
+ if ( contains_only_asian_languages($languagesref) ) { $containswestern = 0; }
+
+ return $containswestern;
+}
+
+################################################################
+# Determining the language used by the Java installer
+################################################################
+
+sub get_java_language
+{
+ my ( $language ) = @_;
+
+ # my $javalanguage = "";
+
+ # if ( $language eq "en-US" ) { $javalanguage = "en_US"; }
+ # elsif ( $language eq "ar" ) { $javalanguage = "ar_AR"; }
+ # elsif ( $language eq "bg" ) { $javalanguage = "bg_BG"; }
+ # elsif ( $language eq "ca" ) { $javalanguage = "ca_CA"; }
+ # elsif ( $language eq "cs" ) { $javalanguage = "cs_CS"; }
+ # elsif ( $language eq "da" ) { $javalanguage = "da_DA"; }
+ # elsif ( $language eq "de" ) { $javalanguage = "de"; }
+ # elsif ( $language eq "de" ) { $javalanguage = "de_DE"; }
+ # elsif ( $language eq "et" ) { $javalanguage = "et_ET"; }
+ # elsif ( $language eq "el" ) { $javalanguage = "el_EL"; }
+ # elsif ( $language eq "fi" ) { $javalanguage = "fi_FI"; }
+ # elsif ( $language eq "fr" ) { $javalanguage = "fr_FR"; }
+ # elsif ( $language eq "hu" ) { $javalanguage = "hu_HU"; }
+ # elsif ( $language eq "he" ) { $javalanguage = "he_HE"; }
+ # elsif ( $language eq "it" ) { $javalanguage = "it_IT"; }
+ # elsif ( $language eq "nl" ) { $javalanguage = "nl_NL"; }
+ # elsif ( $language eq "es" ) { $javalanguage = "es_ES"; }
+ # elsif ( $language eq "sv" ) { $javalanguage = "sv_SV"; }
+ # elsif ( $language eq "sk" ) { $javalanguage = "sk_SK"; }
+ # elsif ( $language eq "pl" ) { $javalanguage = "pl_PL"; }
+ # elsif ( $language eq "pt-BR" ) { $javalanguage = "pt_BR"; }
+ # elsif ( $language eq "ru" ) { $javalanguage = "ru_RU"; }
+ # elsif ( $language eq "tr" ) { $javalanguage = "tr_TR"; }
+ # elsif ( $language eq "ja" ) { $javalanguage = "ja"; }
+ # elsif ( $language eq "ja" ) { $javalanguage = "ja_JP"; }
+ # elsif ( $language eq "ko" ) { $javalanguage = "ko_KR"; }
+ # elsif ( $language eq "th" ) { $javalanguage = "th_TH"; }
+ # elsif ( $language eq "zh-CN" ) { $javalanguage = "zh_CN"; }
+ # elsif ( $language eq "zh-TW" ) { $javalanguage = "zh_TW"; }
+
+ # languages not defined yet
+ # if ( $javalanguage eq "" )
+ # {
+ # $javalanguage = $language;
+ # $javalanguage =~ s/\-/\_/;
+ # }
+
+ $javalanguage = $language;
+ $javalanguage =~ s/\-/\_/;
+
+ return $javalanguage;
+}
+
+1;
diff --git a/solenv/bin/modules/installer/logger.pm b/solenv/bin/modules/installer/logger.pm
new file mode 100644
index 000000000000..c5982c6a05f9
--- /dev/null
+++ b/solenv/bin/modules/installer/logger.pm
@@ -0,0 +1,339 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::logger;
+
+use installer::files;
+use installer::globals;
+
+####################################################
+# Including header files into the logfile
+####################################################
+
+sub include_header_into_logfile
+{
+ my ($message) = @_;
+
+ my $infoline;
+
+ $infoline = "\n" . get_time_string();
+ push( @installer::globals::logfileinfo, $infoline);
+
+ $infoline = "######################################################\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ $infoline = "$message\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+
+ $infoline = "######################################################\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+####################################################
+# Including header files into the logfile
+####################################################
+
+sub include_header_into_globallogfile
+{
+ my ($message) = @_;
+
+ my $infoline;
+
+ $infoline = "\n" . get_time_string();
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ $infoline = "######################################################\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ $infoline = "$message\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+
+ $infoline = "######################################################\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+}
+
+####################################################
+# Write timestamp into log file
+####################################################
+
+sub include_timestamp_into_logfile
+{
+ my ($message) = @_;
+
+ my $infoline;
+ my $timestring = get_time_string();
+ $infoline = "$message\t$timestring";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+####################################################
+# Writing all variables content into the log file
+####################################################
+
+sub log_hashref
+{
+ my ($hashref) = @_;
+
+ my $infoline = "\nLogging variable settings:\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+
+ my $itemkey;
+
+ foreach $itemkey ( keys %{$hashref} )
+ {
+ my $line = "";
+ my $itemvalue = "";
+ if ( $hashref->{$itemkey} ) { $itemvalue = $hashref->{$itemkey}; }
+ $line = $itemkey . "=" . $itemvalue . "\n";
+ push(@installer::globals::globallogfileinfo, $line);
+ }
+
+ $infoline = "\n";
+ push(@installer::globals::globallogfileinfo, $infoline);
+}
+
+#########################################################
+# Including global logging info into global log array
+#########################################################
+
+sub globallog
+{
+ my ($message) = @_;
+
+ my $infoline;
+
+ $infoline = "\n" . get_time_string();
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ $infoline = "################################################################\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ $infoline = "$message\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ $infoline = "################################################################\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+}
+
+###############################################################
+# For each product (new language) a new log file is created.
+# Therefore the global logging has to be saved in this file.
+###############################################################
+
+sub copy_globalinfo_into_logfile
+{
+ for ( my $i = 0; $i <= $#installer::globals::globallogfileinfo; $i++ )
+ {
+ push(@installer::globals::logfileinfo, $installer::globals::globallogfileinfo[$i]);
+ }
+}
+
+###############################################################
+# For each product (new language) a new log file is created.
+# Therefore the global logging has to be saved in this file.
+###############################################################
+
+sub debuginfo
+{
+ my ( $message ) = @_;
+
+ $message = $message . "\n";
+ push(@installer::globals::functioncalls, $message);
+}
+
+###############################################################
+# Saving the debug information.
+###############################################################
+
+sub savedebug
+{
+ my ( $outputdir ) = @_;
+
+ installer::files::save_file($outputdir . $installer::globals::debugfilename, \@installer::globals::functioncalls);
+ print_message( "... writing debug file " . $outputdir . $installer::globals::debugfilename . "\n" );
+}
+
+###############################################################
+# Starting the time
+###############################################################
+
+sub starttime
+{
+ $installer::globals::starttime = time();
+}
+
+###############################################################
+# Convert time string
+###############################################################
+
+sub convert_timestring
+{
+ my ($secondstring) = @_;
+
+ my $timestring = "";
+
+ if ( $secondstring < 60 ) # less than a minute
+ {
+ if ( $secondstring < 10 ) { $secondstring = "0" . $secondstring; }
+ $timestring = "00\:$secondstring min\.";
+ }
+ elsif ( $secondstring < 3600 )
+ {
+ my $minutes = $secondstring / 60;
+ my $seconds = $secondstring % 60;
+ if ( $minutes =~ /(\d*)\.\d*/ ) { $minutes = $1; }
+ if ( $minutes < 10 ) { $minutes = "0" . $minutes; }
+ if ( $seconds < 10 ) { $seconds = "0" . $seconds; }
+ $timestring = "$minutes\:$seconds min\.";
+ }
+ else # more than one hour
+ {
+ my $hours = $secondstring / 3600;
+ my $secondstring = $secondstring % 3600;
+ my $minutes = $secondstring / 60;
+ my $seconds = $secondstring % 60;
+ if ( $hours =~ /(\d*)\.\d*/ ) { $hours = $1; }
+ if ( $minutes =~ /(\d*)\.\d*/ ) { $minutes = $1; }
+ if ( $hours < 10 ) { $hours = "0" . $hours; }
+ if ( $minutes < 10 ) { $minutes = "0" . $minutes; }
+ if ( $seconds < 10 ) { $seconds = "0" . $seconds; }
+ $timestring = "$hours\:$minutes\:$seconds hours";
+ }
+
+ return $timestring;
+}
+
+###############################################################
+# Returning time string for logging
+###############################################################
+
+sub get_time_string
+{
+ my $currenttime = time();
+ $currenttime = $currenttime - $installer::globals::starttime;
+ $currenttime = convert_timestring($currenttime);
+ $currenttime = localtime() . " \(" . $currenttime . "\)\n";
+ return $currenttime;
+}
+
+###############################################################
+# Returning the age of a file (in seconds)
+###############################################################
+
+sub get_file_age
+{
+ my ( $filename ) = @_;
+
+ my $filetime = (stat($filename))[9];
+ my $timediff = time() - $filetime;
+ return $timediff;
+}
+
+###############################################################
+# Stopping the time
+###############################################################
+
+sub stoptime
+{
+ my $infoline = get_time_string();
+ print_message( "$infoline" );
+}
+
+###############################################################
+# Set date string, format: yymmdd
+###############################################################
+
+sub set_installation_date
+{
+ my $datestring = "";
+
+ my @timearray = localtime(time);
+
+ my $day = $timearray[3];
+ my $month = $timearray[4] + 1;
+ my $year = $timearray[5] - 100;
+
+ if ( $year < 10 ) { $year = "0" . $year; }
+ if ( $month < 10 ) { $month = "0" . $month; }
+ if ( $day < 10 ) { $day = "0" . $day; }
+
+ $datestring = $year . $month . $day;
+
+ return $datestring;
+}
+
+###############################################################
+# Console output: messages
+###############################################################
+
+sub print_message
+{
+ my $message = shift;
+ chomp $message;
+ my $force = shift || 0;
+ print "$message\n" if ( $force || ! $installer::globals::quiet );
+ return;
+}
+
+sub print_message_without_newline
+{
+ my $message = shift;
+ chomp $message;
+ print "$message" if ( ! $installer::globals::quiet );
+ return;
+}
+
+###############################################################
+# Console output: warnings
+###############################################################
+
+sub print_warning
+{
+ my $message = shift;
+ chomp $message;
+ print STDERR "WARNING: $message";
+ return;
+}
+
+###############################################################
+# Console output: errors
+###############################################################
+
+sub print_error
+{
+ my $message = shift;
+ chomp $message;
+ print STDERR "\n**************************************************\n";
+ print STDERR "ERROR: $message";
+ print STDERR "\n**************************************************\n";
+ return;
+}
+
+1;
diff --git a/solenv/bin/modules/installer/mail.pm b/solenv/bin/modules/installer/mail.pm
new file mode 100644
index 000000000000..3580b3f3b6ab
--- /dev/null
+++ b/solenv/bin/modules/installer/mail.pm
@@ -0,0 +1,136 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::mail;
+
+use Net::SMTP;
+use installer::converter;
+use installer::exiter;
+use installer::ziplist;
+
+#########################################
+# Sending a mail
+#########################################
+
+sub send_mail
+{
+ my ($message, $listenerstring, $mailinfostring, $languagesref, $destdir) = @_;
+
+ my $listener = installer::converter::convert_stringlist_into_array($listenerstring, ",");
+ my $mailinfo = installer::converter::convert_stringlist_into_array($mailinfostring, ",");
+
+ my @listener = ();
+
+ for ( my $i = 0; $i <= $#{$listener}; $i++ ) { push(@listener, ${$listener}[$i]); }
+ for ( my $i = 0; $i <= $#{$mailinfo}; $i++ ) { ${$mailinfo}[$i] =~ s/\s*$//g; }
+
+ my $smtphost = ${$mailinfo}[0];
+ my $account = ${$mailinfo}[1];
+ my $sender = ${$mailinfo}[2];
+
+ if ( ! $smtphost ) { installer::exiter::exit_program("ERROR: Could not read SMTP Host in list file!", "send_mail"); }
+ if ( ! $account ) { installer::exiter::exit_program("ERROR: Could not read Account in list file!", "send_mail"); }
+ if ( ! $sender ) { installer::exiter::exit_program("ERROR: Could not read Sender in list file!", "send_mail"); }
+
+ my $subject = "";
+ my $basestring = $installer::globals::product . " " . $installer::globals::compiler . $installer::globals::productextension . " " . $installer::globals::build. " " . $installer::globals::buildid . " " . $$languagesref . "\n";
+ if ( $message eq "ERROR" ) { $subject = "ERROR: $basestring" }
+ if ( $message eq "SUCCESS" ) { $subject = "SUCCESS: $basestring" }
+
+ my @message = ();
+
+ my $recipient_string = join ',', @listener;
+ push(@message, "Subject: $subject");
+ push(@message, "To: $recipient_string");
+ push(@message, "\n");
+ push(@message, "Located at $destdir");
+
+ if ( $message eq "ERROR" )
+ {
+ for ( my $j = 0; $j <= $#installer::globals::errorlogfileinfo; $j++ )
+ {
+ my $line = $installer::globals::errorlogfileinfo[$j];
+ $line =~ s/\s*$//g;
+ push(@message, $line);
+ }
+ }
+
+ for ( my $i = 0; $i <= $#message; $i++ ) { $message[$i] = $message[$i] . "\015\012"; }
+
+ my $smtp = Net::SMTP->new( $smtphost, Hello => $account, Debug => 0 );
+
+ # set sender
+ $smtp->mail($sender);
+
+ # listener
+ my @good_addresses = ();
+ $smtp->recipient( @listener, { SkipBad => 1 } );
+
+ # send message
+ $smtp->data(\@message);
+
+ # quit server
+ $smtp->quit();
+}
+
+sub send_fail_mail
+{
+ my ($allsettingsarrayref, $languagestringref, $errordir) = @_;
+
+ # sending a mail into the error board
+ my $listener = "";
+ $listener = installer::ziplist::getinfofromziplist($allsettingsarrayref, "fail");
+
+ if ( $$listener )
+ {
+ my $mailinfo = installer::ziplist::getinfofromziplist($allsettingsarrayref, "mailinfo");
+
+ if ( $$mailinfo ) { send_mail("ERROR", $listener, $mailinfo, $languagestringref, $errordir); }
+ else { installer::exiter::exit_program("ERROR: Could not read mailinfo in list file!", "send_fail_mail"); }
+ }
+}
+
+sub send_success_mail
+{
+ my ($allsettingsarrayref, $languagestringref, $completeshipinstalldir) = @_;
+
+ # sending success mail
+ my $listener = "";
+ $listener = installer::ziplist::getinfofromziplist($allsettingsarrayref, "success");
+
+ if ( $$listener )
+ {
+ my $mailinfo = installer::ziplist::getinfofromziplist($allsettingsarrayref, "mailinfo");
+
+ if ( $$mailinfo ) { send_mail("SUCCESS", $listener, $mailinfo, $languagestringref, $completeshipinstalldir); }
+ else { installer::exiter::exit_program("ERROR: Could not read mailinfo in list file!", "send_success_mail"); }
+
+ }
+}
+
+
+1;
diff --git a/solenv/bin/modules/installer/packagelist.pm b/solenv/bin/modules/installer/packagelist.pm
new file mode 100644
index 000000000000..f2becc19a610
--- /dev/null
+++ b/solenv/bin/modules/installer/packagelist.pm
@@ -0,0 +1,872 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::packagelist;
+
+use installer::converter;
+use installer::exiter;
+use installer::globals;
+use installer::remover;
+use installer::scriptitems;
+
+########################################
+# Check existence of module
+########################################
+
+sub check_module_existence
+{
+ my ($onegid, $moduleslist) = @_;
+
+ my $foundgid = 0;
+
+ for ( my $i = 0; $i <= $#{$moduleslist}; $i++ )
+ {
+ my $gid = ${$moduleslist}[$i]->{'gid'};
+
+ if ( $gid eq $onegid )
+ {
+ $foundgid = 1;
+ last;
+ }
+ }
+
+ return $foundgid;
+}
+
+###################################################
+# Analyzing the gids, defined in the packagelist
+###################################################
+
+sub analyze_list
+{
+ my ($packagelist, $moduleslist) = @_;
+
+ @allpackages = ();
+
+ my $moduleshash = get_module_hash($moduleslist);
+
+ for ( my $i = 0; $i <= $#{$packagelist}; $i++ )
+ {
+ my $onepackage = ${$packagelist}[$i];
+
+ my $onegid = $onepackage->{'module'};
+
+ installer::remover::remove_leading_and_ending_whitespaces(\$onegid);
+
+ my $moduleexists = check_module_existence($onegid, $moduleslist);
+
+ if ( ! $moduleexists ) { next; }
+
+ my @allmodules = ();
+
+ push(@allmodules, $onegid);
+
+ # get_children($moduleslist, $onegid, \@allmodules);
+ get_children_with_hash($moduleshash, $onegid, \@allmodules);
+
+ $onepackage->{'allmodules'} = \@allmodules;
+
+ push(@allpackages, $onepackage);
+ }
+
+ return \@allpackages;
+}
+
+###################################################
+# Creating a hash, that contains the module gids
+# as keys and the parentids as values
+###################################################
+
+sub get_module_hash
+{
+ my ($moduleslist) = @_;
+
+ my %modulehash = ();
+
+ for ( my $i = 0; $i <= $#{$moduleslist}; $i++ )
+ {
+ my $gid = ${$moduleslist}[$i]->{'gid'};
+ # Containing only modules with parent. Root modules can be ignored.
+ if ( ${$moduleslist}[$i]->{'ParentID'} ) { $modulehash{$gid} = ${$moduleslist}[$i]->{'ParentID'}; }
+ }
+
+ return \%modulehash;
+}
+
+########################################################
+# Recursively defined procedure to order
+# modules and directories
+########################################################
+
+sub get_children_with_hash
+{
+ my ($modulehash, $parentgid, $newitemorder) = @_;
+
+ foreach my $gid ( keys %{$modulehash} )
+ {
+ my $parent = $modulehash->{$gid};
+
+ if ( $parent eq $parentgid )
+ {
+ push(@{$newitemorder}, $gid);
+ my $parent = $gid;
+ get_children_with_hash($modulehash, $parent, $newitemorder); # recursive!
+ }
+ }
+}
+
+########################################################
+# Recursively defined procedure to order
+# modules and directories
+########################################################
+
+sub get_children
+{
+ my ($allitems, $startparent, $newitemorder) = @_;
+
+ for ( my $i = 0; $i <= $#{$allitems}; $i++ )
+ {
+ my $gid = ${$allitems}[$i]->{'gid'};
+ my $parent = "";
+ if ( ${$allitems}[$i]->{'ParentID'} ) { $parent = ${$allitems}[$i]->{'ParentID'}; }
+
+ if ( $parent eq $startparent )
+ {
+ push(@{$newitemorder}, $gid);
+ my $parent = $gid;
+ get_children($allitems, $parent, $newitemorder); # recursive!
+ }
+ }
+}
+
+#####################################################################
+# All modules below a defined gid_Module_A are collected now for
+# each modules defined in the packagelist. Now the modules have
+# to be removed, that are part of more than one package.
+#####################################################################
+
+sub remove_multiple_modules_packages
+{
+ my ($allpackagemodules) = @_;
+
+ # iterating over all packages
+
+ for ( my $i = 0; $i <= $#{$allpackagemodules}; $i++ )
+ {
+ my $onepackage = ${$allpackagemodules}[$i];
+ my $allmodules = $onepackage->{'allmodules'};
+
+ # print "Modules below $onepackage->{'module'}: $#{$allmodules}\n";
+
+ # Comparing each package, with all following packages. If a
+ # gid for the module is part of more than one package, it is
+ # removed if the number of modules in the package is greater
+ # in the current package than in the compare package.
+
+ # Taking all modules from package $i
+
+ my $packagecount = $#{$allmodules};
+
+ my @optimizedpackage = ();
+
+ # iterating over all modules of this package
+
+ for ( my $j = 0; $j <= $#{$allmodules}; $j++ )
+ {
+ my $onemodule = ${$allmodules}[$j]; # this is the module, that shall be removed or not
+
+ my $put_module_into_new_package = 1;
+
+ # iterating over all other packages
+
+ for ( my $k = 0; $k <= $#{$allpackagemodules}; $k++ )
+ {
+ if ( $k == $i ) { next; } # not comparing equal module
+
+ if (! $put_module_into_new_package) { next; } # do not compare, if already found
+
+ my $comparepackage = ${$allpackagemodules}[$k];
+ my $allcomparemodules = $comparepackage->{'allmodules'};
+
+ my $comparepackagecount = $#{$allcomparemodules};
+
+ # modules will only be removed from packages, that have more modules
+ # than the compare package
+
+ if ( $packagecount <= $comparepackagecount ) { next; } # nothing to do, take next package
+
+ # iterating over all modules of this package
+
+ for ( my $m = 0; $m <= $#{$allcomparemodules}; $m++ )
+ {
+ my $onecomparemodule = ${$allcomparemodules}[$m];
+
+ if ( $onemodule eq $onecomparemodule ) # this $onemodule has to be removed
+ {
+ $put_module_into_new_package = 0;
+ }
+ }
+ }
+
+ if ( $put_module_into_new_package )
+ {
+ push(@optimizedpackage, $onemodule)
+ }
+ }
+
+ $onepackage->{'allmodules'} = \@optimizedpackage;
+ }
+
+ # for ( my $i = 0; $i <= $#{$allpackagemodules}; $i++ )
+ # {
+ # my $onepackage = ${$allpackagemodules}[$i];
+ # my $allmodules = $onepackage->{'allmodules'};
+ # print "New: Modules below $onepackage->{'module'}: $#{$allmodules}\n";
+ # }
+
+}
+
+#####################################################################
+# Analyzing all files if they belong to a special package.
+# A package is described by a list of modules.
+#####################################################################
+
+sub find_files_for_package
+{
+ my ($filelist, $onepackage) = @_;
+
+ my @newfilelist = ();
+
+ for ( my $i = 0; $i <= $#{$filelist}; $i++ )
+ {
+ my $onefile = ${$filelist}[$i];
+ my $modulesstring = $onefile->{'modules'}; # comma separated modules list
+ my $moduleslist = installer::converter::convert_stringlist_into_array(\$modulesstring, ",");
+
+ my $includefile = 0;
+
+ # iterating over all modules of this file
+
+ for ( my $j = 0; $j <= $#{$moduleslist}; $j++ )
+ {
+ if ( $includefile ) { next; }
+ my $filemodule = ${$moduleslist}[$j];
+ installer::remover::remove_leading_and_ending_whitespaces(\$filemodule);
+
+ # iterating over all modules of the package
+
+ my $packagemodules = $onepackage->{'allmodules'};
+
+ for ( my $k = 0; $k <= $#{$packagemodules}; $k++ )
+ {
+ if ( $includefile ) { next; }
+ my $packagemodule = ${$packagemodules}[$k];
+
+ if ( $filemodule eq $packagemodule )
+ {
+ $includefile = 1;
+ last;
+ }
+ }
+ }
+
+ if ( $includefile )
+ {
+ push(@newfilelist, $onefile);
+ }
+ }
+
+ return \@newfilelist;
+}
+
+#####################################################################
+# Analyzing all links if they belong to a special package.
+# A package is described by a list of modules.
+# A link is inserted into the package, if the corresponding
+# file is also inserted.
+#####################################################################
+
+sub find_links_for_package
+{
+ my ($linklist, $filelist) = @_;
+
+ # First looking for all links with a FileID.
+ # Then looking for all links with a ShortcutID.
+
+ my @newlinklist = ();
+
+ for ( my $i = 0; $i <= $#{$linklist}; $i++ )
+ {
+ my $includelink = 0;
+
+ my $onelink = ${$linklist}[$i];
+
+ my $fileid = "";
+ if ( $onelink->{'FileID'} ) { $fileid = $onelink->{'FileID'}; }
+
+ if ( $fileid eq "" ) { next; } # A link with a ShortcutID
+
+ for ( my $j = 0; $j <= $#{$filelist}; $j++ ) # iterating over file list
+ {
+ my $onefile = ${$filelist}[$j];
+ my $gid = $onefile->{'gid'};
+
+ if ( $gid eq $fileid )
+ {
+ $includelink = 1;
+ last;
+ }
+ }
+
+ if ( $includelink )
+ {
+ push(@newlinklist, $onelink);
+ }
+ }
+
+ # iterating over the new list, because of all links with a ShortcutID
+
+ for ( my $i = 0; $i <= $#{$linklist}; $i++ )
+ {
+ my $includelink = 0;
+
+ my $onelink = ${$linklist}[$i];
+
+ my $shortcutid = "";
+ if ( $onelink->{'ShortcutID'} ) { $shortcutid = $onelink->{'ShortcutID'}; }
+
+ if ( $shortcutid eq "" ) { next; } # A link with a ShortcutID
+
+ for ( my $j = 0; $j <= $#newlinklist; $j++ ) # iterating over newly created link list
+ {
+ my $onefilelink = $newlinklist[$j];
+ my $gid = $onefilelink->{'gid'};
+
+ if ( $gid eq $shortcutid )
+ {
+ $includelink = 1;
+ last;
+ }
+ }
+
+ if ( $includelink )
+ {
+ push(@newlinklist, $onelink);
+ }
+ }
+
+ return \@newlinklist;
+}
+
+#####################################################################
+# Analyzing all directories if they belong to a special package.
+# A package is described by a list of modules.
+# Directories are included into the package, if they are needed
+# by a file or a link included into the package.
+# Attention: A directory with the flag CREATE, is only included
+# into the root module:
+# ($packagename eq $installer::globals::rootmodulegid)
+#####################################################################
+
+sub find_dirs_for_package
+{
+ my ($dirlist, $onepackage) = @_;
+
+ my @newdirlist = ();
+
+ for ( my $i = 0; $i <= $#{$dirlist}; $i++ )
+ {
+ my $onedir = ${$dirlist}[$i];
+ my $modulesstring = $onedir->{'modules'}; # comma separated modules list
+ my $moduleslist = installer::converter::convert_stringlist_into_array(\$modulesstring, ",");
+
+ my $includedir = 0;
+
+ # iterating over all modules of this dir
+
+ for ( my $j = 0; $j <= $#{$moduleslist}; $j++ )
+ {
+ if ( $includedir ) { last; }
+ my $dirmodule = ${$moduleslist}[$j];
+ installer::remover::remove_leading_and_ending_whitespaces(\$dirmodule);
+
+ # iterating over all modules of the package
+
+ my $packagemodules = $onepackage->{'allmodules'};
+
+ for ( my $k = 0; $k <= $#{$packagemodules}; $k++ )
+ {
+ my $packagemodule = ${$packagemodules}[$k];
+
+ if ( $dirmodule eq $packagemodule )
+ {
+ $includedir = 1;
+ last;
+ }
+ }
+ }
+
+ if ( $includedir )
+ {
+ push(@newdirlist, $onedir);
+ }
+ }
+
+ return \@newdirlist;
+}
+
+#####################################################################
+# Resolving all variables in the packagename.
+#####################################################################
+
+sub resolve_packagevariables
+{
+ my ($packagenameref, $variableshashref, $make_lowercase) = @_;
+
+ my $key;
+
+ # Special handling for dictionaries
+ if ( $$packagenameref =~ /-dict-/ )
+ {
+ if (exists($variableshashref->{'DICTIONARYUNIXPRODUCTNAME'}) ) { $$packagenameref =~ s/\%UNIXPRODUCTNAME/$variableshashref->{'DICTIONARYUNIXPRODUCTNAME'}/g; }
+ if (exists($variableshashref->{'DICTIONARYBRANDPACKAGEVERSION'}) ) { $$packagenameref =~ s/\%BRANDPACKAGEVERSION/$variableshashref->{'DICTIONARYBRANDPACKAGEVERSION'}/g; }
+ }
+
+ foreach $key (keys %{$variableshashref})
+ {
+ my $value = $variableshashref->{$key};
+ if ( $make_lowercase ) { $value = lc($value); }
+ $$packagenameref =~ s/\%$key/$value/g;
+ }
+}
+
+#####################################################################
+# Resolving all variables in the packagename.
+#####################################################################
+
+sub resolve_packagevariables2
+{
+ my ($packagenameref, $variableshashref, $make_lowercase, $isdict ) = @_;
+
+ my $key;
+
+ # Special handling for dictionaries
+ if ( $isdict )
+ {
+ if (exists($variableshashref->{'DICTIONARYUNIXPRODUCTNAME'}) ) { $$packagenameref =~ s/\%UNIXPRODUCTNAME/$variableshashref->{'DICTIONARYUNIXPRODUCTNAME'}/g; }
+ if (exists($variableshashref->{'DICTIONARYBRANDPACKAGEVERSION'}) ) { $$packagenameref =~ s/\%BRANDPACKAGEVERSION/$variableshashref->{'DICTIONARYBRANDPACKAGEVERSION'}/g; }
+ }
+
+ foreach $key (keys %{$variableshashref})
+ {
+ my $value = $variableshashref->{$key};
+ if ( $make_lowercase ) { $value = lc($value); }
+ $$packagenameref =~ s/\%$key/$value/g;
+ }
+}
+
+#####################################################################
+# New packages system.
+#####################################################################
+
+##################################################################
+# Controlling the content of the packagelist
+# 1. Items in @installer::globals::packagelistitems must exist
+# 2. If a shellscript file is defined, it must exist
+##################################################################
+
+sub check_packagelist
+{
+ my ($packages) = @_;
+
+ if ( ! ( $#{$packages} > -1 )) { installer::exiter::exit_program("ERROR: No packages defined!", "check_packagelist"); }
+
+ for ( my $i = 0; $i <= $#{$packages}; $i++ )
+ {
+ my $onepackage = ${$packages}[$i];
+
+ my $element;
+
+ # checking all items that must be defined
+
+ foreach $element (@installer::globals::packagelistitems)
+ {
+ if ( ! exists($onepackage->{$element}) )
+ {
+ installer::exiter::exit_program("ERROR in package list: No value for $element !", "check_packagelist");
+ }
+ }
+
+ # checking the existence of the script file, if defined
+
+ if ( $onepackage->{'script'} )
+ {
+ my $scriptfile = $onepackage->{'script'};
+ my $gid = $onepackage->{'module'};
+ my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$scriptfile, "" , 0);
+
+ if ( $$fileref eq "" ) { installer::exiter::exit_program("ERROR: Could not find script file $scriptfile for module $gid!", "check_packagelist"); }
+
+ my $infoline = "$gid: Using script file: \"$$fileref\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ $onepackage->{'script'} = $$fileref;
+ }
+ }
+}
+
+#####################################################################
+# Reading pack info for one module from packinfo file.
+#####################################################################
+
+sub get_packinfo
+{
+ my ($gid, $filename, $packages, $onelanguage, $islanguagemodule) = @_;
+
+ my $packagelist = installer::files::read_file($filename);
+
+ my @allpackages = ();
+
+ for ( my $i = 0; $i <= $#{$packagelist}; $i++ )
+ {
+ my $line = ${$packagelist}[$i];
+
+ if ( $line =~ /^\s*\#/ ) { next; } # this is a comment line
+
+ if ( $line =~ /^\s*Start\s*$/i ) # a new package definition
+ {
+ my %onepackage = ();
+
+ my $counter = $i + 1;
+
+ while (!( ${$packagelist}[$counter] =~ /^\s*End\s*$/i ))
+ {
+ if ( ${$packagelist}[$counter] =~ /^\s*(\S+)\s*\=\s*\"(.*)\"/ )
+ {
+ my $key = $1;
+ my $value = $2;
+ $onepackage{$key} = $value;
+ }
+
+ $counter++;
+ }
+
+ $onepackage{'islanguagemodule'} = $islanguagemodule;
+ if ( $islanguagemodule )
+ {
+ $saveonelanguage = $onelanguage;
+ $saveonelanguage =~ s/_/-/g;
+ $onepackage{'language'} = $saveonelanguage;
+ }
+
+ push(@allpackages, \%onepackage);
+ }
+ }
+
+ # looking for the packinfo with the correct gid
+
+ my $foundgid = 0;
+ my $onepackage;
+ foreach $onepackage (@allpackages)
+ {
+ # Adding the language to the module gid for LanguagePacks !
+ # Making the module gid language specific: gid_Module_Root -> gir_Module_Root_pt_BR (as defined in scp2)
+ if ( $onelanguage ne "" ) { $onepackage->{'module'} = $onepackage->{'module'} . "_$onelanguage"; }
+
+ if ( $onepackage->{'module'} eq $gid )
+ {
+ # Resolving the language identifier
+ my $onekey;
+ foreach $onekey ( keys %{$onepackage} )
+ {
+ # Some keys require "-" instead of "_" for example in "en-US". All package names do not use underlines.
+ my $locallang = $onelanguage;
+ if (( $onekey eq "solarispackagename" ) ||
+ ( $onekey eq "solarisrequires" ) ||
+ ( $onekey eq "packagename" ) ||
+ ( $onekey eq "requires" )) { $locallang =~ s/_/-/g; } # avoiding illegal package abbreviation
+ $onepackage->{$onekey} =~ s/\%LANGUAGESTRING/$locallang/g;
+ }
+
+ # Saving the language for the package
+ my $lang = $onelanguage;
+ $lang =~ s/_/-/g;
+ $onepackage->{'specificlanguage'} = $lang;
+
+ push(@{$packages}, $onepackage);
+ $foundgid = 1;
+ last;
+ }
+ }
+
+ if ( ! $foundgid )
+ {
+ installer::exiter::exit_program("ERROR: Could not find package info for module $gid in file \"$filename\"!", "get_packinfo");
+ }
+}
+
+#####################################################################
+# Collecting all packages from scp project.
+#####################################################################
+
+sub collectpackages
+{
+ my ( $allmodules, $languagesarrayref ) = @_;
+
+ installer::logger::include_header_into_logfile("Collecting packages:");
+
+ my @packages = ();
+ my %gid_analyzed = ();
+
+ my $onemodule;
+ foreach $onemodule ( @{$allmodules} )
+ {
+ my $packageinfo = "PackageInfo";
+ if (( $installer::globals::tab ) && ( $onemodule->{"TabPackageInfo"} )) { $packageinfo = "TabPackageInfo" }
+
+ if ( $onemodule->{$packageinfo} ) # this is a package module!
+ {
+ my $modulegid = $onemodule->{'gid'};
+
+ # Only collecting modules with correct language for language packs
+# if ( $installer::globals::languagepack ) { if ( ! ( $modulegid =~ /_$onelanguage\s*$/ )) { next; } }
+ # Resetting language, if this is no language pack
+# if ( ! $installer::globals::languagepack ) { $onelanguage = ""; }
+
+ my $styles = "";
+ if ( $onemodule->{'Styles'} ) { $styles = $onemodule->{'Styles'}; }
+
+ # checking modules with style LANGUAGEMODULE
+ my $islanguagemodule = 0;
+ my $onelanguage = "";
+ if ( $styles =~ /\bLANGUAGEMODULE\b/ )
+ {
+ $islanguagemodule = 1;
+ $onelanguage = $onemodule->{'Language'}; # already checked, that it is set.
+ $onelanguage =~ s/-/_/g; # pt-BR -> pt_BR in scp
+ }
+
+ # Modules in different languages are listed more than once in multilingual installation sets
+ if ( exists($gid_analyzed{$modulegid}) ) { next; }
+ $gid_analyzed{$modulegid} = 1;
+
+ my $packinfofile = $onemodule->{$packageinfo};
+
+ # The file with package information has to be found in path list
+ my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$packinfofile, "" , 0);
+
+ if ( $$fileref eq "" ) { installer::exiter::exit_program("ERROR: Could not find file $packinfofile for module $modulegid!", "collectpackages"); }
+
+ my $infoline = "$modulegid: Using packinfo: \"$$fileref\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ get_packinfo($modulegid, $$fileref, \@packages, $onelanguage, $islanguagemodule);
+ }
+ }
+
+ return \@packages;
+}
+
+#####################################################################
+# Printing packages content for debugging purposes
+#####################################################################
+
+sub log_packages_content
+{
+ my ($packages) = @_;
+
+ if ( ! ( $#{$packages} > -1 )) { installer::exiter::exit_program("ERROR: No packages defined!", "print_content"); }
+
+ installer::logger::include_header_into_logfile("Logging packages content:");
+
+ my $infoline = "";
+
+ for ( my $i = 0; $i <= $#{$packages}; $i++ )
+ {
+ my $onepackage = ${$packages}[$i];
+
+ # checking all items that must be defined
+
+ $infoline = "Package $onepackage->{'module'}\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ my $key;
+ foreach $key (sort keys %{$onepackage})
+ {
+ if ( $key =~ /^\s*\;/ ) { next; }
+
+ if ( $key eq "allmodules" )
+ {
+ $infoline = "\t$key:\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ my $onemodule;
+ foreach $onemodule ( @{$onepackage->{$key}} )
+ {
+ $infoline = "\t\t$onemodule\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+ else
+ {
+ $infoline = "\t$key: $onepackage->{$key}\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ }
+}
+
+#####################################################################
+# Creating assignments from modules to destination pathes.
+# This is required for logging in fileinfo file. Otherwise
+# the complete destination file would not be known in file list.
+# Saved in %installer::globals::moduledestination
+#####################################################################
+
+sub create_module_destination_hash
+{
+ my ($packages, $allvariables) = @_;
+
+ for ( my $i = 0; $i <= $#{$packages}; $i++ )
+ {
+ my $onepackage = ${$packages}[$i];
+
+ my $defaultdestination = $onepackage->{'destpath'};
+ resolve_packagevariables(\$defaultdestination, $allvariables, 1);
+ if ( $^O =~ /darwin/i ) { $defaultdestination =~ s/\/opt\//\/Applications\//; }
+
+ foreach my $onemodule ( @{$onepackage->{'allmodules'}} )
+ {
+ $installer::globals::moduledestination{$onemodule} = $defaultdestination;
+ }
+ }
+}
+
+#####################################################################
+# Adding the default pathes into the files collector for Unixes.
+# This is necessary to know the complete destination path in
+# fileinfo log file.
+#####################################################################
+
+sub add_defaultpathes_into_filescollector
+{
+ my ($allfiles) = @_;
+
+ for ( my $i = 0; $i <= $#{$allfiles}; $i++ )
+ {
+ my $onefile = ${$allfiles}[$i];
+
+ if ( ! $onefile->{'destination'} ) { installer::exiter::exit_program("ERROR: No destination found at file $onefile->{'gid'}!", "add_defaultpathes_into_filescollector"); }
+ my $destination = $onefile->{'destination'};
+
+ if ( ! $onefile->{'modules'} ) { installer::exiter::exit_program("ERROR: No modules found at file $onefile->{'gid'}!", "add_defaultpathes_into_filescollector"); }
+ my $module = $onefile->{'modules'};
+ # If modules contains a list of modules, only taking the first one.
+ if ( $module =~ /^\s*(.*?)\,/ ) { $module = $1; }
+
+ if ( ! exists($installer::globals::moduledestination{$module}) ) { installer::exiter::exit_program("ERROR: No default destination path found for module $module!", "add_defaultpathes_into_filescollector"); }
+ my $defaultpath = $installer::globals::moduledestination{$module};
+ $defaultpath =~ s/\/\s*$//; # removing ending slashes
+ my $fulldestpath = $defaultpath . $installer::globals::separator . $destination;
+
+ $onefile->{'fulldestpath'} = $fulldestpath;
+ }
+}
+
+#####################################################################
+# Creating list of cabinet files from packages
+#####################################################################
+
+sub prepare_cabinet_files
+{
+ my ($packages, $allvariables) = @_;
+
+ if ( ! ( $#{$packages} > -1 )) { installer::exiter::exit_program("ERROR: No packages defined!", "print_content"); }
+
+ installer::logger::include_header_into_logfile("Preparing cabinet files:");
+
+ my $infoline = "";
+
+ for ( my $i = 0; $i <= $#{$packages}; $i++ )
+ {
+ my $onepackage = ${$packages}[$i];
+
+ my $cabinetfile = "$onepackage->{'packagename'}\.cab";
+
+ resolve_packagevariables(\$cabinetfile, $allvariables, 0);
+
+ $installer::globals::allcabinets{$cabinetfile} = 1;
+
+ # checking all items that must be defined
+
+ $infoline = "Package $onepackage->{'module'}\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ # Assigning the cab file to the module and also to all corresponding sub modules
+
+ my $onemodule;
+ foreach $onemodule ( @{$onepackage->{'allmodules'}} )
+ {
+ if ( ! exists($installer::globals::allcabinetassigns{$onemodule}) )
+ {
+ $installer::globals::allcabinetassigns{$onemodule} = $cabinetfile;
+ }
+ else
+ {
+ my $infoline = "Warning: Already existing assignment: $onemodule : $installer::globals::allcabinetassigns{$onemodule}\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Ignoring further assignment: $onemodule : $cabinetfile\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+}
+
+#####################################################################
+# Logging assignments of cabinet files
+#####################################################################
+
+sub log_cabinet_assignments
+{
+ installer::logger::include_header_into_logfile("Logging cabinet files:");
+
+ my $infoline = "List of cabinet files:\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ my $key;
+ foreach $key ( sort keys %installer::globals::allcabinets ) { push(@installer::globals::logfileinfo, "\t$key\n"); }
+
+ $infoline = "\nList of assignments from modules to cabinet files:\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ foreach $key ( sort keys %installer::globals::allcabinetassigns ) { push(@installer::globals::logfileinfo, "\t$key : $installer::globals::allcabinetassigns{$key}\n"); }
+}
+
+1;
diff --git a/solenv/bin/modules/installer/packagepool.pm b/solenv/bin/modules/installer/packagepool.pm
new file mode 100644
index 000000000000..d4032b7db17e
--- /dev/null
+++ b/solenv/bin/modules/installer/packagepool.pm
@@ -0,0 +1,1048 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::packagepool;
+
+use Digest::MD5;
+use installer::exiter;
+use installer::globals;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::worker;
+
+######################################################
+# Checking the md5sum of a file
+######################################################
+
+sub get_md5sum
+{
+ my ($filename) = @_;
+
+ open(FILE, "<$filename") or die "ERROR: Can't open $filename for creating file hash";
+ binmode(FILE);
+ my $digest = Digest::MD5->new->addfile(*FILE)->hexdigest;
+ close(FILE);
+
+ return $digest;
+}
+
+####################################################
+# Setting a unique sessionid to identify this
+# packaging process.
+####################################################
+
+sub set_sessionid
+{
+ my $pid = $$; # process id
+ my $timer = time(); # time
+ $installer::globals::sessionid = $pid . $timer;
+ $installer::globals::sessionidset = 1;
+ my $infoline = "\nPool: Setting session id: $installer::globals::sessionid.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+####################################################
+# Setting and creating pool path.
+####################################################
+
+sub set_pool_path
+{
+ $installer::globals::unpackpath =~ s/\Q$installer::globals::separator\E\s*$//; # removing ending slashes and backslashes
+ $installer::globals::poolpath = $installer::globals::unpackpath . $installer::globals::separator . "pool_" . $installer::globals::packageformat;
+ installer::systemactions::create_directory($installer::globals::poolpath);
+ $installer::globals::poolpathset = 1;
+}
+
+####################################################
+# Comparing the content of two epm files.
+####################################################
+
+sub compare_epm_content
+{
+ my ($oldcontent, $newcontent) = @_;
+
+ my $identical = 1;
+ my $diffinfo = "";
+
+ # Removing empty lines and files from $newcontent
+
+ my @newlocalcontent = ();
+ for ( my $i = 0; $i <= $#{$newcontent}; $i++ )
+ {
+ if ( ${$newcontent}[$i] =~ /^\s*$/ ) { next; } # Removing empty lines from $newcontent. Empty lines are also not included into pcf file, from where $oldcontent was read.
+ if ( ${$newcontent}[$i] =~ /^\s*f\s+/ ) { next; } # Ignoring files, they can contain temporary pathes
+ if (( ${$newcontent}[$i] =~ /^\s*%readme\s+/ ) || ( ${$newcontent}[$i] =~ /^\s*%license\s+/ )) { next; } # ignoring license and readme (language specific!)
+ my $oneline = ${$newcontent}[$i];
+ $oneline =~ s/\s*$//; # Removing line ends. Also not included in old epm file, that is read from pcf file.
+ push(@newlocalcontent, $oneline);
+ }
+
+ my $oldmember = $#{$oldcontent} + 1;
+ my $newmember = $#newlocalcontent + 1;
+
+ # comparing the count
+ if ( $oldmember != $newmember )
+ {
+ $identical = 0;
+ installer::logger::print_message("\n...... changed length of EPM file\n");
+ $diffinfo = "Pool: EPM, different line count: old epm file: $oldmember, new epm file: $newmember\n";
+ push(@installer::globals::epmdifflist, $diffinfo);
+ }
+
+ # comparing the content line for line, so the order must not change
+
+ if ( $identical )
+ {
+ for ( my $i = 0; $i <= $#{$oldcontent}; $i++ )
+ {
+ if ( ${$oldcontent}[$i] ne $newlocalcontent[$i] )
+ {
+ $identical = 0;
+ my $line = $i + 1;
+ installer::logger::print_message("\n...... different content in EPM file\n");
+ $diffinfo = "Pool: EPM, line $line changed from \"${$oldcontent}[$i]\" to \"$newlocalcontent[$i]\".\n";
+ push(@installer::globals::epmdifflist, $diffinfo);
+ last;
+ }
+ }
+ }
+
+ return $identical;
+}
+
+####################################################
+# Comparing the content of two pcf files.
+####################################################
+
+sub compare_package_content
+{
+ my ($oldcontent, $newcontent) = @_;
+
+ my $identical = 1;
+ my $infoline = "";
+
+ my $oldmember = scalar keys %{$oldcontent};
+ my $newmember = scalar keys %{$newcontent};
+
+ # comparing the count
+
+ if ( $oldmember != $newmember )
+ {
+ # Logging the difference
+ $identical = 0;
+ installer::logger::print_message("\n...... different number of files in packages. New number: $newmember, old number: $oldmember\n");
+ $infoline = "Different number of files in packages. New number: $newmember, old number: $oldmember\n";
+ push(@installer::globals::pcfdiffcomment, $infoline);
+ }
+
+ # comparing the keys
+
+ if ( $identical )
+ {
+ my $first = 1;
+ my $start = "\n";
+ foreach my $dest ( keys %{$newcontent} )
+ {
+ if ( ! exists($oldcontent->{$dest}) )
+ {
+ $identical = 0;
+ installer::logger::print_message("$start...... file only in one package (A): $dest\n");
+ $infoline = "File only in existing pool package: $dest\n";
+ push(@installer::globals::pcfdiffcomment, $infoline);
+ if ( $first ) { $start = ""; }
+ $first = 0;
+ }
+ }
+
+ # collecting all differences
+ if ( ! $identical )
+ {
+ foreach my $dest ( keys %{$oldcontent} )
+ {
+ if ( ! exists($newcontent->{$dest}) )
+ {
+ $identical = 0;
+ installer::logger::print_message("$start...... file only in one package (B): $dest\n");
+ $infoline = "File only in new package: $dest\n";
+ push(@installer::globals::pcfdiffcomment, $infoline);
+ if ( $first ) { $start = ""; }
+ $first = 0;
+ }
+ }
+ }
+ }
+
+ # comparing the checksum
+
+ if ( $identical )
+ {
+ my $first = 1;
+
+ foreach my $dest ( keys %{$newcontent} )
+ {
+ if ( $newcontent->{$dest}->{'md5sum'} ne $oldcontent->{$dest}->{'md5sum'} )
+ {
+ $identical = 0;
+ if ( $first == 1 )
+ {
+ installer::logger::print_message("\n");
+ $first = 0;
+ }
+ $installer::globals::pcfdifflist{$dest} = 1;
+ installer::logger::print_message("...... different file: $dest\n");
+ # last;
+ }
+
+ if ( $installer::globals::iswindowsbuild )
+ {
+ if ( $newcontent->{$dest}->{'uniquename'} ne $oldcontent->{$dest}->{'uniquename'} )
+ {
+ $identical = 0;
+ $installer::globals::pcfdifflist{$dest} = 1;
+ installer::logger::print_message("\n...... different file: $dest");
+ # last;
+ }
+ }
+ }
+ }
+
+ return $identical;
+}
+
+####################################################
+# Calculating content of pcf file.
+####################################################
+
+sub calculate_current_content
+{
+ my ($filesarray, $packagename) = @_;
+
+ installer::logger::include_timestamp_into_logfile("\nCalculating content for package content file ($packagename), start");
+
+ my %globalcontent = ();
+
+ for ( my $i = 0; $i <= $#{$filesarray}; $i++ )
+ {
+ my %onefilehash = ();
+
+ my $onefile = ${$filesarray}[$i];
+ if ( ! $onefile->{'sourcepath'} ) { installer::exiter::exit_program("ERROR: No sourcepath found for file $onefile->{'gid'}", "calculate_current_content"); }
+ my $source = $onefile->{'sourcepath'};
+ if ( $onefile->{'zipfilesource'} ) { $source = $onefile->{'zipfilesource'}; }
+ if ( ! -f $source ) { installer::exiter::exit_program("ERROR: Sourcefile not found: $source ($onefile->{'gid'})", "calculate_current_content"); }
+
+ # For Windows the unique name inside the cabinet file also has to be saved
+ my $uniquename = "";
+ if ( $installer::globals::iswindowsbuild ) { $uniquename = $onefile->{'uniquename'};}
+
+ my $destination = $onefile->{'destination'};
+ my $checksum = get_md5sum($source);
+
+ $onefilehash{'md5sum'} = $checksum;
+ $onefilehash{'uniquename'} = $uniquename;
+
+ if ( exists($globalcontent{$destination}) ) { installer::exiter::exit_program("ERROR: Destination not unique: $destination ($onefile->{'gid'})", "calculate_current_content"); }
+ $globalcontent{$destination} = \%onefilehash;
+ }
+
+ installer::logger::include_timestamp_into_logfile("\nCalculating content for package content file ($packagename), start");
+
+ return \%globalcontent;
+}
+
+####################################################
+# Writing pcf file.
+####################################################
+
+sub create_pcfcontent_file
+{
+ my ($realpackagename, $md5sum, $filesize, $fullpackagename, $pkgversion, $epmfilecontent, $pcffilename) = @_;
+
+ my @content = ();
+ my $oneline = "PackageName: $realpackagename\n";
+ push(@content, $oneline);
+
+ $oneline = "md5sum: $md5sum\n";
+ push(@content, $oneline);
+
+ $oneline = "FileSize: $filesize\n";
+ push(@content, $oneline);
+
+ $oneline = "FullPackageName: $fullpackagename\n";
+ push(@content, $oneline);
+
+ $oneline = "PkgVersion: $pkgversion\n";
+ push(@content, $oneline);
+
+ foreach my $dest (keys %{$installer::globals::newpcfcontent} )
+ {
+ $oneline = "Files:\t$dest\t$installer::globals::newpcfcontent->{$dest}->{'md5sum'}\t$installer::globals::newpcfcontent->{$dest}->{'uniquename'}\n";
+ push(@content, $oneline);
+ }
+
+ for ( my $i = 0; $i <= $#{$epmfilecontent}; $i++ )
+ {
+ if ( ${$epmfilecontent}[$i] =~ /^\s*$/ ) { next; } # avoiding empty lines
+ if ( ${$epmfilecontent}[$i] =~ /^\s*f\s+/ ) { next; } # ignoring files, because they can contain temporary pathes
+ if (( ${$epmfilecontent}[$i] =~ /^\s*%readme\s+/ ) || ( ${$epmfilecontent}[$i] =~ /^\s*%license\s+/ )) { next; } # ignoring license and readme (language specific!)
+ $oneline = "EPM:\t${$epmfilecontent}[$i]";
+ push(@content, $oneline);
+ }
+
+ installer::files::save_file($pcffilename, \@content);
+}
+
+#######################################################
+# Reading the content of the package content file.
+#######################################################
+
+sub read_pcf_content
+{
+ my ($pcffilename) = @_;
+
+ my %allcontent = ();
+ my @epmfile = ();
+ my $realpackagename = "";
+
+ my $content = installer::files::read_file($pcffilename);
+
+ for ( my $i = 0; $i <= $#{$content}; $i++ )
+ {
+ my $line = ${$content}[$i];
+
+ if ( $line =~ /^\s*PackageName\:\s*(.*?)\s*$/ )
+ {
+ $realpackagename = $1;
+ $installer::globals::xpdpackageinfo{'RealPackageName'} = $realpackagename;
+ next;
+ }
+
+ if ( $line =~ /^\s*FullPackageName\:\s*(.*?)\s*$/ )
+ {
+ $installer::globals::xpdpackageinfo{'FullPackageName'} = $1;
+ next;
+ }
+
+ if ( $line =~ /^\s*FileSize\:\s*(.*?)\s*$/ )
+ {
+ $installer::globals::xpdpackageinfo{'FileSize'} = $1;
+ next;
+ }
+
+ if ( $line =~ /^\s*PkgVersion\:\s*(.*?)\s*$/ )
+ {
+ $installer::globals::xpdpackageinfo{'PkgVersion'} = $1;
+ next;
+ }
+
+ if ( $line =~ /^\s*md5sum\:\s*(.*?)\s*$/ )
+ {
+ $installer::globals::xpdpackageinfo{'md5sum'} = $1;
+ next;
+ }
+
+ if ( $line =~ /^\s*Files:\t(.+?)\t(.+?)\t(.*?)\s*$/ )
+ {
+ my $destination = $1;
+ my $checksum = $2;
+ my $uniquename = $3;
+
+ my %onefilehash = ();
+ $onefilehash{'md5sum'} = $checksum;
+ $onefilehash{'uniquename'} = $uniquename;
+
+ $allcontent{$destination} = \%onefilehash;
+ next;
+ }
+
+ if ( $line =~ /^\s*EPM:\t(.*?)\s*$/ ) # A line can be empty in epm file
+ {
+ my $epmcontent = $1;
+ push(@epmfile, $epmcontent);
+ next;
+ }
+ }
+
+ if ( $realpackagename eq "" ) { installer::exiter::exit_program("ERROR: Real package name not found in pcf file: \"$pcffilename\"", "read_pcf_content"); }
+
+ return ($realpackagename, \%allcontent, \@epmfile);
+}
+
+####################################################
+# Checking, if a specific package can be
+# created at the moment.
+####################################################
+
+sub check_package_availability
+{
+ my ($packagename) = @_;
+
+ my $package_is_available = 1;
+
+ my $checkfilename = $installer::globals::poolpath . $installer::globals::separator . $packagename . ".pcf.check";
+ my $lockfilename = $installer::globals::poolpath . $installer::globals::separator . $packagename . ".pcf.lock";
+
+ if (( -f $checkfilename ) || ( -f $lockfilename )) { $package_is_available = 0; }
+
+ return $package_is_available;
+}
+
+####################################################
+# Check, if the existence of the check or lock
+# file requires an exit of packaging process.
+####################################################
+
+sub check_pool_exit
+{
+ my ( $lockfilename, $timecounter ) = @_;
+
+ # How old is this lock file?
+ my $timeage = installer::logger::get_file_age($lockfilename);
+
+ # if ( $timeage > 1800 ) # file is older than half an hour
+ if ( $timeage > 3600 ) # file is older than an hour
+ {
+ my $timestring = installer::logger::convert_timestring($timeage);
+ my $infoline = "\nPool: Attention: \"$lockfilename\" is too old ($timestring). Removing file!\n";
+ installer::logger::print_message( "... $infoline" );
+ push( @installer::globals::logfileinfo, $infoline);
+ unlink $lockfilename;
+ # installer::exiter::exit_program("ERROR: Waiting too long for removal of lock file \"$lockfilename\"", "check_pool_exit (packagepool)");
+ }
+ else
+ {
+ my $filecontent = installer::files::read_file($lockfilename);
+ my $waittime = $timecounter * 10;
+ $waittime = installer::logger::convert_timestring($waittime);
+ my $infoline = "\nPool: Warning: \"$lockfilename\" blocks this process for $waittime. Lock content: \"${$filecontent}[0]\"\n";
+ installer::logger::print_message( "... $infoline" );
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+############################################################################
+# This function logs some information, that can be used to find
+# pool problems.
+############################################################################
+
+sub log_pool_info
+{
+ my ( $file_exists ) = @_;
+
+ my $infoline = "";
+
+ # Content saved in
+ # $installer::globals::savelockfilecontent = installer::files::read_file($filename);
+ # $installer::globals::savelockfilename = $filename;
+
+ if ( $file_exists )
+ {
+ $infoline = "\nPool Problem: Lock file \"$installer::globals::savelockfilename\" belongs to another process. This process has session id: $installer::globals::sessionid .\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "Content of Lock file:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ foreach my $line ( @{$installer::globals::savelockfilecontent} ) { push( @installer::globals::logfileinfo, $line); }
+ }
+ else
+ {
+ $infoline = "\nPool Problem: Lock file \"$installer::globals::savelockfilename\" does not exist anymore (this process has session id: $installer::globals::sessionid) .\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+############################################################################
+# Checking, if this process is the owner of the lock file in the pool.
+# This can be determined by the Process ID, that is written at the
+# beginning of the first line into the lock file.
+############################################################################
+
+sub process_is_owner
+{
+ my ( $filename ) = @_;
+
+ my $process_is_owner = 0;
+
+ $installer::globals::savelockfilecontent = installer::files::read_file($filename);
+ $installer::globals::savelockfilename = $filename;
+
+ if ( ${$installer::globals::savelockfilecontent}[0] =~ /^\s*\Q$installer::globals::sessionid\E\s+/ ) { $process_is_owner = 1; }
+
+ return $process_is_owner;
+}
+
+####################################################
+# Removing a package from installation set, if
+# there were pooling problems.
+####################################################
+
+sub remove_package_from_installset
+{
+ my ($newpackagepath) = @_;
+
+ my $infoline = "Pool problem: Removing package \"$newpackagepath\" from installation set!\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ if ( -f $newpackagepath ) { unlink $newpackagepath; }
+ if ( -d $newpackagepath ) { installer::systemactions::remove_complete_directory($newpackagepath, 1); }
+
+ # Keeping the content of @installer::globals::installsetcontent up to date. Removing the last package.
+ pop(@installer::globals::installsetcontent);
+}
+
+####################################################
+# Check, if the package is in the pool and if
+# there are no changes in the package.
+####################################################
+
+sub package_is_up_to_date
+{
+ my ($allvariables, $onepackage, $packagename, $newepmcontent, $filesinpackage, $installdir, $subdir, $languagestringref) = @_;
+
+ installer::logger::print_message_without_newline( "... checking pool package $packagename ..." );
+
+ installer::logger::include_header_into_logfile("Checking package in pool: $packagename");
+
+ if ( ! $installer::globals::poolpathset ) { installer::packagepool::set_pool_path(); }
+ if ( ! $installer::globals::sessionidset ) { installer::packagepool::set_sessionid(); }
+
+ my $infoline = "";
+ # Resetting some variables for this package
+ my $package_is_up_to_date = 0;
+ my $realpackagename = "";
+ my $oldepmcontent = "";
+ my $waited_for_check = 0;
+ my $waited_for_lock = 0;
+ $installer::globals::newpcfcontentcalculated = 0;
+ %installer::globals::pcfdifflist = ();
+ @installer::globals::pcfdiffcomment = ();
+ @installer::globals::epmdifflist = ();
+
+ # Reading the package content file, if this file exists (extension *.pcf)
+ my $filename = $installer::globals::poolpath . $installer::globals::separator . $packagename . ".pcf";
+ my $checkfilename = $installer::globals::poolpath . $installer::globals::separator . $packagename . ".pcf.check";
+ my $lockfilename = $installer::globals::poolpath . $installer::globals::separator . $packagename . ".pcf.lock";
+ # Saving name in global variable, so that this file can be removed somewhere else (at the end of "put_content_into_pool").
+ $installer::globals::poolcheckfilename = $checkfilename;
+ $installer::globals::poollockfilename = $lockfilename;
+
+ my @checkfilecontent = ("$installer::globals::sessionid $installer::globals::product $$languagestringref $checkfilename"); # $$ is the process id
+ my @lockfilecontent = ("$installer::globals::sessionid $installer::globals::product $$languagestringref $lockfilename"); # $$ is the process id
+
+ # Waiting, step 1
+ # Checking, if another process checks this package at the moment
+ my $timecounter = 0;
+ while ( -f $checkfilename )
+ {
+ $timecounter++;
+
+ # including an exit to enable creation of other packages
+ if (( $timecounter == 1 ) && ( ! exists($installer::globals::poolshiftedpackages{$packagename}) ))
+ {
+ $package_is_up_to_date = 3; # repeat this package later
+ return $package_is_up_to_date;
+ }
+
+ $infoline = "Pool: $checkfilename exists. WAITING 10 seconds ($timecounter).\n";
+ if ( $timecounter == 1 ) { installer::logger::print_message( "\n" ); }
+ installer::logger::print_message( "... $infoline" );
+ push( @installer::globals::logfileinfo, $infoline);
+ # if ( $timecounter % 50 == 0 ) { check_pool_exit($checkfilename, $timecounter); }
+ if ( $timecounter % 100 == 0 ) { check_pool_exit($checkfilename, $timecounter); }
+ sleep 10; # process sleeps 10 seconds
+ $waited_for_check = 1;
+ }
+
+ # Creating file, showing that this package is checked at the moment by this process. No other process can reach this.
+ installer::files::save_file($checkfilename, \@checkfilecontent); # Creating the Lock, to check this package. This blocks all other processes.
+ $installer::globals::processhaspoolcheckfile = 1;
+
+ # Check, if the Lock file creation was really successful
+ if ( ! -f $checkfilename )
+ {
+ $infoline = "Pool problem: Pool lock file \"$checkfilename\" could not be created successfully or was removed by another process (A)!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ log_pool_info(0);
+ $package_is_up_to_date = 4; # repeat this package
+ return $package_is_up_to_date;
+ }
+
+ if ( ! process_is_owner($checkfilename) )
+ {
+ $infoline = "Pool problem: Pool lock file \"$checkfilename\" belongs to another process (A)!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ log_pool_info(1);
+ $package_is_up_to_date = 4; # repeat this package
+ return $package_is_up_to_date;
+ }
+
+ $infoline = "Pool: Created file: $checkfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ if ( $waited_for_check ) { installer::logger::print_message( "... $infoline" ); }
+
+ # Waiting, step 2
+ # Checking, if another process creates this package at the moment
+ $timecounter = 0;
+ while ( -f $lockfilename )
+ {
+ $timecounter++;
+ $infoline = "Pool: $lockfilename exists. WAITING 10 seconds ($timecounter).\n";
+ if ( $timecounter == 1 ) { installer::logger::print_message( "\n" ); }
+ installer::logger::print_message( "... $infoline" );
+ push( @installer::globals::logfileinfo, $infoline);
+ # if ( $timecounter % 50 == 0 ) { check_pool_exit($lockfilename, $timecounter); }
+ if ( $timecounter % 100 == 0 ) { check_pool_exit($lockfilename, $timecounter); }
+ sleep 10; # process sleeps 10 seconds
+ $waited_for_lock = 1;
+ }
+
+ # No lock file exists, therefore no process creates this package at the moment. Check can be done now.
+ if ( $waited_for_lock ) { installer::logger::print_message( "... Pool: Proceeding, $lockfilename was removed.\n" ); }
+
+ my $package_already_exists = 0;
+
+ if ( -f $filename )
+ {
+ # Calculating content for pcf file
+ $installer::globals::newpcfcontent = calculate_current_content($filesinpackage, $packagename);
+ $installer::globals::newpcfcontentcalculated = 1;
+
+ # reading the existing pcf file
+ ($realpackagename, $oldpcfcontent, $oldepmcontent) = read_pcf_content($filename);
+
+ # First check: Package has to exist in pool (directories on Solaris)
+ my $fullpackage = $installer::globals::poolpath . $installer::globals::separator . $realpackagename;
+ if ( $installer::globals::issolarisbuild ) { $fullpackage = $fullpackage . ".tar"; }
+ if ( -f $fullpackage )
+ {
+ $package_already_exists = 1;
+ # Second check: Only files
+ my $content_is_identical = compare_package_content($oldpcfcontent, $installer::globals::newpcfcontent);
+
+ # Third check for Unix: Changes in the epm file?
+ if (( $content_is_identical ) && ( ! $installer::globals::iswindowsbuild ))
+ {
+ $content_is_identical = compare_epm_content($oldepmcontent, $newepmcontent);
+ }
+
+ if ( $content_is_identical ) { $package_is_up_to_date = 1; }
+ }
+ }
+
+ if ( $package_is_up_to_date )
+ {
+ $infoline = "Pool: $packagename: No new content, using existing package\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::logger::print_message( "... using package from pool\n" );
+ }
+ else
+ {
+ if ( $package_already_exists )
+ {
+ $infoline = "Pool: $packagename: Contains new content, creating new package. Differences:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ foreach my $dest ( sort keys %installer::globals::pcfdifflist ) { push( @installer::globals::logfileinfo, "$dest\n"); }
+ foreach my $dest ( @installer::globals::pcfdiffcomment ) { push( @installer::globals::logfileinfo, "$dest"); }
+ foreach my $dest ( @installer::globals::epmdifflist ) { push( @installer::globals::logfileinfo, "$dest"); }
+ }
+ else
+ {
+ $infoline = "Pool: $packagename: Does not exist in pool.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ installer::logger::print_message( "... packaging required\n" );
+ %installer::globals::xpdpackageinfo = (); # reset the filled hash, because the package cannot be used.
+
+ # Creating lock mechanism, so that other processes do not create this package, too.
+ installer::files::save_file($lockfilename, \@lockfilecontent); # Creating the Lock, to create this package (Lock for check still exists).
+ $installer::globals::processhaspoollockfile = 1;
+
+ # Check if creation of Lock file was really successful
+
+ if ( ! -f $lockfilename )
+ {
+ $infoline = "Pool problem: Pool lock file \"$lockfilename\" could not be created successfully or was removed by another process (D)!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ log_pool_info(0);
+ $package_is_up_to_date = 4; # repeat this package
+ return $package_is_up_to_date;
+ }
+
+ if ( ! process_is_owner($lockfilename) )
+ {
+ $infoline = "Pool problem: Pool lock file \"$lockfilename\" belongs to another process (D)!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ log_pool_info(1);
+ $package_is_up_to_date = 4; # repeat this package
+ return $package_is_up_to_date;
+ }
+
+ $infoline = "Pool: Created file: $lockfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ my $newpackagepath = "";
+
+ if ( $package_is_up_to_date )
+ {
+ # Before the package is copied into the installation set, it has to be checked, if this process is really the owner of this lock file..
+ # Check, if lock file still exists and if this process is the owner.
+
+ if ( ! -f $checkfilename )
+ {
+ $infoline = "Pool problem: Pool lock file \"$checkfilename\" was removed by another process (B)!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ log_pool_info(0);
+ $package_is_up_to_date = 4; # repeat this package
+ return $package_is_up_to_date;
+ }
+
+ if ( ! process_is_owner($checkfilename) )
+ {
+ $infoline = "Pool problem: Pool lock file \"$checkfilename\" belongs to another process (B)!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ log_pool_info(1);
+ $package_is_up_to_date = 4; # repeat this package
+ return $package_is_up_to_date;
+ }
+
+ # Copying the package from the pool into the installation set
+ $newpackagepath = copy_package_from_pool($installdir, $subdir, $realpackagename);
+ }
+
+ # Before the lock file in the pool can be removed, it has to be checked, if this process is still the owner of this lock file.
+ # Check, if lock file still exists and if this process is the owner.
+ if ( ! -f $checkfilename )
+ {
+ $infoline = "Pool problem: Pool lock file \"$checkfilename\" was removed by another process (C)!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ log_pool_info(0);
+
+ # removing new package from installation set
+ if ( $newpackagepath ne "" ) { remove_package_from_installset($newpackagepath); } # A file was copied and a problem occured with pooling
+
+ $package_is_up_to_date = 4; # repeat this package
+ return $package_is_up_to_date;
+ }
+
+ if ( ! process_is_owner($checkfilename) )
+ {
+ $infoline = "Pool problem: Pool lock file \"$checkfilename\" belongs to another process (C)!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ log_pool_info(1);
+
+ # removing new package from installation set
+ if ( $newpackagepath ne "" ) { remove_package_from_installset($newpackagepath); } # A file was copied and a problem occured with pooling
+
+ $package_is_up_to_date = 4; # repeat this package
+ return $package_is_up_to_date;
+ }
+
+ # Removing the check file, releasing this package for the next process.
+ # The Lock to create this package still exists, if required.
+ unlink $checkfilename;
+ $installer::globals::processhaspoolcheckfile = 0;
+ $infoline = "Pool: Removing file: $checkfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Last chance before packaging starts, to check, if this process is really still owner
+ # of the packaging lock file. If not, this packaging process can be repeated.
+ if ( $installer::globals::processhaspoollockfile )
+ {
+ if ( ! -f $lockfilename )
+ {
+ $infoline = "Pool problem: Pool lock file \"$lockfilename\" was removed by another process (E)!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ log_pool_info(0);
+ $package_is_up_to_date = 4; # repeat this package
+ return $package_is_up_to_date;
+ }
+
+ if ( ! process_is_owner($lockfilename) )
+ {
+ $infoline = "Pool problem: Pool lock file \"$lockfilename\" belongs to another process (E)!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ log_pool_info(1);
+ $package_is_up_to_date = 4; # repeat this package
+ return $package_is_up_to_date;
+ }
+ }
+
+ # Collecting log information
+ if ( $package_is_up_to_date == 1 ) { $installer::globals::poolpackages{$packagename} = 1; }
+ if ( $package_is_up_to_date == 0 )
+ {
+ my @packreasons = ();
+ if ( $package_already_exists )
+ {
+ $infoline = "\t\tPool: $packagename: Contains new content, creating new package. Differences:\n";
+ push( @packreasons, $infoline);
+ foreach my $dest ( sort keys %installer::globals::pcfdifflist ) { push( @packreasons, "\t\t$dest\n"); }
+ foreach my $dest ( @installer::globals::pcfdiffcomment ) { push( @packreasons, "\t\t$dest"); }
+ foreach my $dest ( @installer::globals::epmdifflist ) { push( @packreasons, "\t\t$dest"); }
+ }
+ else
+ {
+ $infoline = "\t\tPool: $packagename: Does not exist in pool.\n";
+ push( @packreasons, $infoline);
+ }
+
+ $installer::globals::createpackages{$packagename} = \@packreasons;
+ }
+
+ return $package_is_up_to_date;
+}
+
+###################################################
+# Determine, which package was created newly
+###################################################
+
+sub determine_new_packagename
+{
+ my ( $dir ) = @_;
+
+ my ($newcontent, $allcontent) = installer::systemactions::find_new_content_in_directory($dir, \@installer::globals::installsetcontent);
+ @installer::globals::installsetcontent = ();
+ foreach my $element ( @{$allcontent} ) { push(@installer::globals::installsetcontent, $element); }
+
+ my $newentriesnumber = $#{$newcontent} + 1;
+ if ( $newentriesnumber > 1 )
+ {
+ my $newpackages = "";
+ foreach my $onepackage ( @{$newcontent} ) { $newpackages = $newpackages . " " . $onepackage; }
+ installer::exiter::exit_program("ERROR: More than one new package in directory $dir ($newpackages)", "determine_new_packagename (packagepool)");
+ }
+ elsif ( $newentriesnumber < 1 )
+ {
+ installer::exiter::exit_program("ERROR: No new package in directory $dir", "determine_new_packagename (packagepool)");
+ }
+ my $newpackage = ${$newcontent}[0];
+
+ return $newpackage;
+}
+
+####################################################
+# Including content into the package pool
+####################################################
+
+sub put_content_into_pool
+{
+ my ($packagename, $installdir, $subdir, $filesinpackage, $epmfilecontent) = @_;
+
+ my $infoline = "";
+
+ my $fullinstalldir = $installdir . $installer::globals::separator . $subdir;
+ my $fullrealpackagename = determine_new_packagename($fullinstalldir);
+ my $realpackagename = $fullrealpackagename;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$realpackagename);
+
+ installer::logger::include_header_into_logfile("Adding content into the package pool: $realpackagename (PackageName: $packagename)");
+
+ # Calculating content for pcf file, if not already done in "package_is_up_to_date"
+ if ( ! $installer::globals::newpcfcontentcalculated )
+ {
+ $installer::globals::newpcfcontent = calculate_current_content($filesinpackage, $packagename);
+ $installer::globals::newpcfcontentcalculated = 1;
+ }
+
+ # Determining md5sum and FileSize for the new package and saving in pcf file
+ my $md5sum = installer::xpdinstaller::get_md5_value($fullrealpackagename);
+ my $filesize = installer::xpdinstaller::get_size_value($fullrealpackagename);
+ my $fullpackagename = installer::xpdinstaller::get_fullpkgname_value($fullrealpackagename);
+ my $pkgversion = installer::xpdinstaller::get_pkgversion_value($fullrealpackagename);
+
+ # Put package content file (pcf) into pool
+ my $pcffilename = $installer::globals::poolpath . $installer::globals::separator . $packagename . ".pcf";
+ create_pcfcontent_file($realpackagename, $md5sum, $filesize, $fullpackagename, $pkgversion, $epmfilecontent, $pcffilename);
+
+ # Creating xpd info
+ $installer::globals::xpdpackageinfo{'FileSize'} = $filesize;
+ $installer::globals::xpdpackageinfo{'FullPackageName'} = $fullpackagename;
+ $installer::globals::xpdpackageinfo{'md5sum'} = $md5sum;
+ $installer::globals::xpdpackageinfo{'RealPackageName'} = $realpackagename;
+ $installer::globals::xpdpackageinfo{'PkgVersion'} = $pkgversion;
+
+ # Put package into pool
+ $infoline = "Pool: Adding package \"$packagename\" into pool.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Copying with unique name, containing PID. Only renaming if everything was fine.
+ my $realdestination = "";
+ my $uniquedestination = "";
+ if ( -f $fullrealpackagename )
+ {
+ $realdestination = $installer::globals::poolpath . $installer::globals::separator . $realpackagename;
+ $uniquedestination = $realdestination . "." . $installer::globals::sessionid;
+ installer::systemactions::copy_one_file($fullrealpackagename, $uniquedestination);
+ }
+
+ # Copying Solaris packages (as tar files)
+ if ( -d $fullrealpackagename )
+ {
+ my $tarfilename = $packagename . ".tar";
+ my $fulltarfilename = $fullinstalldir . $installer::globals::separator . $tarfilename;
+ my $size = installer::worker::tar_package($fullinstalldir, $packagename, $tarfilename, $installer::globals::getuidpath);
+ if (( ! -f $fulltarfilename ) || ( ! ( $size > 0 ))) { installer::exiter::exit_program("ERROR: Missing file: $fulltarfilename", "put_content_into_pool"); }
+ $realdestination = $installer::globals::poolpath . $installer::globals::separator . $tarfilename;
+ $uniquedestination = $realdestination . "." . $installer::globals::sessionid;
+ installer::systemactions::copy_one_file($fulltarfilename, $uniquedestination);
+ unlink $fulltarfilename;
+ }
+
+ # Before the new package is renamed in the pool, it has to be checked, if this process still has the lock for this package.
+ # Check, if lock file still exists and if this process is the owner. Otherwise a pool error occured.
+ if ( ! -f $installer::globals::poollockfilename )
+ {
+ unlink $uniquedestination; # removing file from pool
+ log_pool_info(0);
+ installer::exiter::exit_program("ERROR: Pool lock file \"$installer::globals::poollockfilename\" was removed by another process (F)!", "put_content_into_pool");
+ }
+
+ if ( ! process_is_owner($installer::globals::poollockfilename) )
+ {
+ unlink $uniquedestination; # removing file from pool
+ log_pool_info(1);
+ installer::exiter::exit_program("ERROR: Pool lock file \"$installer::globals::poollockfilename\" belongs to another process (F)!", "put_content_into_pool");
+ }
+
+ # Renaming the file in the pool (atomic step)
+ rename($uniquedestination, $realdestination);
+
+ $infoline = "Pool: Renamed file: \"$uniquedestination\" to \"$realdestination\".\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Before the lock file in the pool can be removed, it has to be checked, if this process is still the owner of this lock file.
+ # Check, if lock file still exists and if this process is the owner. Otherwise a pool error occured.
+ if ( ! -f $installer::globals::poollockfilename )
+ {
+ log_pool_info(0);
+ installer::exiter::exit_program("ERROR: Pool lock file \"$installer::globals::poollockfilename\" was removed by another process (G)!", "put_content_into_pool");
+ }
+
+ if ( ! process_is_owner($installer::globals::poollockfilename) )
+ {
+ log_pool_info(1);
+ installer::exiter::exit_program("ERROR: Pool lock file \"$installer::globals::poollockfilename\" belongs to another process (G)!", "put_content_into_pool");
+ }
+
+ # Removing lock file, so that other processes can use this package now
+ unlink $installer::globals::poollockfilename;
+ $installer::globals::processhaspoollockfile = 0;
+ $infoline = "Pool: Removing file: $installer::globals::poollockfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+###################################################################
+# Copying a package from the pool into the installation set
+###################################################################
+
+sub copy_package_from_pool
+{
+ my ($installdir, $subdir, $packagename) = @_;
+
+ my $infoline = "Pool: Using package \"$packagename\" from pool.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ my $sourcefile = $installer::globals::poolpath . $installer::globals::separator . $packagename;
+ if ( $installer::globals::issolarisbuild ) { $sourcefile = $sourcefile . ".tar"; }
+ if ( ! -f $sourcefile ) { installer::exiter::exit_program("ERROR: Missing package in package pool: \"$sourcefile\"", "copy_package_from_pool"); }
+ my $destination = $installdir . $installer::globals::separator . $subdir;
+ if ( ! -d $destination ) { installer::systemactions::create_directory($destination); }
+ my $destinationfile = $destination . $installer::globals::separator . $packagename;
+ if ( $installer::globals::issolarisbuild ) { $destinationfile = $destinationfile . ".tar"; }
+ if ( -f $sourcefile ) { installer::systemactions::copy_one_file($sourcefile, $destinationfile); }
+ # Unpacking for Solaris
+ if ( $installer::globals::issolarisbuild )
+ {
+ my $tarfilename = $packagename . ".tar";
+ installer::worker::untar_package($destination, $tarfilename, $installer::globals::getuidpath);
+ unlink $destinationfile;
+ $destinationfile =~ s/.tar\s*$//;
+ }
+
+ # Keeping the content of @installer::globals::installsetcontent up to date (with full pathes):
+ push(@installer::globals::installsetcontent, $destinationfile);
+
+ return $destinationfile;
+}
+
+###################################################################
+# Counting keys in hash
+###################################################################
+
+sub get_count
+{
+ my ( $hashref ) = @_;
+
+ my $counter = 0;
+ foreach my $onekey ( keys %{$hashref} ) { $counter++; }
+ return $counter;
+}
+
+###################################################################
+# Logging some pool information
+###################################################################
+
+sub log_pool_statistics
+{
+ my $infoline = "";
+
+ installer::logger::include_header_into_logfile("Pool statistics:");
+
+ # Info collected in global hashes
+ # %installer::globals::createpackages
+ # %installer::globals::poolpackages
+
+ my $pool_packages = get_count(\%installer::globals::poolpackages);
+ my $created_packages = get_count(\%installer::globals::createpackages);
+
+ $infoline = "Number of packages from pool: $pool_packages\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ foreach my $packagename ( sort keys(%installer::globals::poolpackages) )
+ {
+ $infoline = "\t$packagename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ $infoline = "\nNumber of packages that were created: $created_packages\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ foreach my $packagename ( sort keys(%installer::globals::createpackages) )
+ {
+ $infoline = "\t$packagename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ my $reason = $installer::globals::createpackages{$packagename};
+
+ for ( my $i = 0; $i <= $#{$reason}; $i++ )
+ {
+ $infoline = "${$reason}[$i]";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/installer/parameter.pm b/solenv/bin/modules/installer/parameter.pm
new file mode 100644
index 000000000000..70bc32e36c7c
--- /dev/null
+++ b/solenv/bin/modules/installer/parameter.pm
@@ -0,0 +1,651 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::parameter;
+
+use Cwd;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::remover;
+use installer::systemactions;
+
+############################################
+# Parameter Operations
+############################################
+
+sub usage
+{
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::parameter::usage"); }
+
+ print <<Ende;
+--------------------------------------------------------------------------------
+$installer::globals::prog
+The following parameter are needed:
+-f: Path to the product list (required)
+-s: Path to the setup script (optional, if defined in product list)
+-i: Install path of the product (/opt/openofficeorg20) (optional)
+-p: Product from product list to be created (required)
+-l: Language of the product (comma and hash) (optional, defined in productlist)
+-b: Build, e.g. srx645 (optional)
+-m: Minor, e.g. m10 (optional)
+-simple: Path to do a simple install to
+-c: Compiler, e.g. wntmsci8, unxlngi5, unxsols4, ... (optional)
+-u: Path, in which zipfiles are unpacked (optional)
+-msitemplate: Source of the msi file templates (Windows compiler only)
+-msilanguage: Source of the msi file templates (Windows compiler only)
+-javalanguage: Source of the Java language files (opt., non-Windows only)
+-buildid: Current BuildID (optional)
+-pro: Product version
+-format: Package format
+-debian: Create Debian packages for Linux
+-dontunzip: do not unzip all files with flag ARCHIVE
+-dontcallepm : do not call epm to create install sets (opt., non-Windows only)
+-ispatchedepm : Usage of a patched (non-standard) epm (opt., non-Windows only)
+-copyproject : is set for projects that are only used for copying (optional)
+-languagepack : do create a languagepack, no product pack (optional)
+-patch : do create a patch (optional)
+-patchinc: Source for the patch include files (Solaris only)
+-dontstrip: No file stripping (Unix only)
+-log : Logging all available information (optional)
+-debug : Collecting debug information
+
+Examples for Windows:
+
+perl make_epmlist.pl -f zip.lst -p OfficeFAT -l en-US
+ -u /export/unpack -buildid 8712
+ -msitemplate /export/msi_files
+ -msilanguage /export/msi_languages
+
+Examples for Non-Windows:
+
+perl make_epmlist.pl -f zip.lst -p OfficeFAT -l en-US -format rpm
+ -u /export/unpack -buildid 8712 -ispatchedepm
+--------------------------------------------------------------------------------
+Ende
+ exit(-1);
+}
+
+#########################################
+# Writing all parameter into logfile
+#########################################
+
+sub saveparameter
+{
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::parameter::saveparameter"); }
+
+ my $include = "";
+
+ installer::logger::globallog("Command line arguments:");
+
+ for ( my $i = 0; $i <= $#ARGV; $i++ )
+ {
+ $include = $ARGV[$i] . "\n";
+ push(@installer::globals::globallogfileinfo, $include);
+ }
+
+ # also saving global settings:
+
+ $include = "Separator: $installer::globals::separator\n";
+ push(@installer::globals::globallogfileinfo, $include);
+
+}
+
+#####################################
+# Reading parameter
+#####################################
+
+sub getparameter
+{
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::parameter::getparameter"); }
+
+ while ( $#ARGV >= 0 )
+ {
+ my $param = shift(@ARGV);
+
+ if ($param eq "-f") { $installer::globals::ziplistname = shift(@ARGV); }
+ elsif ($param eq "-s") { $installer::globals::setupscriptname = shift(@ARGV); }
+ elsif ($param eq "-p") { $installer::globals::product = shift(@ARGV); }
+ elsif ($param eq "-l") { $installer::globals::languagelist = shift(@ARGV); }
+ elsif ($param eq "-b") { $installer::globals::build = shift(@ARGV); }
+ elsif ($param eq "-m") { $installer::globals::minor = shift(@ARGV); }
+ elsif ($param eq "-dontunzip") { $installer::globals::dounzip = 0; }
+ elsif ($param eq "-c") { $installer::globals::compiler = shift(@ARGV); }
+ elsif ($param eq "-pro") { $installer::globals::pro = 1; }
+ elsif ($param eq "-format") { $installer::globals::packageformat = shift(@ARGV); }
+ elsif ($param eq "-log") { $installer::globals::globallogging = 1; }
+ elsif ($param eq "-quiet") { $installer::globals::quiet = 1; }
+ elsif ($param eq "-verbose") { $installer::globals::quiet = 0; }
+ elsif ($param eq "-debug") { $installer::globals::debug = 1; }
+ elsif ($param eq "-tab") { $installer::globals::tab = 1; }
+ elsif ($param eq "-u") { $installer::globals::unpackpath = shift(@ARGV); }
+ elsif ($param eq "-i") { $installer::globals::rootpath = shift(@ARGV); }
+ elsif ($param eq "-dontcallepm") { $installer::globals::call_epm = 0; }
+ elsif ($param eq "-msitemplate") { $installer::globals::idttemplatepath = shift(@ARGV); }
+ elsif ($param eq "-msilanguage") { $installer::globals::idtlanguagepath = shift(@ARGV); }
+ elsif ($param eq "-patchinc") { $installer::globals::patchincludepath = shift(@ARGV); }
+ elsif ($param eq "-javalanguage") { $installer::globals::javalanguagepath = shift(@ARGV); }
+ elsif ($param eq "-buildid") { $installer::globals::buildid = shift(@ARGV); }
+ elsif ($param eq "-copyproject") { $installer::globals::is_copy_only_project = 1; }
+ elsif ($param eq "-languagepack") { $installer::globals::languagepack = 1; }
+ elsif ($param eq "-patch") { $installer::globals::patch = 1; }
+ elsif ($param eq "-debian") { $installer::globals::debian = 1; }
+ elsif ($param eq "-dontstrip") { $installer::globals::strip = 0; }
+ elsif ($param eq "-destdir") # new parameter for simple installer
+ {
+ $installer::globals::rootpath ne "" && die "must set destdir before -i or -simple";
+ $installer::globals::destdir = shift @ARGV;
+ }
+ elsif ($param eq "-simple") # new parameter for simple installer
+ {
+ $installer::globals::simple = 1;
+ $installer::globals::call_epm = 0;
+ $installer::globals::makedownload = 0;
+ $installer::globals::makejds = 0;
+ $installer::globals::strip = 0;
+ my $path = shift(@ARGV);
+ $path =~ s/^\Q$installer::globals::destdir\E//;
+ $installer::globals::rootpath = $path;
+ }
+ else
+ {
+ installer::logger::print_error( "unknown parameter: $param" );
+ usage();
+ exit(-1);
+ }
+ }
+
+ # Usage of simple installer (not for Windows):
+ # $PERL -w $SOLARENV/bin/make_installer.pl \
+ # -f openoffice.lst -l en-US -p OpenOffice \
+ # -buildid $BUILD -rpm \
+ # -destdir /tmp/nurk -simple $INSTALL_PATH
+}
+
+############################################
+# Controlling the fundamental parameter
+# (required for every process)
+############################################
+
+sub control_fundamental_parameter
+{
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::parameter::control_fundamental_parameter"); }
+
+ if ($installer::globals::product eq "")
+ {
+ installer::logger::print_error( "Product name not set!" );
+ usage();
+ exit(-1);
+ }
+}
+
+##########################################################
+# The path parameters can be relative or absolute.
+# This function creates absolute pathes.
+##########################################################
+
+sub make_path_absolute
+{
+ my ($pathref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::parameter::make_path_absolute : $$pathref"); }
+
+ if ( $installer::globals::isunix )
+ {
+ if (!($$pathref =~ /^\s*\//)) # this is a relative unix path
+ {
+ $$pathref = cwd() . $installer::globals::separator . $$pathref;
+ }
+ }
+
+ if ( $installer::globals::iswin )
+ {
+ if ( $^O =~ /cygwin/i )
+ {
+ if ( $$pathref !~ /^\s*\// && $$pathref !~ /^\s*\w\:/ ) # not an absolute POSIX or DOS path
+ {
+ $$pathref = cwd() . $installer::globals::separator . $$pathref;
+ }
+ my $p = $$pathref;
+ chomp( $p );
+ my $q = '';
+ # Avoid the $(LANG) problem.
+ if ($p =~ /(\A.*)(\$\(.*\Z)/) {
+ $p = $1;
+ $q = $2;
+ }
+ $p =~ s/\\/\\\\/g;
+ chomp( $p = qx{cygpath -w "$p"} );
+ $$pathref = $p.$q;
+ # Use windows paths, but with '/'s.
+ $$pathref =~ s/\\/\//g;
+ }
+ else
+ {
+ if (!($$pathref =~ /^\s*\w\:/)) # this is a relative windows path (no dos drive)
+ {
+ $$pathref = cwd() . $installer::globals::separator . $$pathref;
+
+ $$pathref =~ s/\//\\/g;
+ }
+ }
+ }
+ $$pathref =~ s/[\/\\]\s*$//; # removing ending slashes
+}
+
+##################################################
+# Setting some global parameters
+# This has to be expanded with furher platforms
+##################################################
+
+sub setglobalvariables
+{
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::parameter::setglobalvariables"); }
+
+ # Setting the installertype directory corresponding to the environment variable PKGFORMAT
+ # The global variable $installer::globals::packageformat can only contain one package format.
+ # If PKGFORMAT cotains more than one format (for example "rpm deb") this is splitted in the
+ # makefile calling the perl program.
+ $installer::globals::installertypedir = $installer::globals::packageformat;
+
+ if ( $installer::globals::compiler =~ /wnt(msc|gcc)i/ )
+ {
+ $installer::globals::iswindowsbuild = 1;
+ }
+
+ if ( $installer::globals::compiler =~ /unxso[lg][siux]/ )
+ {
+ $installer::globals::issolarisbuild = 1;
+ if ( $installer::globals::packageformat eq "pkg" )
+ {
+ $installer::globals::issolarispkgbuild = 1;
+ $installer::globals::epmoutpath = "packages";
+ $installer::globals::isxpdplatform = 1;
+ }
+ }
+
+ if (( $installer::globals::compiler =~ /unxmacxi/ ) || ( $installer::globals::compiler =~ /unxmacxp/ ))
+ {
+ $installer::globals::ismacbuild = 1;
+
+ if ( $installer::globals::packageformat eq "dmg" )
+ {
+ $installer::globals::ismacdmgbuild = 1;
+ }
+ }
+
+ if ( $installer::globals::compiler =~ /unxfbsd/ )
+ {
+ $installer::globals::isfreebsdbuild = 1;
+
+ if ( $installer::globals::packageformat eq "bsd" )
+ {
+ $installer::globals::epmoutpath = "freebsd";
+ $installer::globals::isfreebsdpkgbuild = 1;
+ }
+ }
+
+ if ( $installer::globals::compiler =~ /unxso[lg]s/ ) { $installer::globals::issolarissparcbuild = 1; }
+
+ if ( $installer::globals::compiler =~ /unxso[lg]i/ ) { $installer::globals::issolarisx86build = 1; }
+
+ if ($ENV{OS} eq 'LINUX')
+ {
+ $installer::globals::islinuxbuild = 1;
+ if ( $installer::globals::packageformat eq "rpm" )
+ {
+ $installer::globals::islinuxrpmbuild = 1;
+ $installer::globals::isxpdplatform = 1;
+ $installer::globals::epmoutpath = "RPMS";
+ if ( $installer::globals::compiler =~ /unxlngi/ )
+ {
+ $installer::globals::islinuxintelrpmbuild = 1;
+ }
+ if ( $installer::globals::compiler =~ /unxlngppc/ )
+ {
+ $installer::globals::islinuxppcrpmbuild = 1;
+ }
+ if ( $installer::globals::compiler =~ /unxlngx/ )
+ {
+ $installer::globals::islinuxx86_64rpmbuild = 1;
+ }
+
+ if ( $installer::globals::rpm eq "" ) { installer::exiter::exit_program("ERROR: Environment variable \"\$RPM\" has to be defined!", "setglobalvariables"); }
+ }
+
+ # Creating Debian packages ?
+ if (( $installer::globals::packageformat eq "deb" ) || ( $installer::globals::debian ))
+ {
+ $installer::globals::debian = 1;
+ $installer::globals::packageformat = "deb";
+ my $message = "Creating Debian packages";
+ installer::logger::print_message( $message );
+ push(@installer::globals::globallogfileinfo, $message);
+ $installer::globals::islinuxrpmbuild = 0;
+ $installer::globals::islinuxdebbuild = 1;
+ $installer::globals::epmoutpath = "DEBS";
+ if ( $installer::globals::compiler =~ /unxlngi/ )
+ {
+ $installer::globals::islinuxinteldebbuild = 1;
+ }
+ if ( $installer::globals::compiler =~ /unxlngppc/ )
+ {
+ $installer::globals::islinuxppcdebbuild = 1;
+ }
+ if ( $installer::globals::compiler =~ /unxlngx/ )
+ {
+ $installer::globals::islinuxx86_64debbuild = 1;
+ }
+ }
+ }
+
+ # Defaulting to native package format for epm
+
+ if ( ! $installer::globals::packageformat ) { $installer::globals::packageformat = "native"; }
+
+ # extension, if $installer::globals::pro is set
+ if ($installer::globals::pro) { $installer::globals::productextension = ".pro"; }
+
+ # no languages defined as parameter
+ if ($installer::globals::languagelist eq "") { $installer::globals::languages_defined_in_productlist = 1; }
+
+ # setting and creating the unpackpath
+
+ if ($installer::globals::unpackpath eq "") # unpackpath not set
+ {
+ $installer::globals::unpackpath = cwd();
+ if ( $installer::globals::iswin ) { $installer::globals::unpackpath =~ s/\//\\/g; }
+ }
+
+ if ( $installer::globals::localunpackdir ne "" ) { $installer::globals::unpackpath = $installer::globals::localunpackdir; }
+
+ if (!($installer::globals::unpackpath eq ""))
+ {
+ make_path_absolute(\$installer::globals::unpackpath);
+ }
+
+ $installer::globals::unpackpath =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ if (! -d $installer::globals::unpackpath ) # create unpackpath
+ {
+ installer::systemactions::create_directory($installer::globals::unpackpath);
+ }
+
+ # setting jds exclude file list
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ $installer::globals::jdsexcludefilename = "jds_excludefiles_linux.txt";
+ }
+ if ( $installer::globals::issolarissparcbuild )
+ {
+ $installer::globals::jdsexcludefilename = "jds_excludefiles_solaris_sparc.txt";
+ }
+ if ( $installer::globals::issolarisx86build )
+ {
+ $installer::globals::jdsexcludefilename = "jds_excludefiles_solaris_intel.txt";
+ }
+
+ # setting and creating the temppath
+
+ if (( $ENV{'TMP'} ) || ( $ENV{'TEMP'} ) || ( $ENV{'TMPDIR'} ))
+ {
+ if ( $ENV{'TMP'} ) { $installer::globals::temppath = $ENV{'TMP'}; }
+ elsif ( $ENV{'TEMP'} ) { $installer::globals::temppath = $ENV{'TEMP'}; }
+ elsif ( $ENV{'TMPDIR'} ) { $installer::globals::temppath = $ENV{'TMPDIR'}; }
+ $installer::globals::temppath =~ s/\Q$installer::globals::separator\E\s*$//; # removing ending slashes and backslashes
+ $installer::globals::temppath = $installer::globals::temppath . $installer::globals::separator . $installer::globals::globaltempdirname;
+ installer::systemactions::create_directory_with_privileges($installer::globals::temppath, "777");
+ my $dirsave = $installer::globals::temppath;
+
+ if ( $installer::globals::compiler =~ /^unxmac/ )
+ {
+ my $localcall = "chmod 777 $installer::globals::temppath \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+
+ $installer::globals::temppath = $installer::globals::temppath . $installer::globals::separator . "i";
+ $installer::globals::temppath = installer::systemactions::create_pid_directory($installer::globals::temppath);
+ push(@installer::globals::removedirs, $installer::globals::temppath);
+
+ if ( ! -d $installer::globals::temppath ) { installer::exiter::exit_program("ERROR: Failed to create directory $installer::globals::temppath ! Possible reason: Wrong privileges in directory $dirsave .", "setglobalvariables"); }
+
+ $installer::globals::jdstemppath = $installer::globals::temppath;
+ $installer::globals::jdstemppath =~ s/i_/j_/;
+ push(@installer::globals::jdsremovedirs, $installer::globals::jdstemppath);
+ $installer::globals::temppath = $installer::globals::temppath . $installer::globals::separator . $installer::globals::compiler . $installer::globals::productextension;
+ installer::systemactions::create_directory($installer::globals::temppath);
+ if ( $^O =~ /cygwin/i )
+ {
+ $installer::globals::cyg_temppath = $installer::globals::temppath;
+ $installer::globals::cyg_temppath =~ s/\\/\\\\/g;
+ chomp( $installer::globals::cyg_temppath = qx{cygpath -w "$installer::globals::cyg_temppath"} );
+ }
+ $installer::globals::temppathdefined = 1;
+ $installer::globals::jdstemppathdefined = 1;
+ }
+ else
+ {
+ $installer::globals::temppathdefined = 0;
+ $installer::globals::jdstemppathdefined = 0;
+ }
+
+ # only one cab file, if Windows msp patches shall be prepared
+ if ( $installer::globals::prepare_winpatch ) { $installer::globals::number_of_cabfiles = 1; }
+
+}
+
+############################################
+# Controlling the parameter that are
+# required for special processes
+############################################
+
+sub control_required_parameter
+{
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::parameter::control_required_parameter"); }
+
+ if (!($installer::globals::is_copy_only_project))
+ {
+ ##############################################################################################
+ # idt template path. Only required for Windows build ($installer::globals::compiler =~ /wntmsci/)
+ # for the creation of the msi database.
+ ##############################################################################################
+
+ if (($installer::globals::idttemplatepath eq "") && ($installer::globals::iswindowsbuild))
+ {
+ installer::logger::print_error( "idt template path not set (-msitemplate)!" );
+ usage();
+ exit(-1);
+ }
+
+ ##############################################################################################
+ # idt language path. Only required for Windows build ($installer::globals::compiler =~ /wntmsci/)
+ # for the creation of the msi database.
+ ##############################################################################################
+
+ if (($installer::globals::idtlanguagepath eq "") && ($installer::globals::iswindowsbuild))
+ {
+ installer::logger::print_error( "idt language path not set (-msilanguage)!" );
+ usage();
+ exit(-1);
+ }
+
+ # Analyzing the idt template path
+
+ if (!($installer::globals::idttemplatepath eq "")) # idttemplatepath set, relative or absolute?
+ {
+ make_path_absolute(\$installer::globals::idttemplatepath);
+ }
+
+ installer::remover::remove_ending_pathseparator(\$installer::globals::idttemplatepath);
+
+ # Analyzing the idt language path
+
+ if (!($installer::globals::idtlanguagepath eq "")) # idtlanguagepath set, relative or absolute?
+ {
+ make_path_absolute(\$installer::globals::idtlanguagepath);
+ }
+
+ installer::remover::remove_ending_pathseparator(\$installer::globals::idtlanguagepath);
+
+ # In the msi template directory a files "codes.txt" has to exist, in which the ProductCode
+ # and the UpgradeCode for the product are defined.
+ # The name "codes.txt" can be overwritten in Product definition with CODEFILENAME (msiglobal.pm)
+
+ if (( $installer::globals::iswindowsbuild ) && ( $installer::globals::packageformat ne "archive" ) && ( $installer::globals::packageformat ne "installed" ))
+ {
+ $installer::globals::codefilename = $installer::globals::idttemplatepath . $installer::globals::separator . $installer::globals::codefilename;
+ installer::files::check_file($installer::globals::codefilename);
+ $installer::globals::componentfilename = $installer::globals::idttemplatepath . $installer::globals::separator . $installer::globals::componentfilename;
+ installer::files::check_file($installer::globals::componentfilename);
+ }
+
+ }
+
+ #######################################
+ # Patch currently only available
+ # for Solaris packages and Linux
+ #######################################
+
+ if (( $installer::globals::patch ) && ( ! $installer::globals::issolarispkgbuild ) && ( ! $installer::globals::islinuxrpmbuild ) && ( ! $installer::globals::islinuxdebbuild ) && ( ! $installer::globals::iswindowsbuild ) && ( ! $installer::globals::ismacdmgbuild ))
+ {
+ installer::logger::print_error( "Sorry, Patch flag currently only available for Solaris pkg, Linux RPM and Windows builds!" );
+ usage();
+ exit(-1);
+ }
+
+ if (( $installer::globals::patch ) && ( $installer::globals::issolarispkgbuild ) && ( ! $installer::globals::patchincludepath ))
+ {
+ installer::logger::print_error( "Solaris patch requires parameter -patchinc !" );
+ usage();
+ exit(-1);
+ }
+
+ if (( $installer::globals::patch ) && ( $installer::globals::issolarispkgbuild ) && ( $installer::globals::patchincludepath ))
+ {
+ make_path_absolute(\$installer::globals::patchincludepath);
+ $installer::globals::patchincludepath = installer::converter::make_path_conform($installer::globals::patchincludepath);
+ }
+
+ #######################################
+ # Testing existence of files
+ # also for copy-only projects
+ #######################################
+
+ if ($installer::globals::ziplistname eq "")
+ {
+ installer::logger::print_error( "ERROR: Zip list file has to be defined (Parameter -f) !" );
+ usage();
+ exit(-1);
+ }
+ else
+ {
+ installer::files::check_file($installer::globals::ziplistname);
+ }
+
+ if ($installer::globals::setupscriptname eq "") { $installer::globals::setupscript_defined_in_productlist = 1; }
+ else { installer::files::check_file($installer::globals::setupscriptname); } # if the setupscript file is defined, it has to exist
+
+}
+
+################################################
+# Writing parameter to shell and into logfile
+################################################
+
+sub outputparameter
+{
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::parameter::outputparameter"); }
+
+ my $element;
+
+ my @output = ();
+
+ push(@output, "\n########################################################\n");
+ push(@output, "$installer::globals::prog, version 1.0\n");
+ push(@output, "Product list file: $installer::globals::ziplistname\n");
+ if (!($installer::globals::setupscript_defined_in_productlist))
+ {
+ push(@output, "Setup script: $installer::globals::setupscriptname\n");
+ }
+ else
+ {
+ push(@output, "Taking setup script from solver\n");
+ }
+ push(@output, "Unpackpath: $installer::globals::unpackpath\n");
+ push(@output, "Compiler: $installer::globals::compiler\n");
+ push(@output, "Product: $installer::globals::product\n");
+ push(@output, "BuildID: $installer::globals::buildid\n");
+ push(@output, "Build: $installer::globals::build\n");
+ if ( $installer::globals::minor ) { push(@output, "Minor: $installer::globals::minor\n"); }
+ else { push(@output, "No minor set\n"); }
+ if ( $installer::globals::pro ) { push(@output, "Product version\n"); }
+ else { push(@output, "Non-Product version\n"); }
+ if ( $installer::globals::rootpath eq "" ) { push(@output, "Using default installpath\n"); }
+ else { push(@output, "Installpath: $installer::globals::rootpath\n"); }
+ push(@output, "Package format: $installer::globals::packageformat\n");
+ if (!($installer::globals::idttemplatepath eq "")) { push(@output, "msi templatepath: $installer::globals::idttemplatepath\n"); }
+ if ((!($installer::globals::idttemplatepath eq "")) && (!($installer::globals::iswindowsbuild))) { push(@output, "msi template path will be ignored for non Windows builds!\n"); }
+ if (!($installer::globals::idtlanguagepath eq "")) { push(@output, "msi languagepath: $installer::globals::idtlanguagepath\n"); }
+ if ((!($installer::globals::idtlanguagepath eq "")) && (!($installer::globals::iswindowsbuild))) { push(@output, "msi language path will be ignored for non Windows builds!\n"); }
+ if ((!($installer::globals::iswindowsbuild)) && ( $installer::globals::call_epm )) { push(@output, "Calling epm\n"); }
+ if ((!($installer::globals::iswindowsbuild)) && (!($installer::globals::call_epm))) { push(@output, "Not calling epm\n"); }
+ if (!($installer::globals::javalanguagepath eq "")) { push(@output, "Java language path: $installer::globals::javalanguagepath\n"); }
+ if ((!($installer::globals::javalanguagepath eq "")) && ($installer::globals::iswindowsbuild)) { push(@output, "Java language path will be ignored for Windows builds!\n"); }
+ if ( $installer::globals::patchincludepath ) { push(@output, "Patch include path: $installer::globals::patchincludepath\n"); }
+ if ( $installer::globals::globallogging ) { push(@output, "Complete logging activated\n"); }
+ if ( $installer::globals::debug ) { push(@output, "Debug is activated\n"); }
+ if ( $installer::globals::tab ) { push(@output, "TAB version\n"); }
+ if ( $installer::globals::strip ) { push(@output, "Stripping files\n"); }
+ else { push(@output, "No file stripping\n"); }
+ if ( $installer::globals::debian ) { push(@output, "Linux: Creating Debian packages\n"); }
+ if ( $installer::globals::dounzip ) { push(@output, "Unzip ARCHIVE files\n"); }
+ else { push(@output, "Not unzipping ARCHIVE files\n"); }
+ if (!($installer::globals::languages_defined_in_productlist))
+ {
+ push(@output, "Languages:\n");
+ foreach $element (@installer::globals::languageproducts) { push(@output, "\t$element\n"); }
+ }
+ else
+ {
+ push(@output, "Languages defined in $installer::globals::ziplistname\n");
+ }
+ if ( $installer::globals::is_copy_only_project ) { push(@output, "This is a copy only project!\n"); }
+ if ( $installer::globals::languagepack ) { push(@output, "Creating language pack!\n"); }
+ if ( $installer::globals::patch ) { push(@output, "Creating patch!\n"); }
+ push(@output, "########################################################\n");
+
+ # output into shell and into logfile
+
+ for ( my $i = 0; $i <= $#output; $i++ )
+ {
+ installer::logger::print_message( $output[$i] );
+ push(@installer::globals::globallogfileinfo, $output[$i]);
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/installer/pathanalyzer.pm b/solenv/bin/modules/installer/pathanalyzer.pm
new file mode 100644
index 000000000000..1c57a0d76e02
--- /dev/null
+++ b/solenv/bin/modules/installer/pathanalyzer.pm
@@ -0,0 +1,75 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::pathanalyzer;
+
+use installer::globals;
+
+###########################################
+# Path analyzer
+###########################################
+
+sub get_path_from_fullqualifiedname
+{
+ my ($longfilenameref) = @_;
+
+ if ( $$longfilenameref =~ /\Q$installer::globals::separator\E/ ) # Is there a separator in the path? Otherwise the path is empty.
+ {
+ if ( $$longfilenameref =~ /^\s*(\S.*\S\Q$installer::globals::separator\E)(\S.+\S?)/ )
+ {
+ $$longfilenameref = $1;
+ }
+ }
+ else
+ {
+ $$longfilenameref = ""; # there is no path
+ }
+}
+
+sub make_absolute_filename_to_relative_filename
+{
+ my ($longfilenameref) = @_;
+
+ if ( $installer::globals::isunix )
+ {
+ if ( $$longfilenameref =~ /^.*\/(\S.+\S?)/ )
+ {
+ $$longfilenameref = $1;
+ }
+ }
+
+ if ( $installer::globals::iswin )
+ {
+ # Either '/' or '\'. It would be possible to use $installer::globals::separator.
+ if ( $$longfilenameref =~ /^.*[\/\\](\S.+\S?)/ )
+ {
+ $$longfilenameref = $1;
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/installer/profiles.pm b/solenv/bin/modules/installer/profiles.pm
new file mode 100644
index 000000000000..3feef2e8a367
--- /dev/null
+++ b/solenv/bin/modules/installer/profiles.pm
@@ -0,0 +1,231 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::profiles;
+
+use installer::converter;
+use installer::existence;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::remover;
+use installer::systemactions;
+
+#############################
+# Profiles
+#############################
+
+#######################################################
+# Sorting the content of a profile
+#######################################################
+
+sub sorting_profile
+{
+ my ($profilesref) = @_;
+
+ my @profile = ();
+ my @definedsections = ();
+
+ for ( my $i = 0; $i <= $#{$profilesref}; $i++ )
+ {
+ my $line = ${$profilesref}[$i];
+
+ if ( $line =~ /^\s*(\[.*\])\s*$/ ) # this is a section (every second line)
+ {
+ my $section = $1;
+
+ if (!(installer::existence::exists_in_array($section, \@definedsections)))
+ {
+ my $sectionline = $section . "\n";
+ push(@definedsections, $section);
+ push(@profile, $sectionline);
+
+ for ( my $j = 0; $j <= $#{$profilesref}; $j++ )
+ {
+ my $oneline = ${$profilesref}[$j];
+ installer::remover::remove_leading_and_ending_whitespaces(\$oneline);
+
+ if ( $oneline eq $section )
+ {
+ my $nextline = ${$profilesref}[$j+1];
+ push(@profile, $nextline);
+ }
+ }
+ }
+ }
+ }
+
+ return \@profile;
+}
+
+#####################################################################
+# Adding the newly created profile into the file list
+#####################################################################
+
+sub add_profile_into_filelist
+{
+ my ($filesarrayref, $oneprofile, $completeprofilename, $allvariables) = @_;
+
+ my %profile = ();
+
+ # Taking the base data from the "gid_File_Lib_Vcl"
+
+ my $vclgid = "gid_File_Lib_Vcl";
+ if ( $allvariables->{'GLOBALFILEGID'} ) { $vclgid = $allvariables->{'GLOBALFILEGID'}; }
+ my $vclfile = installer::existence::get_specified_file($filesarrayref, $vclgid);
+
+ # copying all base data
+ installer::converter::copy_item_object($vclfile, \%profile);
+
+ # and overriding all new values
+
+ $profile{'ismultilingual'} = 0;
+ $profile{'sourcepath'} = $completeprofilename;
+ $profile{'Name'} = $oneprofile->{'Name'};
+ $profile{'UnixRights'} = "444";
+ $profile{'gid'} = $oneprofile->{'gid'};
+ $profile{'Dir'} = $oneprofile->{'Dir'};
+ $profile{'destination'} = $oneprofile->{'destination'};
+ $profile{'Styles'} = "";
+ if ( $oneprofile->{'Styles'} ) { $profile{'Styles'} = $oneprofile->{'Styles'}; }
+ $profile{'modules'} = $oneprofile->{'ModuleID'}; # Profiles can only be added completely to a module
+
+ push(@{$filesarrayref}, \%profile);
+}
+
+###################################################
+# Including Windows line ends in ini files
+# Profiles on Windows shall have \r\n line ends
+###################################################
+
+sub include_windows_lineends
+{
+ my ($onefile) = @_;
+
+ for ( my $i = 0; $i <= $#{$onefile}; $i++ )
+ {
+ ${$onefile}[$i] =~ s/\r?\n$/\r\n/;
+ }
+}
+
+####################################
+# Create profiles
+####################################
+
+sub create_profiles
+{
+ my ($profilesref, $profileitemsref, $filesarrayref, $languagestringref, $allvariables) = @_;
+
+ my $infoline;
+
+ my $profilesdir = installer::systemactions::create_directories("profiles", $languagestringref);
+
+ installer::logger::include_header_into_logfile("Creating profiles:");
+
+ # Attention: The module dependencies from ProfileItems have to be ignored, because
+ # the Profile has to be installed completely with all of its content and the correct name.
+ # Only complete profiles can belong to a specified module, but not ProfileItems!
+
+ # iterating over all files
+
+ for ( my $i = 0; $i <= $#{$profilesref}; $i++ )
+ {
+ my $oneprofile = ${$profilesref}[$i];
+ my $dir = $oneprofile->{'Dir'};
+ if ( $dir eq "PREDEFINED_CONFIGDIR" ) { next; } # ignoring the profile sversion file
+
+ my $profilegid = $oneprofile->{'gid'};
+ my $profilename = $oneprofile->{'Name'};
+
+ my $localprofilesdir = $profilesdir . $installer::globals::separator . $profilegid; # uniqueness guaranteed by gid
+ if ( ! -d $localprofilesdir ) { installer::systemactions::create_directory($localprofilesdir); }
+
+ my @onefile = ();
+ my $profileempty = 1;
+
+ for ( my $j = 0; $j <= $#{$profileitemsref}; $j++ )
+ {
+ my $oneprofileitem = ${$profileitemsref}[$j];
+
+ my $styles = "";
+ if ( $oneprofileitem->{'Styles'} ) { $styles = $oneprofileitem->{'Styles'}; }
+ if ( $styles =~ /\bINIFILETABLE\b/ ) { next; } # these values are written during installation, not during packing
+
+ my $profileid = $oneprofileitem->{'ProfileID'};
+
+ if ( $profileid eq $profilegid )
+ {
+ my $section = $oneprofileitem->{'Section'};
+ my $key = $oneprofileitem->{'Key'};
+ my $value = $oneprofileitem->{'Value'};
+ for (my $pk = 1; $pk <= 50; $pk++)
+ {
+ my $key = "ValueList" . $pk;
+ if ( $oneprofileitem->{$key} )
+ { $value = $value . " " . $oneprofileitem->{$key} }
+ }
+ my $order = $oneprofileitem->{'Order'}; # ignoring order at the moment
+
+ my $line = "[" . $section . "]" . "\n";
+ push(@onefile, $line);
+ $line = $key . "=" . $value . "\n";
+ push(@onefile, $line);
+
+ $profileempty = 0;
+ }
+ }
+
+ if ( $profileempty ) { next; } # ignoring empty profiles
+
+ # Sorting the array @onefile
+ my $onefileref = sorting_profile(\@onefile);
+
+ if ( $installer::globals::iswin && $installer::globals::plat =~ /cygwin/i) # Windows line ends only for Cygwin
+ {
+ include_windows_lineends($onefileref);
+ }
+
+ # Saving the profile as a file
+ $completeprofilename = $localprofilesdir . $installer::globals::separator . $profilename;
+
+ installer::files::save_file($completeprofilename, $onefileref);
+
+ # Adding the file to the filearray
+ # Some data are set now, others are taken from the file "soffice.exe" ("soffice.bin")
+ add_profile_into_filelist($filesarrayref, $oneprofile, $completeprofilename, $allvariables);
+
+ $infoline = "Created Profile: $completeprofilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ $infoline = "\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+
+1;
diff --git a/solenv/bin/modules/installer/remover.pm b/solenv/bin/modules/installer/remover.pm
new file mode 100644
index 000000000000..541a33bce4c1
--- /dev/null
+++ b/solenv/bin/modules/installer/remover.pm
@@ -0,0 +1,82 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::remover;
+
+use installer::globals;
+
+############################################
+# Remover
+############################################
+
+sub remove_leading_and_ending_whitespaces
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/^\s*//;
+ $$stringref =~ s/\s*$//;
+}
+
+sub remove_leading_and_ending_quotationmarks
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/^\s*\"//;
+ $$stringref =~ s/\"\s*$//;
+}
+
+sub remove_leading_and_ending_slashes
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/^\s*\///g;
+ $$stringref =~ s/\/\s*$//g;
+}
+
+sub remove_ending_slashes
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/\/\s*$//g;
+}
+
+sub remove_leading_and_ending_pathseparators
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/^\s*\Q$installer::globals::separator\E//;
+ $$stringref =~ s/\Q$installer::globals::separator\E\s*$//;
+}
+
+sub remove_ending_pathseparator
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/\Q$installer::globals::separator\E\s*$//;
+}
+
+1;
diff --git a/solenv/bin/modules/installer/scppatchsoname.pm b/solenv/bin/modules/installer/scppatchsoname.pm
new file mode 100644
index 000000000000..32a142828981
--- /dev/null
+++ b/solenv/bin/modules/installer/scppatchsoname.pm
@@ -0,0 +1,218 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::scppatchsoname;
+
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::setupscript;
+use installer::systemactions;
+
+########################################################################################
+# The length of the new string must be identical with the length of the old string
+########################################################################################
+
+sub change_length_of_string
+{
+ my ($newstringref, $oldstring) = @_;
+
+ while ( length($$newstringref) < length($oldstring) )
+ {
+ $$newstringref = $$newstringref . chr(0);
+ }
+}
+
+########################################################################################
+# The length of the new string must be identical with the length of the old string
+########################################################################################
+
+sub change_length_of_string_with_letter
+{
+ my ($newstringref, $oldstring, $onestring) = @_;
+
+ while ( length($$newstringref) < length($oldstring) )
+ {
+ $$newstringref = $$newstringref . $onestring;
+ }
+}
+
+########################################################################################
+# Converting a string to a unicode string
+########################################################################################
+
+sub convert_to_unicode
+{
+ my ($string) = @_;
+
+ my $unicodestring = "";
+
+ my $stringlength = length($string);
+
+ for ( my $i = 0; $i < $stringlength; $i++ )
+ {
+ $unicodestring = $unicodestring . substr($string, $i, 1);
+ $unicodestring = $unicodestring . chr(0);
+ }
+
+ return $unicodestring;
+}
+
+########################################################################################
+# Replacing the so name in all files with flag PATCH_SO_NAME
+########################################################################################
+
+sub replace_productname_in_file
+{
+ my ($sourcepath, $destpath, $variableshashref, $onefilehash, $styles) = @_;
+
+ my $onefile = installer::files::read_binary_file($sourcepath);
+
+ # searching for "x"
+
+ my $onestring = "x" . chr(0);
+ my $replacestring = "";
+ for ( my $i = 1; $i <= 80; $i++ ) { $replacestring .= $onestring; }
+
+ my $productname = $variableshashref->{'PRODUCTNAME'} . " " . $variableshashref->{'PRODUCTVERSION'};
+ if ( exists($onefilehash->{'FileDescription'}) ) { $productname = $onefilehash->{'FileDescription'}; }
+ my $unicode_productname = convert_to_unicode($productname);
+
+ change_length_of_string(\$unicode_productname, $replacestring);
+
+ my $found1 = $onefile =~ s/$replacestring/$unicode_productname/sg;
+
+ my $found2 = 0;
+
+ if ( $styles =~ /\bPATCH_SO_NAME_Z\b/ )
+ {
+ # searching for "z"
+
+ $onestring = "z" . chr(0);
+ $replacestring = "";
+ for ( my $i = 1; $i <= 80; $i++ ) { $replacestring .= $onestring; }
+
+ my $productname2 = $variableshashref->{'PRODUCTNAME'} . " " . $variableshashref->{'PRODUCTVERSION'};
+ if ( exists($onefilehash->{'FileDescriptionZ'}) ) { $productname2 = $onefilehash->{'FileDescriptionZ'}; }
+ my $unicode_productname2 = convert_to_unicode($productname2);
+
+ change_length_of_string_with_letter(\$unicode_productname2, $replacestring, $onestring);
+
+ $found2 = $onefile =~ s/$replacestring/$unicode_productname2/sg;
+ }
+
+ installer::files::save_binary_file($onefile, $destpath);
+
+ my $found = $found1 + $found2;
+
+ return $found;
+}
+
+#########################################################
+# Analyzing files with flag PATCH_SO_NAME
+#########################################################
+
+sub resolving_patchsoname_flag
+{
+ my ($filesarrayref, $variableshashref, $item, $languagestringref) = @_;
+
+ my $diritem = lc($item);
+
+ my $replacedirbase = installer::systemactions::create_directories("patchsoname_$diritem", $languagestringref);
+
+ installer::logger::include_header_into_logfile("$item with flag PATCH_SO_NAME:");
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $styles = "";
+
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+
+ if ( $styles =~ /\bPATCH_SO_NAME\b/ )
+ {
+ # Language specific subdirectory
+
+ my $onelanguage = $onefile->{'specificlanguage'};
+ my $filedescription = "";
+
+ if ($onelanguage eq "")
+ {
+ $onelanguage = "00"; # files without language into directory "00"
+ }
+
+ my $replacedir = $replacedirbase . $installer::globals::separator . $onelanguage . $installer::globals::separator;
+ installer::systemactions::create_directory($replacedir); # creating language specific directories
+
+ # copy files and edit them with the variables defined in the zip.lst
+
+ my $onefilename = $onefile->{'Name'};
+ my $sourcepath = $onefile->{'sourcepath'};
+ my $destinationpath = $replacedir . $onefilename;
+ my $movepath = $destinationpath . ".orig";
+
+ # if (!(-f $destinationpath)) # do nothing if the file already exists
+ # {
+
+ my $copysuccess = installer::systemactions::copy_one_file($sourcepath, $movepath);
+
+ if ( $copysuccess )
+ {
+ # Now the file can be patch (binary!)
+ my $found = replace_productname_in_file($movepath, $destinationpath, $variableshashref, $onefile, $styles);
+
+ if ($found == 0)
+ {
+ my $infoline = "Did not patch the file $destinationpath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ my $infoline = "Successfully patched $destinationpath, Count: $found\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ # }
+
+ # Saving the original source, where the file was found
+ $onefile->{'originalsourcepath'} = $onefile->{'sourcepath'};
+
+ # Saving the original source, where the file was found
+ $onefile->{'originalsourcepath'} = $onefile->{'sourcepath'};
+
+ # Writing the new sourcepath into the hashref, even if it was no copied
+
+ $onefile->{'sourcepath'} = $destinationpath;
+ }
+ }
+
+ my $infoline = "\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/scpzipfiles.pm b/solenv/bin/modules/installer/scpzipfiles.pm
new file mode 100644
index 000000000000..52dea6032ee1
--- /dev/null
+++ b/solenv/bin/modules/installer/scpzipfiles.pm
@@ -0,0 +1,187 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::scpzipfiles;
+
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::systemactions;
+
+########################################################################################
+# Replacing all zip list variables in setup script and files with flag scpzip_replace
+########################################################################################
+
+sub replace_all_ziplistvariables_in_file
+{
+ my ( $fileref, $variableshashref ) = @_;
+
+ for ( my $i = 0; $i <= $#{$fileref}; $i++ )
+ {
+ my $line = ${$fileref}[$i];
+
+ if ( $line =~ /^.*\$\{\w+\}.*$/ ) # only occurence of ${abc}
+ {
+ my $key;
+
+ foreach $key (keys %{$variableshashref})
+ {
+ my $value = $variableshashref->{$key};
+ $key = '${' . $key . '}';
+ $line =~ s/\Q$key\E/$value/g;
+ ${$fileref}[$i] = $line;
+ }
+ }
+ }
+}
+
+########################################################################################
+# Replacing all zip list variables in rtf files. In rtf files
+# the brackets are masked.
+########################################################################################
+
+sub replace_all_ziplistvariables_in_rtffile
+{
+ my ( $fileref, $variablesref, $onelanguage, $loggingdir ) = @_;
+
+ # installer::files::save_file($loggingdir . "license_" . $onelanguage . "_before.rtf", $fileref);
+
+ for ( my $i = 0; $i <= $#{$fileref}; $i++ )
+ {
+ my $line = ${$fileref}[$i];
+
+ if ( $line =~ /^.*\$\\\{\w+\\\}.*$/ ) # only occurence of $\{abc\}
+ {
+ for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
+ {
+ my $variableline = ${$variablesref}[$j];
+
+ my ($key, $value);
+
+ if ( $variableline =~ /^\s*([\w-]+?)\s+(.*?)\s*$/ )
+ {
+ $key = $1;
+ $value = $2;
+ $key = '$\{' . $key . '\}';
+ }
+
+ $line =~ s/\Q$key\E/$value/g;
+
+ ${$fileref}[$i] = $line;
+ }
+ }
+ }
+
+ # installer::files::save_file($loggingdir . "license_" . $onelanguage . "_after.rtf", $fileref);
+}
+
+#########################################################
+# Analyzing files with flag SCPZIP_REPLACE
+# $item can be "File" or "ScpAction"
+#########################################################
+
+sub resolving_scpzip_replace_flag
+{
+ my ($filesarrayref, $variableshashref, $item, $languagestringref) = @_;
+
+ my $diritem = lc($item);
+
+ my $replacedirbase = installer::systemactions::create_directories("replace_$diritem", $languagestringref);
+
+ installer::logger::include_header_into_logfile("$item with flag SCPZIP:");
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $styles = "";
+
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+
+ if ( $styles =~ /\bSCPZIP_REPLACE\b/ )
+ {
+ # Language specific subdirectory
+
+ my $onelanguage = $onefile->{'specificlanguage'};
+
+ if ($onelanguage eq "")
+ {
+ $onelanguage = "00"; # files without language into directory "00"
+ }
+
+ my $replacedir = $replacedirbase . $installer::globals::separator . $onelanguage . $installer::globals::separator;
+ installer::systemactions::create_directory($replacedir); # creating language specific directories
+
+ # copy files and edit them with the variables defined in the zip.lst
+
+ my $longfilename = 0;
+
+ my $onefilename = $onefile->{'Name'};
+ my $sourcepath = $onefile->{'sourcepath'};
+
+ if ( $onefilename =~ /^\s*\Q$installer::globals::separator\E/ ) # filename begins with a slash, for instance /registry/schema/org/openoffice/VCL.xcs
+ {
+ $onefilename =~ s/^\s*\Q$installer::globals::separator\E//;
+ $longfilename = 1;
+ }
+
+ my $destinationpath = $replacedir . $onefilename;
+ my $movepath = $destinationpath . ".orig";
+
+ if ( $longfilename ) # the destination directory has to be created before copying
+ {
+ my $destdir = $movepath;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$destdir);
+ installer::systemactions::create_directory_structure($destdir);
+ }
+
+ my $copysuccess = installer::systemactions::copy_one_file($sourcepath, $movepath);
+
+ if ( $copysuccess )
+ {
+ # Now the file can be edited
+ # ToDo: How about binary patching?
+
+ my $onefileref = installer::files::read_file($movepath);
+ replace_all_ziplistvariables_in_file($onefileref, $variableshashref);
+ installer::files::save_file($destinationpath ,$onefileref);
+ }
+
+ # Saving the original source, where the file was found
+ $onefile->{'originalsourcepath'} = $onefile->{'sourcepath'};
+
+ # Writing the new sourcepath into the hashref, even if it was no copied
+
+ $onefile->{'sourcepath'} = $destinationpath;
+ }
+ }
+
+ my $infoline = "\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/scriptitems.pm b/solenv/bin/modules/installer/scriptitems.pm
new file mode 100644
index 000000000000..54d22df1e19e
--- /dev/null
+++ b/solenv/bin/modules/installer/scriptitems.pm
@@ -0,0 +1,2944 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::scriptitems;
+
+use installer::converter;
+use installer::existence;
+use installer::exiter;
+use installer::globals;
+use installer::languages;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::remover;
+use installer::systemactions;
+
+################################################################
+# Resolving the GID for the directories defined in setup script
+################################################################
+
+sub resolve_all_directory_names
+{
+ my ($directoryarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::resolve_all_directory_names : $#{$directoryarrayref}"); }
+
+ # After this procedure the hash shall contain the complete language
+ # dependent path, not only the language dependent HostName.
+
+ my ($key, $value, $parentvalue, $parentgid, $parentdirectoryhashref);
+
+ for ( my $i = 0; $i <= $#{$directoryarrayref}; $i++ )
+ {
+ my $directoryhashref = ${$directoryarrayref}[$i];
+ my $gid = $directoryhashref-> {'gid'};
+ my $parentid = $directoryhashref-> {'ParentID'};
+
+ if ( $parentid ne "PREDEFINED_PROGDIR" )
+ {
+ # find the array of the parentid, which has to be defined before in setup script
+ # and is therefore listed before in this array
+
+ for ( my $j = 0; $j <= $i; $j++ )
+ {
+ $parentdirectoryhashref = ${$directoryarrayref}[$j];
+ $parentgid = $parentdirectoryhashref->{'gid'};
+
+ if ( $parentid eq $parentgid)
+ {
+ last;
+ }
+ }
+
+ # and now we can put the path together
+ # But take care of the languages!
+
+ my $dirismultilingual = $directoryhashref->{'ismultilingual'};
+ my $parentismultilingual = $parentdirectoryhashref->{'ismultilingual'};
+
+ # First: Both directories are language independent or both directories are language dependent
+
+ if ((( ! $dirismultilingual ) && ( ! $parentismultilingual )) ||
+ (( $dirismultilingual ) && ( $parentismultilingual )))
+ {
+ foreach $key (keys %{$directoryhashref})
+ {
+ # the key ("HostName (en-US)") must be usable for both hashes
+
+ if ( $key =~ /\bHostName\b/ )
+ {
+ $parentvalue = "";
+ $value = $directoryhashref->{$key};
+ if ( $parentdirectoryhashref->{$key} ) { $parentvalue = $parentdirectoryhashref->{$key}; }
+
+ # It is possible, that in scp project, a directory is defined in more languages than
+ # the directory parent (happened after automatic generation of macros.inc).
+ # Therefore this is checked now and written with a warning into the logfile.
+ # This is no error, because (in most cases) the concerned language is not build.
+
+ if ($parentvalue eq "")
+ {
+ $directoryhashref->{$key} = "FAILURE";
+ my $infoline = "WARNING: No hostname for $parentid with \"$key\". Needed by child directory $gid !\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ }
+ else
+ {
+ $directoryhashref->{$key} = $parentvalue . $installer::globals::separator . $value;
+ }
+ }
+ }
+ }
+
+ # Second: The directory is language dependent, the parent not
+
+ if (( $dirismultilingual ) && ( ! $parentismultilingual ))
+ {
+ $parentvalue = $parentdirectoryhashref->{'HostName'}; # there is only one
+
+ foreach $key (keys %{$directoryhashref}) # the current directory
+ {
+ if ( $key =~ /\bHostName\b/ )
+ {
+ $value = $directoryhashref->{$key};
+ $directoryhashref->{$key} = $parentvalue . $installer::globals::separator . $value;
+ }
+ }
+ }
+
+ # Third: The directory is not language dependent, the parent is language dependent
+
+ if (( ! $dirismultilingual ) && ( $parentismultilingual ))
+ {
+ $value = $directoryhashref->{'HostName'}; # there is only one
+ delete($directoryhashref->{'HostName'});
+
+ foreach $key (keys %{$parentdirectoryhashref}) # the parent directory
+ {
+ if ( $key =~ /\bHostName\b/ )
+ {
+ $parentvalue = $parentdirectoryhashref->{$key}; # there is only one
+ $directoryhashref->{$key} = $parentvalue . $installer::globals::separator . $value;
+ }
+ }
+
+ $directoryhashref->{'ismultilingual'} = 1; # now this directory is also language dependent
+ }
+ }
+ }
+}
+
+#############################################################################
+# Files with flag DELETE_ONLY do not need to be packed into installation set
+#############################################################################
+
+sub remove_delete_only_files_from_productlists
+{
+ my ($productarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_delete_only_files_from_productlists : $#{$productarrayref}"); }
+
+ my @newitems = ();
+
+ for ( my $i = 0; $i <= $#{$productarrayref}; $i++ )
+ {
+ my $oneitem = ${$productarrayref}[$i];
+ my $styles = "";
+
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
+
+ if (!($styles =~ /\bDELETE_ONLY\b/))
+ {
+ push(@newitems, $oneitem);
+ }
+ }
+
+ return \@newitems;
+}
+
+#############################################################################
+# Files with flag NOT_IN_SUITE do not need to be packed into
+# Suite installation sets
+#############################################################################
+
+sub remove_notinsuite_files_from_productlists
+{
+ my ($productarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_notinsuite_files_from_productlists : $#{$productarrayref}"); }
+
+ my @newitems = ();
+
+ for ( my $i = 0; $i <= $#{$productarrayref}; $i++ )
+ {
+ my $oneitem = ${$productarrayref}[$i];
+ my $styles = "";
+
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
+
+ if (!($styles =~ /\bNOT_IN_SUITE\b/))
+ {
+ push(@newitems, $oneitem);
+ }
+ else
+ {
+ my $infoline = "INFO: Flag NOT_IN_SUITE \-\> Removing $oneitem->{'gid'} from file list.\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ }
+ }
+
+ return \@newitems;
+}
+
+#############################################################################
+# Files with flag NOT_IN_SUITE do not need to be packed into
+# Suite installation sets
+#############################################################################
+
+sub remove_office_start_language_files
+{
+ my ($productarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_notinsuite_files_from_productlists : $#{$productarrayref}"); }
+
+ my @newitems = ();
+
+ for ( my $i = 0; $i <= $#{$productarrayref}; $i++ )
+ {
+ my $oneitem = ${$productarrayref}[$i];
+ my $styles = "";
+
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
+
+ if (!($styles =~ /\bSET_OFFICE_LANGUAGE\b/))
+ {
+ push(@newitems, $oneitem);
+ }
+ else
+ {
+ my $infoline = "INFO: Flag SET_OFFICE_LANGUAGE \-\> Removing $oneitem->{'gid'} from file list.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ return \@newitems;
+}
+
+#############################################################################
+# Registryitems for Uninstall have to be removed
+#############################################################################
+
+sub remove_uninstall_regitems_from_script
+{
+ my ($registryarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_uninstall_regitems_from_script : $#{$registryarrayref}"); }
+
+ my @newitems = ();
+
+ for ( my $i = 0; $i <= $#{$registryarrayref}; $i++ )
+ {
+ my $oneitem = ${$registryarrayref}[$i];
+ my $subkey = "";
+
+ if ( $oneitem->{'Subkey'} ) { $subkey = $oneitem->{'Subkey'}; }
+
+ if ( $subkey =~ /Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall/ ) { next; }
+
+ push(@newitems, $oneitem);
+ }
+
+ return \@newitems;
+}
+
+##############################################################################
+# Searching the language module for a specified language
+##############################################################################
+
+sub get_languagespecific_module
+{
+ my ( $lang, $modulestring ) = @_;
+
+ my $langmodulestring = "";
+
+ my $module;
+ foreach $module ( keys %installer::globals::alllangmodules )
+ {
+ if (( $installer::globals::alllangmodules{$module} eq $lang ) && ( $modulestring =~ /\b$module\b/ ))
+ {
+ $langmodulestring = "$langmodulestring,$module";
+ }
+ }
+
+ $langmodulestring =~ s/^\s*,//;
+
+ if ( $langmodulestring eq "" ) { installer::exiter::exit_program("ERROR: No language pack module found for language $lang in string \"$modulestring\"!", "get_languagespecific_module"); }
+
+ return $langmodulestring;
+}
+
+##############################################################################
+# Removing all items in product lists which do not have the correct languages
+##############################################################################
+
+sub resolving_all_languages_in_productlists
+{
+ my ($productarrayref, $languagesarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::resolving_all_languages_in_productlists : $#{$productarrayref} : $#{$languagesarrayref}"); }
+
+ my @itemsinalllanguages = ();
+
+ my ($key, $value);
+
+ for ( my $i = 0; $i <= $#{$productarrayref}; $i++ )
+ {
+ my $oneitem = ${$productarrayref}[$i];
+
+ my $ismultilingual = $oneitem->{'ismultilingual'};
+
+ if (!($ismultilingual)) # nothing to do with single language items
+ {
+ $oneitem->{'specificlanguage'} = "";
+ push(@itemsinalllanguages, $oneitem);
+ }
+ else #all language dependent files
+ {
+ for ( my $j = 0; $j <= $#{$languagesarrayref}; $j++ ) # iterating over all languages
+ {
+ my $onelanguage = ${$languagesarrayref}[$j];
+
+ my %oneitemhash = ();
+
+ foreach $key (keys %{$oneitem})
+ {
+ if ( $key =~ /\(\S+\)/ ) # this are the language dependent keys
+ {
+ if ( $key =~ /\(\Q$onelanguage\E\)/ )
+ {
+ $value = $oneitem->{$key};
+ $oneitemhash{$key} = $value;
+ }
+ }
+ else
+ {
+ $value = $oneitem->{$key};
+ $oneitemhash{$key} = $value;
+ }
+ }
+
+ $oneitemhash{'specificlanguage'} = $onelanguage;
+
+ if ( $oneitemhash{'haslanguagemodule'} )
+ {
+ my $langmodulestring = get_languagespecific_module($onelanguage, $oneitemhash{'modules'});
+ $oneitemhash{'modules'} = $langmodulestring;
+ }
+
+ push(@itemsinalllanguages, \%oneitemhash);
+ }
+ }
+ }
+
+ return \@itemsinalllanguages;
+}
+
+################################################################################
+# Removing all modules, that have the flag LANGUAGEMODULE, but do not
+# have the correct language
+################################################################################
+
+sub remove_not_required_language_modules
+{
+ my ($modulesarrayref, $languagesarrayref) = @_;
+
+ my @allmodules = ();
+
+ for ( my $i = 0; $i <= $#{$modulesarrayref}; $i++ )
+ {
+ my $module = ${$modulesarrayref}[$i];
+ my $styles = "";
+ if ( $module->{'Styles'} ) { $styles = $module->{'Styles'}; }
+
+ if ( $styles =~ /\bLANGUAGEMODULE\b/ )
+ {
+ if ( ! exists($module->{'Language'}) ) { installer::exiter::exit_program("ERROR: \"$module->{'gid'}\" has flag LANGUAGEMODULE, but does not know its language!", "remove_not_required_language_modules"); }
+ my $modulelanguage = $module->{'Language'};
+ # checking, if language is required
+ my $doinclude = 0;
+ for ( my $j = 0; $j <= $#{$languagesarrayref}; $j++ )
+ {
+ my $onelanguage = ${$languagesarrayref}[$j];
+ if ( $onelanguage eq $modulelanguage )
+ {
+ $doinclude = 1;
+ last;
+ }
+ }
+
+ if ( $doinclude ) { push(@allmodules, $module); }
+ }
+ else
+ {
+ push(@allmodules, $module);
+ }
+ }
+
+ return \@allmodules;
+}
+
+################################################################################
+# Removing all modules, that have a spellchecker language that is not
+# required for this product (spellchecker selection).
+# All required spellchecker languages are stored in
+# %installer::globals::spellcheckerlanguagehash
+################################################################################
+
+sub remove_not_required_spellcheckerlanguage_modules
+{
+ my ($modulesarrayref) = @_;
+
+ my $infoline = "";
+ my @allmodules = ();
+
+ for ( my $i = 0; $i <= $#{$modulesarrayref}; $i++ )
+ {
+ my $module = ${$modulesarrayref}[$i];
+ if ( $module->{'Spellcheckerlanguage'} ) # selecting modules with Spellcheckerlanguage
+ {
+ if ( exists($installer::globals::spellcheckerlanguagehash{$module->{'Spellcheckerlanguage'}}) )
+ {
+ push(@allmodules, $module);
+ }
+ else
+ {
+ $infoline = "Spellchecker selection: Removing module $module->{'gid'}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Collecting all files at modules that are removed
+
+ if ( $module->{'Files'} )
+ {
+ if ( $module->{'Files'} =~ /^\s*\((.*?)\)\s*$/ )
+ {
+ my $filelist = $1;
+
+ my $filelisthash = installer::converter::convert_stringlist_into_hash(\$filelist, ",");
+ foreach my $onefile ( keys %{$filelisthash} ) { $installer::globals::spellcheckerfilehash{$onefile} = 1; }
+ }
+ }
+ }
+ }
+ else
+ {
+ push(@allmodules, $module);
+ }
+ }
+
+ return \@allmodules;
+}
+
+################################################################################
+# Removing all modules, that belong to a module that was removed
+# in "remove_not_required_spellcheckerlanguage_modules" because of the
+# spellchecker language. The files belonging to the modules are collected
+# in %installer::globals::spellcheckerfilehash.
+################################################################################
+
+sub remove_not_required_spellcheckerlanguage_files
+{
+ my ($filesarrayref) = @_;
+
+ my @filesarray = ();
+ my $infoline = "";
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ if ( exists($installer::globals::spellcheckerfilehash{$onefile->{'gid'}}) )
+ {
+ $infoline = "Spellchecker selection: Removing file $onefile->{'gid'}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ next;
+ }
+ push(@filesarray, $onefile);
+ }
+
+ return \@filesarray;
+}
+
+################################################################################
+# Looking for directories without correct HostName
+################################################################################
+
+sub checking_directories_with_corrupt_hostname
+{
+ my ($dirsref, $languagesarrayref) = @_;
+
+ for ( my $i = 0; $i <= $#{$dirsref}; $i++ )
+ {
+ my $onedir = ${$dirsref}[$i];
+
+ my $hostname = "";
+
+ if ( $onedir->{'HostName'} ) { $hostname = $onedir->{'HostName'}; }
+
+ if ( $hostname eq "" )
+ {
+ my $langstring = "";
+ for ( my $j = 0; $j <= $#{$languagesarrayref}; $j++ ) { $langstring .= ${$languagesarrayref}[$j] . " "; }
+ installer::exiter::exit_program("ERROR: HostName not defined for $onedir->{'gid'} for specified language. Probably you wanted to create an installation set, in a language not defined in scp2 project. You selected the following language(s): $langstring", "checking_directories_with_corrupt_hostname");
+ }
+
+ if ( $hostname eq "FAILURE" )
+ {
+ installer::exiter::exit_program("ERROR: Could not create HostName for $onedir->{'gid'} (missing language at parent). See logfile warning for more info!", "checking_directories_with_corrupt_hostname");
+ }
+ }
+}
+
+################################################################################
+# Setting global properties
+################################################################################
+
+sub set_global_directory_hostnames
+{
+ my ($dirsref, $allvariables) = @_;
+
+ for ( my $i = 0; $i <= $#{$dirsref}; $i++ )
+ {
+ my $onedir = ${$dirsref}[$i];
+ my $styles = "";
+ if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; }
+
+ if ( $styles =~ /\bOFFICEDIRECTORY\b/ )
+ {
+ $installer::globals::officedirhostname = $onedir->{'HostName'};
+ $installer::globals::officedirgid = $onedir->{'gid'};
+ $allvariables->{'OFFICEDIRECTORYHOSTNAME'} = $installer::globals::officedirhostname;
+ }
+ if ( $styles =~ /\bSUNDIRECTORY\b/ )
+ {
+ $installer::globals::sundirhostname = $onedir->{'HostName'};
+ $installer::globals::sundirgid = $onedir->{'gid'};
+ $allvariables->{'SUNDIRECTORYHOSTNAME'} = $installer::globals::sundirhostname;
+ }
+ }
+}
+
+########################################################
+# Recursively defined procedure to order
+# modules and directories
+########################################################
+
+sub get_children
+{
+ my ($allitems, $startparent, $newitemorder) = @_;
+
+ for ( my $i = 0; $i <= $#{$allitems}; $i++ )
+ {
+ my $gid = ${$allitems}[$i]->{'gid'};
+ my $parent = "";
+ if ( ${$allitems}[$i]->{'ParentID'} ) { $parent = ${$allitems}[$i]->{'ParentID'}; }
+
+ if ( $parent eq $startparent )
+ {
+ push(@{$newitemorder}, ${$allitems}[$i]);
+ my $parent = $gid;
+ get_children($allitems, $parent, $newitemorder); # recursive!
+ }
+ }
+}
+
+################################################################################
+# Using different HostName for language packs
+################################################################################
+
+sub use_langpack_hostname
+{
+ my ($dirsref) = @_;
+
+ for ( my $i = 0; $i <= $#{$dirsref}; $i++ )
+ {
+ my $onedir = ${$dirsref}[$i];
+ if (( $onedir->{'LangPackHostName'} ) && ( $onedir->{'LangPackHostName'} ne "" )) { $onedir->{'HostName'} = $onedir->{'LangPackHostName'}; }
+ }
+}
+
+################################################################################
+# Using different HostName for language packs
+################################################################################
+
+sub use_patch_hostname
+{
+ my ($dirsref) = @_;
+
+ for ( my $i = 0; $i <= $#{$dirsref}; $i++ )
+ {
+ my $onedir = ${$dirsref}[$i];
+ if (( $onedir->{'PatchHostName'} ) && ( $onedir->{'PatchHostName'} ne "" )) { $onedir->{'HostName'} = $onedir->{'PatchHostName'}; }
+ }
+}
+
+################################################################################
+# Using different HostName for language packs
+################################################################################
+
+sub use_langpack_copy_scpaction
+{
+ my ($scpactionsref) = @_;
+
+ for ( my $i = 0; $i <= $#{$scpactionsref}; $i++ )
+ {
+ my $onescpaction = ${$scpactionsref}[$i];
+ if (( $onescpaction->{'LangPackCopy'} ) && ( $onescpaction->{'LangPackCopy'} ne "" )) { $onescpaction->{'Copy'} = $onescpaction->{'LangPackCopy'}; }
+ }
+}
+
+################################################################################
+# Using different HostName for language packs
+################################################################################
+
+sub use_patch_copy_scpaction
+{
+ my ($scpactionsref) = @_;
+
+ for ( my $i = 0; $i <= $#{$scpactionsref}; $i++ )
+ {
+ my $onescpaction = ${$scpactionsref}[$i];
+ if (( $onescpaction->{'PatchCopy'} ) && ( $onescpaction->{'PatchCopy'} ne "" )) { $onescpaction->{'Copy'} = $onescpaction->{'PatchCopy'}; }
+ }
+}
+
+################################################################################
+# Shifting parent directories of URE and Basis layer, so that
+# these directories are located below the Brand layer.
+# Style: SHIFT_BASIS_INTO_BRAND_LAYER
+################################################################################
+
+sub shift_basis_directory_parents
+{
+ my ($dirsref) = @_;
+
+ my @alldirs = ();
+ my @savedirs = ();
+ my @shifteddirs = ();
+
+ my $officedirgid = "";
+
+ for ( my $i = 0; $i <= $#{$dirsref}; $i++ )
+ {
+ my $onedir = ${$dirsref}[$i];
+ my $styles = "";
+ if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; }
+
+ if ( $styles =~ /\bOFFICEDIRECTORY\b/ ) { $officedirgid = $onedir->{'gid'}; }
+ }
+
+ if ( $officedirgid ne "" )
+ {
+ for ( my $i = 0; $i <= $#{$dirsref}; $i++ )
+ {
+ my $onedir = ${$dirsref}[$i];
+ my $styles = "";
+ if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; }
+
+ if (( $styles =~ /\bBASISDIRECTORY\b/ ) || ( $styles =~ /\bUREDIRECTORY\b/ ))
+ {
+ $onedir->{'ParentID'} = $officedirgid;
+ }
+ }
+
+ # Sorting directories
+ my $startgid = "PREDEFINED_PROGDIR";
+ get_children($dirsref, $startgid, \@alldirs);
+ }
+
+ return \@alldirs;
+}
+
+################################################################################
+# Setting the name of the directory with style OFFICEDIRECTORY.
+# The name can be defined in property OFFICEDIRECTORYNAME.
+################################################################################
+
+sub set_officedirectory_name
+{
+ my ($dirsref, $officedirname) = @_;
+
+ for ( my $i = 0; $i <= $#{$dirsref}; $i++ )
+ {
+ my $onedir = ${$dirsref}[$i];
+ my $styles = "";
+ if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; }
+ if ( $styles =~ /\bOFFICEDIRECTORY\b/ )
+ {
+ $onedir->{'HostName'} = $officedirname;
+ last;
+ }
+ }
+}
+
+################################################################################
+# Simplifying the name for language dependent items from "Name (xy)" to "Name"
+################################################################################
+
+sub changing_name_of_language_dependent_keys
+{
+ my ($itemsarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::changing_name_of_language_dependent_keys : $#{$itemsarrayref}"); }
+
+ # Changing key for multilingual items from "Name ( )" to "Name" or "HostName ( )" to "HostName"
+
+ for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemsarrayref}[$i];
+ my $onelanguage = $oneitem->{'specificlanguage'};
+
+ if (!($onelanguage eq "" )) # language dependent item
+ {
+ my $itemkey;
+
+ foreach $itemkey (keys %{$oneitem})
+ {
+ if ( $itemkey =~ /^\s*(\S+?)\s+\(\S+\)\s*$/ )
+ {
+ my $newitemkey = $1;
+ my $itemvalue = $oneitem->{$itemkey};
+ $oneitem->{$newitemkey} = $itemvalue;
+ delete($oneitem->{$itemkey});
+ }
+ }
+ }
+ }
+}
+
+################################################################################
+# Collecting language specific names for language packs
+################################################################################
+
+sub collect_language_specific_names
+{
+ my ($itemsarrayref) = @_;
+
+ for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemsarrayref}[$i];
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
+
+ if ( $styles =~ /\bUSELANGUAGENAME\b/ )
+ {
+ my $language = "";
+ if ( $oneitem->{'Language'} ) { $language = $oneitem->{'Language'}; }
+ my $specificlanguage = "";
+ if ( $oneitem->{'specificlanguage'} ) { $specificlanguage = $oneitem->{'specificlanguage'}; }
+
+ if (( $language ne "" ) && ( $language eq $specificlanguage ))
+ {
+ if (! installer::existence::exists_in_array($oneitem->{'Name'}, \@installer::globals::languagenames ))
+ {
+ push(@installer::globals::languagenames, $oneitem->{'Name'});
+ }
+ }
+ }
+ }
+}
+
+################################################################################
+# Replacement of setup variables in ConfigurationItems and ProfileItems
+# <productkey>, <buildid>, <sequence_languages>, <productcode>, <upgradecode>, <productupdate>
+################################################################################
+
+sub replace_setup_variables
+{
+ my ($itemsarrayref, $languagestringref, $hashref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::replace_setup_variables : $#{$itemsarrayref} : $$languagestringref : $hashref->{'PRODUCTNAME'}"); }
+
+ my $languagesstring = $$languagestringref;
+ $languagesstring =~ s/\_/ /g; # replacing underscore with whitespace
+ # $languagesstring is "01 49" instead of "en-US de"
+ installer::languages::fake_languagesstring(\$languagesstring);
+
+ my $productname = $hashref->{'PRODUCTNAME'};
+ my $productversion = $hashref->{'PRODUCTVERSION'};
+ my $userdirproductversion = "";
+ if ( $hashref->{'USERDIRPRODUCTVERSION'} ) { $userdirproductversion = $hashref->{'USERDIRPRODUCTVERSION'}; }
+ my $productkey = $productname . " " . $productversion;
+
+ # string $buildid, which is used to replace the setup variable <buildid>
+
+ my $localminor = "flat";
+ if ( $installer::globals::minor ne "" ) { $localminor = $installer::globals::minor; }
+ else { $localminor = $installer::globals::lastminor; }
+
+ my $localbuild = $installer::globals::build;
+
+ if ( $localbuild =~ /^\s*(\w+?)(\d+)\s*$/ ) { $localbuild = $2; } # using "680" instead of "src680"
+
+ my $buildidstring = $localbuild . $localminor . "(Build:" . $installer::globals::buildid . ")";
+
+ # the environment variable CWS_WORK_STAMP is set only in CWS
+ if ( $ENV{'CWS_WORK_STAMP'} ) { $buildidstring = $buildidstring . "\[CWS\:" . $ENV{'CWS_WORK_STAMP'} . "\]"; }
+
+ if ( $localminor =~ /^\s*\w(\d+)\w*\s*$/ ) { $localminor = $1; }
+
+ # $updateid
+ my $updateid = $productname . "_" . $userdirproductversion . "_" . $$languagestringref;
+ $updateid =~ s/ /_/g;
+
+ for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemsarrayref}[$i];
+ my $value = $oneitem->{'Value'};
+
+ $value =~ s/\<buildid\>/$buildidstring/;
+ $value =~ s/\<sequence_languages\>/$languagesstring/;
+ $value =~ s/\<productkey\>/$productkey/;
+ $value =~ s/\<productcode\>/$installer::globals::productcode/;
+ $value =~ s/\<upgradecode\>/$installer::globals::upgradecode/;
+ $value =~ s/\<alllanguages\>/$languagesstring/;
+ $value =~ s/\<productmajor\>/$localbuild/;
+ $value =~ s/\<productminor\>/$localminor/;
+ $value =~ s/\<productbuildid\>/$installer::globals::buildid/;
+ $value =~ s/\<sourceid\>/$installer::globals::build/;
+ $value =~ s/\<updateid\>/$updateid/;
+ $value =~ s/\<pkgformat\>/$installer::globals::packageformat/;
+
+ $oneitem->{'Value'} = $value;
+ }
+}
+
+################################################################################
+# By defining variable LOCALUSERDIR in *.lst it is possible to change
+# the standard destination of user directory defined in scp2 ($SYSUSERCONFIG).
+################################################################################
+
+sub replace_userdir_variable
+{
+ my ($itemsarrayref) = @_;
+
+ my $userdir = "";
+ if ( $allvariableshashref->{'LOCALUSERDIR'} ) { $userdir = $allvariableshashref->{'LOCALUSERDIR'}; }
+ else { $userdir = $installer::globals::simpledefaultuserdir; }
+
+ if ( $userdir ne "" )
+ {
+ for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemsarrayref}[$i];
+ $oneitem->{'Value'} =~ s/\$SYSUSERCONFIG/$userdir/;
+ }
+ }
+}
+
+#####################################################################################
+# Files and ConfigurationItems are not included for all languages.
+# For instance asian fonts. These can be removed, if no "Name" is found.
+# ConfigurationItems are not always defined in the linguistic configuration file.
+# The "Key" cannot be found for them.
+#####################################################################################
+
+sub remove_non_existent_languages_in_productlists
+{
+ my ($itemsarrayref, $languagestringref, $searchkey, $itemtype) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_non_existent_languages_in_productlists : $#{$itemsarrayref} : $$languagestringref : $searchkey : $itemtype"); }
+
+ # Removing of all non existent files, for instance asian fonts
+
+ installer::logger::include_header_into_logfile("Removing for this language $$languagestringref:");
+
+ my @allexistentitems = ();
+
+ my $infoline;
+
+ for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemsarrayref}[$i];
+ my $oneitemname = ""; # $searchkey is "Name" for files and "Key" for ConfigurationItems
+
+ if ( $oneitem->{$searchkey} ) { $oneitemname = $oneitem->{$searchkey} }
+
+ my $itemtoberemoved = 0;
+
+ if ($oneitemname eq "") # for instance asian font in english installation set
+ {
+ $itemtoberemoved = 1;
+ }
+
+ if ($itemtoberemoved)
+ {
+ $infoline = "WARNING: Language $$languagestringref: No $itemtype packed for $oneitem->{'gid'}!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ push(@allexistentitems, $oneitem);
+ }
+ }
+
+ $infoline = "\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return \@allexistentitems;
+}
+
+########################################################################
+# Input is the directory gid, output the "HostName" of the directory
+########################################################################
+
+sub get_Directoryname_From_Directorygid
+{
+ my ($dirsarrayref ,$searchgid, $onelanguage, $oneitemgid) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_Directoryname_From_Directorygid : $#{$dirsarrayref} : $searchgid : $onelanguage"); }
+
+ my $directoryname = "";
+ my $onedirectory;
+ my $foundgid = 0;
+
+ for ( my $i = 0; $i <= $#{$dirsarrayref}; $i++ )
+ {
+ $onedirectory = ${$dirsarrayref}[$i];
+ my $directorygid = $onedirectory->{'gid'};
+
+ if ($directorygid eq $searchgid)
+ {
+ $foundgid = 1;
+ last;
+ }
+ }
+
+ if (!($foundgid))
+ {
+ installer::exiter::exit_program("ERROR: Gid $searchgid not defined in $installer::globals::setupscriptname", "get_Directoryname_From_Directorygid");
+ }
+
+ if ( ! ( $onedirectory->{'ismultilingual'} )) # the directory is not language dependent
+ {
+ $directoryname = $onedirectory->{'HostName'};
+ }
+ else
+ {
+ $directoryname = $onedirectory->{"HostName ($onelanguage)"};
+ }
+
+ # gid_Dir_Template_Wizard_Letter is defined as language dependent directory, but the file gid_Dir_Template_Wizard_Letter
+ # is not language dependent. Therefore $onelanguage is not defined. But which language is the correct language for the
+ # directory?
+ # Perhaps better solution: In scp it must be forbidden to have a language independent file in a language dependent directory.
+
+ if (( ! $directoryname ) && ( $onelanguage eq "" ))
+ {
+ installer::exiter::exit_program("ERROR (in scp): Directory $searchgid is language dependent, but not $oneitemgid inside this directory", "get_Directoryname_From_Directorygid");
+ }
+
+ return \$directoryname;
+}
+
+##################################################################
+# Getting destination direcotory for links, files and profiles
+##################################################################
+
+sub get_Destination_Directory_For_Item_From_Directorylist # this is used for Files, Profiles and Links
+{
+ my ($itemarrayref, $dirsarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_Destination_Directory_For_Item_From_Directorylist : $#{$itemarrayref} : $#{$dirsarrayref}"); }
+
+ for ( my $i = 0; $i <= $#{$itemarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemarrayref}[$i];
+ my $oneitemgid = $oneitem->{'gid'};
+ my $directorygid = $oneitem->{'Dir'}; # for instance gid_Dir_Program
+ my $netdirectorygid = "";
+ my $onelanguage = $oneitem->{'specificlanguage'};
+ my $ispredefinedprogdir = 0;
+ my $ispredefinedconfigdir = 0;
+
+ my $oneitemname = $oneitem->{'Name'};
+
+ if ( $oneitem->{'NetDir'} ) { $netdirectorygid = $oneitem->{'NetDir'}; }
+
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$oneitemname); # making /registry/schema/org/openoffice/VCL.xcs to VCL.xcs
+
+ my $searchdirgid;
+
+ if ( $netdirectorygid eq "" ) # if NetDir is defined, it is privileged
+ {
+ $searchdirgid = $directorygid
+ }
+ else
+ {
+ $searchdirgid = $netdirectorygid
+ }
+
+ if ($searchdirgid =~ /PREDEFINED_PROGDIR/) # the root directory is not defined in setup script
+ {
+ $ispredefinedprogdir = 1;
+ }
+
+ if ($searchdirgid =~ /PREDEFINED_CONFIGDIR/) # the root directory is not defined in setup script
+ {
+ $ispredefinedconfigdir = 1;
+ }
+
+ my $destfilename;
+
+ if ((!( $ispredefinedprogdir )) && (!( $ispredefinedconfigdir )))
+ {
+ my $directorynameref = get_Directoryname_From_Directorygid($dirsarrayref, $searchdirgid, $onelanguage, $oneitemgid);
+ $destfilename = $$directorynameref . $installer::globals::separator . $oneitemname;
+ }
+ else
+ {
+ $destfilename = $oneitemname;
+ }
+
+ $oneitem->{'destination'} = $destfilename;
+ }
+}
+
+##########################################################################
+# Searching a file in a list of pathes
+##########################################################################
+
+sub get_sourcepath_from_filename_and_includepath_classic
+{
+ my ($searchfilenameref, $includepatharrayref, $write_logfile) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic : $$searchfilenameref : $#{$includepatharrayref} : $write_logfile"); }
+
+ my ($onefile, $includepath, $infoline);
+
+ my $foundsourcefile = 0;
+
+ for ( my $j = 0; $j <= $#{$includepatharrayref}; $j++ )
+ {
+ $includepath = ${$includepatharrayref}[$j];
+ installer::remover::remove_leading_and_ending_whitespaces(\$includepath);
+
+ $onefile = $includepath . $installer::globals::separator . $$searchfilenameref;
+
+ if ( -f $onefile )
+ {
+ $foundsourcefile = 1;
+ last;
+ }
+ }
+
+ if (!($foundsourcefile))
+ {
+ $onefile = ""; # the sourcepath has to be empty
+ if ( $write_logfile)
+ {
+ if ( $ENV{'DEFAULT_TO_ENGLISH_FOR_PACKING'} )
+ {
+ $infoline = "WARNING: Source for $$searchfilenameref not found!\n"; # Important message in log file
+ }
+ else
+ {
+ $infoline = "ERROR: Source for $$searchfilenameref not found!\n"; # Important message in log file
+ }
+
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ else
+ {
+ if ( $write_logfile)
+ {
+ $infoline = "SUCCESS: Source for $$searchfilenameref: $onefile\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ return \$onefile;
+}
+
+##########################################################################
+# Input is one file name, output the complete absolute path of this file
+##########################################################################
+
+sub get_sourcepath_from_filename_and_includepath
+{
+ my ($searchfilenameref, $unused, $write_logfile) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_sourcepath_from_filename_and_includepath : $$searchfilenameref : $#{$includepatharrayref} : $write_logfile"); }
+
+ my ($onefile, $includepath, $infoline);
+
+ my $foundsourcefile = 0;
+ my $foundnewname = 0;
+
+ for ( my $j = 0; $j <= $#installer::globals::allincludepathes; $j++ )
+ {
+ my $allfiles = $installer::globals::allincludepathes[$j];
+
+ if ( exists( $allfiles->{$$searchfilenameref} ))
+ {
+ $onefile = $allfiles->{'includepath'} . $installer::globals::separator . $$searchfilenameref;
+ $foundsourcefile = 1;
+ last;
+ }
+ }
+
+ if (!($foundsourcefile)) # testing with lowercase filename
+ {
+ # Attention: README01.html is copied for Windows to readme01.html, not case sensitive
+
+ for ( my $j = 0; $j <= $#installer::globals::allincludepathes; $j++ )
+ {
+ my $allfiles = $installer::globals::allincludepathes[$j];
+
+ my $newfilename = $$searchfilenameref;
+ $newfilename =~ s/readme/README/; # special handling for readme files
+ $newfilename =~ s/license/LICENSE/; # special handling for license files
+
+ if ( exists( $allfiles->{$newfilename} ))
+ {
+ $onefile = $allfiles->{'includepath'} . $installer::globals::separator . $newfilename;
+ $foundsourcefile = 1;
+ $foundnewname = 1;
+ last;
+ }
+ }
+ }
+
+ if (!($foundsourcefile))
+ {
+ $onefile = ""; # the sourcepath has to be empty
+ if ( $write_logfile)
+ {
+ if ( $ENV{'DEFAULT_TO_ENGLISH_FOR_PACKING'} )
+ {
+ $infoline = "WARNING: Source for $$searchfilenameref not found!\n"; # Important message in log file
+ }
+ else
+ {
+ $infoline = "ERROR: Source for $$searchfilenameref not found!\n"; # Important message in log file
+ }
+
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ else
+ {
+ if ( $write_logfile)
+ {
+ if (!($foundnewname))
+ {
+ $infoline = "SUCCESS: Source for $$searchfilenameref: $onefile\n";
+ }
+ else
+ {
+ $infoline = "SUCCESS/WARNING: Special handling for $$searchfilenameref: $onefile\n";
+ }
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ return \$onefile;
+}
+
+##############################################################
+# Determining, whether a specified directory is language
+# dependent
+##############################################################
+
+sub determine_directory_language_dependency
+{
+ my($directorygid, $dirsref) = @_;
+
+ my $is_multilingual = 0;
+
+ for ( my $i = 0; $i <= $#{$dirsref}; $i++ )
+ {
+ my $onedir = ${$dirsref}[$i];
+ my $gid = $onedir->{'gid'};
+
+ if ( $gid eq $directorygid )
+ {
+ $is_multilingual = $onedir->{'ismultilingual'};
+ last;
+ }
+ }
+
+ return $is_multilingual;
+}
+
+##############################################################
+# Getting all source pathes for all files to be packed
+# $item can be "Files" or "ScpActions"
+##############################################################
+
+sub get_Source_Directory_For_Files_From_Includepathlist
+{
+ my ($filesarrayref, $includepatharrayref, $dirsref, $item) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_Source_Directory_For_Files_From_Includepathlist : $#{$filesarrayref} : $#{$includepatharrayref} : $item"); }
+
+ installer::logger::include_header_into_logfile("$item:");
+
+ my $infoline = "";
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $onelanguage = $onefile->{'specificlanguage'};
+
+ if ( ! $onefile->{'Name'} ) { installer::exiter::exit_program("ERROR: $item without name ! GID: $onefile->{'gid'} ! Language: $onelanguage", "get_Source_Directory_For_Files_From_Includepathlist"); }
+
+ my $onefilename = $onefile->{'Name'};
+ if ( $item eq "ScpActions" ) { $onefilename =~ s/\//$installer::globals::separator/g; }
+ $onefilename =~ s/^\s*\Q$installer::globals::separator\E//; # filename begins with a slash, for instance /registry/schema/org/openoffice/VCL.xcs
+
+ my $styles = "";
+ my $file_can_miss = 0;
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+ if ( $styles =~ /\bFILE_CAN_MISS\b/ ) { $file_can_miss = 1; }
+
+ if (( $installer::globals::languagepack ) && ( ! $onefile->{'ismultilingual'} ) && ( ! ( $styles =~ /\bFORCELANGUAGEPACK\b/ ))) { $file_can_miss = 1; }
+
+ my $sourcepathref = "";
+
+ if ( $file_can_miss ) { $sourcepathref = get_sourcepath_from_filename_and_includepath(\$onefilename, $includepatharrayref, 0); }
+ else { $sourcepathref = get_sourcepath_from_filename_and_includepath(\$onefilename, $includepatharrayref, 1); }
+
+ $onefile->{'sourcepath'} = $$sourcepathref; # This $$sourcepathref is empty, if no source was found
+
+ # defaulting to english for multilingual files if DEFAULT_TO_ENGLISH_FOR_PACKING is set
+
+ if ( $ENV{'DEFAULT_TO_ENGLISH_FOR_PACKING'} )
+ {
+ if (( ! $onefile->{'sourcepath'} ) && ( $onefile->{'ismultilingual'} ))
+ {
+ my $oldname = $onefile->{'Name'};
+ my $oldlanguage = $onefile->{'specificlanguage'};
+ my $newlanguage = "en-US";
+ # $onefile->{'Name'} =~ s/$oldlanguage\./$newlanguage\./; # Example: tplwizfax_it.zip -> tplwizfax_en-US.zip
+ $onefilename = $onefile->{'Name'};
+ $onefilename =~ s/$oldlanguage\./$newlanguage\./; # Example: tplwizfax_it.zip -> tplwizfax_en-US.zip
+ $onefilename =~ s/^\s*\Q$installer::globals::separator\E//; # filename begins with a slash, for instance /registry/schema/org/openoffice/VCL.xcs
+ $sourcepathref = get_sourcepath_from_filename_and_includepath(\$onefilename, $includepatharrayref, 1);
+ $onefile->{'sourcepath'} = $$sourcepathref; # This $$sourcepathref is empty, if no source was found
+
+ if ($onefile->{'sourcepath'}) # defaulting to english was successful
+ {
+ $infoline = "WARNING: Using $onefilename instead of $oldname\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ print " $infoline";
+ # if ( $onefile->{'destination'} ) { $onefile->{'destination'} =~ s/\Q$oldname\E/$onefile->{'Name'}/; }
+
+ # If the directory, in which the new file is installed, is not language dependent,
+ # the filename has to be changed to avoid installation conflicts
+ # No mechanism for resource files!
+ # -> implementing for the content of ARCHIVE files
+
+ if ( $onefile->{'Styles'} =~ /\bARCHIVE\b/ )
+ {
+ my $directorygid = $onefile->{'Dir'};
+ my $islanguagedependent = determine_directory_language_dependency($directorygid, $dirsref);
+
+ if ( ! $islanguagedependent )
+ {
+ $onefile->{'Styles'} =~ s/\bARCHIVE\b/ARCHIVE, RENAME_TO_LANGUAGE/; # Setting new flag RENAME_TO_LANGUAGE
+ $infoline = "Setting flag RENAME_TO_LANGUAGE: File $onefile->{'Name'} in directory: $directorygid\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+ else
+ {
+ $infoline = "WARNING: Using $onefile->{'Name'} instead of $oldname was not successful\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $onefile->{'Name'} = $oldname; # Switching back to old file name
+ }
+ }
+ }
+ }
+
+ $infoline = "\n"; # empty line after listing of all files
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+#################################################################################
+# Removing files, that shall not be included into languagepacks
+# (because of rpm conflicts)
+#################################################################################
+
+sub remove_Files_For_Languagepacks
+{
+ my ($itemsarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_Files_For_Languagepacks : $#{$filesarrayref}"); }
+
+ my $infoline;
+
+ my @newitemsarray = ();
+
+ for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemsarrayref}[$i];
+ my $gid = $oneitem->{'gid'};
+
+ # scp Todo: Remove asap after removal of old setup
+
+ if (( $gid eq "gid_File_Extra_Fontunxpsprint" ) ||
+ ( $gid eq "gid_File_Extra_Migration_Lang" ))
+ {
+ $infoline = "ATTENTION: Removing item $oneitem->{'gid'} from the installation set.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ next;
+ }
+
+ push(@newitemsarray, $oneitem);
+ }
+
+ return \@newitemsarray;
+}
+
+#################################################################################
+# Files, whose source directory is not found, are removed now (this is an ERROR)
+#################################################################################
+
+sub remove_Files_Without_Sourcedirectory
+{
+ my ($filesarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_Files_Without_Sourcedirectory : $#{$filesarrayref}"); }
+
+ my $infoline;
+
+ my $error_occured = 0;
+ my @missingfiles = ();
+ push(@missingfiles, "ERROR: The following files could not be found: \n");
+
+ my @newfilesarray = ();
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $sourcepath = $onefile->{'sourcepath'};
+
+ if ($sourcepath eq "")
+ {
+ my $styles = $onefile->{'Styles'};
+ my $filename = $onefile->{'Name'};
+
+ if ( ! $installer::globals::languagepack )
+ {
+ $infoline = "ERROR: Removing file $filename from file list.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ push(@missingfiles, "ERROR: File not found: $filename\n");
+ $error_occured = 1;
+
+ next; # removing this file from list, if sourcepath is empty
+ }
+ else # special case for language packs
+ {
+ if (( $onefile->{'ismultilingual'} ) || ( $styles =~ /\bFORCELANGUAGEPACK\b/ ))
+ {
+ $infoline = "ERROR: Removing file $filename from file list.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ push(@missingfiles, "ERROR: File not found: $filename\n");
+ $error_occured = 1;
+
+ next; # removing this file from list, if sourcepath is empty
+ }
+ else
+ {
+ $infoline = "INFO: Removing file $filename from file list. It is not language dependent.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "INFO: It is not language dependent and can be ignored in language packs.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ next; # removing this file from list, if sourcepath is empty
+ }
+ }
+ }
+
+ push(@newfilesarray, $onefile);
+ }
+
+ $infoline = "\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $error_occured )
+ {
+ for ( my $i = 0; $i <= $#missingfiles; $i++ ) { print "$missingfiles[$i]"; }
+ installer::exiter::exit_program("ERROR: Missing files", "remove_Files_Without_Sourcedirectory");
+ }
+
+ return \@newfilesarray;
+}
+
+############################################################################
+# License and Readme files in the default language have to be installed
+# in the directory with flag OFFICEDIRECTORY. If this is not defined
+# they have to be installed in the installation root.
+############################################################################
+
+sub get_office_directory_gid_and_hostname
+{
+ my ($dirsarrayref) = @_;
+
+ my $foundofficedir = 0;
+ my $gid = "";
+ my $hostname = "";
+
+ for ( my $i = 0; $i <= $#{$dirsarrayref}; $i++ )
+ {
+ my $onedir = ${$dirsarrayref}[$i];
+ if ( $onedir->{'Styles'} )
+ {
+ my $styles = $onedir->{'Styles'};
+
+ if ( $styles =~ /\bOFFICEDIRECTORY\b/ )
+ {
+ $foundofficedir = 1;
+ $gid = $onedir->{'gid'};
+ $hostname = $onedir->{'HostName'};
+ last;
+ }
+ }
+ }
+
+ return ($foundofficedir, $gid, $hostname);
+}
+
+############################################################################
+# License and Readme files in the default language have to be installed
+# in the installation root (next to the program dir). This is in scp
+# project done by a post install basic script
+############################################################################
+
+sub add_License_Files_into_Installdir
+{
+ my ($filesarrayref, $dirsarrayref, $languagesarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::add_License_Files_into_Installdir : $#{$filesarrayref} : $#{$languagesarrayref}"); }
+
+ my $infoline;
+
+ my @newfilesarray = ();
+
+ my $defaultlanguage = installer::languages::get_default_language($languagesarrayref);
+
+ my ($foundofficedir, $officedirectorygid, $officedirectoryhostname) = get_office_directory_gid_and_hostname($dirsarrayref);
+
+ # copy all files from directory share/readme, that contain the default language in their name
+ # without default language into the installation root. This makes the settings of the correct
+ # file names superfluous. On the other hand this requires a dependency to the directory
+ # share/readme
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $destination = $onefile->{'destination'};
+ my $styles = "";
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+
+ if ( ( $destination =~ /share\Q$installer::globals::separator\Ereadme\Q$installer::globals::separator\E(\w+?)_?$defaultlanguage\.?(\w*)\s*/ )
+ || (( $styles =~ /\bROOTLICENSEFILE\b/ ) && ( $destination =~ /\Q$installer::globals::separator\E?(\w+?)_?$defaultlanguage\.?(\w*?)\s*$/ )) )
+ {
+ my $filename = $1;
+ my $extension = $2;
+
+ my $newfilename;
+
+ if ( $extension eq "" ) { $newfilename = $filename; }
+ else { $newfilename = $filename . "\." . $extension; }
+
+ my %newfile = ();
+ my $newfile = \%newfile;
+
+ installer::converter::copy_item_object($onefile, $newfile);
+
+ $newfile->{'gid'} = $onefile->{'gid'} . "_Copy";
+ $newfile->{'Name'} = $newfilename;
+ $newfile->{'ismultilingual'} = "0";
+ $newfile->{'specificlanguage'} = "";
+ $newfile->{'haslanguagemodule'} = "0";
+
+ if ( defined $newfile->{'InstallName'} )
+ {
+ if ( $newfile->{'InstallName'} =~ /^\s*(.*?)_$defaultlanguage\.?(\w*?)\s*$/ )
+ {
+ my $localfilename = $1;
+ my $localextension = $2;
+
+ if ( $localextension eq "" ) { $newfile->{'InstallName'} = $localfilename; }
+ else { $newfile->{'InstallName'} = $localfilename . "\." . $localextension; }
+ }
+ }
+
+ $newfile->{'removelangfromfile'} = "1"; # Important for files with an InstallName, because language also has to be removed there.
+
+ if ( $foundofficedir )
+ {
+ $newfile->{'Dir'} = $officedirectorygid;
+ $newfile->{'destination'} = $officedirectoryhostname . $installer::globals::separator . $newfilename;
+ }
+ else
+ {
+ $newfile->{'Dir'} = "PREDEFINED_PROGDIR";
+ $newfile->{'destination'} = $newfilename;
+ }
+
+ # Also setting "modules=gid_Module_Root_Brand" (module with style: ROOT_BRAND_PACKAGE)
+ if ( $installer::globals::rootbrandpackageset )
+ {
+ $newfile->{'modules'} = $installer::globals::rootbrandpackage;
+ }
+
+ push(@newfilesarray, $newfile);
+
+ $infoline = "New files: Adding file $newfilename for the installation root to the file list. Language: $defaultlanguage\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( defined $newfile->{'InstallName'} )
+ {
+ $infoline = "New files: Using installation name: $newfile->{'InstallName'}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ # Collecting license and readme file for the installation set
+
+ push(@installer::globals::installsetfiles, $newfile);
+ $infoline = "New files: Adding file $newfilename to the file collector for the installation set. Language: $defaultlanguage\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ push(@newfilesarray, $onefile);
+ }
+
+ return \@newfilesarray;
+}
+
+############################################################################
+# Removing files with flag ONLY_ASIA_LANGUAGE, only if no asian
+# language is part of the product.
+# This special files are connected to the root module and are not
+# included into a language pack (would lead to conflicts!).
+# But this files shall only be included into the product, if the
+# product contains at least one asian language.
+############################################################################
+
+sub remove_onlyasialanguage_files_from_productlists
+{
+ my ($filesarrayref) = @_;
+
+ my $infoline;
+
+ my @newfilesarray = ();
+ my $returnfilesarrayref;
+
+ my $containsasianlanguage = installer::languages::detect_asian_language($installer::globals::alllanguagesinproductarrayref);
+
+ my $alllangstring = installer::converter::convert_array_to_comma_separated_string($installer::globals::alllanguagesinproductarrayref);
+ $infoline = "\nLanguages in complete product: $alllangstring\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( ! $containsasianlanguage )
+ {
+ $infoline = "Product does not contain asian language -> removing files\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $styles = "";
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+ if ( $styles =~ /\bONLY_ASIA_LANGUAGE\b/ )
+ {
+ $infoline = "Flag ONLY_ASIA_LANGUAGE: Removing file $onefile->{'Name'} from files collector!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ next;
+ }
+
+ push(@newfilesarray, $onefile);
+ }
+
+ $returnfilesarrayref = \@newfilesarray;
+ }
+ else
+ {
+ $returnfilesarrayref = $filesarrayref;
+
+ $infoline = "Product contains asian language -> Nothing to do\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ }
+
+ return $returnfilesarrayref;
+}
+
+############################################################################
+# Removing files with flag ONLY_WESTERN_LANGUAGE, only if no western
+# language is part of the product.
+# This special files are connected to the root module and are not
+# included into a language pack (would lead to conflicts!).
+# But this files shall only be included into the product, if the
+# product contains at least one western language.
+############################################################################
+
+sub remove_onlywesternlanguage_files_from_productlists
+{
+ my ($filesarrayref) = @_;
+
+ my $infoline;
+
+ my @newfilesarray = ();
+ my $returnfilesarrayref;
+
+ my $containswesternlanguage = installer::languages::detect_western_language($installer::globals::alllanguagesinproductarrayref);
+
+ my $alllangstring = installer::converter::convert_array_to_comma_separated_string($installer::globals::alllanguagesinproductarrayref);
+ $infoline = "\nLanguages in complete product: $alllangstring\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( ! $containswesternlanguage )
+ {
+ $infoline = "Product does not contain western language -> removing files\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $styles = "";
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+ if ( $styles =~ /\bONLY_WESTERN_LANGUAGE\b/ )
+ {
+ $infoline = "Flag ONLY_WESTERN_LANGUAGE: Removing file $onefile->{'Name'} from files collector!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ next;
+ }
+
+ push(@newfilesarray, $onefile);
+ }
+
+ $returnfilesarrayref = \@newfilesarray;
+ }
+ else
+ {
+ $returnfilesarrayref = $filesarrayref;
+
+ $infoline = "Product contains western language -> Nothing to do\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ }
+
+ return $returnfilesarrayref;
+}
+
+############################################################################
+# Some files are included for more than one language and have the same
+# name and the same destination directory for all languages. This would
+# lead to conflicts, if the filenames are not changed.
+# In scp project this files must have the flag MAKE_LANG_SPECIFIC
+# For this files, the language is included into the filename.
+############################################################################
+
+sub make_filename_language_specific
+{
+ my ($filesarrayref) = @_;
+
+ my $infoline = "";
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+
+ if ( $onefile->{'ismultilingual'} )
+ {
+ my $styles = "";
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+ if ( $styles =~ /\bMAKE_LANG_SPECIFIC\b/ )
+ {
+ my $language = $onefile->{'specificlanguage'};
+ my $olddestination = $onefile->{'destination'};
+ my $oldname = $onefile->{'Name'};
+
+ # Including the language into the file name.
+ # But be sure, to include the language before the file extension.
+
+ my $fileextension = "";
+
+ if ( $onefile->{'Name'} =~ /(\.\w+?)\s*$/ ) { $fileextension = $1; }
+ if ( $fileextension ne "" )
+ {
+ $onefile->{'Name'} =~ s/\Q$fileextension\E\s*$/_$language$fileextension/;
+ $onefile->{'destination'} =~ s/\Q$fileextension\E\s*$/_$language$fileextension/;
+ }
+
+ $infoline = "Flag MAKE_LANG_SPECIFIC:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "Changing name from $oldname to $onefile->{'Name'} !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "Changing destination from $olddestination to $onefile->{'destination'} !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+}
+
+############################################################################
+# Removing all scpactions, that have no name.
+# See: FlatLoaderZip
+############################################################################
+
+sub remove_scpactions_without_name
+{
+ my ($itemsarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_scpactions_without_name : $#{$itemsarrayref}"); }
+
+ my $infoline;
+
+ my @newitemsarray = ();
+
+ for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemsarrayref}[$i];
+ my $name = "";
+
+ if ( $oneitem->{'Name'} ) { $name = $oneitem->{'Name'}; }
+
+ if ( $name eq "" )
+ {
+ $infoline = "ATTENTION: Removing scpaction $oneitem->{'gid'} from the installation set.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ next;
+ }
+
+ push(@newitemsarray, $oneitem);
+ }
+
+ return \@newitemsarray;
+}
+
+############################################################################
+# Because of the item "File" the source name must be "Name". Therefore
+# "Copy" is changed to "Name" and "Name" is changed to "DestinationName".
+############################################################################
+
+sub change_keys_of_scpactions
+{
+ my ($itemsarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::change_keys_of_scpactions : $#{$itemsarrayref}"); }
+
+ for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemsarrayref}[$i];
+
+ my $key;
+
+ # First Name to DestinationName, then deleting Name
+ foreach $key (keys %{$oneitem})
+ {
+ if ( $key =~ /\bName\b/ )
+ {
+ my $value = $oneitem->{$key};
+ my $oldkey = $key;
+ $key =~ s/Name/DestinationName/;
+ $oneitem->{$key} = $value;
+ delete($oneitem->{$oldkey});
+ }
+ }
+
+ # Second Copy to Name, then deleting Copy
+ foreach $key (keys %{$oneitem})
+ {
+ if ( $key =~ /\bCopy\b/ )
+ {
+ my $value = $oneitem->{$key};
+ my $oldkey = $key;
+ $key =~ s/Copy/Name/;
+ $oneitem->{$key} = $value;
+ delete($oneitem->{$oldkey});
+ }
+ }
+ }
+}
+
+############################################################################
+# Removing all xpd only items from installation set (scpactions with
+# the style XPD_ONLY), except an xpd installation set is created
+############################################################################
+
+sub remove_Xpdonly_Items
+{
+ my ($itemsarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_Xpdonly_Items : $#{$itemsarrayref}"); }
+
+ my $infoline;
+
+ my @newitemsarray = ();
+
+ for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemsarrayref}[$i];
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
+
+ if ( $styles =~ /\bXPD_ONLY\b/ )
+ {
+ $infoline = "Removing \"xpd only\" item $oneitem->{'gid'} from the installation set.\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ next;
+ }
+
+ push(@newitemsarray, $oneitem);
+ }
+
+ $infoline = "\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ return \@newitemsarray;
+}
+
+############################################################################
+# Removing all language pack files from installation set (files with
+# the style LANGUAGEPACK), except this is a language pack.
+############################################################################
+
+sub remove_Languagepacklibraries_from_Installset
+{
+ my ($itemsarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_Languagepacklibraries_from_Installset : $#{$itemsarrayref}"); }
+
+ my $infoline;
+
+ my @newitemsarray = ();
+
+ for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemsarrayref}[$i];
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
+
+ if ( $styles =~ /\bLANGUAGEPACK\b/ )
+ {
+ $infoline = "Removing language pack file $oneitem->{'gid'} from the installation set.\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ next;
+ }
+
+ push(@newitemsarray, $oneitem);
+ }
+
+ $infoline = "\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ return \@newitemsarray;
+}
+
+############################################################################
+# Removing all files with flag PATCH_ONLY from installation set.
+# This function is not called during patch creation.
+############################################################################
+
+sub remove_patchonlyfiles_from_Installset
+{
+ my ($itemsarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_patchonlyfiles_from_Installset : $#{$itemsarrayref}"); }
+
+ my $infoline;
+
+ my @newitemsarray = ();
+
+ for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemsarrayref}[$i];
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
+
+ if ( $styles =~ /\bPATCH_ONLY\b/ )
+ {
+ $infoline = "Removing file with flag PATCH_ONLY $oneitem->{'gid'} from the installation set.\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ next;
+ }
+
+ push(@newitemsarray, $oneitem);
+ }
+
+ $infoline = "\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ return \@newitemsarray;
+}
+
+############################################################################
+# Removing all files with flag TAB_ONLY from installation set.
+# This function is not called during tab creation.
+############################################################################
+
+sub remove_tabonlyfiles_from_Installset
+{
+ my ($itemsarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_tabonlyfiles_from_Installset : $#{$itemsarrayref}"); }
+
+ my $infoline;
+
+ my @newitemsarray = ();
+
+ for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemsarrayref}[$i];
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
+
+ if ( $styles =~ /\bTAB_ONLY\b/ )
+ {
+ $infoline = "Removing tab only file $oneitem->{'gid'} from the installation set.\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ next;
+ }
+
+ push(@newitemsarray, $oneitem);
+ }
+
+ $infoline = "\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ return \@newitemsarray;
+}
+
+###############################################################################
+# Removing all files with flag ONLY_INSTALLED_PRODUCT from installation set.
+# This function is not called for PKGFORMAT installed and archive.
+###############################################################################
+
+sub remove_installedproductonlyfiles_from_Installset
+{
+ my ($itemsarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_installedproductonlyfiles_from_Installset : $#{$itemsarrayref}"); }
+
+ my $infoline;
+
+ my @newitemsarray = ();
+
+ for ( my $i = 0; $i <= $#{$itemsarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemsarrayref}[$i];
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
+
+ if ( $styles =~ /\bONLY_INSTALLED_PRODUCT\b/ )
+ {
+ $infoline = "Removing file $oneitem->{'gid'} from the installation set. This file is only required for PKGFORMAT archive or installed).\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ next;
+ }
+
+ push(@newitemsarray, $oneitem);
+ }
+
+ $infoline = "\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ return \@newitemsarray;
+}
+
+############################################################################
+# Some files cotain a $ in their name. epm conflicts with such files.
+# Solution: Renaming this files, converting "$" to "$$"
+############################################################################
+
+sub quoting_illegal_filenames
+{
+ my ($filesarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::rename_illegal_filenames : $#{$filesarrayref}"); }
+
+ # This function has to be removed as soon as possible!
+
+ installer::logger::include_header_into_logfile("Renaming illegal filenames:");
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $filename = $onefile->{'Name'};
+
+ if ( $filename =~ /\$/ )
+ {
+ my $sourcepath = $onefile->{'sourcepath'};
+ my $destpath = $onefile->{'destination'};
+
+ # sourcepath and destination have to be quoted for epm list file
+
+ # $filename =~ s/\$/\$\$/g;
+ $destpath =~ s/\$/\$\$/g;
+ $sourcepath =~ s/\$/\$\$/g;
+
+ # my $infoline = "ATTENTION: Files: Renaming $onefile->{'Name'} to $filename\n";
+ # push( @installer::globals::logfileinfo, $infoline);
+ my $infoline = "ATTENTION: Files: Quoting sourcepath $onefile->{'sourcepath'} to $sourcepath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "ATTENTION: Files: Quoting destination path $onefile->{'destination'} to $destpath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # $onefile->{'Name'} = $filename;
+ $onefile->{'sourcepath'} = $sourcepath;
+ $onefile->{'destination'} = $destpath;
+ }
+ }
+}
+
+############################################################################
+# Removing multiple occurences of same module.
+############################################################################
+
+sub optimize_list
+{
+ my ( $longlist ) = @_;
+
+ my $shortlist = "";
+ my $hashref = installer::converter::convert_stringlist_into_hash(\$longlist, ",");
+ foreach my $key (sort keys %{$hashref} ) { $shortlist = "$shortlist,$key"; }
+ $shortlist =~ s/^\s*\,//;
+
+ return $shortlist;
+}
+
+#######################################################################
+# Collecting all directories needed for the epm list
+# 1. Looking for all destination paths in the files array
+# 2. Looking for directories with CREATE flag in the directory array
+#######################################################################
+
+##################################
+# Collecting directories: Part 1
+##################################
+
+sub collect_directories_from_filesarray
+{
+ my ($filesarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::collect_directories_from_filesarray : $#{$filesarrayref}"); }
+
+ my @alldirectories = ();
+ my %alldirectoryhash = ();
+
+ my $predefinedprogdir_added = 0;
+ my $alreadyincluded = 0;
+
+ # Preparing this already as hash, although the only needed value at the moment is the HostName
+ # But also adding: "specificlanguage" and "Dir" (for instance gid_Dir_Program)
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $destinationpath = $onefile->{'destination'};
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$destinationpath);
+ $destinationpath =~ s/\Q$installer::globals::separator\E\s*$//; # removing ending slashes or backslashes
+
+ $alreadyincluded = 0;
+ if ( exists($alldirectoryhash{$destinationpath}) ) { $alreadyincluded = 1; }
+
+ if (!($alreadyincluded))
+ {
+ my %directoryhash = ();
+ $directoryhash{'HostName'} = $destinationpath;
+ $directoryhash{'specificlanguage'} = $onefile->{'specificlanguage'};
+ $directoryhash{'Dir'} = $onefile->{'Dir'};
+ $directoryhash{'modules'} = $onefile->{'modules'}; # NEW, saving modules
+ # NEVER!!! if ( ! $installer::globals::iswindowsbuild ) { $directoryhash{'Styles'} = "(CREATE)"; } # this directories must be created
+
+ if ( $onefile->{'Dir'} eq "PREDEFINED_PROGDIR" ) { $predefinedprogdir_added = 1; }
+
+ $alldirectoryhash{$destinationpath} = \%directoryhash;
+
+ # Problem: The $destinationpath can be share/registry/schema/org/openoffice
+ # but not all directories contain files and will be added to this list.
+ # Therefore the path has to be analyzed.
+
+ while ( $destinationpath =~ /(^.*\S)\Q$installer::globals::separator\E(\S.*?)\s*$/ ) # as long as the path contains slashes
+ {
+ $destinationpath = $1;
+
+ $alreadyincluded = 0;
+ if ( exists($alldirectoryhash{$destinationpath}) ) { $alreadyincluded = 1; }
+
+ if (!($alreadyincluded))
+ {
+ my %directoryhash = ();
+
+ $directoryhash{'HostName'} = $destinationpath;
+ $directoryhash{'specificlanguage'} = $onefile->{'specificlanguage'};
+ $directoryhash{'Dir'} = $onefile->{'Dir'};
+ $directoryhash{'modules'} = $onefile->{'modules'}; # NEW, saving modules
+ # NEVER!!! if ( ! $installer::globals::iswindowsbuild ) { $directoryhash{'Styles'} = "(CREATE)"; } # this directories must be created
+
+ $alldirectoryhash{$destinationpath} = \%directoryhash;
+ }
+ else
+ {
+ # Adding the modules to the module list!
+ $alldirectoryhash{$destinationpath}->{'modules'} = $alldirectoryhash{$destinationpath}->{'modules'} . "," . $onefile->{'modules'};
+ }
+ }
+ }
+ else
+ {
+ # Adding the modules to the module list!
+ $alldirectoryhash{$destinationpath}->{'modules'} = $alldirectoryhash{$destinationpath}->{'modules'} . "," . $onefile->{'modules'};
+
+ # Also adding the module to all parents
+ while ( $destinationpath =~ /(^.*\S)\Q$installer::globals::separator\E(\S.*?)\s*$/ ) # as long as the path contains slashes
+ {
+ $destinationpath = $1;
+ $alldirectoryhash{$destinationpath}->{'modules'} = $alldirectoryhash{$destinationpath}->{'modules'} . "," . $onefile->{'modules'};
+ }
+ }
+ }
+
+ # if there is no file in the root directory PREDEFINED_PROGDIR, it has to be included into the directory array now
+ # HostName= specificlanguage= Dir=PREDEFINED_PROGDIR
+
+ if (! $predefinedprogdir_added )
+ {
+ my %directoryhash = ();
+ $directoryhash{'HostName'} = "";
+ $directoryhash{'specificlanguage'} = "";
+ $directoryhash{'modules'} = ""; # ToDo?
+ $directoryhash{'Dir'} = "PREDEFINED_PROGDIR";
+
+ push(@alldirectories, \%directoryhash);
+ }
+
+ # Creating directory array
+ foreach my $destdir ( sort keys %alldirectoryhash )
+ {
+ $alldirectoryhash{$destdir}->{'modules'} = optimize_list($alldirectoryhash{$destdir}->{'modules'});
+ push(@alldirectories, $alldirectoryhash{$destdir});
+ }
+
+ return (\@alldirectories, \%alldirectoryhash);
+}
+
+##################################
+# Collecting directories: Part 2
+##################################
+
+sub collect_directories_with_create_flag_from_directoryarray
+{
+ my ($directoryarrayref, $alldirectoryhash) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::collect_directories_with_create_flag_from_directoryarray : $#{$directoryarrayref}"); }
+
+ my $alreadyincluded = 0;
+ my @alldirectories = ();
+
+ for ( my $i = 0; $i <= $#{$directoryarrayref}; $i++ )
+ {
+ my $onedir = ${$directoryarrayref}[$i];
+ my $styles = "";
+ $newdirincluded = 0;
+
+ if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; }
+
+ if ( $styles =~ /\bCREATE\b/ )
+ {
+ my $directoryname = "";
+
+ if ( $onedir->{'HostName'} ) { $directoryname = $onedir->{'HostName'}; }
+ else { installer::exiter::exit_program("ERROR: No directory name (HostName) set for specified language in gid $onedir->{'gid'}", "collect_directories_with_create_flag_from_directoryarray"); }
+
+ $alreadyincluded = 0;
+ if ( exists($alldirectoryhash->{$directoryname}) ) { $alreadyincluded = 1; }
+
+ if (!($alreadyincluded))
+ {
+ my %directoryhash = ();
+ $directoryhash{'HostName'} = $directoryname;
+ $directoryhash{'specificlanguage'} = $onedir->{'specificlanguage'};
+ # $directoryhash{'gid'} = $onedir->{'gid'};
+ $directoryhash{'Dir'} = $onedir->{'gid'};
+ $directoryhash{'Styles'} = $onedir->{'Styles'};
+
+ # saving also the modules
+ if ( ! $onedir->{'modules'} ) { installer::exiter::exit_program("ERROR: No assigned modules found for directory $onedir->{'gid'}", "collect_directories_with_create_flag_from_directoryarray"); }
+ $directoryhash{'modules'} = $onedir->{'modules'};
+
+ $alldirectoryhash->{$directoryname} = \%directoryhash;
+ $newdirincluded = 1;
+
+ # Problem: The $destinationpath can be share/registry/schema/org/openoffice
+ # but not all directories contain files and will be added to this list.
+ # Therefore the path has to be analyzed.
+
+ while ( $directoryname =~ /(^.*\S)\Q$installer::globals::separator\E(\S.*?)\s*$/ ) # as long as the path contains slashes
+ {
+ $directoryname = $1;
+
+ $alreadyincluded = 0;
+ if ( exists($alldirectoryhash->{$directoryname}) ) { $alreadyincluded = 1; }
+
+ if (!($alreadyincluded))
+ {
+ my %directoryhash = ();
+
+ $directoryhash{'HostName'} = $directoryname;
+ $directoryhash{'specificlanguage'} = $onedir->{'specificlanguage'};
+ $directoryhash{'Dir'} = $onedir->{'gid'};
+ if ( ! $installer::globals::iswindowsbuild ) { $directoryhash{'Styles'} = "(CREATE)"; } # Exeception for Windows?
+
+ # saving also the modules
+ $directoryhash{'modules'} = $onedir->{'modules'};
+
+ $alldirectoryhash->{$directoryname} = \%directoryhash;
+ $newdirincluded = 1;
+ }
+ else
+ {
+ # Adding the modules to the module list!
+ $alldirectoryhash->{$directoryname}->{'modules'} = $alldirectoryhash->{$directoryname}->{'modules'} . "," . $onedir->{'modules'};
+ }
+ }
+ }
+ else
+ {
+ # Adding the modules to the module list!
+ $alldirectoryhash->{$directoryname}->{'modules'} = $alldirectoryhash->{$directoryname}->{'modules'} . "," . $onedir->{'modules'};
+
+ while ( $directoryname =~ /(^.*\S)\Q$installer::globals::separator\E(\S.*?)\s*$/ ) # as long as the path contains slashes
+ {
+ $directoryname = $1;
+ # Adding the modules to the module list!
+ $alldirectoryhash->{$directoryname}->{'modules'} = $alldirectoryhash->{$directoryname}->{'modules'} . "," . $onedir->{'modules'};
+ }
+ }
+ }
+
+ # Saving the styles for already added directories in function collect_directories_from_filesarray
+
+ if (( ! $newdirincluded ) && ( $styles ne "" ))
+ {
+ $styles =~ s/\bWORKSTATION\b//;
+ $styles =~ s/\bCREATE\b//;
+
+ if (( ! ( $styles =~ /^\s*\(\s*\)\s*$/ )) && ( ! ( $styles =~ /^\s*\(\s*\,\s*\)\s*$/ )) && ( ! ( $styles =~ /^\s*$/ ))) # checking, if there are styles left
+ {
+ my $directoryname = "";
+ if ( $onedir->{'HostName'} ) { $directoryname = $onedir->{'HostName'}; }
+ else { installer::exiter::exit_program("ERROR: No directory name (HostName) set for specified language in gid $onedir->{'gid'}", "collect_directories_with_create_flag_from_directoryarray"); }
+
+ if ( exists($alldirectoryhash->{$directoryname}) )
+ {
+ $alldirectoryhash->{$directoryname}->{'Styles'} = $styles;
+ }
+ }
+ }
+ }
+
+ # Creating directory array
+ foreach my $destdir ( sort keys %{$alldirectoryhash} )
+ {
+ $alldirectoryhash->{$destdir}->{'modules'} = optimize_list($alldirectoryhash->{$destdir}->{'modules'});
+ push(@alldirectories, $alldirectoryhash->{$destdir});
+ }
+
+ return (\@alldirectories, \%alldirectoryhash);
+}
+
+#################################################
+# Determining the destination file of a link
+#################################################
+
+sub get_destination_file_path_for_links
+{
+ my ($linksarrayref, $filesarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_destination_file_path_for_links : $#{$linksarrayref} : $#{$filesarrayref}"); }
+
+ my $infoline;
+
+ for ( my $i = 0; $i <= $#{$linksarrayref}; $i++ )
+ {
+ my $fileid = "";
+ my $onelink = ${$linksarrayref}[$i];
+ if ( $onelink->{'FileID'} ) { $fileid = $onelink->{'FileID'}; }
+
+ if (!( $fileid eq "" ))
+ {
+ my $foundfile = 0;
+
+ for ( my $j = 0; $j <= $#{$filesarrayref}; $j++ )
+ {
+ my $onefile = ${$filesarrayref}[$j];
+ my $filegid = $onefile->{'gid'};
+
+ if ( $filegid eq $fileid )
+ {
+ $foundfile = 1;
+ $onelink->{'destinationfile'} = $onefile->{'destination'};
+ last;
+ }
+ }
+
+ if (!($foundfile))
+ {
+ $infoline = "Warning: FileID $fileid for Link $onelink->{'gid'} not found!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+
+ $infoline = "\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+#################################################
+# Determining the destination link of a link
+#################################################
+
+sub get_destination_link_path_for_links
+{
+ my ($linksarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_destination_link_path_for_links : $#{$linksarrayref}"); }
+
+ my $infoline;
+
+ for ( my $i = 0; $i <= $#{$linksarrayref}; $i++ )
+ {
+ my $shortcutid = "";
+ my $onelink = ${$linksarrayref}[$i];
+ if ( $onelink->{'ShortcutID'} ) { $shortcutid = $onelink->{'ShortcutID'}; }
+
+ if (!( $shortcutid eq "" ))
+ {
+ my $foundlink = 0;
+
+ for ( my $j = 0; $j <= $#{$linksarrayref}; $j++ )
+ {
+ my $destlink = ${$linksarrayref}[$j];
+ $shortcutgid = $destlink->{'gid'};
+
+ if ( $shortcutgid eq $shortcutid )
+ {
+ $foundlink = 1;
+ $onelink->{'destinationfile'} = $destlink->{'destination'}; # making key 'destinationfile'
+ last;
+ }
+ }
+
+ if (!($foundlink))
+ {
+ $infoline = "Warning: ShortcutID $shortcutid for Link $onelink->{'gid'} not found!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+
+ $infoline = "\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+###################################################################################
+# Items with flag WORKSTATION are not needed (here: links and configurationitems)
+###################################################################################
+
+sub remove_workstation_only_items
+{
+ my ($itemarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_workstation_only_items : $#{$itemarrayref}"); }
+
+ my @newitemarray = ();
+
+ for ( my $i = 0; $i <= $#{$itemarrayref}; $i++ )
+ {
+ my $oneitem = ${$itemarrayref}[$i];
+ my $styles = $oneitem->{'Styles'};
+
+ if (( $styles =~ /\bWORKSTATION\b/ ) &&
+ (!( $styles =~ /\bNETWORK\b/ )) &&
+ (!( $styles =~ /\bSTANDALONE\b/ )))
+ {
+ next; # removing this link, it is only needed for a workstation installation
+ }
+
+ push(@newitemarray, $oneitem);
+ }
+
+ return \@newitemarray;
+}
+
+################################################
+# Resolving relative path in links
+################################################
+
+sub resolve_links_with_flag_relative
+{
+ my ($linksarrayref) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::resolve_links_with_flag_relative : $#{$linksarrayref}"); }
+
+ # Before this step is:
+ # destination=program/libsalhelperC52.so.3, this will be the name of the link
+ # destinationfile=program/libsalhelperC52.so.3, this will be the linked file or name
+ # If the flag RELATIVE is set, the pathes have to be analyzed. If the flag is not set
+ # (this will not occur in the future?) destinationfile has to be an absolute path name
+
+ for ( my $i = 0; $i <= $#{$linksarrayref}; $i++ )
+ {
+ my $onelink = ${$linksarrayref}[$i];
+ my $styles = $onelink->{'Styles'};
+
+ if ( $styles =~ /\bRELATIVE\b/ )
+ {
+ # ToDo: This is only a simple not sufficient mechanism
+
+ my $destination = $onelink->{'destination'};
+ my $destinationfile = $onelink->{'destinationfile'};
+
+ my $destinationpath = $destination;
+
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$destinationpath);
+
+ my $destinationfilepath = $destinationfile;
+
+ # it is possible, that the destinationfile is no longer part of the files collector
+ if ($destinationfilepath) { installer::pathanalyzer::get_path_from_fullqualifiedname(\$destinationfilepath); }
+ else { $destinationfilepath = ""; }
+
+ if ( $destinationpath eq $destinationfilepath )
+ {
+ # link and file are in the same directory
+ # Therefore the path of the file can be removed
+
+ my $newdestinationfile = $destinationfile;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$newdestinationfile);
+
+ $onelink->{'destinationfile'} = $newdestinationfile;
+ }
+ }
+ }
+}
+
+########################################################################
+# This function is a helper of function "assigning_modules_to_items"
+########################################################################
+
+sub insert_for_item ($$$)
+{
+ my ($hash, $item, $id) = @_;
+
+ # print STDERR "insert '$id' for '$item'\n";
+ if (!defined $hash->{$item})
+ {
+ my @gids = ();
+ $hash->{$item} = \@gids;
+ }
+ my $gid_list = $hash->{$item};
+ push @{$gid_list}, $id;
+ $hash->{$item} = $gid_list;
+}
+
+sub build_modulegids_table
+{
+ my ($modulesref, $itemname) = @_;
+
+ my %module_lookup_table = ();
+
+ # build map of item names to list of respective module gids
+ # containing these items
+ for my $onemodule (@{$modulesref})
+ {
+ next if ( ! defined $onemodule->{$itemname} );
+ # these are the items contained in this module
+ # eg. Files = (gid_a_b_c,gid_d_e_f)
+ my $module_gids = $onemodule->{$itemname};
+
+ # prune outer brackets
+ $module_gids =~ s|^\s*\(||g;
+ $module_gids =~ s|\)\s*$||g;
+ for my $id (split (/,/, $module_gids))
+ {
+ chomp $id;
+ insert_for_item(\%module_lookup_table, lc ($id), $onemodule->{'gid'});
+ }
+ }
+
+ return \%module_lookup_table;
+}
+
+########################################################################
+# Items like files do not know their modules
+# This function is a helper of function "assigning_modules_to_items"
+########################################################################
+
+sub get_string_of_modulegids_for_itemgid
+{
+ my ($module_lookup_table, $modulesref, $itemgid, $itemname) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::get_string_of_modulegids_for_itemgid : $#{$modulesref} : $itemgid : $itemname"); }
+
+ my $allmodules = "";
+ my $haslanguagemodule = 0;
+ my %foundmodules = ();
+
+ # print STDERR "lookup '" . lc($itemgid) . "'\n";
+ my $gid_list = $module_lookup_table->{lc($itemgid)};
+
+ for my $gid (@{$gid_list})
+ {
+ $foundmodules{$gid} = 1;
+ $allmodules = $allmodules . "," . $gid;
+ # Is this module a language module? This info should be stored at the file.
+ if ( exists($installer::globals::alllangmodules{$gid}) ) { $haslanguagemodule = 1; }
+ }
+
+ $allmodules =~ s/^\s*\,//; # removing leading comma
+
+ # Check: All modules or no module must have flag LANGUAGEMODULE
+ if ( $haslanguagemodule )
+ {
+ my $isreallylanguagemodule = installer::worker::key_in_a_is_also_key_in_b(\%foundmodules, \%installer::globals::alllangmodules);
+ if ( ! $isreallylanguagemodule ) { installer::exiter::exit_program("ERROR: \"$itemgid\" is assigned to modules with flag \"LANGUAGEMODULE\" and also to modules without this flag! Modules: $allmodules", "get_string_of_modulegids_for_itemgid"); }
+ }
+
+ # print STDERR "get_string_for_itemgid ($itemgid, $itemname) => $allmodules, $haslanguagemodule\n";
+
+ return ($allmodules, $haslanguagemodule);
+}
+
+########################################################
+# Items like files do not know their modules
+# This function add the {'modules'} to these items
+########################################################
+
+sub assigning_modules_to_items
+{
+ my ($modulesref, $itemsref, $itemname) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::assigning_modules_to_items : $#{$modulesref} : $#{$itemsref} : $itemname"); }
+
+ my $infoline = "";
+ my $languageassignmenterror = 0;
+ my @languageassignmenterrors = ();
+
+ my $module_lookup_table = build_modulegids_table($modulesref, $itemname);
+
+ for my $oneitem (@{$itemsref})
+ {
+ my $itemgid = $oneitem->{'gid'};
+
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
+ if (( $itemname eq "Dirs" ) && ( ! ( $styles =~ /\bCREATE\b/ ))) { next; }
+
+ if ( $itemgid eq "" )
+ {
+ installer::exiter::exit_program("ERROR in item collection: No gid for item $oneitem->{'Name'}", "assigning_modules_to_items");
+ }
+
+ # every item can belong to many modules
+
+ my ($modulegids, $haslanguagemodule) = get_string_of_modulegids_for_itemgid($module_lookup_table, $modulesref, $itemgid, $itemname);
+
+ if ($modulegids eq "")
+ {
+ installer::exiter::exit_program("ERROR in file collection: No module found for $itemname $itemgid", "assigning_modules_to_items");
+ }
+
+ $oneitem->{'modules'} = $modulegids;
+ $oneitem->{'haslanguagemodule'} = $haslanguagemodule;
+
+ # Important check: "ismultilingual" and "haslanguagemodule" must have the same value !
+ if (( $oneitem->{'ismultilingual'} ) && ( ! $oneitem->{'haslanguagemodule'} ))
+ {
+ $infoline = "Error: \"$oneitem->{'gid'}\" is multi lingual, but not in language pack (Assigned module: $modulegids)!\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ push( @languageassignmenterrors, $infoline );
+ $languageassignmenterror = 1;
+ }
+ if (( $oneitem->{'haslanguagemodule'} ) && ( ! $oneitem->{'ismultilingual'} ))
+ {
+ $infoline = "Error: \"$oneitem->{'gid'}\" is in language pack, but not multi lingual (Assigned module: $modulegids)!\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ push( @languageassignmenterrors, $infoline );
+ $languageassignmenterror = 1;
+ }
+ }
+
+ if ($languageassignmenterror)
+ {
+ for ( my $i = 0; $i <= $#languageassignmenterrors; $i++ ) { print "$languageassignmenterrors[$i]"; }
+ installer::exiter::exit_program("ERROR: Incorrect assignments for language packs.", "assigning_modules_to_items");
+ }
+
+}
+
+#################################################################################################
+# Root path (for instance /opt/openofficeorg20) needs to be added to directories, files and links
+#################################################################################################
+
+sub add_rootpath_to_directories
+{
+ my ($dirsref, $rootpath) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::add_rootpath_to_directories : $#{$dirsref} : $rootpath"); }
+
+ for ( my $i = 0; $i <= $#{$dirsref}; $i++ )
+ {
+ my $onedir = ${$dirsref}[$i];
+ my $dir = "";
+
+ if ( $onedir->{'Dir'} ) { $dir = $onedir->{'Dir'}; }
+
+ if (!($dir =~ /\bPREDEFINED_/ ))
+ {
+ my $hostname = $onedir->{'HostName'};
+ $hostname = $rootpath . $installer::globals::separator . $hostname;
+ $onedir->{'HostName'} = $hostname;
+ }
+
+ # added
+
+ if ( $dir =~ /\bPREDEFINED_PROGDIR\b/ )
+ {
+ my $hostname = $onedir->{'HostName'};
+ if ( $hostname eq "" ) { $onedir->{'HostName'} = $rootpath; }
+ else { $onedir->{'HostName'} = $rootpath . $installer::globals::separator . $hostname; }
+ }
+ }
+}
+
+sub add_rootpath_to_files
+{
+ my ($filesref, $rootpath) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::add_rootpath_to_files : $#{$filesref} : $rootpath"); }
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ my $destination = $onefile->{'destination'};
+ $destination = $rootpath . $installer::globals::separator . $destination;
+ $onefile->{'destination'} = $destination;
+ }
+}
+
+sub add_rootpath_to_links
+{
+ my ($linksref, $rootpath) = @_;
+
+ if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::add_rootpath_to_links : $#{$linksref} : $rootpath"); }
+
+ for ( my $i = 0; $i <= $#{$linksref}; $i++ )
+ {
+ my $onelink = ${$linksref}[$i];
+ my $styles = $onelink->{'Styles'};
+
+ my $destination = $onelink->{'destination'};
+ $destination = $rootpath . $installer::globals::separator . $destination;
+ $onelink->{'destination'} = $destination;
+
+ if (!($styles =~ /\bRELATIVE\b/ )) # for absolute links
+ {
+ my $destinationfile = $onelink->{'destinationfile'};
+ $destinationfile = $rootpath . $installer::globals::separator . $destinationfile;
+ $onelink->{'destinationfile'} = $destinationfile;
+ }
+ }
+}
+
+#################################################################################
+# Collecting all parent gids
+#################################################################################
+
+sub collect_all_parent_feature
+{
+ my ($modulesref) = @_;
+
+ my @allparents = ();
+
+ my $found_root_module = 0;
+
+ for ( my $i = 0; $i <= $#{$modulesref}; $i++ )
+ {
+ my $onefeature = ${$modulesref}[$i];
+
+ my $parentgid = "";
+ if ( $onefeature->{'ParentID'} )
+ {
+ $parentgid = $onefeature->{'ParentID'};
+ }
+
+ if ( $parentgid ne "" )
+ {
+ if (! installer::existence::exists_in_array($parentgid, \@allparents))
+ {
+ push(@allparents, $parentgid);
+ }
+ }
+
+ # Setting the global root module
+
+ if ( $parentgid eq "" )
+ {
+ if ( $found_root_module ) { installer::exiter::exit_program("ERROR: Only one module without ParentID or with empty ParentID allowed ($installer::globals::rootmodulegid, $onefeature->{'gid'}).", "collect_all_parent_feature"); }
+ $installer::globals::rootmodulegid = $onefeature->{'gid'};
+ $found_root_module = 1;
+ $infoline = "Setting Root Module: $installer::globals::rootmodulegid\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ }
+
+ if ( ! $found_root_module ) { installer::exiter::exit_program("ERROR: Could not define root module. No module without ParentID or with empty ParentID exists.", "collect_all_parent_feature"); }
+
+ }
+
+ return \@allparents;
+}
+
+#################################################################################
+# Checking for every feature, whether it has children
+#################################################################################
+
+sub set_children_flag
+{
+ my ($modulesref) = @_;
+
+ my $allparents = collect_all_parent_feature($modulesref);
+
+ for ( my $i = 0; $i <= $#{$modulesref}; $i++ )
+ {
+ my $onefeature = ${$modulesref}[$i];
+ my $gid = $onefeature->{'gid'};
+
+ # is this gid a parent?
+
+ if ( installer::existence::exists_in_array($gid, $allparents) )
+ {
+ $onefeature->{'has_children'} = 1;
+ }
+ else
+ {
+ $onefeature->{'has_children'} = 0;
+ }
+ }
+}
+
+#################################################################################
+# All modules, that use a template module, do now get the assignments of
+# the template module.
+#################################################################################
+
+sub resolve_assigned_modules
+{
+ my ($modulesref) = @_;
+
+ # collecting all template modules
+
+ my %directaccess = ();
+
+ for ( my $i = 0; $i <= $#{$modulesref}; $i++ )
+ {
+ my $onefeature = ${$modulesref}[$i];
+ my $styles = "";
+ if ( $onefeature->{'Styles'} ) { $styles = $onefeature->{'Styles'}; }
+ if ( $styles =~ /\bTEMPLATEMODULE\b/ ) { $directaccess{$onefeature->{'gid'}} = $onefeature; }
+
+ # also looking for module with flag ROOT_BRAND_PACKAGE, to save is for further usage
+ if ( $styles =~ /\bROOT_BRAND_PACKAGE\b/ )
+ {
+ $installer::globals::rootbrandpackage = $onefeature->{'gid'};
+ $installer::globals::rootbrandpackageset = 1;
+ }
+ }
+
+ # looking, where template modules are assigned
+
+ for ( my $i = 0; $i <= $#{$modulesref}; $i++ )
+ {
+ my $onefeature = ${$modulesref}[$i];
+ if ( $onefeature->{'Assigns'} )
+ {
+ my $templategid = $onefeature->{'Assigns'};
+
+ if ( ! exists($directaccess{$templategid}) )
+ {
+ installer::exiter::exit_program("ERROR: Did not find definition of assigned template module \"$templategid\"", "resolve_assigned_modules");
+ }
+
+ # Currently no merging of Files, Dirs, ...
+ # This has to be included here, if it is required
+ my $item;
+ foreach $item (@installer::globals::items_at_modules)
+ {
+ if ( exists($directaccess{$templategid}->{$item}) ) { $onefeature->{$item} = $directaccess{$templategid}->{$item}; }
+ }
+ }
+ }
+}
+
+#################################################################################
+# Removing the template modules from the list, after all
+# assignments are transferred to the "real" modules.
+#################################################################################
+
+sub remove_template_modules
+{
+ my ($modulesref) = @_;
+
+ my @modules = ();
+
+ for ( my $i = 0; $i <= $#{$modulesref}; $i++ )
+ {
+ my $onefeature = ${$modulesref}[$i];
+ my $styles = "";
+ if ( $onefeature->{'Styles'} ) { $styles = $onefeature->{'Styles'}; }
+ if ( $styles =~ /\bTEMPLATEMODULE\b/ ) { next; }
+
+ push(@modules, $onefeature);
+ }
+
+ return \@modules;
+}
+
+#################################################################################
+# Collecting all modules with flag LANGUAGEMODULE in a global
+# collector.
+#################################################################################
+
+sub collect_all_languagemodules
+{
+ my ($modulesref) = @_;
+
+ for ( my $i = 0; $i <= $#{$modulesref}; $i++ )
+ {
+ my $onefeature = ${$modulesref}[$i];
+ my $styles = "";
+ if ( $onefeature->{'Styles'} ) { $styles = $onefeature->{'Styles'}; }
+ if ( $styles =~ /\bLANGUAGEMODULE\b/ )
+ {
+ if ( ! exists($onefeature->{'Language'}) ) { installer::exiter::exit_program("ERROR: \"$onefeature->{'gid'}\" has flag LANGUAGEMODULE, but does not know its language!", "collect_all_languagemodules"); }
+ $installer::globals::alllangmodules{$onefeature->{'gid'}} = $onefeature->{'Language'};
+ # Collecting also the english names, that are used for nsis unpack directory for language packs
+ my $lang = $onefeature->{'Language'};
+ my $name = "";
+ foreach my $localkey ( keys %{$onefeature} )
+ {
+ if ( $localkey =~ /^\s*Name\s*\(\s*en-US\s*\)\s*$/ )
+ {
+ $installer::globals::all_english_languagestrings{$lang} = $onefeature->{$localkey};
+ }
+ }
+ }
+ }
+}
+
+#################################################################################
+# Selecting from all collected english language strings those, that are really
+# required in this installation set.
+#################################################################################
+
+sub select_required_language_strings
+{
+ my ($modulesref) = @_;
+
+ for ( my $i = 0; $i <= $#{$modulesref}; $i++ )
+ {
+ my $onefeature = ${$modulesref}[$i];
+ my $styles = "";
+ if ( $onefeature->{'Styles'} ) { $styles = $onefeature->{'Styles'}; }
+ if ( $styles =~ /\bLANGUAGEMODULE\b/ )
+ {
+ if ( ! exists($onefeature->{'Language'}) ) { installer::exiter::exit_program("ERROR: \"$onefeature->{'gid'}\" has flag LANGUAGEMODULE, but does not know its language!", "select_required_language_strings"); }
+ my $lang = $onefeature->{'Language'};
+
+ if (( exists($installer::globals::all_english_languagestrings{$lang}) ) && ( ! exists($installer::globals::all_required_english_languagestrings{$lang}) ))
+ {
+ $installer::globals::all_required_english_languagestrings{$lang} = $installer::globals::all_english_languagestrings{$lang};
+ }
+ }
+ }
+}
+
+#####################################################################################
+# Unixlinks are not always required. For Linux RPMs and Solaris Packages they are
+# created dynamically. Exception: For package formats "installed" or "archive".
+# In scp2 this unixlinks have the flag LAYERLINK.
+#####################################################################################
+
+sub filter_layerlinks_from_unixlinks
+{
+ my ( $unixlinksref ) = @_;
+
+ my @alllinks = ();
+
+ for ( my $i = 0; $i <= $#{$unixlinksref}; $i++ )
+ {
+ my $isrequired = 1;
+
+ my $onelink = ${$unixlinksref}[$i];
+ my $styles = "";
+ if ( $onelink->{'Styles'} ) { $styles = $onelink->{'Styles'}; }
+
+ if ( $styles =~ /\bLAYERLINK\b/ )
+ {
+ # Platforms, that do not need the layer links
+ if (( $installer::globals::islinuxrpmbuild ) || ( $installer::globals::issolarispkgbuild ))
+ {
+ $isrequired = 0;
+ }
+
+ # Package formats, that need the layer link (platform independent)
+ if (( $installer::globals::packageformat eq "installed" ) || ( $installer::globals::packageformat eq "archive" ))
+ {
+ $isrequired = 1;
+ }
+ }
+
+ if ( $isrequired ) { push(@alllinks, $onelink); }
+ }
+
+ return \@alllinks;
+}
+
+1;
diff --git a/solenv/bin/modules/installer/setupscript.pm b/solenv/bin/modules/installer/setupscript.pm
new file mode 100644
index 000000000000..a3bf5abf50a9
--- /dev/null
+++ b/solenv/bin/modules/installer/setupscript.pm
@@ -0,0 +1,540 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::setupscript;
+
+use installer::existence;
+use installer::exiter;
+use installer::globals;
+use installer::logger;
+use installer::remover;
+use installer::scriptitems;
+use installer::ziplist;
+
+#######################################################
+# Set setup script name, if not defined as parameter
+#######################################################
+
+sub set_setupscript_name
+{
+ my ( $allsettingsarrayref, $includepatharrayref ) = @_;
+
+ my $scriptnameref = installer::ziplist::getinfofromziplist($allsettingsarrayref, "script");
+
+ my $scriptname = $$scriptnameref;
+
+ if ( $scriptname eq "" ) # not defined on command line and not in product list
+ {
+ installer::exiter::exit_program("ERROR: Setup script not defined on command line (-l) and not in product list!", "set_setupscript_name");
+ }
+
+ if ( $installer::globals::compiler =~ /wnt/ )
+ {
+ $scriptname .= ".inf";
+ }
+ else
+ {
+ $scriptname .= ".ins";
+ }
+
+ # and now the complete path for the setup script is needed
+ # The log file cannot be used, because this is the language independent section
+
+ $scriptnameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$scriptname, $includepatharrayref, 1);
+
+ $installer::globals::setupscriptname = $$scriptnameref;
+
+ if ( $installer::globals::setupscriptname eq "" )
+ {
+ installer::exiter::exit_program("ERROR: Script $scriptname not found!", "set_setupscript_name");
+ }
+}
+
+#####################################################################
+# Reading script variables from installation object of script file
+#####################################################################
+
+sub get_all_scriptvariables_from_installation_object
+{
+ my ($scriptref) = @_;
+
+ my @installobjectvariables;
+
+ for ( my $i = 0; $i <= $#{$scriptref}; $i++ )
+ {
+ my $line = ${$scriptref}[$i];
+
+ if ( $line =~ /^\s*Installation\s+\w+\s*$/ ) # should be the first line
+ {
+ my $counter = $i+1;
+ my $installline = ${$scriptref}[$counter];
+
+ while (!($installline =~ /^\s*End\s*$/ ))
+ {
+ if ( $installline =~ /^\s*(\w+)\s+\=\s*(.*?)\s*\;\s*$/ )
+ {
+ my $key = $1;
+ my $value = $2;
+
+ # removing leading and ending " in $value
+
+ if ( $value =~ /^\s*\"(.*)\"\s*$/ )
+ {
+ $value = $1;
+ }
+
+ $key = "\%" . uc($key); # $key is %PRODUCTNAME
+
+ my $input = $key . " " . $value . "\n"; # $key can only be the first word
+
+ push(@installobjectvariables ,$input);
+ }
+
+ $counter++;
+ $installline = ${$scriptref}[$counter];
+ }
+ }
+
+ last; # not interesting after installation object
+ }
+
+ return \@installobjectvariables;
+}
+
+######################################################################
+# Including LCPRODUCTNAME into the array
+######################################################################
+
+sub add_lowercase_productname_setupscriptvariable
+{
+ my ( $variablesref ) = @_;
+
+ for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
+ {
+ my $variableline = ${$variablesref}[$j];
+
+ my ($key, $value);
+
+ if ( $variableline =~ /^\s*\%(\w+?)\s+(.*?)\s*$/ )
+ {
+ $key = $1;
+ $value = $2;
+
+ if ( $key eq "PRODUCTNAME" )
+ {
+ my $newline = "\%LCPRODUCTNAME " . lc($value) . "\n";
+ push(@{$variablesref} ,$newline);
+ my $original = $value;
+ $value =~ s/\s*//g;
+ $newline = "\%ONEWORDPRODUCTNAME " . $value . "\n";
+ push(@{$variablesref} ,$newline);
+ $newline = "\%LCONEWORDPRODUCTNAME " . lc($value) . "\n";
+ push(@{$variablesref} ,$newline);
+ $value = $original;
+ $value =~ s/\s*$//g;
+ $value =~ s/^\s*//g;
+ $value =~ s/ /\%20/g;
+ $newline = "\%MASKEDPRODUCTNAME " . $value . "\n";
+ push(@{$variablesref} ,$newline);
+ $value = $original;
+ $value =~ s/\s/\_/g;
+ # if ( $value =~ /^\s*(.*?)\_(\w)(.*?)\_(\w)(.*)\s*$/ ) { $value = $1 . $2 . $4; }
+ $newline = "\%UNIXPRODUCTNAME " . lc($value) . "\n";
+ push(@{$variablesref} ,$newline);
+ $newline = "\%SYSTEMINTUNIXPACKAGENAME " . lc($value) . "\n";
+ push(@{$variablesref} ,$newline);
+ # if ( $value =~ /^\s*(.*?)\_(\w)(.*?)\_(\w)(.*)\s*$/ ) { $value = $1 . $2 . $4; }
+ # if ( $value =~ /^\s*(.*?)\_(\w)(.*?)\_(\w)(.*)\s*$/ ) { $value = $2 . $4; }
+ $newline = "\%UNIXPACKAGENAME " . lc($value) . "\n";
+ push(@{$variablesref} ,$newline);
+ $value = $original;
+ $value =~ s/\s/\_/g;
+ $value =~ s/\.//g;
+ # if ( $value =~ /^\s*(.*?)\_(\w)(.*?)\_(\w)(.*)\s*$/ ) { $value = $1 . $2 . $4; }
+ $newline = "\%WITHOUTDOTUNIXPRODUCTNAME " . lc($value) . "\n";
+ push(@{$variablesref} ,$newline);
+ # if ( $value =~ /^\s*(.*?)\_(\w)(.*?)\_(\w)(.*)\s*$/ ) { $value = $1 . $2 . $4; }
+ # if ( $value =~ /^\s*(.*?)\_(\w)(.*?)\_(\w)(.*)\s*$/ ) { $value = $2 . $4; }
+ $newline = "\%WITHOUTDOTUNIXPACKAGENAME " . lc($value) . "\n";
+ push(@{$variablesref} ,$newline);
+ $newline = "\%SOLARISBRANDPACKAGENAME " . lc($value) . "\n";
+ push(@{$variablesref} ,$newline);
+ $value = $original;
+ }
+ elsif ( $key eq "PRODUCTEXTENSION" )
+ {
+ my $newline = "\%LCPRODUCTEXTENSION " . lc($value) . "\n";
+ push(@{$variablesref} ,$newline);
+ }
+ elsif ( $key eq "PRODUCTVERSION" )
+ {
+ $value =~ s/\.//g;
+ my $newline = "\%WITHOUTDOTPRODUCTVERSION " . $value . "\n";
+ push(@{$variablesref} ,$newline);
+ }
+ elsif ( $key eq "OOOBASEVERSION" )
+ {
+ $value =~ s/\.//g;
+ my $newline = "\%WITHOUTDOTOOOBASEVERSION " . $value . "\n";
+ push(@{$variablesref} ,$newline);
+ }
+
+ }
+ }
+}
+
+######################################################################
+# Resolving the new introduced lowercase script variables
+######################################################################
+
+sub resolve_lowercase_productname_setupscriptvariable
+{
+ my ( $variablesref ) = @_;
+
+ my %variables = ();
+
+ # First step: Collecting variables
+
+ for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
+ {
+ my $variableline = ${$variablesref}[$j];
+
+ my ($key, $value);
+
+ if ( $variableline =~ /^\s*\%(\w+?)\s+(.*?)\s*$/ )
+ {
+ $key = $1;
+ $value = $2;
+ $variables{$key} = $value;
+ }
+ }
+
+ # Second step: Resolving variables
+
+ for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
+ {
+ if ( ${$variablesref}[$j] =~ /\$\{(.*?)\}/ )
+ {
+ my $key = $1;
+ ${$variablesref}[$j] =~ s/\$\{\Q$key\E\}/$variables{$key}/g;
+ }
+ }
+
+}
+
+######################################################################
+# Replacing all setup script variables inside the setup script file
+######################################################################
+
+sub replace_all_setupscriptvariables_in_script
+{
+ my ( $scriptref, $variablesref ) = @_;
+
+ installer::logger::include_header_into_globallogfile("Replacing variables in setup script (start)");
+
+ # make hash of variables to be substituted if they appear in the script
+ my %subs;
+ for ( my $j = 0; $j <= $#{$variablesref}; $j++ )
+ {
+ my $variableline = ${$variablesref}[$j];
+
+ if ( $variableline =~ /^\s*(\%\w+?)\s+(.*?)\s*$/ )
+ {
+ $subs{$1}= $2;
+ }
+ }
+
+ # This is far faster than running a regexp for each line
+ my $bigstring = '';
+ for my $line (@{$scriptref}) { $bigstring = $bigstring . $line; }
+
+ foreach my $key ( keys %subs )
+ {
+ # Attention: It must be possible to substitute "%PRODUCTNAMEn", "%PRODUCTNAME%PRODUCTVERSIONabc"
+ my $value = $subs{$key};
+ $bigstring =~ s/$key/$value/g;
+ }
+
+ my @newlines = split /\n/, $bigstring;
+ $scriptref = \@newlines;
+
+ # now check for any mis-named '%' variables that we have left
+ my $num = 0;
+ for my $check (@newlines)
+ {
+ $num++;
+ if ( $check =~ /^.*\%\w+.*$/ )
+ {
+ if (( $check =~ /%1/ ) || ( $check =~ /%2/ ) || ( $check =~ /%verify/ )) { next; }
+ my $infoline = "WARNING: mis-named or un-known '%' variable in setup script at line $num:\n$check\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ # print STDERR "Warning: mis-named or un-known '%' variable at line $num:\n$check\n";
+ }
+ }
+
+ installer::logger::include_header_into_globallogfile("Replacing variables in setup script (end)");
+
+ return $scriptref;
+}
+
+#######################################################################
+# Collecting all items of the type "searchitem" from the setup script
+#######################################################################
+
+sub get_all_items_from_script
+{
+ my ($scriptref, $searchitem) = @_;
+
+ my @allitemarray = ();
+
+ my ($itemkey, $itemvalue, $valuecounter);
+
+ for ( my $i = 0; $i <= $#{$scriptref}; $i++ )
+ {
+ my $line = ${$scriptref}[$i];
+
+ if ( $line =~ /^\s*\Q$searchitem\E\s+(\S+)\s*$/ )
+ {
+ my $gid = $1;
+ my $counter = $i + 1;
+
+ my %oneitemhash = ();
+ my $ismultilang = 0;
+
+ $oneitemhash{'gid'} = $gid;
+
+ while (!( $line =~ /^\s*End\s*$/ ))
+ {
+ if ( $counter > $#{$scriptref} ) {
+ installer::exiter::exit_program("Invalid setup script file. End of file reached before 'End' line of '$searchitem' section.", "get_all_items_from_script");
+ }
+ $line = ${$scriptref}[$counter];
+ $counter++;
+
+ if ( $line =~ /^\s*(.+?)\s*\=\s*(.+?)\s*\;\s*$/ ) # only oneliner!
+ {
+ $itemkey = $1;
+ $itemvalue = $2;
+
+ installer::remover::remove_leading_and_ending_quotationmarks(\$itemvalue);
+ $itemvalue =~ s/\s*$//; # removing ending whitespaces. Could be introduced by empty variables.
+
+ $oneitemhash{$itemkey} = $itemvalue;
+
+ if ( $itemkey =~ /^\s*\S+\s+\(\S+\)\s*$/ )
+ {
+ $ismultilang = 1;
+ }
+ }
+ else
+ {
+ if ( $searchitem eq "Module" ) # more than one line, for instance files at modules!
+ {
+ if (( $line =~ /^\s*(.+?)\s*\=\s*\(/ ) && (!($line =~ /\)\;\s*$ / )))
+ {
+ if ( $line =~ /^\s*(.+?)\s*\=\s*(.+)/ ) # the first line
+ {
+ $itemkey = $1;
+ $itemvalue = $2;
+ $itemvalue =~ s/\s*$//;
+ }
+
+ # collecting the complete itemvalue
+
+ $valuecounter = $counter;
+ $line = ${$scriptref}[$valuecounter];
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ $itemvalue = $itemvalue . $line;
+
+ while (!( $line =~ /\)\;\s*$/ ))
+ {
+ $valuecounter++;
+ $line = ${$scriptref}[$valuecounter];
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ $itemvalue = $itemvalue . $line;
+ }
+
+ # removing ending ";"
+ $itemvalue =~ s/\;\s*$//;
+
+ $oneitemhash{$itemkey} = $itemvalue;
+
+ if ( $itemkey =~ /^\s*\S+\s+\(\S+\)\s*$/ )
+ {
+ $ismultilang = 1;
+ }
+ }
+ }
+ }
+ }
+
+ $oneitemhash{'ismultilingual'} = $ismultilang;
+
+ push(@allitemarray, \%oneitemhash);
+ }
+ }
+
+ return \@allitemarray;
+}
+
+######################################################################
+# Collecting all folder at folderitems, that are predefined values
+# For example: PREDEFINED_AUTOSTART
+######################################################################
+
+sub add_predefined_folder
+{
+ my ( $folderitemref, $folderref ) = @_;
+
+ for ( my $i = 0; $i <= $#{$folderitemref}; $i++ )
+ {
+ my $folderitem = ${$folderitemref}[$i];
+ my $folderid = $folderitem->{'FolderID'};
+
+ if ( $folderid =~ /PREDEFINED_/ )
+ {
+ if (! installer::existence::exists_in_array_of_hashes("gid", $folderid, $folderref))
+ {
+ my %folder = ();
+ $folder{'ismultilingual'} = "0";
+ $folder{'Name'} = "";
+ $folder{'gid'} = $folderid;
+
+ push(@{$folderref}, \%folder);
+ }
+ }
+ }
+}
+
+#####################################################################################
+# If folderitems are non-advertised, the component needs to have a registry key
+# below HKCU as key path. Therefore it is required, to mark the file belonging
+# to a non-advertised shortcut, that a special userreg_xxx registry key can be
+# created during packing process.
+#####################################################################################
+
+sub prepare_non_advertised_files
+{
+ my ( $folderitemref, $filesref ) = @_;
+
+ for ( my $i = 0; $i <= $#{$folderitemref}; $i++ )
+ {
+ my $folderitem = ${$folderitemref}[$i];
+ my $styles = "";
+ if ( $folderitem->{'Styles'} ) { $styles = $folderitem->{'Styles'}; }
+
+ if ( $styles =~ /\bNON_ADVERTISED\b/ )
+ {
+ my $fileid = $folderitem->{'FileID'};
+ if ( $folderitem->{'ComponentIDFile'} ) { $fileid = $folderitem->{'ComponentIDFile'}; }
+ my $onefile = installer::worker::find_file_by_id($filesref, $fileid);
+
+ # Attention: If $onefile with "FileID" is not found, this is not always an error.
+ # FileID can also contain an executable file, for example msiexec.exe.
+ if ( $onefile ne "" ) { $onefile->{'needs_user_registry_key'} = 1; }
+ }
+ }
+}
+
+#####################################################################################
+# Adding all variables defined in the installation object into the hash
+# of all variables from the zip list file.
+# This is needed if variables are defined in the installation object,
+# but not in the zip list file.
+# If there is a definition in the zip list file and in the installation
+# object, the installation object is more important
+#####################################################################################
+
+sub add_installationobject_to_variables
+{
+ my ($allvariables, $allscriptvariablesref) = @_;
+
+ for ( my $i = 0; $i <= $#{$allscriptvariablesref}; $i++ )
+ {
+ my $line = ${$allscriptvariablesref}[$i];
+
+ if ( $line =~ /^\s*\%(\w+)\s+(.*?)\s*$/ )
+ {
+ my $key = $1;
+ my $value = $2;
+
+ $allvariables->{$key} = $value; # overwrite existing values from zip.lst
+ }
+ }
+}
+
+#####################################################################################
+# Adding all variables, that must be defined, but are not defined until now.
+# List of this varibles: @installer::globals::forced_properties
+#####################################################################################
+
+sub add_forced_properties
+{
+ my ($allvariables) = @_;
+
+ my $property;
+ foreach $property ( @installer::globals::forced_properties )
+ {
+ if ( ! exists($allvariables->{$property}) ) { $allvariables->{$property} = ""; }
+ }
+}
+
+#####################################################################################
+# Some properties are created automatically. It should be possible to
+# overwrite them, with PRESET properties. For example UNIXPRODUCTNAME
+# with PRESETUNIXPRODUCTNAME, if this is defined and the automatic process
+# does not deliver the desired results.
+#####################################################################################
+
+sub replace_preset_properties
+{
+ my ($allvariables) = @_;
+
+ # SOLARISBRANDPACKAGENAME
+ # needs to be replaced by
+ # PRESETSOLARISBRANDPACKAGENAME
+
+ my @presetproperties = ();
+ push(@presetproperties, "SOLARISBRANDPACKAGENAME");
+ push(@presetproperties, "SYSTEMINTUNIXPACKAGENAME");
+ # push(@presetproperties, "UNIXPACKAGENAME");
+ # push(@presetproperties, "WITHOUTDOTUNIXPACKAGENAME");
+ # push(@presetproperties, "UNIXPRODUCTNAME");
+ # push(@presetproperties, "WITHOUTDOTUNIXPRODUCTNAME");
+
+
+ foreach $property ( @presetproperties )
+ {
+ my $presetproperty = "PRESET" . $property;
+ if (( exists($allvariables->{$presetproperty}) ) && ( $allvariables->{$presetproperty} ne "" ))
+ {
+ $allvariables->{$property} = $allvariables->{$presetproperty};
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/installer/simplepackage.pm b/solenv/bin/modules/installer/simplepackage.pm
new file mode 100644
index 000000000000..d76b81a55850
--- /dev/null
+++ b/solenv/bin/modules/installer/simplepackage.pm
@@ -0,0 +1,836 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::simplepackage;
+
+# use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
+use Cwd;
+use File::Copy;
+use installer::download;
+use installer::exiter;
+use installer::globals;
+use installer::logger;
+use installer::strip;
+use installer::systemactions;
+use installer::worker;
+
+####################################################
+# Checking if the simple packager is required.
+# This can be achieved by setting the global
+# variable SIMPLE_PACKAGE in *.lst file or by
+# setting the environment variable SIMPLE_PACKAGE.
+####################################################
+
+sub check_simple_packager_project
+{
+ my ( $allvariables ) = @_;
+
+ if (( $installer::globals::packageformat eq "installed" ) ||
+ ( $installer::globals::packageformat eq "archive" ))
+ {
+ $installer::globals::is_simple_packager_project = 1;
+ $installer::globals::patch_user_dir = 1;
+ }
+ elsif( $installer::globals::packageformat eq "dmg" )
+ {
+ $installer::globals::is_simple_packager_project = 1;
+ }
+}
+
+####################################################
+# Detecting the directory with extensions
+####################################################
+
+sub get_extensions_dir
+{
+ my ( $subfolderdir ) = @_;
+
+ my $extensiondir = $subfolderdir . $installer::globals::separator;
+ if ( $installer::globals::officedirhostname ne "" ) { $extensiondir = $extensiondir . $installer::globals::officedirhostname . $installer::globals::separator; }
+ my $extensionsdir = $extensiondir . "share" . $installer::globals::separator . "extensions";
+ my $preregdir = $extensiondir . "share" . $installer::globals::separator . "prereg" . $installer::globals::separator . "bundled";
+
+ return ( $extensionsdir, $preregdir );
+}
+
+####################################################
+# Registering extensions
+####################################################
+
+sub register_extensions
+{
+ my ($officedir, $languagestringref, $preregdir) = @_;
+
+ my $infoline = "";
+
+ if ( $preregdir eq "" )
+ {
+ $infoline = "ERROR: Failed to determine directory \"prereg\" for extension registration! Please check your installation set.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program($infoline, "register_extensions");
+ }
+
+ my $programdir = $officedir . $installer::globals::separator;
+ if ( $installer::globals::officedirhostname ne "" ) { $programdir = $programdir . $installer::globals::officedirhostname . $installer::globals::separator; }
+ $programdir = $programdir . "program";
+
+ my $from = cwd();
+ chdir($programdir);
+
+ my $unopkgfile = $installer::globals::unopkgfile;
+
+ my $unopkgexists = 1;
+ if (( $installer::globals::languagepack ) && ( ! -f $unopkgfile ))
+ {
+ $unopkgexists = 0;
+ $infoline = "Language packs do not contain unopkg!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( ! -f $unopkgfile )
+ {
+ $unopkgexists = 0;
+ $infoline = "Info: File $unopkgfile does not exist! Extensions cannot be registered.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( $unopkgexists )
+ {
+ my $currentdir = cwd();
+ print "... current dir: $currentdir ...\n";
+ $infoline = "Current dir: $currentdir\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( ! -f $unopkgfile ) { installer::exiter::exit_program("ERROR: $unopkgfile not found!", "register_extensions"); }
+
+ my $localtemppath = installer::systemactions::create_directories("uno", $languagestringref);
+
+ my $slash = "";
+
+ if ( $installer::globals::iswindowsbuild )
+ {
+ if ( $^O =~ /cygwin/i )
+ {
+ $localtemppath = $installer::globals::cyg_temppath;
+ $preregdir = qx{cygpath -m "$preregdir"};
+ chomp($preregdir);
+ }
+ $localtemppath =~ s/\\/\//g;
+ $slash = "/"; # Third slash for Windows. Other OS pathes already start with "/"
+ }
+
+ $preregdir =~ s/\/\s*$//g;
+
+ my $systemcall = $unopkgfile . " sync --verbose -env:BUNDLED_EXTENSIONS_USER=\"file://" . $slash . $preregdir . "\"" . " -env:UserInstallation=file://" . $slash . $localtemppath . " -env:UNO_JAVA_JFW_ENV_JREHOME=true 2\>\&1 |";
+
+ print "... $systemcall ...\n";
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my @unopkgoutput = ();
+
+ open (UNOPKG, $systemcall);
+ while (<UNOPKG>)
+ {
+ my $lastline = $_;
+ push(@unopkgoutput, $lastline);
+ }
+ close (UNOPKG);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ if ($returnvalue)
+ {
+ # Writing content of @unopkgoutput only in the error case into the log file. Sometimes it
+ # contains strings like "Error" even in the case of success. This causes a packaging error
+ # when the log file is analyzed at the end, even if there is no real error.
+ for ( my $j = 0; $j <= $#unopkgoutput; $j++ ) { push( @installer::globals::logfileinfo, "$unopkgoutput[$j]"); }
+
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\nExitcode: '$returnvalue'\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: $systemcall failed!", "register_extensions");
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ chdir($from);
+}
+
+########################################################################
+# Getting the translation file for the Mac Language Pack installer
+########################################################################
+
+sub get_mac_translation_file
+{
+ my $translationfilename = $installer::globals::maclangpackfilename;
+ # my $translationfilename = $installer::globals::idtlanguagepath . $installer::globals::separator . $installer::globals::maclangpackfilename;
+ # if ( $installer::globals::unicodensis ) { $translationfilename = $translationfilename . ".uulf"; }
+ # else { $translationfilename = $translationfilename . ".mlf"; }
+ if ( ! -f $translationfilename ) { installer::exiter::exit_program("ERROR: Could not find language file $translationfilename!", "get_mac_translation_file"); }
+ my $translationfile = installer::files::read_file($translationfilename);
+
+ my $infoline = "Reading translation file: $translationfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return $translationfile;
+}
+
+##################################################################
+# Collecting all identifier from ulf file
+##################################################################
+
+sub get_identifier
+{
+ my ( $translationfile ) = @_;
+
+ my @identifier = ();
+
+ for ( my $i = 0; $i <= $#{$translationfile}; $i++ )
+ {
+ my $oneline = ${$translationfile}[$i];
+
+ if ( $oneline =~ /^\s*\[(.+)\]\s*$/ )
+ {
+ my $identifier = $1;
+ push(@identifier, $identifier);
+ }
+ }
+
+ return \@identifier;
+}
+
+##############################################################
+# Returning the complete block in all languages
+# for a specified string
+##############################################################
+
+sub get_language_block_from_language_file
+{
+ my ($searchstring, $languagefile) = @_;
+
+ my @language_block = ();
+
+ for ( my $i = 0; $i <= $#{$languagefile}; $i++ )
+ {
+ if ( ${$languagefile}[$i] =~ /^\s*\[\s*$searchstring\s*\]\s*$/ )
+ {
+ my $counter = $i;
+
+ push(@language_block, ${$languagefile}[$counter]);
+ $counter++;
+
+ while (( $counter <= $#{$languagefile} ) && (!( ${$languagefile}[$counter] =~ /^\s*\[/ )))
+ {
+ push(@language_block, ${$languagefile}[$counter]);
+ $counter++;
+ }
+
+ last;
+ }
+ }
+
+ return \@language_block;
+}
+
+##############################################################
+# Returning a specific language string from the block
+# of all translations
+##############################################################
+
+sub get_language_string_from_language_block
+{
+ my ($language_block, $language) = @_;
+
+ my $newstring = "";
+
+ for ( my $i = 0; $i <= $#{$language_block}; $i++ )
+ {
+ if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
+ {
+ $newstring = $1;
+ last;
+ }
+ }
+
+ if ( $newstring eq "" )
+ {
+ $language = "en-US"; # defaulting to english
+
+ for ( my $i = 0; $i <= $#{$language_block}; $i++ )
+ {
+ if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
+ {
+ $newstring = $1;
+ last;
+ }
+ }
+ }
+
+ return $newstring;
+}
+
+########################################################################
+# Localizing the script for the Mac Language Pack installer
+########################################################################
+
+sub localize_scriptfile
+{
+ my ($scriptfile, $translationfile, $languagestringref) = @_;
+
+ # my $translationfile = get_mac_translation_file();
+
+ my $onelanguage = $$languagestringref;
+ if ( $onelanguage =~ /^\s*(.*?)_/ ) { $onelanguage = $1; }
+
+ # Analyzing the ulf file, collecting all Identifier
+ my $allidentifier = get_identifier($translationfile);
+
+ for ( my $i = 0; $i <= $#{$allidentifier}; $i++ )
+ {
+ my $identifier = ${$allidentifier}[$i];
+ my $language_block = get_language_block_from_language_file($identifier, $translationfile);
+ my $newstring = get_language_string_from_language_block($language_block, $onelanguage);
+
+ # removing mask
+ $newstring =~ s/\\\'/\'/g;
+
+ replace_one_variable_in_shellscript($scriptfile, $newstring, $identifier);
+ }
+}
+
+#################################################################################
+# Replacing one variable in Mac shell script
+#################################################################################
+
+sub replace_one_variable_in_shellscript
+{
+ my ($scriptfile, $variable, $searchstring) = @_;
+
+ for ( my $i = 0; $i <= $#{$scriptfile}; $i++ )
+ {
+ ${$scriptfile}[$i] =~ s/\[$searchstring\]/$variable/g;
+ }
+}
+
+#############################################
+# Replacing variables in Mac shell script
+#############################################
+
+sub replace_variables_in_scriptfile
+{
+ my ($scriptfile, $volume_name, $volume_name_app, $allvariables) = @_;
+
+ replace_one_variable_in_shellscript($scriptfile, $volume_name, "FULLPRODUCTNAME" );
+ replace_one_variable_in_shellscript($scriptfile, $volume_name_app, "FULLAPPPRODUCTNAME" );
+ replace_one_variable_in_shellscript($scriptfile, $allvariables->{'PRODUCTNAME'}, "PRODUCTNAME" );
+ replace_one_variable_in_shellscript($scriptfile, $allvariables->{'PRODUCTVERSION'}, "PRODUCTVERSION" );
+
+ my $scriptname = lc($allvariables->{'PRODUCTNAME'}) . "\.script";
+ if ( $allvariables->{'PRODUCTNAME'} eq "OpenOffice.org" ) { $scriptname = "org.openoffice.script"; }
+
+ replace_one_variable_in_shellscript($scriptfile, $scriptname, "SEARCHSCRIPTNAME" );
+}
+
+#############################################
+# Creating the "simple" package.
+# "zip" for Windows
+# "tar.gz" for all other platforms
+# additionally "dmg" on Mac OS X
+#############################################
+
+sub create_package
+{
+ my ( $installdir, $archivedir, $packagename, $allvariables, $includepatharrayref, $languagestringref, $format ) = @_;
+
+ installer::logger::print_message( "... creating $installer::globals::packageformat file ...\n" );
+ installer::logger::include_header_into_logfile("Creating $installer::globals::packageformat file:");
+
+ # moving dir into temporary directory
+ my $pid = $$; # process id
+ my $tempdir = $installdir . "_temp" . "." . $pid;
+ my $systemcall = "";
+ my $from = "";
+ my $makesystemcall = 1;
+ my $return_to_start = 0;
+ installer::systemactions::rename_directory($installdir, $tempdir);
+
+ # creating new directory with original name
+ installer::systemactions::create_directory($archivedir);
+
+ my $archive = $archivedir . $installer::globals::separator . $packagename . $format;
+
+ if ( $archive =~ /zip$/ )
+ {
+ $from = cwd();
+ $return_to_start = 1;
+ chdir($tempdir);
+ $systemcall = "$installer::globals::zippath -qr $archive .";
+
+ # Using Archive::Zip fails because of very long path names below "share/uno_packages/cache"
+ # my $packzip = Archive::Zip->new();
+ # $packzip->addTree("."); # after changing into $tempdir
+ # $packzip->writeToFileNamed($archive);
+ # $makesystemcall = 0;
+ }
+ elsif ( $archive =~ /dmg$/ )
+ {
+ my $folder = (( -l "$tempdir/$packagename/Applications" ) or ( -l "$tempdir/$packagename/opt" )) ? $packagename : "\.";
+
+ if ( $allvariables->{'PACK_INSTALLED'} ) {
+ $folder = $packagename;
+ }
+
+ # my $volume_name = $allvariables->{'PRODUCTNAME'} . ' ' . $allvariables->{'PRODUCTVERSION'}; # Adding PRODUCTVERSION makes this difficult to maintain!
+ my $volume_name = $allvariables->{'PRODUCTNAME'};
+ my $volume_name_classic = $allvariables->{'PRODUCTNAME'} . ' ' . $allvariables->{'PRODUCTVERSION'};
+ my $volume_name_classic_app = $volume_name; # "app" should not contain version number
+ # $volume_name = $volume_name . ' ' . $allvariables->{'PRODUCTEXTENSION'} if $allvariables->{'PRODUCTEXTENSION'}; # Adding PRODUCTEXTENSION makes this difficult to maintain!
+ $volume_name_classic = $volume_name_classic . ' ' . $allvariables->{'PRODUCTEXTENSION'} if $allvariables->{'PRODUCTEXTENSION'};
+ $volume_name_classic_app = $volume_name_classic_app . ' ' . $allvariables->{'PRODUCTEXTENSION'} if $allvariables->{'PRODUCTEXTENSION'};
+ if ( $allvariables->{'DMG_VOLUMEEXTENSION'} ) {
+ $volume_name = $volume_name . ' ' . $allvariables->{'DMG_VOLUMEEXTENSION'};
+ $volume_name_classic = $volume_name_classic . ' ' . $allvariables->{'DMG_VOLUMEEXTENSION'};
+ $volume_name_classic_app = $volume_name_classic_app . ' ' . $allvariables->{'DMG_VOLUMEEXTENSION'};
+ }
+
+ my $sla = 'sla.r';
+ my $ref = "";
+
+ if ( ! $allvariables->{'HIDELICENSEDIALOG'} )
+ {
+ installer::scriptitems::get_sourcepath_from_filename_and_includepath( \$sla, $includepatharrayref, 0);
+ }
+
+ my $localtempdir = $tempdir;
+
+ if (( $installer::globals::languagepack ) || ( $installer::globals::patch ))
+ {
+ $localtempdir = "$tempdir/$packagename";
+ if ( $installer::globals::languagepack )
+ {
+ $volume_name = "$volume_name Language Pack";
+ $volume_name_classic = "$volume_name_classic Language Pack";
+ $volume_name_classic_app = "$volume_name_classic_app Language Pack";
+ }
+ if ( $installer::globals::patch )
+ {
+ $volume_name = "$volume_name Patch";
+ $volume_name_classic = "$volume_name_classic Patch";
+ $volume_name_classic_app = "$volume_name_classic_app Patch";
+ }
+
+ # Create tar ball named tarball.tar.bz2
+ # my $appfolder = $localtempdir . "/" . $volume_name . "\.app";
+ my $appfolder = $localtempdir . "/" . $volume_name_classic_app . "\.app";
+ my $contentsfolder = $appfolder . "/Contents";
+ my $tarballname = "tarball.tar.bz2";
+
+ my $localfrom = cwd();
+ chdir $appfolder;
+
+ $systemcall = "tar -cjf $tarballname Contents/";
+
+ print "... $systemcall ...\n";
+ my $localreturnvalue = system($systemcall);
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($localreturnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ my $sourcefile = $appfolder . "/" . $tarballname;
+ my $destfile = $contentsfolder . "/" . $tarballname;
+
+ installer::systemactions::remove_complete_directory($contentsfolder);
+ installer::systemactions::create_directory($contentsfolder);
+
+ installer::systemactions::copy_one_file($sourcefile, $destfile);
+ unlink($sourcefile);
+
+ # Copy two files into installation set next to the tar ball
+ # 1. "osx_install.applescript"
+ # 2 "OpenOffice.org Languagepack"
+
+ my $scriptrealfilename = "osx_install.applescript";
+ my $scriptfilename = "";
+ if ( $installer::globals::languagepack ) { $scriptfilename = "osx_install_languagepack.applescript"; }
+ if ( $installer::globals::patch ) { $scriptfilename = "osx_install_patch.applescript"; }
+ my $scripthelpersolverfilename = "mac_install.script";
+ # my $scripthelperrealfilename = $volume_name;
+ my $scripthelperrealfilename = $volume_name_classic_app;
+ my $translationfilename = $installer::globals::macinstallfilename;
+
+ # Finding both files in solver
+
+ my $scriptref = installer::scriptitems::get_sourcepath_from_filename_and_includepath( \$scriptfilename, $includepatharrayref, 0);
+ if ($$scriptref eq "") { installer::exiter::exit_program("ERROR: Could not find Apple script $scriptfilename!", "create_package"); }
+ my $scripthelperref = installer::scriptitems::get_sourcepath_from_filename_and_includepath( \$scripthelpersolverfilename, $includepatharrayref, 0);
+ if ($$scripthelperref eq "") { installer::exiter::exit_program("ERROR: Could not find Apple script $scripthelpersolverfilename!", "create_package"); }
+ my $translationfileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath( \$translationfilename, $includepatharrayref, 0);
+ if ($$translationfileref eq "") { installer::exiter::exit_program("ERROR: Could not find Apple script translation file $translationfilename!", "create_package"); }
+
+ $scriptfilename = $contentsfolder . "/" . $scriptrealfilename;
+ $scripthelperrealfilename = $contentsfolder . "/" . $scripthelperrealfilename;
+
+ installer::systemactions::copy_one_file($$scriptref, $scriptfilename);
+ installer::systemactions::copy_one_file($$scripthelperref, $scripthelperrealfilename);
+
+ # Replacing variables in script $scriptfilename
+ # Localizing script $scriptfilename
+ my $scriptfilecontent = installer::files::read_file($scriptfilename);
+ my $translationfilecontent = installer::files::read_file($$translationfileref);
+ localize_scriptfile($scriptfilecontent, $translationfilecontent, $languagestringref);
+ # replace_variables_in_scriptfile($scriptfilecontent, $volume_name, $allvariables);
+ replace_variables_in_scriptfile($scriptfilecontent, $volume_name_classic, $volume_name_classic_app, $allvariables);
+ installer::files::save_file($scriptfilename, $scriptfilecontent);
+
+ $systemcall = "chmod 775 " . "\"" . $scriptfilename . "\"";
+ system($systemcall);
+ $systemcall = "chmod 775 " . "\"" . $scripthelperrealfilename . "\"";
+ system($systemcall);
+
+ # Copy also Info.plist and icon file
+ # Finding both files in solver
+ my $iconfile = "ooo3_installer.icns";
+ my $iconfileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath( \$iconfile, $includepatharrayref, 0);
+ if ($$iconfileref eq "") { installer::exiter::exit_program("ERROR: Could not find Apple script icon file $iconfile!", "create_package"); }
+ my $subdir = $contentsfolder . "/" . "Resources";
+ if ( ! -d $subdir ) { installer::systemactions::create_directory($subdir); }
+ $destfile = $subdir . "/" . $iconfile;
+ installer::systemactions::copy_one_file($$iconfileref, $destfile);
+
+ my $infoplistfile = "Info.plist.langpack";
+ my $installname = "Info.plist";
+ my $infoplistfileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath( \$infoplistfile, $includepatharrayref, 0);
+ if ($$infoplistfileref eq "") { installer::exiter::exit_program("ERROR: Could not find Apple script Info.plist: $infoplistfile!", "create_package"); }
+ $destfile = $contentsfolder . "/" . $installname;
+ installer::systemactions::copy_one_file($$infoplistfileref, $destfile);
+
+ # Replacing variables in Info.plist
+ $scriptfilecontent = installer::files::read_file($destfile);
+ # replace_one_variable_in_shellscript($scriptfilecontent, $volume_name, "FULLPRODUCTNAME" );
+ replace_one_variable_in_shellscript($scriptfilecontent, $volume_name_classic_app, "FULLAPPPRODUCTNAME" ); # OpenOffice.org Language Pack
+ installer::files::save_file($destfile, $scriptfilecontent);
+
+ chdir $localfrom;
+ }
+
+ $systemcall = "cd $localtempdir && hdiutil makehybrid -hfs -hfs-openfolder $folder $folder -hfs-volume-name \"$volume_name\" -ov -o $installdir/tmp && hdiutil convert -ov -format UDZO $installdir/tmp.dmg -o $archive && ";
+ if (( $ref ne "" ) && ( $$ref ne "" )) {
+ $systemcall .= "hdiutil unflatten $archive && Rez -a $$ref -o $archive && hdiutil flatten $archive &&";
+ }
+ $systemcall .= "rm -f $installdir/tmp.dmg";
+ }
+ else
+ {
+ # getting the path of the getuid.so (only required for Solaris and Linux)
+ my $getuidlibrary = "";
+ my $ldpreloadstring = "";
+ if (( $installer::globals::issolarisbuild ) || ( $installer::globals::islinuxbuild ))
+ {
+ $getuidlibrary = installer::download::get_path_for_library($includepatharrayref);
+ if ( $getuidlibrary ne "" ) { $ldpreloadstring = "LD_PRELOAD=" . $getuidlibrary; }
+ }
+
+ $systemcall = "cd $tempdir; $ldpreloadstring tar -cf - . | gzip > $archive";
+ }
+
+ if ( $makesystemcall )
+ {
+ print "... $systemcall ...\n";
+ my $returnvalue = system($systemcall);
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ if ( $return_to_start ) { chdir($from); }
+
+ print "... removing $tempdir ...\n";
+ installer::systemactions::remove_complete_directory($tempdir);
+}
+
+####################################################
+# Main method for creating the simple package
+# installation sets
+####################################################
+
+sub create_simple_package
+{
+ my ( $filesref, $dirsref, $scpactionsref, $linksref, $unixlinksref, $loggingdir, $languagestringref, $shipinstalldir, $allsettingsarrayref, $allvariables, $includepatharrayref ) = @_;
+
+ # Creating directories
+
+ my $current_install_number = "";
+ my $infoline = "";
+
+ installer::logger::print_message( "... creating installation directory ...\n" );
+ installer::logger::include_header_into_logfile("Creating installation directory");
+
+ $installer::globals::csp_installdir = installer::worker::create_installation_directory($shipinstalldir, $languagestringref, \$current_install_number);
+ $installer::globals::csp_installlogdir = installer::systemactions::create_directory_next_to_directory($installer::globals::csp_installdir, "log");
+
+ my $installdir = $installer::globals::csp_installdir;
+ my $installlogdir = $installer::globals::csp_installlogdir;
+
+ # Setting package name (similar to the download name)
+ my $packagename = "";
+
+ if ( $installer::globals::packageformat eq "archive" ||
+ $installer::globals::packageformat eq "dmg" )
+ {
+ $installer::globals::csp_languagestring = $$languagestringref;
+
+ my $locallanguage = $installer::globals::csp_languagestring;
+
+ if ( $allvariables->{'OOODOWNLOADNAME'} )
+ {
+ $packagename = installer::download::set_download_filename(\$locallanguage, $allvariables);
+ }
+ else
+ {
+ $downloadname = installer::ziplist::getinfofromziplist($allsettingsarrayref, "downloadname");
+ if ( $installer::globals::languagepack ) { $downloadname = installer::ziplist::getinfofromziplist($allsettingsarrayref, "langpackdownloadname"); }
+ if ( $installer::globals::patch ) { $downloadname = installer::ziplist::getinfofromziplist($allsettingsarrayref, "patchdownloadname"); }
+ $packagename = installer::download::resolve_variables_in_downloadname($allvariables, $$downloadname, \$locallanguage);
+ }
+ }
+
+ # Work around Windows problems with long pathnames (see issue 50885) by
+ # putting the to-be-archived installation tree into the temp directory
+ # instead of the module output tree (unless LOCALINSTALLDIR dictates
+ # otherwise, anyway); can be removed once issue 50885 is fixed:
+ my $tempinstalldir = $installdir;
+ if ( $installer::globals::iswindowsbuild &&
+ $installer::globals::packageformat eq "archive" &&
+ !$installer::globals::localinstalldirset )
+ {
+ $tempinstalldir = File::Temp::tempdir;
+ }
+
+ # Creating subfolder in installdir, which shall become the root of package or zip file
+ my $subfolderdir = "";
+ if ( $packagename ne "" ) { $subfolderdir = $tempinstalldir . $installer::globals::separator . $packagename; }
+ else { $subfolderdir = $tempinstalldir; }
+
+ if ( ! -d $subfolderdir ) { installer::systemactions::create_directory($subfolderdir); }
+
+ # Create directories, copy files and ScpActions
+
+ installer::logger::print_message( "... creating directories ...\n" );
+ installer::logger::include_header_into_logfile("Creating directories:");
+
+ for ( my $i = 0; $i <= $#{$dirsref}; $i++ )
+ {
+ my $onedir = ${$dirsref}[$i];
+
+ if ( $onedir->{'HostName'} )
+ {
+ my $destdir = $subfolderdir . $installer::globals::separator . $onedir->{'HostName'};
+
+ if ( ! -d $destdir )
+ {
+ if ( $^O =~ /cygwin/i ) # Cygwin performance check
+ {
+ $infoline = "Try to create directory $destdir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ # Directories in $dirsref are sorted and all parents were added -> "mkdir" works without parent creation!
+ if ( ! ( -d $destdir )) { mkdir($destdir, 0775); }
+ }
+ else
+ {
+ installer::systemactions::create_directory_structure($destdir);
+ }
+ }
+ }
+ }
+
+ # stripping files ?!
+ if (( $installer::globals::strip ) && ( ! $installer::globals::iswindowsbuild )) { installer::strip::strip_libraries($filesref, $languagestringref); }
+
+ # copy Files
+ installer::logger::print_message( "... copying files ...\n" );
+ installer::logger::include_header_into_logfile("Copying files:");
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+
+ if (( $onefile->{'Styles'} ) && ( $onefile->{'Styles'} =~ /\bBINARYTABLE_ONLY\b/ )) { next; }
+ if (( $installer::globals::patch ) && ( $onefile->{'Styles'} ) && ( ! ( $onefile->{'Styles'} =~ /\bPATCH\b/ ))) { next; }
+
+ my $source = $onefile->{'sourcepath'};
+ my $destination = $onefile->{'destination'};
+ $destination = $subfolderdir . $installer::globals::separator . $destination;
+
+ # Replacing $$ by $ is necessary to install files with $ in its name (back-masquerading)
+ # Otherwise, the following shell command does not work and the file list is not correct
+ $source =~ s/\$\$/\$/;
+ $destination =~ s/\$\$/\$/;
+
+ if ( $^O =~ /cygwin/i ) # Cygwin performance, do not use copy_one_file. "chmod -R" at the end
+ {
+ my $copyreturn = copy($source, $destination);
+
+ if ($copyreturn)
+ {
+ $infoline = "Copy: $source to $destination\n";
+ $returnvalue = 1;
+ }
+ else
+ {
+ $infoline = "ERROR: Could not copy $source to $destination\n";
+ $returnvalue = 0;
+ }
+
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ installer::systemactions::copy_one_file($source, $destination);
+
+ if ( ! $installer::globals::iswindowsbuild )
+ {
+ # see issue 102274
+ my $unixrights = "";
+ if ( $onefile->{'UnixRights'} )
+ {
+ $unixrights = $onefile->{'UnixRights'};
+
+ my $localcall = "$installer::globals::wrapcmd chmod $unixrights \'$destination\' \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ }
+ }
+ }
+
+ # creating Links
+
+ installer::logger::print_message( "... creating links ...\n" );
+ installer::logger::include_header_into_logfile("Creating links:");
+
+ for ( my $i = 0; $i <= $#{$linksref}; $i++ )
+ {
+ my $onelink = ${$linksref}[$i];
+
+ if (( $installer::globals::patch ) && ( $onelink->{'Styles'} ) && ( ! ( $onelink->{'Styles'} =~ /\bPATCH\b/ ))) { next; }
+
+ my $destination = $onelink->{'destination'};
+ $destination = $subfolderdir . $installer::globals::separator . $destination;
+ my $destinationfile = $onelink->{'destinationfile'};
+
+ my $localcall = "ln -sf \'$destinationfile\' \'$destination\' \>\/dev\/null 2\>\&1";
+ system($localcall);
+
+ $infoline = "Creating link: \"ln -sf $destinationfile $destination\"\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ for ( my $i = 0; $i <= $#{$unixlinksref}; $i++ )
+ {
+ my $onelink = ${$unixlinksref}[$i];
+
+ if (( $installer::globals::patch ) && ( $onelink->{'Styles'} ) && ( ! ( $onelink->{'Styles'} =~ /\bPATCH\b/ ))) { next; }
+
+ my $target = $onelink->{'Target'};
+ my $destination = $subfolderdir . $installer::globals::separator . $onelink->{'destination'};
+
+ my $localcall = "ln -sf \'$target\' \'$destination\' \>\/dev\/null 2\>\&1";
+ system($localcall);
+
+ $infoline = "Creating Unix link: \"ln -sf $target $destination\"\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ # Setting privileges for cygwin globally
+
+ if ( $^O =~ /cygwin/i )
+ {
+ installer::logger::print_message( "... changing privileges in $subfolderdir ...\n" );
+ installer::logger::include_header_into_logfile("Changing privileges in $subfolderdir:");
+
+ my $localcall = "chmod -R 755 " . "\"" . $subfolderdir . "\"";
+ system($localcall);
+ }
+
+ installer::logger::print_message( "... removing superfluous directories ...\n" );
+ installer::logger::include_header_into_logfile("Removing superfluous directories:");
+
+ my ( $extensionfolder, $preregdir ) = get_extensions_dir($subfolderdir);
+ installer::systemactions::remove_empty_dirs_in_folder($extensionfolder);
+
+ # Registering the extensions
+
+ installer::logger::print_message( "... registering extensions ...\n" );
+ installer::logger::include_header_into_logfile("Registering extensions:");
+ register_extensions($subfolderdir, $languagestringref, $preregdir);
+
+ if ( $installer::globals::compiler =~ /^unxmacx/ )
+ {
+ installer::worker::put_scpactions_into_installset("$installdir/$packagename");
+ }
+
+ # Creating archive file
+ if ( $installer::globals::packageformat eq "archive" )
+ {
+ create_package($tempinstalldir, $installdir, $packagename, $allvariables, $includepatharrayref, $languagestringref, $installer::globals::archiveformat);
+ }
+ elsif ( $installer::globals::packageformat eq "dmg" )
+ {
+ create_package($installdir, $installdir, $packagename, $allvariables, $includepatharrayref, $languagestringref, ".dmg");
+ }
+
+ # Analyzing the log file
+
+ installer::worker::clean_output_tree(); # removing directories created in the output tree
+ installer::worker::analyze_and_save_logfile($loggingdir, $installdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/sorter.pm b/solenv/bin/modules/installer/sorter.pm
new file mode 100644
index 000000000000..dd983c060093
--- /dev/null
+++ b/solenv/bin/modules/installer/sorter.pm
@@ -0,0 +1,116 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::sorter;
+
+#########################################
+# Sorting an array of hashes
+#########################################
+
+sub sorting_array_of_hashes
+{
+ my ($arrayref, $sortkey) = @_;
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ my $onehashunder = ${$arrayref}[$i];
+ my $sortvalueunder = $onehashunder->{$sortkey};
+
+ for ( my $j = $i + 1; $j <= $#{$arrayref}; $j++ )
+ {
+ my $onehashover = ${$arrayref}[$j];
+ my $sortvalueover = $onehashover->{$sortkey};
+
+ if ( $sortvalueunder gt $sortvalueover)
+ {
+ ${$arrayref}[$i] = $onehashover;
+ ${$arrayref}[$j] = $onehashunder;
+
+ $onehashunder = $onehashover;
+ $sortvalueunder = $sortvalueover;
+ }
+ }
+ }
+}
+
+######################################################
+# Sorting an array of hashes with a numerical value
+######################################################
+
+sub sort_array_of_hashes_numerically
+{
+ my ($arrayref, $sortkey) = @_;
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ my $onehashunder = ${$arrayref}[$i];
+ my $sortvalueunder = $onehashunder->{$sortkey};
+
+ for ( my $j = $i + 1; $j <= $#{$arrayref}; $j++ )
+ {
+ my $onehashover = ${$arrayref}[$j];
+ my $sortvalueover = $onehashover->{$sortkey};
+
+ if ( $sortvalueunder > $sortvalueover)
+ {
+ ${$arrayref}[$i] = $onehashover;
+ ${$arrayref}[$j] = $onehashunder;
+
+ $onehashunder = $onehashover;
+ $sortvalueunder = $sortvalueover;
+ }
+ }
+ }
+}
+
+#########################################
+# Sorting an array of of strings
+#########################################
+
+sub sorting_array_of_strings
+{
+ my ($arrayref) = @_;
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ my $onestringunder = ${$arrayref}[$i];
+
+ for ( my $j = $i + 1; $j <= $#{$arrayref}; $j++ )
+ {
+ my $onestringover = ${$arrayref}[$j];
+
+ if ( $onestringunder gt $onestringover)
+ {
+ ${$arrayref}[$i] = $onestringover;
+ ${$arrayref}[$j] = $onestringunder;
+ $onestringunder = $onestringover;
+ }
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/installer/strip.pm b/solenv/bin/modules/installer/strip.pm
new file mode 100644
index 000000000000..a9541879d119
--- /dev/null
+++ b/solenv/bin/modules/installer/strip.pm
@@ -0,0 +1,139 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::strip;
+
+use installer::converter;
+use installer::existence;
+use installer::globals;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::systemactions;
+
+#####################################################################
+# Checking whether a file has to be stripped
+#####################################################################
+
+sub need_to_strip
+{
+ my ( $filename ) = @_;
+
+ my $strip = 0;
+
+ # Check using the "file" command
+
+ open (FILE, "file $filename |");
+ my $fileoutput = <FILE>;
+ close (FILE);
+
+ if (( $fileoutput =~ /not stripped/i ) && ( $fileoutput =~ /\bELF\b/ )) { $strip = 1; }
+
+ return $strip
+}
+
+#####################################################################
+# Checking whether a file has to be stripped
+#####################################################################
+
+sub do_strip
+{
+ my ( $filename ) = @_;
+
+ my $systemcall = "strip" . " " . $filename;
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not strip $filename!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "SUCCESS: Stripped library $filename!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+#####################################################################
+# Resolving all variables in the packagename.
+#####################################################################
+
+sub strip_libraries
+{
+ my ( $filelist, $languagestringref ) = @_;
+
+ installer::logger::include_header_into_logfile("Stripping files:");
+
+ my $strippeddirbase = installer::systemactions::create_directories("stripped", $languagestringref);
+
+ if (! installer::existence::exists_in_array($strippeddirbase, \@installer::globals::removedirs))
+ {
+ push(@installer::globals::removedirs, $strippeddirbase);
+ }
+
+ for ( my $i = 0; $i <= $#{$filelist}; $i++ )
+ {
+ my $sourcefilename = ${$filelist}[$i]->{'sourcepath'};
+
+ if ( need_to_strip($sourcefilename) )
+ {
+ my $shortfilename = $sourcefilename;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$shortfilename);
+
+ $infoline = "Strip: $shortfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # copy file into directory for stripped libraries
+
+ my $onelanguage = ${$filelist}[$i]->{'specificlanguage'};
+
+ # files without language into directory "00"
+
+ if ($onelanguage eq "") { $onelanguage = "00"; }
+
+ my $strippeddir = $strippeddirbase . $installer::globals::separator . $onelanguage;
+ installer::systemactions::create_directory($strippeddir); # creating language specific subdirectories
+
+ my $destfilename = $strippeddir . $installer::globals::separator . $shortfilename;
+ installer::systemactions::copy_one_file($sourcefilename, $destfilename);
+
+ # change sourcepath in files collector
+
+ ${$filelist}[$i]->{'sourcepath'} = $destfilename;
+
+ # strip file
+
+ do_strip($destfilename);
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/installer/substfilenamefiles.pm b/solenv/bin/modules/installer/substfilenamefiles.pm
new file mode 100644
index 000000000000..fd9557ff81c0
--- /dev/null
+++ b/solenv/bin/modules/installer/substfilenamefiles.pm
@@ -0,0 +1,166 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::substfilenamefiles;
+
+use installer::exiter;
+use installer::globals;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::systemactions;
+
+#########################################################
+# Analyzing files with flag SUBST_FILENAME
+#########################################################
+
+sub resolving_subst_filename_flag
+{
+ my ($filesarrayref, $variableshashref, $languagestringref) = @_;
+
+ my $replacedirbase = installer::systemactions::create_directories("change_filename", $languagestringref);
+
+ installer::logger::include_header_into_logfile("Files with flag SUBST_FILENAME:");
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $styles = "";
+
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+
+ if ( $styles =~ /\bSUBST_FILENAME\b/ )
+ {
+ # Files with flag SUBST_FILENAME must have a "Substitute" key
+ if (( ! $onefile->{'Substitute'} ) && ( ! $onefile->{'InstallName'} ))
+ {
+ installer::exiter::exit_program("ERROR: SUBST_FILENAME is set, but no Substitute and no InstallName defined at file $onefile->{'gid'}!", "resolving_subst_filename_flag");
+ }
+
+ # Language specific subdirectory
+ my $onelanguage = $onefile->{'specificlanguage'};
+
+ if ($onelanguage eq "")
+ {
+ $onelanguage = "00"; # files without language into directory "00"
+ }
+
+ my $replacedir = $replacedirbase . $installer::globals::separator . $onelanguage . $installer::globals::separator;
+ installer::systemactions::create_directory($replacedir); # creating language specific directories
+
+ # copy files and edit them with the variables defined in the zip.lst
+
+ my $longfilename = 0;
+
+ my $onefilename = $onefile->{'Name'};
+
+ my $sourcepath = $onefile->{'sourcepath'};
+
+ # if ( $onefilename =~ /^\s*\Q$installer::globals::separator\E/ ) # filename begins with a slash, for instance /registry/schema/org/openoffice/VCL.xcs
+ if ( $onefilename =~ /\Q$installer::globals::separator\E/ ) # filename begins with a slash, for instance /registry/schema/org/openoffice/VCL.xcs
+ {
+ $onefilename =~ s/^\s*\Q$installer::globals::separator\E//;
+ $longfilename = 1;
+ }
+
+ my $destinationpath = $replacedir . $onefilename;
+ my $movepath = $destinationpath . ".orig";
+ my $destdir = $replacedir;
+
+ if ( $longfilename ) # the destination directory has to be created before copying
+ {
+ $destdir = $movepath;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$destdir);
+ installer::systemactions::create_directory_structure($destdir);
+ }
+
+ my $copysuccess = installer::systemactions::copy_one_file($sourcepath, $movepath);
+
+ if ( $copysuccess )
+ {
+ if ( $onefile->{'Substitute'} )
+ {
+ my $substitute = $onefile->{'Substitute'};
+
+ my $newfilename = $destinationpath;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$newfilename);
+ eval '$newfilename =~ ' . "$substitute";
+
+ my $longnewfilename = $destdir . $newfilename;
+
+ $copysuccess = installer::systemactions::copy_one_file($movepath, $longnewfilename);
+
+ # Saving the new file name
+ $onefile->{'Name'} = $newfilename;
+
+ # Saving the new destination
+ my $newdest = $onefile->{'destination'};
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$newdest);
+ $onefile->{'destination'} = $newdest . $newfilename;
+
+ # Saving the original source, where the file was found
+ $onefile->{'originalsourcepath'} = $onefile->{'sourcepath'};
+
+ # Writing the new sourcepath into the hashref, even if it was not copied
+ $onefile->{'sourcepath'} = $longnewfilename;
+ }
+ else
+ {
+ if ( $onefile->{'InstallName'} )
+ {
+ my $installname = $onefile->{'InstallName'};
+
+ my $newfilename = $destinationpath;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$newfilename);
+
+ my $longnewfilename = $destdir . $installname;
+
+ $copysuccess = installer::systemactions::copy_one_file($movepath, $longnewfilename);
+
+ # Saving the new file name
+ $onefile->{'Name'} = $installname;
+
+ # Saving the new destination
+ my $newdest = $onefile->{'destination'};
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$newdest);
+ $onefile->{'destination'} = $newdest . $installname;
+
+ # Saving the original source, where the file was found
+ $onefile->{'originalsourcepath'} = $onefile->{'sourcepath'};
+
+ # Writing the new sourcepath into the hashref, even if it was not copied
+ $onefile->{'sourcepath'} = $longnewfilename;
+ }
+ }
+ }
+ }
+ }
+
+ my $infoline = "\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/systemactions.pm b/solenv/bin/modules/installer/systemactions.pm
new file mode 100644
index 000000000000..24b070574189
--- /dev/null
+++ b/solenv/bin/modules/installer/systemactions.pm
@@ -0,0 +1,1738 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::systemactions;
+
+use Cwd;
+use File::Copy;
+use installer::converter;
+use installer::exiter;
+use installer::globals;
+use installer::pathanalyzer;
+use installer::remover;
+
+######################################################
+# Creating a new direcotory
+######################################################
+
+sub create_directory
+{
+ my ($directory) = @_;
+
+ my $returnvalue = 1;
+ my $infoline = "";
+
+ if (!(-d $directory))
+ {
+ $returnvalue = mkdir($directory, 0775);
+
+ if ($returnvalue)
+ {
+ $infoline = "\nCreated directory: $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ my $localcall = "chmod 0775 $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+
+ # chmod 0775 is not sufficient on mac to remove sticky tag
+ $localcall = "chmod a-s $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ else
+ {
+ # New solution in parallel packing: It is possible, that the directory now exists, although it
+ # was not created in this process. There is only an important error, if the directory does not
+ # exist now.
+
+ $infoline = "\nDid not succeed in creating directory: \"$directory\". Further attempts will follow.\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ if (!(-d $directory))
+ {
+ # Problem with parallel packaging? -> Try a little harder, before exiting.
+ # Did someone else remove the parent directory in the meantime?
+ my $parentdir = $directory;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$parentdir);
+ if (!(-d $parentdir))
+ {
+ $returnvalue = mkdir($parentdir, 0775);
+
+ if ($returnvalue)
+ {
+ $infoline = "\nAttention: Successfully created parent directory (should already be created before): $parentdir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ my $localcall = "chmod 775 $parentdir \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ else
+ {
+ $infoline = "\Error: \"$directory\" could not be created. Even the parent directory \"$parentdir\" does not exist and could not be created.\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ if ( -d $parentdir )
+ {
+ $infoline = "\nAttention: Finally the parent directory \"$parentdir\" exists, but I could not create it.\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ # Now it is time to exit, even the parent could not be created.
+ installer::exiter::exit_program("ERROR: Could not create parent directory \"$parentdir\"", "create_directory");
+ }
+ }
+ }
+
+ # At this point we have to assume, that the parent directory exist.
+ # Trying once more to create the desired directory
+
+ $returnvalue = mkdir($directory, 0775);
+
+ if ($returnvalue)
+ {
+ $infoline = "\nAttention: Created directory \"$directory\" in the second try.\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ my $localcall = "chmod 775 $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ else
+ {
+ if ( -d $directory )
+ {
+ $infoline = "\nAttention: Finally the directory \"$directory\" exists, but I could not create it.\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ # It is time to exit, even the second try failed.
+ installer::exiter::exit_program("ERROR: Failed to create the directory: $directory", "create_directory");
+ }
+ }
+ }
+ else
+ {
+ $infoline = "\nAnother process created this directory in exactly this moment :-) : $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+ else
+ {
+ $infoline = "\nAlready existing directory, did not create: $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+}
+
+######################################################
+# Creating a new direcotory with defined privileges
+######################################################
+
+sub create_directory_with_privileges
+{
+ my ($directory, $privileges) = @_;
+
+ my $returnvalue = 1;
+ my $infoline = "";
+
+ if (!(-d $directory))
+ {
+ my $localprivileges = oct("0".$privileges); # changes "777" to 0777
+ $returnvalue = mkdir($directory, $localprivileges);
+
+ if ($returnvalue)
+ {
+ $infoline = "\nCreated directory: $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ my $localcall = "chmod $privileges $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ else
+ {
+ # New solution in parallel packing: It is possible, that the directory now exists, although it
+ # was not created in this process. There is only an important error, if the directory does not
+ # exist now.
+
+ $infoline = "\nDid not succeed in creating directory: \"$directory\". Further attempts will follow.\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ if (!(-d $directory))
+ {
+ # Problem with parallel packaging? -> Try a little harder, before exiting.
+ # Did someone else remove the parent directory in the meantime?
+ my $parentdir = $directory;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$parentdir);
+ if (!(-d $parentdir))
+ {
+ $returnvalue = mkdir($directory, $localprivileges);
+
+ if ($returnvalue)
+ {
+ $infoline = "\nAttention: Successfully created parent directory (should already be created before): $parentdir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ my $localcall = "chmod $privileges $parentdir \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ else
+ {
+ $infoline = "\Error: \"$directory\" could not be created. Even the parent directory \"$parentdir\" does not exist and could not be created.\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ if ( -d $parentdir )
+ {
+ $infoline = "\nAttention: Finally the parent directory \"$parentdir\" exists, but I could not create it.\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ # Now it is time to exit, even the parent could not be created.
+ installer::exiter::exit_program("ERROR: Could not create parent directory \"$parentdir\"", "create_directory_with_privileges");
+ }
+ }
+ }
+
+ # At this point we have to assume, that the parent directory exist.
+ # Trying once more to create the desired directory
+
+ $returnvalue = mkdir($directory, $localprivileges);
+
+ if ($returnvalue)
+ {
+ $infoline = "\nAttention: Created directory \"$directory\" in the second try.\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ my $localcall = "chmod $privileges $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ else
+ {
+ if ( -d $directory )
+ {
+ $infoline = "\nAttention: Finally the directory \"$directory\" exists, but I could not create it.\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ # It is time to exit, even the second try failed.
+ installer::exiter::exit_program("ERROR: Failed to create the directory: $directory", "create_directory_with_privileges");
+ }
+ }
+ }
+ else
+ {
+ $infoline = "\nAnother process created this directory in exactly this moment :-) : $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+ else
+ {
+ $infoline = "\nAlready existing directory, did not create: $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ my $localcall = "chmod $privileges $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+}
+
+######################################################
+# Removing a new direcotory
+######################################################
+
+sub remove_empty_directory
+{
+ my ($directory) = @_;
+
+ my $returnvalue = 1;
+
+ if (-d $directory)
+ {
+ my $systemcall = "rmdir $directory";
+
+ $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not remove \"$directory\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Removed \"$directory\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+}
+
+#######################################################################
+# Calculating the number of languages in the string
+#######################################################################
+
+sub get_number_of_langs
+{
+ my ($languagestring) = @_;
+
+ my $number = 1;
+
+ my $workstring = $languagestring;
+
+ while ( $workstring =~ /^\s*(.*)_(.*?)\s*$/ )
+ {
+ $workstring = $1;
+ $number++;
+ }
+
+ return $number;
+}
+
+#######################################################################
+# Creating the directories, in which files are generated or unzipped
+#######################################################################
+
+sub create_directories
+{
+ my ($newdirectory, $languagesref) =@_;
+
+ $installer::globals::unpackpath =~ s/\Q$installer::globals::separator\E\s*$//; # removing ending slashes and backslashes
+
+ my $path = "";
+
+ if (( $newdirectory eq "uno" ) || ( $newdirectory eq "zip" ) || ( $newdirectory eq "cab" ) || ( $newdirectory =~ /rdb\s*$/i )) # special handling for zip files, cab files and services file because of performance reasons
+ {
+ if ( $installer::globals::temppathdefined ) { $path = $installer::globals::temppath; }
+ else { $path = $installer::globals::unpackpath; }
+ $path =~ s/\Q$installer::globals::separator\E\s*$//; # removing ending slashes and backslashes
+ $path = $path . $installer::globals::separator;
+ }
+ elsif ( ( $newdirectory eq "jds" ) )
+ {
+ if ( $installer::globals::jdstemppathdefined ) { $path = $installer::globals::jdstemppath; }
+ else { $path = $installer::globals::unpackpath; }
+ $path =~ s/\Q$installer::globals::separator\E\s*$//; # removing ending slashes and backslashes
+ $path = $path . $installer::globals::separator;
+ installer::systemactions::create_directory($path);
+ }
+ else
+ {
+ $path = $installer::globals::unpackpath . $installer::globals::separator;
+
+ # special handling, if LOCALINSTALLDIR is set
+ if (( $installer::globals::localinstalldirset ) && ( $newdirectory eq "install" ))
+ {
+ $installer::globals::localinstalldir =~ s/\Q$installer::globals::separator\E\s*$//;
+ $path = $installer::globals::localinstalldir . $installer::globals::separator;
+ }
+ }
+
+ $infoline = "create_directories: Using $path for $newdirectory !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($newdirectory eq "unzip" ) # special handling for common directory
+ {
+ $path = $path . ".." . $installer::globals::separator . "common" . $installer::globals::productextension . $installer::globals::separator;
+ create_directory($path);
+
+ $path = $path . $newdirectory . $installer::globals::separator;
+ create_directory($path);
+ }
+ else
+ {
+ my $localproductname = $installer::globals::product;
+ my $localproductsubdir = "";
+
+ if ( $installer::globals::product =~ /^\s*(.+?)\_\_(.+?)\s*$/ )
+ {
+ $localproductname = $1;
+ $localproductsubdir = $2;
+ }
+
+ if ( $installer::globals::languagepack ) { $path = $path . $localproductname . "_languagepack" . $installer::globals::separator; }
+ elsif ( $installer::globals::patch ) { $path = $path . $localproductname . "_patch" . $installer::globals::separator; }
+ else { $path = $path . $localproductname . $installer::globals::separator; }
+
+ create_directory($path);
+
+ if ( $localproductsubdir )
+ {
+ $path = $path . $localproductsubdir . $installer::globals::separator;
+ create_directory($path);
+ }
+
+ $path = $path . $installer::globals::installertypedir . $installer::globals::separator;
+ create_directory($path);
+
+ $path = $path . $newdirectory . $installer::globals::separator;
+ create_directory($path);
+
+ my $locallanguagesref = "";
+
+ if ( $$languagesref ) { $locallanguagesref = $$languagesref; }
+
+ if (!($locallanguagesref eq "" )) # this will be a path like "01_49", for Profiles and ConfigurationFiles, idt-Files
+ {
+ my $languagestring = $$languagesref;
+
+ if (length($languagestring) > $installer::globals::max_lang_length )
+ {
+ my $number_of_languages = get_number_of_langs($languagestring);
+ chomp(my $shorter = `echo $languagestring | md5sum | sed -e "s/ .*//g"`);
+ # $languagestring = $shorter;
+ my $id = substr($shorter, 0, 8); # taking only the first 8 digits
+ $languagestring = "lang_" . $number_of_languages . "_id_" . $id;
+ }
+
+ $path = $path . $languagestring . $installer::globals::separator;
+ create_directory($path);
+ }
+ }
+
+ installer::remover::remove_ending_pathseparator(\$path);
+
+ $path = installer::converter::make_path_conform($path);
+
+ return $path;
+}
+
+########################
+# Copying one file
+########################
+
+sub copy_one_file
+{
+ my ($source, $dest) = @_;
+
+ my ($returnvalue, $infoline);
+
+ my $copyreturn = copy($source, $dest);
+
+ if ($copyreturn)
+ {
+ $infoline = "Copy: $source to $dest\n";
+ $returnvalue = 1;
+ }
+ else
+ {
+ $infoline = "ERROR: Could not copy $source to $dest\n";
+ $returnvalue = 0;
+ }
+
+ push(@installer::globals::logfileinfo, $infoline);
+
+ if ( !$returnvalue ) {
+ return $returnvalue;
+ }
+
+ # taking care of file attributes
+ if ($installer::globals::iswin && -f $dest) {
+ my $mode = -x $source ? 0775 : 0664;
+ my $mode_str = sprintf("%o", $mode);
+ my $chmodreturn = chmod($mode, $dest);
+ if ($chmodreturn)
+ {
+ $infoline = "chmod $mode_str, $dest\n";
+ $returnvalue = 1;
+ }
+ else
+ {
+ $infoline = "WARNING: Could not chmod $dest: $!\n";
+ $returnvalue = 0;
+ }
+
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ return $returnvalue;
+}
+
+##########################
+# Hard linking one file
+##########################
+
+sub hardlink_one_file
+{
+ my ($source, $dest) = @_;
+
+ my ($returnvalue, $infoline);
+
+ my $copyreturn = link($source, $dest);
+
+ if ($copyreturn)
+ {
+ $infoline = "Link: $source to $dest\n";
+ $returnvalue = 1;
+ }
+ else
+ {
+ $infoline = "ERROR: Could not link $source to $dest\n";
+ $returnvalue = 0;
+ }
+
+ push(@installer::globals::logfileinfo, $infoline);
+
+ return $returnvalue;
+}
+
+##########################
+# Soft linking one file
+##########################
+
+sub softlink_one_file
+{
+ my ($source, $dest) = @_;
+
+ my ($returnvalue, $infoline);
+
+ my $linkreturn = symlink($source, $dest);
+
+ if ($linkreturn)
+ {
+ $infoline = "Symlink: $source to $dest\n";
+ $returnvalue = 1;
+ }
+ else
+ {
+ $infoline = "ERROR: Could not symlink $source to $dest\n";
+ $returnvalue = 0;
+ }
+
+ push(@installer::globals::logfileinfo, $infoline);
+
+ return $returnvalue;
+}
+
+########################
+# Renaming one file
+########################
+
+sub rename_one_file
+{
+ my ($source, $dest) = @_;
+
+ my ($returnvalue, $infoline);
+
+ my $renamereturn = rename($source, $dest);
+
+ if ($renamereturn)
+ {
+ $infoline = "Rename: $source to $dest\n";
+ $returnvalue = 1;
+ }
+ else
+ {
+ $infoline = "ERROR: Could not rename $source to $dest\n";
+ $returnvalue = 0;
+ }
+
+ push(@installer::globals::logfileinfo, $infoline);
+
+ return $returnvalue;
+}
+
+##########################################
+# Copying all files from one directory
+# to another directory
+##########################################
+
+sub copy_directory
+{
+ my ($sourcedir, $destdir) = @_;
+
+ my @sourcefiles = ();
+
+ $sourcedir =~ s/\Q$installer::globals::separator\E\s*$//;
+ $destdir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ my $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Copying files from directory $sourcedir to directory $destdir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ opendir(DIR, $sourcedir);
+ @sourcefiles = readdir(DIR);
+ closedir(DIR);
+
+ my $onefile;
+
+ foreach $onefile (@sourcefiles)
+ {
+ if ((!($onefile eq ".")) && (!($onefile eq "..")))
+ {
+ my $sourcefile = $sourcedir . $installer::globals::separator . $onefile;
+ my $destfile = $destdir . $installer::globals::separator . $onefile;
+ if ( -f $sourcefile ) # only files, no directories
+ {
+ copy_one_file($sourcefile, $destfile);
+ }
+ }
+ }
+}
+
+##########################################
+# Copying all files from one directory
+# to another directory
+##########################################
+
+sub is_empty_dir
+{
+ my ($dir) = @_;
+
+ my $directory_is_empty = 1;
+ my @sourcefiles = ();
+
+ opendir(DIR, $dir);
+ @sourcefiles = readdir(DIR);
+ closedir(DIR);
+
+ my $onefile;
+ my @realcontent = ();
+
+ foreach $onefile (@sourcefiles)
+ {
+ if ((!($onefile eq ".")) && (!($onefile eq "..")))
+ {
+ push(@realcontent, $onefile);
+ }
+ }
+
+ if ( $#realcontent > -1 ) { $directory_is_empty = 0; }
+
+ return $directory_is_empty;
+}
+
+#####################################################################
+# Creating hard links to a complete directory with sub directories.
+#####################################################################
+
+sub hardlink_complete_directory
+{
+ my ($sourcedir, $destdir) = @_;
+
+ my @sourcefiles = ();
+
+ $sourcedir =~ s/\Q$installer::globals::separator\E\s*$//;
+ $destdir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ if ( ! -d $destdir ) { create_directory($destdir); }
+
+ my $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Creating hard links for all files from directory $sourcedir to directory $destdir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ opendir(DIR, $sourcedir);
+ @sourcefiles = readdir(DIR);
+ closedir(DIR);
+
+ my $onefile;
+
+ foreach $onefile (@sourcefiles)
+ {
+ if ((!($onefile eq ".")) && (!($onefile eq "..")))
+ {
+ my $source = $sourcedir . $installer::globals::separator . $onefile;
+ my $dest = $destdir . $installer::globals::separator . $onefile;
+ if ( -f $source ) # only files, no directories
+ {
+ hardlink_one_file($source, $dest);
+ }
+ if ( -d $source ) # recursive
+ {
+ hardlink_complete_directory($source, $dest);
+ }
+ }
+ }
+}
+
+#####################################################################
+# Creating hard links to a complete directory with sub directories.
+#####################################################################
+
+sub softlink_complete_directory
+{
+ my ($sourcedir, $destdir, $depth) = @_;
+
+ my @sourcefiles = ();
+
+ $sourcedir =~ s/\Q$installer::globals::separator\E\s*$//;
+ $destdir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ if ( ! -d $destdir ) { create_directory($destdir); }
+
+ my $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Creating soft links for all files from directory $sourcedir to directory $destdir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ opendir(DIR, $sourcedir);
+ @sourcefiles = readdir(DIR);
+ closedir(DIR);
+
+ my $onefile;
+
+ foreach $onefile (@sourcefiles)
+ {
+ if ((!($onefile eq ".")) && (!($onefile eq "..")))
+ {
+ my $source = $sourcedir . $installer::globals::separator . $onefile;
+ my $dest = $destdir . $installer::globals::separator . $onefile;
+ if ( -f $source ) # only files, no directories
+ {
+ my $localsource = $source;
+ if ( $depth > 0 ) { for ( my $i = 1; $i <= $depth; $i++ ) { $localsource = "../" . $localsource; } }
+ softlink_one_file($localsource, $dest);
+ }
+ if ( -d $source ) # recursive
+ {
+ my $newdepth = $depth + 1;
+ softlink_complete_directory($source, $dest, $newdepth);
+ }
+ }
+ }
+}
+
+#####################################################
+# Copying a complete directory with sub directories.
+#####################################################
+
+sub copy_complete_directory
+{
+ my ($sourcedir, $destdir) = @_;
+
+ my @sourcefiles = ();
+
+ $sourcedir =~ s/\Q$installer::globals::separator\E\s*$//;
+ $destdir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ if ( ! -d $destdir ) { create_directory($destdir); }
+
+ my $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Copying files from directory $sourcedir to directory $destdir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ opendir(DIR, $sourcedir);
+ @sourcefiles = readdir(DIR);
+ closedir(DIR);
+
+ my $onefile;
+
+ foreach $onefile (@sourcefiles)
+ {
+ if ((!($onefile eq ".")) && (!($onefile eq "..")))
+ {
+ my $source = $sourcedir . $installer::globals::separator . $onefile;
+ my $dest = $destdir . $installer::globals::separator . $onefile;
+ if ( -f $source ) # only files, no directories
+ {
+ copy_one_file($source, $dest);
+ }
+ if ( -d $source ) # recursive
+ {
+ if ((!( $source =~ /packages\/SUNW/ )) && (!( $source =~ /packages\/OOO/ ))) # do not copy complete Solaris packages!
+ {
+ copy_complete_directory($source, $dest);
+ }
+ }
+ }
+ }
+}
+
+#####################################################################################
+# Copying a complete directory with sub directories, but not the CVS directories.
+#####################################################################################
+
+sub copy_complete_directory_without_cvs
+{
+ my ($sourcedir, $destdir) = @_;
+
+ my @sourcefiles = ();
+
+ $sourcedir =~ s/\Q$installer::globals::separator\E\s*$//;
+ $destdir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ if ( ! -d $destdir ) { create_directory($destdir); }
+
+ my $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Copying files from directory $sourcedir to directory $destdir (without CVS)\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ opendir(DIR, $sourcedir);
+ @sourcefiles = readdir(DIR);
+ closedir(DIR);
+
+ my $onefile;
+
+ foreach $onefile (@sourcefiles)
+ {
+ if ((!($onefile eq ".")) && (!($onefile eq "..")) && (!($onefile eq "CVS")))
+ {
+ my $source = $sourcedir . $installer::globals::separator . $onefile;
+ my $dest = $destdir . $installer::globals::separator . $onefile;
+ if ( -f $source ) # only files, no directories
+ {
+ copy_one_file($source, $dest);
+ }
+ if ( -d $source ) # recursive
+ {
+ copy_complete_directory_without_cvs($source, $dest);
+ }
+ }
+ }
+}
+
+#####################################################
+# Copying all files with a specified file extension
+# from one directory to another directory.
+#####################################################
+
+sub copy_directory_with_fileextension
+{
+ my ($sourcedir, $destdir, $extension) = @_;
+
+ my @sourcefiles = ();
+
+ $sourcedir =~ s/\Q$installer::globals::separator\E\s*$//;
+ $destdir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Copying files with extension $extension from directory $sourcedir to directory $destdir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ opendir(DIR, $sourcedir);
+ @sourcefiles = readdir(DIR);
+ closedir(DIR);
+
+ my $onefile;
+
+ foreach $onefile (@sourcefiles)
+ {
+ if ((!($onefile eq ".")) && (!($onefile eq "..")))
+ {
+ if ( $onefile =~ /\.$extension\s*$/ ) # only copying specified files
+ {
+ my $sourcefile = $sourcedir . $installer::globals::separator . $onefile;
+ my $destfile = $destdir . $installer::globals::separator . $onefile;
+ if ( -f $sourcefile ) # only files, no directories
+ {
+ copy_one_file($sourcefile, $destfile);
+ }
+ }
+ }
+ }
+}
+
+#########################################################
+# Copying all files without a specified file extension
+# from one directory to another directory.
+#########################################################
+
+sub copy_directory_except_fileextension
+{
+ my ($sourcedir, $destdir, $extension) = @_;
+
+ my @sourcefiles = ();
+
+ $sourcedir =~ s/\Q$installer::globals::separator\E\s*$//;
+ $destdir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Copying files without extension $extension from directory $sourcedir to directory $destdir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ opendir(DIR, $sourcedir);
+ @sourcefiles = readdir(DIR);
+ closedir(DIR);
+
+ my $onefile;
+
+ foreach $onefile (@sourcefiles)
+ {
+ if ((!($onefile eq ".")) && (!($onefile eq "..")))
+ {
+ if ( ! ( $onefile =~ /\.$extension\s*$/ )) # only copying not having the specified extension
+ {
+ my $sourcefile = $sourcedir . $installer::globals::separator . $onefile;
+ my $destfile = $destdir . $installer::globals::separator . $onefile;
+ if ( -f $sourcefile ) # only files, no directories
+ {
+ copy_one_file($sourcefile, $destfile);
+ }
+ }
+ }
+ }
+}
+
+########################################################
+# Renaming all files with a specified file extension
+# in a specified directory.
+# Example: "Feature.idt.01" -> "Feature.idt"
+########################################################
+
+sub rename_files_with_fileextension
+{
+ my ($dir, $extension) = @_;
+
+ my @sourcefiles = ();
+
+ $dir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ my $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Renaming files with extension \"$extension\" in the directory $dir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ opendir(DIR, $dir);
+ @sourcefiles = readdir(DIR);
+ closedir(DIR);
+
+ my $onefile;
+
+ foreach $onefile (@sourcefiles)
+ {
+ if ((!($onefile eq ".")) && (!($onefile eq "..")))
+ {
+ if ( $onefile =~ /^\s*(\S.*?)\.$extension\s*$/ ) # only renaming specified files
+ {
+ my $destfile = $1;
+ my $sourcefile = $dir . $installer::globals::separator . $onefile;
+ $destfile = $dir . $installer::globals::separator . $destfile;
+ if ( -f $sourcefile ) # only files, no directories
+ {
+ rename_one_file($sourcefile, $destfile);
+ }
+ }
+ }
+ }
+}
+
+########################################################
+# Finding all files with a specified file extension
+# in a specified directory.
+########################################################
+
+sub find_file_with_file_extension
+{
+ my ($extension, $dir) = @_;
+
+ my @allfiles = ();
+
+ $dir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ my $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Searching files with extension \"$extension\" in the directory $dir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ opendir(DIR, $dir);
+ @sourcefiles = readdir(DIR);
+ closedir(DIR);
+
+ my $onefile;
+
+ foreach $onefile (@sourcefiles)
+ {
+ if ((!($onefile eq ".")) && (!($onefile eq "..")))
+ {
+ if ( $onefile =~ /^\s*(\S.*?)\.$extension\s*$/ )
+ {
+ push(@allfiles, $onefile)
+ }
+ }
+ }
+
+ return \@allfiles;
+}
+
+##############################################################
+# Creating a unique directory, for example "01_inprogress_7"
+# in the install directory.
+##############################################################
+
+sub make_numbered_dir
+{
+ my ($newstring, $olddir) = @_;
+
+ my $basedir = $olddir;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$basedir);
+
+ my $alldirs = get_all_directories($basedir);
+
+ # searching for the highest number extension
+
+ my $maxnumber = 0;
+
+ for ( my $i = 0; $i <= $#{$alldirs}; $i++ )
+ {
+ if ( ${$alldirs}[$i] =~ /\_(\d+)\s*$/ )
+ {
+ my $number = $1;
+ if ( $number > $maxnumber ) { $maxnumber = $number; }
+ }
+ }
+
+ my $newnumber = $maxnumber + 1;
+
+ my $newdir = $olddir . "_" . $newstring . "_" . $newnumber;
+
+ my $returndir = "";
+
+ if ( move($olddir, $newdir) )
+ {
+ $infoline = "\nMoved directory from $olddir to $newdir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $returndir = $newdir;
+ }
+ else
+ {
+ $infoline = "\nATTENTION: Could not move directory from $olddir to $newdir, \"make_numbered_dir\"\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $returndir = $olddir;
+ }
+
+ return $returndir;
+}
+
+##############################################################
+# Determining the highest number in the install directory.
+##############################################################
+
+sub determine_maximum_number
+{
+ my ($dir, $languagestringref) = @_;
+
+ my $basedir = $dir;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$basedir);
+
+ my $alldirs = get_all_directories($basedir);
+
+ my $maxnumber = 1;
+
+ # In control.pm the installation directory is determined as:
+ # $installer::globals::build . "_" . $installer::globals::lastminor . "_" .
+ # "native_inprogress-number_" . $$languagesref . "\." . $installer::globals::buildid;
+
+ # searching for the highest number extension after the first "-", which belongs to
+ # $installer::globals::build, $installer::globals::lastminor and $installer::globals::buildid
+ # In this step not looking for the language!
+
+ my @correctbuildiddirs = ();
+
+ for ( my $i = 0; $i <= $#{$alldirs}; $i++ )
+ {
+ my $onedir = ${$alldirs}[$i];
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$onedir);
+
+ if ( $onedir =~ /^\s*\Q$installer::globals::build\E\_\Q$installer::globals::lastminor\E\_(.*?)\-(\d+)\_(.*?)\.\Q$installer::globals::buildid\E\s*$/ )
+ {
+ my $number = $2;
+ if ( $number > $maxnumber ) { $maxnumber = $number; }
+ push(@correctbuildiddirs, $onedir);
+ }
+ }
+
+ # From all directories with correct $installer::globals::build, $installer::globals::lastminor
+ # and $installer::globals::buildid, those directories, which already have the maximum number
+ # have to be selected
+
+ my @maximumnumberdirs = ();
+
+ for ( my $i = 0; $i <= $#correctbuildiddirs; $i++ )
+ {
+ my $onedir = $correctbuildiddirs[$i];
+
+ if ( $onedir =~ /^\s*(.*?)\-(\d+)\_(.*?)\.(.*?)\s*$/ )
+ {
+ my $number = $2;
+
+ if ( $number == $maxnumber )
+ {
+ push(@maximumnumberdirs, $onedir);
+ }
+ }
+ }
+
+ # @maximumnumberdirs contains only those directories with correct $installer::globals::build,
+ # $installer::globals::lastminor and $installer::globals::buildid, which already have the maximum number.
+ # If the current language is part of this directory, the number has to be increased.
+
+ my $increase_counter = 0;
+
+ for ( my $i = 0; $i <= $#maximumnumberdirs; $i++ )
+ {
+ my $onedir = $maximumnumberdirs[$i];
+
+ if ( $onedir =~ /^\s*(.*?)\-(\d+)\_(.*?)\.(.*?)\s*$/ )
+ {
+ my $number = $2;
+ my $languagestring = $3;
+
+ if ( $languagestring eq $$languagestringref )
+ {
+ $increase_counter = 1;
+ }
+ }
+ }
+
+ if ( $increase_counter )
+ {
+ $maxnumber = $maxnumber + 1;
+ }
+
+ return $maxnumber;
+}
+
+#####################################################################################
+# Renaming a directory by exchanging a string, for example from "01_inprogress_7"
+# to "01_witherror_7".
+#####################################################################################
+
+sub rename_string_in_directory
+{
+ my ($olddir, $oldstring, $newstring) = @_;
+
+ my $newdir = $olddir;
+ my $infoline = "";
+
+ $newdir =~ s/$oldstring/$newstring/g;
+
+ if (( -d $newdir ) && ( $olddir ne $newdir )) { remove_complete_directory($newdir, 1); }
+
+ if ( move($olddir, $newdir) )
+ {
+ $infoline = "\nMoved directory from $olddir to $newdir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "\nATTENTION: Could not move directory from $olddir to $newdir, \"rename_string_in_directory\"\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ return $newdir;
+}
+
+######################################################
+# Returning the complete directory name,
+# input is the first part of the directory name.
+######################################################
+
+sub get_directoryname
+{
+ my ($searchdir, $startstring) = @_;
+
+ my $dirname = "";
+ my $founddir = 0;
+ my $direntry;
+
+ opendir(DIR, $searchdir);
+
+ foreach $direntry (readdir (DIR))
+ {
+ next if $direntry eq ".";
+ next if $direntry eq "..";
+
+ if (( -d $direntry ) && ( $direntry =~ /^\s*\Q$startstring\E/ ))
+ {
+ $dirname = $direntry;
+ $founddir = 1;
+ last;
+ }
+ }
+
+ closedir(DIR);
+
+ if ( ! $founddir ) { installer::exiter::exit_program("ERROR: Did not find directory beginning with $startstring in directory $searchdir", "get_directoryname"); }
+
+ return $dirname;
+}
+
+
+###################################
+# Renaming a directory
+###################################
+
+sub rename_directory
+{
+ my ($olddir, $newdir) = @_;
+
+ my $infoline = "";
+
+ if ( move($olddir, $newdir) )
+ {
+ $infoline = "\nMoved directory from $olddir to $newdir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: Could not move directory from $olddir to $newdir", "rename_directory");
+ # $infoline = "\nATTENTION: Could not move directory from $olddir to $newdir, \"rename_directory\"\n";
+ # push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ return $newdir;
+}
+
+##############################################################
+# Creating a directory next to an existing directory
+##############################################################
+
+sub create_directory_next_to_directory
+{
+ my ($topdir, $dirname) = @_;
+
+ my $basedir = $topdir;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$basedir);
+
+ $basedir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ my $newdir = $basedir . $installer::globals::separator . $dirname;
+
+ create_directory($newdir);
+
+ return $newdir;
+}
+
+##############################################################
+# Collecting all directories inside a directory
+##############################################################
+
+sub get_all_directories
+{
+ my ($basedir) = @_;
+
+ my @alldirs = ();
+ my $direntry;
+
+ $basedir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ opendir(DIR, $basedir);
+
+ foreach $direntry (readdir (DIR))
+ {
+ next if $direntry eq ".";
+ next if $direntry eq "..";
+
+ my $completeentry = $basedir . $installer::globals::separator . $direntry;
+
+ if ( -d $completeentry ) { push(@alldirs, $completeentry); }
+ }
+
+ closedir(DIR);
+
+ return \@alldirs;
+}
+
+##############################################################
+# Collecting all directories inside a directory
+# Returning without path
+##############################################################
+
+sub get_all_directories_without_path
+{
+ my ($basedir) = @_;
+
+ my @alldirs = ();
+ my $direntry;
+
+ $basedir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ opendir(DIR, $basedir);
+
+ foreach $direntry (readdir (DIR))
+ {
+ next if $direntry eq ".";
+ next if $direntry eq "..";
+
+ my $completeentry = $basedir . $installer::globals::separator . $direntry;
+
+ if ( -d $completeentry ) { push(@alldirs, $direntry); }
+ }
+
+ closedir(DIR);
+
+ return \@alldirs;
+}
+
+##############################################################
+# Collecting all files inside one directory
+##############################################################
+
+sub get_all_files_from_one_directory
+{
+ my ($basedir) = @_;
+
+ my @allfiles = ();
+ my $direntry;
+
+ $basedir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ opendir(DIR, $basedir);
+
+ foreach $direntry (readdir (DIR))
+ {
+ next if $direntry eq ".";
+ next if $direntry eq "..";
+
+ my $completeentry = $basedir . $installer::globals::separator . $direntry;
+
+ if ( -f $completeentry ) { push(@allfiles, $completeentry); }
+ }
+
+ closedir(DIR);
+
+ return \@allfiles;
+}
+
+##############################################################
+# Collecting all files inside one directory
+##############################################################
+
+sub get_all_files_from_one_directory_without_path
+{
+ my ($basedir) = @_;
+
+ my @allfiles = ();
+ my $direntry;
+
+ $basedir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ opendir(DIR, $basedir);
+
+ foreach $direntry (readdir (DIR))
+ {
+ next if $direntry eq ".";
+ next if $direntry eq "..";
+
+ my $completeentry = $basedir . $installer::globals::separator . $direntry;
+
+ if ( -f $completeentry ) { push(@allfiles, $direntry); }
+ }
+
+ closedir(DIR);
+
+ return \@allfiles;
+}
+
+##############################################################
+# Collecting all files and directories inside one directory
+##############################################################
+
+sub read_directory
+{
+ my ($basedir) = @_;
+
+ my @allcontent = ();
+ my $direntry;
+
+ $basedir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ opendir(DIR, $basedir);
+
+ foreach $direntry (readdir (DIR))
+ {
+ next if $direntry eq ".";
+ next if $direntry eq "..";
+
+ my $completeentry = $basedir . $installer::globals::separator . $direntry;
+
+ if (( -f $completeentry ) || ( -d $completeentry )) { push(@allcontent, $completeentry); }
+ }
+
+ closedir(DIR);
+
+ return \@allcontent;
+}
+
+##############################################################
+# Finding the new content in a directory
+##############################################################
+
+sub find_new_content_in_directory
+{
+ my ( $basedir, $oldcontent ) = @_;
+
+ my @newcontent = ();
+ my @allcontent = ();
+
+ my $direntry;
+
+ $basedir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ opendir(DIR, $basedir);
+
+ foreach $direntry (readdir (DIR))
+ {
+ next if $direntry eq ".";
+ next if $direntry eq "..";
+
+ my $completeentry = $basedir . $installer::globals::separator . $direntry;
+
+ if (( -f $completeentry ) || ( -d $completeentry ))
+ {
+ push(@allcontent, $completeentry);
+ if (! installer::existence::exists_in_array($completeentry, $oldcontent))
+ {
+ push(@newcontent, $completeentry);
+ }
+ }
+ }
+
+ closedir(DIR);
+
+ return (\@newcontent, \@allcontent);
+}
+
+##############################################################
+# Trying to create a directory, no error if this fails
+##############################################################
+
+sub try_to_create_directory
+{
+ my ($directory) = @_;
+
+ my $returnvalue = 1;
+ my $created_directory = 0;
+
+ if (!(-d $directory))
+ {
+ $returnvalue = mkdir($directory, 0775);
+
+ if ($returnvalue)
+ {
+ $created_directory = 1;
+ $infoline = "\nCreated directory: $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ my $localcall = "chmod 0775 $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+
+ # chmod 0775 is not sufficient on mac to remove sticky tag
+ $localcall = "chmod a-s $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ else
+ {
+ $created_directory = 0;
+ }
+ }
+ else
+ {
+ $created_directory = 1;
+ }
+
+ return $created_directory;
+}
+
+##############################################################
+# Creating a complete directory structure
+##############################################################
+
+sub create_directory_structure
+{
+ my ($directory) = @_;
+
+ if ( ! try_to_create_directory($directory) )
+ {
+ my $parentdir = $directory;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$parentdir);
+
+ my $infoline = "INFO: Did not create directory $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Now trying to create parent directory $parentdir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ create_directory_structure($parentdir); # recursive
+ }
+
+ create_directory($directory); # now it has to succeed
+}
+
+######################################################
+# Removing a complete directory with subdirectories
+######################################################
+
+sub remove_complete_directory
+{
+ my ($directory, $start) = @_;
+
+ my @content = ();
+ my $infoline = "";
+
+ $directory =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ if ( -d $directory )
+ {
+ if ( $start )
+ {
+ $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Removing directory $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ opendir(DIR, $directory);
+ @content = readdir(DIR);
+ closedir(DIR);
+
+ my $oneitem;
+
+ foreach $oneitem (@content)
+ {
+ if ((!($oneitem eq ".")) && (!($oneitem eq "..")))
+ {
+ my $item = $directory . $installer::globals::separator . $oneitem;
+
+ if ( -f $item || -l $item ) # deleting files or links
+ {
+ unlink($item);
+ }
+
+ if ( -d $item ) # recursive
+ {
+ remove_complete_directory($item, 0);
+ }
+ }
+ }
+
+ # try to remove empty directory
+
+ my $returnvalue = rmdir $directory;
+
+ if ( ! $returnvalue )
+ {
+ $infoline = "Warning: Problem with removing empty dir $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ # try a little bit harder (sometimes there is a performance problem)
+ if ( -d $directory )
+ {
+ for ( my $j = 1; $j <= 3; $j++ )
+ {
+ if ( -d $directory )
+ {
+ $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Warning (Try $j): Problems with removing directory $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ $returnvalue = rmdir $directory;
+
+ if ( $returnvalue )
+ {
+ $infoline = "Successfully removed empty dir $directory\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ } else {
+ $infoline = "Warning: rmdir $directory failed.\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+ }
+ }
+}
+
+######################################################
+# Creating a unique directory with number extension
+######################################################
+
+sub create_unique_directory
+{
+ my ($directory) = @_;
+
+ $directory =~ s/\Q$installer::globals::separator\E\s*$//;
+ $directory = $directory . "_INCREASINGNUMBER";
+
+ my $counter = 1;
+ my $created = 0;
+ my $localdirectory = "";
+
+ do
+ {
+ $localdirectory = $directory;
+ $localdirectory =~ s/INCREASINGNUMBER/$counter/;
+ $counter++;
+
+ if ( ! -d $localdirectory )
+ {
+ create_directory($localdirectory);
+ $created = 1;
+ }
+ }
+ while ( ! $created );
+
+ return $localdirectory;
+}
+
+######################################################
+# Creating a unique directory with pid extension
+######################################################
+
+sub create_pid_directory
+{
+ my ($directory) = @_;
+
+ $directory =~ s/\Q$installer::globals::separator\E\s*$//;
+ my $pid = $$; # process id
+ my $time = time(); # time
+
+ $directory = $directory . "_" . $pid . $time;
+
+ if ( ! -d $directory ) { create_directory($directory); }
+ else { installer::exiter::exit_program("ERROR: Directory $directory already exists!", "create_pid_directory"); }
+
+ return $directory;
+}
+
+##############################################################
+# Reading all files from a directory and its subdirectories
+##############################################################
+
+sub read_complete_directory
+{
+ my ($directory, $pathstring, $filecollector) = @_;
+
+ my @content = ();
+ opendir(DIR, $directory);
+ @content = readdir(DIR);
+ closedir(DIR);
+
+ my $onefile;
+
+ foreach $onefile (@content)
+ {
+ if ((!($onefile eq ".")) && (!($onefile eq "..")))
+ {
+ my $completefilename = $directory . $installer::globals::separator . $onefile;
+ my $sep = "";
+ if ( $pathstring ne "" ) { $sep = $installer::globals::separator; }
+
+ if ( ! -d $completefilename ) # only files, no directories
+ {
+ my $content = $pathstring . $sep . $onefile;
+ push(@{$filecollector}, $content);
+ }
+ else # recursive for directories
+ {
+ my $newpathstring = $pathstring . $sep . $onefile;
+ read_complete_directory($completefilename, $newpathstring, $filecollector);
+ }
+ }
+ }
+}
+
+##############################################################
+# Reading all files from a directory and its subdirectories
+# Version 2
+##############################################################
+
+sub read_full_directory {
+ my ( $currentdir, $pathstring, $collector ) = @_;
+ my $item;
+ my $fullname;
+ local *DH;
+
+ unless (opendir(DH, $currentdir))
+ {
+ return;
+ }
+ while (defined ($item = readdir(DH)))
+ {
+ next if($item eq "." or $item eq "..");
+ $fullname = $currentdir . $installer::globals::separator . $item;
+ my $sep = "";
+ if ( $pathstring ne "" ) { $sep = $installer::globals::separator; }
+
+ if( -d $fullname)
+ {
+ my $newpathstring = $pathstring . $sep . $item;
+ read_full_directory($fullname, $newpathstring, $collector) if(-d $fullname);
+ }
+ else
+ {
+ my $content = $pathstring . $sep . $item;
+ push(@{$collector}, $content);
+ }
+ }
+ closedir(DH);
+ return
+}
+
+##############################################################
+# Removing all empty directories below a specified directory
+##############################################################
+
+sub remove_empty_dirs_in_folder
+{
+ my ( $dir ) = @_;
+
+ my @content = ();
+ my $infoline = "";
+
+ $dir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ if ( -d $dir )
+ {
+ opendir(DIR, $dir);
+ @content = readdir(DIR);
+ closedir(DIR);
+
+ my $oneitem;
+
+ foreach $oneitem (@content)
+ {
+ if ((!($oneitem eq ".")) && (!($oneitem eq "..")))
+ {
+ my $item = $dir . $installer::globals::separator . $oneitem;
+
+ if ( -d $item ) # recursive
+ {
+ remove_empty_dirs_in_folder($item);
+ }
+ }
+ }
+
+ # try to remove empty directory
+ my $returnvalue = rmdir $dir;
+
+ if ( $returnvalue )
+ {
+ $infoline = "Successfully removed empty dir $dir\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ }
+
+}
+
+1;
diff --git a/solenv/bin/modules/installer/upx.pm b/solenv/bin/modules/installer/upx.pm
new file mode 100644
index 000000000000..7bfb14fae0d5
--- /dev/null
+++ b/solenv/bin/modules/installer/upx.pm
@@ -0,0 +1,156 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::upx;
+
+use installer::converter;
+use installer::existence;
+use installer::globals;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::scriptitems;
+use installer::systemactions;
+
+#####################################################################
+# Checking whether a file has to be stripped
+#####################################################################
+
+sub is_upx_candidate
+{
+ my ( $filename, $onefile ) = @_;
+
+ my $useupx = 0;
+
+ if (( $filename =~ /\.so\s*$/ ) ||
+ ( $filename =~ /\.dll\s*$/ ) ||
+ ( $filename =~ /\.exe\s*$/ ) ||
+ ( $filename =~ /\.bin\s*$/ ))
+ {
+ my $styles = "";
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+ if ( ! ( $styles =~ /\bDONT_UPX\b/ )) { $useupx = 1; }
+ }
+
+ return $useupx;
+}
+
+#####################################################################
+# Checking whether a file has to be stripped
+#####################################################################
+
+sub do_upx
+{
+ my ( $filename ) = @_;
+
+ my $compression = "9";
+ my $systemcall = $installer::globals::upxfile . " -" . $compression . " " . $filename;
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "WARNING: Could not successfully upx $filename! Using original file.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "SUCCESS: upx $filename!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return $returnvalue;
+}
+
+#####################################################################
+# Using upx to decrease file size
+#####################################################################
+
+sub upx_on_libraries
+{
+ my ( $filelist, $languagestringref) = @_;
+
+ installer::logger::include_header_into_logfile("UPX'ing files:");
+ my $infoline = "";
+
+ if ( ! $installer::globals::upx_in_path )
+ {
+ $infoline = "\n\nWarning: This is an UPX product, but upx was not found in PATH!\n\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Using upx: $installer::globals::upxfile\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $upxdirbase = installer::systemactions::create_directories("upx", $languagestringref);
+
+ if (! installer::existence::exists_in_array($upxdirbase, \@installer::globals::removedirs))
+ {
+ push(@installer::globals::removedirs, $upxdirbase);
+ }
+
+ for ( my $i = 0; $i <= $#{$filelist}; $i++ )
+ {
+ my $sourcefilename = ${$filelist}[$i]->{'sourcepath'};
+
+ if ( is_upx_candidate($sourcefilename, ${$filelist}[$i]) )
+ {
+ my $shortfilename = $sourcefilename;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$shortfilename);
+
+ $infoline = "\nUpx: $shortfilename";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # copy file into directory for stripped libraries
+ my $onelanguage = ${$filelist}[$i]->{'specificlanguage'};
+
+ # files without language into directory "00"
+ if ($onelanguage eq "") { $onelanguage = "00"; }
+
+ my $upxdir = $upxdirbase . $installer::globals::separator . $onelanguage;
+ installer::systemactions::create_directory($upxdir); # creating language specific subdirectories
+
+ my $destfilename = $upxdir . $installer::globals::separator . $shortfilename;
+ installer::systemactions::copy_one_file($sourcefilename, $destfilename);
+
+ # change sourcepath in files collector
+ ${$filelist}[$i]->{'sourcepath'} = $destfilename;
+
+ # do upx on file
+ my $return = do_upx($destfilename);
+
+ # Using original file, if upx was not successful (no reason for error)
+ if ( $return ) { ${$filelist}[$i]->{'sourcepath'} = $sourcefilename; }
+ }
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/admin.pm b/solenv/bin/modules/installer/windows/admin.pm
new file mode 100644
index 000000000000..47a71b059b2a
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/admin.pm
@@ -0,0 +1,916 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::admin;
+
+use File::Copy;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::pathanalyzer;
+use installer::systemactions;
+use installer::worker;
+use installer::windows::idtglobal;
+
+#################################################################################
+# Unpacking cabinet files with expand
+#################################################################################
+
+sub unpack_cabinet_file
+{
+ my ($cabfilename, $unpackdir) = @_;
+
+ my $infoline = "Unpacking cabinet file: $cabfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $expandfile = "expand.exe"; # Has to be in the path
+
+ # expand.exe has to be located in the system directory.
+ # Cygwin has another tool expand.exe, that converts tabs to spaces. This cannot be used of course.
+ # But this wrong expand.exe is typically in the PATH before this expand.exe, to unpack
+ # cabinet files.
+
+# if ( $^O =~ /cygwin/i )
+# {
+# $expandfile = $ENV{'SYSTEMROOT'} . "/system32/expand.exe"; # Has to be located in the systemdirectory
+# $expandfile =~ s/\\/\//;
+# if ( ! -f $expandfile ) { exit_program("ERROR: Did not find file $expandfile in the Windows system folder!"); }
+# }
+
+ if ( $^O =~ /cygwin/i )
+ {
+ $expandfile = qx(cygpath -u "$ENV{WINDIR}"/System32/expand.exe);
+ chomp $expandfile;
+ }
+
+ my $expandlogfile = $unpackdir . $installer::globals::separator . "expand.log";
+
+ # exclude cabinet file
+ # my $systemcall = $cabarc . " -o X " . $mergemodulehash->{'cabinetfile'};
+
+ my $systemcall = "";
+ if ( $^O =~ /cygwin/i ) {
+ my $localunpackdir = qx{cygpath -w "$unpackdir"};
+ chomp ($localunpackdir);
+ $localunpackdir =~ s/\\/\\\\/g;
+ $cabfilename =~ s/\\/\\\\/g;
+ $cabfilename =~ s/\s*$//g;
+ $systemcall = $expandfile . " " . $cabfilename . " -F:\* " . $localunpackdir . " \> " . $expandlogfile;
+ }
+ else
+ {
+ $systemcall = $expandfile . " " . $cabfilename . " -F:\* " . $unpackdir . " \> " . $expandlogfile;
+ }
+
+ my $returnvalue = system($systemcall);
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Could not extract cabinet file: $mergemodulehash->{'cabinetfile'} !", "change_file_table");
+ }
+ else
+ {
+ $infoline = "Success: Executed $systemcall successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+#################################################################################
+# Include tables into a msi database
+#################################################################################
+
+sub include_tables_into_pcpfile
+{
+ my ($fullmsidatabasepath, $workdir, $tables) = @_;
+
+ my $msidb = "msidb.exe"; # Has to be in the path
+ my $infoline = "";
+ my $systemcall = "";
+ my $returnvalue = "";
+
+ # Make all table 8+3 conform
+ my $alltables = installer::converter::convert_stringlist_into_array(\$tables, " ");
+
+ for ( my $i = 0; $i <= $#{$alltables}; $i++ )
+ {
+ my $tablename = ${$alltables}[$i];
+ $tablename =~ s/\s*$//;
+ my $namelength = length($tablename);
+ if ( $namelength > 8 )
+ {
+ my $newtablename = substr($tablename, 0, 8); # name, offset, length
+ my $oldfile = $workdir . $installer::globals::separator . $tablename . ".idt";
+ my $newfile = $workdir . $installer::globals::separator . $newtablename . ".idt";
+ if ( -f $newfile ) { unlink $newfile; }
+ installer::systemactions::copy_one_file($oldfile, $newfile);
+ my $savfile = $oldfile . ".orig";
+ installer::systemactions::copy_one_file($oldfile, $savfile);
+ }
+ }
+
+ # Import of tables
+
+ $systemcall = $msidb . " -d " . $fullmsidatabasepath . " -f " . $workdir . " -i " . $tables;
+
+ $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Could not include tables into msi database: $fullmsidatabasepath !", "include_tables_into_pcpfile");
+ }
+ else
+ {
+ $infoline = "Success: Executed $systemcall successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+#################################################################################
+# Extracting tables from msi database
+#################################################################################
+
+sub extract_tables_from_pcpfile
+{
+ my ($fullmsidatabasepath, $workdir, $tablelist) = @_;
+
+ my $msidb = "msidb.exe"; # Has to be in the path
+ my $infoline = "";
+ my $systemcall = "";
+ my $returnvalue = "";
+
+ my $localfullmsidatabasepath = $fullmsidatabasepath;
+
+ # Export of all tables by using "*"
+
+ if ( $^O =~ /cygwin/i ) {
+ # Copying the msi database locally guarantees the format of the directory.
+ # Otherwise it is defined in the file of UPDATE_DATABASE_LISTNAME
+
+ my $msifilename = $localfullmsidatabasepath;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$msifilename);
+ my $destdatabasename = $workdir . $installer::globals::separator . $msifilename;
+ installer::systemactions::copy_one_file($localfullmsidatabasepath, $destdatabasename);
+ $localfullmsidatabasepath = $destdatabasename;
+
+ chomp( $localfullmsidatabasepath = qx{cygpath -w "$localfullmsidatabasepath"} );
+ chomp( $workdir = qx{cygpath -w "$workdir"} );
+
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ $localfullmsidatabasepath =~ s/\\/\\\\/g;
+ $workdir =~ s/\\/\\\\/g;
+
+ # and if there are still slashes, they also need to be double backslash
+ $localfullmsidatabasepath =~ s/\//\\\\/g;
+ $workdir =~ s/\//\\\\/g;
+ }
+
+ $systemcall = $msidb . " -d " . $localfullmsidatabasepath . " -f " . $workdir . " -e $tablelist";
+ $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Could not exclude tables from pcp file: $localfullmsidatabasepath !", "extract_tables_from_pcpfile");
+ }
+ else
+ {
+ $infoline = "Success: Executed $systemcall successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+################################################################################
+# Analyzing the content of Directory.idt
+#################################################################################
+
+sub analyze_directory_file
+{
+ my ($filecontent) = @_;
+
+ my %table = ();
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if (( $i == 0 ) || ( $i == 1 ) || ( $i == 2 )) { next; }
+
+ if ( ${$filecontent}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my $dir = $1;
+ my $parent = $2;
+ my $name = $3;
+
+ if ( $name =~ /^\s*(.*?)\s*\:\s*(.*?)\s*$/ ) { $name = $2; }
+ if ( $name =~ /^\s*(.*?)\s*\|\s*(.*?)\s*$/ ) { $name = $2; }
+
+ my %helphash = ();
+ $helphash{'Directory_Parent'} = $parent;
+ $helphash{'DefaultDir'} = $name;
+ $table{$dir} = \%helphash;
+ }
+ }
+
+ return \%table;
+}
+
+#################################################################################
+# Analyzing the content of Component.idt
+#################################################################################
+
+sub analyze_component_file
+{
+ my ($filecontent) = @_;
+
+ my %table = ();
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if (( $i == 0 ) || ( $i == 1 ) || ( $i == 2 )) { next; }
+
+ if ( ${$filecontent}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my $component = $1;
+ my $dir = $3;
+
+ $table{$component} = $dir;
+ }
+ }
+
+ return \%table;
+}
+
+#################################################################################
+# Analyzing the full content of Component.idt
+#################################################################################
+
+sub analyze_keypath_component_file
+{
+ my ($filecontent) = @_;
+
+ my %keypathtable = ();
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if (( $i == 0 ) || ( $i == 1 ) || ( $i == 2 )) { next; }
+
+ if ( ${$filecontent}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my $component = $1;
+ my $keypath = $6;
+
+ $keypathtable{$keypath} = $component;
+ }
+ }
+
+ return (\%keypathtable);
+
+}
+
+#################################################################################
+# Analyzing the content of Registry.idt
+#################################################################################
+
+sub analyze_registry_file
+{
+ my ($filecontent) = @_;
+
+ my %table = ();
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if (( $i == 0 ) || ( $i == 1 ) || ( $i == 2 )) { next; }
+
+ if ( ${$filecontent}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my $registry = $1;
+ my $root = $2;
+ my $key = $3;
+ my $name = $4;
+ my $value = $5;
+ my $component = $6;
+
+ my %helphash = ();
+ # $helphash{'Registry'} = $registry;
+ $helphash{'Root'} = $root;
+ $helphash{'Key'} = $key;
+ $helphash{'Name'} = $name;
+ $helphash{'Value'} = $value;
+ $helphash{'Component'} = $component;
+
+ $table{$registry} = \%helphash;
+ }
+ }
+
+ return \%table;
+}
+
+#################################################################################
+# Analyzing the content of File.idt
+#################################################################################
+
+sub analyze_file_file
+{
+ my ($filecontent) = @_;
+
+ my %table = ();
+ my %fileorder = ();
+ my $maxsequence = 0;
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if (( $i == 0 ) || ( $i == 1 ) || ( $i == 2 )) { next; }
+
+ if ( ${$filecontent}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my $file = $1;
+ my $comp = $2;
+ my $filename = $3;
+ my $sequence = $8;
+
+ if ( $filename =~ /^\s*(.*?)\s*\|\s*(.*?)\s*$/ ) { $filename = $2; }
+
+ my %helphash = ();
+ $helphash{'Component'} = $comp;
+ $helphash{'FileName'} = $filename;
+ $helphash{'Sequence'} = $sequence;
+
+ $table{$file} = \%helphash;
+
+ $fileorder{$sequence} = $file;
+
+ if ( $sequence > $maxsequence ) { $maxsequence = $sequence; }
+ }
+ }
+
+ return (\%table, \%fileorder, $maxsequence);
+}
+
+####################################################################################
+# Recursively creating the directory tree
+####################################################################################
+
+sub create_directory_tree
+{
+ my ($parent, $pathcollector, $fulldir, $dirhash) = @_;
+
+ foreach my $dir ( keys %{$dirhash} )
+ {
+ if (( $dirhash->{$dir}->{'Directory_Parent'} eq $parent ) && ( $dirhash->{$dir}->{'DefaultDir'} ne "." ))
+ {
+ my $dirname = $dirhash->{$dir}->{'DefaultDir'};
+ # Create the directory
+ my $newdir = $fulldir . $installer::globals::separator . $dirname;
+ if ( ! -f $newdir ) { mkdir $newdir; }
+ # Saving in collector
+ $pathcollector->{$dir} = $newdir;
+ # Iteration
+ create_directory_tree($dir, $pathcollector, $newdir, $dirhash);
+ }
+ }
+}
+
+####################################################################################
+# Creating the directory tree
+####################################################################################
+
+sub create_directory_structure
+{
+ my ($dirhash, $targetdir) = @_;
+
+ my %fullpathhash = ();
+
+ my @startparents = ("TARGETDIR", "INSTALLLOCATION");
+
+ foreach $dir (@startparents) { create_directory_tree($dir, \%fullpathhash, $targetdir, $dirhash); }
+
+ # Also adding the pathes of the startparents
+ foreach $dir (@startparents)
+ {
+ if ( ! exists($fullpathhash{$dir}) ) { $fullpathhash{$dir} = $targetdir; }
+ }
+
+ return \%fullpathhash;
+}
+
+####################################################################################
+# Copying files into installation set
+####################################################################################
+
+sub copy_files_into_directory_structure
+{
+ my ($fileorder, $filehash, $componenthash, $fullpathhash, $maxsequence, $unpackdir, $installdir, $dirhash) = @_;
+
+ my $unopkgfile = "";
+
+ for ( my $i = 1; $i <= $maxsequence; $i++ )
+ {
+ if ( exists($fileorder->{$i}) )
+ {
+ my $file = $fileorder->{$i};
+ if ( ! exists($filehash->{$file}->{'Component'}) ) { installer::exiter::exit_program("ERROR: Did not find component for file: \"$file\".", "copy_files_into_directory_structure"); }
+ my $component = $filehash->{$file}->{'Component'};
+ if ( ! exists($componenthash->{$component}) ) { installer::exiter::exit_program("ERROR: Did not find directory for component: \"$component\".", "copy_files_into_directory_structure"); }
+ my $dirname = $componenthash->{$component};
+ if ( ! exists($fullpathhash->{$dirname}) ) { installer::exiter::exit_program("ERROR: Did not find full directory path for dir: \"$dirname\".", "copy_files_into_directory_structure"); }
+ my $destdir = $fullpathhash->{$dirname};
+ if ( ! exists($filehash->{$file}->{'FileName'}) ) { installer::exiter::exit_program("ERROR: Did not find \"FileName\" for file: \"$file\".", "copy_files_into_directory_structure"); }
+ my $destfile = $filehash->{$file}->{'FileName'};
+
+ $destfile = $destdir . $installer::globals::separator . $destfile;
+ my $sourcefile = $unpackdir . $installer::globals::separator . $file;
+
+ if ( ! -f $sourcefile )
+ {
+ # It is possible, that this was an unpacked file
+ # Looking in the dirhash, to find the subdirectory in the installation set (the id is $dirname)
+ # subdir is not recursively analyzed, only one directory.
+
+ my $oldsourcefile = $sourcefile;
+ my $subdir = "";
+ if ( exists($dirhash->{$dirname}->{'DefaultDir'}) ) { $subdir = $dirhash->{$dirname}->{'DefaultDir'} . $installer::globals::separator; }
+ my $realfilename = $filehash->{$file}->{'FileName'};
+ my $localinstalldir = $installdir;
+
+ $localinstalldir =~ s/\\\s*$//;
+ $localinstalldir =~ s/\/\s*$//;
+
+ $sourcefile = $localinstalldir . $installer::globals::separator . $subdir . $realfilename;
+
+ if ( ! -f $sourcefile )
+ {
+ installer::exiter::exit_program("ERROR: File not found: \"$oldsourcefile\" (or \"$sourcefile\").", "copy_files_into_directory_structure");
+ }
+ }
+
+ my $copyreturn = copy($sourcefile, $destfile);
+
+ if ( ! $copyreturn) # only logging problems
+ {
+ my $infoline = "ERROR: Could not copy $sourcefile to $destfile (insufficient disc space for $destfile ?)\n";
+ $returnvalue = 0;
+ push(@installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program($infoline, "copy_files_into_directory_structure");
+ }
+
+ if ( $destfile =~ /unopkg\.exe\s*$/ ) { $unopkgfile = $destfile; }
+
+ # installer::systemactions::copy_one_file($sourcefile, $destfile);
+ }
+ # else # allowing missing sequence numbers ?
+ # {
+ # installer::exiter::exit_program("ERROR: No file assigned to sequence $i", "copy_files_into_directory_structure");
+ # }
+ }
+
+ return $unopkgfile;
+}
+
+
+###############################################################
+# Setting the time string for the
+# Summary Information stream in the
+# msi database of the admin installations.
+###############################################################
+
+sub get_sis_time_string
+{
+ # Syntax: <yyyy/mm/dd hh:mm:ss>
+ my $second = (localtime())[0];
+ my $minute = (localtime())[1];
+ my $hour = (localtime())[2];
+ my $day = (localtime())[3];
+ my $month = (localtime())[4];
+ my $year = 1900 + (localtime())[5];
+
+ $month++; # zero based month
+
+ if ( $second < 10 ) { $second = "0" . $second; }
+ if ( $minute < 10 ) { $minute = "0" . $minute; }
+ if ( $hour < 10 ) { $hour = "0" . $hour; }
+ if ( $day < 10 ) { $day = "0" . $day; }
+ if ( $month < 10 ) { $month = "0" . $month; }
+
+ my $timestring = $year . "/" . $month . "/" . $day . " " . $hour . ":" . $minute . ":" . $second;
+
+ return $timestring;
+}
+
+###############################################################
+# Windows registry entries containing properties are not set
+# correctly during msp patch process. The properties are
+# empty or do get their default values. This destroys the
+# values of many entries in Windows registry.
+# This can be fixed by removing all entries in Registry table,
+# containing a property before starting msimsp.exe.
+###############################################################
+
+sub remove_properties_from_registry_table
+{
+ my ($registryhash, $componentkeypathhash, $registryfilecontent) = @_;
+
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Start remove_properties_from_registry_table");
+
+ my @registrytable = ();
+
+ # Registry hash
+ # Collecting all RegistryItems with values containing a property: [...]
+ # To which component do they belong
+ # Is this after removal an empty component? Create a replacement, so that
+ # no Component has to be removed.
+ # Is this RegistryItem a KeyPath of a component. Then it cannot be removed.
+
+ my %problemitems = ();
+ my %problemcomponents = ();
+ my %securecomponents = ();
+ my $changevalue = "";
+ my $changeroot = "";
+ my $infoline = "";
+
+ my $newitemcounter = 0;
+ my $olditemcounter = 0;
+
+ foreach my $regitem ( keys %{$registryhash} )
+ {
+ my $value = "";
+ if ( exists($registryhash->{$regitem}->{'Value'}) ) { $value = $registryhash->{$regitem}->{'Value'}; }
+
+ if ( $value =~ /^.*(\[.*?\]).*$/ )
+ {
+ my $property = $1;
+
+ # Collecting registry item
+ $problemitems{$regitem} = 1; # "1" -> can be removed
+ if ( exists($componentkeypathhash->{$regitem}) ) { $problemitems{$regitem} = 2; } # "2" -> cannot be removed, KeyPath
+
+ # Collecting component (and number of problematic registry items
+ # my $component = $registryhash->{$regitem}->{'Component'};
+ # if ( exists($problemcomponents{$regitem}) ) { $problemcomponents{$regitem} = $problemcomponents{$regitem} + 1; }
+ # else { $problemcomponents{$regitem} = 1; }
+ }
+ else
+ {
+ # Collecting all components with secure regisry items
+ my $component = "";
+ if ( exists($registryhash->{$regitem}->{'Component'}) ) { $component = $registryhash->{$regitem}->{'Component'}; }
+ if ( $component eq "" ) { installer::exiter::exit_program("ERROR: Did not find component for registry item \"$regitem\".", "remove_properties_from_registry_table"); }
+ $securecomponents{$component} = 1;
+ }
+
+ # Searching for change value
+ my $localkey = "";
+ if ( exists($registryhash->{$regitem}->{'Key'}) ) { $localkey = $registryhash->{$regitem}->{'Key'}; }
+ if (( $localkey =~ /^\s*(Software\\.*\\)StartMenu\s*$/ ) && ( $changevalue eq "" ))
+ {
+ $changevalue = $1;
+ $changeroot = $registryhash->{$regitem}->{'Root'};
+ }
+
+ $olditemcounter++;
+ }
+
+ my $removecounter = 0;
+ my $renamecounter = 0;
+
+ foreach my $regitem ( keys %{$registryhash} )
+ {
+ my $value = "";
+ if ( exists($registryhash->{$regitem}->{'Value'}) ) { $value = $registryhash->{$regitem}->{'Value'}; }
+
+ if ( $value =~ /^.*(\[.*?\]).*$/ )
+ {
+ # Removing registry items, that are no KeyPath and that belong to components,
+ # that have other secure registry items.
+
+ my $component = "";
+ if ( exists($registryhash->{$regitem}->{'Component'}) ) { $component = $registryhash->{$regitem}->{'Component'}; }
+ if ( $component eq "" ) { installer::exiter::exit_program("ERROR: Did not find component for registry item (2) \"$regitem\".", "remove_properties_from_registry_table"); }
+
+ if (( $problemitems{$regitem} == 1 ) && ( exists($securecomponents{$component}) ))
+ {
+ # remove complete registry item
+ delete($registryhash->{$regitem});
+ $removecounter++;
+ $infoline = "Removing registry item: $regitem : $value\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ # Changing values of registry items, that are KeyPath or that contain to
+ # components with only unsecure registry items.
+
+ if (( $problemitems{$regitem} == 2 ) || ( ! exists($securecomponents{$component}) ))
+ {
+ # change value of registry item
+ if ( $changevalue eq "" ) { installer::exiter::exit_program("ERROR: Did not find good change value for registry items", "remove_properties_from_registry_table"); }
+
+ my $oldkey = "";
+ if ( exists($registryhash->{$regitem}->{'Key'}) ) { $oldkey = $registryhash->{$regitem}->{'Key'}; };
+ my $oldname = "";
+ if ( exists($registryhash->{$regitem}->{'Name'}) ) { $oldname = $registryhash->{$regitem}->{'Name'}; }
+ my $oldvalue = "";
+ if ( exists($registryhash->{$regitem}->{'Value'}) ) { $oldvalue = $registryhash->{$regitem}->{'Value'}; }
+
+ $registryhash->{$regitem}->{'Key'} = $changevalue . "RegistryItem";
+ $registryhash->{$regitem}->{'Root'} = $changeroot;
+ $registryhash->{$regitem}->{'Name'} = $regitem;
+ $registryhash->{$regitem}->{'Value'} = 1;
+ $renamecounter++;
+
+ $infoline = "Changing registry item: $regitem\n";
+ $infoline = "Old: $oldkey : $oldname : $oldvalue\n";
+ $infoline = "New: $registryhash->{$regitem}->{'Key'} : $registryhash->{$regitem}->{'Name'} : $registryhash->{$regitem}->{'Value'}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+ }
+
+ $infoline = "Number of removed registry items: $removecounter\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "Number of changed registry items: $renamecounter\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Creating the new content of Registry table
+ # First three lines from $registryfilecontent
+ # All further files from changed $registryhash
+
+ for ( my $i = 0; $i <= 2; $i++ ) { push(@registrytable, ${$registryfilecontent}[$i]); }
+
+ foreach my $regitem ( keys %{$registryhash} )
+ {
+ my $root = "";
+ if ( exists($registryhash->{$regitem}->{'Root'}) ) { $root = $registryhash->{$regitem}->{'Root'}; }
+ else { installer::exiter::exit_program("ERROR: Did not find root in registry table for item: \"$regitem\".", "remove_properties_from_registry_table"); }
+ my $localkey = "";
+ if ( exists($registryhash->{$regitem}->{'Key'}) ) { $localkey = $registryhash->{$regitem}->{'Key'}; }
+ my $name = "";
+ if ( exists($registryhash->{$regitem}->{'Name'}) ) { $name = $registryhash->{$regitem}->{'Name'}; }
+ my $value = "";
+ if ( exists($registryhash->{$regitem}->{'Value'}) ) { $value = $registryhash->{$regitem}->{'Value'}; }
+ my $comp = "";
+ if ( exists($registryhash->{$regitem}->{'Component'}) ) { $comp = $registryhash->{$regitem}->{'Component'}; }
+
+ my $oneline = $regitem . "\t" . $root . "\t" . $localkey . "\t" . $name . "\t" . $value . "\t" . $comp . "\n";
+ push(@registrytable, $oneline);
+
+ $newitemcounter++;
+ }
+
+ $infoline = "Number of registry items: $newitemcounter. Old value: $olditemcounter.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: End remove_properties_from_registry_table");
+
+ return (\@registrytable);
+}
+
+###############################################################
+# Writing content of administrative installations into
+# Summary Information Stream of msi database.
+# This is required for example for following
+# patch processes using Windows Installer service.
+###############################################################
+
+sub write_sis_info
+{
+ my ($msidatabase) = @_ ;
+
+ if ( ! -f $msidatabase ) { installer::exiter::exit_program("ERROR: Cannot find file $msidatabase", "write_sis_info"); }
+
+ my $msiinfo = "msiinfo.exe"; # Has to be in the path
+ my $infoline = "";
+ my $systemcall = "";
+ my $returnvalue = "";
+
+ # Required setting for administrative installations:
+ # -w 4 (source files are unpacked), wordcount
+ # -s <date of admin installation>, LastPrinted, Syntax: <yyyy/mm/dd hh:mm:ss>
+ # -l <person_making_admin_installation>, LastSavedBy
+
+ my $wordcount = 4; # Unpacked files
+ my $lastprinted = get_sis_time_string();
+ my $lastsavedby = "Installer";
+
+ my $localmsidatabase = $msidatabase;
+
+ if( $^O =~ /cygwin/i )
+ {
+ $localmsidatabase = qx{cygpath -w "$localmsidatabase"};
+ $localmsidatabase =~ s/\\/\\\\/g;
+ $localmsidatabase =~ s/\s*$//g;
+ }
+
+ $systemcall = $msiinfo . " " . "\"" . $localmsidatabase . "\"" . " -w " . $wordcount . " -s " . "\"" . $lastprinted . "\"" . " -l $lastsavedby";
+ push(@installer::globals::logfileinfo, $systemcall);
+ $returnvalue = system($systemcall);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall !\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program($infoline, "write_sis_info");
+ }
+}
+
+####################################################
+# Detecting the directory with extensions
+####################################################
+
+sub get_extensions_dir
+{
+ my ( $unopkgfile ) = @_;
+
+ my $localbranddir = $unopkgfile;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$localbranddir); # "program" dir in brand layer
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$localbranddir); # root dir in brand layer
+ $localbranddir =~ s/\Q$installer::globals::separator\E\s*$//;
+ my $extensiondir = $localbranddir . $installer::globals::separator . "share" . $installer::globals::separator . "extensions";
+
+ return $extensiondir;
+}
+
+##############################################################
+# Removing all empty directories below a specified directory
+##############################################################
+
+sub remove_empty_dirs_in_folder
+{
+ my ( $dir, $firstrun ) = @_;
+
+ if ( $firstrun )
+ {
+ print "Removing superfluous directories\n";
+ }
+
+ my @content = ();
+
+ $dir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ if ( -d $dir )
+ {
+ opendir(DIR, $dir);
+ @content = readdir(DIR);
+ closedir(DIR);
+
+ my $oneitem;
+
+ foreach $oneitem (@content)
+ {
+ if ((!($oneitem eq ".")) && (!($oneitem eq "..")))
+ {
+ my $item = $dir . $installer::globals::separator . $oneitem;
+
+ if ( -d $item ) # recursive
+ {
+ remove_empty_dirs_in_folder($item, 0);
+ }
+ }
+ }
+
+ # try to remove empty directory
+ my $returnvalue = rmdir $dir;
+
+ # if ( $returnvalue ) { print "Successfully removed empty dir $dir\n"; }
+ }
+}
+
+####################################################################################
+# Simulating an administrative installation
+####################################################################################
+
+sub make_admin_install
+{
+ my ($databasepath, $targetdir) = @_;
+
+ # Create helper directory
+
+ installer::logger::print_message( "... installing $databasepath in directory $targetdir ...\n" );
+
+ my $helperdir = $targetdir . $installer::globals::separator . "installhelper";
+ installer::systemactions::create_directory($helperdir);
+
+ # Get File.idt, Component.idt and Directory.idt from database
+
+ my $tablelist = "File Directory Component Registry";
+ extract_tables_from_pcpfile($databasepath, $helperdir, $tablelist);
+
+ # Unpack all cab files into $helperdir, cab files must be located next to msi database
+ my $installdir = $databasepath;
+
+ if ( $^O =~ /cygwin/i ) { $installdir =~ s/\\/\//g; } # backslash to slash
+
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$installdir);
+
+ if ( $^O =~ /cygwin/i ) { $installdir =~ s/\//\\/g; } # slash to backslash
+
+ my $databasefilename = $databasepath;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$databasefilename);
+
+ my $cabfiles = installer::systemactions::find_file_with_file_extension("cab", $installdir);
+
+ if ( $#{$cabfiles} < 0 ) { installer::exiter::exit_program("ERROR: Did not find any cab file in directory $installdir", "make_admin_install"); }
+
+ # Set unpackdir
+ my $unpackdir = $helperdir . $installer::globals::separator . "unpack";
+ installer::systemactions::create_directory($unpackdir);
+
+ for ( my $i = 0; $i <= $#{$cabfiles}; $i++ )
+ {
+ my $cabfile = "";
+ if ( $^O =~ /cygwin/i )
+ {
+ $cabfile = $installdir . ${$cabfiles}[$i];
+ }
+ else
+ {
+ $cabfile = $installdir . $installer::globals::separator . ${$cabfiles}[$i];
+ }
+ unpack_cabinet_file($cabfile, $unpackdir);
+ }
+
+ # Reading tables
+ my $filename = $helperdir . $installer::globals::separator . "Directory.idt";
+ my $filecontent = installer::files::read_file($filename);
+ my $dirhash = analyze_directory_file($filecontent);
+
+ $filename = $helperdir . $installer::globals::separator . "Component.idt";
+ my $componentfilecontent = installer::files::read_file($filename);
+ my $componenthash = analyze_component_file($componentfilecontent);
+
+ $filename = $helperdir . $installer::globals::separator . "File.idt";
+ $filecontent = installer::files::read_file($filename);
+ my ( $filehash, $fileorder, $maxsequence ) = analyze_file_file($filecontent);
+
+ # Creating the directory structure
+ my $fullpathhash = create_directory_structure($dirhash, $targetdir);
+
+ # Copying files
+ my $unopkgfile = copy_files_into_directory_structure($fileorder, $filehash, $componenthash, $fullpathhash, $maxsequence, $unpackdir, $installdir, $dirhash);
+
+ my $msidatabase = $targetdir . $installer::globals::separator . $databasefilename;
+ installer::systemactions::copy_one_file($databasepath, $msidatabase);
+
+ if ( $unopkgfile ne "" )
+ {
+ # Removing empty dirs in extension folder
+ my $extensionfolder = get_extensions_dir($unopkgfile);
+ if ( -d $extensionfolder ) { remove_empty_dirs_in_folder($extensionfolder, 1); }
+ }
+
+ # Editing registry table because of wrong Property value
+ # my $registryfilename = $helperdir . $installer::globals::separator . "Registry.idt";
+ # my $componentfilename = $helperdir . $installer::globals::separator . "Component.idt";
+ # my $componentkeypathhash = analyze_keypath_component_file($componentfilecontent);
+
+ # my $registryfilecontent = installer::files::read_file($registryfilename);
+ # my $registryhash = analyze_registry_file($registryfilecontent);
+
+ # $registryfilecontent = remove_properties_from_registry_table($registryhash, $componentkeypathhash, $registryfilecontent);
+
+ # installer::files::save_file($registryfilename, $registryfilecontent);
+ # $tablelist = "Registry";
+ # include_tables_into_pcpfile($msidatabase, $helperdir, $tablelist);
+
+ # Saving info in Summary Information Stream of msi database (required for following patches)
+ write_sis_info($msidatabase);
+
+ return $msidatabase;
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/assembly.pm b/solenv/bin/modules/installer/windows/assembly.pm
new file mode 100644
index 000000000000..bb5efe2207d5
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/assembly.pm
@@ -0,0 +1,371 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::assembly;
+
+use installer::files;
+use installer::globals;
+use installer::worker;
+use installer::windows::idtglobal;
+
+##############################################################
+# Returning the first module of a file from the
+# comma separated list of modules.
+##############################################################
+
+sub get_msiassembly_feature
+{
+ my ( $onefile ) = @_;
+
+ my $module = "";
+
+ if ( $onefile->{'modules'} ) { $module = $onefile->{'modules'}; }
+
+ # If modules contains a list of modules, only taking the first one.
+
+ if ( $module =~ /^\s*(.*?)\,/ ) { $module = $1; }
+
+ # Attention: Maximum feature length is 38!
+ installer::windows::idtglobal::shorten_feature_gid(\$module);
+
+ return $module;
+}
+
+##############################################################
+# Returning the component of a file.
+##############################################################
+
+sub get_msiassembly_component
+{
+ my ( $onefile ) = @_;
+
+ my $component = "";
+
+ $component = $onefile->{'componentname'};
+
+ return $component;
+}
+
+##############################################################
+# Returning the file name as manifest file
+##############################################################
+
+sub get_msiassembly_filemanifest
+{
+ my ( $onefile ) = @_;
+
+ my $filemanifest = "";
+
+ $filemanifest = $onefile->{'uniquename'};
+ # $filemanifest = $onefile->{'Name'};
+
+ return $filemanifest;
+}
+
+
+##############################################################
+# Returning the file application
+##############################################################
+
+sub get_msiassembly_fileapplication
+{
+ my ( $onefile ) = @_;
+
+ my $fileapplication = "";
+
+ return $fileapplication;
+}
+
+##############################################################
+# Returning the file attributes
+##############################################################
+
+sub get_msiassembly_attributes
+{
+ my ( $onefile ) = @_;
+
+ my $fileattributes = "";
+
+ if ( $onefile->{'Attributes'} ne "" ) { $fileattributes = $onefile->{'Attributes'}; }
+
+ return $fileattributes;
+}
+
+##############################################################
+# Returning the file object for the msiassembly table.
+##############################################################
+
+sub get_msiassembly_file
+{
+ my ( $filesref, $filename ) = @_;
+
+ my $foundfile = 0;
+ my $onefile;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ $onefile = ${$filesref}[$i];
+ my $name = $onefile->{'Name'};
+
+ if ( $name eq $filename )
+ {
+ $foundfile = 1;
+ last;
+ }
+ }
+
+ # It does not need to exist. For example products that do not contain the libraries.
+ # if (! $foundfile ) { installer::exiter::exit_program("ERROR: No unique file name found for $filename !", "get_selfreg_file"); }
+
+ if (! $foundfile ) { $onefile = ""; }
+
+ return $onefile;
+}
+
+##############################################################
+# Returning the file object for the msiassembly table.
+##############################################################
+
+sub get_msiassembly_file_by_gid
+{
+ my ( $filesref, $gid ) = @_;
+
+ my $foundfile = 0;
+ my $onefile;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ $onefile = ${$filesref}[$i];
+ my $filegid = $onefile->{'gid'};
+
+ if ( $filegid eq $gid )
+ {
+ $foundfile = 1;
+ last;
+ }
+ }
+
+ # It does not need to exist. For example products that do not contain the libraries.
+ # if (! $foundfile ) { installer::exiter::exit_program("ERROR: No unique file name found for $filename !", "get_selfreg_file"); }
+
+ if (! $foundfile ) { $onefile = ""; }
+
+ return $onefile;
+}
+
+####################################################################################
+# Creating the file MsiAssembly.idt dynamically
+# Content:
+# Component_ Feature_ File_Manifest File_Application Attributes
+# s72 s38 S72 S72 I2
+# MsiAssembly Component_
+####################################################################################
+
+sub create_msiassembly_table
+{
+ my ($filesref, $basedir) = @_;
+
+ $installer::globals::msiassemblyfiles = installer::worker::collect_all_items_with_special_flag($filesref, "ASSEMBLY");
+
+ my @msiassemblytable = ();
+
+ installer::windows::idtglobal::write_idt_header(\@msiassemblytable, "msiassembly");
+
+ # Registering all libraries listed in $installer::globals::msiassemblyfiles
+
+ for ( my $i = 0; $i <= $#{$installer::globals::msiassemblyfiles}; $i++ )
+ {
+ my $onefile = ${$installer::globals::msiassemblyfiles}[$i];
+
+ my %msiassembly = ();
+
+ $msiassembly{'Component_'} = get_msiassembly_component($onefile);
+ $msiassembly{'Feature_'} = get_msiassembly_feature($onefile);
+ $msiassembly{'File_Manifest'} = get_msiassembly_filemanifest($onefile);
+ $msiassembly{'File_Application'} = get_msiassembly_fileapplication($onefile);
+ $msiassembly{'Attributes'} = get_msiassembly_attributes($onefile);
+
+ my $oneline = $msiassembly{'Component_'} . "\t" . $msiassembly{'Feature_'} . "\t" .
+ $msiassembly{'File_Manifest'} . "\t" . $msiassembly{'File_Application'} . "\t" .
+ $msiassembly{'Attributes'} . "\n";
+
+ push(@msiassemblytable, $oneline);
+ }
+
+ # Saving the file
+
+ my $msiassemblytablename = $basedir . $installer::globals::separator . "MsiAssem.idt";
+ installer::files::save_file($msiassemblytablename ,\@msiassemblytable);
+ my $infoline = "Created idt file: $msiassemblytablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+}
+
+####################################################################################
+# Returning the name for the table MsiAssemblyName
+####################################################################################
+
+sub get_msiassemblyname_name
+{
+ ( $number ) = @_;
+
+ my $name = "";
+
+ if ( $number == 1 ) { $name = "name"; }
+ elsif ( $number == 2 ) { $name = "publicKeyToken"; }
+ elsif ( $number == 3 ) { $name = "version"; }
+ elsif ( $number == 4 ) { $name = "culture"; }
+
+ return $name;
+}
+
+####################################################################################
+# Creating the file MsiAssemblyName.idt dynamically
+# Content:
+# Component_ Name Value
+# s72 s255 s255
+# MsiAssemblyName Component_ Name
+####################################################################################
+
+sub create_msiassemblyname_table
+{
+ my ($filesref, $basedir) = @_;
+
+ my @msiassemblynametable = ();
+
+ installer::windows::idtglobal::write_idt_header(\@msiassemblynametable, "msiassemblyname");
+
+ for ( my $i = 0; $i <= $#{$installer::globals::msiassemblyfiles}; $i++ )
+ {
+ my $onefile = ${$installer::globals::msiassemblyfiles}[$i];
+
+ my $component = get_msiassembly_component($onefile);
+ my $oneline = "";
+
+ # Order: (Assembly)name, publicKeyToken, version, culture.
+
+ if ( $onefile->{'Assemblyname'} )
+ {
+ $oneline = $component . "\t" . "name" . "\t" . $onefile->{'Assemblyname'} . "\n";
+ push(@msiassemblynametable, $oneline);
+ }
+
+ if ( $onefile->{'PublicKeyToken'} )
+ {
+ $oneline = $component . "\t" . "publicKeyToken" . "\t" . $onefile->{'PublicKeyToken'} . "\n";
+ push(@msiassemblynametable, $oneline);
+ }
+
+ if ( $onefile->{'Version'} )
+ {
+ $oneline = $component . "\t" . "version" . "\t" . $onefile->{'Version'} . "\n";
+ push(@msiassemblynametable, $oneline);
+ }
+
+ if ( $onefile->{'Culture'} )
+ {
+ $oneline = $component . "\t" . "culture" . "\t" . $onefile->{'Culture'} . "\n";
+ push(@msiassemblynametable, $oneline);
+ }
+
+ if ( $onefile->{'ProcessorArchitecture'} )
+ {
+ $oneline = $component . "\t" . "processorArchitecture" . "\t" . $onefile->{'ProcessorArchitecture'} . "\n";
+ push(@msiassemblynametable, $oneline);
+ }
+ }
+
+ # Saving the file
+
+ my $msiassemblynametablename = $basedir . $installer::globals::separator . "MsiAsseN.idt";
+ installer::files::save_file($msiassemblynametablename ,\@msiassemblynametable);
+ my $infoline = "Created idt file: $msiassemblynametablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+####################################################################################
+# setting an installation condition for the assembly libraries saved in
+# @installer::globals::msiassemblynamecontent
+####################################################################################
+
+sub add_assembly_condition_into_component_table
+{
+ my ($filesref, $basedir) = @_;
+
+ my $componenttablename = $basedir . $installer::globals::separator . "Componen.idt";
+ my $componenttable = installer::files::read_file($componenttablename);
+ my $changed = 0;
+ my $infoline = "";
+
+ for ( my $i = 0; $i <= $#{$installer::globals::msiassemblyfiles}; $i++ )
+ {
+ my $onefile = ${$installer::globals::msiassemblyfiles}[$i];
+
+ my $filecomponent = get_msiassembly_component($onefile);
+
+ for ( my $j = 0; $j <= $#{$componenttable}; $j++ )
+ {
+ my $oneline = ${$componenttable}[$j];
+
+ if ( $oneline =~ /(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)/ )
+ {
+ my $component = $1;
+ my $componentid = $2;
+ my $directory = $3;
+ my $attributes = $4;
+ my $condition = $5;
+ my $keypath = $6;
+
+ if ( $component eq $filecomponent )
+ {
+ # setting the condition
+
+ # $condition = "MsiNetAssemblySupport";
+ $condition = "DOTNET_SUFFICIENT=1";
+ $oneline = $component . "\t" . $componentid . "\t" . $directory . "\t" . $attributes . "\t" . $condition . "\t" . $keypath . "\n";
+ ${$componenttable}[$j] = $oneline;
+ $changed = 1;
+ $infoline = "Changing $componenttablename :\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = $oneline;
+ push(@installer::globals::logfileinfo, $infoline);
+ last;
+ }
+ }
+ }
+ }
+
+ if ( $changed )
+ {
+ # Saving the file
+ installer::files::save_file($componenttablename ,$componenttable);
+ $infoline = "Saved idt file: $componenttablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+}
+
+1; \ No newline at end of file
diff --git a/solenv/bin/modules/installer/windows/binary.pm b/solenv/bin/modules/installer/windows/binary.pm
new file mode 100644
index 000000000000..96ee50eb4b19
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/binary.pm
@@ -0,0 +1,77 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::binary;
+
+use installer::existence;
+use installer::files;
+use installer::globals;
+
+###########################################################################################################
+# Updating the table Binary dynamically with all files from $binarytablefiles
+# Content:
+# Name Data
+# s72 v0
+# Binary Name
+###########################################################################################################
+
+sub update_binary_table
+{
+ my ($languageidtdir, $filesref, $binarytablefiles) = @_;
+
+ my $binaryidttablename = $languageidtdir . $installer::globals::separator . "Binary.idt";
+ my $binaryidttable = installer::files::read_file($binaryidttablename);
+
+ # Only the iconfiles, that are used in the shortcut table for the
+ # FolderItems (entries in Windows startmenu) are added into the icon table.
+
+ for ( my $i = 0; $i <= $#{$binarytablefiles}; $i++ )
+ {
+ my $binaryfile = ${$binarytablefiles}[$i];
+ my $binaryfilename = $binaryfile->{'Name'};
+ my $binaryfiledata = $binaryfilename;
+
+ $binaryfilename =~ s/\.//g; # removing "." in filename: "abc.dll" to "abcdll" in name column
+
+ my %binary = ();
+
+ $binary{'Name'} = $binaryfilename;
+ $binary{'Data'} = $binaryfiledata;
+
+ my $oneline = $binary{'Name'} . "\t" . $binary{'Data'} . "\n";
+
+ push(@{$binaryidttable}, $oneline);
+ }
+
+ # Saving the file
+
+ installer::files::save_file($binaryidttablename ,$binaryidttable);
+ my $infoline = "Updated idt file: $binaryidttablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/component.pm b/solenv/bin/modules/installer/windows/component.pm
new file mode 100644
index 000000000000..38989858a4b6
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/component.pm
@@ -0,0 +1,524 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::component;
+
+use installer::converter;
+use installer::existence;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::windows::idtglobal;
+use installer::windows::language;
+
+##############################################################
+# Returning a globally unique ID (GUID) for a component
+# If the component is new, a unique guid has to be created.
+# If the component already exists, the guid has to be
+# taken from a list component <-> guid
+# Sample for a guid: {B68FD953-3CEF-4489-8269-8726848056E8}
+##############################################################
+
+sub get_component_guid
+{
+ my ( $componentname, $componentidhashref ) = @_;
+
+ # At this time only a template
+ my $returnvalue = "\{COMPONENTGUID\}";
+
+ if (( $installer::globals::updatedatabase ) && ( exists($componentidhashref->{$componentname}) ))
+ {
+ $returnvalue = $componentidhashref->{$componentname};
+ }
+
+ # Returning a ComponentID, that is assigned in scp project
+ if ( exists($installer::globals::componentid{$componentname}) )
+ {
+ $returnvalue = "\{" . $installer::globals::componentid{$componentname} . "\}";
+ }
+
+ return $returnvalue;
+}
+
+##############################################################
+# Returning the directory for a file component.
+##############################################################
+
+sub get_file_component_directory
+{
+ my ($componentname, $filesref, $dirref) = @_;
+
+ my ($onefile, $component, $onedir, $hostname, $uniquedir);
+ my $found = 0;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ $onefile = ${$filesref}[$i];
+ $component = $onefile->{'componentname'};
+
+ if ( $component eq $componentname )
+ {
+ $found = 1;
+ last;
+ }
+ }
+
+ if (!($found))
+ {
+ # This component can be ignored, if it exists in a version with extension "_pff" (this was renamed in file::get_sequence_for_file() )
+ my $ignore_this_component = 0;
+ my $origcomponentname = $componentname;
+ my $componentname = $componentname . "_pff";
+
+ for ( my $j = 0; $j <= $#{$filesref}; $j++ )
+ {
+ $onefile = ${$filesref}[$j];
+ $component = $onefile->{'componentname'};
+
+ if ( $component eq $componentname )
+ {
+ $ignore_this_component = 1;
+ last;
+ }
+ }
+
+ if ( $ignore_this_component ) { return "IGNORE_COMP"; }
+ else { installer::exiter::exit_program("ERROR: Did not find component \"$origcomponentname\" in file collection", "get_file_component_directory"); }
+ }
+
+ my $localstyles = "";
+
+ if ( $onefile->{'Styles'} ) { $localstyles = $onefile->{'Styles'}; }
+
+ if ( $localstyles =~ /\bFONT\b/ ) # special handling for font files
+ {
+ return $installer::globals::fontsfolder;
+ }
+
+ my $destdir = "";
+
+ if ( $onefile->{'Dir'} ) { $destdir = $onefile->{'Dir'}; }
+
+ if ( $destdir =~ /\bPREDEFINED_OSSHELLNEWDIR\b/ ) # special handling for shellnew files
+ {
+ return $installer::globals::templatefolder;
+ }
+
+ my $destination = $onefile->{'destination'};
+
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
+
+ $destination =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ # This path has to be defined in the directory collection at "HostName"
+
+ if ($destination eq "") # files in the installation root
+ {
+ $uniquedir = "INSTALLLOCATION";
+ }
+ else
+ {
+ $found = 0;
+
+ for ( my $i = 0; $i <= $#{$dirref}; $i++ )
+ {
+ $onedir = ${$dirref}[$i];
+ $hostname = $onedir->{'HostName'};
+
+ if ( $hostname eq $destination )
+ {
+ $found = 1;
+ last;
+ }
+ }
+
+ if (!($found))
+ {
+ installer::exiter::exit_program("ERROR: Did not find destination $destination in directory collection", "get_file_component_directory");
+ }
+
+ $uniquedir = $onedir->{'uniquename'};
+
+ if ( $uniquedir eq $installer::globals::officeinstalldirectory )
+ {
+ $uniquedir = "INSTALLLOCATION";
+ }
+ }
+
+ $onefile->{'uniquedirname'} = $uniquedir; # saving it in the file collection
+
+ return $uniquedir
+}
+
+##############################################################
+# Returning the directory for a registry component.
+# This cannot be a useful value
+##############################################################
+
+sub get_registry_component_directory
+{
+ my $componentdir = "INSTALLLOCATION";
+
+ return $componentdir;
+}
+
+##############################################################
+# Returning the attributes for a file component.
+# Always 8 in this first try?
+##############################################################
+
+sub get_file_component_attributes
+{
+ my ($componentname, $filesref) = @_;
+
+ my $attributes;
+
+ $attributes = 2;
+
+ # special handling for font files
+
+ my $onefile;
+ my $found = 0;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ $onefile = ${$filesref}[$i];
+ my $component = $onefile->{'componentname'};
+
+ if ( $component eq $componentname )
+ {
+ $found = 1;
+ last;
+ }
+ }
+
+ if (!($found))
+ {
+ installer::exiter::exit_program("ERROR: Did not find component in file collection", "get_file_component_attributes");
+ }
+
+ my $localstyles = "";
+
+ if ( $onefile->{'Styles'} ) { $localstyles = $onefile->{'Styles'}; }
+
+ if ( $localstyles =~ /\bFONT\b/ )
+ {
+ $attributes = 16; # font files will not be deinstalled
+ }
+
+ if ( $localstyles =~ /\bASSEMBLY\b/ )
+ {
+ $attributes = 0; # Assembly files cannot run from source
+ }
+
+ if (( $onefile->{'Dir'} =~ /\bPREDEFINED_OSSHELLNEWDIR\b/ ) || ( $onefile->{'needs_user_registry_key'} ))
+ {
+ $attributes = 4; # Files in shellnew dir and in non advertised startmenu entries must have user registry key as KeyPath
+ }
+
+ return $attributes
+}
+
+##############################################################
+# Returning the attributes for a registry component.
+# Always 4, indicating, the keypath is a defined in
+# table registry
+##############################################################
+
+sub get_registry_component_attributes
+{
+ my ($componentname) = @_;
+
+ my $attributes;
+
+ $attributes = 4;
+
+ if ( exists($installer::globals::dontdeletecomponents{$componentname}) ) { $attributes = $attributes + 16; }
+
+ return $attributes
+}
+
+##############################################################
+# Returning the conditions for a component.
+# This is important for language dependent components
+# in multilingual installation sets.
+##############################################################
+
+sub get_file_component_condition
+{
+ my ($componentname, $filesref) = @_;
+
+ my $condition = "";
+
+ if (exists($installer::globals::componentcondition{$componentname}))
+ {
+ $condition = $installer::globals::componentcondition{$componentname};
+ }
+
+ # there can be also tree conditions for multilayer products
+ if (exists($installer::globals::treeconditions{$componentname}))
+ {
+ if ( $condition eq "" )
+ {
+ $condition = $installer::globals::treeconditions{$componentname};
+ }
+ else
+ {
+ $condition = "($condition) And ($installer::globals::treeconditions{$componentname})";
+ }
+ }
+
+ return $condition
+}
+
+##############################################################
+# Returning the conditions for a registry component.
+##############################################################
+
+sub get_component_condition
+{
+ my ($componentname) = @_;
+
+ my $condition;
+
+ $condition = ""; # Always ?
+
+ if (exists($installer::globals::componentcondition{$componentname}))
+ {
+ $condition = $installer::globals::componentcondition{$componentname};
+ }
+
+ return $condition
+}
+
+####################################################################
+# Returning the keypath for a component.
+# This will be the name of the first file/registry, found in the
+# collection $itemsref
+# Attention: This has to be the unique (file)name, not the
+# real filename!
+####################################################################
+
+sub get_component_keypath
+{
+ my ($componentname, $itemsref, $componentidkeypathhashref) = @_;
+
+ my $oneitem;
+ my $found = 0;
+ my $infoline = "";
+
+ for ( my $i = 0; $i <= $#{$itemsref}; $i++ )
+ {
+ $oneitem = ${$itemsref}[$i];
+ my $component = $oneitem->{'componentname'};
+
+ if ( $component eq $componentname )
+ {
+ $found = 1;
+ last;
+ }
+ }
+
+ if (!($found))
+ {
+ installer::exiter::exit_program("ERROR: Did not find component in file/registry collection, function get_component_keypath", "get_component_keypath");
+ }
+
+ my $keypath = $oneitem->{'uniquename'}; # "uniquename", not "Name"
+
+ # Special handling for updates from existing databases, because KeyPath must not change
+ if (( $installer::globals::updatedatabase ) && ( exists($componentidkeypathhashref->{$componentname}) ))
+ {
+ $keypath = $componentidkeypathhashref->{$componentname};
+ # -> check, if this is a valid key path?!
+ if ( $keypath ne $oneitem->{'uniquename'} )
+ {
+ # Warning: This keypath was changed because of info from old database
+ $infoline = "WARNING: The KeyPath for component \"$componentname\" was changed from \"$oneitem->{'uniquename'}\" to \"$keypath\" because of information from update database";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ # Special handling for components in PREDEFINED_OSSHELLNEWDIR. These components
+ # need as KeyPath a RegistryItem in HKCU
+ if ( $oneitem->{'userregkeypath'} ) { $keypath = $oneitem->{'userregkeypath'}; }
+
+ # saving it in the file and registry collection
+ $oneitem->{'keypath'} = $keypath;
+
+ return $keypath
+}
+
+###################################################################
+# Creating the file Componen.idt dynamically
+# Content:
+# Component ComponentId Directory_ Attributes Condition KeyPath
+###################################################################
+
+sub create_component_table
+{
+ my ($filesref, $registryref, $dirref, $allfilecomponentsref, $allregistrycomponents, $basedir, $componentidhashref, $componentidkeypathhashref) = @_;
+
+ my @componenttable = ();
+
+ my ($oneline, $infoline);
+
+ installer::windows::idtglobal::write_idt_header(\@componenttable, "component");
+
+ # collect_layer_conditions();
+
+
+ # File components
+
+ for ( my $i = 0; $i <= $#{$allfilecomponentsref}; $i++ )
+ {
+ my %onecomponent = ();
+
+ $onecomponent{'name'} = ${$allfilecomponentsref}[$i];
+ $onecomponent{'guid'} = get_component_guid($onecomponent{'name'}, $componentidhashref);
+ $onecomponent{'directory'} = get_file_component_directory($onecomponent{'name'}, $filesref, $dirref);
+ if ( $onecomponent{'directory'} eq "IGNORE_COMP" ) { next; }
+ $onecomponent{'attributes'} = get_file_component_attributes($onecomponent{'name'}, $filesref);
+ $onecomponent{'condition'} = get_file_component_condition($onecomponent{'name'}, $filesref);
+ $onecomponent{'keypath'} = get_component_keypath($onecomponent{'name'}, $filesref, $componentidkeypathhashref);
+
+ $oneline = $onecomponent{'name'} . "\t" . $onecomponent{'guid'} . "\t" . $onecomponent{'directory'} . "\t"
+ . $onecomponent{'attributes'} . "\t" . $onecomponent{'condition'} . "\t" . $onecomponent{'keypath'} . "\n";
+
+ push(@componenttable, $oneline);
+ }
+
+ # Registry components
+
+ for ( my $i = 0; $i <= $#{$allregistrycomponents}; $i++ )
+ {
+ my %onecomponent = ();
+
+ $onecomponent{'name'} = ${$allregistrycomponents}[$i];
+ $onecomponent{'guid'} = get_component_guid($onecomponent{'name'}, $componentidhashref);
+ $onecomponent{'directory'} = get_registry_component_directory();
+ $onecomponent{'attributes'} = get_registry_component_attributes($onecomponent{'name'});
+ $onecomponent{'condition'} = get_component_condition($onecomponent{'name'});
+ $onecomponent{'keypath'} = get_component_keypath($onecomponent{'name'}, $registryref, $componentidkeypathhashref);
+
+ $oneline = $onecomponent{'name'} . "\t" . $onecomponent{'guid'} . "\t" . $onecomponent{'directory'} . "\t"
+ . $onecomponent{'attributes'} . "\t" . $onecomponent{'condition'} . "\t" . $onecomponent{'keypath'} . "\n";
+
+ push(@componenttable, $oneline);
+ }
+
+ # Saving the file
+
+ my $componenttablename = $basedir . $installer::globals::separator . "Componen.idt";
+ installer::files::save_file($componenttablename ,\@componenttable);
+ $infoline = "Created idt file: $componenttablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+}
+
+####################################################################################
+# Returning a component for a scp module gid.
+# Pairs are saved in the files collector.
+####################################################################################
+
+sub get_component_name_from_modulegid
+{
+ my ($modulegid, $filesref) = @_;
+
+ my $componentname = "";
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+
+ if ( $onefile->{'modules'} )
+ {
+ my $filemodules = $onefile->{'modules'};
+ my $filemodulesarrayref = installer::converter::convert_stringlist_into_array_without_newline(\$filemodules, ",");
+
+ if (installer::existence::exists_in_array($modulegid, $filemodulesarrayref))
+ {
+ $componentname = $onefile->{'componentname'};
+ last;
+ }
+ }
+ }
+
+ return $componentname;
+}
+
+####################################################################################
+# Updating the file Environm.idt dynamically
+# Content:
+# Environment Name Value Component_
+####################################################################################
+
+sub set_component_in_environment_table
+{
+ my ($basedir, $filesref) = @_;
+
+ my $infoline = "";
+
+ my $environmentfilename = $basedir . $installer::globals::separator . "Environm.idt";
+
+ if ( -f $environmentfilename ) # only do something, if file exists
+ {
+ my $environmentfile = installer::files::read_file($environmentfilename);
+
+ for ( my $i = 3; $i <= $#{$environmentfile}; $i++ ) # starting in line 4 of Environm.idt
+ {
+ if ( ${$environmentfile}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my $modulegid = $4; # in Environment table a scp module gid can be used as component replacement
+
+ my $componentname = get_component_name_from_modulegid($modulegid, $filesref);
+
+ if ( $componentname ) # only do something if a component could be found
+ {
+ $infoline = "Updated Environment table:\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Old line: ${$environmentfile}[$i]\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ ${$environmentfile}[$i] =~ s/$modulegid/$componentname/;
+
+ $infoline = "New line: ${$environmentfile}[$i]\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ }
+ }
+ }
+
+ # Saving the file
+
+ installer::files::save_file($environmentfilename ,$environmentfile);
+ $infoline = "Updated idt file: $environmentfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ }
+}
+
+1; \ No newline at end of file
diff --git a/solenv/bin/modules/installer/windows/createfolder.pm b/solenv/bin/modules/installer/windows/createfolder.pm
new file mode 100644
index 000000000000..7ade8866c6c5
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/createfolder.pm
@@ -0,0 +1,153 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::createfolder;
+
+use installer::existence;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::windows::idtglobal;
+
+##############################################################
+# Returning directory for createfolder table.
+##############################################################
+
+sub get_createfolder_directory
+{
+ my ($onedir) = @_;
+
+ my $uniquename = $onedir->{'uniquename'};
+
+ return $uniquename;
+}
+
+##############################################################
+# Searching the correct file for language pack directories.
+##############################################################
+
+sub get_languagepack_file
+{
+ my ($filesref, $onedir) = @_;
+
+ my $language = $onedir->{'specificlanguage'};
+ my $foundfile = 0;
+ my $onefile = "";
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ $onefile = ${$filesref}[$i];
+
+ if ( $onefile->{'specificlanguage'} eq $onedir->{'specificlanguage'} )
+ {
+ $foundfile = 1;
+ last;
+ }
+ }
+
+ if ( ! $foundfile ) { installer::exiter::exit_program("ERROR: No file with correct language found (language pack build)!", "get_languagepack_file"); }
+
+ return $onefile;
+}
+
+##############################################################
+# Returning component for createfolder table.
+##############################################################
+
+sub get_createfolder_component
+{
+ my ($onedir, $filesref, $allvariableshashref) = @_;
+
+ # Directories do not belong to a module.
+ # Therefore they can only belong to the root module and
+ # will be added to a component at the root module.
+ # All directories will be added to the component
+ # containing the file $allvariableshashref->{'GLOBALFILEGID'}
+
+ if ( ! $allvariableshashref->{'GLOBALFILEGID'} ) { installer::exiter::exit_program("ERROR: GLOBALFILEGID must be defined in list file!", "get_createfolder_component"); }
+ if (( $installer::globals::patch ) && ( ! $allvariableshashref->{'GLOBALFILEGID'} )) { installer::exiter::exit_program("ERROR: GLOBALPATCHFILEGID must be defined in list file!", "get_createfolder_component"); }
+
+ my $globalfilegid = $allvariableshashref->{'GLOBALFILEGID'};
+ if ( $installer::globals::patch ) { $globalfilegid = $allvariableshashref->{'GLOBALPATCHFILEGID'}; }
+
+ my $onefile = "";
+ if ( $installer::globals::languagepack ) { $onefile = get_languagepack_file($filesref, $onedir); }
+ else { $onefile = installer::existence::get_specified_file($filesref, $globalfilegid); }
+
+ return $onefile->{'componentname'};
+}
+
+####################################################################################
+# Creating the file CreateFo.idt dynamically for creation of empty directories
+# Content:
+# Directory_ Component_
+####################################################################################
+
+sub create_createfolder_table
+{
+ my ($dirref, $filesref, $basedir, $allvariableshashref) = @_;
+
+ my @createfoldertable = ();
+
+ my $infoline;
+
+ installer::windows::idtglobal::write_idt_header(\@createfoldertable, "createfolder");
+
+ for ( my $i = 0; $i <= $#{$dirref}; $i++ )
+ {
+ my $onedir = ${$dirref}[$i];
+
+ # language packs get only language dependent directories
+ if (( $installer::globals::languagepack ) && ( $onedir->{'specificlanguage'} eq "" )) { next };
+
+ my $styles = "";
+
+ if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; }
+
+ if ( $styles =~ /\bCREATE\b/ )
+ {
+ my %directory = ();
+
+ $directory{'Directory_'} = get_createfolder_directory($onedir);
+ $directory{'Component_'} = get_createfolder_component($onedir, $filesref, $allvariableshashref);
+
+ my $oneline = $directory{'Directory_'} . "\t" . $directory{'Component_'} . "\n";
+
+ push(@createfoldertable, $oneline);
+ }
+ }
+
+ # Saving the file
+
+ my $createfoldertablename = $basedir . $installer::globals::separator . "CreateFo.idt";
+ installer::files::save_file($createfoldertablename ,\@createfoldertable);
+ $infoline = "Created idt file: $createfoldertablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+1; \ No newline at end of file
diff --git a/solenv/bin/modules/installer/windows/directory.pm b/solenv/bin/modules/installer/windows/directory.pm
new file mode 100644
index 000000000000..ba6f9a3b75bd
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/directory.pm
@@ -0,0 +1,456 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::directory;
+
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::pathanalyzer;
+use installer::windows::idtglobal;
+
+##############################################################
+# Collecting all directory trees in global hash
+##############################################################
+
+sub collectdirectorytrees
+{
+ my ( $directoryref ) = @_;
+
+ for ( my $i = 0; $i <= $#{$directoryref}; $i++ )
+ {
+ my $onedir = ${$directoryref}[$i];
+ my $styles = "";
+ if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; }
+
+ if ( $styles ne "" )
+ {
+ foreach my $treestyle ( keys %installer::globals::treestyles )
+ {
+ if ( $styles =~ /\b$treestyle\b/ )
+ {
+ my $hostname = $onedir->{'HostName'};
+ # -> hostname is the key, the style the value!
+ $installer::globals::hostnametreestyles{$hostname} = $treestyle;
+ }
+ }
+ }
+ }
+}
+
+##############################################################
+# Overwriting global programfilesfolder, if required
+##############################################################
+
+sub overwrite_programfilesfolder
+{
+ my ( $allvariables ) = @_;
+
+ if ( $allvariables->{'PROGRAMFILESFOLDERNAME'} )
+ {
+ $installer::globals::programfilesfolder = $allvariables->{'PROGRAMFILESFOLDERNAME'};
+ }
+}
+
+##############################################################
+# Adding unique directory names to the directory collection
+##############################################################
+
+sub create_unique_directorynames
+{
+ my ($directoryref) = @_;
+
+ $installer::globals::officeinstalldirectoryset = 0;
+
+ for ( my $i = 0; $i <= $#{$directoryref}; $i++ )
+ {
+ my $onedir = ${$directoryref}[$i];
+ my $uniquename = $onedir->{'HostName'};
+ my $styles = "";
+ if ( $onedir->{'Styles'} ) { $styles = $onedir->{'Styles'}; }
+ # get_path_from_fullqualifiedname(\$uniqueparentname);
+ # making /registry/schema/org/openoffice/VCL.xcs to VCL.xcs
+
+ $uniquename =~ s/^\s*//g; # removing beginning white spaces
+ $uniquename =~ s/\s*$//g; # removing ending white spaces
+ $uniquename =~ s/\s//g; # removing white spaces
+ $uniquename =~ s/\_//g; # removing existing underlines
+ $uniquename =~ s/\.//g; # removing dots in directoryname
+ $uniquename =~ s/\Q$installer::globals::separator\E/\_/g; # replacing slash and backslash with underline
+
+ my $uniqueparentname = $uniquename;
+
+ if ( $uniqueparentname =~ /^\s*(.*)\_(.*?)\s*$/ ) # the underline is now the separator
+ {
+ $uniqueparentname = $1;
+ }
+ else
+ {
+ $uniqueparentname = $installer::globals::programfilesfolder;
+ }
+
+ if ( $styles =~ /\bPROGRAMFILESFOLDER\b/ ) { $uniqueparentname = $installer::globals::programfilesfolder; }
+ if ( $styles =~ /\bCOMMONFILESFOLDER\b/ ) { $uniqueparentname = $installer::globals::commonfilesfolder; }
+ if ( $styles =~ /\bCOMMONAPPDATAFOLDER\b/ ) { $uniqueparentname = $installer::globals::commonappdatafolder; }
+ if ( $styles =~ /\bLOCALAPPDATAFOLDER\b/ ) { $uniqueparentname = $installer::globals::localappdatafolder; }
+
+ if ( $styles =~ /\bSHAREPOINTPATH\b/ )
+ {
+ $uniqueparentname = "SHAREPOINTPATH";
+ $installer::globals::usesharepointpath = 1;
+ }
+
+ $uniquename =~ s/\-/\_/g; # making "-" to "_"
+ $uniqueparentname =~ s/\-/\_/g; # making "-" to "_"
+
+ $onedir->{'uniquename'} = $uniquename;
+ $onedir->{'uniqueparentname'} = $uniqueparentname;
+
+ # setting the installlocation directory
+ if ( $styles =~ /\bISINSTALLLOCATION\b/ )
+ {
+ if ( $installer::globals::installlocationdirectoryset ) { installer::exiter::exit_program("ERROR: Directory with flag ISINSTALLLOCATION alread set: \"$installer::globals::installlocationdirectory\".", "create_unique_directorynames"); }
+ $installer::globals::installlocationdirectory = $uniquename;
+ $installer::globals::installlocationdirectoryset = 1;
+ if ( $installer::globals::installlocationdirectory =~ /oracle_/i ) { $installer::globals::sundirexists = 1; }
+ }
+
+ # setting the sundirectory
+ if ( $styles =~ /\bSUNDIRECTORY\b/ )
+ {
+ if ( $installer::globals::vendordirectoryset ) { installer::exiter::exit_program("ERROR: Directory with flag SUNDIRECTORY alread set: \"$installer::globals::vendordirectory\".", "create_unique_directorynames"); }
+ $installer::globals::vendordirectory = $uniquename;
+ $installer::globals::vendordirectoryset = 1;
+ }
+ }
+}
+
+#####################################################
+# Adding ":." to selected default directory names
+#####################################################
+
+sub check_sourcedir_addon
+{
+ my ( $onedir, $allvariableshashref ) = @_;
+
+ if (($installer::globals::addchildprojects) ||
+ ($installer::globals::patch) ||
+ ($installer::globals::languagepack) ||
+ ($allvariableshashref->{'CHANGETARGETDIR'}))
+ {
+ my $sourcediraddon = "\:\.";
+ $onedir->{'defaultdir'} = $onedir->{'defaultdir'} . $sourcediraddon;
+ }
+
+}
+
+#####################################################
+# The directory with the style ISINSTALLLOCATION
+# will be replaced by INSTALLLOCATION
+#####################################################
+
+sub set_installlocation_directory
+{
+ my ( $directoryref, $allvariableshashref ) = @_;
+
+ if ( ! $installer::globals::installlocationdirectoryset ) { installer::exiter::exit_program("ERROR: Directory with flag ISINSTALLLOCATION not set!", "set_installlocation_directory"); }
+
+ for ( my $i = 0; $i <= $#{$directoryref}; $i++ )
+ {
+ my $onedir = ${$directoryref}[$i];
+
+ if ( $onedir->{'uniquename'} eq $installer::globals::installlocationdirectory )
+ {
+ $onedir->{'uniquename'} = "INSTALLLOCATION";
+ check_sourcedir_addon($onedir, $allvariableshashref);
+ }
+
+ if ( $onedir->{'uniquename'} eq $installer::globals::vendordirectory )
+ {
+ check_sourcedir_addon($onedir, $allvariableshashref);
+ }
+
+ if ( $onedir->{'uniqueparentname'} eq $installer::globals::installlocationdirectory )
+ {
+ $onedir->{'uniqueparentname'} = "INSTALLLOCATION";
+ }
+ }
+}
+
+#####################################################
+# Getting the name of the top level directory. This
+# can have only one letter
+#####################################################
+
+sub get_last_directory_name
+{
+ my ($completepathref) = @_;
+
+ if ( $$completepathref =~ /^.*[\/\\](.+?)\s*$/ )
+ {
+ $$completepathref = $1;
+ }
+}
+
+#####################################################
+# Creating the defaultdir for the file Director.idt
+#####################################################
+
+sub create_defaultdir_directorynames
+{
+ my ($directoryref, $shortdirnamehashref) = @_;
+
+ my @shortnames = ();
+ if ( $installer::globals::updatedatabase ) { @shortnames = values(%{$shortdirnamehashref}); }
+ elsif ( $installer::globals::prepare_winpatch ) { @shortnames = values(%installer::globals::saved83dirmapping); }
+
+ for ( my $i = 0; $i <= $#{$directoryref}; $i++ )
+ {
+ my $onedir = ${$directoryref}[$i];
+ my $hostname = $onedir->{'HostName'};
+
+ $hostname =~ s/\Q$installer::globals::separator\E\s*$//;
+ get_last_directory_name(\$hostname);
+ # installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$hostname); # making program/classes to classes
+ my $uniquename = $onedir->{'uniquename'};
+ my $shortstring;
+ if (( $installer::globals::updatedatabase ) && ( exists($shortdirnamehashref->{$uniquename}) ))
+ {
+ $shortstring = $shortdirnamehashref->{$uniquename};
+ }
+ elsif (( $installer::globals::prepare_winpatch ) && ( exists($installer::globals::saved83dirmapping{$uniquename}) ))
+ {
+ $shortstring = $installer::globals::saved83dirmapping{$uniquename};
+ }
+ else
+ {
+ $shortstring = installer::windows::idtglobal::make_eight_three_conform($hostname, "dir", \@shortnames);
+ }
+
+ my $defaultdir;
+
+ if ( $shortstring eq $hostname )
+ {
+ $defaultdir = $hostname;
+ }
+ else
+ {
+ $defaultdir = $shortstring . "|" . $hostname;
+ }
+
+ $onedir->{'defaultdir'} = $defaultdir;
+
+ my $fontdir = "";
+ if ( $onedir->{'Dir'} ) { $fontdir = $onedir->{'Dir'}; }
+
+ my $fontdefaultdir = "";
+ if ( $onedir->{'defaultdir'} ) { $fontdefaultdir = $onedir->{'defaultdir'}; }
+
+ if (( $fontdir eq "PREDEFINED_OSSYSTEMFONTDIR" ) && ( $fontdefaultdir eq $installer::globals::fontsdirhostname ))
+ {
+ $installer::globals::fontsdirname = $onedir->{'defaultdir'};
+ $installer::globals::fontsdirparent = $onedir->{'uniqueparentname'};
+ }
+ }
+}
+
+###############################################
+# Fill content into the directory table
+###############################################
+
+sub create_directorytable_from_collection
+{
+ my ($directorytableref, $directoryref) = @_;
+
+ for ( my $i = 0; $i <= $#{$directoryref}; $i++ )
+ {
+ my $onedir = ${$directoryref}[$i];
+ my $hostname = $onedir->{'HostName'};
+ my $dir = "";
+
+ if ( $onedir->{'Dir'} ) { $dir = $onedir->{'Dir'}; }
+
+ if (( $dir eq "PREDEFINED_PROGDIR" ) && ( $hostname eq "" )) { next; } # removing files from root directory
+
+ my $oneline = $onedir->{'uniquename'} . "\t" . $onedir->{'uniqueparentname'} . "\t" . $onedir->{'defaultdir'} . "\n";
+
+ push(@{$directorytableref}, $oneline);
+ }
+}
+
+###############################################
+# Defining the root installation structure
+###############################################
+
+sub add_root_directories
+{
+ my ($directorytableref, $allvariableshashref) = @_;
+
+# my $sourcediraddon = "";
+# if (($installer::globals::addchildprojects) ||
+# ($installer::globals::patch) ||
+# ($installer::globals::languagepack) ||
+# ($allvariableshashref->{'CHANGETARGETDIR'}))
+# {
+# $sourcediraddon = "\:\.";
+# }
+
+ my $oneline = "";
+
+ if (( ! $installer::globals::patch ) && ( ! $installer::globals::languagepack ) && ( ! $allvariableshashref->{'DONTUSESTARTMENUFOLDER'} ))
+ {
+ my $productname = $allvariableshashref->{'PRODUCTNAME'};
+ my $productversion = $allvariableshashref->{'PRODUCTVERSION'};
+ my $baseproductversion = $productversion;
+
+ if (( $installer::globals::prepare_winpatch ) && ( $allvariableshashref->{'BASEPRODUCTVERSION'} ))
+ {
+ $baseproductversion = $allvariableshashref->{'BASEPRODUCTVERSION'}; # for example "2.0" for OOo
+ }
+
+ my $realproductkey = $productname . " " . $productversion;
+ my $productkey = $productname . " " . $baseproductversion;
+
+ if (( $allvariableshashref->{'POSTVERSIONEXTENSION'} ) && ( ! $allvariableshashref->{'DONTUSEEXTENSIONINDEFAULTDIR'} ))
+ {
+ $productkey = $productkey . " " . $allvariableshashref->{'POSTVERSIONEXTENSION'};
+ $realproductkey = $realproductkey . " " . $allvariableshashref->{'POSTVERSIONEXTENSION'};
+ }
+ if ( $allvariableshashref->{'NOVERSIONINDIRNAME'} )
+ {
+ $productkey = $productname;
+ $realproductkey = $realproductname;
+ }
+ if ( $allvariableshashref->{'NOSPACEINDIRECTORYNAME'} )
+ {
+ $productkey =~ s/\ /\_/g;
+ $realproductkey =~ s/\ /\_/g;
+ }
+
+ my $shortproductkey = installer::windows::idtglobal::make_eight_three_conform($productkey, "dir"); # third parameter not used
+ $shortproductkey =~ s/\s/\_/g; # changing empty space to underline
+
+ $oneline = "$installer::globals::officemenufolder\t$installer::globals::programmenufolder\t$shortproductkey|$realproductkey\n";
+ push(@{$directorytableref}, $oneline);
+ }
+
+ $oneline = "TARGETDIR\t\tSourceDir\n";
+ push(@{$directorytableref}, $oneline);
+
+ $oneline = "$installer::globals::programfilesfolder\tTARGETDIR\t.\n";
+ push(@{$directorytableref}, $oneline);
+
+ $oneline = "$installer::globals::programmenufolder\tTARGETDIR\t.\n";
+ push(@{$directorytableref}, $oneline);
+
+ $oneline = "$installer::globals::startupfolder\tTARGETDIR\t.\n";
+ push(@{$directorytableref}, $oneline);
+
+ $oneline = "$installer::globals::desktopfolder\tTARGETDIR\t.\n";
+ push(@{$directorytableref}, $oneline);
+
+ $oneline = "$installer::globals::startmenufolder\tTARGETDIR\t.\n";
+ push(@{$directorytableref}, $oneline);
+
+ $oneline = "$installer::globals::commonfilesfolder\tTARGETDIR\t.\n";
+ push(@{$directorytableref}, $oneline);
+
+ $oneline = "$installer::globals::commonappdatafolder\tTARGETDIR\t.\n";
+ push(@{$directorytableref}, $oneline);
+
+ $oneline = "$installer::globals::localappdatafolder\tTARGETDIR\t.\n";
+ push(@{$directorytableref}, $oneline);
+
+ if ( $installer::globals::usesharepointpath )
+ {
+ $oneline = "SHAREPOINTPATH\tTARGETDIR\t.\n";
+ push(@{$directorytableref}, $oneline);
+ }
+
+ $oneline = "$installer::globals::systemfolder\tTARGETDIR\t.\n";
+ push(@{$directorytableref}, $oneline);
+
+ my $localtemplatefoldername = $installer::globals::templatefoldername;
+ my $directorytableentry = $localtemplatefoldername;
+ my $shorttemplatefoldername = installer::windows::idtglobal::make_eight_three_conform($localtemplatefoldername, "dir");
+ if ( $shorttemplatefoldername ne $localtemplatefoldername ) { $directorytableentry = "$shorttemplatefoldername|$localtemplatefoldername"; }
+ $oneline = "$installer::globals::templatefolder\tTARGETDIR\t$directorytableentry\n";
+ push(@{$directorytableref}, $oneline);
+
+ if ( $installer::globals::fontsdirname )
+ {
+ $oneline = "$installer::globals::fontsfolder\t$installer::globals::fontsdirparent\t$installer::globals::fontsfoldername\:$installer::globals::fontsdirname\n";
+ }
+ else
+ {
+ $oneline = "$installer::globals::fontsfolder\tTARGETDIR\t$installer::globals::fontsfoldername\n";
+ }
+
+ push(@{$directorytableref}, $oneline);
+
+}
+
+###############################################
+# Creating the file Director.idt dynamically
+###############################################
+
+sub create_directory_table
+{
+ my ($directoryref, $basedir, $allvariableshashref, $shortdirnamehashref, $loggingdir) = @_;
+
+ # Structure of the directory table:
+ # Directory Directory_Parent DefaultDir
+ # Directory is a unique identifier
+ # Directory_Parent is the unique identifier of the parent
+ # DefaultDir is .:APPLIC~1|Application Data with
+ # Before ":" : [sourcedir]:[destdir] (not programmed yet)
+ # After ":" : 8+3 and not 8+3 the destination directory name
+
+ my @directorytable = ();
+ my $infoline;
+
+ overwrite_programfilesfolder($allvariableshashref);
+ create_unique_directorynames($directoryref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_1.log", $directoryref); }
+ create_defaultdir_directorynames($directoryref, $shortdirnamehashref); # only destdir!
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_2.log", $directoryref); }
+ set_installlocation_directory($directoryref, $allvariableshashref);
+ if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_3.log", $directoryref); }
+ installer::windows::idtglobal::write_idt_header(\@directorytable, "directory");
+ add_root_directories(\@directorytable, $allvariableshashref);
+ create_directorytable_from_collection(\@directorytable, $directoryref);
+
+ # Saving the file
+
+ my $directorytablename = $basedir . $installer::globals::separator . "Director.idt";
+ installer::files::save_file($directorytablename ,\@directorytable);
+ $infoline = "Created idt file: $directorytablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/feature.pm b/solenv/bin/modules/installer/windows/feature.pm
new file mode 100644
index 000000000000..39521baecdfe
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/feature.pm
@@ -0,0 +1,445 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::feature;
+
+use installer::existence;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::sorter;
+use installer::worker;
+use installer::windows::idtglobal;
+use installer::windows::language;
+
+##############################################################
+# Returning the gid for a feature.
+# Attention: Maximum length
+##############################################################
+
+sub get_feature_gid
+{
+ my ($onefeature) = @_;
+
+ my $gid = "";
+
+ if ( $onefeature->{'gid'} ) { $gid = $onefeature->{'gid'}; }
+
+ # Attention: Maximum feature length is 38!
+ installer::windows::idtglobal::shorten_feature_gid(\$gid);
+
+ return $gid
+}
+
+##############################################################
+# Returning the gid of the parent.
+# Attention: Maximum length
+##############################################################
+
+sub get_feature_parent
+{
+ my ($onefeature) = @_;
+
+ my $parentgid = "";
+
+ if ( $onefeature->{'ParentID'} ) { $parentgid = $onefeature->{'ParentID'}; }
+
+ # The modules, hanging directly below the root, have to be root modules.
+ # Only then it is possible to make the "real" root module invisible by
+ # setting the display to "0".
+
+ if ( $parentgid eq $installer::globals::rootmodulegid ) { $parentgid = ""; }
+
+ # Attention: Maximum feature length is 38!
+ installer::windows::idtglobal::shorten_feature_gid(\$parentgid);
+
+ return $parentgid
+}
+
+##############################################################
+# Returning the display for a feature.
+# 0: Feature is not shown
+# odd: subfeatures are shown
+# even: subfeatures are not shown
+##############################################################
+
+sub get_feature_display
+{
+ my ($onefeature) = @_;
+
+ my $display;
+ my $parentid = "";
+
+ if ( $onefeature->{'ParentID'} ) { $parentid = $onefeature->{'ParentID'}; }
+
+ if ( $parentid eq "" )
+ {
+ $display = "0"; # root module is not visible
+ }
+ elsif ( $onefeature->{'gid'} eq "gid_Module_Prg") # program module shows subfeatures
+ {
+ $display = "1"; # root module shows subfeatures
+ }
+ else
+ {
+ $display = "2"; # all other modules do not show subfeatures
+ }
+
+ # special case: Feature has flag "HIDDEN_ROOT" -> $display is 0
+ my $styles = "";
+ if ( $onefeature->{'Styles'} ) { $styles = $onefeature->{'Styles'}; }
+ if ( $styles =~ /\bHIDDEN_ROOT\b/ ) { $display = "0"; }
+
+ # Special handling for language modules. Only visible in multilingual installation set
+ if (( $styles =~ /\bSHOW_MULTILINGUAL_ONLY\b/ ) && ( ! $installer::globals::ismultilingual )) { $display = "0"; }
+
+ # Special handling for c05office. No program module visible.
+ if (( $onefeature->{'gid'} eq "gid_Module_Prg" ) && ( $installer::globals::product =~ /c05office/i )) { $display = "0"; }
+
+ # making all feature invisible in Language packs!
+ if ( $installer::globals::languagepack ) { $display = "0"; }
+
+ return $display
+}
+
+##############################################################
+# Returning the level for a feature.
+##############################################################
+
+sub get_feature_level
+{
+ my ($onefeature) = @_;
+
+ my $level = "20"; # the default
+
+ my $localdefault = "";
+
+ if ( $onefeature->{'Default'} ) { $localdefault = $onefeature->{'Default'}; }
+
+ if ( $localdefault eq "NO" ) # explicitely set Default = "NO"
+ {
+ $level = "200"; # deselected in default installation, base is 100
+ if ( $installer::globals::patch ) { $level = "20"; }
+ }
+
+ # special handling for Java and Ada
+ if ( $onefeature->{'Name'} )
+ {
+ if ( $onefeature->{'Name'} =~ /java/i ) { $level = $level + 40; }
+ }
+
+ # if FeatureLevel is defined in scp, this will be used
+
+ if ( $onefeature->{'FeatureLevel'} ) { $level = $onefeature->{'FeatureLevel'}; }
+
+ return $level
+}
+
+##############################################################
+# Returning the directory for a feature.
+##############################################################
+
+sub get_feature_directory
+{
+ my ($onefeature) = @_;
+
+ my $directory;
+
+ $directory = "INSTALLLOCATION";
+
+ return $directory
+}
+
+##############################################################
+# Returning the directory for a feature.
+##############################################################
+
+sub get_feature_attributes
+{
+ my ($onefeature) = @_;
+
+ my $attributes;
+
+ # No advertising of features and no leaving on network.
+ # Feature without parent must not have the "2"
+
+ my $parentgid = "";
+ if ( $onefeature->{'ParentID'} ) { $parentgid = $onefeature->{'ParentID'}; }
+
+ if (( $parentgid eq "" ) || ( $parentgid eq $installer::globals::rootmodulegid )) { $attributes = "8"; }
+ else { $attributes = "10"; }
+
+ return $attributes
+}
+
+#################################################################################
+# Replacing one variable in one files
+#################################################################################
+
+sub replace_one_variable
+{
+ my ($translationfile, $variable, $searchstring) = @_;
+
+ for ( my $i = 0; $i <= $#{$translationfile}; $i++ )
+ {
+ ${$translationfile}[$i] =~ s/\%$searchstring/$variable/g;
+ }
+}
+
+#################################################################################
+# Replacing the variables in the feature names and descriptions
+#################################################################################
+
+sub replace_variables
+{
+ my ($translationfile, $variableshashref) = @_;
+
+ foreach $key (keys %{$variableshashref})
+ {
+ my $value = $variableshashref->{$key};
+ replace_one_variable($translationfile, $value, $key);
+ }
+}
+
+#################################################################################
+# Collecting the feature recursively.
+#################################################################################
+
+sub collect_modules_recursive
+{
+ my ($modulesref, $parentid, $feature, $directaccess, $directgid, $directparent, $directsortkey, $sorted) = @_;
+
+ my @allchildren = ();
+ my $childrenexist = 0;
+
+ # Collecting children from Module $parentid
+
+ my $modulegid;
+ foreach $modulegid ( keys %{$directparent})
+ {
+ if ( $directparent->{$modulegid} eq $parentid )
+ {
+ my %childhash = ( "gid" => "$modulegid", "Sortkey" => "$directsortkey->{$modulegid}");
+ push(@allchildren, \%childhash);
+ $childrenexist = 1;
+ }
+ }
+
+ # Sorting children
+
+ if ( $childrenexist )
+ {
+ # Sort children
+ installer::sorter::sort_array_of_hashes_numerically(\@allchildren, "Sortkey");
+
+ # Adding children to new array
+ my $childhashref;
+ foreach $childhashref ( @allchildren )
+ {
+ my $gid = $childhashref->{'gid'};
+
+ # Saving all lines, that have this 'gid'
+
+ my $unique;
+ foreach $unique ( keys %{$directgid} )
+ {
+ if ( $directgid->{$unique} eq $gid )
+ {
+ push(@{$feature}, ${$modulesref}[$directaccess->{$unique}]);
+ if ( $sorted->{$unique} == 1 ) { installer::exiter::exit_program("ERROR: Sorting feature failed! \"$unique\" already sorted.", "sort_feature"); }
+ $sorted->{$unique} = 1;
+ }
+ }
+
+ collect_modules_recursive($modulesref, $gid, $feature, $directaccess, $directgid, $directparent, $directsortkey, $sorted);
+ }
+ }
+}
+
+#################################################################################
+# Sorting the feature in specified order. Evaluated is the key "Sortkey", that
+# is set in scp2 projects.
+# The display order of modules in Windows Installer is dependent from the order
+# in the idt file. Therefore the order of the modules array has to be adapted
+# to the Sortkey order, before the idt file is created.
+#################################################################################
+
+sub sort_feature
+{
+ my ($modulesref) = @_;
+
+ my @feature = ();
+
+ my %directaccess = ();
+ my %directparent = ();
+ my %directgid = ();
+ my %directsortkey = ();
+ my %sorted = ();
+
+ for ( my $i = 0; $i <= $#{$modulesref}; $i++ )
+ {
+ my $onefeature = ${$modulesref}[$i];
+
+ my $uniquekey = $onefeature->{'uniquekey'};
+ my $modulegid = $onefeature->{'gid'};
+
+ $directaccess{$uniquekey} = $i;
+
+ $directgid{$uniquekey} = $onefeature->{'gid'};
+
+ # ParentID and Sortkey are not saved for the 'uniquekey', but only for the 'gid'
+
+ if ( $onefeature->{'ParentID'} ) { $directparent{$modulegid} = $onefeature->{'ParentID'}; }
+ else { $directparent{$modulegid} = ""; }
+
+ if ( $onefeature->{'Sortkey'} ) { $directsortkey{$modulegid} = $onefeature->{'Sortkey'}; }
+ else { $directsortkey{$modulegid} = "9999"; }
+
+ # Bookkeeping:
+ $sorted{$uniquekey} = 0;
+ }
+
+ # Searching all feature recursively, beginning with ParentID = ""
+ my $parentid = "";
+ collect_modules_recursive($modulesref, $parentid, \@feature, \%directaccess, \%directgid, \%directparent, \%directsortkey, \%sorted);
+
+ # Bookkeeping
+ my $modulekey;
+ foreach $modulekey ( keys %sorted )
+ {
+ if ( $sorted{$modulekey} == 0 )
+ {
+ my $infoline = "Warning: Module \"$modulekey\" could not be sorted. Added to the end of the module array.\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ push(@feature, ${$modulesref}[$directaccess{$modulekey}]);
+ }
+ }
+
+ return \@feature;
+}
+
+#################################################################################
+# Adding a unique key to the modules array. The gid is not unique for
+# multilingual modules. Only the combination from gid and specific language
+# is unique. Uniqueness is required for sorting mechanism.
+#################################################################################
+
+sub add_uniquekey
+{
+ my ( $modulesref ) = @_;
+
+ for ( my $i = 0; $i <= $#{$modulesref}; $i++ )
+ {
+ my $uniquekey = ${$modulesref}[$i]->{'gid'};
+ if ( ${$modulesref}[$i]->{'specificlanguage'} ) { $uniquekey = $uniquekey . "_" . ${$modulesref}[$i]->{'specificlanguage'}; }
+ ${$modulesref}[$i]->{'uniquekey'} = $uniquekey;
+ }
+}
+
+#################################################################################
+# Creating the file Feature.idt dynamically
+# Content:
+# Feature Feature_Parent Title Description Display Level Directory_ Attributes
+#################################################################################
+
+sub create_feature_table
+{
+ my ($modulesref, $basedir, $languagesarrayref, $allvariableshashref) = @_;
+
+ for ( my $m = 0; $m <= $#{$languagesarrayref}; $m++ )
+ {
+ my $onelanguage = ${$languagesarrayref}[$m];
+
+ my $infoline;
+
+ my @featuretable = ();
+
+ installer::windows::idtglobal::write_idt_header(\@featuretable, "feature");
+
+ for ( my $i = 0; $i <= $#{$modulesref}; $i++ )
+ {
+ my $onefeature = ${$modulesref}[$i];
+
+ # Java and Ada only, if the correct settings are set
+ my $styles = "";
+ if ( $onefeature->{'Styles'} ) { $styles = $onefeature->{'Styles'}; }
+ if (( $styles =~ /\bJAVAMODULE\b/ ) && ( ! ($allvariableshashref->{'JAVAPRODUCT'} ))) { next; }
+ if (( $styles =~ /\bADAMODULE\b/ ) && ( ! ($allvariableshashref->{'ADAPRODUCT'} ))) { next; }
+
+ # Controlling the language!
+ # Only language independent feature or feature with the correct language will be included into the table
+
+ if (! (!(( $onefeature->{'ismultilingual'} )) || ( $onefeature->{'specificlanguage'} eq $onelanguage )) ) { next; }
+
+ my %feature = ();
+
+ $feature{'feature'} = get_feature_gid($onefeature);
+ $feature{'feature_parent'} = get_feature_parent($onefeature);
+ # if ( $onefeature->{'ParentID'} eq "" ) { $feature{'feature_parent'} = ""; } # Root has no parent
+ $feature{'Title'} = $onefeature->{'Name'};
+ $feature{'Description'} = $onefeature->{'Description'};
+ $feature{'Display'} = get_feature_display($onefeature);
+ $feature{'Level'} = get_feature_level($onefeature);
+ $feature{'Directory_'} = get_feature_directory($onefeature);
+ $feature{'Attributes'} = get_feature_attributes($onefeature);
+
+ my $oneline = $feature{'feature'} . "\t" . $feature{'feature_parent'} . "\t" . $feature{'Title'} . "\t"
+ . $feature{'Description'} . "\t" . $feature{'Display'} . "\t" . $feature{'Level'} . "\t"
+ . $feature{'Directory_'} . "\t" . $feature{'Attributes'} . "\n";
+
+ push(@featuretable, $oneline);
+
+ # collecting all feature in global feature collector (so that properties can be set in property table)
+ if ( ! installer::existence::exists_in_array($feature{'feature'}, \@installer::globals::featurecollector) )
+ {
+ push(@installer::globals::featurecollector, $feature{'feature'});
+ }
+
+ # collecting all language feature in feature collector for check of language selection
+ if (( $styles =~ /\bSHOW_MULTILINGUAL_ONLY\b/ ) && ( $onefeature->{'ParentID'} ne $installer::globals::rootmodulegid ))
+ {
+ $installer::globals::multilingual_only_modules{$feature{'feature'}} = 1;
+ }
+
+ # collecting all application feature in global feature collector for check of application selection
+ if ( $styles =~ /\bAPPLICATIONMODULE\b/ )
+ {
+ $installer::globals::application_modules{$feature{'feature'}} = 1;
+ }
+ }
+
+ # Saving the file
+
+ my $featuretablename = $basedir . $installer::globals::separator . "Feature.idt" . "." . $onelanguage;
+ installer::files::save_file($featuretablename ,\@featuretable);
+ $infoline = "Created idt file: $featuretablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/featurecomponent.pm b/solenv/bin/modules/installer/windows/featurecomponent.pm
new file mode 100644
index 000000000000..c5053212aad3
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/featurecomponent.pm
@@ -0,0 +1,244 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::featurecomponent;
+
+use installer::converter;
+use installer::existence;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::windows::idtglobal;
+
+#################################################################################
+# Collecting all pairs of features and components from the files collector
+#################################################################################
+
+sub create_featurecomponent_table_from_files_collector
+{
+ my ($featurecomponenttableref, $filesref) = @_;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+
+ my $filecomponent = $onefile->{'componentname'};
+ my $filemodules = $onefile->{'modules'};
+
+ if ( $filecomponent eq "" )
+ {
+ installer::exiter::exit_program("ERROR: No component defined for file $onefile->{'Name'}", "create_featurecomponent_table_from_files_collector");
+ }
+ if ( $filemodules eq "" )
+ {
+ installer::exiter::exit_program("ERROR: No modules found for file $onefile->{'Name'}", "create_featurecomponent_table_from_files_collector");
+ }
+
+ my $filemodulesarrayref = installer::converter::convert_stringlist_into_array(\$filemodules, ",");
+
+ for ( my $j = 0; $j <= $#{$filemodulesarrayref}; $j++ )
+ {
+ my %featurecomponent = ();
+
+ my $onemodule = ${$filemodulesarrayref}[$j];
+ $onemodule =~ s/\s*$//;
+ $featurecomponent{'Feature'} = $onemodule;
+ $featurecomponent{'Component'} = $filecomponent;
+
+ # Attention: Features are renamed, because the maximum length is 38.
+ # But in the files collector ($filesref), the original names are saved.
+
+ installer::windows::idtglobal::shorten_feature_gid(\$featurecomponent{'Feature'});
+
+ $oneline = "$featurecomponent{'Feature'}\t$featurecomponent{'Component'}\n";
+
+ # control of uniqueness
+
+ if (! installer::existence::exists_in_array($oneline, $featurecomponenttableref))
+ {
+ push(@{$featurecomponenttableref}, $oneline);
+ }
+ }
+ }
+}
+
+#################################################################################
+# Collecting all pairs of features and components from the registry collector
+#################################################################################
+
+sub create_featurecomponent_table_from_registry_collector
+{
+ my ($featurecomponenttableref, $registryref) = @_;
+
+ for ( my $i = 0; $i <= $#{$registryref}; $i++ )
+ {
+ my $oneregistry = ${$registryref}[$i];
+
+ my $registrycomponent = $oneregistry->{'componentname'};
+ my $registrymodule = $oneregistry->{'ModuleID'};
+
+ if ( $registrycomponent eq "" )
+ {
+ installer::exiter::exit_program("ERROR: No component defined for registry $oneregistry->{'gid'}", "create_featurecomponent_table_from_registry_collector");
+ }
+ if ( $registrymodule eq "" )
+ {
+ installer::exiter::exit_program("ERROR: No modules found for registry $oneregistry->{'gid'}", "create_featurecomponent_table_from_registry_collector");
+ }
+
+ my %featurecomponent = ();
+
+ $featurecomponent{'Feature'} = $registrymodule;
+ $featurecomponent{'Component'} = $registrycomponent;
+
+ # Attention: Features are renamed, because the maximum length is 38.
+ # But in the files collector ($filesref), the original names are saved.
+
+ installer::windows::idtglobal::shorten_feature_gid(\$featurecomponent{'Feature'});
+
+ $oneline = "$featurecomponent{'Feature'}\t$featurecomponent{'Component'}\n";
+
+ # control of uniqueness
+
+ if (! installer::existence::exists_in_array($oneline, $featurecomponenttableref))
+ {
+ push(@{$featurecomponenttableref}, $oneline);
+ }
+ }
+}
+
+#################################################################################
+# Collecting all feature that are listed in the featurecomponent table.
+#################################################################################
+
+sub collect_all_feature
+{
+ my ($featurecomponenttable) = @_;
+
+ my @allfeature = ();
+
+ for ( my $i = 3; $i <= $#{$featurecomponenttable}; $i++ ) # beginning in line 4
+ {
+ my $oneline = ${$featurecomponenttable}[$i];
+
+ if ( $oneline =~ /^\s*(\S+)\s+(\S+)\s*$/ )
+ {
+ my $feature = $1;
+
+ if (! installer::existence::exists_in_array($feature, \@allfeature)) { push(@allfeature, $feature); }
+ }
+ }
+
+ return \@allfeature;
+}
+
+#################################################################################
+# On Win98 and Win Me there seems to be the problem, that maximum 817
+# components can be added to a feature. Even if Windows Installer 2.0
+# is used.
+#################################################################################
+
+sub check_number_of_components_at_feature
+{
+ my ($featurecomponenttable) = @_;
+
+ my $infoline = "\nChecking number of components at features. Maximum is 817 (for Win 98 and Win Me)\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ my $allfeature = collect_all_feature($featurecomponenttable);
+
+ for ( my $i = 0; $i <= $#{$allfeature}; $i++ )
+ {
+ my $onefeature = ${$allfeature}[$i];
+ my $featurecomponents = 0;
+
+ for ( my $j = 0; $j <= $#{$featurecomponenttable}; $j++ )
+ {
+ if ( ${$featurecomponenttable}[$j] =~ /^\s*\Q$onefeature\E\s+(\S+)\s*$/ ) { $featurecomponents++; }
+ }
+
+ if ( $featurecomponents > 816 )
+ {
+ installer::exiter::exit_program("ERROR: More than 816 components ($featurecomponents) at feature $onefeature. This causes problems on Win 98 and Win Me!", "check_number_of_components_at_feature");
+ }
+
+ # Logging the result
+
+ $infoline = "Number of components at feature $onefeature : $featurecomponents\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ $infoline = "\n";
+ push(@installer::globals::logfileinfo, $infoline);
+}
+
+#################################################################################
+# Creating the file FeatureC.idt dynamically
+# Content:
+# Feature Component
+#################################################################################
+
+sub create_featurecomponent_table
+{
+ my ($filesref, $registryref, $basedir) = @_;
+
+ my @featurecomponenttable = ();
+ my $infoline;
+
+ installer::windows::idtglobal::write_idt_header(\@featurecomponenttable, "featurecomponent");
+
+ # This is the first time, that features and componentes are related
+ # Problem: How about created profiles, configurationfiles, services.rdb
+ # -> simple solution: putting them all to the root module
+ # Otherwise profiles and configurationfiles cannot be created the way, they are now created
+ # -> especially a problem for the configurationfiles! # ToDo
+ # Very good: All ProfileItems belong to the root
+ # services.rdb belongs to the root anyway.
+
+ # At the moment only the files are related to components (and the files know their modules).
+ # The component for each file is written into the files collector $filesinproductlanguageresolvedarrayref
+
+ create_featurecomponent_table_from_files_collector(\@featurecomponenttable, $filesref);
+
+ create_featurecomponent_table_from_registry_collector(\@featurecomponenttable, $registryref);
+
+ # Additional components have to be added here
+
+ # Checking, whether there are more than 817 components at a feature
+
+ check_number_of_components_at_feature(\@featurecomponenttable);
+
+ # Saving the file
+
+ my $featurecomponenttablename = $basedir . $installer::globals::separator . "FeatureC.idt";
+ installer::files::save_file($featurecomponenttablename ,\@featurecomponenttable);
+ $infoline = "Created idt file: $featurecomponenttablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+1; \ No newline at end of file
diff --git a/solenv/bin/modules/installer/windows/file.pm b/solenv/bin/modules/installer/windows/file.pm
new file mode 100644
index 000000000000..10666be7460c
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/file.pm
@@ -0,0 +1,971 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::file;
+
+use Digest::MD5;
+use installer::existence;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::worker;
+use installer::windows::font;
+use installer::windows::idtglobal;
+use installer::windows::language;
+
+##########################################################################
+# Assigning one cabinet file to each file. This is requrired,
+# if cabinet files shall be equivalent to packages.
+##########################################################################
+
+sub assign_cab_to_files
+{
+ my ( $filesref ) = @_;
+
+ my $infoline = "";
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ if ( ! exists(${$filesref}[$i]->{'modules'}) ) { installer::exiter::exit_program("ERROR: No module assignment found for ${$filesref}[$i]->{'gid'} !", "assign_cab_to_files"); }
+ my $module = ${$filesref}[$i]->{'modules'};
+ # If modules contains a list of modules, only taking the first one.
+ if ( $module =~ /^\s*(.*?)\,/ ) { $module = $1; }
+
+ if ( ! exists($installer::globals::allcabinetassigns{$module}) ) { installer::exiter::exit_program("ERROR: No cabinet file assigned to module \"$module\" (${$filesref}[$i]->{'gid'}) !", "assign_cab_to_files"); }
+ ${$filesref}[$i]->{'assignedcabinetfile'} = $installer::globals::allcabinetassigns{$module};
+
+ # Counting the files in each cabinet file
+ if ( ! exists($installer::globals::cabfilecounter{${$filesref}[$i]->{'assignedcabinetfile'}}) )
+ {
+ $installer::globals::cabfilecounter{${$filesref}[$i]->{'assignedcabinetfile'}} = 1;
+ }
+ else
+ {
+ $installer::globals::cabfilecounter{${$filesref}[$i]->{'assignedcabinetfile'}}++;
+ }
+ }
+
+ # logging the number of files in each cabinet file
+
+ $infoline = "\nCabinet file content:\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ my $cabfile;
+ foreach $cabfile ( sort keys %installer::globals::cabfilecounter )
+ {
+ $infoline = "$cabfile : $installer::globals::cabfilecounter{$cabfile} files\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ # assigning startsequencenumbers for each cab file
+
+ my $offset = 1;
+ foreach $cabfile ( sort keys %installer::globals::cabfilecounter )
+ {
+ my $filecount = $installer::globals::cabfilecounter{$cabfile};
+ $installer::globals::cabfilecounter{$cabfile} = $offset;
+ $offset = $offset + $filecount;
+
+ $installer::globals::lastsequence{$cabfile} = $offset - 1;
+ }
+
+ # logging the start sequence numbers
+
+ $infoline = "\nCabinet file start sequences:\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ foreach $cabfile ( sort keys %installer::globals::cabfilecounter )
+ {
+ $infoline = "$cabfile : $installer::globals::cabfilecounter{$cabfile}\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ # logging the last sequence numbers
+
+ $infoline = "\nCabinet file last sequences:\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ foreach $cabfile ( sort keys %installer::globals::lastsequence )
+ {
+ $infoline = "$cabfile : $installer::globals::lastsequence{$cabfile}\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+}
+
+##########################################################################
+# Assigning sequencenumbers to files. This is requrired,
+# if cabinet files shall be equivalent to packages.
+##########################################################################
+
+sub assign_sequencenumbers_to_files
+{
+ my ( $filesref ) = @_;
+
+ my %directaccess = ();
+ my %allassigns = ();
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+
+ # Keeping order in cabinet files
+ # -> collecting all files in one cabinet file
+ # -> sorting files and assigning numbers
+
+ # Saving counter $i for direct access into files array
+ # "destination" of the file is a unique identifier ('Name' is not unique!)
+ if ( exists($directaccess{$onefile->{'destination'}}) ) { installer::exiter::exit_program("ERROR: 'destination' at file not unique: $onefile->{'destination'}", "assign_sequencenumbers_to_files"); }
+ $directaccess{$onefile->{'destination'}} = $i;
+
+ my $cabfilename = $onefile->{'assignedcabinetfile'};
+ # collecting files in cabinet files
+ if ( ! exists($allassigns{$cabfilename}) )
+ {
+ my %onecabfile = ();
+ $onecabfile{$onefile->{'destination'}} = 1;
+ $allassigns{$cabfilename} = \%onecabfile;
+ }
+ else
+ {
+ $allassigns{$cabfilename}->{$onefile->{'destination'}} = 1;
+ }
+ }
+
+ # Sorting each hash and assigning numbers
+ # The destination of the file determines the sort order, not the filename!
+ my $cabfile;
+ foreach $cabfile ( sort keys %allassigns )
+ {
+ my $counter = $installer::globals::cabfilecounter{$cabfile};
+ my $dest;
+ foreach $dest ( sort keys %{$allassigns{$cabfile}} ) # <- sorting the destination!
+ {
+ my $directaccessnumber = $directaccess{$dest};
+ ${$filesref}[$directaccessnumber]->{'assignedsequencenumber'} = $counter;
+ $counter++;
+ }
+ }
+}
+
+###############################################
+# Generating the component name from a file
+###############################################
+
+sub get_file_component_name
+{
+ my ($fileref, $filesref) = @_;
+
+ # In this function exists the rule to create components from files
+ # Rule:
+ # Two files get the same componentid, if:
+ # both have the same destination directory.
+ # both have the same "gid" -> both were packed in the same zip file
+ # All other files are included into different components!
+
+ # my $componentname = $fileref->{'gid'} . "_" . $fileref->{'Dir'};
+
+ # $fileref->{'Dir'} is not sufficient! All files in a zip file have the same $fileref->{'Dir'},
+ # but can be in different subdirectories.
+ # Solution: destination=share\Scripts\beanshell\Capitalise\capitalise.bsh
+ # in which the filename (capitalise.bsh) has to be removed and all backslashes (slashes) are
+ # converted into underline.
+
+ my $destination = $fileref->{'destination'};
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
+ $destination =~ s/\s//g;
+ $destination =~ s/\\/\_/g;
+ $destination =~ s/\//\_/g;
+ $destination =~ s/\_\s*$//g; # removing ending underline
+
+ my $componentname = $fileref->{'gid'} . "__" . $destination;
+
+ # Files with different languages, need to be packed into different components.
+ # Then the installation of the language specific component is determined by a language condition.
+
+ if ( $fileref->{'ismultilingual'} )
+ {
+ my $officelanguage = $fileref->{'specificlanguage'};
+ $componentname = $componentname . "_" . $officelanguage;
+ }
+
+ $componentname = lc($componentname); # componentnames always lowercase
+
+ $componentname =~ s/\-/\_/g; # converting "-" to "_"
+ $componentname =~ s/\./\_/g; # converting "-" to "_"
+
+ # Attention: Maximum length for the componentname is 72
+
+ $componentname =~ s/gid_file_/g_f_/g;
+ $componentname =~ s/_extra_/_e_/g;
+ $componentname =~ s/_config_/_c_/g;
+ $componentname =~ s/_org_openoffice_/_o_o_/g;
+ $componentname =~ s/_program_/_p_/g;
+ $componentname =~ s/_typedetection_/_td_/g;
+ $componentname =~ s/_linguistic_/_l_/g;
+ $componentname =~ s/_module_/_m_/g;
+ $componentname =~ s/_optional_/_opt_/g;
+ $componentname =~ s/_packages/_pack/g;
+ $componentname =~ s/_menubar/_mb/g;
+ $componentname =~ s/_common_/_cm_/g;
+ $componentname =~ s/_export_/_exp_/g;
+ $componentname =~ s/_table_/_tb_/g;
+ $componentname =~ s/_sofficecfg_/_sc_/g;
+ $componentname =~ s/_startmodulecommands_/_smc_/g;
+ $componentname =~ s/_drawimpresscommands_/_dic_/g;
+ $componentname =~ s/_basiccommands_/_bac_/g;
+ $componentname =~ s/_basicidecommands_/_baic_/g;
+ $componentname =~ s/_genericcommands_/_genc_/g;
+ $componentname =~ s/_bibliographycommands_/_bibc_/g;
+ $componentname =~ s/_share_/_s_/g;
+ $componentname =~ s/_modules_/_ms_/g;
+ $componentname =~ s/_uiconfig_zip_/_ucz_/g;
+ $componentname =~ s/_soffice_cfg_/_sc_/g;
+
+ # All this is not necessary for files, which have the flag ASSIGNCOMPOMENT
+
+ my $styles = "";
+ if ( $fileref->{'Styles'} ) { $styles = $fileref->{'Styles'}; }
+ if ( $styles =~ /\bASSIGNCOMPOMENT\b/ ) { $componentname = get_component_from_assigned_file($fileref->{'AssignComponent'}, $filesref); }
+
+ return $componentname;
+}
+
+####################################################################
+# Returning the component name for a defined file gid.
+# This is necessary for files with flag ASSIGNCOMPOMENT
+####################################################################
+
+sub get_component_from_assigned_file
+{
+ my ($gid, $filesref) = @_;
+
+ my $onefile = installer::existence::get_specified_file($filesref, $gid);
+ my $componentname = "";
+ if ( $onefile->{'componentname'} ) { $componentname = $onefile->{'componentname'}; }
+ else { installer::exiter::exit_program("ERROR: No component defined for file: $gid", "get_component_from_assigned_file"); }
+
+ return $componentname;
+}
+
+####################################################################
+# Generating the special filename for the database file File.idt
+# Sample: CONTEXTS, CONTEXTS1
+# This name has to be unique.
+# In most cases this is simply the filename.
+####################################################################
+
+sub generate_unique_filename_for_filetable
+{
+ my ($fileref, $component, $uniquefilenamehashref) = @_;
+
+ # This new filename has to be saved into $fileref, because this is needed to find the source.
+ # The filename sbasic.idx/OFFSETS is changed to OFFSETS, but OFFSETS is not unique.
+ # In this procedure names like OFFSETS5 are produced. And exactly this string has to be added to
+ # the array of all files.
+
+ my $uniquefilename = "";
+ my $counter = 0;
+
+ if ( $fileref->{'Name'} ) { $uniquefilename = $fileref->{'Name'}; }
+
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$uniquefilename); # making /registry/schema/org/openoffice/VCL.xcs to VCL.xcs
+
+ # Reading unique filename with help of "Component_" in File table from old database
+ if (( $installer::globals::updatedatabase ) && ( exists($uniquefilenamehashref->{"$component/$uniquefilename"}) ))
+ {
+ $uniquefilename = $uniquefilenamehashref->{"$component/$uniquefilename"}; # syntax of $value: ($uniquename;$shortname)
+ if ( $uniquefilename =~ /^\s*(.*?)\;\s*(.*?)\s*$/ ) { $uniquefilename = $1; }
+ $lcuniquefilename = lc($uniquefilename);
+ $installer::globals::alluniquefilenames{$uniquefilename} = 1;
+ $installer::globals::alllcuniquefilenames{$lcuniquefilename} = 1;
+ return $uniquefilename;
+ }
+ elsif (( $installer::globals::prepare_winpatch ) && ( exists($installer::globals::savedmapping{"$component/$uniquefilename"}) ))
+ {
+ # If we have a FTK mapping for this component/file, use it.
+ $installer::globals::savedmapping{"$component/$uniquefilename"} =~ m/^(.*);/;
+ $uniquefilename = $1;
+ $lcuniquefilename = lc($uniquefilename);
+ $installer::globals::alluniquefilenames{$uniquefilename} = 1;
+ $installer::globals::alllcuniquefilenames{$lcuniquefilename} = 1;
+ return $uniquefilename;
+ }
+
+ $uniquefilename =~ s/\-/\_/g; # no "-" allowed
+ $uniquefilename =~ s/\@/\_/g; # no "@" allowed
+ $uniquefilename =~ s/\$/\_/g; # no "$" allowed
+ $uniquefilename =~ s/^\s*\./\_/g; # no "." at the beginning allowed allowed
+ $uniquefilename =~ s/^\s*\d/\_d/g; # no number at the beginning allowed allowed (even file "0.gif", replacing to "_d.gif")
+ $uniquefilename =~ s/org_openoffice_/ooo_/g; # shorten the unique file name
+
+ my $lcuniquefilename = lc($uniquefilename); # only lowercase names
+
+ my $newname = 0;
+
+ if ( ! exists($installer::globals::alllcuniquefilenames{$lcuniquefilename}) &&
+ ! exists($installer::globals::savedrevmapping{$lcuniquefilename}) )
+ {
+ $installer::globals::alluniquefilenames{$uniquefilename} = 1;
+ $installer::globals::alllcuniquefilenames{$lcuniquefilename} = 1;
+ $newname = 1;
+ }
+
+ if ( ! $newname )
+ {
+ # adding a number until the name is really unique: OFFSETS, OFFSETS1, OFFSETS2, ...
+ # But attention: Making "abc.xcu" to "abc1.xcu"
+
+ my $uniquefilenamebase = $uniquefilename;
+
+ do
+ {
+ $counter++;
+
+ if ( $uniquefilenamebase =~ /\./ )
+ {
+ $uniquefilename = $uniquefilenamebase;
+ $uniquefilename =~ s/\./$counter\./;
+ }
+ else
+ {
+ $uniquefilename = $uniquefilenamebase . $counter;
+ }
+
+ $newname = 0;
+ $lcuniquefilename = lc($uniquefilename); # only lowercase names
+
+ if ( ! exists($installer::globals::alllcuniquefilenames{$lcuniquefilename}) &&
+ ! exists($installer::globals::savedrevmapping{$lcuniquefilename}) )
+ {
+ $installer::globals::alluniquefilenames{$uniquefilename} = 1;
+ $installer::globals::alllcuniquefilenames{$lcuniquefilename} = 1;
+ $newname = 1;
+ }
+ }
+ until ( $newname )
+ }
+
+ return $uniquefilename;
+}
+
+####################################################################
+# Generating the special file column for the database file File.idt
+# Sample: NAMETR~1.TAB|.nametranslation.table
+# The first part has to be 8.3 conform.
+####################################################################
+
+sub generate_filename_for_filetable
+{
+ my ($fileref, $shortnamesref, $uniquefilenamehashref) = @_;
+
+ my $returnstring = "";
+
+ my $filename = $fileref->{'Name'};
+
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$filename); # making /registry/schema/org/openoffice/VCL.xcs to VCL.xcs
+
+ my $shortstring;
+
+ # Reading short string with help of "FileName" in File table from old database
+ if (( $installer::globals::updatedatabase ) && ( exists($uniquefilenamehashref->{"$fileref->{'componentname'}/$filename"}) ))
+ {
+ my $value = $uniquefilenamehashref->{"$fileref->{'componentname'}/$filename"}; # syntax of $value: ($uniquename;$shortname)
+ if ( $value =~ /^\s*(.*?)\;\s*(.*?)\s*$/ ) { $shortstring = $2; } # already collected in function "collect_shortnames_from_old_database"
+ else { $shortstring = $filename; }
+ }
+ elsif (( $installer::globals::prepare_winpatch ) && ( exists($installer::globals::savedmapping{"$fileref->{'componentname'}/$filename"}) ))
+ {
+ $installer::globals::savedmapping{"$fileref->{'componentname'}/$filename"} =~ m/.*;(.*)/;
+ if ($1 ne '')
+ {
+ $shortstring = $1;
+ }
+ else
+ {
+ $shortstring = installer::windows::idtglobal::make_eight_three_conform_with_hash($filename, "file", $shortnamesref);
+ }
+ }
+ else
+ {
+ $shortstring = installer::windows::idtglobal::make_eight_three_conform_with_hash($filename, "file", $shortnamesref);
+ }
+
+ if ( $shortstring eq $filename ) { $returnstring = $filename; } # nothing changed
+ else {$returnstring = $shortstring . "\|" . $filename; }
+
+ return $returnstring;
+}
+
+#########################################
+# Returning the filesize of a file
+#########################################
+
+sub get_filesize
+{
+ my ($fileref) = @_;
+
+ my $file = $fileref->{'sourcepath'};
+
+ my $filesize;
+
+ if ( -f $file ) # test of existence. For instance services.rdb does not always exist
+ {
+ $filesize = ( -s $file ); # file size can be "0"
+ }
+ else
+ {
+ $filesize = -1;
+ }
+
+ return $filesize;
+}
+
+#############################################
+# Returning the file version, if required
+# Sample: "8.0.1.8976";
+#############################################
+
+sub get_fileversion
+{
+ my ($onefile, $allvariables, $styles) = @_;
+
+ my $fileversion = "";
+
+ if ( $allvariables->{'USE_FILEVERSION'} )
+ {
+ if ( ! $allvariables->{'LIBRARYVERSION'} ) { installer::exiter::exit_program("ERROR: USE_FILEVERSION is set, but not LIBRARYVERSION", "get_fileversion"); }
+ my $libraryversion = $allvariables->{'LIBRARYVERSION'};
+ if ( $libraryversion =~ /^\s*(\d+)\.(\d+)\.(\d+)\s*$/ )
+ {
+ my $major = $1;
+ my $minor = $2;
+ my $micro = $3;
+ my $concat = 100 * $minor + $micro;
+ $libraryversion = $major . "\." . $concat;
+ }
+ my $vendornumber = 0;
+ if ( $allvariables->{'VENDORPATCHVERSION'} ) { $vendornumber = $allvariables->{'VENDORPATCHVERSION'}; }
+ $fileversion = $libraryversion . "\." . $installer::globals::buildid . "\." . $vendornumber;
+ if ( $onefile->{'FileVersion'} ) { $fileversion = $onefile->{'FileVersion'}; } # overriding FileVersion in scp
+
+ # if ( $styles =~ /\bFONT\b/ )
+ # {
+ # my $newfileversion = installer::windows::font::get_font_version($onefile->{'sourcepath'});
+ # if ( $newfileversion != 0 ) { $fileversion = $newfileversion; }
+ # }
+ }
+
+ if ( $installer::globals::prepare_winpatch ) { $fileversion = ""; } # Windows patches do not allow this version # -> who says so?
+
+ return $fileversion;
+}
+
+#############################################
+# Returning the sequence for a file
+#############################################
+
+sub get_sequence_for_file
+{
+ my ($number, $onefile, $fileentry, $allupdatesequenceshashref, $allupdatecomponentshashref, $allupdatefileorderhashref, $allfilecomponents) = @_;
+
+ my $sequence = "";
+ my $infoline = "";
+ my $pffcomponentname = $onefile->{'componentname'} . "_pff";
+
+ if ( $installer::globals::updatedatabase )
+ {
+ if (( exists($allupdatesequenceshashref->{$onefile->{'uniquename'}}) ) &&
+ (( $onefile->{'componentname'} eq $allupdatecomponentshashref->{$onefile->{'uniquename'}} ) ||
+ ( $pffcomponentname eq $allupdatecomponentshashref->{$onefile->{'uniquename'}} )))
+ {
+ # The second condition is necessary to find shifted files, that have same "uniquename", but are now
+ # located in another directory. This can be seen at the component name.
+ $sequence = $allupdatesequenceshashref->{$onefile->{'uniquename'}};
+ $onefile->{'assignedsequencenumber'} = $sequence;
+ # Collecting all used sequences, to guarantee, that no number is unused
+ $installer::globals::allusedupdatesequences{$sequence} = 1;
+ # Special help for files, that already have a "pff" component name (for example after ServicePack 1)
+ if ( $pffcomponentname eq $allupdatecomponentshashref->{$onefile->{'uniquename'}} )
+ {
+ $infoline = "Warning: Special handling for component \"$pffcomponentname\". This file was added after the final, but before this ServicePack.\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $onefile->{'componentname'} = $pffcomponentname; # pff for "post final file"
+ $fileentry->{'Component_'} = $onefile->{'componentname'};
+ if ( ! exists($allfilecomponents->{$fileentry->{'Component_'}}) ) { $allfilecomponents->{$fileentry->{'Component_'}} = 1; }
+ }
+ }
+ else
+ {
+ $installer::globals::updatesequencecounter++;
+ $sequence = $installer::globals::updatesequencecounter;
+ $onefile->{'assignedsequencenumber'} = $sequence;
+ # $onefile->{'assignedcabinetfile'} = $installer::globals::pffcabfilename; # assigning to cabinet file for "post final files"
+ # Collecting all new files
+ $installer::globals::newupdatefiles{$sequence} = $onefile;
+ # Saving in sequence hash
+ $allupdatefileorderhashref->{$sequence} = $onefile->{'uniquename'};
+
+ # If the new file is part of an existing component, this must be changed now. All files
+ # of one component have to be included in one cabinet file. But because the order must
+ # not change, all new files have to be added to new components.
+ # $onefile->{'componentname'} = $file{'Component_'};
+
+ $onefile->{'componentname'} = $onefile->{'componentname'} . "_pff"; # pff for "post final file"
+ $fileentry->{'Component_'} = $onefile->{'componentname'};
+ if ( ! exists($allfilecomponents->{$fileentry->{'Component_'}}) ) { $allfilecomponents->{$fileentry->{'Component_'}} = 1; }
+ $onefile->{'PostFinalFile'} = 1;
+ # $installer::globals::pfffileexists = 1;
+ # The sequence for this file has changed. It has to be inserted at the end of the files collector.
+ $installer::globals::insert_file_at_end = 1;
+ $installer::globals::newfilescollector{$sequence} = $onefile; # Adding new files to the end of the filescollector
+ $installer::globals::newfilesexist = 1;
+ }
+ }
+ elsif (( $onefile->{'assignedsequencenumber'} ) && ( $installer::globals::use_packages_for_cabs ))
+ {
+ $sequence = $onefile->{'assignedsequencenumber'};
+ }
+ else
+ {
+ $sequence = $number;
+ # my $sequence = $number + 1;
+
+ # Idea: Each component is packed into a cab file.
+ # This requires that all files in one cab file have sequences directly follwing each other,
+ # for instance from 1456 to 1466. Then in the media table the LastSequence for this cab file
+ # is 1466.
+ # Because all files belonging to one component are directly behind each other in the file
+ # collector, it is possible to use simply an increasing number as sequence value.
+ # If files belonging to one component are not directly behind each other in the files collector
+ # this mechanism will no longer work.
+ }
+
+ return $sequence;
+}
+
+#############################################
+# Returning the Windows language of a file
+#############################################
+
+sub get_language_for_file
+{
+ my ($fileref) = @_;
+
+ my $language = "";
+
+ if ( $fileref->{'specificlanguage'} ) { $language = $fileref->{'specificlanguage'}; }
+
+ if (!($language eq ""))
+ {
+ $language = installer::windows::language::get_windows_language($language);
+ }
+
+ return $language;
+}
+
+####################################################################
+# Creating a new KeyPath for components in TemplatesFolder.
+####################################################################
+
+sub generate_registry_keypath
+{
+ my ($onefile) = @_;
+
+ my $keypath = $onefile->{'Name'};
+ $keypath =~ s/\.//g;
+ $keypath = lc($keypath);
+ $keypath = "userreg_" . $keypath;
+
+ return $keypath;
+}
+
+####################################################################
+# Check, if in an update process files are missing. No removal
+# of files allowed for Windows Patch creation.
+# Also logging all new files, that have to be included in extra
+# components and cab files.
+####################################################################
+
+sub check_file_sequences
+{
+ my ($allupdatefileorderhashref, $allupdatecomponentorderhashref) = @_;
+
+ # All used sequences stored in %installer::globals::allusedupdatesequences
+ # Maximum sequence number of old database stored in $installer::globals::updatelastsequence
+ # All new files stored in %installer::globals::newupdatefiles
+
+ my $infoline = "";
+
+ my @missing_sequences = ();
+ my @really_missing_sequences = ();
+
+ for ( my $i = 1; $i <= $installer::globals::updatelastsequence; $i++ )
+ {
+ if ( ! exists($installer::globals::allusedupdatesequences{$i}) ) { push(@missing_sequences, $i); }
+ }
+
+ if ( $#missing_sequences > -1 )
+ {
+ # Missing sequences can also be caused by files included in merge modules. This files are added later into the file table.
+ # Therefore now it is time to check the content of the merge modules.
+
+ for ( my $j = 0; $j <= $#missing_sequences; $j++ )
+ {
+ my $filename = $allupdatefileorderhashref->{$missing_sequences[$j]};
+
+ # Is this a file from a merge module? Then this is no error.
+ if ( ! exists($installer::globals::mergemodulefiles{$filename}) )
+ {
+ push(@really_missing_sequences, $missing_sequences[$j]);
+ }
+ }
+ }
+
+ if ( $#really_missing_sequences > -1 )
+ {
+ my $errorstring = "";
+ for ( my $j = 0; $j <= $#really_missing_sequences; $j++ )
+ {
+ my $filename = $allupdatefileorderhashref->{$really_missing_sequences[$j]};
+ my $comp = $allupdatecomponentorderhashref->{$really_missing_sequences[$j]};
+ $errorstring = "$errorstring$filename (Sequence: $really_missing_sequences[$j], Component: \"$comp\")\n";
+ }
+
+ $infoline = "ERROR: Files are removed compared with update database.\nThe following files are missing:\n$errorstring";
+ push(@installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program($infoline, "check_file_sequences");
+ }
+
+ # Searching for new files
+
+ my $counter = 0;
+
+ foreach my $key ( keys %installer::globals::newupdatefiles )
+ {
+ my $onefile = $installer::globals::newupdatefiles{$key};
+ $counter++;
+ if ( $counter == 1 )
+ {
+ $infoline = "\nNew files compared to the update database:\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ $infoline = "$onefile->{'Name'} ($onefile->{'gid'}) Sequence: $onefile->{'assignedsequencenumber'}\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( $counter == 0 )
+ {
+ $infoline = "Info: No new file compared with update database!\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+}
+
+###################################################################
+# Collecting further conditions for the component table.
+# This is used by multilayer products, to enable installation
+# of separate layers.
+###################################################################
+
+sub get_tree_condition_for_component
+{
+ my ($onefile, $componentname) = @_;
+
+ if ( $onefile->{'destination'} )
+ {
+ my $dest = $onefile->{'destination'};
+
+ # Comparing the destination path with
+ # $installer::globals::hostnametreestyles{$hostname} = $treestyle;
+ # (-> hostname is the key, the style the value!)
+
+ foreach my $hostname ( keys %installer::globals::hostnametreestyles )
+ {
+ if (( $dest eq $hostname ) || ( $dest =~ /^\s*\Q$hostname\E\\/ ))
+ {
+ # the value is the style
+ my $style = $installer::globals::hostnametreestyles{$hostname};
+ # the condition is saved in %installer::globals::treestyles
+ my $condition = $installer::globals::treestyles{$style};
+ # Saving condition to be added in table Property
+ $installer::globals::usedtreeconditions{$condition} = 1;
+ $condition = $condition . "=1";
+ # saving this condition
+ $installer::globals::treeconditions{$componentname} = $condition;
+
+ # saving also at the file, for usage in fileinfo
+ $onefile->{'layer'} = $installer::globals::treelayername{$style};
+ }
+ }
+ }
+}
+
+############################################
+# Collecting all short names, that are
+# already used by the old database
+############################################
+
+sub collect_shortnames_from_old_database
+{
+ my ($uniquefilenamehashref, $shortnameshashref) = @_;
+
+ foreach my $key ( keys %{$uniquefilenamehashref} )
+ {
+ my $value = $uniquefilenamehashref->{$key}; # syntax of $value: ($uniquename;$shortname)
+
+ if ( $value =~ /^\s*(.*?)\;\s*(.*?)\s*$/ )
+ {
+ my $shortstring = $2;
+ $shortnameshashref->{$shortstring} = 1; # adding the shortname to the array of all shortnames
+ }
+ }
+}
+
+############################################
+# Creating the file File.idt dynamically
+############################################
+
+sub create_files_table
+{
+ my ($filesref, $allfilecomponentsref, $basedir, $allvariables, $uniquefilenamehashref, $allupdatesequenceshashref, $allupdatecomponentshashref, $allupdatefileorderhashref) = @_;
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: File Table start");
+
+ # Structure of the files table:
+ # File Component_ FileName FileSize Version Language Attributes Sequence
+ # In this function, all components are created.
+ #
+ # $allfilecomponentsref is empty at the beginning
+
+ my $infoline;
+
+ my @allfiles = ();
+ my @filetable = ();
+ my @filehashtable = ();
+ my %allfilecomponents = ();
+ my $counter = 0;
+
+ if ( $^O =~ /cygwin/i ) { installer::worker::generate_cygwin_pathes($filesref); }
+
+ # The filenames must be collected because of uniqueness
+ # 01-44-~1.DAT, 01-44-~2.DAT, ...
+ # my @shortnames = ();
+ my %shortnames = ();
+
+ if ( $installer::globals::updatedatabase ) { collect_shortnames_from_old_database($uniquefilenamehashref, \%shortnames); }
+
+ installer::windows::idtglobal::write_idt_header(\@filetable, "file");
+ installer::windows::idtglobal::write_idt_header(\@filehashtable, "filehash");
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my %file = ();
+
+ my $onefile = ${$filesref}[$i];
+
+ my $styles = "";
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+ if (( $styles =~ /\bJAVAFILE\b/ ) && ( ! ($allvariables->{'JAVAPRODUCT'} ))) { next; }
+
+ $file{'Component_'} = get_file_component_name($onefile, $filesref);
+ $file{'File'} = generate_unique_filename_for_filetable($onefile, $file{'Component_'}, $uniquefilenamehashref);
+
+ $onefile->{'uniquename'} = $file{'File'};
+ $onefile->{'componentname'} = $file{'Component_'};
+
+ # Collecting all components
+ # if (!(installer::existence::exists_in_array($file{'Component_'}, $allfilecomponentsref))) { push(@{$allfilecomponentsref}, $file{'Component_'}); }
+
+ if ( ! exists($allfilecomponents{$file{'Component_'}}) ) { $allfilecomponents{$file{'Component_'}} = 1; }
+
+ $file{'FileName'} = generate_filename_for_filetable($onefile, \%shortnames, $uniquefilenamehashref);
+
+ $file{'FileSize'} = get_filesize($onefile);
+
+ $file{'Version'} = get_fileversion($onefile, $allvariables, $styles);
+
+ $file{'Language'} = get_language_for_file($onefile);
+
+ if ( $styles =~ /\bDONT_PACK\b/ ) { $file{'Attributes'} = "8192"; }
+ else { $file{'Attributes'} = "16384"; }
+
+ # $file{'Attributes'} = "16384"; # Sourcefile is packed
+ # $file{'Attributes'} = "8192"; # Sourcefile is unpacked
+
+ $installer::globals::insert_file_at_end = 0;
+ $counter++;
+ $file{'Sequence'} = get_sequence_for_file($counter, $onefile, \%file, $allupdatesequenceshashref, $allupdatecomponentshashref, $allupdatefileorderhashref, \%allfilecomponents);
+
+ $onefile->{'sequencenumber'} = $file{'Sequence'};
+
+ my $oneline = $file{'File'} . "\t" . $file{'Component_'} . "\t" . $file{'FileName'} . "\t"
+ . $file{'FileSize'} . "\t" . $file{'Version'} . "\t" . $file{'Language'} . "\t"
+ . $file{'Attributes'} . "\t" . $file{'Sequence'} . "\n";
+
+ push(@filetable, $oneline);
+
+ if ( ! $installer::globals::insert_file_at_end ) { push(@allfiles, $onefile); }
+
+ # Collecting all component conditions
+ if ( $onefile->{'ComponentCondition'} )
+ {
+ if ( ! exists($installer::globals::componentcondition{$file{'Component_'}}))
+ {
+ $installer::globals::componentcondition{$file{'Component_'}} = $onefile->{'ComponentCondition'};
+ }
+ }
+
+ # Collecting also all tree conditions for multilayer products
+ get_tree_condition_for_component($onefile, $file{'Component_'});
+
+ # Collecting all component names, that have flag VERSION_INDEPENDENT_COMP_ID
+ # This should be all components with constant API, for example URE
+ if ( $styles =~ /\bVERSION_INDEPENDENT_COMP_ID\b/ )
+ {
+ $installer::globals::base_independent_components{$onefile->{'componentname'}} = 1;
+ }
+
+ # Collecting all component ids, that are defined at files in scp project (should not be used anymore)
+ if ( $onefile->{'CompID'} )
+ {
+ if ( ! exists($installer::globals::componentid{$onefile->{'componentname'}}))
+ {
+ $installer::globals::componentid{$onefile->{'componentname'}} = $onefile->{'CompID'};
+ }
+ else
+ {
+ if ( $installer::globals::componentid{$onefile->{'componentname'}} ne $onefile->{'CompID'} )
+ {
+ installer::exiter::exit_program("ERROR: There is already a ComponentID for component \"$onefile->{'componentname'}\" : \"$installer::globals::componentid{$onefile->{'componentname'}}\" . File \"$onefile->{'gid'}\" uses \"$onefile->{'CompID'}\" !", "create_files_table");
+ }
+ }
+
+ # Also checking vice versa. Is this ComponentID already used? If yes, is the componentname the same?
+
+ if ( ! exists($installer::globals::comparecomponentname{$onefile->{'CompID'}}))
+ {
+ $installer::globals::comparecomponentname{$onefile->{'CompID'}} = $onefile->{'componentname'};
+ }
+ else
+ {
+ if ( $installer::globals::comparecomponentname{$onefile->{'CompID'}} ne $onefile->{'componentname'} )
+ {
+ installer::exiter::exit_program("ERROR: There is already a component for ComponentID \"$onefile->{'CompID'}\" : \"$installer::globals::comparecomponentname{$onefile->{'CompID'}}\" . File \"$onefile->{'gid'}\" has same component id but is included in component \"$onefile->{'componentname'}\" !", "create_files_table");
+ }
+ }
+ }
+
+ # Collecting all language specific conditions
+ # if ( $onefile->{'haslanguagemodule'} )
+ if ( $onefile->{'ismultilingual'} )
+ {
+ if ( $onefile->{'ComponentCondition'} ) { installer::exiter::exit_program("ERROR: Cannot set language condition. There is already another component condition for file $onefile->{'gid'}: \"$onefile->{'ComponentCondition'}\" !", "create_files_table"); }
+
+ if ( $onefile->{'specificlanguage'} eq "" ) { installer::exiter::exit_program("ERROR: There is no specific language for file at language module: $onefile->{'gid'} !", "create_files_table"); }
+ my $locallanguage = $onefile->{'specificlanguage'};
+ my $property = "IS" . $file{'Language'};
+ my $value = 1;
+ my $condition = $property . "=" . $value;
+
+ $onefile->{'ComponentCondition'} = $condition;
+
+ if ( exists($installer::globals::componentcondition{$file{'Component_'}}))
+ {
+ if ( $installer::globals::componentcondition{$file{'Component_'}} ne $condition ) { installer::exiter::exit_program("ERROR: There is already another component condition for file $onefile->{'gid'}: \"$installer::globals::componentcondition{$file{'Component_'}}\" and \"$condition\" !", "create_files_table"); }
+ }
+ else
+ {
+ $installer::globals::componentcondition{$file{'Component_'}} = $condition;
+ }
+
+ # collecting all properties for table Property
+ if ( ! exists($installer::globals::languageproperties{$property}) ) { $installer::globals::languageproperties{$property} = $value; }
+ }
+
+ if ( $installer::globals::prepare_winpatch )
+ {
+ my $path = $onefile->{'sourcepath'};
+ if ( $^O =~ /cygwin/i ) { $path = $onefile->{'cyg_sourcepath'}; }
+
+ open(FILE, $path) or die "ERROR: Can't open $path for creating file hash";
+ binmode(FILE);
+ my $hashinfo = pack("l", 20);
+ $hashinfo .= Digest::MD5->new->addfile(*FILE)->digest;
+
+ my @i = unpack ('x[l]l4', $hashinfo);
+ $oneline = $file{'File'} . "\t" .
+ "0" . "\t" .
+ $i[0] . "\t" .
+ $i[1] . "\t" .
+ $i[2] . "\t" .
+ $i[3] . "\n";
+ push (@filehashtable, $oneline);
+ }
+
+ # Saving the sequence number in a hash with uniquefilename as key.
+ # This is used for better performance in "save_packorder"
+ $installer::globals::uniquefilenamesequence{$onefile->{'uniquename'}} = $onefile->{'sequencenumber'};
+
+ # Special handling for files in PREDEFINED_OSSHELLNEWDIR. These components
+ # need as KeyPath a RegistryItem in HKCU
+ my $destdir = "";
+ if ( $onefile->{'Dir'} ) { $destdir = $onefile->{'Dir'}; }
+
+ if (( $destdir =~ /\bPREDEFINED_OSSHELLNEWDIR\b/ ) || ( $onefile->{'needs_user_registry_key'} ))
+ {
+ my $keypath = generate_registry_keypath($onefile);
+ $onefile->{'userregkeypath'} = $keypath;
+ push(@installer::globals::userregistrycollector, $onefile);
+ $installer::globals::addeduserregitrykeys = 1;
+ }
+ }
+
+ # putting content from %allfilecomponents to $allfilecomponentsref for later usage
+ foreach $localkey (keys %allfilecomponents ) { push( @{$allfilecomponentsref}, $localkey); }
+
+ my $filetablename = $basedir . $installer::globals::separator . "File.idt";
+ installer::files::save_file($filetablename ,\@filetable);
+ $infoline = "\nCreated idt file: $filetablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: File Table end");
+
+ my $filehashtablename = $basedir . $installer::globals::separator . "MsiFileHash.idt";
+ installer::files::save_file($filehashtablename ,\@filehashtable);
+ $infoline = "\nCreated idt file: $filehashtablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ # Now the new files can be added to the files collector (only in update packaging processes)
+ if ( $installer::globals::newfilesexist )
+ {
+ foreach my $seq (sort keys %installer::globals::newfilescollector) { push(@allfiles, $installer::globals::newfilescollector{$seq}) }
+ }
+
+ return \@allfiles;
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/font.pm b/solenv/bin/modules/installer/windows/font.pm
new file mode 100644
index 000000000000..9dab78caf5f7
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/font.pm
@@ -0,0 +1,110 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::font;
+
+use installer::files;
+use installer::globals;
+use installer::windows::idtglobal;
+
+
+#################################################################################
+# Creating the file Font.idt dynamically
+# Content:
+# File_ FontTitle
+#################################################################################
+
+sub create_font_table
+{
+ my ($filesref, $basedir) = @_;
+
+ my @fonttable = ();
+
+ installer::windows::idtglobal::write_idt_header(\@fonttable, "font");
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ my $styles = "";
+
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+
+ if ( $styles =~ /\bFONT\b/ )
+ {
+ my %font = ();
+
+ $font{'File_'} = $onefile->{'uniquename'};
+ # $font{'FontTitle'} = $onefile->{'FontName'}; # results in a warning during validation
+ $font{'FontTitle'} = "";
+
+ my $oneline = $font{'File_'} . "\t" . $font{'FontTitle'} . "\n";
+
+ push(@fonttable, $oneline);
+ }
+ }
+
+ # Saving the file
+
+ my $fonttablename = $basedir . $installer::globals::separator . "Font.idt";
+ installer::files::save_file($fonttablename ,\@fonttable);
+ my $infoline = "Created idt file: $fonttablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+#################################################################################
+# Reading the Font version from the ttf file, to avoid installation
+# of older files over newer files.
+#################################################################################
+
+sub get_font_version
+{
+ my ( $fontfile ) = @_;
+
+ if ( ! -f $fontfile ) { installer::exiter::exit_program("ERROR: Font file does not exist: \"$fontfile\"", "get_font_version"); }
+
+ my $fontversion = 0;
+ my $infoline = "";
+
+ my $onefile = installer::files::read_binary_file($fontfile);
+
+ if ( $onefile =~ /Version\s+(\d+\.\d+\.*\d*)/ )
+ {
+ $fontversion = $1;
+ $infoline = "FONT: Font \"$fontfile\" version: $fontversion\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "FONT: Could not determine font version: \"$fontfile\"\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ return $fontversion;
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/icon.pm b/solenv/bin/modules/installer/windows/icon.pm
new file mode 100644
index 000000000000..ac2fa9ea8cfa
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/icon.pm
@@ -0,0 +1,77 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::icon;
+
+use installer::files;
+use installer::globals;
+use installer::pathanalyzer;
+use installer::windows::idtglobal;
+
+###########################################################################################################
+# Creating the file Icon.idt dynamically
+# Content:
+# Name Data
+###########################################################################################################
+
+sub create_icon_table
+{
+ my ($iconfilecollector, $basedir) = @_;
+
+ my @icontable = ();
+
+ installer::windows::idtglobal::write_idt_header(\@icontable, "icon");
+
+ # Only the iconfiles, that are used in the shortcut table for the
+ # FolderItems (entries in Windows startmenu) are added into the icon table.
+
+ for ( my $i = 0; $i <= $#{$iconfilecollector}; $i++ )
+ {
+ my $iconfile = ${$iconfilecollector}[$i];
+
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$iconfile);
+
+ my %icon = ();
+
+ $icon{'Name'} = $iconfile; # simply soffice.exe
+ $icon{'Data'} = $iconfile; # simply soffice.exe
+
+ my $oneline = $icon{'Name'} . "\t" . $icon{'Data'} . "\n";
+
+ push(@icontable, $oneline);
+ }
+
+ # Saving the file
+
+ my $icontablename = $basedir . $installer::globals::separator . "Icon.idt";
+ installer::files::save_file($icontablename ,\@icontable);
+ my $infoline = "Created idt file: $icontablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/idtglobal.pm b/solenv/bin/modules/installer/windows/idtglobal.pm
new file mode 100644
index 000000000000..64dc2f34a12a
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/idtglobal.pm
@@ -0,0 +1,2423 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::idtglobal;
+
+use Cwd;
+use installer::converter;
+use installer::existence;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::pathanalyzer;
+use installer::remover;
+use installer::scriptitems;
+use installer::systemactions;
+use installer::windows::language;
+
+##############################################################
+# Shorten the gid for a feature.
+# Attention: Maximum length is 38
+##############################################################
+
+sub shorten_feature_gid
+{
+ my ($stringref) = @_;
+
+ $$stringref =~ s/gid_Module_/gm_/;
+ $$stringref =~ s/_Root_/_r_/;
+ $$stringref =~ s/_Prg_/_p_/;
+ $$stringref =~ s/_Optional_/_o_/;
+ $$stringref =~ s/_Wrt_Flt_/_w_f_/;
+ $$stringref =~ s/_Javafilter_/_jf_/;
+}
+
+############################################
+# Getting the next free number, that
+# can be added.
+# Sample: 01-44-~1.DAT, 01-44-~2.DAT, ...
+############################################
+
+sub get_next_free_number
+{
+ my ($name, $shortnamesref) = @_;
+
+ my $counter = 0;
+ my $dontsave = 0;
+ my $alreadyexists;
+ my ($newname, $shortname);
+
+ do
+ {
+ $alreadyexists = 0;
+ $counter++;
+ $newname = $name . $counter;
+
+ for ( my $i = 0; $i <= $#{$shortnamesref}; $i++ )
+ {
+ $shortname = ${$shortnamesref}[$i];
+
+ if ( uc($shortname) eq uc($newname) ) # case insensitive
+ {
+ $alreadyexists = 1;
+ last;
+ }
+ }
+ }
+ until (!($alreadyexists));
+
+ if (( $counter > 9 ) && ( length($name) > 6 ))
+ {
+ $dontsave = 1;
+ }
+
+ if (!($dontsave))
+ {
+ push(@{$shortnamesref}, $newname); # adding the new shortname to the array of shortnames
+ }
+
+ return $counter
+}
+
+############################################
+# Getting the next free number, that
+# can be added.
+# Sample: 01-44-~1.DAT, 01-44-~2.DAT, ...
+############################################
+
+sub get_next_free_number_with_hash
+{
+ my ($name, $shortnamesref, $ext) = @_;
+
+ my $counter = 0;
+ my $dontsave = 0;
+ my $saved = 0;
+ my $alreadyexists;
+ my ($newname, $shortname);
+
+ do
+ {
+ $alreadyexists = 0;
+ $counter++;
+ $newname = $name . $counter;
+ $newname = uc($newname); # case insensitive, always upper case
+ if ( exists($shortnamesref->{$newname}) ||
+ exists($installer::globals::savedrev83mapping{$newname.$ext}) )
+ {
+ $alreadyexists = 1;
+ }
+ }
+ until (!($alreadyexists));
+
+ if (( $counter > 9 ) && ( length($name) > 6 )) { $dontsave = 1; }
+ if (( $counter > 99 ) && ( length($name) > 5 )) { $dontsave = 1; }
+
+ if (!($dontsave))
+ {
+ # push(@{$shortnamesref}, $newname); # adding the new shortname to the array of shortnames
+ $shortnamesref->{$newname} = 1; # adding the new shortname to the array of shortnames, always uppercase
+ $saved = 1;
+ }
+
+ return ( $counter, $saved )
+}
+
+#########################################
+# 8.3 for filenames and directories
+#########################################
+
+sub make_eight_three_conform
+{
+ my ($inputstring, $pattern, $shortnamesref) = @_;
+
+ # all shortnames are collected in $shortnamesref, because of uniqueness
+
+ my ($name, $namelength, $number);
+ my $conformstring = "";
+ my $changed = 0;
+
+ if (( $inputstring =~ /^\s*(.*?)\.(.*?)\s*$/ ) && ( $pattern eq "file" )) # files with a dot
+ {
+ $name = $1;
+ my $extension = $2;
+
+ $namelength = length($name);
+ my $extensionlength = length($extension);
+
+ if ( $extensionlength > 3 )
+ {
+ # simply taking the first three letters
+ $extension = substr($extension, 0, 3); # name, offset, length
+ }
+
+ # Attention: readme.html -> README~1.HTM
+
+ if (( $namelength > 8 ) || ( $extensionlength > 3 ))
+ {
+ # taking the first six letters
+ $name = substr($name, 0, 6); # name, offset, length
+ $name =~ s/\s*$//; # removing ending whitespaces
+ $name = $name . "\~";
+ $number = get_next_free_number($name, $shortnamesref);
+
+ # if $number>9 the new name would be "abcdef~10.xyz", which is 9+3, and therefore not allowed
+
+ if ( $number > 9 )
+ {
+ $name = substr($name, 0, 5); # name, offset, length
+ $name =~ s/\s*$//; # removing ending whitespaces
+ $name = $name . "\~";
+ $number = get_next_free_number($name, $shortnamesref);
+ }
+
+ $name = $name . "$number";
+
+ $changed = 1;
+ }
+
+ $conformstring = $name . "\." . $extension;
+
+ if ( $changed ) { $conformstring= uc($conformstring); }
+ }
+ else # no dot in filename or directory (also used for shortcuts)
+ {
+ $name = $inputstring;
+ $namelength = length($name);
+
+ if ( $namelength > 8 )
+ {
+ # taking the first six letters
+ $name = substr($name, 0, 6); # name, offset, length
+ $name =~ s/\s*$//; # removing ending whitespaces
+ $name = $name . "\~";
+ $number = get_next_free_number($name, $shortnamesref);
+
+ # if $number>9 the new name would be "abcdef~10.xyz", which is 9+3, and therefore not allowed
+
+ if ( $number > 9 )
+ {
+ $name = substr($name, 0, 5); # name, offset, length
+ $name =~ s/\s*$//; # removing ending whitespaces
+ $name = $name . "\~";
+ $number = get_next_free_number($name, $shortnamesref);
+ }
+
+ $name = $name . "$number";
+ $changed = 1;
+ if ( $pattern eq "dir" ) { $name =~ s/\./\_/g; } # in directories replacing "." with "_"
+ }
+
+ $conformstring = $name;
+
+ if ( $changed ) { $conformstring = uc($name); }
+ }
+
+ return $conformstring;
+}
+
+#########################################
+# 8.3 for filenames and directories
+# $shortnamesref is a hash in this case
+# -> performance reasons
+#########################################
+
+sub make_eight_three_conform_with_hash
+{
+ my ($inputstring, $pattern, $shortnamesref) = @_;
+
+ # all shortnames are collected in $shortnamesref, because of uniqueness (a hash!)
+
+ my ($name, $namelength, $number);
+ my $conformstring = "";
+ my $changed = 0;
+ my $saved;
+
+ # if (( $inputstring =~ /^\s*(.*?)\.(.*?)\s*$/ ) && ( $pattern eq "file" )) # files with a dot
+ if (( $inputstring =~ /^\s*(.*)\.(.*?)\s*$/ ) && ( $pattern eq "file" )) # files with a dot
+ {
+ # extension has to be non-greedy, but name is. This is important to find the last dot in the filename
+ $name = $1;
+ my $extension = $2;
+
+ if ( $name =~ /^\s*(.*?)\s*$/ ) { $name = $1; } # now the name is also non-greedy
+ $name =~ s/\.//g; # no dots in 8+3 conform filename
+
+ $namelength = length($name);
+ my $extensionlength = length($extension);
+
+ if ( $extensionlength > 3 )
+ {
+ # simply taking the first three letters
+ $extension = substr($extension, 0, 3); # name, offset, length
+ $changed = 1;
+ }
+
+ # Attention: readme.html -> README~1.HTM
+
+ if (( $namelength > 8 ) || ( $extensionlength > 3 ))
+ {
+ # taking the first six letters, if filename is longer than 6 characters
+ if ( $namelength > 6 )
+ {
+ $name = substr($name, 0, 6); # name, offset, length
+ $name =~ s/\s*$//; # removing ending whitespaces
+ $name = $name . "\~";
+ ($number, $saved) = get_next_free_number_with_hash($name, $shortnamesref, '.'.uc($extension));
+
+ # if $number>9 the new name would be "abcdef~10.xyz", which is 9+3, and therefore not allowed
+
+ if ( ! $saved )
+ {
+ $name = substr($name, 0, 5); # name, offset, length
+ $name =~ s/\s*$//; # removing ending whitespaces
+ $name = $name . "\~";
+ ($number, $saved) = get_next_free_number_with_hash($name, $shortnamesref, '.'.uc($extension));
+
+ # if $number>99 the new name would be "abcde~100.xyz", which is 9+3, and therefore not allowed
+
+ if ( ! $saved )
+ {
+ $name = substr($name, 0, 4); # name, offset, length
+ $name =~ s/\s*$//; # removing ending whitespaces
+ $name = $name . "\~";
+ ($number, $saved) = get_next_free_number_with_hash($name, $shortnamesref, '.'.uc($extension));
+
+ if ( ! $saved )
+ {
+ installer::exiter::exit_program("ERROR: Could not set 8+3 conform name for $inputstring !", "make_eight_three_conform_with_hash");
+ }
+ }
+ }
+
+ $name = $name . "$number";
+ $changed = 1;
+ }
+ }
+
+ $conformstring = $name . "\." . $extension;
+
+ if ( $changed ) { $conformstring= uc($conformstring); }
+ }
+ else # no dot in filename or directory (also used for shortcuts)
+ {
+ $name = $inputstring;
+ $namelength = length($name);
+
+ if ( $namelength > 8 )
+ {
+ # taking the first six letters
+ $name = substr($name, 0, 6); # name, offset, length
+ $name =~ s/\s*$//; # removing ending whitespaces
+ $name = $name . "\~";
+ ( $number, $saved ) = get_next_free_number_with_hash($name, $shortnamesref, '');
+
+ # if $number>9 the new name would be "abcdef~10", which is 9+0, and therefore not allowed
+
+ if ( ! $saved )
+ {
+ $name = substr($name, 0, 5); # name, offset, length
+ $name =~ s/\s*$//; # removing ending whitespaces
+ $name = $name . "\~";
+ ( $number, $saved ) = get_next_free_number_with_hash($name, $shortnamesref, '');
+
+ # if $number>99 the new name would be "abcde~100", which is 9+0, and therefore not allowed
+
+ if ( ! $saved )
+ {
+ $name = substr($name, 0, 4); # name, offset, length
+ $name =~ s/\s*$//; # removing ending whitespaces
+ $name = $name . "\~";
+ ( $number, $saved ) = get_next_free_number_with_hash($name, $shortnamesref, '');
+
+ if ( ! $saved ) { installer::exiter::exit_program("ERROR: Could not set 8+3 conform name for $inputstring !", "make_eight_three_conform_with_hash"); }
+ }
+ }
+
+ $name = $name . "$number";
+ $changed = 1;
+ if ( $pattern eq "dir" ) { $name =~ s/\./\_/g; } # in directories replacing "." with "_"
+ }
+
+ $conformstring = $name;
+
+ if ( $changed ) { $conformstring = uc($name); }
+ }
+
+ return $conformstring;
+}
+
+#########################################
+# Writing the header for idt files
+#########################################
+
+sub write_idt_header
+{
+ my ($idtref, $definestring) = @_;
+
+ my $oneline;
+
+ if ( $definestring eq "file" )
+ {
+ $oneline = "File\tComponent_\tFileName\tFileSize\tVersion\tLanguage\tAttributes\tSequence\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\ts72\tl255\ti4\tS72\tS20\tI2\ti2\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "File\tFile\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "filehash" )
+ {
+ $oneline = "File_\tOptions\tHashPart1\tHashPart2\tHashPart3\tHashPart4\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\ti2\ti4\ti4\ti4\ti4\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "MsiFileHash\tFile_\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "directory" )
+ {
+ $oneline = "Directory\tDirectory_Parent\tDefaultDir\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\tS72\tl255\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "Directory\tDirectory\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "component" )
+ {
+ $oneline = "Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\tS38\ts72\ti2\tS255\tS72\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "Component\tComponent\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "feature" )
+ {
+ $oneline = "Feature\tFeature_Parent\tTitle\tDescription\tDisplay\tLevel\tDirectory_\tAttributes\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s38\tS38\tL64\tL255\tI2\ti2\tS72\ti2\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "WINDOWSENCODINGTEMPLATE\tFeature\tFeature\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "featurecomponent" )
+ {
+ $oneline = "Feature_\tComponent_\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s38\ts72\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "FeatureComponents\tFeature_\tComponent_\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "media" )
+ {
+ $oneline = "DiskId\tLastSequence\tDiskPrompt\tCabinet\tVolumeLabel\tSource\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "i2\ti2\tL64\tS255\tS32\tS72\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "Media\tDiskId\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "font" )
+ {
+ $oneline = "File_\tFontTitle\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\tS128\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "Font\tFile_\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "shortcut" )
+ {
+ $oneline = "Shortcut\tDirectory_\tName\tComponent_\tTarget\tArguments\tDescription\tHotkey\tIcon_\tIconIndex\tShowCmd\tWkDir\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\ts72\tl128\ts72\ts72\tS255\tL255\tI2\tS72\tI2\tI2\tS72\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "WINDOWSENCODINGTEMPLATE\tShortcut\tShortcut\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "registry" )
+ {
+ $oneline = "Registry\tRoot\tKey\tName\tValue\tComponent_\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\ti2\tl255\tL255\tL0\ts72\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "Registry\tRegistry\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "reg64" )
+ {
+ $oneline = "Registry\tRoot\tKey\tName\tValue\tComponent_\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\ti2\tl255\tL255\tL0\ts72\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "Reg64\tRegistry\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "createfolder" )
+ {
+ $oneline = "Directory_\tComponent_\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\ts72\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "CreateFolder\tDirectory_\tComponent_\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "removefile" )
+ {
+ $oneline = "FileKey\tComponent_\tFileName\tDirProperty\tInstallMode\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\ts72\tL255\ts72\ti2\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "RemoveFile\tFileKey\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "upgrade" )
+ {
+ $oneline = "UpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\tRemove\tActionProperty\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s38\tS20\tS20\tS255\ti4\tS255\ts72\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "Upgrade\tUpgradeCode\tVersionMin\tVersionMax\tLanguage\tAttributes\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "icon" )
+ {
+ $oneline = "Name\tData\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\tv0\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "Icon\tName\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "inifile" )
+ {
+ $oneline = "IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\tl255\tS72\tl96\tl128\tl255\ti2\ts72\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "IniFile\tIniFile\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "selfreg" )
+ {
+ $oneline = "File_\tCost\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\tI2\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "SelfReg\tFile_\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "msiassembly" )
+ {
+ $oneline = "Component_\tFeature_\tFile_Manifest\tFile_Application\tAttributes\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\ts38\tS72\tS72\tI2\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "MsiAssembly\tComponent_\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "msiassemblyname" )
+ {
+ $oneline = "Component_\tName\tValue\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\ts255\ts255\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "MsiAssemblyName\tComponent_\tName\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "appsearch" )
+ {
+ $oneline = "Property\tSignature_\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\ts72\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "AppSearch\tProperty\tSignature_\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "reglocat" )
+ {
+ $oneline = "Signature_\tRoot\tKey\tName\tType\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\ti2\ts255\tS255\tI2\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "RegLocator\tSignature_\n";
+ push(@{$idtref}, $oneline);
+ }
+
+ if ( $definestring eq "signatur" )
+ {
+ $oneline = "Signature\tFileName\tMinVersion\tMaxVersion\tMinSize\tMaxSize\tMinDate\tMaxDate\tLanguages\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "s72\ts255\tS20\tS20\tI4\tI4\tI4\tI4\tS255\n";
+ push(@{$idtref}, $oneline);
+ $oneline = "Signature\tSignature\n";
+ push(@{$idtref}, $oneline);
+ }
+
+}
+
+##############################################################
+# Returning the name of the rranslation file for a
+# given language.
+# Sample: "01" oder "en-US" -> "1033.txt"
+##############################################################
+
+sub get_languagefilename
+{
+ my ($idtfilename, $basedir) = @_;
+
+ # $idtfilename =~ s/\.idt/\.ulf/;
+ $idtfilename =~ s/\.idt/\.mlf/;
+
+ my $languagefilename = $basedir . $installer::globals::separator . $idtfilename;
+
+ return $languagefilename;
+}
+
+##############################################################
+# Returning the complete block in all languages
+# for a specified string
+##############################################################
+
+sub get_language_block_from_language_file
+{
+ my ($searchstring, $languagefile) = @_;
+
+ my @language_block = ();
+
+ for ( my $i = 0; $i <= $#{$languagefile}; $i++ )
+ {
+ if ( ${$languagefile}[$i] =~ /^\s*\[\s*$searchstring\s*\]\s*$/ )
+ {
+ my $counter = $i;
+
+ push(@language_block, ${$languagefile}[$counter]);
+ $counter++;
+
+ while (( $counter <= $#{$languagefile} ) && (!( ${$languagefile}[$counter] =~ /^\s*\[/ )))
+ {
+ push(@language_block, ${$languagefile}[$counter]);
+ $counter++;
+ }
+
+ last;
+ }
+ }
+
+ return \@language_block;
+}
+
+##############################################################
+# Returning a specific language string from the block
+# of all translations
+##############################################################
+
+sub get_language_string_from_language_block
+{
+ my ($language_block, $language, $oldstring) = @_;
+
+ my $newstring = "";
+
+ for ( my $i = 0; $i <= $#{$language_block}; $i++ )
+ {
+ if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
+ {
+ $newstring = $1;
+ last;
+ }
+ }
+
+ if ( $newstring eq "" )
+ {
+ $language = "en-US"; # defaulting to english
+
+ for ( my $i = 0; $i <= $#{$language_block}; $i++ )
+ {
+ if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
+ {
+ $newstring = $1;
+ last;
+ }
+ }
+ }
+
+ return $newstring;
+}
+
+##############################################################
+# Returning a specific code from the block
+# of all codes. No defaulting to english!
+##############################################################
+
+sub get_code_from_code_block
+{
+ my ($codeblock, $language) = @_;
+
+ my $newstring = "";
+
+ for ( my $i = 0; $i <= $#{$codeblock}; $i++ )
+ {
+ if ( ${$codeblock}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
+ {
+ $newstring = $1;
+ last;
+ }
+ }
+
+ return $newstring;
+}
+
+##############################################################
+# Translating an idt file
+##############################################################
+
+sub translate_idtfile
+{
+ my ($idtfile, $languagefile, $onelanguage) = @_;
+
+ for ( my $i = 0; $i <= $#{$idtfile}; $i++ )
+ {
+ my @allstrings = ();
+
+ my $oneline = ${$idtfile}[$i];
+
+ while ( $oneline =~ /\b(OOO_\w+)\b/ )
+ {
+ my $replacestring = $1;
+ push(@allstrings, $replacestring);
+ $oneline =~ s/$replacestring//;
+ }
+
+ my $oldstring;
+
+ foreach $oldstring (@allstrings)
+ {
+ my $language_block = get_language_block_from_language_file($oldstring, $languagefile);
+ my $newstring = get_language_string_from_language_block($language_block, $onelanguage, $oldstring);
+
+ # if (!( $newstring eq "" )) { ${$idtfile}[$i] =~ s/$oldstring/$newstring/; }
+ ${$idtfile}[$i] =~ s/$oldstring/$newstring/; # always substitute, even if $newstring eq "" (there are empty strings for control.idt)
+ }
+ }
+}
+
+##############################################################
+# Copying all needed files to create a msi database
+# into one language specific directory
+##############################################################
+
+sub prepare_language_idt_directory
+{
+ my ($destinationdir, $newidtdir, $onelanguage, $filesref, $iconfilecollector, $binarytablefiles, $allvariables) = @_;
+
+ # Copying all idt-files from the source $installer::globals::idttemplatepath to the destination $destinationdir
+ # Copying all files in the subdirectory "Binary"
+ # Copying all files in the subdirectory "Icon"
+
+ my $infoline = "";
+
+ installer::systemactions::copy_directory($installer::globals::idttemplatepath, $destinationdir);
+
+ if ( -d $installer::globals::idttemplatepath . $installer::globals::separator . "Binary")
+ {
+ installer::systemactions::create_directory($destinationdir . $installer::globals::separator . "Binary");
+ installer::systemactions::copy_directory($installer::globals::idttemplatepath . $installer::globals::separator . "Binary", $destinationdir . $installer::globals::separator . "Binary");
+
+ if ((( $installer::globals::patch ) && ( $allvariables->{'WINDOWSPATCHBITMAPDIRECTORY'} )) || ( $allvariables->{'WINDOWSBITMAPDIRECTORY'} ))
+ {
+ my $bitmapdir = "";
+ if ( $allvariables->{'WINDOWSPATCHBITMAPDIRECTORY'} ) { $bitmapdir = $allvariables->{'WINDOWSPATCHBITMAPDIRECTORY'}; }
+ if ( $allvariables->{'WINDOWSBITMAPDIRECTORY'} ) { $bitmapdir = $allvariables->{'WINDOWSBITMAPDIRECTORY'}; }
+
+ my $newsourcedir = $installer::globals::unpackpath . $installer::globals::separator . $bitmapdir; # path setting in list file dependent from unpackpath !?
+ $infoline = "\nOverwriting files in directory \"" . $destinationdir . $installer::globals::separator . "Binary" . "\" with files from directory \"" . $newsourcedir . "\".\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ if ( ! -d $newsourcedir )
+ {
+ my $currentdir = cwd();
+ installer::exiter::exit_program("ERROR: Directory $newsourcedir does not exist! Current directory is: $currentdir", "prepare_language_idt_directory");
+ }
+ installer::systemactions::copy_directory($newsourcedir, $destinationdir . $installer::globals::separator . "Binary");
+ }
+ }
+
+ installer::systemactions::create_directory($destinationdir . $installer::globals::separator . "Icon");
+
+ if ( -d $installer::globals::idttemplatepath . $installer::globals::separator . "Icon")
+ {
+ installer::systemactions::copy_directory($installer::globals::idttemplatepath . $installer::globals::separator . "Icon", $destinationdir . $installer::globals::separator . "Icon");
+ }
+
+ # Copying all files in $iconfilecollector, that describe icons of folderitems
+
+ for ( my $i = 0; $i <= $#{$iconfilecollector}; $i++ )
+ {
+ my $iconfilename = ${$iconfilecollector}[$i];
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$iconfilename);
+ installer::systemactions::copy_one_file(${$iconfilecollector}[$i], $destinationdir . $installer::globals::separator . "Icon" . $installer::globals::separator . $iconfilename);
+ }
+
+ # Copying all files in $binarytablefiles in the binary directory
+
+ for ( my $i = 0; $i <= $#{$binarytablefiles}; $i++ )
+ {
+ my $binaryfile = ${$binarytablefiles}[$i];
+ my $binaryfilepath = $binaryfile->{'sourcepath'};
+ my $binaryfilename = $binaryfilepath;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$binaryfilename);
+ installer::systemactions::copy_one_file($binaryfilepath, $destinationdir . $installer::globals::separator . "Binary" . $installer::globals::separator . $binaryfilename);
+ }
+
+ # Copying all new created and language independent idt-files to the destination $destinationdir.
+ # Example: "File.idt"
+
+ installer::systemactions::copy_directory_with_fileextension($newidtdir, $destinationdir, "idt");
+
+ # Copying all new created and language dependent idt-files to the destination $destinationdir.
+ # Example: "Feature.idt.01"
+
+ installer::systemactions::copy_directory_with_fileextension($newidtdir, $destinationdir, $onelanguage);
+ installer::systemactions::rename_files_with_fileextension($destinationdir, $onelanguage);
+
+}
+
+##############################################################
+# Returning the source path of the rtf licensefile for
+# a specified language
+##############################################################
+
+sub get_rtflicensefilesource
+{
+ my ($language, $includepatharrayref) = @_;
+
+ my $licensefilename = "license_" . $language . ".rtf";
+
+ my $sourcefileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$licensefilename, $includepatharrayref, 1);
+
+ if ($$sourcefileref eq "") { installer::exiter::exit_program("ERROR: Could not find $licensefilename!", "get_rtflicensefilesource"); }
+
+ my $infoline = "Using licensefile: $$sourcefileref\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return $$sourcefileref;
+}
+
+##############################################################
+# Returning the source path of the licensefile for
+# a specified language
+##############################################################
+
+sub get_licensefilesource
+{
+ my ($language, $filesref) = @_;
+
+ my $licensefilename = "license_" . $language . ".txt";
+ my $sourcepath = "";
+ my $foundlicensefile = 0;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ my $filename = $onefile->{'Name'};
+
+ if ($filename eq $licensefilename)
+ {
+ $sourcepath = $onefile->{'sourcepath'};
+ $foundlicensefile = 1;
+ last;
+ }
+ }
+
+ if ( ! $foundlicensefile ) { installer::exiter::exit_program("ERROR: Did not find file $licensefilename in file collector!", "get_licensefilesource"); }
+
+ return $sourcepath;
+}
+
+##############################################################
+# A simple converter to create the license text
+# in rtf format
+##############################################################
+
+sub get_rtf_licensetext
+{
+ my ($licensefile) = @_;
+
+ # A very simple rtf converter
+
+ # The static header
+
+ my $rtf_licensetext = '{\rtf1\ansi\deff0';
+ $rtf_licensetext = $rtf_licensetext . '{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}}';
+ $rtf_licensetext = $rtf_licensetext . '{\colortbl\red0\green0\blue0;\red255\green255\blue255;\red128\green128\blue128;}';
+ $rtf_licensetext = $rtf_licensetext . '{\stylesheet{\s1\snext1 Standard;}}';
+ $rtf_licensetext = $rtf_licensetext . '{\info{\comment StarWriter}{\vern5690}}\deftab709';
+ $rtf_licensetext = $rtf_licensetext . '{\*\pgdsctbl';
+ $rtf_licensetext = $rtf_licensetext . '{\pgdsc0\pgdscuse195\pgwsxn11905\pghsxn16837\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Standard;}}';
+ $rtf_licensetext = $rtf_licensetext . '\paperh16837\paperw11905\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgwsxn11905\pghsxn16837\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc';
+ $rtf_licensetext = $rtf_licensetext . '\pard\plain \s1';
+
+ for ( my $i = 0; $i <= $#{$licensefile}; $i++ )
+ {
+ my $oneline = ${$licensefile}[$i];
+ # if ( $oneline =~ /^\s*$/ ) { $oneline = '\par'; } # empty lines
+
+ if ( $i == 0 ) { $oneline =~ s/^\W*//; }
+
+ $oneline =~ s/\t/ /g; # no tabs allowed, converting to four spaces
+ $oneline =~ s/\n$//g; # no newline at line end
+
+# $oneline =~ s/ä/\\\'e4/g; # converting "ä"
+# $oneline =~ s/ö/\\\'f6/g; # converting "ö"
+# $oneline =~ s/ü/\\\'fc/g; # converting "ü"
+# $oneline =~ s/ß/\\\'df/g; # converting "ß"
+
+ # german replacements
+
+ $oneline =~ s/\Ã\„/\\\'c4/g; # converting "Ä"
+ $oneline =~ s/\Ã\–/\\\'d6/g; # converting "Ö"
+ $oneline =~ s/\Ã\œ/\\\'dc/g; # converting "Ü"
+ $oneline =~ s/\Ã\¤/\\\'e4/g; # converting "ä"
+ $oneline =~ s/\Ã\¶/\\\'f6/g; # converting "ö"
+ $oneline =~ s/\Ã\¼/\\\'fc/g; # converting "ü"
+ $oneline =~ s/\Ã\Ÿ/\\\'df/g; # converting "ß"
+
+ # french replacements
+
+ $oneline =~ s/\Ã\‰/\\\'c9/g;
+ $oneline =~ s/\Ã\€/\\\'c0/g;
+ $oneline =~ s/\Â\«/\\\'ab/g;
+ $oneline =~ s/\Â\»/\\\'bb/g;
+ $oneline =~ s/\Ã\©/\\\'e9/g;
+ $oneline =~ s/\Ã\¨/\\\'e8/g;
+ $oneline =~ s/\Ã\ /\\\'e0/g;
+ $oneline =~ s/\Ã\´/\\\'f4/g;
+ $oneline =~ s/\Ã\§/\\\'e7/g;
+ $oneline =~ s/\Ã\ª/\\\'ea/g;
+ $oneline =~ s/\Ã\Š/\\\'ca/g;
+ $oneline =~ s/\Ã\»/\\\'fb/g;
+ $oneline =~ s/\Ã\¹/\\\'f9/g;
+ $oneline =~ s/\Ã\®/\\\'ee/g;
+
+ # quotation marks
+
+ $oneline =~ s/\â\€\ž/\\\'84/g;
+ $oneline =~ s/\â\€\œ/\\ldblquote/g;
+ $oneline =~ s/\â\€\™/\\rquote/g;
+
+
+ $oneline =~ s/\Â\ /\\\~/g;
+
+ $oneline = '\par ' . $oneline;
+
+ $rtf_licensetext = $rtf_licensetext . $oneline;
+ }
+
+ # and the end
+
+ $rtf_licensetext = $rtf_licensetext . '\par \par }';
+
+ return $rtf_licensetext;
+}
+
+##############################################################
+# A simple converter to create a license txt string from
+# the rtf format
+##############################################################
+
+sub make_string_licensetext
+{
+ my ($licensefile) = @_;
+
+ my $rtf_licensetext = "";
+
+ for ( my $i = 0; $i <= $#{$licensefile}; $i++ )
+ {
+ my $oneline = ${$licensefile}[$i];
+ $oneline =~ s/\s*$//g; # no whitespace at line end
+
+ $rtf_licensetext = $rtf_licensetext . $oneline . " ";
+ }
+
+ return $rtf_licensetext;
+}
+
+##############################################################
+# Setting the path, where the soffice.exe is installed, into
+# the CustomAction table
+##############################################################
+
+sub add_officedir_to_database
+{
+ my ($basedir, $allvariables) = @_;
+
+ my $customactionfilename = $basedir . $installer::globals::separator . "CustomAc.idt";
+
+ my $customacfile = installer::files::read_file($customactionfilename);
+
+ my $found = 0;
+
+ # Updating the values
+
+ if ( $installer::globals::officeinstalldirectoryset )
+ {
+ $found = 0;
+
+ for ( my $i = 0; $i <= $#{$customacfile}; $i++ )
+ {
+ if ( ${$customacfile}[$i] =~ /\bOFFICEDIRECTORYGID\b/ )
+ {
+ ${$customacfile}[$i] =~ s/\bOFFICEDIRECTORYGID\b/$installer::globals::officeinstalldirectory/;
+ $found = 1;
+ }
+ }
+
+ if (( ! $found ) && ( ! $allvariables->{'IGNOREDIRECTORYLAYER'} ))
+ {
+ installer::exiter::exit_program("ERROR: \"OFFICEDIRECTORYGID\" not found in \"$customactionfilename\" !", "add_officedir_to_database");
+ }
+ }
+
+ # Saving the file
+
+ installer::files::save_file($customactionfilename ,$customacfile);
+ my $infoline = "Updated idt file: $customactionfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+##############################################################
+# Including the license text into the table control.idt
+##############################################################
+
+sub add_licensefile_to_database
+{
+ my ($licensefile, $controltable) = @_;
+
+ # Nine tabs before the license text and two tabs after it
+ # The license text has to be included into the dialog
+ # LicenseAgreement into the control Memo.
+
+ my $foundlicenseline = 0;
+ my ($number, $line);
+
+ for ( my $i = 0; $i <= $#{$controltable}; $i++ )
+ {
+ $line = ${$controltable}[$i];
+
+ if ( $line =~ /^\s*\bLicenseAgreement\b\t\bMemo\t/ )
+ {
+ $foundlicenseline = 1;
+ $number = $i;
+ last;
+ }
+ }
+
+ if (!($foundlicenseline))
+ {
+ installer::exiter::exit_program("ERROR: Line for license file in Control.idt not found!", "add_licensefile_to_database");
+ }
+ else
+ {
+ my %control = ();
+
+ if ( $line =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ $control{'Dialog_'} = $1;
+ $control{'Control'} = $2;
+ $control{'Type'} = $3;
+ $control{'X'} = $4;
+ $control{'Y'} = $5;
+ $control{'Width'} = $6;
+ $control{'Height'} = $7;
+ $control{'Attributes'} = $8;
+ $control{'Property'} = $9;
+ $control{'Text'} = $10;
+ $control{'Control_Next'} = $11;
+ $control{'Help'} = $12;
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: Could not split line correctly!", "add_licensefile_to_database");
+ }
+
+ # my $licensetext = get_rtf_licensetext($licensefile);
+ my $licensetext = make_string_licensetext($licensefile);
+
+ $control{'Text'} = $licensetext;
+
+ my $newline = $control{'Dialog_'} . "\t" . $control{'Control'} . "\t" . $control{'Type'} . "\t" .
+ $control{'X'} . "\t" . $control{'Y'} . "\t" . $control{'Width'} . "\t" .
+ $control{'Height'} . "\t" . $control{'Attributes'} . "\t" . $control{'Property'} . "\t" .
+ $control{'Text'} . "\t" . $control{'Control_Next'} . "\t" . $control{'Help'} . "\n";
+
+ ${$controltable}[$number] = $newline
+ }
+}
+
+################################################################################################
+# Including the checkboxes for the language selection dialog
+# into the table control.idt . This is only relevant for
+# multilingual installation sets.
+#
+# old:
+# LanguageSelection CheckBox1 CheckBox 22 60 15 24 3 IS1033 CheckBox2
+# LanguageSelection Text1 Text 40 60 70 15 65539 OOO_CONTROL_LANG_1033
+# LanguageSelection CheckBox2 CheckBox 22 90 15 24 3 IS1031 Next
+# LanguageSelection Text2 Text 40 90 70 15 65539 OOO_CONTROL_LANG_1031
+# new:
+# LanguageSelection CheckBox1 CheckBox 22 60 15 24 3 IS1033 Text CheckBox2
+# LanguageSelection CheckBox2 CheckBox 22 90 15 24 3 IS1031 Text Next
+################################################################################################
+
+sub add_language_checkboxes_to_database
+{
+ my ($controltable, $languagesarrayref) = @_;
+
+ # for each language, two lines have to be inserted
+
+ for ( my $i = 0; $i <= $#{$languagesarrayref}; $i++ )
+ {
+ my $last = 0;
+ if ( $i == $#{$languagesarrayref} ) { $last = 1; } # special handling for the last
+
+ my $onelanguage = ${$languagesarrayref}[$i];
+ my $windowslanguage = installer::windows::language::get_windows_language($onelanguage);
+
+ # my $is_english = 0;
+ # if ( $windowslanguage eq "1033" ) { $is_english = 1; }
+
+ my $checkboxattribute = "3";
+ # if ( $is_english ) { $checkboxattribute = "1"; } # english is not deselectable
+
+ my $count = $i + 1;
+ my $nextcount = $i + 2;
+ my $checkboxcount = "CheckBox" . $count;
+
+ my $multiplier = 20;
+ my $offset = 60;
+ if ( $#{$languagesarrayref} > 7 )
+ {
+ $multiplier = 15; # smaller differences for more than 7 languages
+ $offset = 50; # smaller offset for more than 7 languages
+ }
+
+ my $yvalue = $offset + $i * $multiplier;
+
+ my $property = "IS" . $windowslanguage;
+ # if ( ! exists($installer::globals::languageproperties{$property}) ) { installer::exiter::exit_program("ERROR: Could not find property \"$property\" in the list of language properties!", "add_language_checkboxes_to_database"); }
+
+ my $controlnext = "";
+ if ( $last ) { $controlnext = "Next"; }
+ else { $controlnext = "CheckBox" . $nextcount; }
+
+ my $stringname = "OOO_CONTROL_LANG_" . $windowslanguage;
+
+ my $line1 = "LanguageSelection" . "\t" . $checkboxcount . "\t" . "CheckBox" . "\t" .
+ "22" . "\t" . $yvalue . "\t" . "200" . "\t" . "15" . "\t" . $checkboxattribute . "\t" .
+ $property . "\t" . $stringname . "\t" . $controlnext . "\t" . "\n";
+
+ push(@{$controltable}, $line1);
+
+ # my $textcount = "Text" . $count;
+ # my $stringname = "OOO_CONTROL_LANG_" . $windowslanguage;
+ #
+ # $yvalue = $yvalue + 2; # text 2 pixel lower than checkbox
+ #
+ # my $line2 = "LanguageSelection" . "\t" . $textcount . "\t" . "Text" . "\t" .
+ # "40" . "\t" . $yvalue . "\t" . "70" . "\t" . "15" . "\t" . "65539" . "\t" .
+ # "\t" . $stringname . "\t" . "\t" . "\n";
+ #
+ # push(@{$controltable}, $line2);
+ }
+}
+
+###################################################################
+# Determining the last position in a sequencetable
+# into the tables CustomAc.idt and InstallE.idt.
+###################################################################
+
+sub get_last_position_in_sequencetable
+{
+ my ($sequencetable) = @_;
+
+ my $position = 0;
+
+ for ( my $i = 0; $i <= $#{$sequencetable}; $i++ )
+ {
+ my $line = ${$sequencetable}[$i];
+
+ if ( $line =~ /^\s*\w+\t.*\t\s*(\d+)\s$/ )
+ {
+ my $newposition = $1;
+ if ( $newposition > $position ) { $position = $newposition; }
+ }
+ }
+
+ return $position;
+}
+
+#########################################################################
+# Determining the position of a specified Action in the sequencetable
+#########################################################################
+
+sub get_position_in_sequencetable
+{
+ my ($action, $sequencetable) = @_;
+
+ my $position = 0;
+
+ $action =~ s/^\s*behind_//;
+
+ for ( my $i = 0; $i <= $#{$sequencetable}; $i++ )
+ {
+ my $line = ${$sequencetable}[$i];
+
+ if ( $line =~ /^\s*(\w+)\t.*\t\s*(\d+)\s$/ )
+ {
+ my $compareaction = $1;
+ $position = $2;
+ if ( $compareaction eq $action ) { last; }
+ }
+ }
+
+ return $position;
+}
+
+################################################################################################
+# Including the CustomAction for the configuration
+# into the tables CustomAc.idt and InstallE.idt.
+#
+# CustomAc.idt: ExecutePkgchk 82 pkgchk.exe -s
+# InstallE.idt: ExecutePkgchk Not REMOVE="ALL" 3175
+#
+# CustomAc.idt: ExecuteQuickstart 82 install_quickstart.exe
+# InstallE.idt: ExecuteQuickstart &gm_o_Quickstart=3 3200
+#
+# CustomAc.idt: ExecuteInstallRegsvrex 82 regsvrex.exe shlxthdl.dll
+# InstallE.idt: ExecuteInstallRegsvrex Not REMOVE="ALL" 3225
+#
+# CustomAc.idt: ExecuteUninstallRegsvrex 82 regsvrex.exe /u shlxthdl.dll
+# InstallE.idt: ExecuteUninstallRegsvrex REMOVE="ALL" 690
+#
+# CustomAc.idt: Regmsdocmsidll1 1 reg4msdocmsidll Reg4MsDocEntry
+# InstallU.idt: Regmsdocmsidll1 Not REMOVE="ALL" 610
+#
+# CustomAc.idt: Regmsdocmsidll2 1 reg4msdocmsidll Reg4MsDocEntry
+# InstallE.idt: Regmsdocmsidll2 Not REMOVE="ALL" 3160
+################################################################################################
+
+sub set_custom_action
+{
+ my ($customactionidttable, $actionname, $actionflags, $exefilename, $actionparameter, $inbinarytable, $filesref, $customactionidttablename, $styles) = @_;
+
+ my $included_customaction = 0;
+ my $infoline = "";
+ my $customaction_exefilename = $exefilename;
+ my $uniquename = "";
+
+ # when the style NO_FILE is set, no searching for the file is needed, no filtering is done, we can add that custom action
+ if ( $styles =~ /\bNO_FILE\b/ )
+ {
+ my $line = $actionname . "\t" . $actionflags . "\t" . $customaction_exefilename . "\t" . $actionparameter . "\n";
+ push(@{$customactionidttable}, $line);
+
+ $infoline = "Added $actionname CustomAction into table $customactionidttablename (NO_FILE has been set)\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ $included_customaction = 1;
+ return $included_customaction;
+ }
+
+ # is the $exefilename a library that is included into the binary table
+
+ if ( $inbinarytable ) { $customaction_exefilename =~ s/\.//; } # this is the entry in the binary table ("abc.dll" -> "abcdll")
+
+ # is the $exefilename included into the product?
+
+ my $contains_file = 0;
+
+ # All files are located in $filesref and in @installer::globals::binarytableonlyfiles.
+ # Both must be added together
+ my $localfilesref = installer::converter::combine_arrays_from_references(\@installer::globals::binarytableonlyfiles, $filesref);
+
+ for ( my $i = 0; $i <= $#{$localfilesref}; $i++ )
+ {
+ my $onefile = ${$localfilesref}[$i];
+ my $filename = "";
+ if ( exists($onefile->{'Name'}) )
+ {
+ $filename = $onefile->{'Name'};
+
+ if ( $filename eq $exefilename )
+ {
+ $contains_file = 1;
+ $uniquename = ${$localfilesref}[$i]->{'uniquename'};
+ last;
+ }
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: Did not find \"Name\" for file \"$onefile->{'uniquename'}\" ($onefile->{'gid'})!", "set_custom_action");
+ }
+ }
+
+ if ( $contains_file )
+ {
+ # Now the CustomAction can be included into the CustomAc.idt
+
+ if ( ! $inbinarytable ) { $customaction_exefilename = $uniquename; } # the unique file name has to be added to the custom action table
+
+ my $line = $actionname . "\t" . $actionflags . "\t" . $customaction_exefilename . "\t" . $actionparameter . "\n";
+ push(@{$customactionidttable}, $line);
+
+ $included_customaction = 1;
+ }
+
+ if ( $included_customaction ) { $infoline = "Added $actionname CustomAction into table $customactionidttablename\n"; }
+ else { $infoline = "Did not add $actionname CustomAction into table $customactionidttablename\n"; }
+ push(@installer::globals::logfileinfo, $infoline);
+
+ return $included_customaction;
+}
+
+####################################################################
+# Adding a Custom Action to InstallExecuteTable or InstallUITable
+####################################################################
+
+sub add_custom_action_to_install_table
+{
+ my ($installtable, $exefilename, $actionname, $actioncondition, $position, $filesref, $installtablename, $styles) = @_;
+
+ my $included_customaction = 0;
+ my $feature = "";
+ my $infoline = "";
+
+ # when the style NO_FILE is set, no searching for the file is needed, no filtering is done, we can add that custom action
+ if ( $styles =~ /\bNO_FILE\b/ )
+ {
+ # then the InstallE.idt.idt or InstallU.idt.idt
+ $actioncondition =~ s/FEATURETEMPLATE/$feature/g; # only execute Custom Action, if feature of the file is installed
+
+ my $actionposition = 0;
+
+ if ( $position eq "end" ) { $actionposition = get_last_position_in_sequencetable($installtable) + 25; }
+ elsif ( $position =~ /^\s*behind_/ ) { $actionposition = get_position_in_sequencetable($position, $installtable) + 2; }
+ else { $actionposition = get_position_in_sequencetable($position, $installtable) - 2; }
+
+ my $line = $actionname . "\t" . $actioncondition . "\t" . $actionposition . "\n";
+ push(@{$installtable}, $line);
+
+ $infoline = "Added $actionname CustomAction into table $installtablename (NO_FILE has been set)\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ return;
+ }
+
+ my $contains_file = 0;
+
+ # All files are located in $filesref and in @installer::globals::binarytableonlyfiles.
+ # Both must be added together
+ my $localfilesref = installer::converter::combine_arrays_from_references(\@installer::globals::binarytableonlyfiles, $filesref);
+
+ for ( my $i = 0; $i <= $#{$localfilesref}; $i++ )
+ {
+ my $filename = ${$localfilesref}[$i]->{'Name'};
+
+ if ( $filename eq $exefilename )
+ {
+ $contains_file = 1;
+
+ # Determining the feature of the file
+
+ if ( ${$localfilesref}[$i] ) { $feature = ${$localfilesref}[$i]->{'modules'}; }
+
+ # If modules contains a list of modules, only taking the first one.
+ if ( $feature =~ /^\s*(.*?)\,/ ) { $feature = $1; }
+ # Attention: Maximum feature length is 38!
+ shorten_feature_gid(\$feature);
+
+ last;
+ }
+ }
+
+ if ( $contains_file )
+ {
+ # then the InstallE.idt.idt or InstallU.idt.idt
+
+ $actioncondition =~ s/FEATURETEMPLATE/$feature/g; # only execute Custom Action, if feature of the file is installed
+
+# my $actionposition = 0;
+# if ( $position eq "end" ) { $actionposition = get_last_position_in_sequencetable($installtable) + 25; }
+# elsif ( $position =~ /^\s*behind_/ ) { $actionposition = get_position_in_sequencetable($position, $installtable) + 2; }
+# else { $actionposition = get_position_in_sequencetable($position, $installtable) - 2; }
+# my $line = $actionname . "\t" . $actioncondition . "\t" . $actionposition . "\n";
+
+ my $positiontemplate = "";
+ if ( $position =~ /^\s*\d+\s*$/ ) { $positiontemplate = $position; } # setting the position directly, number defined in scp2
+ else { $positiontemplate = "POSITIONTEMPLATE_" . $position; }
+
+ my $line = $actionname . "\t" . $actioncondition . "\t" . $positiontemplate . "\n";
+ push(@{$installtable}, $line);
+
+ $included_customaction = 1;
+ }
+
+ if ( $included_customaction ) { $infoline = "Added $actionname CustomAction into table $installtablename\n"; }
+ else { $infoline = "Did not add $actionname CustomAction into table $installtablename\n"; }
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+##################################################################
+# A line in the table ControlEvent connects a Control
+# with a Custom Action
+#################################################################
+
+sub connect_custom_action_to_control
+{
+ my ( $table, $tablename, $dialog, $control, $event, $argument, $condition, $ordering) = @_;
+
+ my $line = $dialog . "\t" . $control. "\t" . $event. "\t" . $argument. "\t" . $condition. "\t" . $ordering . "\n";
+
+ push(@{$table}, $line);
+
+ $line =~ s/\s*$//g;
+
+ $infoline = "Added line \"$line\" into table $tablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+}
+
+##################################################################
+# A line in the table ControlCondition connects a Control state
+# with a condition
+##################################################################
+
+sub connect_condition_to_control
+{
+ my ( $table, $tablename, $dialog, $control, $event, $condition) = @_;
+
+ my $line = $dialog . "\t" . $control. "\t" . $event. "\t" . $condition. "\n";
+
+ push(@{$table}, $line);
+
+ $line =~ s/\s*$//g;
+
+ $infoline = "Added line \"$line\" into table $tablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+}
+
+##################################################################
+# Searching for a sequencenumber in InstallUISequence table
+# "ExecuteAction" must be the last action
+##################################################################
+
+sub get_free_number_in_uisequence_table
+{
+ my ( $installuitable ) = @_;
+
+ # determining the sequence of "ExecuteAction"
+
+ my $executeactionnumber = 0;
+
+ for ( my $i = 0; $i <= $#{$installuitable}; $i++ )
+ {
+ if ( ${$installuitable}[$i] =~ /^\s*(\w+)\t\w*\t(\d+)\s*$/ )
+ {
+ my $actionname = $1;
+ my $actionnumber = $2;
+
+ if ( $actionname eq "ExecuteAction" )
+ {
+ $executeactionnumber = $actionnumber;
+ last;
+ }
+ }
+ }
+
+ if ( $executeactionnumber == 0 ) { installer::exiter::exit_program("ERROR: Did not find \"ExecuteAction\" in InstallUISequence table!", "get_free_number_in_uisequence_table"); }
+
+ # determining the sequence of the action before "ExecuteAction"
+
+ my $lastactionnumber = 0;
+
+ for ( my $i = 0; $i <= $#{$installuitable}; $i++ )
+ {
+ if ( ${$installuitable}[$i] =~ /^\s*\w+\t\w*\t(\d+)\s*$/ )
+ {
+ my $actionnumber = $1;
+
+ if (( $actionnumber > $lastactionnumber ) && ( $actionnumber != $executeactionnumber ))
+ {
+ $lastactionnumber = $actionnumber;
+ }
+ }
+ }
+
+ # the new number can now be calculated
+
+ my $newnumber = 0;
+
+ if ((( $lastactionnumber + $executeactionnumber ) % 2 ) == 0 ) { $newnumber = ( $lastactionnumber + $executeactionnumber ) / 2; }
+ else { $newnumber = ( $lastactionnumber + $executeactionnumber -1 ) / 2; }
+
+ return $newnumber;
+}
+
+##################################################################
+# Searching for a specified string in the feature table
+##################################################################
+
+sub get_feature_name
+{
+ my ( $string, $featuretable ) = @_;
+
+ my $featurename = "";
+
+ for ( my $i = 0; $i <= $#{$featuretable}; $i++ )
+ {
+ if ( ${$featuretable}[$i] =~ /^\s*(\w+$string)\t/ )
+ {
+ $featurename = $1;
+ last;
+ }
+ }
+
+ return $featurename;
+}
+
+######################################################################
+# Returning the toplevel directory name of one specific file
+######################################################################
+
+sub get_directory_name_from_file
+{
+ my ($onefile) = @_;
+
+ my $destination = $onefile->{'destination'};
+ my $name = $onefile->{'Name'};
+
+ $destination =~ s/\Q$name\E\s*$//;
+ $destination =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ my $path = "";
+
+ if ( $destination =~ /\Q$installer::globals::separator\E/ )
+ {
+ if ( $destination =~ /^\s*(\S.*\S\Q$installer::globals::separator\E)(\S.+\S?)/ )
+ {
+ $path = $2;
+ }
+ }
+ else
+ {
+ $path = $destination;
+ }
+
+ return $path;
+}
+
+#############################################################
+# Including the new subdir into the directory table
+#############################################################
+
+sub include_subdirname_into_directory_table
+{
+ my ($dirname, $directorytable, $directorytablename, $onefile) = @_;
+
+ my $subdir = "";
+ if ( $onefile->{'Subdir'} ) { $subdir = $onefile->{'Subdir'}; }
+ if ( $subdir eq "" ) { installer::exiter::exit_program("ERROR: No \"Subdir\" defined for $onefile->{'Name'}", "include_subdirname_into_directory_table"); }
+
+ # program INSTALLLOCATION program -> subjava INSTALLLOCATION program:java
+
+ my $uniquename = "";
+ my $parent = "";
+ my $name = "";
+
+ my $includedline = 0;
+
+ my $newdir = "";
+
+ for ( my $i = 0; $i <= $#{$directorytable}; $i++ )
+ {
+
+ if ( ${$directorytable}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ $uniquename = $1;
+ $parent = $2;
+ $name = $3;
+
+ if ( $dirname eq $name )
+ {
+ my $newuniquename = "sub" . $subdir;
+ $newdir = $newuniquename;
+ # my $newparent = $parent;
+ my $newparent = "INSTALLLOCATION";
+ my $newname = $name . "\:" . $subdir;
+ my $newline =
+ $line = "$newuniquename\t$newparent\t$newname\n";
+ push(@{$directorytable}, $line);
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ $infoline = "Added $line into directory table $directorytablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ $includedline = 1;
+ last;
+ }
+ }
+ }
+
+ if ( ! $includedline ) { installer::exiter::exit_program("ERROR: Could not include new subdirectory into directory table for file $onefile->{'Name'}!", "include_subdirname_into_directory_table"); }
+
+ return $newdir;
+}
+
+##################################################################
+# Including the new sub directory into the component table
+##################################################################
+
+sub include_subdir_into_componenttable
+{
+ my ($subdir, $onefile, $componenttable) = @_;
+
+ my $componentname = $onefile->{'componentname'};
+
+ my $changeddirectory = 0;
+
+ for ( my $i = 0; $i <= $#{$componenttable}; $i++ )
+ {
+ if ( ${$componenttable}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my $localcomponentname = $1;
+ my $directory = $3;
+
+ if ( $componentname eq $localcomponentname )
+ {
+ my $oldvalue = ${$componenttable}[$i];
+ ${$componenttable}[$i] =~ s/\b\Q$directory\E\b/$subdir/;
+ my $newvalue = ${$componenttable}[$i];
+
+ installer::remover::remove_leading_and_ending_whitespaces(\$oldvalue);
+ installer::remover::remove_leading_and_ending_whitespaces(\$newvalue);
+ $infoline = "Change in Component table: From \"$oldvalue\" to \"$newvalue\"\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ $changeddirectory = 1;
+ last;
+ }
+ }
+ }
+
+ if ( ! $changeddirectory ) { installer::exiter::exit_program("ERROR: Could not change directory for component: $onefile->{'Name'}!", "include_subdir_into_componenttable"); }
+
+}
+
+################################################################################################
+# Including the content for the child installations
+# into the tables:
+# CustomAc.idt, InstallU.idt, Feature.idt
+################################################################################################
+
+sub add_childprojects
+{
+ my ($languageidtdir, $filesref, $allvariables) = @_;
+
+ my $customactiontablename = $languageidtdir . $installer::globals::separator . "CustomAc.idt";
+ my $customactiontable = installer::files::read_file($customactiontablename);
+ my $installuitablename = $languageidtdir . $installer::globals::separator . "InstallU.idt";
+ my $installuitable = installer::files::read_file($installuitablename);
+ my $featuretablename = $languageidtdir . $installer::globals::separator . "Feature.idt";
+ my $featuretable = installer::files::read_file($featuretablename);
+ my $directorytablename = $languageidtdir . $installer::globals::separator . "Director.idt";
+ my $directorytable = installer::files::read_file($directorytablename);
+ my $componenttablename = $languageidtdir . $installer::globals::separator . "Componen.idt";
+ my $componenttable = installer::files::read_file($componenttablename);
+
+ my $infoline = "";
+ my $line = "";
+
+ $installer::globals::javafile = installer::worker::return_first_item_with_special_flag($filesref ,"JAVAFILE");
+ $installer::globals::urefile = installer::worker::return_first_item_with_special_flag($filesref ,"UREFILE");
+
+ if (( $installer::globals::javafile eq "" ) && ( $allvariables->{'JAVAPRODUCT'} )) { installer::exiter::exit_program("ERROR: No JAVAFILE found in files collector!", "add_childprojects"); }
+ if (( $installer::globals::urefile eq "" ) && ( $allvariables->{'UREPRODUCT'} )) { installer::exiter::exit_program("ERROR: No UREFILE found in files collector!", "add_childprojects"); }
+
+ # Content for Directory table
+ # SystemFolder TARGETDIR .
+
+ my $contains_systemfolder = 0;
+
+ for ( my $i = 0; $i <= $#{$directorytable}; $i++ )
+ {
+ if ( ${$directorytable}[$i] =~ /^\s*SystemFolder\t/ )
+ {
+ $contains_systemfolder = 1;
+ last;
+ }
+ }
+
+ if ( ! $contains_systemfolder )
+ {
+ $line = "SystemFolder\tTARGETDIR\t\.\n";
+ push(@{$directorytable}, $line);
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ $infoline = "Added $line into table $directorytablename\n";
+ }
+ else
+ {
+ $infoline = "SystemFolder already exists in table $directorytablename\n";
+ }
+
+ push(@installer::globals::logfileinfo, $infoline);
+
+ # Additional content for the directory table
+ # subjava INSTALLLOCATION program:java
+ # subure INSTALLLOCATION program:ure
+
+ my $dirname = "";
+ my $subjavadir = "";
+ my $suburedir = "";
+
+ if ( $allvariables->{'JAVAPRODUCT'} )
+ {
+ $dirname = get_directory_name_from_file($installer::globals::javafile);
+ $subjavadir = include_subdirname_into_directory_table($dirname, $directorytable, $directorytablename, $installer::globals::javafile);
+ }
+
+ if ( $allvariables->{'UREPRODUCT'} )
+ {
+ $dirname = get_directory_name_from_file($installer::globals::urefile);
+ $suburedir = include_subdirname_into_directory_table($dirname, $directorytable, $directorytablename, $installer::globals::urefile);
+ }
+
+ # Content for the Component table
+ # The Java and Ada components have new directories
+
+ if ( $allvariables->{'JAVAPRODUCT'} ) { include_subdir_into_componenttable($subjavadir, $installer::globals::javafile, $componenttable); }
+ if ( $allvariables->{'UREPRODUCT'} ) { include_subdir_into_componenttable($suburedir, $installer::globals::urefile, $componenttable); }
+
+ # Content for CustomAction table
+
+ if ( $allvariables->{'JAVAPRODUCT'} )
+ {
+ $line = "InstallJava\t98\tSystemFolder\t[SourceDir]$installer::globals::javafile->{'Subdir'}\\$installer::globals::javafile->{'Name'} \/qb REBOOT=Suppress SPONSORS=0 DISABLEAD=1\n";
+ push(@{$customactiontable} ,$line);
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ $infoline = "Added $line into table $customactiontablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( $allvariables->{'UREPRODUCT'} )
+ {
+ $line = "InstallUre\t98\tSystemFolder\t$installer::globals::urefile->{'Subdir'}\\$installer::globals::urefile->{'Name'} /S\n";
+ push(@{$customactiontable} ,$line);
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ $infoline = "Added $line into table $customactiontablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( $allvariables->{'JAVAPRODUCT'} )
+ {
+ $line = "MaintenanceJava\t82\t$installer::globals::javafile->{'uniquename'}\t\/qb REBOOT=Suppress SPONSORS=0 DISABLEAD=1\n";
+ push(@{$customactiontable} ,$line);
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ $infoline = "Added $line into table $customactiontablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( $allvariables->{'UREPRODUCT'} )
+ {
+ $line = "MaintenanceUre\t82\t$installer::globals::urefile->{'uniquename'}\t\/S\n";
+ push(@{$customactiontable} ,$line);
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ $infoline = "Added $line into table $customactiontablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ # Content for InstallUISequence table
+ # InstallAdabas &gm_o_Adabas=3 825
+ # InstallJava &gm_o_Java=3 827
+
+ my $number = "";
+ my $featurename = "";
+
+ if ( $allvariables->{'ADAPRODUCT'} )
+ {
+ $number = get_free_number_in_uisequence_table($installuitable);
+ $featurename = get_feature_name("_Adabas", $featuretable);
+ $line = "InstallAdabas\t\&$featurename\=3 And Not Installed And Not PATCH\t$number\n";
+ push(@{$installuitable} ,$line);
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ $infoline = "Added $line into table $installuitablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( $allvariables->{'JAVAPRODUCT'} )
+ {
+ $number = get_free_number_in_uisequence_table($installuitable) + 2;
+ $featurename = get_feature_name("_Java", $featuretable);
+ if ( $featurename ) { $line = "InstallJava\t\&$featurename\=3 And Not Installed And JAVAPATH\=\"\" And Not PATCH\t$number\n"; }
+ else { $line = "InstallJava\tNot Installed And JAVAPATH\=\"\" And Not PATCH\t$number\n"; } # feature belongs to root
+ push(@{$installuitable} ,$line);
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ $infoline = "Added $line into table $installuitablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( $allvariables->{'ADAPRODUCT'} )
+ {
+ $number = get_free_number_in_uisequence_table($installuitable) + 4;
+ $featurename = get_feature_name("_Adabas", $featuretable);
+ $line = "MaintenanceAdabas\t\&$featurename\=3 And Installed And Not PATCH\t$number\n";
+ push(@{$installuitable} ,$line);
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ $infoline = "Added $line into table $installuitablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( $allvariables->{'JAVAPRODUCT'} )
+ {
+ $number = get_free_number_in_uisequence_table($installuitable) + 6;
+ $featurename = get_feature_name("_Java", $featuretable);
+ if ( $featurename ) { $line = "MaintenanceJava\t\&$featurename\=3 And Installed And JAVAPATH\=\"\" And Not PATCH\t$number\n"; }
+ else { $line = "MaintenanceJava\tInstalled And JAVAPATH\=\"\" And Not PATCH\t$number\n"; } # feature belongs to root
+ push(@{$installuitable} ,$line);
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ $infoline = "Added $line into table $installuitablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( $allvariables->{'UREPRODUCT'} )
+ {
+ $number = get_free_number_in_uisequence_table($installuitable) + 8;
+ $featurename = get_feature_name("_Ure", $featuretable);
+ if ( $featurename ) { $line = "InstallUre\t\&$featurename\=3 And Not Installed\t$number\n"; }
+ else { $line = "InstallUre\tNot Installed\t$number\n"; } # feature belongs to root
+ push(@{$installuitable} ,$line);
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ $infoline = "Added $line into table $installuitablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( $allvariables->{'UREPRODUCT'} )
+ {
+ $number = get_free_number_in_uisequence_table($installuitable) + 10;
+ $featurename = get_feature_name("_Ure", $featuretable);
+ if ( $featurename ) { $line = "MaintenanceUre\t\&$featurename\=3 And Installed\t$number\n"; }
+ else { $line = "MaintenanceUre\tInstalled\t$number\n"; } # feature belongs to root
+ push(@{$installuitable} ,$line);
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ $infoline = "Added $line into table $installuitablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ # Content for Feature table, better from scp (translation)
+ # gm_o_java gm_optional Java 1.4.2 Description 2 200
+
+ installer::files::save_file($customactiontablename, $customactiontable);
+ installer::files::save_file($installuitablename, $installuitable);
+ installer::files::save_file($featuretablename, $featuretable);
+ installer::files::save_file($directorytablename, $directorytable);
+ installer::files::save_file($componenttablename, $componenttable);
+}
+
+##################################################################
+# Setting the encoding in all idt files. Replacing the
+# variable WINDOWSENCODINGTEMPLATE
+##################################################################
+
+sub setencoding
+{
+ my ( $languageidtdir, $onelanguage ) = @_;
+
+ my $encoding = installer::windows::language::get_windows_encoding($onelanguage);
+
+ # collecting all idt files in the directory $languageidtdir and substituting the string
+
+ my $idtfiles = installer::systemactions::find_file_with_file_extension("idt", $languageidtdir);
+
+ for ( my $i = 0; $i <= $#{$idtfiles}; $i++ )
+ {
+ my $onefilename = $languageidtdir . $installer::globals::separator . ${$idtfiles}[$i];
+ my $onefile = installer::files::read_file($onefilename);
+
+ for ( my $j = 0; $j <= $#{$onefile}; $j++ )
+ {
+ ${$onefile}[$j] =~ s/WINDOWSENCODINGTEMPLATE/$encoding/g;
+ }
+
+ installer::files::save_file($onefilename, $onefile);
+ }
+}
+
+##################################################################
+# Setting the condition, that at least one module is selected.
+# All modules with flag SHOW_MULTILINGUAL_ONLY were already
+# collected. In table ControlE.idt, the string
+# LANGUAGECONDITIONINSTALL needs to be replaced.
+# Also for APPLICATIONCONDITIONINSTALL for the applications
+# with flag APPLICATIONMODULE.
+##################################################################
+
+sub set_multilanguageonly_condition
+{
+ my ( $languageidtdir ) = @_;
+
+ my $onefilename = $languageidtdir . $installer::globals::separator . "ControlE.idt";
+ my $onefile = installer::files::read_file($onefilename);
+
+ # Language modules
+
+ my $condition = "";
+
+ foreach my $module ( sort keys %installer::globals::multilingual_only_modules )
+ {
+ $condition = $condition . " &$module=3 Or";
+ }
+
+ $condition =~ s/^\s*//;
+ $condition =~ s/\s*Or\s*$//; # removing the ending "Or"
+
+ if ( $condition eq "" ) { $condition = "1"; }
+
+ for ( my $j = 0; $j <= $#{$onefile}; $j++ )
+ {
+ ${$onefile}[$j] =~ s/LANGUAGECONDITIONINSTALL/$condition/;
+ }
+
+ # Application modules
+
+ $condition = "";
+
+ foreach my $module ( sort keys %installer::globals::application_modules )
+ {
+ $condition = $condition . " &$module=3 Or";
+ }
+
+ $condition =~ s/^\s*//;
+ $condition =~ s/\s*Or\s*$//; # removing the ending "Or"
+
+ if ( $condition eq "" ) { $condition = "1"; }
+
+ for ( my $j = 0; $j <= $#{$onefile}; $j++ )
+ {
+ ${$onefile}[$j] =~ s/APPLICATIONCONDITIONINSTALL/$condition/;
+ }
+
+ installer::files::save_file($onefilename, $onefile);
+}
+
+#############################################
+# Putting array values into hash
+#############################################
+
+sub fill_assignment_hash
+{
+ my ($gid, $name, $key, $assignmenthashref, $parameter, $tablename, $assignmentarray) = @_;
+
+ my $max = $parameter - 1;
+
+ if ( $max != $#{$assignmentarray} )
+ {
+ my $definedparameter = $#{$assignmentarray} + 1;
+ installer::exiter::exit_program("ERROR: gid: $gid, key: $key ! Wrong parameter in scp. For table $tablename $parameter parameter are required ! You defined: $definedparameter", "fill_assignment_hash");
+ }
+
+ for ( my $i = 0; $i <= $#{$assignmentarray}; $i++ )
+ {
+ my $counter = $i + 1;
+ my $key = "parameter". $counter;
+
+ my $localvalue = ${$assignmentarray}[$i];
+ installer::remover::remove_leading_and_ending_quotationmarks(\$localvalue);
+ $localvalue =~ s/\\\"/\"/g;
+ $localvalue =~ s/\\\!/\!/g;
+ $localvalue =~ s/\\\&/\&/g;
+ $localvalue =~ s/\\\</\</g;
+ $localvalue =~ s/\\\>/\>/g;
+ $assignmenthashref->{$key} = $localvalue;
+ }
+}
+
+##########################################################################
+# Checking the assignment of a Windows CustomAction and putting it
+# into a hash
+##########################################################################
+
+sub create_customaction_assignment_hash
+{
+ my ($gid, $name, $key, $assignmentarray) = @_;
+
+ my %assignment = ();
+ my $assignmenthashref = \%assignment;
+
+ my $tablename = ${$assignmentarray}[0];
+ installer::remover::remove_leading_and_ending_quotationmarks(\$tablename);
+
+ my $tablename_defined = 0;
+ my $parameter = 0;
+
+ if ( $tablename eq "InstallUISequence" )
+ {
+ $tablename_defined = 1;
+ $parameter = 3;
+ fill_assignment_hash($gid, $name, $key, $assignmenthashref, $parameter, $tablename, $assignmentarray);
+ }
+
+ if ( $tablename eq "InstallExecuteSequence" )
+ {
+ $tablename_defined = 1;
+ $parameter = 3;
+ fill_assignment_hash($gid, $name, $key, $assignmenthashref, $parameter, $tablename, $assignmentarray);
+ }
+
+ if ( $tablename eq "AdminExecuteSequence" )
+ {
+ $tablename_defined = 1;
+ $parameter = 3;
+ fill_assignment_hash($gid, $name, $key, $assignmenthashref, $parameter, $tablename, $assignmentarray);
+ }
+
+ if ( $tablename eq "ControlEvent" )
+ {
+ $tablename_defined = 1;
+ $parameter = 7;
+ fill_assignment_hash($gid, $name, $key, $assignmenthashref, $parameter, $tablename, $assignmentarray);
+ }
+
+ if ( $tablename eq "ControlCondition" )
+ {
+ $tablename_defined = 1;
+ $parameter = 5;
+ fill_assignment_hash($gid, $name, $key, $assignmenthashref, $parameter, $tablename, $assignmentarray);
+ }
+
+ if ( ! $tablename_defined )
+ {
+ installer::exiter::exit_program("ERROR: gid: $gid, key: $key ! Unknown Windows CustomAction table: $tablename ! Currently supported: InstallUISequence, InstallExecuteSequence, ControlEvent, ControlCondition", "create_customaction_assignment_hash");
+ }
+
+ return $assignmenthashref;
+}
+
+##########################################################################
+# Finding the position of a specified CustomAction.
+# If the CustomAction is not found, the return value is "-1".
+# If the CustomAction position is not defined yet,
+# the return value is also "-1".
+##########################################################################
+
+sub get_customaction_position
+{
+ my ($action, $sequencetable) = @_;
+
+ my $position = -1;
+
+ for ( my $i = 0; $i <= $#{$sequencetable}; $i++ )
+ {
+ my $line = ${$sequencetable}[$i];
+
+ if ( $line =~ /^\s*([\w\.]+)\t.*\t\s*(\d+)\s$/ ) # matching only, if position is a number!
+ {
+ my $compareaction = $1;
+ my $localposition = $2;
+
+ if ( $compareaction eq $action )
+ {
+ $position = $localposition;
+ last;
+ }
+ }
+ }
+
+ return $position;
+}
+
+##########################################################################
+# Setting the position of CustomActions in sequence tables.
+# Replacing all occurences of "POSITIONTEMPLATE_"
+##########################################################################
+
+sub set_positions_in_table
+{
+ my ( $sequencetable, $tablename ) = @_;
+
+ my $infoline = "\nSetting positions in table \"$tablename\".\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ # Step 1: Resolving all occurences of "POSITIONTEMPLATE_end"
+
+ my $lastposition = get_last_position_in_sequencetable($sequencetable);
+
+ for ( my $i = 0; $i <= $#{$sequencetable}; $i++ )
+ {
+ if ( ${$sequencetable}[$i] =~ /^\s*([\w\.]+)\t.*\t\s*POSITIONTEMPLATE_end\s*$/ )
+ {
+ my $customaction = $1;
+ $lastposition = $lastposition + 25;
+ ${$sequencetable}[$i] =~ s/POSITIONTEMPLATE_end/$lastposition/;
+ $infoline = "Setting position \"$lastposition\" for custom action \"$customaction\".\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ # Step 2: Resolving all occurences of "POSITIONTEMPLATE_abc" or "POSITIONTEMPLATE_behind_abc"
+ # where abc is the name of the reference Custom Action.
+ # This has to be done, until there is no more occurence of POSITIONTEMPLATE (success)
+ # or there is no replacement in one circle (failure).
+
+ my $template_exists = 0;
+ my $template_replaced = 0;
+ my $counter = 0;
+
+ do
+ {
+ $template_exists = 0;
+ $template_replaced = 0;
+ $counter++;
+
+ for ( my $i = 0; $i <= $#{$sequencetable}; $i++ )
+ {
+ if ( ${$sequencetable}[$i] =~ /^\s*([\w\.]+)\t.*\t\s*(POSITIONTEMPLATE_.*?)\s*$/ )
+ {
+ my $onename = $1;
+ my $templatename = $2;
+ my $positionname = $templatename;
+ my $customaction = $templatename;
+ $customaction =~ s/POSITIONTEMPLATE_//;
+ $template_exists = 1;
+
+ # Trying to find the correct number.
+ # This can fail, if the custom action has no number
+
+ my $setbehind = 0;
+ if ( $customaction =~ /^\s*behind_(.*?)\s*$/ )
+ {
+ $customaction = $1;
+ $setbehind = 1;
+ }
+
+ my $position = get_customaction_position($customaction, $sequencetable);
+
+ if ( $position >= 0 ) # Found CustomAction and is has a position. Otherwise return value is "-1".
+ {
+ my $newposition = 0;
+ if ( $setbehind ) { $newposition = $position + 2; }
+ else { $newposition = $position - 2; }
+ ${$sequencetable}[$i] =~ s/$templatename/$newposition/;
+ $template_replaced = 1;
+ $infoline = "Setting position \"$newposition\" for custom action \"$onename\" (scp: \"$positionname\" at position $position).\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Could not assign position for custom action \"$onename\" yet (scp: \"$positionname\").\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+ } while (( $template_exists ) && ( $template_replaced ));
+
+ # An error occured, because templates still exist, but could not be replaced.
+ # Reason:
+ # 1. Wrong name of CustomAction in scp2 (typo?)
+ # 2. Circular dependencies of CustomActions (A after B and B after A)
+
+ # Problem: It is allowed, that a CustomAction is defined in scp2 in a library that is
+ # part of product ABC, but this CustomAction is not used in this product
+ # and the reference CustomAction is not part of this product.
+ # Therefore this cannot be an error, but only produce a warning. The assigned number
+ # must be the last sequence number.
+
+ if (( $template_exists ) && ( ! $template_replaced ))
+ {
+ # Giving a precise error message, collecting all unresolved templates
+ # my $templatestring = "";
+
+ for ( my $i = 0; $i <= $#{$sequencetable}; $i++ )
+ {
+ if ( ${$sequencetable}[$i] =~ /^\s*([\w\.]+)\t.*\t\s*(POSITIONTEMPLATE_.*?)\s*$/ )
+ {
+ my $customactionname = $1;
+ my $fulltemplate = $2;
+ my $template = $fulltemplate;
+ $template =~ s/POSITIONTEMPLATE_//;
+ # my $newstring = $customactionname . " (" . $template . ")";
+ # $templatestring = $templatestring . $newstring . ", ";
+ # Setting at the end!
+ $lastposition = $lastposition + 25;
+ ${$sequencetable}[$i] =~ s/$fulltemplate/$lastposition/;
+ $infoline = "WARNING: Setting position \"$lastposition\" for custom action \"$customactionname\". Could not find CustomAction \"$template\".\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+ # $templatestring =~ s/,\s*$//;
+
+ # $infoline = "Error: Saving table \"$tablename\"\n";
+ # push(@installer::globals::logfileinfo, $infoline);
+ # print $infoline;
+ # installer::files::save_file($tablename, $sequencetable);
+ # installer::exiter::exit_program("ERROR: Unresolved positions in CustomActions in scp2: $templatestring", "set_positions_in_table");
+ }
+}
+
+##########################################################################
+# Setting the Windows custom actions into different tables
+# CustomAc.idt, InstallE.idt, InstallU.idt, ControlE.idt, ControlC.idt
+##########################################################################
+
+sub addcustomactions
+{
+ my ($languageidtdir, $customactions, $filesarray) = @_;
+
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: addcustomactions start\n");
+
+ my $customactionidttablename = $languageidtdir . $installer::globals::separator . "CustomAc.idt";
+ my $customactionidttable = installer::files::read_file($customactionidttablename);
+ my $installexecutetablename = $languageidtdir . $installer::globals::separator . "InstallE.idt";
+ my $installexecutetable = installer::files::read_file($installexecutetablename);
+ my $adminexecutetablename = $languageidtdir . $installer::globals::separator . "AdminExe.idt";
+ my $adminexecutetable = installer::files::read_file($adminexecutetablename);
+ my $installuitablename = $languageidtdir . $installer::globals::separator . "InstallU.idt";
+ my $installuitable = installer::files::read_file($installuitablename);
+ my $controleventtablename = $languageidtdir . $installer::globals::separator . "ControlE.idt";
+ my $controleventtable = installer::files::read_file($controleventtablename);
+ my $controlconditiontablename = $languageidtdir . $installer::globals::separator . "ControlC.idt";
+ my $controlconditiontable = installer::files::read_file($controlconditiontablename);
+
+ # Iterating over all Windows custom actions
+
+ for ( my $i = 0; $i <= $#{$customactions}; $i++ )
+ {
+ my $customaction = ${$customactions}[$i];
+ my $name = $customaction->{'Name'};
+ my $typ = $customaction->{'Typ'};
+ my $source = $customaction->{'Source'};
+ my $target = $customaction->{'Target'};
+ my $inbinarytable = $customaction->{'Inbinarytable'};
+ my $gid = $customaction->{'gid'};
+
+ my $styles = "";
+ if ( $customaction->{'Styles'} ) { $styles = $customaction->{'Styles'}; }
+
+ my $added_customaction = set_custom_action($customactionidttable, $name, $typ, $source, $target, $inbinarytable, $filesarray, $customactionidttablename, $styles);
+
+ if ( $added_customaction )
+ {
+ # If the CustomAction was added into the CustomAc.idt, it can be connected to the installation.
+ # There are currently two different ways for doing this:
+ # 1. Using "add_custom_action_to_install_table", which adds the CustomAction to the install sequences,
+ # which are saved in InstallE.idt and InstallU.idt
+ # 2. Using "connect_custom_action_to_control" and "connect_custom_action_to_control". The first method
+ # connects a CustomAction to a control in ControlE.idt. The second method sets a condition for a control,
+ # which might be influenced by the CustomAction. This happens in ControlC.idt.
+
+ # Any Windows CustomAction can have a lot of different assignments.
+
+ for ( my $j = 1; $j <= 50; $j++ )
+ {
+ my $key = "Assignment" . $j;
+ my $value = "";
+ if ( $customaction->{$key} )
+ {
+ $value = $customaction->{$key};
+
+ # in a patch the Assignment can be overwritten by a PatchAssignment
+ if ( $installer::globals::patch )
+ {
+ $patchkey = "PatchAssignment" . $j;
+ if ( $customaction->{$patchkey} )
+ {
+ $value = $customaction->{$patchkey};
+ $key = $patchkey;
+ }
+ }
+
+ }
+ else { last; }
+
+ # $value is now a comma separated list
+ if ( $value =~ /^\s*\(\s*(.*)\s*\);?\s*$/ ) { $value = $1; }
+ my $assignmentarray = installer::converter::convert_stringlist_into_array(\$value, ",");
+ my $assignment = create_customaction_assignment_hash($gid, $name, $key, $assignmentarray);
+
+ if ( $assignment->{'parameter1'} eq "InstallExecuteSequence" )
+ {
+ add_custom_action_to_install_table($installexecutetable, $source, $name, $assignment->{'parameter2'}, $assignment->{'parameter3'}, $filesarray, $installexecutetablename, $styles);
+ }
+ elsif ( $assignment->{'parameter1'} eq "AdminExecuteSequence" )
+ {
+ add_custom_action_to_install_table($adminexecutetable, $source, $name, $assignment->{'parameter2'}, $assignment->{'parameter3'}, $filesarray, $adminexecutetablename, $styles);
+ }
+ elsif ( $assignment->{'parameter1'} eq "InstallUISequence" )
+ {
+ add_custom_action_to_install_table($installuitable, $source, $name, $assignment->{'parameter2'}, $assignment->{'parameter3'}, $filesarray, $installuitablename, $styles);
+ }
+ elsif ( $assignment->{'parameter1'} eq "ControlEvent" )
+ {
+ connect_custom_action_to_control($controleventtable, $controleventtablename, $assignment->{'parameter2'}, $assignment->{'parameter3'}, $assignment->{'parameter4'}, $assignment->{'parameter5'}, $assignment->{'parameter6'}, $assignment->{'parameter7'});
+ }
+ elsif ( $assignment->{'parameter1'} eq "ControlCondition" )
+ {
+ connect_condition_to_control($controlconditiontable, $controlconditiontablename, $assignment->{'parameter2'}, $assignment->{'parameter3'}, $assignment->{'parameter4'}, $assignment->{'parameter5'});
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: gid: $gid, key: $key ! Unknown Windows CustomAction table: $assignmenthashref->{'parameter1'} ! Currently supported: InstallUISequence, InstallESequence, ControlEvent, ControlCondition", "addcustomactions");
+ }
+ }
+ }
+ }
+
+ # Setting the positions in the tables
+
+ set_positions_in_table($installexecutetable, $installexecutetablename);
+ set_positions_in_table($installuitable, $installuitablename);
+ set_positions_in_table($adminexecutetable, $adminexecutetablename);
+
+ # Saving the files
+
+ installer::files::save_file($customactionidttablename, $customactionidttable);
+ installer::files::save_file($installexecutetablename, $installexecutetable);
+ installer::files::save_file($adminexecutetablename, $adminexecutetable);
+ installer::files::save_file($installuitablename, $installuitable);
+ installer::files::save_file($controleventtablename, $controleventtable);
+ installer::files::save_file($controlconditiontablename, $controlconditiontable);
+
+ my $infoline = "Updated idt file: $customactionidttablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Updated idt file: $installexecutetablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Updated idt file: $adminexecutetablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Updated idt file: $installuitablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Updated idt file: $controleventtablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ $infoline = "Updated idt file: $controlconditiontablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: addcustomactions end\n");
+}
+
+##########################################################################
+# Setting bidi attributes in idt tables
+##########################################################################
+
+sub setbidiattributes
+{
+ my ($languageidtdir, $onelanguage) = @_;
+
+ # Editing the files Dialog.idt and Control.idt
+
+ my $dialogfilename = $languageidtdir . $installer::globals::separator . "Dialog.idt";
+ my $controlfilename = $languageidtdir . $installer::globals::separator . "Control.idt";
+
+ my $dialogfile = installer::files::read_file($dialogfilename);
+ my $controlfile = installer::files::read_file($controlfilename);
+
+ # Searching attributes in Dialog.idt and adding "896".
+ # Attributes are in column 6 (from 10).
+
+ my $bidiattribute = 896;
+ for ( my $i = 0; $i <= $#{$dialogfile}; $i++ )
+ {
+ if ( $i < 3 ) { next; }
+ if ( ${$dialogfile}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my $one = $1;
+ my $two = $2;
+ my $three = $3;
+ my $four = $4;
+ my $five = $5;
+ my $attribute = $6;
+ my $seven = $7;
+ my $eight = $8;
+ $attribute = $attribute + $bidiattribute;
+ ${$dialogfile}[$i] = "$one\t$two\t$three\t$four\t$five\t$attribute\t$seven\t$eight\n";
+ }
+ }
+
+ # Searching attributes in Control.idt and adding "224".
+ # Attributes are in column 8 (from 12).
+
+ $bidiattribute = 224;
+ for ( my $i = 0; $i <= $#{$controlfile}; $i++ )
+ {
+ if ( $i < 3 ) { next; }
+ if ( ${$controlfile}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my $one = $1;
+ my $two = $2;
+ my $three = $3;
+ my $four = $4;
+ my $five = $5;
+ my $six = $6;
+ my $seven = $7;
+ my $attribute = $8;
+ my $nine = $9;
+ my $ten = $10;
+ my $eleven = $11;
+ my $twelve = $12;
+ $attribute = $attribute + $bidiattribute;
+ ${$controlfile}[$i] = "$one\t$two\t$three\t$four\t$five\t$six\t$seven\t$attribute\t$nine\t$ten\t$eleven\t$twelve\n";
+ }
+ }
+
+ # Saving the file
+
+ installer::files::save_file($dialogfilename, $dialogfile);
+ $infoline = "Set bidi support in idt file \"$dialogfilename\" for language $onelanguage\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ installer::files::save_file($controlfilename, $controlfile);
+ $infoline = "Set bidi support in idt file \"$controlfilename\" for language $onelanguage\n";
+ push(@installer::globals::logfileinfo, $infoline);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/inifile.pm b/solenv/bin/modules/installer/windows/inifile.pm
new file mode 100644
index 000000000000..de279da8d48b
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/inifile.pm
@@ -0,0 +1,146 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::inifile;
+
+use installer::existence;
+use installer::files;
+use installer::globals;
+use installer::windows::idtglobal;
+
+####################################################
+# Setting the profile for a special profileitem
+####################################################
+
+sub get_profile_for_profileitem
+{
+ my ($profileid, $filesref) = @_;
+
+ my $profile = installer::existence::get_specified_file($filesref, $profileid);
+
+ return $profile;
+}
+
+####################################################
+# Checking whether profile is included in patch
+####################################################
+
+sub profile_has_patch_flag
+{
+ my ($profile) = @_;
+
+ my $in_patch = 0;
+
+ my $styles = "";
+ if ( $profile->{'Styles'} ) { $styles = $profile->{'Styles'}; }
+ if ( $styles =~ /\bPATCH\b/ ) { $in_patch = 1; }
+
+ return $in_patch;
+}
+
+####################################################
+# Checking whether profile is part of product
+####################################################
+
+sub file_is_part_of_product
+{
+ my ($profilegid, $filesref) = @_;
+
+ my $part_of_product = 0;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ $onefile = ${$filesref}[$i];
+ my $filegid = $onefile->{'gid'};
+
+ if ( $filegid eq $profilegid )
+ {
+ $part_of_product = 1;
+ last;
+ }
+ }
+
+ return $part_of_product;
+}
+
+###########################################################################################################
+# Creating the file IniFile.idt dynamically
+# Content:
+# IniFile\tFileName\tDirProperty\tSection\tKey\tValue\tAction\tComponent_
+###########################################################################################################
+
+sub create_inifile_table
+{
+ my ($inifiletableentries, $filesref, $basedir) = @_;
+
+ my @inifiletable = ();
+
+ installer::windows::idtglobal::write_idt_header(\@inifiletable, "inifile");
+
+ for ( my $i = 0; $i <= $#{$inifiletableentries}; $i++ )
+ {
+ my $profileitem = ${$inifiletableentries}[$i];
+
+ my $profileid = $profileitem->{'ProfileID'};
+
+ # Is this profile part of the product? This is not sure, for example in patch process.
+ # If the profile is not part of the product, this ProfileItem must be ignored.
+
+ if ( ! file_is_part_of_product($profileid, $filesref) ) { next; }
+
+ my $profile = get_profile_for_profileitem($profileid, $filesref);
+
+ if (( $installer::globals::patch ) && ( ! profile_has_patch_flag($profile) )) { next; }
+
+ my %inifile = ();
+
+ $inifile{'IniFile'} = $profileitem->{'Inifiletablekey'};
+ $inifile{'FileName'} = $profile->{'Name'};
+ $inifile{'DirProperty'} = $profile->{'uniquedirname'};
+ $inifile{'Section'} = $profileitem->{'Section'};
+ $inifile{'Key'} = $profileitem->{'Key'};
+ $inifile{'Value'} = $profileitem->{'Value'};
+ $inifile{'Action'} = $profileitem->{'Inifiletableaction'};
+ $inifile{'Component_'} = $profile->{'componentname'};
+
+ my $oneline = $inifile{'IniFile'} . "\t" . $inifile{'FileName'} . "\t" . $inifile{'DirProperty'} . "\t"
+ . $inifile{'Section'} . "\t" . $inifile{'Key'} . "\t" . $inifile{'Value'} . "\t"
+ . $inifile{'Action'} . "\t" . $inifile{'Component_'} . "\n";
+
+ push(@inifiletable, $oneline);
+ }
+
+ # Saving the file
+
+ my $inifiletablename = $basedir . $installer::globals::separator . "IniFile.idt";
+ installer::files::save_file($inifiletablename ,\@inifiletable);
+ my $infoline = "Created idt file: $inifiletablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/java.pm b/solenv/bin/modules/installer/windows/java.pm
new file mode 100644
index 000000000000..11ccd7076f71
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/java.pm
@@ -0,0 +1,120 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::java;
+
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::windows::idtglobal;
+
+####################################################################################
+# Writing content into RegLocat.idt and AppSearc.idt to find Java on system
+####################################################################################
+
+sub update_java_tables
+{
+ my ($basedir, $allvariables) = @_;
+
+ my $reglocatfile = "";
+ my $appsearchfile = "";
+
+ my $reglocatfilename = $basedir . $installer::globals::separator . "RegLocat.idt";
+ my $appsearchfilename = $basedir . $installer::globals::separator . "AppSearc.idt";
+ my $signaturefilename = $basedir . $installer::globals::separator . "Signatur.idt";
+
+ if ( -f $reglocatfilename )
+ {
+ $reglocatfile = installer::files::read_file($reglocatfilename);
+ }
+ else
+ {
+ my @reglocattable = ();
+ $reglocatfile = \@reglocattable;
+ installer::windows::idtglobal::write_idt_header($reglocatfile, "reglocat");
+ }
+
+ if ( -f $appsearchfilename )
+ {
+ $appsearchfile = installer::files::read_file($appsearchfilename);
+ }
+ else
+ {
+ my @appsearchtable = ();
+ $appsearchfile = \@appsearchtable;
+ installer::windows::idtglobal::write_idt_header($appsearchfile, "appsearch");
+ }
+
+ if ( -f $signaturefilename )
+ {
+ $signaturefile = installer::files::read_file($signaturefilename);
+ }
+ else
+ {
+ my @signaturetable = ();
+ $signaturefile = \@signaturetable;
+ installer::windows::idtglobal::write_idt_header($signaturefile, "signatur");
+ }
+
+ # Writing content into this tables
+ # Java version is saved in scp project
+ # $installer::globals::javafile was defined in installer::windows::idtglobal::add_childprojects
+
+ if ( ! $installer::globals::javafile->{'Javaversion'} ) { installer::exiter::exit_program("ERROR: \"Javaversion\" has to be defined in $installer::globals::javafile->{'gid'} in scp project!", "update_java_tables"); }
+
+ my $javastring = $installer::globals::javafile->{'Javaversion'};
+
+ my $signature = "JavaReg";
+ my $rootvalue = "2";
+ my $key = "Software\\JavaSoft\\Java Runtime Environment\\" . $javastring;
+ my $name = "JavaHome";
+ my $type = 2;
+ my $property = "JAVAPATH";
+
+ my $oneline = $signature . "\t" . $rootvalue . "\t" . $key . "\t" . $name . "\t" . $type . "\n";
+ push(@{$reglocatfile}, $oneline);
+
+ $oneline = $property . "\t" . $signature . "\n";
+ push(@{$appsearchfile}, $oneline);
+
+ # Saving the files
+
+ installer::files::save_file($reglocatfilename ,$reglocatfile);
+ my $infoline = "Updated idt file for Java: $reglocatfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ installer::files::save_file($appsearchfilename ,$appsearchfile);
+ $infoline = "Updated idt file for Java: $appsearchfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ installer::files::save_file($signaturefilename ,$signaturefile);
+ $infoline = "Updated idt file: $signaturefilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/language.pm b/solenv/bin/modules/installer/windows/language.pm
new file mode 100644
index 000000000000..c0dca543eb56
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/language.pm
@@ -0,0 +1,74 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::language;
+
+use installer::exiter;
+
+####################################################
+# Determining the Windows language (LCID)
+# English: 1033
+####################################################
+
+sub get_windows_language
+{
+ my ($language) = @_;
+
+ my $windowslanguage = "";
+
+ if ( $installer::globals::msilanguage->{$language} ) { $windowslanguage = $installer::globals::msilanguage->{$language}; }
+
+ if ( $windowslanguage eq "" ) { installer::exiter::exit_program("ERROR: Unknown language $language in function get_windows_language", "get_windows_language"); }
+
+ return $windowslanguage;
+}
+
+####################################################
+# Determining the Windows language ANSI-Codepage
+# English: 1252
+####################################################
+
+sub get_windows_encoding
+{
+ my ($language) = @_;
+
+ my $windowsencoding = "";
+
+ if ( $installer::globals::msiencoding->{$language} ) { $windowsencoding = $installer::globals::msiencoding->{$language}; }
+
+ # if ( $windowsencoding eq "" ) { installer::exiter::exit_program("ERROR: Unknown language $language in function get_windows_encoding", "get_windows_encoding"); }
+ if ( $windowsencoding eq "" ) { $windowsencoding = "0"; } # setting value, if the language is not listed in the encodinglist
+
+ if ( $windowsencoding eq "0" ) { $windowsencoding = "65001"; } # languages with "0" have to be available in UTF-8 (65001)
+
+ # Asian multilingual installation sets need a code neutral Windows Installer database -> $windowsencoding = 0
+ if (( $language eq "en-US" ) && (( $installer::globals::product =~ /suitemulti/i ) || ( $installer::globals::product =~ /officemulti/i ) || ( $installer::globals::product =~ /c05office/i ) || ( $installer::globals::added_english ))) { $windowsencoding = "0"; }
+
+ return $windowsencoding;
+}
+
+1; \ No newline at end of file
diff --git a/solenv/bin/modules/installer/windows/media.pm b/solenv/bin/modules/installer/windows/media.pm
new file mode 100644
index 000000000000..35e90f6a3856
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/media.pm
@@ -0,0 +1,458 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::media;
+
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::windows::idtglobal;
+
+##############################################################
+# Returning the diskid for the media table.
+##############################################################
+
+sub get_media_diskid
+{
+ my ($id) = @_;
+
+ return $id;
+}
+
+##############################################################
+# Returning the lastsequence for the media table.
+##############################################################
+
+sub get_media_lastsequence
+{
+ my ($fileref) = @_;
+
+ return $fileref->{'sequencenumber'};
+}
+
+##############################################################
+# Returning the diskprompt for the media table.
+##############################################################
+
+sub get_media_diskprompt
+{
+ return 1;
+}
+
+##############################################################
+# Returning the cabinet file name for the media table.
+##############################################################
+
+sub get_media_cabinet
+{
+ my ($id) = @_;
+
+ my $number = 1000 + $id;
+ my $filename = "f_" . $number . ".cab";
+
+ if ( $installer::globals::include_cab_in_msi ) { $filename = "\#" . $filename; }
+
+ return $filename;
+}
+
+##############################################################
+# Returning the volumelabel for the media table.
+##############################################################
+
+sub get_media_volumelabel
+{
+ return "DISK1";
+}
+
+##############################################################
+# Returning the source for the media table.
+##############################################################
+
+sub get_media_source
+{
+ return "";
+}
+
+##############################################################
+# Saving the cabinet file name in the files collector.
+# This is useful for making a list to connect the
+# source of each file with the destination cabinet file.
+##############################################################
+
+sub set_cabinetfilename_for_component_in_file_collector
+{
+ my ($cabinetfilename, $filesref, $componentname, $max) = @_;
+
+ for ( my $i = 0; $i <= $max; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ my $component = $onefile->{'componentname'};
+
+ if ( $component eq $componentname )
+ {
+ my $cabinet = "";
+
+ if ( $onefile->{'cabinet'} ) { $cabinet = $onefile->{'cabinet'}; }
+
+ if ( $cabinet eq "" )
+ {
+ $onefile->{'cabinet'} = $cabinetfilename;
+ }
+ }
+ }
+}
+
+#################################################
+# Creating the cab file name dynamically
+#################################################
+
+sub generate_cab_filename_for_some_cabs
+{
+ my ( $allvariables, $id ) = @_;
+
+ my $name = $allvariables->{'PRODUCTNAME'};
+
+ $name = lc($name);
+ $name =~ s/\.//g;
+ $name =~ s/\s//g;
+
+ # possibility to overwrite the name with variable CABFILENAME
+ if ( $allvariables->{'CABFILENAME'} ) { $name = $allvariables->{'CABFILENAME'}; }
+
+ $name = $name . $id . ".cab";
+
+ if ( $installer::globals::include_cab_in_msi ) { $name = "\#" . $name; }
+
+ return $name;
+}
+
+#################################################
+# Creating the cab file name for cab files
+# defined in packages.
+#################################################
+
+sub get_cabfilename
+{
+ my ($name) = @_;
+
+ if ( $installer::globals::include_cab_in_msi ) { $name = "\#" . $name; }
+
+ return $name;
+}
+
+#################################################
+# Creating the cab file name dynamically
+#################################################
+
+sub generate_cab_filename
+{
+ my ( $allvariables ) = @_;
+
+ my $name = $allvariables->{'PRODUCTNAME'};
+
+ $name = lc($name);
+ $name =~ s/\.//g;
+ $name =~ s/\s//g;
+
+ # possibility to overwrite the name with variable CABFILENAME
+ if ( $allvariables->{'CABFILENAME'} ) { $name = $allvariables->{'CABFILENAME'}; }
+
+ $name = $name . ".cab";
+
+ if ( $installer::globals::include_cab_in_msi ) { $name = "\#" . $name; }
+
+ return $name;
+}
+
+sub get_maximum_filenumber
+{
+ my ($allfiles, $maxcabfilenumber) = @_;
+
+ my $maxfile = 0;
+
+ while ( ! ( $allfiles%$maxcabfilenumber == 0 ))
+ {
+ $allfiles++;
+ }
+
+ $maxfile = $allfiles / $maxcabfilenumber;
+
+ $maxfile++; # for securitry
+
+ return $maxfile;
+}
+
+#################################################################################
+# Setting the last sequence for the cabinet files
+#################################################################################
+
+sub get_last_sequence
+{
+ my ( $cabfilename, $alludpatelastsequences ) = @_;
+
+ my $sequence = 0;
+
+ if (( $installer::globals::updatedatabase ) && ( exists($alludpatelastsequences->{$cabfilename}) ))
+ {
+ $sequence = $alludpatelastsequences->{$cabfilename};
+ }
+ else
+ {
+ $sequence = $installer::globals::lastsequence{$cabfilename};
+ }
+
+ return $sequence;
+}
+
+#################################################################################
+# Creating the file Media.idt dynamically
+# Content:
+# DiskId LastSequence DiskPrompt Cabinet VolumeLabel Source
+# Idea: Every component is packed into each own cab file
+#################################################################################
+
+sub create_media_table
+{
+ my ($filesref, $basedir, $allvariables, $alludpatelastsequences, $allupdatediskids) = @_;
+
+ my @mediatable = ();
+
+ my $diskid = 0;
+
+ installer::windows::idtglobal::write_idt_header(\@mediatable, "media");
+
+ if ( $allvariables->{'INCLUDE_CAB_IN_MSI'} ) { $installer::globals::include_cab_in_msi = 1; }
+
+ if ( $installer::globals::use_packages_for_cabs )
+ {
+ my $cabfile;
+ foreach $cabfile ( sort keys %installer::globals::lastsequence )
+ {
+ my %media = ();
+ $diskid++;
+
+ $media{'DiskId'} = get_media_diskid($diskid);
+ $media{'LastSequence'} = get_last_sequence($cabfile, $alludpatelastsequences);
+ $media{'DiskPrompt'} = get_media_diskprompt();
+ $media{'Cabinet'} = get_cabfilename($cabfile);
+ $media{'VolumeLabel'} = get_media_volumelabel();
+ $media{'Source'} = get_media_source();
+
+ my $oneline = $media{'DiskId'} . "\t" . $media{'LastSequence'} . "\t" . $media{'DiskPrompt'} . "\t"
+ . $media{'Cabinet'} . "\t" . $media{'VolumeLabel'} . "\t" . $media{'Source'} . "\n";
+
+ push(@mediatable, $oneline);
+
+ # Comparing the disk id with the disk id from update database. Both have to be identical. New files have to be added
+ # to the new pff cabinet file. And existing cab files must not be removed.
+ if ( $installer::globals::updatedatabase )
+ {
+ # Comparing lines in new media table with line from media table in udpate database.
+ if ( exists($allupdatediskids->{$media{'Cabinet'}}) )
+ {
+ if ( $media{'DiskId'} != $allupdatediskids->{$media{'Cabinet'}} )
+ {
+ installer::exiter::exit_program("ERROR: Different DiskIDs for cab file \"$media{'Cabinet'}\".\nCurrent installation set: \"$media{'DiskId'}\", but update database used \"$allupdatediskids->{$media{'Cabinet'}}\".\nWere cabinet files removed or added?", "create_media_table");
+ }
+ }
+ else
+ {
+ my $localinfoline = "Warning: Could not find cabinet file \"$media{'Cabinet'}}\" in update database. This seems to be an new cabinet file!?\n";
+ push(@installer::globals::logfileinfo, $localinfoline);
+ }
+ }
+ }
+
+ # one new cabinet file for all files added after the final release
+ if (( $installer::globals::updatedatabase ) && ( $installer::globals::pfffileexists ))
+ {
+ my %media = ();
+ $diskid++;
+
+ $media{'DiskId'} = get_media_diskid($diskid) + $installer::globals::mergemodulenumber; # Adding mergemodulenumber, because this files are included later
+ $media{'LastSequence'} = $installer::globals::updatesequencecounter;
+ $media{'DiskPrompt'} = get_media_diskprompt();
+ $media{'Cabinet'} = get_cabfilename($installer::globals::pffcabfilename);
+ $media{'VolumeLabel'} = get_media_volumelabel();
+ $media{'Source'} = get_media_source();
+
+ my $oneline = $media{'DiskId'} . "\t" . $media{'LastSequence'} . "\t" . $media{'DiskPrompt'} . "\t"
+ . $media{'Cabinet'} . "\t" . $media{'VolumeLabel'} . "\t" . $media{'Source'} . "\n";
+
+ push(@mediatable, $oneline);
+ }
+
+ }
+ elsif ( $installer::globals::cab_file_per_component )
+ {
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ my $nextfile = ${$filesref}[$i+1];
+
+ my $filecomponent = "";
+ my $nextcomponent = "";
+
+ if ( $onefile->{'componentname'} ) { $filecomponent = $onefile->{'componentname'}; }
+ if ( $nextfile->{'componentname'} ) { $nextcomponent = $nextfile->{'componentname'}; }
+
+ if ( $filecomponent eq $nextcomponent )
+ {
+ next; # nothing to do, this is not the last file of a component
+ }
+
+ my %media = ();
+ $diskid++;
+
+ $media{'DiskId'} = get_media_diskid($diskid);
+ $media{'LastSequence'} = get_media_lastsequence($onefile);
+ $media{'DiskPrompt'} = get_media_diskprompt();
+ $media{'Cabinet'} = get_media_cabinet($diskid);
+ $media{'VolumeLabel'} = get_media_volumelabel();
+ $media{'Source'} = get_media_source();
+
+ my $oneline = $media{'DiskId'} . "\t" . $media{'LastSequence'} . "\t" . $media{'DiskPrompt'} . "\t"
+ . $media{'Cabinet'} . "\t" . $media{'VolumeLabel'} . "\t" . $media{'Source'} . "\n";
+
+ push(@mediatable, $oneline);
+
+ $media{'Cabinet'} =~ s/^\s*\#//; # removing leading hash
+ set_cabinetfilename_for_component_in_file_collector($media{'Cabinet'}, $filesref, $filecomponent, $i);
+ }
+ }
+ elsif ( $installer::globals::fix_number_of_cab_files )
+ {
+ # number of cabfiles
+ my $maxcabfilenumber = $installer::globals::number_of_cabfiles;
+ if ( $allvariables->{'CABFILENUMBER'} ) { $maxcabfilenumber = $allvariables->{'CABFILENUMBER'}; }
+ my $allfiles = $#{$filesref} + 1;
+ my $maxfilenumber = get_maximum_filenumber($allfiles, $maxcabfilenumber);
+ # my $maxfilenumber = 1000; # maximum 1000 files in each cabinet file
+ my $cabfilenumber = 0;
+ my $cabfull = 0;
+ my $counter = 0;
+
+ # Sorting of files collector files required !
+ # Attention: The order in the cab file is not guaranteed (especially in udpate process)
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ if (( $counter >= $maxfilenumber ) || ( $i == $#{$filesref} )) { $cabfull = 1; }
+
+ $counter++; # counting the files in the cab file
+
+ my $onefile = ${$filesref}[$i];
+ my $nextfile = ${$filesref}[$i+1];
+
+ my $filecomponent = "";
+ my $nextcomponent = "";
+
+ if ( $onefile->{'componentname'} ) { $filecomponent = $onefile->{'componentname'}; }
+ if ( $nextfile->{'componentname'} ) { $nextcomponent = $nextfile->{'componentname'}; }
+
+ if ( $filecomponent eq $nextcomponent ) # all files of one component have to be in one cab file
+ {
+ next; # nothing to do, this is not the last file of a component
+ }
+
+ if ( $cabfull )
+ {
+ my %media = ();
+ $cabfilenumber++;
+
+ $media{'DiskId'} = get_media_diskid($cabfilenumber);
+ # $media{'LastSequence'} = get_media_lastsequence($onefile);
+ $media{'LastSequence'} = $i + 1; # This should be correct, also for unsorted files collectors
+ $media{'DiskPrompt'} = get_media_diskprompt();
+ $media{'Cabinet'} = generate_cab_filename_for_some_cabs($allvariables, $cabfilenumber);
+ $media{'VolumeLabel'} = get_media_volumelabel();
+ $media{'Source'} = get_media_source();
+
+ my $oneline = $media{'DiskId'} . "\t" . $media{'LastSequence'} . "\t" . $media{'DiskPrompt'} . "\t"
+ . $media{'Cabinet'} . "\t" . $media{'VolumeLabel'} . "\t" . $media{'Source'} . "\n";
+
+ push(@mediatable, $oneline);
+
+ # Saving the cabinet file name in the file collector
+
+ $media{'Cabinet'} =~ s/^\s*\#//; # removing leading hash
+
+ for ( my $j = 0; $j <= $i; $j++ )
+ {
+ my $onefile = ${$filesref}[$j];
+ if ( ! $onefile->{'cabinet'} ) { $onefile->{'cabinet'} = $media{'Cabinet'}; }
+ }
+
+ $cabfull = 0;
+ $counter = 0;
+ }
+ }
+ }
+ elsif ( $installer::globals::one_cab_file )
+ {
+ my %media = ();
+ $diskid++;
+
+ my $maximumfile = $#{$filesref};
+
+ $media{'DiskId'} = get_media_diskid($diskid);
+ # $media{'LastSequence'} = ${$filesref}[$maximumfile]->{'sequencenumber'}; # sequence number of the last file
+ $media{'LastSequence'} = $maximumfile + 1; # This works also for unsorted file collector
+ $media{'DiskPrompt'} = get_media_diskprompt();
+ $media{'Cabinet'} = generate_cab_filename($allvariables);
+ $media{'VolumeLabel'} = get_media_volumelabel();
+ $media{'Source'} = get_media_source();
+
+ my $oneline = $media{'DiskId'} . "\t" . $media{'LastSequence'} . "\t" . $media{'DiskPrompt'} . "\t"
+ . $media{'Cabinet'} . "\t" . $media{'VolumeLabel'} . "\t" . $media{'Source'} . "\n";
+
+ push(@mediatable, $oneline);
+
+ # Saving the cabinet file name in the file collector
+
+ $media{'Cabinet'} =~ s/^\s*\#//; # removing leading hash
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ $onefile->{'cabinet'} = $media{'Cabinet'};
+ }
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: No cab file specification in globals.pm !", "create_media_table");
+ }
+
+ # Saving the file
+
+ my $mediatablename = $basedir . $installer::globals::separator . "Media.idt";
+ installer::files::save_file($mediatablename ,\@mediatable);
+ my $infoline = "Created idt file: $mediatablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/mergemodule.pm b/solenv/bin/modules/installer/windows/mergemodule.pm
new file mode 100755
index 000000000000..eb524fdafc3e
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/mergemodule.pm
@@ -0,0 +1,1652 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::mergemodule;
+
+use Cwd;
+use Digest::MD5;
+use installer::converter;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::remover;
+use installer::scriptitems;
+use installer::systemactions;
+use installer::worker;
+use installer::windows::idtglobal;
+use installer::windows::language;
+
+#################################################################
+# Merging the Windows MergeModules into the msi database.
+#################################################################
+
+sub merge_mergemodules_into_msi_database
+{
+ my ($mergemodules, $filesref, $msifilename, $languagestringref, $language, $languagefile, $allvariables, $includepatharrayref, $allupdatesequences, $allupdatelastsequences, $allupdatediskids) = @_;
+
+ my $domerge = 0;
+ if (( $#{$mergemodules} > -1 ) && ( ! $installer::globals::patch ) && ( ! $installer::globals::languagepack )) { $domerge = 1; }
+
+ if ( $domerge )
+ {
+ installer::logger::include_header_into_logfile("Merging merge modules into msi database");
+ installer::logger::print_message( "... merging msm files into msi database ... \n" );
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: MergeModule into msi database, start");
+
+ my $msidb = "msidb.exe"; # Has to be in the path
+ my $cabinetfile = "MergeModule.CABinet"; # the name of each cabinet file in a merge file
+ my $infoline = "";
+ my $systemcall = "";
+ my $returnvalue = "";
+
+ # 1. Analyzing the MergeModule (has only to be done once)
+ # a. -> Extracting cabinet file: msidb.exe -d <msmfile> -x MergeModule.CABinet
+ # b. -> Number of files in cabinet file: msidb.exe -d <msmfile> -f <directory> -e File
+ # c. -> List of components: msidb.exe -d <msmfile> -f <directory> -e Component
+
+ if ( ! $installer::globals::mergemodules_analyzed )
+ {
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Analyzing MergeModules, start");
+ $infoline = "Analyzing all Merge Modules\n\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ %installer::globals::mergemodules = ();
+
+ my $mergemoduledir = installer::systemactions::create_directories("mergefiles", $languagestringref);
+ # push(@installer::globals::removedirs, $mergemoduledir);
+
+ my $mergemodule;
+ foreach $mergemodule ( @{$mergemodules} )
+ {
+ my $filename = $mergemodule->{'Name'};
+ my $mergefile = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 1);
+
+ if ( ! -f $$mergefile ) { installer::exiter::exit_program("ERROR: msm file not found: $filename !", "merge_mergemodules_into_msi_database"); }
+ my $completesource = $$mergefile;
+
+ my $mergegid = $mergemodule->{'gid'};
+ my $workdir = $mergemoduledir . $installer::globals::separator . $mergegid;
+ if ( ! -d $workdir ) { installer::systemactions::create_directory($workdir); }
+
+ $infoline = "Analyzing Merge Module: $filename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # copy msm file into working directory
+ my $completedest = $workdir . $installer::globals::separator . $filename;
+ installer::systemactions::copy_one_file($completesource, $completedest);
+ if ( ! -f $completedest ) { installer::exiter::exit_program("ERROR: msm file not found: $completedest !", "merge_mergemodules_into_msi_database"); }
+
+ # changing directory
+ my $from = cwd();
+ my $to = $workdir;
+ chdir($to);
+
+ # remove an existing cabinet file
+ if ( -f $cabinetfile ) { unlink($cabinetfile); }
+
+ # exclude cabinet file
+ $systemcall = $msidb . " -d " . $filename . " -x " . $cabinetfile;
+ $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Could not extract cabinet file from merge file: $completedest !", "merge_mergemodules_into_msi_database");
+ }
+ else
+ {
+ $infoline = "Success: Executed $systemcall successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ # exclude tables from mergefile
+ # Attention: All listed tables have to exist in the database. If they not exist, an error window pops up
+ # and the return value of msidb.exe is not zero. The error window makes it impossible to check the existence
+ # of a table with the help of the return value.
+ # Solution: Export of all tables by using "*" . Some tables must exist (File Component Directory), other
+ # tables do not need to exist (MsiAssembly).
+
+ if ( $^O =~ /cygwin/i ) {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ my $localworkdir = $workdir;
+ $localworkdir =~ s/\//\\\\/g;
+ $systemcall = $msidb . " -d " . $filename . " -f " . $localworkdir . " -e \\\*";
+ }
+ else
+ {
+ # $systemcall = $msidb . " -d " . $filename . " -f " . $workdir . " -e File Component MsiAssembly Directory";
+ $systemcall = $msidb . " -d " . $filename . " -f " . $workdir . " -e \*";
+ }
+
+ $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Could not exclude tables from merge file: $completedest !", "merge_mergemodules_into_msi_database");
+ }
+ else
+ {
+ $infoline = "Success: Executed $systemcall successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ # Determining files
+ my $idtfilename = "File.idt"; # must exist
+ if ( ! -f $idtfilename ) { installer::exiter::exit_program("ERROR: File \"$idtfilename\" not found in directory \"$workdir\" !", "merge_mergemodules_into_msi_database"); }
+ my $filecontent = installer::files::read_file($idtfilename);
+ my @file_idt_content = ();
+ my $filecounter = 0;
+ my %mergefilesequence = ();
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i <= 2 ) { next; } # ignoring first three lines
+ if ( ${$filecontent}[$i] =~ /^\s*$/ ) { next; } # ignoring empty lines
+ $filecounter++;
+ push(@file_idt_content, ${$filecontent}[$i]);
+ if ( ${$filecontent}[$i] =~ /^\s*(.+?)\t(.+?)\t(.+?)\t(.+?)\t(.*?)\t(.*?)\t(.*?)\t(\d+?)\s*$/ )
+ {
+ my $filename = $1;
+ my $filesequence = $8;
+ $mergefilesequence{$filename} = $filesequence;
+ }
+ else
+ {
+ my $linecount = $i + 1;
+ installer::exiter::exit_program("ERROR: Unknown line format in table \"$idtfilename\" (line $linecount) !", "merge_mergemodules_into_msi_database");
+ }
+ }
+
+ # Determining components
+ $idtfilename = "Component.idt"; # must exist
+ if ( ! -f $idtfilename ) { installer::exiter::exit_program("ERROR: File \"$idtfilename\" not found in directory \"$workdir\" !", "merge_mergemodules_into_msi_database"); }
+ $filecontent = installer::files::read_file($idtfilename);
+ my %componentnames = ();
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i <= 2 ) { next; } # ignoring first three lines
+ if ( ${$filecontent}[$i] =~ /^\s*$/ ) { next; } # ignoring empty lines
+ if ( ${$filecontent}[$i] =~ /^\s*(\S+)\s+/ ) { $componentnames{$1} = 1; }
+ }
+
+ # Determining directories
+ $idtfilename = "Directory.idt"; # must exist
+ if ( ! -f $idtfilename ) { installer::exiter::exit_program("ERROR: File \"$idtfilename\" not found in directory \"$workdir\" !", "merge_mergemodules_into_msi_database"); }
+ $filecontent = installer::files::read_file($idtfilename);
+ my %mergedirectories = ();
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i <= 2 ) { next; } # ignoring first three lines
+ if ( ${$filecontent}[$i] =~ /^\s*$/ ) { next; } # ignoring empty lines
+ if ( ${$filecontent}[$i] =~ /^\s*(\S+)\s+/ ) { $mergedirectories{$1} = 1; }
+ }
+
+ # Determining assemblies
+ $idtfilename = "MsiAssembly.idt"; # does not need to exist
+ my $hasmsiassemblies = 0;
+ my %mergeassemblies = ();
+ if ( -f $idtfilename )
+ {
+ $filecontent = installer::files::read_file($idtfilename);
+ $hasmsiassemblies = 1;
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i <= 2 ) { next; } # ignoring first three lines
+ if ( ${$filecontent}[$i] =~ /^\s*$/ ) { next; } # ignoring empty lines
+ if ( ${$filecontent}[$i] =~ /^\s*(\S+)\s+/ ) { $mergeassemblies{$1} = 1; }
+ }
+ }
+
+ # It is possible, that other tables have to be checked here. This happens, if tables in the
+ # merge module have to know the "Feature" or the "Directory", under which the content of the
+ # msm file is integrated into the msi database.
+
+ # Determining name of cabinet file in installation set
+ my $cabfilename = $mergemodule->{'Cabfilename'};
+ installer::packagelist::resolve_packagevariables(\$cabfilename, $allvariables, 0);
+
+ # Analyzing styles
+ # Flag REMOVE_FILE_TABLE is required for msvc9 Merge-Module, because otherwise msidb.exe
+ # fails during integration of msm file into msi database.
+
+ my $styles = "";
+ my $removefiletable = 0;
+ if ( $mergemodule->{'Styles'} ) { $styles = $mergemodule->{'Styles'}; }
+ if ( $styles =~ /\bREMOVE_FILE_TABLE\b/ ) { $removefiletable = 1; }
+
+ if ( $removefiletable )
+ {
+ my $removeworkdir = $workdir . $installer::globals::separator . "remove_file_idt";
+ if ( ! -d $removeworkdir ) { installer::systemactions::create_directory($removeworkdir); }
+ my $completeremovedest = $removeworkdir . $installer::globals::separator . $filename;
+ installer::systemactions::copy_one_file($completedest, $completeremovedest);
+ if ( ! -f $completeremovedest ) { installer::exiter::exit_program("ERROR: msm file not found: $completeremovedest !", "merge_mergemodules_into_msi_database"); }
+
+ # Unpacking msm file
+ if ( $^O =~ /cygwin/i ) {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ my $localcompleteremovedest = $completeremovedest;
+ my $localremoveworkdir = $removeworkdir;
+ $localcompleteremovedest =~ s/\//\\\\/g;
+ $localremoveworkdir =~ s/\//\\\\/g;
+ $systemcall = $msidb . " -d " . $localcompleteremovedest . " -f " . $localremoveworkdir . " -e \\\*";
+ }
+ else
+ {
+ $systemcall = $msidb . " -d " . $completeremovedest . " -f " . $removeworkdir . " -e \*";
+ }
+
+ $returnvalue = system($systemcall);
+
+ my $idtfilename = $removeworkdir . $installer::globals::separator . "File.idt";
+ if ( -f $idtfilename ) { unlink $idtfilename; }
+ unlink $completeremovedest;
+
+ # Packing msm file without "File.idt"
+ if ( $^O =~ /cygwin/i ) {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ my $localcompleteremovedest = $completeremovedest;
+ my $localremoveworkdir = $removeworkdir;
+ $localcompleteremovedest =~ s/\//\\\\/g;
+ $localremoveworkdir =~ s/\//\\\\/g;
+ $systemcall = $msidb . " -c -d " . $localcompleteremovedest . " -f " . $localremoveworkdir . " -i \\\*";
+ }
+ else
+ {
+ $systemcall = $msidb . " -c -d " . $completeremovedest . " -f " . $removeworkdir . " -i \*";
+ }
+ $returnvalue = system($systemcall);
+
+ # Using this msm file for merging
+ if ( -f $completeremovedest ) { $completedest = $completeremovedest; }
+ else { installer::exiter::exit_program("ERROR: Could not find msm file without File.idt: $completeremovedest !", "merge_mergemodules_into_msi_database"); }
+ }
+
+ # Saving MergeModule info
+
+ my %onemergemodulehash = ();
+ $onemergemodulehash{'mergefilepath'} = $completedest;
+ $onemergemodulehash{'workdir'} = $workdir;
+ $onemergemodulehash{'cabinetfile'} = $workdir . $installer::globals::separator . $cabinetfile;
+ $onemergemodulehash{'filenumber'} = $filecounter;
+ $onemergemodulehash{'componentnames'} = \%componentnames;
+ $onemergemodulehash{'cabfilename'} = $cabfilename;
+ $onemergemodulehash{'feature'} = $mergemodule->{'Feature'};
+ $onemergemodulehash{'rootdir'} = $mergemodule->{'RootDir'};
+ $onemergemodulehash{'name'} = $mergemodule->{'Name'};
+ $onemergemodulehash{'mergefilesequence'} = \%mergefilesequence;
+ $onemergemodulehash{'mergeassemblies'} = \%mergeassemblies;
+ $onemergemodulehash{'mergedirectories'} = \%mergedirectories;
+ $onemergemodulehash{'hasmsiassemblies'} = $hasmsiassemblies;
+ $onemergemodulehash{'removefiletable'} = $removefiletable;
+ $onemergemodulehash{'fileidtcontent'} = \@file_idt_content;
+
+ $installer::globals::mergemodules{$mergegid} = \%onemergemodulehash;
+
+ # Collecting all cab files, to copy them into installation set
+ $installer::globals::copy_msm_files{$cabfilename} = $onemergemodulehash{'cabinetfile'};
+
+ chdir($from);
+ }
+
+ $infoline = "All Merge Modules successfully analyzed\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ $installer::globals::mergemodules_analyzed = 1;
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Analyzing MergeModules, stop");
+
+ $infoline = "\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ # 2. Change msi database (has to be done for every msi database -> for every language)
+ # a. Merge msm file into msi database: msidb.exe -d <msifile> -m <mergefile>
+ # b. Extracting tables from msi database: msidb.exe -d <msifile> -f <directory> -e File Media, ...
+ # c. Changing content of msi database in tables: File, Media, Directory, FeatureComponent
+ # d. Including tables into msi database: msidb.exe -d <msifile> -f <directory> -i File Media, ...
+ # e. Copying cabinet file into installation set (later)
+
+ my $counter = 0;
+ my $mergemodulegid;
+ foreach $mergemodulegid (keys %installer::globals::mergemodules)
+ {
+ my $mergemodulehash = $installer::globals::mergemodules{$mergemodulegid};
+ $counter++;
+
+ installer::logger::include_header_into_logfile("Merging Module: $mergemodulehash->{'name'}");
+ installer::logger::print_message( "\t... $mergemodulehash->{'name'} ... \n" );
+
+ $msifilename = installer::converter::make_path_conform($msifilename);
+ my $workdir = $msifilename;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$workdir);
+
+ # changing directory
+ my $from = cwd();
+ my $to = $workdir;
+ chdir($to);
+
+ # Saving original msi database
+ installer::systemactions::copy_one_file($msifilename, "$msifilename\.$counter");
+
+ # Merging msm file, this is the "real" merge command
+
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Before merging database");
+
+ if ( $^O =~ /cygwin/i ) {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ my $localmergemodulepath = $mergemodulehash->{'mergefilepath'};
+ my $localmsifilename = $msifilename;
+ $localmergemodulepath =~ s/\//\\\\/g;
+ $localmsifilename =~ s/\//\\\\/g;
+ $systemcall = $msidb . " -d " . $localmsifilename . " -m " . $localmergemodulepath;
+ }
+ else
+ {
+ $systemcall = $msidb . " -d " . $msifilename . " -m " . $mergemodulehash->{'mergefilepath'};
+ }
+ $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall . Returnvalue: $returnvalue!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Could not merge msm file into database: $mergemodulehash->{'mergefilepath'} !", "merge_mergemodules_into_msi_database");
+ }
+ else
+ {
+ $infoline = "Success: Executed $systemcall successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: After merging database");
+
+ # Saving original idt files
+ if ( -f "File.idt" ) { installer::systemactions::rename_one_file("File.idt", "File.idt.$counter"); }
+ if ( -f "Media.idt" ) { installer::systemactions::rename_one_file("Media.idt", "Media.idt.$counter"); }
+ if ( -f "Directory.idt" ) { installer::systemactions::rename_one_file("Directory.idt", "Directory.idt.$counter"); }
+ if ( -f "Director.idt" ) { installer::systemactions::rename_one_file("Director.idt", "Director.idt.$counter"); }
+ if ( -f "FeatureComponents.idt" ) { installer::systemactions::rename_one_file("FeatureComponents.idt", "FeatureComponents.idt.$counter"); }
+ if ( -f "FeatureC.idt" ) { installer::systemactions::rename_one_file("FeatureC.idt", "FeatureC.idt.$counter"); }
+ if ( -f "MsiAssembly.idt" ) { installer::systemactions::rename_one_file("MsiAssembly.idt", "MsiAssembly.idt.$counter"); }
+ if ( -f "MsiAssem.idt" ) { installer::systemactions::rename_one_file("MsiAssem.idt", "MsiAssem.idt.$counter"); }
+
+ # Extracting tables
+
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Before extracting tables");
+
+ my $workingtables = "File Media Directory FeatureComponents"; # required tables
+ # Optional tables can be added now
+ if ( $mergemodulehash->{'hasmsiassemblies'} ) { $workingtables = $workingtables . " MsiAssembly"; }
+
+ # Table "Feature" has to be exported, but it is not necessary to import it.
+ if ( $^O =~ /cygwin/i ) {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ my $localmsifilename = $msifilename;
+ my $localworkdir = $workdir;
+ $localmsifilename =~ s/\//\\\\/g;
+ $localworkdir =~ s/\//\\\\/g;
+ $systemcall = $msidb . " -d " . $localmsifilename . " -f " . $localworkdir . " -e " . "Feature " . $workingtables;
+ }
+ else
+ {
+ $systemcall = $msidb . " -d " . $msifilename . " -f " . $workdir . " -e " . "Feature " . $workingtables;
+ }
+ $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Could not exclude tables from msi database: $msifilename !", "merge_mergemodules_into_msi_database");
+ }
+ else
+ {
+ $infoline = "Success: Executed $systemcall successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: After extracting tables");
+
+ # Using 8+3 table names, that are used, when tables are integrated into database. The export of tables
+ # creates idt-files, that have long names.
+
+ if ( -f "Directory.idt" ) { installer::systemactions::rename_one_file("Directory.idt", "Director.idt"); }
+ if ( -f "FeatureComponents.idt" ) { installer::systemactions::rename_one_file("FeatureComponents.idt", "FeatureC.idt"); }
+ if ( -f "MsiAssembly.idt" ) { installer::systemactions::rename_one_file("MsiAssembly.idt", "MsiAssem.idt"); }
+
+ # Changing content of tables: File, Media, Directory, FeatureComponent, MsiAssembly
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Changing Media table");
+ change_media_table($mergemodulehash, $workdir, $mergemodulegid, $allupdatelastsequences, $allupdatediskids);
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Changing File table");
+ $filesref = change_file_table($mergemodulehash, $workdir, $allupdatesequences, $includepatharrayref, $filesref, $mergemodulegid);
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Changing FeatureComponent table");
+ change_featurecomponent_table($mergemodulehash, $workdir);
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Changing Directory table");
+ change_directory_table($mergemodulehash, $workdir);
+ if ( $mergemodulehash->{'hasmsiassemblies'} )
+ {
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Changing MsiAssembly table");
+ change_msiassembly_table($mergemodulehash, $workdir);
+ }
+
+ # msidb.exe does not merge InstallExecuteSequence, AdminExecuteSequence and AdvtExecuteSequence. Instead it creates
+ # new tables ModuleInstallExecuteSequence, ModuleAdminExecuteSequence and ModuleAdvtExecuteSequence that need to be
+ # merged into the three ExecuteSequences with the following process (also into InstallUISequence.idt).
+
+ # Saving original idt files
+ if ( -f "InstallE.idt" ) { installer::systemactions::rename_one_file("InstallE.idt", "InstallE.idt.$counter"); }
+ if ( -f "InstallU.idt" ) { installer::systemactions::rename_one_file("InstallU.idt", "InstallU.idt.$counter"); }
+ if ( -f "AdminExe.idt" ) { installer::systemactions::rename_one_file("AdminExe.idt", "AdminExe.idt.$counter"); }
+ if ( -f "AdvtExec.idt" ) { installer::systemactions::rename_one_file("AdvtExec.idt", "AdvtExec.idt.$counter"); }
+ if ( -f "ModuleInstallExecuteSequence.idt" ) { installer::systemactions::rename_one_file("ModuleInstallExecuteSequence.idt", "ModuleInstallExecuteSequence.idt.$counter"); }
+ if ( -f "ModuleAdminExecuteSequence.idt" ) { installer::systemactions::rename_one_file("ModuleAdminExecuteSequence.idt", "ModuleAdminExecuteSequence.idt.$counter"); }
+ if ( -f "ModuleAdvtExecuteSequence.idt" ) { installer::systemactions::rename_one_file("ModuleAdvtExecuteSequence.idt", "ModuleAdvtExecuteSequence.idt.$counter"); }
+
+ # Extracting tables
+ my $moduleexecutetables = "ModuleInstallExecuteSequence ModuleAdminExecuteSequence ModuleAdvtExecuteSequence"; # new tables
+ my $executetables = "InstallExecuteSequence InstallUISequence AdminExecuteSequence AdvtExecuteSequence"; # tables to be merged
+
+
+ if ( $^O =~ /cygwin/i ) {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ my $localmsifilename = $msifilename;
+ my $localworkdir = $workdir;
+ $localmsifilename =~ s/\//\\\\/g;
+ $localworkdir =~ s/\//\\\\/g;
+ $systemcall = $msidb . " -d " . $localmsifilename . " -f " . $localworkdir . " -e " . "Feature " . $moduleexecutetables;
+ }
+ else
+ {
+ $systemcall = $msidb . " -d " . $msifilename . " -f " . $workdir . " -e " . "Feature " . $moduleexecutetables;
+ }
+ $returnvalue = system($systemcall);
+
+ if ( $^O =~ /cygwin/i ) {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ my $localmsifilename = $msifilename;
+ my $localworkdir = $workdir;
+ $localmsifilename =~ s/\//\\\\/g;
+ $localworkdir =~ s/\//\\\\/g;
+ $systemcall = $msidb . " -d " . $localmsifilename . " -f " . $localworkdir . " -e " . "Feature " . $executetables;
+ }
+ else
+ {
+ $systemcall = $msidb . " -d " . $msifilename . " -f " . $workdir . " -e " . "Feature " . $executetables;
+ }
+ $returnvalue = system($systemcall);
+
+ # Using 8+3 table names, that are used, when tables are integrated into database. The export of tables
+ # creates idt-files, that have long names.
+
+ if ( -f "InstallExecuteSequence.idt" ) { installer::systemactions::rename_one_file("InstallExecuteSequence.idt", "InstallE.idt"); }
+ if ( -f "InstallUISequence.idt" ) { installer::systemactions::rename_one_file("InstallUISequence.idt", "InstallU.idt"); }
+ if ( -f "AdminExecuteSequence.idt" ) { installer::systemactions::rename_one_file("AdminExecuteSequence.idt", "AdminExe.idt"); }
+ if ( -f "AdvtExecuteSequence.idt" ) { installer::systemactions::rename_one_file("AdvtExecuteSequence.idt", "AdvtExec.idt"); }
+
+ # Merging content of tables ModuleInstallExecuteSequence, ModuleAdminExecuteSequence and ModuleAdvtExecuteSequence
+ # into tables InstallExecuteSequence, AdminExecuteSequence and AdvtExecuteSequence
+ if ( -f "ModuleInstallExecuteSequence.idt" )
+ {
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Changing InstallExecuteSequence table");
+ change_executesequence_table($mergemodulehash, $workdir, "InstallE.idt", "ModuleInstallExecuteSequence.idt");
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Changing InstallUISequence table");
+ change_executesequence_table($mergemodulehash, $workdir, "InstallU.idt", "ModuleInstallExecuteSequence.idt");
+ }
+
+ if ( -f "ModuleAdminExecuteSequence.idt" )
+ {
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Changing AdminExecuteSequence table");
+ change_executesequence_table($mergemodulehash, $workdir, "AdminExe.idt", "ModuleAdminExecuteSequence.idt");
+ }
+
+ if ( -f "ModuleAdvtExecuteSequence.idt" )
+ {
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Changing AdvtExecuteSequence table");
+ change_executesequence_table($mergemodulehash, $workdir, "AdvtExec.idt", "ModuleAdvtExecuteSequence.idt");
+ }
+
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: All tables edited");
+
+ # Including tables into msi database
+
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Before including tables");
+
+ if ( $^O =~ /cygwin/i ) {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ my $localmsifilename = $msifilename;
+ my $localworkdir = $workdir;
+ $localmsifilename =~ s/\//\\\\/g;
+ $localworkdir =~ s/\//\\\\/g;
+ $systemcall = $msidb . " -d " . $localmsifilename . " -f " . $localworkdir . " -i " . $workingtables. " " . $executetables;
+ }
+ else
+ {
+ $systemcall = $msidb . " -d " . $msifilename . " -f " . $workdir . " -i " . $workingtables. " " . $executetables;
+ }
+ $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Could not include tables into msi database: $msifilename !", "merge_mergemodules_into_msi_database");
+ }
+ else
+ {
+ $infoline = "Success: Executed $systemcall successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: After including tables");
+
+ chdir($from);
+ }
+
+ if ( ! $installer::globals::mergefiles_added_into_collector ) { $installer::globals::mergefiles_added_into_collector = 1; } # Now all mergemodules are merged for one language.
+
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: MergeModule into msi database, stop");
+ }
+
+ return $filesref;
+}
+
+#########################################################################
+# Analyzing the content of the media table.
+#########################################################################
+
+sub analyze_media_file
+{
+ my ($filecontent, $workdir) = @_;
+
+ my %filehash = ();
+ my $linecount = 0;
+ my $counter = 0;
+ my $filename = "Media.idt";
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i <= 2 ) { next; } # ignoring first three lines
+ if ( ${$filecontent}[$i] =~ /^\s*$/ ) { next; } # ignoring empty lines
+ if ( ${$filecontent}[$i] =~ /^\s*(.+?)\t(.+?)\t(.+?)\t(.+?)\t(.+?)\t(.*?)\s*$/ )
+ {
+ my %line = ();
+ # Format: DiskId LastSequence DiskPrompt Cabinet VolumeLabel Source
+ $line{'DiskId'} = $1;
+ $line{'LastSequence'} = $2;
+ $line{'DiskPrompt'} = $3;
+ $line{'Cabinet'} = $4;
+ $line{'VolumeLabel'} = $5;
+ $line{'Source'} = $6;
+
+ $counter++;
+ $filehash{$counter} = \%line;
+ }
+ else
+ {
+ $linecount = $i + 1;
+ installer::exiter::exit_program("ERROR: Unknown line format in table \"$filename\" in \"$workdir\" (line $linecount) !", "analyze_media_file");
+ }
+ }
+
+ return \%filehash;
+}
+
+#########################################################################
+# Setting the DiskID for the new cabinet file
+#########################################################################
+
+sub get_diskid
+{
+ my ($mediafile, $allupdatediskids, $cabfilename) = @_;
+
+ my $diskid = 0;
+ my $line;
+
+ if (( $installer::globals::updatedatabase ) && ( exists($allupdatediskids->{$cabfilename}) ))
+ {
+ $diskid = $allupdatediskids->{$cabfilename};
+ }
+ else
+ {
+ foreach $line ( keys %{$mediafile} )
+ {
+ if ( $mediafile->{$line}->{'DiskId'} > $diskid ) { $diskid = $mediafile->{$line}->{'DiskId'}; }
+ }
+
+ $diskid++;
+ }
+
+ return $diskid;
+}
+
+#########################################################################
+# Setting the global LastSequence variable
+#########################################################################
+
+sub set_current_last_sequence
+{
+ my ($mediafile) = @_;
+
+ my $lastsequence = 0;
+ my $line;
+ foreach $line ( keys %{$mediafile} )
+ {
+ if ( $mediafile->{$line}->{'LastSequence'} > $lastsequence ) { $lastsequence = $mediafile->{$line}->{'LastSequence'}; }
+ }
+
+ $installer::globals::lastsequence_before_merge = $lastsequence;
+}
+
+#########################################################################
+# Setting the LastSequence for the new cabinet file
+#########################################################################
+
+sub get_lastsequence
+{
+ my ($mergemodulehash, $allupdatelastsequences) = @_;
+
+ my $lastsequence = 0;
+
+ if (( $installer::globals::updatedatabase ) && ( exists($allupdatelastsequences->{$mergemodulehash->{'cabfilename'}}) ))
+ {
+ $lastsequence = $allupdatelastsequences->{$mergemodulehash->{'cabfilename'}};
+ }
+ else
+ {
+ $lastsequence = $installer::globals::lastsequence_before_merge + $mergemodulehash->{'filenumber'};
+ }
+
+ return $lastsequence;
+}
+
+#########################################################################
+# Setting the DiskPrompt for the new cabinet file
+#########################################################################
+
+sub get_diskprompt
+{
+ my ($mediafile) = @_;
+
+ my $diskprompt = "";
+ my $line;
+ foreach $line ( keys %{$mediafile} )
+ {
+ if ( exists($mediafile->{$line}->{'DiskPrompt'}) )
+ {
+ $diskprompt = $mediafile->{$line}->{'DiskPrompt'};
+ last;
+ }
+ }
+
+ return $diskprompt;
+}
+
+#########################################################################
+# Setting the VolumeLabel for the new cabinet file
+#########################################################################
+
+sub get_volumelabel
+{
+ my ($mediafile) = @_;
+
+ my $volumelabel = "";
+ my $line;
+ foreach $line ( keys %{$mediafile} )
+ {
+ if ( exists($mediafile->{$line}->{'VolumeLabel'}) )
+ {
+ $volumelabel = $mediafile->{$line}->{'VolumeLabel'};
+ last;
+ }
+ }
+
+ return $volumelabel;
+}
+
+#########################################################################
+# Setting the Source for the new cabinet file
+#########################################################################
+
+sub get_source
+{
+ my ($mediafile) = @_;
+
+ my $source = "";
+ my $line;
+ foreach $line ( keys %{$mediafile} )
+ {
+ if ( exists($mediafile->{$line}->{'Source'}) )
+ {
+ $diskprompt = $mediafile->{$line}->{'Source'};
+ last;
+ }
+ }
+
+ return $source;
+}
+
+#########################################################################
+# For each Merge Module one new line has to be included into the
+# media table.
+#########################################################################
+
+sub create_new_media_line
+{
+ my ($mergemodulehash, $mediafile, $allupdatelastsequences, $allupdatediskids) = @_;
+
+ my $diskid = get_diskid($mediafile, $allupdatediskids, $mergemodulehash->{'cabfilename'});
+ my $lastsequence = get_lastsequence($mergemodulehash, $allupdatelastsequences);
+ my $diskprompt = get_diskprompt($mediafile);
+ my $cabinet = $mergemodulehash->{'cabfilename'};
+ my $volumelabel = get_volumelabel($mediafile);
+ my $source = get_source($mediafile);
+
+ if ( $installer::globals::include_cab_in_msi ) { $cabinet = "\#" . $cabinet; }
+
+ my $newline = "$diskid\t$lastsequence\t$diskprompt\t$cabinet\t$volumelabel\t$source\n";
+
+ return $newline;
+}
+
+#########################################################################
+# Setting the last diskid in media table.
+#########################################################################
+
+sub get_last_diskid
+{
+ my ($mediafile) = @_;
+
+ my $lastdiskid = 0;
+ my $line;
+ foreach $line ( keys %{$mediafile} )
+ {
+ if ( $mediafile->{$line}->{'DiskId'} > $lastdiskid ) { $lastdiskid = $mediafile->{$line}->{'DiskId'}; }
+ }
+
+ return $lastdiskid;
+}
+
+#########################################################################
+# Setting global variable for last cab file name.
+#########################################################################
+
+sub set_last_cabfile_name
+{
+ my ($mediafile, $lastdiskid) = @_;
+
+ my $line;
+ foreach $line ( keys %{$mediafile} )
+ {
+ if ( $mediafile->{$line}->{'DiskId'} == $lastdiskid ) { $installer::globals::lastcabfilename = $mediafile->{$line}->{'Cabinet'}; }
+ }
+ my $infoline = "Setting last cabinet file: $installer::globals::lastcabfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+#########################################################################
+# In the media table the new cabinet file has to be added or the
+# number of the last cabinet file has to be increased.
+#########################################################################
+
+sub change_media_table
+{
+ my ( $mergemodulehash, $workdir, $mergemodulegid, $allupdatelastsequences, $allupdatediskids ) = @_;
+
+ my $infoline = "Changing content of table \"Media\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $filename = "Media.idt";
+ if ( ! -f $filename ) { installer::exiter::exit_program("ERROR: Could not find file \"$filename\" in \"$workdir\" !", "change_media_table"); }
+
+ my $filecontent = installer::files::read_file($filename);
+ my $mediafile = analyze_media_file($filecontent, $workdir);
+ set_current_last_sequence($mediafile);
+
+ if ( $installer::globals::fix_number_of_cab_files )
+ {
+ # Determining the line with the highest sequencenumber. That file needs to be updated.
+ my $lastdiskid = get_last_diskid($mediafile);
+ if ( $installer::globals::lastcabfilename eq "" ) { set_last_cabfile_name($mediafile, $lastdiskid); }
+ my $newmaxsequencenumber = $installer::globals::lastsequence_before_merge + $mergemodulehash->{'filenumber'};
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i <= 2 ) { next; } # ignoring first three lines
+ if ( ${$filecontent}[$i] =~ /^\s*$/ ) { next; } # ignoring empty lines
+ if ( ${$filecontent}[$i] =~ /^\s*(\Q$lastdiskid\E\t)\Q$installer::globals::lastsequence_before_merge\E(\t.*)$/ )
+ {
+ my $start = $1;
+ my $final = $2;
+ $infoline = "Merge: Old line in media table: ${$filecontent}[$i]\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ my $newline = $start . $newmaxsequencenumber . $final . "\n";
+ ${$filecontent}[$i] = $newline;
+ $infoline = "Merge: Changed line in media table: ${$filecontent}[$i]\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+ else
+ {
+ # the new line is identical for all localized databases, but has to be created for each MergeModule ($mergemodulegid)
+ if ( ! exists($installer::globals::merge_media_line{$mergemodulegid}) )
+ {
+ $installer::globals::merge_media_line{$mergemodulegid} = create_new_media_line($mergemodulehash, $mediafile, $allupdatelastsequences, $allupdatediskids);
+ }
+
+ $infoline = "Adding line: $installer::globals::merge_media_line{$mergemodulegid}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # adding new line
+ push(@{$filecontent}, $installer::globals::merge_media_line{$mergemodulegid});
+ }
+
+ # saving file
+ installer::files::save_file($filename, $filecontent);
+}
+
+#########################################################################
+# Putting the directory table content into a hash.
+#########################################################################
+
+sub analyze_directorytable_file
+{
+ my ($filecontent, $idtfilename) = @_;
+
+ my %dirhash = ();
+ # Iterating over the file content
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i <= 2 ) { next; } # ignoring first three lines
+ if ( ${$filecontent}[$i] =~ /^\s*$/ ) { next; } # ignoring empty lines
+ if ( ${$filecontent}[$i] =~ /^\s*(.+?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my %line = ();
+ # Format: Directory Directory_Parent DefaultDir
+ $line{'Directory'} = $1;
+ $line{'Directory_Parent'} = $2;
+ $line{'DefaultDir'} = $3;
+ $line{'linenumber'} = $i; # saving also the line number for direct access
+
+ my $uniquekey = $line{'Directory'};
+ $dirhash{$uniquekey} = \%line;
+ }
+ else
+ {
+ my $linecount = $i + 1;
+ installer::exiter::exit_program("ERROR: Unknown line format in table \"$idtfilename\" (line $linecount) !", "analyze_directorytable_file");
+ }
+ }
+
+ return \%dirhash;
+}
+
+#########################################################################
+# Putting the msi assembly table content into a hash.
+#########################################################################
+
+sub analyze_msiassemblytable_file
+{
+ my ($filecontent, $idtfilename) = @_;
+
+ my %assemblyhash = ();
+ # Iterating over the file content
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i <= 2 ) { next; } # ignoring first three lines
+ if ( ${$filecontent}[$i] =~ /^\s*$/ ) { next; } # ignoring empty lines
+ if ( ${$filecontent}[$i] =~ /^\s*(.+?)\t(.+?)\t(.+?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my %line = ();
+ # Format: Component_ Feature_ File_Manifest File_Application Attributes
+ $line{'Component'} = $1;
+ $line{'Feature'} = $2;
+ $line{'File_Manifest'} = $3;
+ $line{'File_Application'} = $4;
+ $line{'Attributes'} = $5;
+ $line{'linenumber'} = $i; # saving also the line number for direct access
+
+ my $uniquekey = $line{'Component'};
+ $assemblyhash{$uniquekey} = \%line;
+ }
+ else
+ {
+ my $linecount = $i + 1;
+ installer::exiter::exit_program("ERROR: Unknown line format in table \"$idtfilename\" (line $linecount) !", "analyze_msiassemblytable_file");
+ }
+ }
+
+ return \%assemblyhash;
+}
+
+#########################################################################
+# Putting the file table content into a hash.
+#########################################################################
+
+sub analyze_filetable_file
+{
+ my ( $filecontent, $idtfilename ) = @_;
+
+ my %filehash = ();
+ # Iterating over the file content
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i <= 2 ) { next; } # ignoring first three lines
+ if ( ${$filecontent}[$i] =~ /^\s*$/ ) { next; } # ignoring empty lines
+ if ( ${$filecontent}[$i] =~ /^\s*(.+?)\t(.+?)\t(.+?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.+?)\s*$/ )
+ {
+ my %line = ();
+ # Format: File Component_ FileName FileSize Version Language Attributes Sequence
+ $line{'File'} = $1;
+ $line{'Component'} = $2;
+ $line{'FileName'} = $3;
+ $line{'FileSize'} = $4;
+ $line{'Version'} = $5;
+ $line{'Language'} = $6;
+ $line{'Attributes'} = $7;
+ $line{'Sequence'} = $8;
+ $line{'linenumber'} = $i; # saving also the line number for direct access
+
+ my $uniquekey = $line{'File'};
+ $filehash{$uniquekey} = \%line;
+ }
+ else
+ {
+ my $linecount = $i + 1;
+ installer::exiter::exit_program("ERROR: Unknown line format in table \"$idtfilename\" (line $linecount) !", "analyze_filetable_file");
+ }
+ }
+
+ return \%filehash;
+}
+
+#########################################################################
+# Creating a new line for the directory table.
+#########################################################################
+
+sub get_new_line_for_directory_table
+{
+ my ($dir) = @_;
+
+ my $newline = "$dir->{'Directory'}\t$dir->{'Directory_Parent'}\t$dir->{'DefaultDir'}\n";
+
+ return $newline;
+}
+
+#########################################################################
+# Creating a new line for the file table.
+#########################################################################
+
+sub get_new_line_for_file_table
+{
+ my ($file) = @_;
+
+ my $newline = "$file->{'File'}\t$file->{'Component'}\t$file->{'FileName'}\t$file->{'FileSize'}\t$file->{'Version'}\t$file->{'Language'}\t$file->{'Attributes'}\t$file->{'Sequence'}\n";
+
+ return $newline;
+}
+
+#########################################################################
+# Creating a new line for the msiassembly table.
+#########################################################################
+
+sub get_new_line_for_msiassembly_table
+{
+ my ($assembly) = @_;
+
+ my $newline = "$assembly->{'Component'}\t$assembly->{'Feature'}\t$assembly->{'File_Manifest'}\t$assembly->{'File_Application'}\t$assembly->{'Attributes'}\n";
+
+ return $newline;
+}
+
+#########################################################################
+# Sorting the files collector, if there are files, following
+# the merge module files.
+#########################################################################
+
+sub sort_files_collector_for_sequence
+{
+ my ($filesref) = @_;
+
+ my @sortarray = ();
+ my %helphash = ();
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ if ( ! exists($onefile->{'sequencenumber'}) ) { installer::exiter::exit_program("ERROR: Could not find sequencenumber for file: $onefile->{'uniquename'} !", "sort_files_collector_for_sequence"); }
+ my $sequence = $onefile->{'sequencenumber'};
+ $helphash{$sequence} = $onefile;
+ }
+
+ foreach my $seq ( sort { $a <=> $b } keys %helphash ) { push(@sortarray, $helphash{$seq}); }
+
+ return \@sortarray;
+}
+
+#########################################################################
+# In the file table "Sequence" and "Attributes" have to be changed.
+#########################################################################
+
+sub change_file_table
+{
+ my ($mergemodulehash, $workdir, $allupdatesequenceshashref, $includepatharrayref, $filesref, $mergemodulegid) = @_;
+
+ my $infoline = "Changing content of table \"File\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $idtfilename = "File.idt";
+ if ( ! -f $idtfilename ) { installer::exiter::exit_program("ERROR: Could not find file \"$idtfilename\" in \"$workdir\" !", "change_file_table"); }
+
+ my $filecontent = installer::files::read_file($idtfilename);
+
+ # If File.idt needed to be removed before the msm database was merged into the msi database,
+ # now it is time to add the content into File.idt
+ if ( $mergemodulehash->{'removefiletable'} )
+ {
+ for ( my $i = 0; $i <= $#{$mergemodulehash->{'fileidtcontent'}}; $i++ )
+ {
+ push(@{$filecontent}, ${$mergemodulehash->{'fileidtcontent'}}[$i]);
+ }
+ }
+
+ # Unpacking the MergeModule.CABinet (only once)
+ # Unpacking into temp directory. Warning: expand.exe has problems with very long unpack directories.
+
+ my $unpackdir = installer::systemactions::create_directories("cab", "");
+ push(@installer::globals::removedirs, $unpackdir);
+ $unpackdir = $unpackdir . $installer::globals::separator . $mergemodulegid;
+
+ my %newfileshash = ();
+ if (( $installer::globals::fix_number_of_cab_files ) && ( ! $installer::globals::mergefiles_added_into_collector ))
+ {
+ if ( ! -d $unpackdir ) { installer::systemactions::create_directory($unpackdir); }
+
+ # Unpack the cab file, so that in can be included into the last office cabinet file. Attention: cararc.exe from cabsdk required.
+ # cabarc.exe -o X <fullcabfilepath>
+
+ # my $cabarcfilename = "cabarc.exe";
+ # my $cabarcfile = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$cabarcfilename, $includepatharrayref, 1);
+
+ # if ( ! -f $$cabarcfile )
+ # {
+ # $cabarcfilename = "CABARC.EXE";
+ # $cabarcfile = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$cabarcfilename, $includepatharrayref, 1);
+ # if ( ! -f $$cabarcfile )
+ # {
+ # installer::exiter::exit_program("ERROR: cabarc.exe not found !", "change_file_table");
+ # }
+ # }
+ # my $cabarc = $$cabarcfile;
+
+ # changing directory
+ my $from = cwd();
+ my $to = $mergemodulehash->{'workdir'};
+ if ( $^O =~ /cygwin/i ) {
+ $to = qx(cygpath -u "$to");
+ chomp $to;
+ }
+
+ chdir($to) || die "Could not chdir to \"$to\"\n";
+
+ # Unpack the cab file, so that in can be included into the last office cabinet file.
+ # Not using cabarc.exe from cabsdk for unpacking cabinet files, but "expand.exe" that
+ # should be available on every Windows system.
+
+ $infoline = "Unpacking cabinet file: $mergemodulehash->{'cabinetfile'}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Avoid the Cygwin expand command
+ my $expandfile = "expand.exe"; # Has to be in the path
+ if ( $^O =~ /cygwin/i ) {
+ $expandfile = qx(cygpath -u "$ENV{WINDIR}"/System32/expand.exe);
+ chomp $expandfile;
+ }
+
+ my $cabfilename = "MergeModule.CABinet";
+
+ # exclude cabinet file
+ # my $systemcall = $cabarc . " -o X " . $mergemodulehash->{'cabinetfile'};
+
+ my $systemcall = "";
+ if ( $^O =~ /cygwin/i ) {
+ my $localunpackdir = qx(cygpath -m "$unpackdir");
+ chomp $localunpackdir;
+ $systemcall = $expandfile . " " . $cabfilename . " -F:\\\* " . $localunpackdir;
+ }
+ else
+ {
+ $systemcall = $expandfile . " " . $cabfilename . " -F:\* " . $unpackdir . " 2\>\&1";
+ }
+
+ my $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Could not extract cabinet file: $mergemodulehash->{'cabinetfile'} !", "change_file_table");
+ }
+ else
+ {
+ $infoline = "Success: Executed $systemcall successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ chdir($from);
+ }
+
+ # For performance reasons creating a hash with file names and rows
+ # The content of File.idt is changed after every merge -> content cannot be saved in global hash
+ $merge_filetablehashref = analyze_filetable_file($filecontent, $idtfilename);
+
+ my $attributes = "16384"; # Always
+
+ my $filename;
+ foreach $filename (keys %{$mergemodulehash->{'mergefilesequence'}} )
+ {
+ my $mergefilesequence = $mergemodulehash->{'mergefilesequence'}->{$filename};
+
+ if ( ! exists($merge_filetablehashref->{$filename}) ) { installer::exiter::exit_program("ERROR: Could not find file \"$filename\" in \"$idtfilename\" !", "change_file_table"); }
+ my $filehash = $merge_filetablehashref->{$filename};
+ my $linenumber = $filehash->{'linenumber'};
+
+ # <- this line has to be changed concerning "Sequence" and "Attributes"
+ $filehash->{'Attributes'} = $attributes;
+
+ # If this is an update process, the sequence numbers have to be reused.
+ if ( $installer::globals::updatedatabase )
+ {
+ if ( ! exists($allupdatesequenceshashref->{$filehash->{'File'}}) ) { installer::exiter::exit_program("ERROR: Sequence not defined for file \"$filehash->{'File'}\" !", "change_file_table"); }
+ $filehash->{'Sequence'} = $allupdatesequenceshashref->{$filehash->{'File'}};
+ # Saving all mergemodule sequence numbers. This is important for creating ddf files
+ $installer::globals::allmergemodulefilesequences{$filehash->{'Sequence'}} = 1;
+ }
+ else
+ {
+ # Important saved data: $installer::globals::lastsequence_before_merge.
+ # This mechanism keeps the correct order inside the new cabinet file.
+ $filehash->{'Sequence'} = $filehash->{'Sequence'} + $installer::globals::lastsequence_before_merge;
+ }
+
+ my $oldline = ${$filecontent}[$linenumber];
+ my $newline = get_new_line_for_file_table($filehash);
+ ${$filecontent}[$linenumber] = $newline;
+
+ $infoline = "Merge, replacing line:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "Old: $oldline\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "New: $newline\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Adding files to the files collector (but only once)
+ if (( $installer::globals::fix_number_of_cab_files ) && ( ! $installer::globals::mergefiles_added_into_collector ))
+ {
+ # If the number of cabinet files is kept constant,
+ # all files from the mergemodule cabinet files will
+ # be integrated into the last office cabinet file
+ # (installer::globals::lastcabfilename).
+ # Therefore the files must now be added to the filescollector,
+ # so that they will be integrated into the ddf files.
+
+ # Problem with very long filenames -> copying to shorter filenames
+ my $newfilename = "f" . $filehash->{'Sequence'};
+ my $completesource = $unpackdir . $installer::globals::separator . $filehash->{'File'};
+ my $completedest = $unpackdir . $installer::globals::separator . $newfilename;
+ installer::systemactions::copy_one_file($completesource, $completedest);
+
+ my $locallastcabfilename = $installer::globals::lastcabfilename;
+ if ( $locallastcabfilename =~ /^\s*\#/ ) { $locallastcabfilename =~ s/^\s*\#//; } # removing beginning hashes
+
+ # Create new file hash for file collector
+ my %newfile = ();
+ $newfile{'sequencenumber'} = $filehash->{'Sequence'};
+ $newfile{'assignedsequencenumber'} = $filehash->{'Sequence'};
+ $newfile{'cabinet'} = $locallastcabfilename;
+ $newfile{'sourcepath'} = $completedest;
+ $newfile{'componentname'} = $filehash->{'Component'};
+ $newfile{'uniquename'} = $filehash->{'File'};
+ $newfile{'Name'} = $filehash->{'File'};
+
+ # Saving in globals sequence hash
+ $installer::globals::uniquefilenamesequence{$filehash->{'File'}} = $filehash->{'Sequence'};
+
+ if ( ! -f $newfile{'sourcepath'} ) { installer::exiter::exit_program("ERROR: File \"$newfile{'sourcepath'}\" must exist!", "change_file_table"); }
+
+ # Collecting all new files. Attention: This files must be included into files collector in correct order!
+ $newfileshash{$filehash->{'Sequence'}} = \%newfile;
+ # push(@{$filesref}, \%newfile); -> this is not the correct order
+ }
+ }
+
+ # Now the files can be added to the files collector
+ # In the case of an update process, there can be new files, that have to be added after the merge module files.
+ # Warning: In multilingual installation sets, the files only have to be added once to the files collector!
+
+ if ( ! $installer::globals::mergefiles_added_into_collector )
+ {
+ foreach my $localsequence ( sort { $a <=> $b } keys %newfileshash ) { push(@{$filesref}, $newfileshash{$localsequence}); }
+ if ( $installer::globals::newfilesexist ) { $filesref = sort_files_collector_for_sequence($filesref); }
+ # $installer::globals::mergefiles_added_into_collector = 1; -> Not yet. Only if all mergemodules are merged for one language.
+ }
+
+ # Saving the idt file (for every language)
+ installer::files::save_file($idtfilename, $filecontent);
+
+ return $filesref;
+}
+
+#########################################################################
+# Reading the file "Director.idt". The Directory, that is defined in scp
+# has to be defined in this table.
+#########################################################################
+
+sub collect_directories
+{
+ my $idtfilename = "Director.idt";
+ my $filecontent = installer::files::read_file($idtfilename);
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i <= 2 ) { next; } # ignoring first three lines
+ if ( ${$filecontent}[$i] =~ /^\s*$/ ) { next; } # ignoring empty lines
+ # Format: Directory Directory_Parent DefaultDir
+ if ( ${$filecontent}[$i] =~ /^\s*(.+?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ $installer::globals::merge_alldirectory_hash{$1} = 1;
+ }
+ else
+ {
+ my $linecount = $i + 1;
+ installer::exiter::exit_program("ERROR: Unknown line format in table \"$idtfilename\" (line $linecount) !", "collect_directories");
+ }
+ }
+}
+
+#########################################################################
+# Reading the file "Feature.idt". The Feature, that is defined in scp
+# has to be defined in this table.
+#########################################################################
+
+sub collect_feature
+{
+ my $idtfilename = "Feature.idt";
+ if ( ! -f $idtfilename ) { installer::exiter::exit_program("ERROR: Could not find file \"$idtfilename\" in \"$workdir\" !", "collect_feature"); }
+ my $filecontent = installer::files::read_file($idtfilename);
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i <= 2 ) { next; } # ignoring first three lines
+ if ( ${$filecontent}[$i] =~ /^\s*$/ ) { next; } # ignoring empty lines
+ # Format: Feature Feature_Parent Title Description Display Level Directory_ Attributes
+ if ( ${$filecontent}[$i] =~ /^\s*(.+?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ $installer::globals::merge_allfeature_hash{$1} = 1;
+ }
+ else
+ {
+ my $linecount = $i + 1;
+ installer::exiter::exit_program("ERROR: Unknown line format in table \"$idtfilename\" (line $linecount) !", "collect_feature");
+ }
+ }
+}
+
+#########################################################################
+# In the featurecomponent table, the new connections have to be added.
+#########################################################################
+
+sub change_featurecomponent_table
+{
+ my ($mergemodulehash, $workdir) = @_;
+
+ my $infoline = "Changing content of table \"FeatureComponents\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $idtfilename = "FeatureC.idt";
+ if ( ! -f $idtfilename ) { installer::exiter::exit_program("ERROR: Could not find file \"$idtfilename\" in \"$workdir\" !", "change_featurecomponent_table"); }
+
+ my $filecontent = installer::files::read_file($idtfilename);
+
+ # Simply adding for each new component one line. The Feature has to be defined in scp project.
+ my $feature = $mergemodulehash->{'feature'};
+
+ if ( ! $installer::globals::mergefeaturecollected )
+ {
+ collect_feature(); # putting content into hash %installer::globals::merge_allfeature_hash
+ $installer::globals::mergefeaturecollected = 1;
+ }
+
+ if ( ! exists($installer::globals::merge_allfeature_hash{$feature}) )
+ {
+ installer::exiter::exit_program("ERROR: Unknown feature defined in scp: \"$feature\" . Not defined in table \"Feature\" !", "change_featurecomponent_table");
+ }
+
+ my $component;
+ foreach $component ( keys %{$mergemodulehash->{'componentnames'}} )
+ {
+ my $line = "$feature\t$component\n";
+ push(@{$filecontent}, $line);
+ $infoline = "Adding line: $line\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ # saving file
+ installer::files::save_file($idtfilename, $filecontent);
+}
+
+#########################################################################
+# In the directory table, the directory parent has to be changed,
+# if it is not TARGETDIR.
+#########################################################################
+
+sub change_directory_table
+{
+ my ($mergemodulehash, $workdir) = @_;
+
+ # directory for MergeModule has to be defined in scp project
+ my $scpdirectory = $mergemodulehash->{'rootdir'};
+
+ if ( $scpdirectory ne "TARGETDIR" ) # TARGETDIR works fine, when using msidb.exe
+ {
+ my $infoline = "Changing content of table \"Directory\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $idtfilename = "Director.idt";
+ if ( ! -f $idtfilename ) { installer::exiter::exit_program("ERROR: Could not find file \"$idtfilename\" in \"$workdir\" !", "change_directory_table"); }
+
+ my $filecontent = installer::files::read_file($idtfilename);
+
+ if ( ! $installer::globals::mergedirectoriescollected )
+ {
+ collect_directories(); # putting content into %installer::globals::merge_alldirectory_hash, only first column!
+ $installer::globals::mergedirectoriescollected = 1;
+ }
+
+ if ( ! exists($installer::globals::merge_alldirectory_hash{$scpdirectory}) )
+ {
+ installer::exiter::exit_program("ERROR: Unknown directory defined in scp: \"$scpdirectory\" . Not defined in table \"Directory\" !", "change_directory_table");
+ }
+
+ # If the definition in scp is okay, now the complete content of "Director.idt" can be analyzed
+ my $merge_directorytablehashref = analyze_directorytable_file($filecontent, $idtfilename);
+
+ my $directory;
+ foreach $directory (keys %{$mergemodulehash->{'mergedirectories'}} )
+ {
+ if ( ! exists($merge_directorytablehashref->{$directory}) ) { installer::exiter::exit_program("ERROR: Could not find directory \"$directory\" in \"$idtfilename\" !", "change_directory_table"); }
+ my $dirhash = $merge_directorytablehashref->{$directory};
+ my $linenumber = $dirhash->{'linenumber'};
+
+ # <- this line has to be changed concerning "Directory_Parent",
+ # if the current value is "TARGETDIR", which is the default value from msidb.exe
+
+ if ( $dirhash->{'Directory_Parent'} eq "TARGETDIR" )
+ {
+ $dirhash->{'Directory_Parent'} = $scpdirectory;
+
+ my $oldline = ${$filecontent}[$linenumber];
+ my $newline = get_new_line_for_directory_table($dirhash);
+ ${$filecontent}[$linenumber] = $newline;
+
+ $infoline = "Merge, replacing line:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "Old: $oldline\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "New: $newline\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ # saving file
+ installer::files::save_file($idtfilename, $filecontent);
+ }
+}
+
+#########################################################################
+# In the msiassembly table, the feature has to be changed.
+#########################################################################
+
+sub change_msiassembly_table
+{
+ my ($mergemodulehash, $workdir) = @_;
+
+ my $infoline = "Changing content of table \"MsiAssembly\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $idtfilename = "MsiAssem.idt";
+ if ( ! -f $idtfilename ) { installer::exiter::exit_program("ERROR: Could not find file \"$idtfilename\" in \"$workdir\" !", "change_msiassembly_table"); }
+
+ my $filecontent = installer::files::read_file($idtfilename);
+
+ # feature has to be defined in scp project
+ my $feature = $mergemodulehash->{'feature'};
+
+ if ( ! $installer::globals::mergefeaturecollected )
+ {
+ collect_feature(); # putting content into hash %installer::globals::merge_allfeature_hash
+ $installer::globals::mergefeaturecollected = 1;
+ }
+
+ if ( ! exists($installer::globals::merge_allfeature_hash{$feature}) )
+ {
+ installer::exiter::exit_program("ERROR: Unknown feature defined in scp: \"$feature\" . Not defined in table \"Feature\" !", "change_msiassembly_table");
+ }
+
+ my $merge_msiassemblytablehashref = analyze_msiassemblytable_file($filecontent, $idtfilename);
+
+ my $component;
+ foreach $component (keys %{$mergemodulehash->{'mergeassemblies'}} )
+ {
+ if ( ! exists($merge_msiassemblytablehashref->{$component}) ) { installer::exiter::exit_program("ERROR: Could not find component \"$component\" in \"$idtfilename\" !", "change_msiassembly_table"); }
+ my $assemblyhash = $merge_msiassemblytablehashref->{$component};
+ my $linenumber = $assemblyhash->{'linenumber'};
+
+ # <- this line has to be changed concerning "Feature"
+ $assemblyhash->{'Feature'} = $feature;
+
+ my $oldline = ${$filecontent}[$linenumber];
+ my $newline = get_new_line_for_msiassembly_table($assemblyhash);
+ ${$filecontent}[$linenumber] = $newline;
+
+ $infoline = "Merge, replacing line:\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "Old: $oldline\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "New: $newline\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ # saving file
+ installer::files::save_file($idtfilename, $filecontent);
+}
+
+#########################################################################
+# Creating file content hash
+#########################################################################
+
+sub make_executeidtcontent_hash
+{
+ my ($filecontent, $idtfilename) = @_;
+
+ my %newhash = ();
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i <= 2 ) { next; } # ignoring first three lines
+ if ( ${$filecontent}[$i] =~ /^\s*$/ ) { next; } # ignoring empty lines
+ # Format for all sequence tables: Action Condition Sequence
+ if ( ${$filecontent}[$i] =~ /^\s*(.+?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my %onehash = ();
+ $onehash{'Action'} = $1;
+ $onehash{'Condition'} = $2;
+ $onehash{'Sequence'} = $3;
+ $newhash{$onehash{'Action'}} = \%onehash;
+ }
+ else
+ {
+ my $linecount = $i + 1;
+ installer::exiter::exit_program("ERROR: Unknown line format in table \"$idtfilename\" (line $linecount) !", "make_executeidtcontent_hash");
+ }
+ }
+
+ return \%newhash;
+}
+
+#########################################################################
+# Creating file content hash
+#########################################################################
+
+sub make_moduleexecuteidtcontent_hash
+{
+ my ($filecontent, $idtfilename) = @_;
+
+ my %newhash = ();
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i <= 2 ) { next; } # ignoring first three lines
+ if ( ${$filecontent}[$i] =~ /^\s*$/ ) { next; } # ignoring empty lines
+ # Format for all module sequence tables: Action Sequence BaseAction After Condition
+ if ( ${$filecontent}[$i] =~ /^\s*(.+?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my %onehash = ();
+ $onehash{'Action'} = $1;
+ $onehash{'Sequence'} = $2;
+ $onehash{'BaseAction'} = $3;
+ $onehash{'After'} = $4;
+ $onehash{'Condition'} = $5;
+ $newhash{$onehash{'Action'}} = \%onehash;
+ }
+ else
+ {
+ my $linecount = $i + 1;
+ installer::exiter::exit_program("ERROR: Unknown line format in table \"$idtfilename\" (line $linecount) !", "make_executeidtcontent_hash");
+ }
+ }
+
+ return \%newhash;
+}
+
+#########################################################################
+# ExecuteSequence tables need to be merged with
+# ModuleExecuteSequence tables created by msidb.exe.
+#########################################################################
+
+sub change_executesequence_table
+{
+ my ($mergemodulehash, $workdir, $idtfilename, $moduleidtfilename) = @_;
+
+ my $infoline = "Changing content of table \"$idtfilename\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( ! -f $idtfilename ) { installer::exiter::exit_program("ERROR: Could not find file \"$idtfilename\" in \"$workdir\" !", "change_executesequence_table"); }
+ if ( ! -f $moduleidtfilename ) { installer::exiter::exit_program("ERROR: Could not find file \"$moduleidtfilename\" in \"$workdir\" !", "change_executesequence_table"); }
+
+ # Reading file content
+ my $idtfilecontent = installer::files::read_file($idtfilename);
+ my $moduleidtfilecontent = installer::files::read_file($moduleidtfilename);
+
+ # Converting to hash
+ my $idtcontenthash = make_executeidtcontent_hash($idtfilecontent, $idtfilename);
+ my $moduleidtcontenthash = make_moduleexecuteidtcontent_hash($moduleidtfilecontent, $moduleidtfilename);
+
+ # Merging
+ foreach my $action ( keys %{$moduleidtcontenthash} )
+ {
+ if ( exists($idtcontenthash->{$action}) ) { next; } # Action already exists, can be ignored
+
+ if (( $idtfilename eq "InstallU.idt" ) && ( ! ( $action =~ /^\s*WindowsFolder\./ ))) { next; } # Only "WindowsFolder.*" CustomActions for UI Sequence table
+
+ my $actionhashref = $moduleidtcontenthash->{$action};
+ if ( $actionhashref->{'Sequence'} ne "" )
+ {
+ # Format for all sequence tables: Action Condition Sequence
+ my $newline = $actionhashref->{'Action'} . "\t" . $actionhashref->{'Condition'} . "\t" . $actionhashref->{'Sequence'} . "\n";
+ # Adding to table
+ push(@{$idtfilecontent}, $newline);
+ # Also adding to hash
+ my %idttablehash = ();
+ $idttablehash{'Action'} = $actionhashref->{'Action'};
+ $idttablehash{'Condition'} = $actionhashref->{'Condition'};
+ $idttablehash{'Sequence'} = $actionhashref->{'Sequence'};
+ $idtcontenthash->{$action} = \%idttablehash;
+
+ }
+ else # no sequence defined, using syntax "BaseAction" and "After"
+ {
+ my $baseactionname = $actionhashref->{'BaseAction'};
+ # If this baseactionname is not defined in execute idt file, it is not possible to merge
+ if ( ! exists($idtcontenthash->{$baseactionname}) ) { installer::exiter::exit_program("ERROR: Merge problem: Could not find action \"$baseactionname\" in file \"$idtfilename\" !", "change_executesequence_table"); }
+
+ my $baseaction = $idtcontenthash->{$baseactionname};
+ my $sequencenumber = $baseaction->{'Sequence'};
+ if ( $actionhashref->{'After'} == 1 ) { $sequencenumber = $sequencenumber + 1; }
+ else { $sequencenumber = $sequencenumber - 1; }
+
+ # Format for all sequence tables: Action Condition Sequence
+ my $newline = $actionhashref->{'Action'} . "\t" . $actionhashref->{'Condition'} . "\t" . $sequencenumber . "\n";
+ # Adding to table
+ push(@{$idtfilecontent}, $newline);
+ # Also adding to hash
+ my %idttablehash = ();
+ $idttablehash{'Action'} = $actionhashref->{'Action'};
+ $idttablehash{'Condition'} = $actionhashref->{'Condition'};
+ $idttablehash{'Sequence'} = $sequencenumber;
+ $idtcontenthash->{$action} = \%idttablehash;
+ }
+ }
+
+ # saving file
+ installer::files::save_file($idtfilename, $idtfilecontent);
+}
+
+
+1;
diff --git a/solenv/bin/modules/installer/windows/msiglobal.pm b/solenv/bin/modules/installer/windows/msiglobal.pm
new file mode 100644
index 000000000000..716f63499a02
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/msiglobal.pm
@@ -0,0 +1,2264 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::msiglobal;
+
+use Cwd;
+use Digest::MD5;
+use installer::converter;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::remover;
+use installer::scriptitems;
+use installer::systemactions;
+use installer::worker;
+use installer::windows::idtglobal;
+use installer::windows::language;
+
+###########################################################################
+# Generating the header of the ddf file.
+# The usage of ddf files is needed, because makecab.exe can only include
+# one sourcefile into a cab file
+###########################################################################
+
+sub write_ddf_file_header
+{
+ my ($ddffileref, $cabinetfile, $installdir) = @_;
+
+ my $oneline;
+
+ $oneline = ".Set CabinetName1=" . $cabinetfile . "\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set ReservePerCabinetSize=128\n"; # This reserves space for a digital signature.
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set MaxDiskSize=2147483648\n"; # This allows the .cab file to get a size of 2 GB.
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set CompressionType=LZX\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set Compress=ON\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set CompressionLevel=$installer::globals::cabfilecompressionlevel\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set Cabinet=ON\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set DiskDirectoryTemplate=" . $installdir . "\n";
+ push(@{$ddffileref} ,$oneline);
+}
+
+##########################################################################
+# Lines in ddf files must not contain more than 256 characters
+##########################################################################
+
+sub check_ddf_file
+{
+ my ( $ddffile, $ddffilename ) = @_;
+
+ my $maxlength = 0;
+ my $maxline = 0;
+ my $linelength = 0;
+ my $linenumber = 0;
+
+ for ( my $i = 0; $i <= $#{$ddffile}; $i++ )
+ {
+ my $oneline = ${$ddffile}[$i];
+
+ $linelength = length($oneline);
+ $linenumber = $i + 1;
+
+ if ( $linelength > 256 )
+ {
+ installer::exiter::exit_program("ERROR \"$ddffilename\" line $linenumber: Lines in ddf files must not contain more than 256 characters!", "check_ddf_file");
+ }
+
+ if ( $linelength > $maxlength )
+ {
+ $maxlength = $linelength;
+ $maxline = $linenumber;
+ }
+ }
+
+ my $infoline = "Check of ddf file \"$ddffilename\": Maximum length \"$maxlength\" in line \"$maxline\" (allowed line length: 256 characters)\n";
+ push(@installer::globals::logfileinfo, $infoline);
+}
+
+##########################################################################
+# Lines in ddf files must not be longer than 256 characters.
+# Therefore it can be useful to use relative pathes. Then it is
+# necessary to change into temp directory before calling
+# makecab.exe.
+##########################################################################
+
+sub make_relative_ddf_path
+{
+ my ( $sourcepath ) = @_;
+
+ my $windowstemppath = $installer::globals::temppath;
+
+ if ( $^O =~ /cygwin/i )
+ {
+ $windowstemppath = $installer::globals::cyg_temppath;
+ }
+
+ $sourcepath =~ s/\Q$windowstemppath\E//;
+ $sourcepath =~ s/^\\//;
+
+ return $sourcepath;
+}
+
+##########################################################################
+# Returning the order of the sequences in the files array.
+##########################################################################
+
+sub get_sequenceorder
+{
+ my ($filesref) = @_;
+
+ my %order = ();
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ if ( ! $onefile->{'assignedsequencenumber'} ) { installer::exiter::exit_program("ERROR: No sequence number assigned to $onefile->{'gid'} ($onefile->{'uniquename'})!", "get_sequenceorder"); }
+ $order{$onefile->{'assignedsequencenumber'}} = $i;
+ }
+
+ return \%order;
+}
+
+##########################################################################
+# Generation the list, in which the source of the files is connected
+# with the cabinet destination file. Because more than one file needs
+# to be included into a cab file, this has to be done via ddf files.
+##########################################################################
+
+sub generate_cab_file_list
+{
+ my ($filesref, $installdir, $ddfdir, $allvariables) = @_;
+
+ my @cabfilelist = ();
+
+ installer::logger::include_header_into_logfile("Generating ddf files");
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: ddf file generation start");
+
+ if ( $^O =~ /cygwin/i ) { installer::worker::generate_cygwin_pathes($filesref); }
+
+ if ( $installer::globals::use_packages_for_cabs )
+ {
+ my $sequenceorder = get_sequenceorder($filesref);
+
+ my $counter = 1;
+ my $currentcabfile = "";
+
+ while ( ( exists($sequenceorder->{$counter}) ) || ( exists($installer::globals::allmergemodulefilesequences{$counter}) ) ) # Taking care of files from merge modules
+ {
+ if ( exists($installer::globals::allmergemodulefilesequences{$counter}) )
+ {
+ # Skipping this sequence, it is not included in $filesref, because it is assigned to a file from a merge module.\n";
+ $counter++;
+ next;
+ }
+
+ # Files with increasing sequencerorder are included in one cab file
+ my $onefile = ${$filesref}[$sequenceorder->{$counter}];
+ my $cabinetfile = $onefile->{'assignedcabinetfile'};
+ my $sourcepath = $onefile->{'sourcepath'};
+ if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; }
+ my $uniquename = $onefile->{'uniquename'};
+
+ my $styles = "";
+ my $doinclude = 1;
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; };
+ if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; }
+
+ # to avoid lines with more than 256 characters, it can be useful to use relative pathes
+ if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); }
+
+ # all files with the same cabinetfile have increasing sequencenumbers
+
+ my @ddffile = ();
+
+ write_ddf_file_header(\@ddffile, $cabinetfile, $installdir);
+
+ my $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n";
+ if ( $doinclude ) { push(@ddffile, $ddfline); }
+
+ $counter++; # increasing the counter
+ my $nextfile = "";
+ my $nextcabinetfile = "";
+ if ( exists($sequenceorder->{$counter}) ) { $nextfile = ${$filesref}[$sequenceorder->{$counter}]; }
+ if ( $nextfile->{'assignedcabinetfile'} ) { $nextcabinetfile = $nextfile->{'assignedcabinetfile'}; }
+
+ while ( $nextcabinetfile eq $cabinetfile )
+ {
+ $sourcepath = $nextfile->{'sourcepath'};
+ if ( $^O =~ /cygwin/i ) { $sourcepath = $nextfile->{'cyg_sourcepath'}; }
+ # to avoid lines with more than 256 characters, it can be useful to use relative pathes
+ if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); }
+ $uniquename = $nextfile->{'uniquename'};
+ my $localdoinclude = 1;
+ my $nextfilestyles = "";
+ if ( $nextfile->{'Styles'} ) { $nextfilestyles = $nextfile->{'Styles'}; }
+ if ( $nextfilestyles =~ /\bDONT_PACK\b/ ) { $localdoinclude = 0; }
+ $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n";
+ if ( $localdoinclude ) { push(@ddffile, $ddfline); }
+
+ $counter++; # increasing the counter!
+ $nextcabinetfile = "_lastfile_";
+ if ( exists($sequenceorder->{$counter}) )
+ {
+ $nextfile = ${$filesref}[$sequenceorder->{$counter}];
+ $nextcabinetfile = $nextfile->{'assignedcabinetfile'};
+ }
+ }
+
+ # creating the DDF file
+
+ my $ddffilename = $cabinetfile;
+ $ddffilename =~ s/.cab/.ddf/;
+ $ddfdir =~ s/\Q$installer::globals::separator\E\s*$//;
+ $ddffilename = $ddfdir . $installer::globals::separator . $ddffilename;
+
+ installer::files::save_file($ddffilename ,\@ddffile);
+ my $infoline = "Created ddf file: $ddffilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ # lines in ddf files must not be longer than 256 characters
+ check_ddf_file(\@ddffile, $ddffilename);
+
+ # Writing the makecab system call
+
+ my $oneline = "makecab.exe /V3 /F " . $ddffilename . " 2\>\&1 |" . "\n";
+
+ push(@cabfilelist, $oneline);
+
+ # collecting all ddf files
+ push(@installer::globals::allddffiles, $ddffilename);
+ }
+ }
+ elsif ((( $installer::globals::cab_file_per_component ) || ( $installer::globals::fix_number_of_cab_files )) && ( $installer::globals::updatedatabase ))
+ {
+ my $sequenceorder = get_sequenceorder($filesref);
+
+ my $counter = 1;
+ my $currentcabfile = "";
+
+ while ( ( exists($sequenceorder->{$counter}) ) || ( exists($installer::globals::allmergemodulefilesequences{$counter}) ) ) # Taking care of files from merge modules
+ {
+# if ( exists($installer::globals::allmergemodulefilesequences{$counter}) )
+# {
+# # Skipping this sequence, it is not included in $filesref, because it is assigned to a file from a merge module.\n";
+# $counter++;
+# next;
+# }
+
+ my $onefile = ${$filesref}[$sequenceorder->{$counter}];
+ $counter++;
+
+ my $cabinetfile = $onefile->{'cabinet'};
+ my $sourcepath = $onefile->{'sourcepath'};
+ if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; }
+ my $uniquename = $onefile->{'uniquename'};
+
+ my $styles = "";
+ my $doinclude = 1;
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; };
+ if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; }
+
+ # to avoid lines with more than 256 characters, it can be useful to use relative pathes
+ if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); }
+
+ my @ddffile = ();
+
+ write_ddf_file_header(\@ddffile, $cabinetfile, $installdir);
+
+ my $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n";
+ if ( $doinclude ) { push(@ddffile, $ddfline); }
+
+ my $nextfile = "";
+ if ( ${$filesref}[$sequenceorder->{$counter}] ) { $nextfile = ${$filesref}[$sequenceorder->{$counter}]; }
+
+ my $nextcabinetfile = "";
+
+ if ( $nextfile->{'cabinet'} ) { $nextcabinetfile = $nextfile->{'cabinet'}; }
+
+ while ( $nextcabinetfile eq $cabinetfile )
+ {
+ $sourcepath = $nextfile->{'sourcepath'};
+ if ( $^O =~ /cygwin/i ) { $sourcepath = $nextfile->{'cyg_sourcepath'}; }
+ # to avoid lines with more than 256 characters, it can be useful to use relative pathes
+ if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); }
+ $uniquename = $nextfile->{'uniquename'};
+ my $localdoinclude = 1;
+ my $nextfilestyles = "";
+ if ( $nextfile->{'Styles'} ) { $nextfilestyles = $nextfile->{'Styles'}; }
+ if ( $nextfilestyles =~ /\bDONT_PACK\b/ ) { $localdoinclude = 0; }
+ $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n";
+ if ( $localdoinclude ) { push(@ddffile, $ddfline); }
+ $counter++; # increasing the counter!
+ $nextfile = "";
+ $nextcabinetfile = "_lastfile_";
+ if (( exists($sequenceorder->{$counter}) ) && ( ${$filesref}[$sequenceorder->{$counter}] ))
+ {
+ $nextfile = ${$filesref}[$sequenceorder->{$counter}];
+ $nextcabinetfile = $nextfile->{'cabinet'};
+ }
+ }
+
+ # creating the DDF file
+
+ my $ddffilename = $cabinetfile;
+ $ddffilename =~ s/.cab/.ddf/;
+ $ddfdir =~ s/\Q$installer::globals::separator\E\s*$//;
+ $ddffilename = $ddfdir . $installer::globals::separator . $ddffilename;
+
+ installer::files::save_file($ddffilename ,\@ddffile);
+ my $infoline = "Created ddf file: $ddffilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ # lines in ddf files must not be longer than 256 characters
+ check_ddf_file(\@ddffile, $ddffilename);
+
+ # Writing the makecab system call
+
+ my $oneline = "makecab.exe /V3 /F " . $ddffilename . " 2\>\&1 |" . "\n";
+
+ push(@cabfilelist, $oneline);
+
+ # collecting all ddf files
+ push(@installer::globals::allddffiles, $ddffilename);
+ }
+ }
+ elsif (( $installer::globals::cab_file_per_component ) || ( $installer::globals::fix_number_of_cab_files ))
+ {
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ my $cabinetfile = $onefile->{'cabinet'};
+ my $sourcepath = $onefile->{'sourcepath'};
+ if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; }
+ my $uniquename = $onefile->{'uniquename'};
+
+ my $styles = "";
+ my $doinclude = 1;
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; };
+ if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; }
+
+
+ # to avoid lines with more than 256 characters, it can be useful to use relative pathes
+ if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); }
+
+ # all files with the same cabinetfile are directly behind each other in the files collector
+
+ my @ddffile = ();
+
+ write_ddf_file_header(\@ddffile, $cabinetfile, $installdir);
+
+ my $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n";
+ if ( $doinclude ) { push(@ddffile, $ddfline); }
+
+ my $nextfile = ${$filesref}[$i+1];
+ my $nextcabinetfile = "";
+
+ if ( $nextfile->{'cabinet'} ) { $nextcabinetfile = $nextfile->{'cabinet'}; }
+
+ while ( $nextcabinetfile eq $cabinetfile )
+ {
+ $sourcepath = $nextfile->{'sourcepath'};
+ if ( $^O =~ /cygwin/i ) { $sourcepath = $nextfile->{'cyg_sourcepath'}; }
+ # to avoid lines with more than 256 characters, it can be useful to use relative pathes
+ if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); }
+ $uniquename = $nextfile->{'uniquename'};
+ my $localdoinclude = 1;
+ my $nextfilestyles = "";
+ if ( $nextfile->{'Styles'} ) { $nextfilestyles = $nextfile->{'Styles'}; }
+ if ( $nextfilestyles =~ /\bDONT_PACK\b/ ) { $localdoinclude = 0; }
+ $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n";
+ if ( $localdoinclude ) { push(@ddffile, $ddfline); }
+ $i++; # increasing the counter!
+ $nextfile = ${$filesref}[$i+1];
+ if ( $nextfile ) { $nextcabinetfile = $nextfile->{'cabinet'}; }
+ else { $nextcabinetfile = "_lastfile_"; }
+ }
+
+ # creating the DDF file
+
+ my $ddffilename = $cabinetfile;
+ $ddffilename =~ s/.cab/.ddf/;
+ $ddfdir =~ s/\Q$installer::globals::separator\E\s*$//;
+ $ddffilename = $ddfdir . $installer::globals::separator . $ddffilename;
+
+ installer::files::save_file($ddffilename ,\@ddffile);
+ my $infoline = "Created ddf file: $ddffilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ # lines in ddf files must not be longer than 256 characters
+ check_ddf_file(\@ddffile, $ddffilename);
+
+ # Writing the makecab system call
+
+ my $oneline = "makecab.exe /V3 /F " . $ddffilename . " 2\>\&1 |" . "\n";
+
+ push(@cabfilelist, $oneline);
+
+ # collecting all ddf files
+ push(@installer::globals::allddffiles, $ddffilename);
+ }
+ }
+ elsif (( $installer::globals::one_cab_file ) && ( $installer::globals::updatedatabase ))
+ {
+ my $sequenceorder = get_sequenceorder($filesref);
+
+ my $counter = 1;
+ my $currentcabfile = "";
+
+ while ( ( exists($sequenceorder->{$counter}) ) || ( exists($installer::globals::allmergemodulefilesequences{$counter}) ) ) # Taking care of files from merge modules
+ {
+ if ( exists($installer::globals::allmergemodulefilesequences{$counter}) )
+ {
+ # Skipping this sequence, it is not included in $filesref, because it is assigned to a file from a merge module.\n";
+ $counter++;
+ next;
+ }
+
+ my $onefile = ${$filesref}[$sequenceorder->{$counter}];
+
+ $cabinetfile = $onefile->{'cabinet'};
+ my $sourcepath = $onefile->{'sourcepath'};
+ if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; }
+ my $uniquename = $onefile->{'uniquename'};
+
+ # to avoid lines with more than 256 characters, it can be useful to use relative pathes
+ if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); }
+
+ if ( $counter == 1 ) { write_ddf_file_header(\@ddffile, $cabinetfile, $installdir); }
+
+ my $styles = "";
+ my $doinclude = 1;
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; };
+ if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; }
+
+ my $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n";
+ if ( $doinclude ) { push(@ddffile, $ddfline); }
+
+ $counter++; # increasing the counter
+ }
+
+ # creating the DDF file
+
+ my $ddffilename = $cabinetfile;
+ $ddffilename =~ s/.cab/.ddf/;
+ $ddfdir =~ s/[\/\\]\s*$//;
+ $ddffilename = $ddfdir . $installer::globals::separator . $ddffilename;
+
+ installer::files::save_file($ddffilename ,\@ddffile);
+ my $infoline = "Created ddf file: $ddffilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ # lines in ddf files must not be longer than 256 characters
+ check_ddf_file(\@ddffile, $ddffilename);
+
+ # Writing the makecab system call
+
+ # my $oneline = "makecab.exe /F " . $ddffilename . "\n";
+ my $oneline = "makecab.exe /V3 /F " . $ddffilename . " 2\>\&1 |" . "\n";
+
+ push(@cabfilelist, $oneline);
+
+ # collecting all ddf files
+ push(@installer::globals::allddffiles, $ddffilename);
+ }
+ elsif ( $installer::globals::one_cab_file )
+ {
+ my @ddffile = ();
+
+ my $cabinetfile = "";
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ $cabinetfile = $onefile->{'cabinet'};
+ my $sourcepath = $onefile->{'sourcepath'};
+ if ( $^O =~ /cygwin/i ) { $sourcepath = $onefile->{'cyg_sourcepath'}; }
+ my $uniquename = $onefile->{'uniquename'};
+
+ # to avoid lines with more than 256 characters, it can be useful to use relative pathes
+ if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); }
+
+ if ( $i == 0 ) { write_ddf_file_header(\@ddffile, $cabinetfile, $installdir); }
+
+ my $styles = "";
+ my $doinclude = 1;
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; };
+ if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; }
+
+ my $ddfline = "\"" . $sourcepath . "\"" . " " . $uniquename . "\n";
+ if ( $doinclude ) { push(@ddffile, $ddfline); }
+ }
+
+ # creating the DDF file
+
+ my $ddffilename = $cabinetfile;
+ $ddffilename =~ s/.cab/.ddf/;
+ $ddfdir =~ s/[\/\\]\s*$//;
+ $ddffilename = $ddfdir . $installer::globals::separator . $ddffilename;
+
+ installer::files::save_file($ddffilename ,\@ddffile);
+ my $infoline = "Created ddf file: $ddffilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ # lines in ddf files must not be longer than 256 characters
+ check_ddf_file(\@ddffile, $ddffilename);
+
+ # Writing the makecab system call
+
+ my $oneline = "makecab.exe /F " . $ddffilename . "\n";
+
+ push(@cabfilelist, $oneline);
+
+ # collecting all ddf files
+ push(@installer::globals::allddffiles, $ddffilename);
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: No cab file specification in globals.pm !", "create_media_table");
+ }
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: ddf file generation end");
+
+ return \@cabfilelist; # contains all system calls for packaging process
+}
+
+########################################################################
+# Returning the file sequence of a specified file.
+########################################################################
+
+sub get_file_sequence
+{
+ my ($filesref, $uniquefilename) = @_;
+
+ my $sequence = "";
+ my $found_sequence = 0;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ my $uniquename = $onefile->{'uniquename'};
+
+ if ( $uniquename eq $uniquefilename )
+ {
+ $sequence = $onefile->{'sequencenumber'};
+ $found_sequence = 1;
+ last;
+ }
+ }
+
+ if ( ! $found_sequence ) { installer::exiter::exit_program("ERROR: No sequence found for $uniquefilename !", "get_file_sequence"); }
+
+ return $sequence;
+}
+
+########################################################################
+# For update and patch reasons the pack order needs to be saved.
+# The pack order is saved in the ddf files; the names and locations
+# of the ddf files are saved in @installer::globals::allddffiles.
+# The outputfile "packorder.txt" can be saved in
+# $installer::globals::infodirectory .
+########################################################################
+
+sub save_packorder
+{
+ installer::logger::include_header_into_logfile("Saving pack order");
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: saving pack order start");
+
+ my $packorderfilename = "packorder.txt";
+ $packorderfilename = $installer::globals::infodirectory . $installer::globals::separator . $packorderfilename;
+
+ my @packorder = ();
+
+ my $headerline = "\# Syntax\: Filetable_Sequence Cabinetfilename Physical_FileName Unique_FileName\n\n";
+ push(@packorder, $headerline);
+
+ for ( my $i = 0; $i <= $#installer::globals::allddffiles; $i++ )
+ {
+ my $ddffilename = $installer::globals::allddffiles[$i];
+ my $ddffile = installer::files::read_file($ddffilename);
+ my $cabinetfile = "";
+
+ for ( my $j = 0; $j <= $#{$ddffile}; $j++ )
+ {
+ my $oneline = ${$ddffile}[$j];
+
+ # Getting the Cabinet file name
+
+ if ( $oneline =~ /^\s*\.Set\s+CabinetName.*\=(.*?)\s*$/ ) { $cabinetfile = $1; }
+ if ( $oneline =~ /^\s*\.Set\s+/ ) { next; }
+
+ if ( $oneline =~ /^\s*\"(.*?)\"\s+(.*?)\s*$/ )
+ {
+ my $sourcefile = $1;
+ my $uniquefilename = $2;
+
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$sourcefile);
+
+ # Using the hash created in create_files_table for performance reasons to get the sequence number
+ my $filesequence = "";
+ if ( exists($installer::globals::uniquefilenamesequence{$uniquefilename}) ) { $filesequence = $installer::globals::uniquefilenamesequence{$uniquefilename}; }
+ else { installer::exiter::exit_program("ERROR: No sequence number value for $uniquefilename !", "save_packorder"); }
+
+ my $line = $filesequence . "\t" . $cabinetfile . "\t" . $sourcefile . "\t" . $uniquefilename . "\n";
+ push(@packorder, $line);
+ }
+ }
+ }
+
+ installer::files::save_file($packorderfilename ,\@packorder);
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: saving pack order end");
+}
+
+#################################################################
+# Returning the name of the msi database
+#################################################################
+
+sub get_msidatabasename
+{
+ my ($allvariableshashref, $language) = @_;
+
+ my $databasename = $allvariableshashref->{'PRODUCTNAME'} . $allvariableshashref->{'PRODUCTVERSION'};
+ $databasename = lc($databasename);
+ $databasename =~ s/\.//g;
+ $databasename =~ s/\-//g;
+ $databasename =~ s/\s//g;
+
+ # possibility to overwrite the name with variable DATABASENAME
+ if ( $allvariableshashref->{'DATABASENAME'} )
+ {
+ $databasename = $allvariableshashref->{'DATABASENAME'};
+ }
+
+ if ( $language )
+ {
+ if (!($language eq ""))
+ {
+ $databasename .= "_$language";
+ }
+ }
+
+ $databasename .= ".msi";
+
+ return $databasename;
+}
+
+#################################################################
+# Creating the msi database
+# This works only on Windows
+#################################################################
+
+sub create_msi_database
+{
+ my ($idtdirbase ,$msifilename) = @_;
+
+ # -f : path containing the idt files
+ # -d : msi database, including path
+ # -c : create database
+ # -i : include the following tables ("*" includes all available tables)
+
+ my $msidb = "msidb.exe"; # Has to be in the path
+ my $extraslash = ""; # Has to be set for non-ActiveState perl
+
+ installer::logger::include_header_into_logfile("Creating msi database");
+
+ $idtdirbase = installer::converter::make_path_conform($idtdirbase);
+
+ $msifilename = installer::converter::make_path_conform($msifilename);
+
+ if ( $^O =~ /cygwin/i ) {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ $idtdirbase =~ s/\//\\\\/g;
+ $msifilename =~ s/\//\\\\/g;
+ $extraslash = "\\";
+ }
+ my $systemcall = $msidb . " -f " . $idtdirbase . " -d " . $msifilename . " -c " . "-i " . $extraslash . "*";
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $msidb!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed $msidb successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+#####################################################################
+# Returning the value from sis.mlf for Summary Information Stream
+#####################################################################
+
+sub get_value_from_sis_lng
+{
+ my ($language, $languagefile, $searchstring) = @_;
+
+ my $language_block = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $languagefile);
+ my $newstring = installer::windows::idtglobal::get_language_string_from_language_block($language_block, $language, $searchstring);
+ $newstring = "\"" . $newstring . "\"";
+
+ return $newstring;
+}
+
+#################################################################
+# Returning the msi version for the Summary Information Stream
+#################################################################
+
+sub get_msiversion_for_sis
+{
+ my $msiversion = "200";
+ return $msiversion;
+}
+
+#################################################################
+# Returning the word count for the Summary Information Stream
+#################################################################
+
+sub get_wordcount_for_sis
+{
+ my $wordcount = "0";
+ return $wordcount;
+}
+
+#################################################################
+# Returning the codepage for the Summary Information Stream
+#################################################################
+
+sub get_codepage_for_sis
+{
+ my ( $language ) = @_;
+
+ my $codepage = installer::windows::language::get_windows_encoding($language);
+
+ # Codepage 65001 does not work in Summary Information Stream
+ if ( $codepage == 65001 ) { $codepage = 0; }
+
+ # my $codepage = "1252"; # determine dynamically in a function
+ # my $codepage = "65001"; # UTF-8
+ return $codepage;
+}
+
+#################################################################
+# Returning the template for the Summary Information Stream
+#################################################################
+
+sub get_template_for_sis
+{
+ my ( $language ) = @_;
+
+ my $windowslanguage = installer::windows::language::get_windows_language($language);
+
+ my $value = "\"Intel;" . $windowslanguage; # adding the Windows language
+
+ $value = $value . "\""; # adding ending '"'
+
+ return $value ;
+}
+
+#################################################################
+# Returning the PackageCode for the Summary Information Stream
+#################################################################
+
+sub get_packagecode_for_sis
+{
+ # always generating a new package code for each package
+
+ my $guidref = get_guid_list(1, 1); # only one GUID shall be generated
+
+ ${$guidref}[0] =~ s/\s*$//; # removing ending spaces
+
+ my $guid = "\{" . ${$guidref}[0] . "\}";
+
+ my $infoline = "PackageCode: $guid\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ return $guid;
+}
+
+#################################################################
+# Returning the title for the Summary Information Stream
+#################################################################
+
+sub get_title_for_sis
+{
+ my ( $language, $languagefile, $searchstring ) = @_;
+
+ my $title = get_value_from_sis_lng($language, $languagefile, $searchstring );
+
+ return $title;
+}
+
+#################################################################
+# Returning the author for the Summary Information Stream
+#################################################################
+
+sub get_author_for_sis
+{
+ my $author = $installer::globals::longmanufacturer;
+
+ $author = "\"" . $author . "\"";
+
+ return $author;
+}
+
+#################################################################
+# Returning the subject for the Summary Information Stream
+#################################################################
+
+sub get_subject_for_sis
+{
+ my ( $allvariableshashref ) = @_;
+
+ my $subject = $allvariableshashref->{'PRODUCTNAME'} . " " . $allvariableshashref->{'PRODUCTVERSION'};
+
+ $subject = "\"" . $subject . "\"";
+
+ return $subject;
+}
+
+#################################################################
+# Returning the comment for the Summary Information Stream
+#################################################################
+
+sub get_comment_for_sis
+{
+ my ( $language, $languagefile, $searchstring ) = @_;
+
+ my $comment = get_value_from_sis_lng($language, $languagefile, $searchstring );
+
+ return $comment;
+}
+
+#################################################################
+# Returning the keywords for the Summary Information Stream
+#################################################################
+
+sub get_keywords_for_sis
+{
+ my ( $language, $languagefile, $searchstring ) = @_;
+
+ my $keywords = get_value_from_sis_lng($language, $languagefile, $searchstring );
+
+ return $keywords;
+}
+
+######################################################################
+# Returning the application name for the Summary Information Stream
+######################################################################
+
+sub get_appname_for_sis
+{
+ my ( $language, $languagefile, $searchstring ) = @_;
+
+ my $appname = get_value_from_sis_lng($language, $languagefile, $searchstring );
+
+ return $appname;
+}
+
+######################################################################
+# Returning the security for the Summary Information Stream
+######################################################################
+
+sub get_security_for_sis
+{
+ my $security = "0";
+ return $security;
+}
+
+#################################################################
+# Writing the Summary information stream into the msi database
+# This works only on Windows
+#################################################################
+
+sub write_summary_into_msi_database
+{
+ my ($msifilename, $language, $languagefile, $allvariableshashref) = @_;
+
+ # -g : requrired msi version
+ # -c : codepage
+ # -p : template
+
+ installer::logger::include_header_into_logfile("Writing summary information stream");
+
+ my $msiinfo = "msiinfo.exe"; # Has to be in the path
+
+ my $sislanguage = "en-US"; # title, comment, keyword and appname alway in english
+
+ my $msiversion = get_msiversion_for_sis();
+ my $codepage = get_codepage_for_sis($language);
+ my $template = get_template_for_sis($language);
+ my $guid = get_packagecode_for_sis();
+ my $title = get_title_for_sis($sislanguage,$languagefile, "OOO_SIS_TITLE");
+ my $author = get_author_for_sis();
+ my $subject = get_subject_for_sis($allvariableshashref);
+ my $comment = get_comment_for_sis($sislanguage,$languagefile, "OOO_SIS_COMMENT");
+ my $keywords = get_keywords_for_sis($sislanguage,$languagefile, "OOO_SIS_KEYWORDS");
+ my $appname = get_appname_for_sis($sislanguage,$languagefile, "OOO_SIS_APPNAME");
+ my $security = get_security_for_sis();
+ my $wordcount = get_wordcount_for_sis();
+
+ $msifilename = installer::converter::make_path_conform($msifilename);
+
+ my $systemcall = $msiinfo . " " . $msifilename . " -g " . $msiversion . " -c " . $codepage
+ . " -p " . $template . " -v " . $guid . " -t " . $title . " -a " . $author
+ . " -j " . $subject . " -o " . $comment . " -k " . $keywords . " -n " . $appname
+ . " -u " . $security . " -w " . $wordcount;
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $msiinfo!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed $msiinfo successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+#########################################################################
+# For more than one language in the installation set:
+# Use one database and create Transformations for all other languages
+#########################################################################
+
+sub create_transforms
+{
+ my ($languagesarray, $defaultlanguage, $installdir, $allvariableshashref) = @_;
+
+ installer::logger::include_header_into_logfile("Creating Transforms");
+
+ my $msitran = "msitran.exe"; # Has to be in the path
+
+ $installdir = installer::converter::make_path_conform($installdir);
+
+ # Syntax for creating a transformation
+ # msitran.exe -g <baseDB> <referenceDB> <transformfile> [<errorhandling>}
+
+ my $basedbname = get_msidatabasename($allvariableshashref, $defaultlanguage);
+ $basedbname = $installdir . $installer::globals::separator . $basedbname;
+
+ my $errorhandling = "f"; # Suppress "change codepage" error
+
+ # Iterating over all files
+
+ foreach ( @{$languagesarray} )
+ {
+ my $onelanguage = $_;
+
+ if ( $onelanguage eq $defaultlanguage ) { next; }
+
+ my $referencedbname = get_msidatabasename($allvariableshashref, $onelanguage);
+ $referencedbname = $installdir . $installer::globals::separator . $referencedbname;
+
+ my $transformfile = $installdir . $installer::globals::separator . "trans_" . $onelanguage . ".mst";
+
+ my $systemcall = $msitran . " " . " -g " . $basedbname . " " . $referencedbname . " " . $transformfile . " " . $errorhandling;
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Problem: msitran.exe in version 4.0 always returns "1", even if no failure occured.
+ # Therefore it has to be checked, if this is version 4.0. If yes, if the mst file
+ # exists and if it is larger than 0 bytes. If this is true, then no error occured.
+ # File Version of msitran.exe: 4.0.6000.16384 has checksum: "b66190a70145a57773ec769e16777b29".
+ # Same for msitran.exe from wntmsci12: "aa25d3445b94ffde8ef0c1efb77a56b8"
+
+ if ($returnvalue)
+ {
+ $infoline = "WARNING: Returnvalue of $msitran is not 0. Checking version of $msitran!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ open(FILE, "<$installer::globals::msitranpath") or die "ERROR: Can't open $installer::globals::msitranpath for creating file hash";
+ binmode(FILE);
+ my $digest = Digest::MD5->new->addfile(*FILE)->hexdigest;
+ close(FILE);
+
+ my @problemchecksums = ("b66190a70145a57773ec769e16777b29", "aa25d3445b94ffde8ef0c1efb77a56b8");
+ my $isproblemchecksum = 0;
+
+ foreach my $problemchecksum ( @problemchecksums )
+ {
+ $infoline = "Checksum of problematic MsiTran.exe: $problemchecksum\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "Checksum of used MsiTran.exe: $digest\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ if ( $digest eq $problemchecksum ) { $isproblemchecksum = 1; }
+ }
+
+ if ( $isproblemchecksum )
+ {
+ # Check existence of mst
+ if ( -f $transformfile )
+ {
+ $infoline = "File $transformfile exists.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ my $filesize = ( -s $transformfile );
+ $infoline = "Size of $transformfile: $filesize\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $filesize > 0 )
+ {
+ $infoline = "Info: Returnvalue $returnvalue of $msitran is no problem :-) .\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $returnvalue = 0; # reset the error
+ }
+ else
+ {
+ $infoline = "Filesize indicates that an error occured.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ else
+ {
+ $infoline = "File $transformfile does not exist -> An error occured.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ else
+ {
+ $infoline = "This is not a problematic version of msitran.exe. Therefore the error is not caused by problematic msitran.exe.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $msitran!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed $msitran successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ # The reference database can be deleted
+
+ my $result = unlink($referencedbname);
+ # $result contains the number of deleted files
+
+ if ( $result == 0 )
+ {
+ $infoline = "ERROR: Could not remove file $$referencedbname !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program($infoline, "create_transforms");
+ }
+ }
+}
+
+#########################################################################
+# The default language msi database does not need to contain
+# the language in the database name. Therefore the file
+# is renamed. Example: "openofficeorg20_01.msi" to "openofficeorg20.msi"
+#########################################################################
+
+sub rename_msi_database_in_installset
+{
+ my ($defaultlanguage, $installdir, $allvariableshashref) = @_;
+
+ installer::logger::include_header_into_logfile("Renaming msi database");
+
+ my $olddatabasename = get_msidatabasename($allvariableshashref, $defaultlanguage);
+ $olddatabasename = $installdir . $installer::globals::separator . $olddatabasename;
+
+ my $newdatabasename = get_msidatabasename($allvariableshashref);
+
+ $installer::globals::shortmsidatabasename = $newdatabasename;
+
+ $newdatabasename = $installdir . $installer::globals::separator . $newdatabasename;
+
+ installer::systemactions::rename_one_file($olddatabasename, $newdatabasename);
+
+ $installer::globals::msidatabasename = $newdatabasename;
+}
+
+#########################################################################
+# Adding the language to the name of the msi databasename,
+# if this is required (ADDLANGUAGEINDATABASENAME)
+#########################################################################
+
+sub add_language_to_msi_database
+{
+ my ($defaultlanguage, $installdir, $allvariables) = @_;
+
+ my $languagestring = $defaultlanguage;
+ if ( $allvariables->{'USELANGUAGECODE'} ) { $languagestring = installer::windows::language::get_windows_language($defaultlanguage); }
+ my $newdatabasename = $installer::globals::shortmsidatabasename;
+ $newdatabasename =~ s/\.msi\s*$/_$languagestring\.msi/;
+ $installer::globals::shortmsidatabasename = $newdatabasename;
+ $newdatabasename = $installdir . $installer::globals::separator . $newdatabasename;
+
+ my $olddatabasename = $installer::globals::msidatabasename;
+
+ installer::systemactions::rename_one_file($olddatabasename, $newdatabasename);
+
+ $installer::globals::msidatabasename = $newdatabasename;
+}
+
+##########################################################################
+# Writing the databasename into the setup.ini.
+##########################################################################
+
+sub put_databasename_into_setupini
+{
+ my ($setupinifile, $allvariableshashref) = @_;
+
+ my $databasename = get_msidatabasename($allvariableshashref);
+ my $line = "database=" . $databasename . "\n";
+
+ push(@{$setupinifile}, $line);
+}
+
+##########################################################################
+# Writing the required msi version into setup.ini
+##########################################################################
+
+sub put_msiversion_into_setupini
+{
+ my ($setupinifile) = @_;
+
+ my $msiversion = "2.0";
+ my $line = "msiversion=" . $msiversion . "\n";
+
+ push(@{$setupinifile}, $line);
+}
+
+##########################################################################
+# Writing the productname into setup.ini
+##########################################################################
+
+sub put_productname_into_setupini
+{
+ my ($setupinifile, $allvariableshashref) = @_;
+
+ my $productname = $allvariableshashref->{'PRODUCTNAME'};
+ my $line = "productname=" . $productname . "\n";
+
+ push(@{$setupinifile}, $line);
+}
+
+##########################################################################
+# Writing the productcode into setup.ini
+##########################################################################
+
+sub put_productcode_into_setupini
+{
+ my ($setupinifile) = @_;
+
+ my $productcode = $installer::globals::productcode;
+ my $line = "productcode=" . $productcode . "\n";
+
+ push(@{$setupinifile}, $line);
+}
+
+##########################################################################
+# Writing the ProductVersion from Property table into setup.ini
+##########################################################################
+
+sub put_productversion_into_setupini
+{
+ my ($setupinifile) = @_;
+
+ my $line = "productversion=" . $installer::globals::msiproductversion . "\n";
+ push(@{$setupinifile}, $line);
+}
+
+##########################################################################
+# Writing the key for Minor Upgrades into setup.ini
+##########################################################################
+
+sub put_upgradekey_into_setupini
+{
+ my ($setupinifile) = @_;
+
+ if ( $installer::globals::minorupgradekey ne "" )
+ {
+ my $line = "upgradekey=" . $installer::globals::minorupgradekey . "\n";
+ push(@{$setupinifile}, $line);
+ }
+}
+
+##########################################################################
+# Writing the number of languages into setup.ini
+##########################################################################
+
+sub put_languagecount_into_setupini
+{
+ my ($setupinifile, $languagesarray) = @_;
+
+ my $languagecount = $#{$languagesarray} + 1;
+ my $line = "count=" . $languagecount . "\n";
+
+ push(@{$setupinifile}, $line);
+}
+
+##########################################################################
+# Writing the defaultlanguage into setup.ini
+##########################################################################
+
+sub put_defaultlanguage_into_setupini
+{
+ my ($setupinifile, $defaultlanguage) = @_;
+
+ my $windowslanguage = installer::windows::language::get_windows_language($defaultlanguage);
+ my $line = "default=" . $windowslanguage . "\n";
+ push(@{$setupinifile}, $line);
+}
+
+##########################################################################
+# Writing the information about transformations into setup.ini
+##########################################################################
+
+sub put_transforms_into_setupini
+{
+ my ($setupinifile, $onelanguage, $counter) = @_;
+
+ my $windowslanguage = installer::windows::language::get_windows_language($onelanguage);
+ my $transformfilename = "trans_" . $onelanguage . ".mst";
+
+ my $line = "lang" . $counter . "=" . $windowslanguage . "," . $transformfilename . "\n";
+
+ push(@{$setupinifile}, $line);
+}
+
+###################################################
+# Including Windows line ends in ini files
+# Profiles on Windows shall have \r\n line ends
+###################################################
+
+sub include_windows_lineends
+{
+ my ($onefile) = @_;
+
+ for ( my $i = 0; $i <= $#{$onefile}; $i++ )
+ {
+ ${$onefile}[$i] =~ s/\r?\n$/\r\n/;
+ }
+}
+
+##########################################################################
+# Generation the file setup.ini, that is used by the loader setup.exe.
+##########################################################################
+
+sub create_setup_ini
+{
+ my ($languagesarray, $defaultlanguage, $installdir, $allvariableshashref) = @_;
+
+ installer::logger::include_header_into_logfile("Creating setup.ini");
+
+ my $setupinifilename = $installdir . $installer::globals::separator . "setup.ini";
+
+ my @setupinifile = ();
+ my $setupinifile = \@setupinifile;
+
+ my $line = "\[setup\]\n";
+ push(@setupinifile, $line);
+
+ put_databasename_into_setupini($setupinifile, $allvariableshashref);
+ put_msiversion_into_setupini($setupinifile);
+ put_productname_into_setupini($setupinifile, $allvariableshashref);
+ put_productcode_into_setupini($setupinifile);
+ put_productversion_into_setupini($setupinifile);
+ put_upgradekey_into_setupini($setupinifile);
+
+ $line = "\[languages\]\n";
+ push(@setupinifile, $line);
+
+ put_languagecount_into_setupini($setupinifile, $languagesarray);
+ put_defaultlanguage_into_setupini($setupinifile, $defaultlanguage);
+
+ if ( $#{$languagesarray} > 0 ) # writing the transforms information
+ {
+ my $counter = 1;
+
+ for ( my $i = 0; $i <= $#{$languagesarray}; $i++ )
+ {
+ if ( ${$languagesarray}[$i] eq $defaultlanguage ) { next; }
+
+ put_transforms_into_setupini($setupinifile, ${$languagesarray}[$i], $counter);
+ $counter++;
+ }
+ }
+
+ if ( $installer::globals::iswin && $installer::globals::plat =~ /cygwin/i) # Windows line ends only for Cygwin
+ {
+ include_windows_lineends($setupinifile);
+ }
+
+ installer::files::save_file($setupinifilename, $setupinifile);
+
+ $infoline = "Generated file $setupinifilename !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+#################################################################
+# Copying the files defined as ScpActions into the
+# installation set.
+#################################################################
+
+sub copy_scpactions_into_installset
+{
+ my ($defaultlanguage, $installdir, $allscpactions) = @_;
+
+ installer::logger::include_header_into_logfile("Copying ScpAction files into installation set");
+
+ for ( my $i = 0; $i <= $#{$allscpactions}; $i++ )
+ {
+ my $onescpaction = ${$allscpactions}[$i];
+
+ if ( $onescpaction->{'Name'} eq "loader.exe" ) { next; } # do not copy this ScpAction loader
+
+ # only copying language independent files or files with the correct language (the defaultlanguage)
+
+ my $filelanguage = $onescpaction->{'specificlanguage'};
+
+ if ( ($filelanguage eq $defaultlanguage) || ($filelanguage eq "") )
+ {
+ my $sourcefile = $onescpaction->{'sourcepath'};
+ my $destfile = $installdir . $installer::globals::separator . $onescpaction->{'DestinationName'};
+
+ installer::systemactions::copy_one_file($sourcefile, $destfile);
+ }
+ }
+}
+
+#################################################################
+# Copying the files for the Windows installer into the
+# installation set (setup.exe).
+#################################################################
+
+sub copy_windows_installer_files_into_installset
+{
+ my ($installdir, $includepatharrayref, $allvariables) = @_;
+
+ installer::logger::include_header_into_logfile("Copying Windows installer files into installation set");
+
+ @copyfile = ();
+ push(@copyfile, "loader2.exe");
+
+ if ( $allvariables->{'NOLOADERREQUIRED'} ) { @copyfile = (); }
+
+ for ( my $i = 0; $i <= $#copyfile; $i++ )
+ {
+ my $filename = $copyfile[$i];
+ my $sourcefileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 1);
+
+ if ( ! -f $$sourcefileref ) { installer::exiter::exit_program("ERROR: msi file not found: $$sourcefileref !", "copy_windows_installer_files_into_installset"); }
+
+ my $destfile;
+ if ( $copyfile[$i] eq "loader2.exe" ) { $destfile = "setup.exe"; } # renaming the loader
+ else { $destfile = $copyfile[$i]; }
+
+ $destfile = $installdir . $installer::globals::separator . $destfile;
+
+ installer::systemactions::copy_one_file($$sourcefileref, $destfile);
+ }
+}
+
+#################################################################
+# Copying MergeModules for the Windows installer into the
+# installation set. The list of MergeModules is located
+# in %installer::globals::copy_msm_files
+#################################################################
+
+sub copy_merge_modules_into_installset
+{
+ my ($installdir) = @_;
+
+ installer::logger::include_header_into_logfile("Copying Merge files into installation set");
+
+ my $cabfile;
+ foreach $cabfile ( keys %installer::globals::copy_msm_files )
+ {
+ my $sourcefile = $installer::globals::copy_msm_files{$cabfile};
+ my $destfile = $installdir . $installer::globals::separator . $cabfile;
+
+ installer::systemactions::copy_one_file($sourcefile, $destfile);
+ }
+}
+
+#################################################################
+# Copying the child projects into the
+# installation set
+#################################################################
+
+sub copy_child_projects_into_installset
+{
+ my ($installdir, $allvariables) = @_;
+
+ my $sourcefile = "";
+ my $destdir = "";
+
+ # adding Java
+
+ if ( $allvariables->{'JAVAPRODUCT'} )
+ {
+ $sourcefile = $installer::globals::javafile->{'sourcepath'};
+ $destdir = $installdir . $installer::globals::separator . $installer::globals::javafile->{'Subdir'};
+ if ( ! -d $destdir) { installer::systemactions::create_directory($destdir); }
+ installer::systemactions::copy_one_file($sourcefile, $destdir);
+ }
+
+ if ( $allvariables->{'UREPRODUCT'} )
+ {
+ $sourcefile = $installer::globals::urefile->{'sourcepath'};
+ $destdir = $installdir . $installer::globals::separator . $installer::globals::urefile->{'Subdir'};
+ if ( ! -d $destdir) { installer::systemactions::create_directory($destdir); }
+ installer::systemactions::copy_one_file($sourcefile, $destdir);
+ }
+}
+
+#################################################################
+# Getting a list of GUID using uuidgen.exe.
+# This works only on Windows
+#################################################################
+
+sub get_guid_list
+{
+ my ($number, $log) = @_;
+
+ if ( $log ) { installer::logger::include_header_into_logfile("Generating $number GUID"); }
+
+ my $uuidgen = "uuidgen.exe"; # Has to be in the path
+
+ # "-c" for uppercase output
+
+ # my $systemcall = "$uuidgen -n$number -c |";
+ my $systemcall = "$uuidgen -n$number |";
+ open (UUIDGEN, "$systemcall" ) or die("uuidgen is missing.");
+ my @uuidlist = <UUIDGEN>;
+ close (UUIDGEN);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ if ( $log ) { push( @installer::globals::logfileinfo, $infoline); }
+
+ my $comparenumber = $#uuidlist + 1;
+
+ if ( $comparenumber == $number )
+ {
+ $infoline = "Success: Executed $uuidgen successfully!\n";
+ if ( $log ) { push( @installer::globals::logfileinfo, $infoline); }
+ }
+ else
+ {
+ $infoline = "ERROR: Could not execute $uuidgen successfully!\n";
+ if ( $log ) { push( @installer::globals::logfileinfo, $infoline); }
+ }
+
+ # uppercase, no longer "-c", because this is only supported in uuidgen.exe v.1.01
+ for ( my $i = 0; $i <= $#uuidlist; $i++ ) { $uuidlist[$i] = uc($uuidlist[$i]); }
+
+ return \@uuidlist;
+}
+
+#################################################################
+# Calculating a GUID with a string using md5.
+#################################################################
+
+sub calculate_guid
+{
+ my ( $string ) = @_;
+
+ my $guid = "";
+
+ my $md5 = Digest::MD5->new;
+ $md5->add($string);
+ my $digest = $md5->hexdigest;
+ $digest = uc($digest);
+
+ # my $id = pack("A32", $digest);
+ my ($first, $second, $third, $fourth, $fifth) = unpack ('A8 A4 A4 A4 A12', $digest);
+ $guid = "$first-$second-$third-$fourth-$fifth";
+
+ return $guid;
+}
+
+#################################################################
+# Filling the component hash with the values of the
+# component file.
+#################################################################
+
+sub fill_component_hash
+{
+ my ($componentfile) = @_;
+
+ my %components = ();
+
+ for ( my $i = 0; $i <= $#{$componentfile}; $i++ )
+ {
+ my $line = ${$componentfile}[$i];
+
+ if ( $line =~ /^\s*(.*?)\t(.*?)\s*$/ )
+ {
+ my $key = $1;
+ my $value = $2;
+
+ $components{$key} = $value;
+ }
+ }
+
+ return \%components;
+}
+
+#################################################################
+# Creating a new component file, if new guids were generated.
+#################################################################
+
+sub create_new_component_file
+{
+ my ($componenthash) = @_;
+
+ my @componentfile = ();
+
+ my $key;
+
+ foreach $key (keys %{$componenthash})
+ {
+ my $value = $componenthash->{$key};
+ my $input = "$key\t$value\n";
+ push(@componentfile ,$input);
+ }
+
+ return \@componentfile;
+}
+
+#################################################################
+# Filling real component GUID into the component table.
+# This works only on Windows
+#################################################################
+
+sub set_uuid_into_component_table
+{
+ my ($idtdirbase, $allvariables) = @_;
+
+ my $componenttablename = $idtdirbase . $installer::globals::separator . "Componen.idt";
+
+ my $componenttable = installer::files::read_file($componenttablename);
+
+ # For update and patch reasons (small update) the GUID of an existing component must not change!
+ # The collection of component GUIDs is saved in the directory $installer::globals::idttemplatepath in the file "components.txt"
+
+ my $infoline = "";
+ my $counter = 0;
+ # my $componentfile = installer::files::read_file($installer::globals::componentfilename);
+ # my $componenthash = fill_component_hash($componentfile);
+
+ for ( my $i = 3; $i <= $#{$componenttable}; $i++ ) # ignoring the first three lines
+ {
+ my $oneline = ${$componenttable}[$i];
+ my $componentname = "";
+ if ( $oneline =~ /^\s*(\S+?)\t/ ) { $componentname = $1; }
+
+ my $uuid = "";
+
+ # if ( $componenthash->{$componentname} )
+ # {
+ # $uuid = $componenthash->{$componentname};
+ # }
+ # else
+ # {
+
+ if ( exists($installer::globals::calculated_component_guids{$componentname}))
+ {
+ $uuid = $installer::globals::calculated_component_guids{$componentname};
+ }
+ else
+ {
+ # Calculating new GUID with the help of the component name.
+ my $useooobaseversion = 1;
+ if ( exists($installer::globals::base_independent_components{$componentname})) { $useooobaseversion = 0; }
+ my $sourcestring = $componentname;
+
+ if ( $useooobaseversion )
+ {
+ if ( ! exists($allvariables->{'OOOBASEVERSION'}) ) { installer::exiter::exit_program("ERROR: Could not find variable \"OOOBASEVERSION\" (required value for GUID creation)!", "set_uuid_into_component_table"); }
+ $sourcestring = $sourcestring . "_" . $allvariables->{'OOOBASEVERSION'};
+ }
+ $uuid = calculate_guid($sourcestring);
+ $counter++;
+
+ # checking, if there is a conflict with an already created guid
+ if ( exists($installer::globals::allcalculated_guids{$uuid}) ) { installer::exiter::exit_program("ERROR: \"$uuid\" was already created before!", "set_uuid_into_component_table"); }
+ $installer::globals::allcalculated_guids{$uuid} = 1;
+ $installer::globals::calculated_component_guids{$componentname} = $uuid;
+
+ # Setting new uuid
+ # $componenthash->{$componentname} = $uuid;
+
+ # Setting flag
+ # $installer::globals::created_new_component_guid = 1; # this is very important!
+ }
+ # }
+
+ ${$componenttable}[$i] =~ s/COMPONENTGUID/$uuid/;
+ }
+
+ installer::files::save_file($componenttablename, $componenttable);
+
+# if ( $installer::globals::created_new_component_guid )
+# {
+# # create new component file!
+# $componentfile = create_new_component_file($componenthash);
+# installer::worker::sort_array($componentfile);
+#
+# # To avoid conflict the components file cannot be saved at the same place
+# # All important data have to be saved in the directory: $installer::globals::infodirectory
+# my $localcomponentfilename = $installer::globals::componentfilename;
+# installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$localcomponentfilename);
+# $localcomponentfilename = $installer::globals::infodirectory . $installer::globals::separator . $localcomponentfilename;
+# installer::files::save_file($localcomponentfilename, $componentfile);
+#
+# # installer::files::save_file($installer::globals::componentfilename, $componentfile); # version using new file in solver
+#
+# $infoline = "COMPONENTCODES: Created $counter new GUIDs for components ! \n";
+# push( @installer::globals::logfileinfo, $infoline);
+# }
+# else
+# {
+# $infoline = "SUCCESS COMPONENTCODES: All component codes exist! \n";
+# push( @installer::globals::logfileinfo, $infoline);
+# }
+
+}
+
+#################################################################
+# Include all cab files into the msi database.
+# This works only on Windows
+#################################################################
+
+sub include_cabs_into_msi
+{
+ my ($installdir) = @_;
+
+ installer::logger::include_header_into_logfile("Including cabs into msi database");
+
+ my $from = cwd();
+ my $to = $installdir;
+
+ chdir($to);
+
+ my $infoline = "Changing into directory: $to";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $msidb = "msidb.exe"; # Has to be in the path
+ my $extraslash = ""; # Has to be set for non-ActiveState perl
+
+ my $msifilename = $installer::globals::msidatabasename;
+
+ $msifilename = installer::converter::make_path_conform($msifilename);
+
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ $msifilename =~ s/\//\\\\/g;
+ $extraslash = "\\";
+
+ my $allcabfiles = installer::systemactions::find_file_with_file_extension("cab", $installdir);
+
+ for ( my $i = 0; $i <= $#{$allcabfiles}; $i++ )
+ {
+ my $systemcall = $msidb . " -d " . $msifilename . " -a " . ${$allcabfiles}[$i];
+
+ my $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed $systemcall successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ # deleting the cab file
+
+ unlink(${$allcabfiles}[$i]);
+
+ $infoline = "Deleted cab file: ${$allcabfiles}[$i]\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ $infoline = "Changing back into directory: $from";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ chdir($from);
+}
+
+#################################################################
+# Executing the created batch file to pack all files.
+# This works only on Windows
+#################################################################
+
+sub execute_packaging
+{
+ my ($localpackjobref, $loggingdir, $allvariables) = @_;
+
+ installer::logger::include_header_into_logfile("Packaging process");
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: Execute packaging start");
+
+ my $infoline = "";
+ my $from = cwd();
+ my $to = $loggingdir;
+
+ chdir($to);
+ $infoline = "chdir: $to \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # if the ddf file contains relative pathes, it is necessary to change into the temp directory
+ if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} )
+ {
+ $to = $installer::globals::temppath;
+ chdir($to);
+ $infoline = "chdir: $to \n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ # changing the tmp directory, because makecab.exe generates temporary cab files
+ my $origtemppath = "";
+ if ( $ENV{'TMP'} ) { $origtemppath = $ENV{'TMP'}; }
+ $ENV{'TMP'} = $installer::globals::temppath; # setting TMP to the new unique directory!
+
+ my $maxmakecabcalls = 3;
+ my $allmakecabcalls = $#{$localpackjobref} + 1;
+
+ for ( my $i = 0; $i <= $#{$localpackjobref}; $i++ )
+ {
+ my $systemcall = ${$localpackjobref}[$i];
+
+ my $callscounter = $i + 1;
+
+ installer::logger::print_message( "... makecab.exe ($callscounter/$allmakecabcalls) ... \n" );
+
+ # my $returnvalue = system($systemcall);
+
+ for ( my $n = 1; $n <= $maxmakecabcalls; $n++ )
+ {
+ my @ddfoutput = ();
+
+ $infoline = "Systemcall: $systemcall";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ open (DDF, "$systemcall");
+ while (<DDF>) {push(@ddfoutput, $_); }
+ close (DDF);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ if ($returnvalue)
+ {
+ if ( $n < $maxmakecabcalls )
+ {
+ installer::logger::print_message( "makecab_error (Try $n): Trying again \n" );
+ $infoline = "makecab_error (Try $n): $systemcall !";
+ }
+ else
+ {
+ installer::logger::print_message( "ERROR (Try $n): Abort packing \n" );
+ $infoline = "ERROR (Try $n): $systemcall !";
+ }
+
+ push( @installer::globals::logfileinfo, $infoline);
+ # for ( my $j = 0; $j <= $#ddfoutput; $j++ ) { push( @installer::globals::logfileinfo, "$ddfoutput[$j]"); }
+
+ for ( my $m = 0; $m <= $#ddfoutput; $m++ )
+ {
+ if ( $ddfoutput[$m] =~ /(ERROR\:.*?)\s*$/ )
+ {
+ $infoline = $1 . "\n";
+ if ( $n < $maxmakecabcalls ) { $infoline =~ s/ERROR\:/makecab_error\:/i; }
+ installer::logger::print_message( $infoline );
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ if ( $n == $maxmakecabcalls ) { installer::exiter::exit_program("ERROR: \"$systemcall\"!", "execute_packaging"); }
+ }
+ else
+ {
+ # installer::logger::print_message( "Success (Try $n): \"$systemcall\"\n" );
+ $infoline = "Success (Try $n): $systemcall";
+ push( @installer::globals::logfileinfo, $infoline);
+ last;
+ }
+ }
+ }
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: Execute packaging end");
+
+ # setting back to the original tmp directory
+ $ENV{'TMP'} = $origtemppath;
+
+ chdir($from);
+ $infoline = "chdir: $from \n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+###############################################################
+# Setting the global variables ProductCode and the UpgradeCode
+###############################################################
+
+sub set_global_code_variables
+{
+ my ( $languagesref, $languagestringref, $allvariableshashref, $alloldproperties ) = @_;
+
+ # In the msi template directory a files "codes.txt" has to exist, in which the ProductCode
+ # and the UpgradeCode for the product are defined.
+ # The name "codes.txt" can be overwritten in Product definition with CODEFILENAME .
+ # Default $installer::globals::codefilename is defined in parameter.pm.
+
+ if ( $allvariableshashref->{'CODEFILENAME'} )
+ {
+ $installer::globals::codefilename = $installer::globals::idttemplatepath . $installer::globals::separator . $allvariableshashref->{'CODEFILENAME'};
+ installer::files::check_file($installer::globals::codefilename);
+ }
+
+ my $infoline = "Using Codes file: $installer::globals::codefilename \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $codefile = installer::files::read_file($installer::globals::codefilename);
+
+ my $isopensource = 0;
+ if ( $allvariableshashref->{'OPENSOURCE'} ) { $isopensource = $allvariableshashref->{'OPENSOURCE'}; }
+
+ my $onelanguage = "";
+
+ if ( $#{$languagesref} > 0 ) # more than one language
+ {
+ if (( $installer::globals::added_english ) && ( $#{$languagesref} == 1 )) # only multilingual because of added English
+ {
+ $onelanguage = ${$languagesref}[1]; # setting the first language, that is not english
+ }
+ else
+ {
+ if (( ${$languagesref}[1] =~ /jp/ ) ||
+ ( ${$languagesref}[1] =~ /ko/ ) ||
+ ( ${$languagesref}[1] =~ /zh/ ))
+ {
+ $onelanguage = "multiasia";
+ }
+ else
+ {
+ $onelanguage = "multiwestern";
+ }
+ }
+ }
+ else # only one language
+ {
+ $onelanguage = ${$languagesref}[0];
+ }
+
+ # ProductCode must not change, if Windows patches shall be applied
+ if ( $installer::globals::updatedatabase )
+ {
+ $installer::globals::productcode = $alloldproperties->{'ProductCode'};
+ }
+ elsif ( $installer::globals::prepare_winpatch )
+ {
+ # ProductCode has to be specified in each language
+ my $searchstring = "PRODUCTCODE";
+ my $codeblock = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $codefile);
+ $installer::globals::productcode = installer::windows::idtglobal::get_code_from_code_block($codeblock, $onelanguage);
+ } else {
+ my $guidref = get_guid_list(1, 1); # only one GUID shall be generated
+ ${$guidref}[0] =~ s/\s*$//; # removing ending spaces
+ $installer::globals::productcode = "\{" . ${$guidref}[0] . "\}";
+ }
+
+ if ( $installer::globals::patch ) # patch upgrade codes are defined in soffice.lst
+ {
+ if ( $allvariableshashref->{'PATCHUPGRADECODE'} ) { $installer::globals::upgradecode = $allvariableshashref->{'PATCHUPGRADECODE'}; }
+ else { installer::exiter::exit_program("ERROR: PATCHUPGRADECODE not defined in list file!", "set_global_code_variables"); }
+ }
+ else
+ {
+ # UpgradeCode can take english as default, if not defined in specified language
+
+ $searchstring = "UPGRADECODE"; # searching in the codes.txt file
+ $codeblock = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $codefile);
+ $installer::globals::upgradecode = installer::windows::idtglobal::get_language_string_from_language_block($codeblock, $onelanguage, "");
+ }
+
+ # if (( $installer::globals::productcode eq "" ) && ( ! $isopensource )) { installer::exiter::exit_program("ERROR: ProductCode for language $onelanguage not defined in $installer::globals::codefilename !", "set_global_code_variables"); }
+ if ( $installer::globals::upgradecode eq "" ) { installer::exiter::exit_program("ERROR: UpgradeCode not defined in $installer::globals::codefilename !", "set_global_code_variables"); }
+
+ $infoline = "Setting ProductCode to: $installer::globals::productcode \n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $infoline = "Setting UpgradeCode to: $installer::globals::upgradecode \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Adding both variables into the variables array
+
+ $allvariableshashref->{'PRODUCTCODE'} = $installer::globals::productcode;
+ $allvariableshashref->{'UPGRADECODE'} = $installer::globals::upgradecode;
+
+ $infoline = "Defined variable PRODUCTCODE: $installer::globals::productcode \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ $infoline = "Defined variable UPGRADECODE: $installer::globals::upgradecode \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+}
+
+###############################################################
+# Setting the product version used in property table and
+# upgrade table. Saving in global variable $msiproductversion
+###############################################################
+
+sub set_msiproductversion
+{
+ my ( $allvariables ) = @_;
+
+ my $productversion = $allvariables->{'PRODUCTVERSION'};
+
+ if (( $productversion =~ /^\s*\d+\s*$/ ) && ( $productversion > 255 )) { $productversion = $productversion%256; }
+
+ if ( $productversion =~ /^\s*(\d+)\.(\d+)\.(\d+)\s*$/ )
+ {
+ $productversion = $1 . "\." . $2 . $3 . "\." . $installer::globals::buildid;
+ }
+ elsif ( $productversion =~ /^\s*(\d+)\.(\d+)\s*$/ )
+ {
+ $productversion = $1 . "\." . $2 . "\." . $installer::globals::buildid;
+ }
+ else
+ {
+ my $productminor = "00";
+ if (( $allvariables->{'PACKAGEVERSION'} ) && ( $allvariables->{'PACKAGEVERSION'} ne "" ))
+ {
+ if ( $allvariables->{'PACKAGEVERSION'} =~ /^\s*(\d+)\.(\d+)\.(\d+)\s*$/ ) { $productminor = $2; }
+ }
+
+ $productversion = $productversion . "\." . $productminor . "\." . $installer::globals::buildid;
+ }
+
+ $installer::globals::msiproductversion = $productversion;
+
+ # Setting $installer::globals::msimajorproductversion, to differ between old version in upgrade table
+
+ if ( $installer::globals::msiproductversion =~ /^\s*(\d+)\./ )
+ {
+ my $major = $1;
+ $installer::globals::msimajorproductversion = $major . "\.0\.0";
+ }
+}
+
+#################################################################################
+# Including the msi product version into the bootstrap.ini, Windows only
+#################################################################################
+
+sub put_msiproductversion_into_bootstrapfile
+{
+ my ($filesref) = @_;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+
+ if ( $onefile->{'gid'} eq "gid_Profile_Version_Ini" )
+ {
+ my $file = installer::files::read_file($onefile->{'sourcepath'});
+
+ for ( my $j = 0; $j <= $#{$file}; $j++ )
+ {
+ ${$file}[$j] =~ s/\<msiproductversion\>/$installer::globals::msiproductversion/;
+ }
+
+ installer::files::save_file($onefile->{'sourcepath'}, $file);
+
+ last;
+ }
+ }
+}
+
+####################################################################################
+# Updating the file Property.idt dynamically
+# Content:
+# Property Value
+####################################################################################
+
+sub update_reglocat_table
+{
+ my ($basedir, $allvariables) = @_;
+
+ my $reglocatfilename = $basedir . $installer::globals::separator . "RegLocat.idt";
+
+ # Only do something, if this file exists
+
+ if ( -f $reglocatfilename )
+ {
+ my $reglocatfile = installer::files::read_file($reglocatfilename);
+
+ my $layername = "";
+ if ( $allvariables->{'REGISTRYLAYERNAME'} )
+ {
+ $layername = $allvariables->{'REGISTRYLAYERNAME'};
+ }
+ else
+ {
+ for ( my $i = 0; $i <= $#{$reglocatfile}; $i++ )
+ {
+ if ( ${$reglocatfile}[$i] =~ /\bLAYERNAMETEMPLATE\b/ )
+ {
+ installer::exiter::exit_program("ERROR: Variable \"REGISTRYLAYERNAME\" has to be defined", "update_reglocat_table");
+ }
+ }
+ }
+
+ if ( $layername ne "" )
+ {
+ # Updating the layername in
+
+ for ( my $i = 0; $i <= $#{$reglocatfile}; $i++ )
+ {
+ ${$reglocatfile}[$i] =~ s/\bLAYERNAMETEMPLATE\b/$layername/;
+ }
+
+ # Saving the file
+ installer::files::save_file($reglocatfilename ,$reglocatfile);
+ my $infoline = "Updated idt file: $reglocatfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+}
+
+
+
+####################################################################################
+# Updating the file RemoveRe.idt dynamically (RemoveRegistry.idt)
+# The name of the component has to be replaced.
+####################################################################################
+
+sub update_removere_table
+{
+ my ($basedir) = @_;
+
+ my $removeregistryfilename = $basedir . $installer::globals::separator . "RemoveRe.idt";
+
+ # Only do something, if this file exists
+
+ if ( -f $removeregistryfilename )
+ {
+ my $removeregistryfile = installer::files::read_file($removeregistryfilename);
+
+ for ( my $i = 0; $i <= $#{$removeregistryfile}; $i++ )
+ {
+ for ( my $i = 0; $i <= $#{$removeregistryfile}; $i++ )
+ {
+ ${$removeregistryfile}[$i] =~ s/\bREGISTRYROOTCOMPONENT\b/$installer::globals::registryrootcomponent/;
+ }
+ }
+
+ # Saving the file
+ installer::files::save_file($removeregistryfilename ,$removeregistryfile);
+ my $infoline = "Updated idt file: $removeregistryfilename \n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+}
+
+##########################################################################
+# Reading saved mappings in Files.idt and Director.idt.
+# This is required, if installation sets shall be created,
+# that can be used for creation of msp files.
+##########################################################################
+
+sub read_saved_mappings
+{
+ installer::logger::include_header_into_logfile("Reading saved mappings from older installation sets:");
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: Reading saved mappings start");
+
+ if ( $installer::globals::previous_idt_dir )
+ {
+ my @errorlines = ();
+ my $errorstring = "";
+ my $error_occured = 0;
+ my $file_error_occured = 0;
+ my $dir_error = 0;
+
+ my $idtdir = $installer::globals::previous_idt_dir;
+ $idtdir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ # Reading File.idt
+
+ my $idtfile = $idtdir . $installer::globals::separator . "File.idt";
+ push( @installer::globals::globallogfileinfo, "\nAnalyzing file: $idtfile\n" );
+ if ( ! -f $idtfile ) { push( @installer::globals::globallogfileinfo, "Warning: File $idtfile does not exist!\n" ); }
+
+ my $n = 0;
+ open (F, "<$idtfile") || installer::exiter::exit_program("ERROR: Cannot open file $idtfile for reading", "read_saved_mappings");
+ <F>; <F>; <F>;
+ while (<F>)
+ {
+ m/^([^\t]+)\t([^\t]+)\t((.*)\|)?([^\t]*)/;
+ print "OUT1: \$1: $1, \$2: $2, \$3: $3, \$4: $4, \$5: $5\n";
+ next if ("$1" eq "$5") && (!defined($3));
+ my $lc1 = lc($1);
+
+ if ( exists($installer::globals::savedmapping{"$2/$5"}))
+ {
+ if ( ! $file_error_occured )
+ {
+ $errorstring = "\nErrors in $idtfile: \n";
+ push(@errorlines, $errorstring);
+ }
+ $errorstring = "Duplicate savedmapping{" . "$2/$5}\n";
+ push(@errorlines, $errorstring);
+ $error_occured = 1;
+ $file_error_occured = 1;
+ }
+
+ if ( exists($installer::globals::savedrevmapping{$lc1}))
+ {
+ if ( ! $file_error_occured )
+ {
+ $errorstring = "\nErrors in $idtfile: \n";
+ push(@errorlines, $errorstring);
+ }
+ $errorstring = "Duplicate savedrevmapping{" . "$lc1}\n";
+ push(@errorlines, $errorstring);
+ $error_occured = 1;
+ $file_error_occured = 1;
+ }
+
+ my $shortname = $4 || '';
+
+ # Don't reuse illegal 8.3 mappings that we used to generate in 2.0.4
+ if (index($shortname, '.') > 8 ||
+ (index($shortname, '.') == -1 && length($shortname) > 8))
+ {
+ $shortname = '';
+ }
+
+ if (( $shortname ne '' ) && ( index($shortname, '~') > 0 ) && ( exists($installer::globals::savedrev83mapping{$shortname}) ))
+ {
+ if ( ! $file_error_occured )
+ {
+ $errorstring = "\nErrors in $idtfile: \n";
+ push(@errorlines, $errorstring);
+ }
+ $errorstring = "Duplicate savedrev83mapping{" . "$shortname}\n";
+ push(@errorlines, $errorstring);
+ $error_occured = 1;
+ $file_error_occured = 1;
+ }
+
+ $installer::globals::savedmapping{"$2/$5"} = "$1;$shortname";
+ $installer::globals::savedrevmapping{lc($1)} = "$2/$5";
+ $installer::globals::savedrev83mapping{$shortname} = "$2/$5" if $shortname ne '';
+ $n++;
+ }
+
+ close (F);
+
+ push( @installer::globals::globallogfileinfo, "Read $n old file table key or 8.3 name mappings from $idtfile\n" );
+
+ # Reading Director.idt
+
+ $idtfile = $idtdir . $installer::globals::separator . "Director.idt";
+ push( @installer::globals::globallogfileinfo, "\nAnalyzing file $idtfile\n" );
+ if ( ! -f $idtfile ) { push( @installer::globals::globallogfileinfo, "Warning: File $idtfile does not exist!\n" ); }
+
+ $n = 0;
+ open (F, "<$idtfile") || installer::exiter::exit_program("ERROR: Cannot open file $idtfile for reading", "read_saved_mappings");
+ <F>; <F>; <F>;
+ while (<F>)
+ {
+ m/^([^\t]+)\t([^\t]+)\t(([^~]+~\d.*)\|)?([^\t]*)/;
+ next if (!defined($3));
+ my $lc1 = lc($1);
+
+ print "OUT2: \$1: $1, \$2: $2, \$3: $3\n";
+
+ if ( exists($installer::globals::saved83dirmapping{$1}) )
+ {
+ if ( ! $dir_error_occured )
+ {
+ $errorstring = "\nErrors in $idtfile: \n";
+ push(@errorlines, $errorstring);
+ }
+ $errorstring = "Duplicate saved83dirmapping{" . "$1}\n";
+ push(@errorlines, $errorstring);
+ $error_occured = 1;
+ $dir_error_occured = 1;
+ }
+
+ $installer::globals::saved83dirmapping{$1} = $4;
+ $n++;
+ }
+ close (F);
+
+ push( @installer::globals::globallogfileinfo, "Read $n old directory 8.3 name mappings from $idtfile\n" );
+
+ # Analyzing errors
+
+ if ( $error_occured )
+ {
+ for ( my $i = 0; $i <= $#errorlines; $i++ )
+ {
+ print "$errorlines[$i]";
+ push( @installer::globals::globallogfileinfo, "$errorlines[$i]");
+ }
+ installer::exiter::exit_program("ERROR: Duplicate entries in saved mappings!", "read_saved_mappings");
+ }
+ } else {
+ # push( @installer::globals::globallogfileinfo, "WARNING: Windows patch shall be prepared, but PREVIOUS_IDT_DIR is not set!\n" );
+ installer::exiter::exit_program("ERROR: Windows patch shall be prepared, but environment variable PREVIOUS_IDT_DIR is not set!", "read_saved_mappings");
+ }
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: Reading saved mappings end");
+}
+
+1;
+
diff --git a/solenv/bin/modules/installer/windows/msp.pm b/solenv/bin/modules/installer/windows/msp.pm
new file mode 100644
index 000000000000..a4996945de4d
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/msp.pm
@@ -0,0 +1,1293 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::msp;
+
+use installer::control;
+use installer::converter;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::systemactions;
+use installer::windows::admin;
+use installer::windows::idtglobal;
+use installer::windows::update;
+
+#################################################################################
+# Making all required administrative installations
+#################################################################################
+
+sub install_installation_sets
+{
+ my ($installationdir) = @_;
+
+ # Finding the msi database in the new installation set, that is located in $installationdir
+
+ my $msifiles = installer::systemactions::find_file_with_file_extension("msi", $installationdir);
+
+ if ( $#{$msifiles} < 0 ) { installer::exiter::exit_program("ERROR: Did not find msi database in directory $installationdir", "create_msp_patch"); }
+ if ( $#{$msifiles} > 0 ) { installer::exiter::exit_program("ERROR: Did find more than one msi database in directory $installationdir", "create_msp_patch"); }
+
+ my $newinstallsetdatabasepath = $installationdir . $installer::globals::separator . ${$msifiles}[0];
+ my $oldinstallsetdatabasepath = $installer::globals::updatedatabasepath;
+
+ # Creating temp directory again
+ installer::systemactions::create_directory_structure($installer::globals::temppath);
+
+ # Creating old installation directory
+ my $dirname = "admin";
+ my $installpath = $installer::globals::temppath . $installer::globals::separator . $dirname;
+ if ( ! -d $installpath) { installer::systemactions::create_directory($installpath); }
+
+ my $oldinstallpath = $installpath . $installer::globals::separator . "old";
+ my $newinstallpath = $installpath . $installer::globals::separator . "new";
+
+ if ( ! -d $oldinstallpath) { installer::systemactions::create_directory($oldinstallpath); }
+ if ( ! -d $newinstallpath) { installer::systemactions::create_directory($newinstallpath); }
+
+ my $olddatabase = installer::windows::admin::make_admin_install($oldinstallsetdatabasepath, $oldinstallpath);
+ my $newdatabase = installer::windows::admin::make_admin_install($newinstallsetdatabasepath, $newinstallpath);
+
+ if ( $^O =~ /cygwin/i ) {
+ $olddatabase = qx{cygpath -w "$olddatabase"};
+ $olddatabase =~ s/\s*$//g;
+ $newdatabase = qx{cygpath -w "$newdatabase"};
+ $newdatabase =~ s/\s*$//g;
+ }
+
+ return ($olddatabase, $newdatabase);
+}
+
+#################################################################################
+# Extracting all tables from a pcp file
+#################################################################################
+
+sub extract_all_tables_from_pcpfile
+{
+ my ($fullpcpfilepath, $workdir) = @_;
+
+ my $msidb = "msidb.exe"; # Has to be in the path
+ my $infoline = "";
+ my $systemcall = "";
+ my $returnvalue = "";
+ my $extraslash = ""; # Has to be set for non-ActiveState perl
+
+ my $localfullpcpfile = $fullpcpfilepath;
+ my $localworkdir = $workdir;
+
+ if ( $^O =~ /cygwin/i ) {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ $localfullpcpfile =~ s/\//\\\\/g;
+ $localworkdir =~ s/\//\\\\/g;
+ $extraslash = "\\";
+ }
+
+ # Export of all tables by using "*"
+
+ $systemcall = $msidb . " -d " . $localfullpcpfile . " -f " . $localworkdir . " -e " . $extraslash . "*";
+ $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Could not exclude tables from pcp file: $fullpcpfilepath !", "extract_all_tables_from_msidatabase");
+ }
+ else
+ {
+ $infoline = "Success: Executed $systemcall successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+#################################################################################
+# Include tables into a pcp file
+#################################################################################
+
+sub include_tables_into_pcpfile
+{
+ my ($fullpcpfilepath, $workdir, $tables) = @_;
+
+ my $msidb = "msidb.exe"; # Has to be in the path
+ my $infoline = "";
+ my $systemcall = "";
+ my $returnvalue = "";
+
+ # Make all table 8+3 conform
+ my $alltables = installer::converter::convert_stringlist_into_array(\$tables, " ");
+
+ for ( my $i = 0; $i <= $#{$alltables}; $i++ )
+ {
+ my $tablename = ${$alltables}[$i];
+ $tablename =~ s/\s*$//;
+ my $namelength = length($tablename);
+ if ( $namelength > 8 )
+ {
+ my $newtablename = substr($tablename, 0, 8); # name, offset, length
+ my $oldfile = $workdir . $installer::globals::separator . $tablename . ".idt";
+ my $newfile = $workdir . $installer::globals::separator . $newtablename . ".idt";
+ if ( -f $newfile ) { unlink $newfile; }
+ installer::systemactions::copy_one_file($oldfile, $newfile);
+ }
+ }
+
+ # Import of tables
+
+ my $localworkdir = $workdir;
+ my $localfullpcpfilepath = $fullpcpfilepath;
+
+ if ( $^O =~ /cygwin/i ) {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ $localfullpcpfilepath =~ s/\//\\\\/g;
+ $localworkdir =~ s/\//\\\\/g;
+ }
+
+ $systemcall = $msidb . " -d " . $localfullpcpfilepath . " -f " . $localworkdir . " -i " . $tables;
+
+ $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Could not include tables into pcp file: $fullpcpfilepath !", "include_tables_into_pcpfile");
+ }
+ else
+ {
+ $infoline = "Success: Executed $systemcall successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+#################################################################################
+# Calling msimsp.exe
+#################################################################################
+
+sub execute_msimsp
+{
+ my ($fullpcpfilename, $mspfilename, $localmspdir) = @_;
+
+ my $msimsp = "msimsp.exe"; # Has to be in the path
+ my $infoline = "";
+ my $systemcall = "";
+ my $returnvalue = "";
+ my $logfilename = $localmspdir . $installer::globals::separator . "msimsp.log";
+
+ # Using a specific temp for each msimsp.exe process
+ # Creating temp directory again (should already have happened)
+ installer::systemactions::create_directory_structure($installer::globals::temppath);
+
+ # Creating old installation directory
+ my $dirname = "msimsptemp";
+ my $msimsptemppath = $installer::globals::temppath . $installer::globals::separator . $dirname;
+ if ( ! -d $msimsptemppath) { installer::systemactions::create_directory($msimsptemppath); }
+
+ # r:\msvc9p\PlatformSDK\v6.1\bin\msimsp.exe -s c:\patch\hotfix_qfe1.pcp -p c:\patch\patch_ooo3_m2_m3.msp -l c:\patch\patch_ooo3_m2_m3.log
+
+ if ( -f $logfilename ) { unlink $logfilename; }
+
+ my $localfullpcpfilename = $fullpcpfilename;
+ my $localmspfilename = $mspfilename;
+ my $locallogfilename = $logfilename;
+ my $localmsimsptemppath = $msimsptemppath;
+
+ if ( $^O =~ /cygwin/i ) {
+ # msimsp.exe really wants backslashes. (And double escaping because system() expands the string.)
+ $localfullpcpfilename =~ s/\//\\\\/g;
+ $locallogfilename =~ s/\//\\\\/g;
+
+ $localmspfilename =~ s/\\/\\\\/g; # path already contains backslash
+ # $localmspfilename =~ s/\//\\\\/g;
+
+ $localmsimsptemppath = qx{cygpath -w "$localmsimsptemppath"};
+ $localmsimsptemppath =~ s/\\/\\\\/g;
+ $localmsimsptemppath =~ s/\s*$//g;
+ }
+
+ $systemcall = $msimsp . " -s " . $localfullpcpfilename . " -p " . $localmspfilename . " -l " . $locallogfilename . " -f " . $localmsimsptemppath;
+ installer::logger::print_message( "... $systemcall ...\n" );
+
+ $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Could not execute $systemcall !", "execute_msimsp");
+ }
+ else
+ {
+ $infoline = "Success: Executed $systemcall successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return $logfilename;
+}
+
+####################################################################
+# Checking existence and saving all tables, that need to be edited
+####################################################################
+
+sub check_and_save_tables
+{
+ my ($tablelist, $workdir) = @_;
+
+ my $tables = installer::converter::convert_stringlist_into_array(\$tablelist, " ");
+
+ for ( my $i = 0; $i <= $#{$tables}; $i++ )
+ {
+ my $filename = ${$tables}[$i];
+ $filename =~ s/\s*$//;
+ my $fullfilename = $workdir . $installer::globals::separator . $filename . ".idt";
+
+ if ( ! -f $fullfilename ) { installer::exiter::exit_program("ERROR: Required idt file could not be found: \"$fullfilename\"!", "check_and_save_tables"); }
+
+ my $savfilename = $fullfilename . ".sav";
+ installer::systemactions::copy_one_file($fullfilename, $savfilename);
+ }
+}
+
+####################################################################
+# Setting the languages for the service packs
+####################################################################
+
+sub create_langstring
+{
+ my ( $languagesarrayref ) = @_;
+
+ my $langstring = "";
+ for ( my $i = 0; $i <= $#{$languagesarrayref}; $i++ ) { $langstring = $langstring . "_" . ${$languagesarrayref}[$i]; }
+
+ return $langstring;
+}
+
+####################################################################
+# Setting the name of the msp database
+####################################################################
+
+sub set_mspfilename
+{
+ my ($allvariables, $mspdir, $languagesarrayref) = @_;
+
+ my $databasename = $allvariables->{'PRODUCTNAME'};
+ $databasename = lc($databasename);
+ $databasename =~ s/\.//g;
+ $databasename =~ s/\-//g;
+ $databasename =~ s/\s//g;
+
+ if ( $allvariables->{'MSPPRODUCTVERSION'} ) { $databasename = $databasename . $allvariables->{'MSPPRODUCTVERSION'}; }
+
+ # possibility to overwrite the name with variable DATABASENAME
+ # if ( $allvariables->{'DATABASENAME'} ) { $databasename = $allvariables->{'DATABASENAME'}; }
+
+ # Adding patch info to database name
+ # if ( $installer::globals::buildid ) { $databasename = $databasename . "_" . $installer::globals::buildid; }
+
+ # if ( $allvariables->{'VENDORPATCHVERSION'} ) { $databasename = $databasename . "_" . $allvariables->{'VENDORPATCHVERSION'}; }
+
+
+ if (( $allvariables->{'SERVICEPACK'} ) && ( $allvariables->{'SERVICEPACK'} == 1 ))
+ {
+ my $windowspatchlevel = 0;
+ if ( $allvariables->{'MSPPATCHLEVEL'} ) { $windowspatchlevel = $allvariables->{'MSPPATCHLEVEL'}; }
+ $databasename = $databasename . "_servicepack_" . $windowspatchlevel;
+ my $languagestring = create_langstring($languagesarrayref);
+ $databasename = $databasename . $languagestring;
+ }
+ else
+ {
+ my $hotfixaddon = "hotfix_";
+ $hotfixaddon = $hotfixaddon . $installer::globals::buildid;
+ my $cwsname = "";
+ if ( $ENV{'CWS_WORK_STAMP'} ) { $hotfixaddon = $ENV{'CWS_WORK_STAMP'}; }
+ if ( $allvariables->{'OVERWRITE_CWSNAME'} ) { $hotfixaddon = $allvariables->{'OVERWRITE_CWSNAME'}; }
+ $databasename = $databasename . "_" . $hotfixaddon;
+ }
+
+ $databasename = $databasename . ".msp";
+
+ my $fullmspname = $mspdir . $installer::globals::separator . $databasename;
+
+ if ( $^O =~ /cygwin/i ) { $fullmspname =~ s/\//\\/g; }
+
+ return $fullmspname;
+}
+
+####################################################################
+# Editing table Properties
+####################################################################
+
+sub change_properties_table
+{
+ my ($localmspdir, $mspfilename) = @_;
+
+ my $infoline = "Changing content of table \"Properties\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $filename = $localmspdir . $installer::globals::separator . "Properties.idt";
+ if ( ! -f $filename ) { installer::exiter::exit_program("ERROR: Could not find file \"$filename\" !", "change_properties_table"); }
+
+ my $filecontent = installer::files::read_file($filename);
+
+
+ my $guidref = installer::windows::msiglobal::get_guid_list(1, 1);
+ ${$guidref}[0] =~ s/\s*$//; # removing ending spaces
+ my $patchcode = "\{" . ${$guidref}[0] . "\}";
+
+ # Setting "PatchOutputPath"
+ my $found_patchoutputpath = 0;
+ my $found_patchguid = 0;
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( ${$filecontent}[$i] =~ /^\s*PatchOutputPath\t(.*?)\s*$/ )
+ {
+ my $oldvalue = $1;
+ ${$filecontent}[$i] =~ s/\Q$oldvalue\E/$mspfilename/;
+ $found_patchoutputpath = 1;
+ }
+
+ if ( ${$filecontent}[$i] =~ /^\s*PatchGUID\t(.*?)\s*$/ )
+ {
+ my $oldvalue = $1;
+ ${$filecontent}[$i] =~ s/\Q$oldvalue\E/$patchcode/;
+ $found_patchguid = 1;
+ }
+ }
+
+ if ( ! $found_patchoutputpath )
+ {
+ my $newline = "PatchOutputPath\t$mspfilename\n";
+ push(@{$filecontent}, $newline);
+ }
+
+ if ( ! $found_patchguid )
+ {
+ my $newline = "PatchGUID\t$patchcode\n";
+ push(@{$filecontent}, $newline);
+ }
+
+ # saving file
+ installer::files::save_file($filename, $filecontent);
+}
+
+####################################################################
+# Editing table TargetImages
+####################################################################
+
+sub change_targetimages_table
+{
+ my ($localmspdir, $olddatabase) = @_;
+
+ my $infoline = "Changing content of table \"TargetImages\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $filename = $localmspdir . $installer::globals::separator . "TargetImages.idt";
+ if ( ! -f $filename ) { installer::exiter::exit_program("ERROR: Could not find file \"$filename\" !", "change_targetimages_table"); }
+
+ my $filecontent = installer::files::read_file($filename);
+ my @newcontent = ();
+
+ # Copying the header
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ ) { if ( $i < 3 ) { push(@newcontent, ${$filecontent}[$i]); } }
+
+ #Adding all targets
+ my $newline = "T1\t$olddatabase\t\tU1\t1\t0x00000922\t1\n";
+ push(@newcontent, $newline);
+
+ # saving file
+ installer::files::save_file($filename, \@newcontent);
+}
+
+####################################################################
+# Editing table UpgradedImages
+####################################################################
+
+sub change_upgradedimages_table
+{
+ my ($localmspdir, $newdatabase) = @_;
+
+ my $infoline = "Changing content of table \"UpgradedImages\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $filename = $localmspdir . $installer::globals::separator . "UpgradedImages.idt";
+ if ( ! -f $filename ) { installer::exiter::exit_program("ERROR: Could not find file \"$filename\" !", "change_upgradedimages_table"); }
+
+ my $filecontent = installer::files::read_file($filename);
+ my @newcontent = ();
+
+ # Copying the header
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ ) { if ( $i < 3 ) { push(@newcontent, ${$filecontent}[$i]); } }
+
+ # Syntax: Upgraded MsiPath PatchMsiPath SymbolPaths Family
+
+ # default values
+ my $upgraded = "U1";
+ my $msipath = $newdatabase;
+ my $patchmsipath = "";
+ my $symbolpaths = "";
+ my $family = "22334455";
+
+ if ( $#{$filecontent} >= 3 )
+ {
+ my $line = ${$filecontent}[3];
+ if ( $line =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ $upgraded = $1;
+ $patchmsipath = $3;
+ $symbolpaths = $4;
+ $family = $5;
+ }
+ }
+
+ #Adding sequence line, saving PatchFamily
+ my $newline = "$upgraded\t$msipath\t$patchmsipath\t$symbolpaths\t$family\n";
+ push(@newcontent, $newline);
+
+ # saving file
+ installer::files::save_file($filename, \@newcontent);
+}
+
+####################################################################
+# Editing table ImageFamilies
+####################################################################
+
+sub change_imagefamilies_table
+{
+ my ($localmspdir) = @_;
+
+ my $infoline = "Changing content of table \"ImageFamilies\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $filename = $localmspdir . $installer::globals::separator . "ImageFamilies.idt";
+ if ( ! -f $filename ) { installer::exiter::exit_program("ERROR: Could not find file \"$filename\" !", "change_imagefamilies_table"); }
+
+ my $filecontent = installer::files::read_file($filename);
+ my @newcontent = ();
+
+ # Copying the header
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ ) { if ( $i < 3 ) { push(@newcontent, ${$filecontent}[$i]); } }
+
+ # Syntax: Family MediaSrcPropName MediaDiskId FileSequenceStart DiskPrompt VolumeLabel
+ # "FileSequenceStart has to be set
+
+ # Default values:
+
+ my $family = "22334455";
+ my $mediasrcpropname = "MediaSrcPropName";
+ my $mediadiskid = "2";
+ my $filesequencestart = get_filesequencestart();
+ my $diskprompt = "";
+ my $volumelabel = "";
+
+ if ( $#{$filecontent} >= 3 )
+ {
+ my $line = ${$filecontent}[3];
+ if ( $line =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ $family = $1;
+ $mediasrcpropname = $2;
+ $mediadiskid = $3;
+ $diskprompt = $5;
+ $volumelabel = $6;
+ }
+ }
+
+ #Adding sequence line
+ my $newline = "$family\t$mediasrcpropname\t$mediadiskid\t$filesequencestart\t$diskprompt\t$volumelabel\n";
+ push(@newcontent, $newline);
+
+ # saving file
+ installer::files::save_file($filename, \@newcontent);
+}
+
+####################################################################
+# Setting start sequence for patch
+####################################################################
+
+sub get_filesequencestart
+{
+ my $sequence = 1000; # default
+
+ if ( $installer::globals::updatelastsequence ) { $sequence = $installer::globals::updatelastsequence + 500; }
+
+ return $sequence;
+}
+
+####################################################################
+# Setting time value into pcp file
+# Format mm/dd/yyyy hh:mm
+####################################################################
+
+sub get_patchtime_value
+{
+ # Syntax: 8/8/2008 11:55
+ my $minute = (localtime())[1];
+ my $hour = (localtime())[2];
+ my $day = (localtime())[3];
+ my $month = (localtime())[4];
+ my $year = 1900 + (localtime())[5];
+
+ $month++; # zero based month
+ if ( $minute < 10 ) { $minute = "0" . $minute; }
+ if ( $hour < 10 ) { $hour = "0" . $hour; }
+
+ my $timestring = $month . "/" . $day . "/" . $year . " " . $hour . ":" . $minute;
+
+ return $timestring;
+}
+
+#################################################################################
+# Checking, if this is the correct database.
+#################################################################################
+
+sub correct_langs
+{
+ my ($langs, $languagestringref) = @_;
+
+ my $correct_langs = 0;
+
+ # Comparing $langs with $languagestringref
+
+ my $langlisthash = installer::converter::convert_stringlist_into_hash(\$langs, ",");
+ my $langstringhash = installer::converter::convert_stringlist_into_hash($languagestringref, "_");
+
+ my $not_included = 0;
+ foreach my $onelang ( keys %{$langlisthash} )
+ {
+ if ( ! exists($langstringhash->{$onelang}) )
+ {
+ $not_included = 1;
+ last;
+ }
+ }
+
+ if ( ! $not_included )
+ {
+ foreach my $onelanguage ( keys %{$langstringhash} )
+ {
+ if ( ! exists($langlisthash->{$onelanguage}) )
+ {
+ $not_included = 1;
+ last;
+ }
+ }
+
+ if ( ! $not_included ) { $correct_langs = 1; }
+ }
+
+ return $correct_langs;
+}
+
+#################################################################################
+# Searching for the path to the reference database for this special product.
+#################################################################################
+
+sub get_patchid_from_list
+{
+ my ($filecontent, $languagestringref, $filename) = @_;
+
+ my $patchid = "";
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ my $line = ${$filecontent}[$i];
+ if ( $line =~ /^\s*$/ ) { next; } # empty line
+ if ( $line =~ /^\s*\#/ ) { next; } # comment line
+
+ if ( $line =~ /^\s*(.+?)\s*=\s*(.+?)\s*$/ )
+ {
+ my $langs = $1;
+ my $localpatchid = $2;
+
+ if ( correct_langs($langs, $languagestringref) )
+ {
+ $patchid = $localpatchid;
+ last;
+ }
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: Wrong syntax in file: $filename! Line: \"$line\"", "get_patchid_from_list");
+ }
+ }
+
+ return $patchid;
+}
+
+####################################################################
+# Editing table PatchMetadata
+####################################################################
+
+sub change_patchmetadata_table
+{
+ my ($localmspdir, $allvariables, $languagestringref) = @_;
+
+ my $infoline = "Changing content of table \"PatchMetadata\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $filename = $localmspdir . $installer::globals::separator . "PatchMetadata.idt";
+ if ( ! -f $filename ) { installer::exiter::exit_program("ERROR: Could not find file \"$filename\" !", "change_patchmetadata_table"); }
+
+ my $filecontent = installer::files::read_file($filename);
+ my @newcontent = ();
+
+ # Syntax: Company Property Value
+ # Interesting properties: "Classification" and "CreationTimeUTC"
+
+ my $classification_set = 0;
+ my $creationtime_set = 0;
+ my $targetproductname_set = 0;
+ my $manufacturer_set = 0;
+ my $displayname_set = 0;
+ my $description_set = 0;
+ my $allowremoval_set = 0;
+
+ my $defaultcompany = "";
+
+ my $classificationstring = "Classification";
+ my $classificationvalue = "Hotfix";
+ if (( $allvariables->{'SERVICEPACK'} ) && ( $allvariables->{'SERVICEPACK'} == 1 )) { $classificationvalue = "ServicePack"; }
+
+ my $allowremovalstring = "AllowRemoval";
+ my $allowremovalvalue = "1";
+ if (( exists($allvariables->{'MSPALLOWREMOVAL'}) ) && ( $allvariables->{'MSPALLOWREMOVAL'} == 0 )) { $allowremovalvalue = 0; }
+
+ my $timestring = "CreationTimeUTC";
+ # Syntax: 8/8/2008 11:55
+ my $timevalue = get_patchtime_value();
+
+ my $targetproductnamestring = "TargetProductName";
+ my $targetproductnamevalue = $allvariables->{'PRODUCTNAME'};
+ if ( $allvariables->{'PROPERTYTABLEPRODUCTNAME'} ) { $targetproductnamevalue = $allvariables->{'PROPERTYTABLEPRODUCTNAME'}; }
+
+ my $manufacturerstring = "ManufacturerName";
+ my $manufacturervalue = "OpenOffice.org";
+ if ( $installer::globals::longmanufacturer ) { $manufacturervalue = $installer::globals::longmanufacturer; }
+
+ my $displaynamestring = "DisplayName";
+ my $descriptionstring = "Description";
+ my $displaynamevalue = "";
+ my $descriptionvalue = "";
+
+ my $base = $allvariables->{'PRODUCTNAME'} . " " . $allvariables->{'PRODUCTVERSION'};
+ if ( $installer::globals::languagepack ) { $base = $targetproductnamevalue; }
+
+ my $windowspatchlevel = 0;
+ if ( $allvariables->{'WINDOWSPATCHLEVEL'} ) { $windowspatchlevel = $allvariables->{'WINDOWSPATCHLEVEL'}; }
+
+ my $displayaddon = "";
+ if ( $allvariables->{'PATCHDISPLAYADDON'} ) { $displayaddon = $allvariables->{'PATCHDISPLAYADDON'}; }
+
+ my $cwsname = "";
+ if ( $ENV{'CWS_WORK_STAMP'} ) { $cwsname = $ENV{'CWS_WORK_STAMP'}; }
+ if (( $cwsname ne "" ) && ( $allvariables->{'OVERWRITE_CWSNAME'} )) { $cwsname = $allvariables->{'OVERWRITE_CWSNAME'}; }
+
+ my $patchsequence = get_patchsequence($allvariables);
+
+ if (( $allvariables->{'SERVICEPACK'} ) && ( $allvariables->{'SERVICEPACK'} == 1 ))
+ {
+ $displaynamevalue = $base . " ServicePack " . $windowspatchlevel . " " . $patchsequence . " Build: " . $installer::globals::buildid;
+ $descriptionvalue = $base . " ServicePack " . $windowspatchlevel . " " . $patchsequence . " Build: " . $installer::globals::buildid;
+ }
+ else
+ {
+ $displaynamevalue = $base . " Hotfix " . $cwsname . " " . $displayaddon . " " . $patchsequence . " Build: " . $installer::globals::buildid;
+ $descriptionvalue = $base . " Hotfix " . $cwsname . " " . $displayaddon . " " . $patchsequence . " Build: " . $installer::globals::buildid;
+ $displaynamevalue =~ s/ / /g;
+ $descriptionvalue =~ s/ / /g;
+ $displaynamevalue =~ s/ / /g;
+ $descriptionvalue =~ s/ / /g;
+ $displaynamevalue =~ s/ / /g;
+ $descriptionvalue =~ s/ / /g;
+ }
+
+ if ( $allvariables->{'MSPPATCHNAMELIST'} )
+ {
+ my $patchnamelistfile = $allvariables->{'MSPPATCHNAMELIST'};
+ $patchnamelistfile = $installer::globals::idttemplatepath . $installer::globals::separator . $patchnamelistfile;
+ if ( ! -f $patchnamelistfile ) { installer::exiter::exit_program("ERROR: Could not find file \"$patchnamelistfile\".", "change_patchmetadata_table"); }
+ my $filecontent = installer::files::read_file($patchnamelistfile);
+
+ # Get name and path of reference database
+ my $patchid = get_patchid_from_list($filecontent, $languagestringref, $patchnamelistfile);
+
+ if ( $patchid eq "" ) { installer::exiter::exit_program("ERROR: Could not find file patchid in file \"$patchnamelistfile\" for language(s) \"$$languagestringref\".", "change_patchmetadata_table"); }
+
+ # Setting language specific patch id
+ }
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( ${$filecontent}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my $company = $1;
+ my $property = $2;
+ my $value = $3;
+
+ if ( $property eq $classificationstring )
+ {
+ ${$filecontent}[$i] = "$company\t$property\t$classificationvalue\n";
+ $classification_set = 1;
+ }
+
+ if ( $property eq $allowremovalstring )
+ {
+ ${$filecontent}[$i] = "$company\t$property\t$allowremovalvalue\n";
+ $allowremoval_set = 1;
+ }
+
+ if ( $property eq $timestring )
+ {
+ ${$filecontent}[$i] = "$company\t$property\t$timevalue\n";
+ $creationtime_set = 1;
+ }
+
+ if ( $property eq $targetproductnamestring )
+ {
+ ${$filecontent}[$i] = "$company\t$property\t$targetproductnamevalue\n";
+ $targetproductname_set = 1;
+ }
+
+ if ( $property eq $manufacturerstring )
+ {
+ ${$filecontent}[$i] = "$company\t$property\t$manufacturervalue\n";
+ $manufacturer_set = 1;
+ }
+
+ if ( $property eq $displaynamestring )
+ {
+ ${$filecontent}[$i] = "$company\t$property\t$displaynamevalue\n";
+ $displayname_set = 1;
+ }
+
+ if ( $property eq $descriptionstring )
+ {
+ ${$filecontent}[$i] = "$company\t$property\t$descriptionvalue\n";
+ $description_set = 1;
+ }
+ }
+
+ push(@newcontent, ${$filecontent}[$i]);
+ }
+
+ if ( ! $classification_set )
+ {
+ my $line = "$defaultcompany\t$classificationstring\t$classificationvalue\n";
+ push(@newcontent, $line);
+ }
+
+ if ( ! $allowremoval_set )
+ {
+ my $line = "$defaultcompany\t$classificationstring\t$allowremovalvalue\n";
+ push(@newcontent, $line);
+ }
+
+ if ( ! $allowremoval_set )
+ {
+ my $line = "$defaultcompany\t$classificationstring\t$allowremovalvalue\n";
+ push(@newcontent, $line);
+ }
+
+ if ( ! $creationtime_set )
+ {
+ my $line = "$defaultcompany\t$timestring\t$timevalue\n";
+ push(@newcontent, $line);
+ }
+
+ if ( ! $targetproductname_set )
+ {
+ my $line = "$defaultcompany\t$targetproductnamestring\t$targetproductnamevalue\n";
+ push(@newcontent, $line);
+ }
+
+ if ( ! $manufacturer_set )
+ {
+ my $line = "$defaultcompany\t$manufacturerstring\t$manufacturervalue\n";
+ push(@newcontent, $line);
+ }
+
+ if ( ! $displayname_set )
+ {
+ my $line = "$defaultcompany\t$displaynamestring\t$displaynamevalue\n";
+ push(@newcontent, $line);
+ }
+
+ if ( ! $description_set )
+ {
+ my $line = "$defaultcompany\t$descriptionstring\t$descriptionvalue\n";
+ push(@newcontent, $line);
+ }
+
+ # saving file
+ installer::files::save_file($filename, \@newcontent);
+}
+
+####################################################################
+# Editing table PatchSequence
+####################################################################
+
+sub change_patchsequence_table
+{
+ my ($localmspdir, $allvariables) = @_;
+
+ my $infoline = "Changing content of table \"PatchSequence\"\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $filename = $localmspdir . $installer::globals::separator . "PatchSequence.idt";
+ if ( ! -f $filename ) { installer::exiter::exit_program("ERROR: Could not find file \"$filename\" !", "change_patchsequence_table"); }
+
+ my $filecontent = installer::files::read_file($filename);
+ my @newcontent = ();
+
+ # Copying the header
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ ) { if ( $i < 3 ) { push(@newcontent, ${$filecontent}[$i]); } }
+
+ # Syntax: PatchFamily Target Sequence Supersede
+
+ my $patchfamily = "SO";
+ my $target = "";
+ my $patchsequence = get_patchsequence($allvariables);
+ my $supersede = get_supersede($allvariables);
+
+ if ( $#{$filecontent} >= 3 )
+ {
+ my $line = ${$filecontent}[3];
+ if ( $line =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\s$/ )
+ {
+ $patchfamily = $1;
+ $target = $2;
+ }
+ }
+
+ #Adding sequence line, saving PatchFamily
+ my $newline = "$patchfamily\t$target\t$patchsequence\t$supersede\n";
+ push(@newcontent, $newline);
+
+ # saving file
+ installer::files::save_file($filename, \@newcontent);
+}
+
+####################################################################
+# Setting supersede, "0" for Hotfixes, "1" for ServicePack
+####################################################################
+
+sub get_supersede
+{
+ my ( $allvariables ) = @_;
+
+ my $supersede = 0; # if not defined, this is a Hotfix
+
+ if (( $allvariables->{'SERVICEPACK'} ) && ( $allvariables->{'SERVICEPACK'} == 1 )) { $supersede = 1; }
+
+ return $supersede;
+}
+
+####################################################################
+# Setting the sequence of the patch
+####################################################################
+
+sub get_patchsequence
+{
+ my ( $allvariables ) = @_;
+
+ my $patchsequence = "1.0";
+
+ if ( ! $allvariables->{'PACKAGEVERSION'} ) { installer::exiter::exit_program("ERROR: PACKAGEVERSION must be set for msp patch creation!", "get_patchsequence"); }
+
+ my $packageversion = $allvariables->{'PACKAGEVERSION'};
+
+ if ( $packageversion =~ /^\s*(\d+)\.(\d+)\.(\d+)\s*$/ )
+ {
+ my $major = $1;
+ my $minor = $2;
+ my $micro = $3;
+ my $concat = 100 * $minor + $micro;
+ $packageversion = $major . "\." . $concat;
+ }
+ my $vendornumber = 0;
+ if ( $allvariables->{'VENDORPATCHVERSION'} ) { $vendornumber = $allvariables->{'VENDORPATCHVERSION'}; }
+ $patchsequence = $packageversion . "\." . $installer::globals::buildid . "\." . $vendornumber;
+
+ if ( $allvariables->{'PATCHSEQUENCE'} ) { $patchsequence = $allvariables->{'PATCHSEQUENCE'}; }
+
+ return $patchsequence;
+}
+
+####################################################################
+# Editing all tables from pcp file, that need to be edited
+####################################################################
+
+sub edit_tables
+{
+ my ($tablelist, $localmspdir, $olddatabase, $newdatabase, $mspfilename, $allvariables, $languagestringref) = @_;
+
+ # table list contains: my $tablelist = "Properties TargetImages UpgradedImages ImageFamilies PatchMetadata PatchSequence";
+
+ change_properties_table($localmspdir, $mspfilename);
+ change_targetimages_table($localmspdir, $olddatabase);
+ change_upgradedimages_table($localmspdir, $newdatabase);
+ change_imagefamilies_table($localmspdir);
+ change_patchmetadata_table($localmspdir, $allvariables, $languagestringref);
+ change_patchsequence_table($localmspdir, $allvariables);
+}
+
+#################################################################################
+# Checking, if this is the correct database.
+#################################################################################
+
+sub correct_patch
+{
+ my ($product, $pro, $langs, $languagestringref) = @_;
+
+ my $correct_patch = 0;
+
+ # Comparing $product with $installer::globals::product and
+ # $pro with $installer::globals::pro and
+ # $langs with $languagestringref
+
+ my $product_is_good = 0;
+
+ my $localproduct = $installer::globals::product;
+ if ( $installer::globals::languagepack ) { $localproduct = $localproduct . "LanguagePack"; }
+
+ if ( $product eq $localproduct ) { $product_is_good = 1; }
+
+ if ( $product_is_good )
+ {
+ my $pro_is_good = 0;
+
+ if ((( $pro eq "pro" ) && ( $installer::globals::pro )) || (( $pro eq "nonpro" ) && ( ! $installer::globals::pro ))) { $pro_is_good = 1; }
+
+ if ( $pro_is_good )
+ {
+ my $langlisthash = installer::converter::convert_stringlist_into_hash(\$langs, ",");
+ my $langstringhash = installer::converter::convert_stringlist_into_hash($languagestringref, "_");
+
+ my $not_included = 0;
+ foreach my $onelang ( keys %{$langlisthash} )
+ {
+ if ( ! exists($langstringhash->{$onelang}) )
+ {
+ $not_included = 1;
+ last;
+ }
+ }
+
+ if ( ! $not_included )
+ {
+ foreach my $onelanguage ( keys %{$langstringhash} )
+ {
+ if ( ! exists($langlisthash->{$onelanguage}) )
+ {
+ $not_included = 1;
+ last;
+ }
+ }
+
+ if ( ! $not_included ) { $correct_patch = 1; }
+ }
+ }
+ }
+
+ return $correct_patch;
+}
+
+#################################################################################
+# Searching for the path to the required patch for this special product.
+#################################################################################
+
+sub get_requiredpatchfile_from_list
+{
+ my ($filecontent, $languagestringref, $filename) = @_;
+
+ my $patchpath = "";
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ my $line = ${$filecontent}[$i];
+ if ( $line =~ /^\s*$/ ) { next; } # empty line
+ if ( $line =~ /^\s*\#/ ) { next; } # comment line
+
+ if ( $line =~ /^\s*(.+?)\s*\t+\s*(.+?)\s*\t+\s*(.+?)\s*\t+\s*(.+?)\s*$/ )
+ {
+ my $product = $1;
+ my $pro = $2;
+ my $langs = $3;
+ my $path = $4;
+
+ if (( $pro ne "pro" ) && ( $pro ne "nonpro" )) { installer::exiter::exit_program("ERROR: Wrong syntax in file: $filename. Only \"pro\" or \"nonpro\" allowed in column 1! Line: \"$line\"", "get_databasename_from_list"); }
+
+ if ( correct_patch($product, $pro, $langs, $languagestringref) )
+ {
+ $patchpath = $path;
+ last;
+ }
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: Wrong syntax in file: $filename! Line: \"$line\"", "get_requiredpatchfile_from_list");
+ }
+ }
+
+ return $patchpath;
+}
+
+##################################################################
+# Converting unicode file to ascii
+# to be more precise: uft-16 little endian to ascii
+##################################################################
+
+sub convert_unicode_to_ascii
+{
+ my ( $filename ) = @_;
+
+ my @localfile = ();
+
+ my $savfilename = $filename . "_before.unicode";
+ installer::systemactions::copy_one_file($filename, $savfilename);
+
+# open( IN, "<:utf16", $filename ) || installer::exiter::exit_program("ERROR: Cannot open file $filename for reading", "convert_unicode_to_ascii");
+# open( IN, "<:para:crlf:uni", $filename ) || installer::exiter::exit_program("ERROR: Cannot open file $filename for reading", "convert_unicode_to_ascii");
+ open( IN, "<:encoding(UTF16-LE)", $filename ) || installer::exiter::exit_program("ERROR: Cannot open file $filename for reading", "convert_unicode_to_ascii");
+# open( IN, "<:encoding(UTF-8)", $filename ) || installer::exiter::exit_program("ERROR: Cannot open file $filename for reading", "convert_unicode_to_ascii");
+ while ( $line = <IN> ) {
+ push @localfile, $line;
+ }
+ close( IN );
+
+ if ( open( OUT, ">", $filename ) )
+ {
+ print OUT @localfile;
+ close(OUT);
+ }
+}
+
+####################################################################
+# Analyzing the log file created by msimsp.exe to find all
+# files included into the patch.
+####################################################################
+
+sub analyze_msimsp_logfile
+{
+ my ($logfile, $filesarray) = @_;
+
+ # Reading log file after converting from utf-16 (LE) to ascii
+ convert_unicode_to_ascii($logfile);
+ my $logfilecontent = installer::files::read_file($logfile);
+
+ # Creating hash from $filesarray: unique file name -> destination of file
+ my %filehash = ();
+ my %destinationcollector = ();
+
+ for ( my $i = 0; $i <= $#{$filesarray}; $i++ )
+ {
+ my $onefile = ${$filesarray}[$i];
+
+ # Only collecting files with "uniquename" and "destination"
+ if (( exists($onefile->{'uniquename'}) ) && ( exists($onefile->{'uniquename'}) ))
+ {
+ my $uniquefilename = $onefile->{'uniquename'};
+ my $destpath = $onefile->{'destination'};
+ $filehash{$uniquefilename} = $destpath;
+ }
+ }
+
+ # Analyzing log file of msimsp.exe, finding all changed files
+ # and searching all destinations of unique file names.
+ # Content in log file: "INFO File Key: <file key> is modified"
+ # Collecting content in @installer::globals::patchfilecollector
+
+ for ( my $i = 0; $i <= $#{$logfilecontent}; $i++ )
+ {
+ if ( ${$logfilecontent}[$i] =~ /Key\:\s*(.*?) is modified\s*$/ )
+ {
+ my $filekey = $1;
+ if ( exists($filehash{$filekey}) ) { $destinationcollector{$filehash{$filekey}} = 1; }
+ else { installer::exiter::exit_program("ERROR: Could not find file key \"$filekey\" in file collector.", "analyze_msimsp_logfile"); }
+ }
+ }
+
+ foreach my $onedest ( sort keys %destinationcollector ) { push(@installer::globals::patchfilecollector, "$onedest\n"); }
+
+}
+
+####################################################################
+# Creating msp patch files for Windows
+####################################################################
+
+sub create_msp_patch
+{
+ my ($installationdir, $includepatharrayref, $allvariables, $languagestringref, $languagesarrayref, $filesarray) = @_;
+
+ my $force = 1; # print this message even in 'quiet' mode
+ installer::logger::print_message( "\n******************************************\n" );
+ installer::logger::print_message( "... creating msp installation set ...\n", $force );
+ installer::logger::print_message( "******************************************\n" );
+
+ $installer::globals::creating_windows_installer_patch = 1;
+
+ my @needed_files = ("msimsp.exe"); # only required for patch creation process
+ installer::control::check_needed_files_in_path(\@needed_files);
+
+ installer::logger::include_header_into_logfile("Creating msp installation sets:");
+
+ my $firstdir = $installationdir;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$firstdir);
+
+ my $lastdir = $installationdir;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$lastdir);
+
+ if ( $lastdir =~ /\./ ) { $lastdir =~ s/\./_msp_inprogress\./ }
+ else { $lastdir = $lastdir . "_msp_inprogress"; }
+
+ # Removing existing directory "_native_packed_inprogress" and "_native_packed_witherror" and "_native_packed"
+
+ my $mspdir = $firstdir . $lastdir;
+ if ( -d $mspdir ) { installer::systemactions::remove_complete_directory($mspdir); }
+
+ my $olddir = $mspdir;
+ $olddir =~ s/_inprogress/_witherror/;
+ if ( -d $olddir ) { installer::systemactions::remove_complete_directory($olddir); }
+
+ $olddir = $mspdir;
+ $olddir =~ s/_inprogress//;
+ if ( -d $olddir ) { installer::systemactions::remove_complete_directory($olddir); }
+
+ # Creating the new directory for new installation set
+ installer::systemactions::create_directory($mspdir);
+
+ $installer::globals::saveinstalldir = $mspdir;
+
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Starting product installation");
+
+ # Installing both installation sets
+ installer::logger::print_message( "... installing products ...\n" );
+ my ($olddatabase, $newdatabase) = install_installation_sets($installationdir);
+
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Starting pcp file creation");
+
+ # Create pcp file
+ installer::logger::print_message( "... creating pcp file ...\n" );
+
+ my $localmspdir = installer::systemactions::create_directories("msp", $languagestringref);
+
+ if ( ! $allvariables->{'PCPFILENAME'} ) { installer::exiter::exit_program("ERROR: Property \"PCPFILENAME\" has to be defined.", "create_msp_patch"); }
+ my $pcpfilename = $allvariables->{'PCPFILENAME'};
+
+ if ( $installer::globals::languagepack ) { $pcpfilename =~ s/.pcp\s*$/languagepack.pcp/; }
+
+ # Searching the pcp file in the include pathes
+ my $fullpcpfilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$pcpfilename, $includepatharrayref, 1);
+ if ( $$fullpcpfilenameref eq "" ) { installer::exiter::exit_program("ERROR: pcp file not found: $pcpfilename !", "create_msp_patch"); }
+ my $fullpcpfilenamesource = $$fullpcpfilenameref;
+
+ # Copying pcp file
+ my $fullpcpfilename = $localmspdir . $installer::globals::separator . $pcpfilename;
+ installer::systemactions::copy_one_file($fullpcpfilenamesource, $fullpcpfilename);
+
+ # a. Extracting tables from msi database: msidb.exe -d <msifile> -f <directory> -e File Media, ...
+ # b. Changing content of msi database in tables: File, Media, Directory, FeatureComponent
+ # c. Including tables into msi database: msidb.exe -d <msifile> -f <directory> -i File Media, ...
+
+ # Unpacking tables from pcp file
+ extract_all_tables_from_pcpfile($fullpcpfilename, $localmspdir);
+
+ # Tables, that need to be edited
+ my $tablelist = "Properties TargetImages UpgradedImages ImageFamilies PatchMetadata PatchSequence"; # required tables
+
+ # Saving all tables
+ check_and_save_tables($tablelist, $localmspdir);
+
+ # Setting the name of the new msp file
+ my $mspfilename = set_mspfilename($allvariables, $mspdir, $languagesarrayref);
+
+ # Editing tables
+ edit_tables($tablelist, $localmspdir, $olddatabase, $newdatabase, $mspfilename, $allvariables, $languagestringref);
+
+ # Adding edited tables into pcp file
+ include_tables_into_pcpfile($fullpcpfilename, $localmspdir, $tablelist);
+
+ # Start msimsp.exe
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Starting msimsp.exe");
+ my $msimsplogfile = execute_msimsp($fullpcpfilename, $mspfilename, $localmspdir);
+
+ # Copy final installation set next to msp file
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: Copying installation set");
+ installer::logger::print_message( "... copying installation set ...\n" );
+
+ my $oldinstallationsetpath = $installer::globals::updatedatabasepath;
+
+ if ( $^O =~ /cygwin/i ) { $oldinstallationsetpath =~ s/\\/\//g; }
+
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$oldinstallationsetpath);
+ installer::systemactions::copy_complete_directory($oldinstallationsetpath, $mspdir);
+
+ # Copying additional patches into the installation set, if required
+ if (( $allvariables->{'ADDITIONALREQUIREDPATCHES'} ) && ( $allvariables->{'ADDITIONALREQUIREDPATCHES'} ne "" ) && ( ! $installer::globals::languagepack ))
+ {
+ my $filename = $allvariables->{'ADDITIONALREQUIREDPATCHES'};
+
+ my $fullfilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 1);
+ if ( $$fullfilenameref eq "" ) { installer::exiter::exit_program("ERROR: Could not find file with required patches, although it is defined: $filename !", "create_msp_patch"); }
+ my $fullfilename = $$fullfilenameref;
+
+ # Reading list file
+ my $listfile = installer::files::read_file($fullfilename);
+
+ # Get name and path of reference database
+ my $requiredpatchfile = get_requiredpatchfile_from_list($listfile, $languagestringref, $fullfilename);
+ if ( $requiredpatchfile eq "" ) { installer::exiter::exit_program("ERROR: Could not find path to required patch in file $fullfilename for language(s) $$languagestringref!", "create_msp_patch"); }
+
+ # Copying patch file
+ installer::systemactions::copy_one_file($requiredpatchfile, $mspdir);
+ # my $infoline = "Copy $requiredpatchfile to $mspdir\n";
+ # push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ # Find all files included into the patch
+ # Analyzing the msimsp log file $msimsplogfile
+ analyze_msimsp_logfile($msimsplogfile, $filesarray);
+
+ # Done
+ installer::logger::include_timestamp_into_logfile("\nPerformance Info: msp creation done");
+
+ return $mspdir;
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/patch.pm b/solenv/bin/modules/installer/windows/patch.pm
new file mode 100644
index 000000000000..536464192a71
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/patch.pm
@@ -0,0 +1,155 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::patch;
+
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::windows::idtglobal;
+
+####################################################################################
+# Creating the file Upgrade.idt dynamically
+# Content:
+# UpgradeCode VersionMin VersionMax Language Attributes Remove ActionProperty
+####################################################################################
+
+sub update_patch_tables
+{
+ my ($basedir, $allvariables) = @_;
+
+ my $reglocatfile = "";
+ my $appsearchfile = "";
+
+ my $reglocatfilename = $basedir . $installer::globals::separator . "RegLocat.idt";
+ my $appsearchfilename = $basedir . $installer::globals::separator . "AppSearc.idt";
+ my $signaturefilename = $basedir . $installer::globals::separator . "Signatur.idt";
+
+ if ( -f $reglocatfilename )
+ {
+ $reglocatfile = installer::files::read_file($reglocatfilename);
+ }
+ else
+ {
+ my @reglocattable = ();
+ $reglocatfile = \@reglocattable;
+ installer::windows::idtglobal::write_idt_header($reglocatfile, "reglocat");
+ }
+
+ if ( -f $appsearchfilename )
+ {
+ $appsearchfile = installer::files::read_file($appsearchfilename);
+ }
+ else
+ {
+ my @appsearchtable = ();
+ $appsearchfile = \@appsearchtable;
+ installer::windows::idtglobal::write_idt_header($appsearchfile, "appsearch");
+ }
+
+ if ( -f $signaturefilename )
+ {
+ $signaturefile = installer::files::read_file($signaturefilename);
+ }
+ else
+ {
+ my @signaturetable = ();
+ $signaturefile = \@signaturetable;
+ installer::windows::idtglobal::write_idt_header($signaturefile, "signatur");
+ }
+
+ # Writing content into this tables
+
+ if ( ! $allvariables->{'PATCHCODEFILE'} ) { installer::exiter::exit_program("ERROR: Variable PATCHCODEFILE must be defined for Windows patches!", "update_patch_tables"); }
+ my $patchcodesfilename = $installer::globals::idttemplatepath . $installer::globals::separator . $allvariables->{'PATCHCODEFILE'};
+ my $patchcodefile = installer::files::read_file($patchcodesfilename);
+
+ my $number = 0;
+
+ for ( my $i = 0; $i <= $#{$patchcodefile}; $i++ )
+ {
+ my $oneline = ${$patchcodefile}[$i];
+
+ if ( $oneline =~ /^\s*\#/ ) { next; } # this is a comment line
+ if ( $oneline =~ /^\s*$/ ) { next; }
+
+ my $code = "";
+ if ( $oneline =~ /^\s*(\S+)\s/ ) { $code = $1; }
+
+ foreach my $name ( sort keys %installer::globals::installlocations )
+ {
+ $number++;
+ my $signature = "dir" . $number . "user";
+ my $rootvalue = "1";
+ my $registryname = "";
+ my $registryversion = "";
+
+ if ( $allvariables->{'SEARCHPRODUCTNAME'} ) { $registryname = $allvariables->{'SEARCHPRODUCTNAME'}; }
+ else { $registryname = $allvariables->{'PRODUCTNAME'}; }
+
+ if ( $allvariables->{'SEARCHPRODUCTVERSION'} ) { $registryversion = $allvariables->{'SEARCHPRODUCTVERSION'}; }
+ else { $registryversion = $allvariables->{'PRODUCTVERSION'}; }
+
+ my $key = "Software\\" . $allvariables->{'MANUFACTURER'} . "\\" . $registryname . "\\" . $registryversion . "\\" . $code;
+
+ my $type = 2;
+ my $property = $name;
+
+ $oneline = $signature . "\t" . $rootvalue . "\t" . $key . "\t" . $name . "\t" . $type . "\n";
+ push(@{$reglocatfile}, $oneline);
+
+ $oneline = $property . "\t" . $signature . "\n";
+ push(@{$appsearchfile}, $oneline);
+
+ $signature = "dir" . $number . "mach";
+ $rootvalue = "2";
+
+ $oneline = $signature . "\t" . $rootvalue . "\t" . $key . "\t" . $name . "\t" . $type . "\n";
+ push(@{$reglocatfile}, $oneline);
+
+ $oneline = $property . "\t" . $signature . "\n";
+ push(@{$appsearchfile}, $oneline);
+ }
+ }
+
+ # Saving the files
+
+ installer::files::save_file($reglocatfilename ,$reglocatfile);
+ my $infoline = "Updated idt file: $reglocatfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ installer::files::save_file($appsearchfilename ,$appsearchfile);
+ $infoline = "Updated idt file: $appsearchfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ installer::files::save_file($signaturefilename ,$signaturefile);
+ $infoline = "Updated idt file: $signaturefilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/property.pm b/solenv/bin/modules/installer/windows/property.pm
new file mode 100644
index 000000000000..9e5557e4dacc
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/property.pm
@@ -0,0 +1,656 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::property;
+
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::windows::idtglobal;
+use installer::windows::language;
+
+#############################################
+# Setting the properties dynamically
+# for the table Property.idt
+#############################################
+
+sub get_arpcomments_for_property_table
+{
+ my ( $allvariables, $languagestringref ) = @_;
+
+ my $name = $allvariables->{'PRODUCTNAME'};
+ my $version = $allvariables->{'PRODUCTVERSION'};
+ my $comment = $name . " " . $version;
+
+ my $postversionextension = "";
+ if ( $allvariables->{'POSTVERSIONEXTENSION'} )
+ {
+ $postversionextension = $allvariables->{'POSTVERSIONEXTENSION'};
+ $comment = $comment . " " . $postversionextension;
+ }
+
+ if ( $installer::globals::languagepack ) { $comment = $comment . " " . "Language Pack"; }
+
+ if ( $installer::globals::patch )
+ {
+ if ( ! $allvariables->{'WINDOWSPATCHLEVEL'} ) { installer::exiter::exit_program("ERROR: No Patch level defined for Windows patch: WINDOWSPATCHLEVEL", "get_arpcomments_for_property_table"); }
+ my $patchstring = "Product Update" . " " . $allvariables->{'WINDOWSPATCHLEVEL'};
+ $comment = $comment . " " . $patchstring;
+ }
+
+ my $languagestring = $$languagestringref;
+ $languagestring =~ s/\_/\,/g;
+
+ $comment = $comment . " ($languagestring)";
+
+ my $localminor = "";
+ if ( $installer::globals::updatepack ) { $localminor = $installer::globals::lastminor; }
+ else { $localminor = $installer::globals::minor; }
+
+ my $buildidstring = "(" . $installer::globals::build . $localminor . "(Build:" . $installer::globals::buildid . "))";
+
+ # the environment variable CWS_WORK_STAMP is set only in CWS
+ if ( $ENV{'CWS_WORK_STAMP'} ) { $buildidstring = $buildidstring . "\[CWS\:" . $ENV{'CWS_WORK_STAMP'} . "\]"; }
+
+ $comment = $comment . " " . $buildidstring;
+
+ return $comment;
+}
+
+sub get_installlevel_for_property_table
+{
+ my $installlevel = "100";
+ return $installlevel;
+}
+
+sub get_ischeckforproductupdates_for_property_table
+{
+ my $ischeckforproductupdates = "1";
+ return $ischeckforproductupdates;
+}
+
+sub get_manufacturer_for_property_table
+{
+ return $installer::globals::manufacturer;
+}
+
+sub get_productlanguage_for_property_table
+{
+ my ($language) = @_;
+ my $windowslanguage = installer::windows::language::get_windows_language($language);
+ return $windowslanguage;
+}
+
+sub get_language_string
+{
+ my $langstring = "";
+
+ for ( my $i = 0; $i <= $#installer::globals::languagenames; $i++ )
+ {
+ $langstring = $langstring . $installer::globals::languagenames[$i] . ", ";
+ }
+
+ $langstring =~ s/\,\s*$//;
+ $langstring = "(" . $langstring . ")";
+
+ return $langstring;
+}
+
+sub get_english_language_string
+{
+ my $langstring = "";
+
+ # Sorting value not keys, therefore collecting all values
+ my %helper = ();
+ foreach my $lang ( keys %installer::globals::all_required_english_languagestrings )
+ {
+ $helper{$installer::globals::all_required_english_languagestrings{$lang}} = 1;
+ }
+
+ foreach my $lang ( sort keys %helper )
+ {
+ $langstring = $langstring . $lang . ", ";
+ }
+
+ $langstring =~ s/\,\s*$//;
+ $langstring = "(" . $langstring . ")";
+
+ return $langstring;
+}
+
+sub get_productname_for_property_table
+{
+ my ( $allvariables ) = @_;
+
+ my $name = $allvariables->{'PRODUCTNAME'};
+ my $version = $allvariables->{'PRODUCTVERSION'};
+ my $productname = $name . " " . $version;
+
+ my $postversionextension = "";
+ if ( $allvariables->{'POSTVERSIONEXTENSION'} )
+ {
+ $postversionextension = $allvariables->{'POSTVERSIONEXTENSION'};
+ $productname = $productname . " " . $postversionextension;
+ }
+
+ my $productextension = "";
+ if ( $allvariables->{'PRODUCTEXTENSION'} )
+ {
+ $productextension = $allvariables->{'PRODUCTEXTENSION'};
+ $productname = $productname . " " . $productextension;
+ }
+
+ if ( $installer::globals::languagepack )
+ {
+ # my $langstring = get_language_string(); # Example (English, Deutsch)
+ my $langstring = get_english_language_string(); # New: (English, German)
+ $productname = $name . " " . $version . " Language Pack" . " " . $langstring;
+ }
+
+ if ( $installer::globals::patch )
+ {
+ if ( ! $allvariables->{'WINDOWSPATCHLEVEL'} ) { installer::exiter::exit_program("ERROR: No Patch level defined for Windows patch: WINDOWSPATCHLEVEL", "get_productname_for_property_table"); }
+ my $patchstring = "Product Update" . " " . $allvariables->{'WINDOWSPATCHLEVEL'};
+ $productname = $productname . " " . $patchstring;
+ }
+
+ # Saving this name in hash $allvariables for further usage
+ $allvariables->{'PROPERTYTABLEPRODUCTNAME'} = $productname;
+ my $infoline = "Defined variable PROPERTYTABLEPRODUCTNAME: $productname\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ return $productname;
+}
+
+sub get_quickstarterlinkname_for_property_table
+{
+ my ( $allvariables ) = @_;
+
+ # no usage of POSTVERSIONEXTENSION for Quickstarter link name!
+
+ my $name = $allvariables->{'PRODUCTNAME'};
+ my $version = $allvariables->{'PRODUCTVERSION'};
+ my $quickstartername = $name . " " . $version;
+
+ my $infoline = "Defined Quickstarter Link name: $quickstartername\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ return $quickstartername;
+}
+
+sub get_productversion_for_property_table
+{
+ return $installer::globals::msiproductversion;
+}
+
+#######################################################
+# Setting all feature names as Properties. This is
+# required for the Windows patch process.
+#######################################################
+
+sub set_featurename_properties_for_patch
+{
+ ($propertyfile) = @_;
+
+ for ( my $i = 0; $i <= $#installer::globals::featurecollector; $i++ )
+ {
+ my $onepropertyline = $installer::globals::featurecollector[$i] . "\t" . "1" . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+}
+
+#######################################################
+# Setting some important properties
+# (for finding the product in deinstallation process)
+#######################################################
+
+sub set_important_properties
+{
+ my ($propertyfile, $allvariables, $languagestringref) = @_;
+
+ # Setting new variables with the content of %PRODUCTNAME and %PRODUCTVERSION
+ if ( $allvariables->{'PRODUCTNAME'} )
+ {
+ my $onepropertyline = "DEFINEDPRODUCT" . "\t" . $allvariables->{'PRODUCTNAME'} . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if ( $allvariables->{'PRODUCTVERSION'} )
+ {
+ my $onepropertyline = "DEFINEDVERSION" . "\t" . $allvariables->{'PRODUCTVERSION'} . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if (( $allvariables->{'PRODUCTNAME'} ) && ( $allvariables->{'PRODUCTVERSION'} ) && ( $allvariables->{'MANUFACTURER'} ) && ( $allvariables->{'PRODUCTCODE'} ))
+ {
+ my $onepropertyline = "FINDPRODUCT" . "\t" . "Software\\" . $allvariables->{'MANUFACTURER'} . "\\" . $allvariables->{'PRODUCTNAME'} . $allvariables->{'PRODUCTADDON'} . "\\" . $allvariables->{'PRODUCTVERSION'} . "\\" . $allvariables->{'PRODUCTCODE'} . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if ( $allvariables->{'PRODUCTMAJOR'} )
+ {
+ my $onepropertyline = "PRODUCTMAJOR" . "\t" . $allvariables->{'PRODUCTMAJOR'} . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if ( $allvariables->{'PRODUCTMINOR'} )
+ {
+ my $onepropertyline = "PRODUCTMINOR" . "\t" . $allvariables->{'PRODUCTMINOR'} . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if ( $allvariables->{'PRODUCTBUILDID'} )
+ {
+ my $onepropertyline = "PRODUCTBUILDID" . "\t" . $allvariables->{'PRODUCTBUILDID'} . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if ( $allvariables->{'OOOBASEVERSION'} )
+ {
+ my $onepropertyline = "OOOBASEVERSION" . "\t" . $allvariables->{'OOOBASEVERSION'} . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if ( $allvariables->{'URELAYERVERSION'} )
+ {
+ my $onepropertyline = "URELAYERVERSION" . "\t" . $allvariables->{'URELAYERVERSION'} . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if ( $allvariables->{'BRANDPACKAGEVERSION'} )
+ {
+ my $onepropertyline = "BRANDPACKAGEVERSION" . "\t" . $allvariables->{'BRANDPACKAGEVERSION'} . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if ( $allvariables->{'BASISROOTNAME'} )
+ {
+ my $onepropertyline = "BASISROOTNAME" . "\t" . $allvariables->{'BASISROOTNAME'} . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if ( $allvariables->{'PREREQUIREDPATCH'} )
+ {
+ my $onepropertyline = "PREREQUIREDPATCH" . "\t" . $allvariables->{'PREREQUIREDPATCH'} . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ my $onepropertyline = "IGNOREPREREQUIREDPATCH" . "\t" . "1" . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+
+ $onepropertyline = "DONTOPTIMIZELIBS" . "\t" . "0" . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+
+ if ( $installer::globals::sundirexists )
+ {
+ my $onepropertyline = "SUNDIREXISTS" . "\t" . "1" . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if ( $installer::globals::officedirhostname )
+ {
+ my $onepropertyline = "OFFICEDIRHOSTNAME" . "\t" . $installer::globals::officedirhostname . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+
+ my $localofficedirhostname = $installer::globals::officedirhostname;
+ $localofficedirhostname =~ s/\//\\/g;
+ $onepropertyline = "OFFICEDIRHOSTNAME_" . "\t" . $localofficedirhostname . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if ( $installer::globals::sundirhostname )
+ {
+ my $onepropertyline = "SUNDIRHOSTNAME" . "\t" . $installer::globals::sundirhostname . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if ( $installer::globals::desktoplinkexists )
+ {
+ my $onepropertyline = "DESKTOPLINKEXISTS" . "\t" . "1" . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+
+ $onepropertyline = "CREATEDESKTOPLINK" . "\t" . "1" . "\n"; # Setting the default
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if ( $installer::globals::patch )
+ {
+ my $onepropertyline = "ISPATCH" . "\t" . "1" . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+
+ $onepropertyline = "SETUP_USED" . "\t" . "0" . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ if ( $installer::globals::languagepack )
+ {
+ my $onepropertyline = "ISLANGUAGEPACK" . "\t" . "1" . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ my $languagesline = "PRODUCTALLLANGUAGES" . "\t" . $$languagestringref . "\n";
+ push(@{$propertyfile}, $languagesline);
+
+ if (( $allvariables->{'PRODUCTEXTENSION'} ) && ( $allvariables->{'PRODUCTEXTENSION'} eq "Beta" ))
+ {
+ # my $registryline = "WRITE_REGISTRY" . "\t" . "0" . "\n";
+ # push(@{$propertyfile}, $registryline);
+ my $betainfoline = "BETAPRODUCT" . "\t" . "1" . "\n";
+ push(@{$propertyfile}, $betainfoline);
+ }
+ elsif ( $allvariables->{'DEVELOPMENTPRODUCT'} )
+ {
+ my $registryline = "WRITE_REGISTRY" . "\t" . "0" . "\n";
+ push(@{$propertyfile}, $registryline);
+ }
+ else
+ {
+ my $registryline = "WRITE_REGISTRY" . "\t" . "1" . "\n"; # Default: Write complete registry
+ push(@{$propertyfile}, $registryline);
+ }
+
+ # Adding also used tree conditions for multilayer products.
+ # These are saved in %installer::globals::usedtreeconditions
+ foreach my $treecondition (keys %installer::globals::usedtreeconditions)
+ {
+ my $onepropertyline = $treecondition . "\t" . "1" . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ # No more license dialog for selected products
+ if ( $allvariables->{'HIDELICENSEDIALOG'} )
+ {
+ my $onepropertyline = "HIDEEULA" . "\t" . "1" . "\n";
+
+ my $already_defined = 0;
+
+ for ( my $i = 0; $i <= $#{$propertyfile}; $i++ )
+ {
+ if ( ${$propertyfile}[$i] =~ /^\s*HIDEEULA\t/ )
+ {
+ ${$propertyfile}[$i] = $onepropertyline;
+ $already_defined = 1;
+ last;
+ }
+ }
+
+ if ( ! $already_defined )
+ {
+ push(@{$propertyfile}, $onepropertyline);
+ }
+ }
+
+ # Setting .NET requirements
+ if ( $installer::globals::required_dotnet_version ne "" )
+ {
+ my $onepropertyline = "REQUIRED_DOTNET_VERSION" . "\t" . $installer::globals::required_dotnet_version . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+
+ $onepropertyline = "DOTNET_SUFFICIENT" . "\t" . "1" . "\n"; # default value for found .NET
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+}
+
+#######################################################
+# Setting properties needed for ms file type registration
+#######################################################
+
+sub set_ms_file_types_properties
+{
+ my ($propertyfile) = @_;
+
+ push(@{$propertyfile}, "REGISTER_PPS" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_PPSX" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_PPSM" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_PPAM" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_PPT" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_PPTX" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_PPTM" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_POT" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_POTX" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_POTM" . "\t" . "0" . "\n");
+
+ push(@{$propertyfile}, "REGISTER_DOC" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_DOCX" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_DOCM" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_DOT" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_DOTX" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_DOTM" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_RTF" . "\t" . "0" . "\n");
+
+ push(@{$propertyfile}, "REGISTER_XLS" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_XLSX" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_XLSM" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_XLSB" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_XLAM" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_XLT" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_XLTX" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_XLTM" . "\t" . "0" . "\n");
+
+ push(@{$propertyfile}, "REGISTER_NO_MSO_TYPES" . "\t" . "0" . "\n");
+ push(@{$propertyfile}, "REGISTER_ALL_MSO_TYPES" . "\t" . "0" . "\n");
+}
+
+####################################################################################
+# Updating the file Property.idt dynamically
+# Content:
+# Property Value
+####################################################################################
+
+sub update_property_table
+{
+ my ($basedir, $language, $allvariables, $languagestringref) = @_;
+
+ my $properyfilename = $basedir . $installer::globals::separator . "Property.idt";
+
+ my $propertyfile = installer::files::read_file($properyfilename);
+
+ # Getting the new values
+ # Some values (arpcomments, arpcontacts, ...) are inserted from the Property.mlf
+
+ my $arpcomments = get_arpcomments_for_property_table($allvariables, $languagestringref);
+ my $installlevel = get_installlevel_for_property_table();
+ my $ischeckforproductupdates = get_ischeckforproductupdates_for_property_table();
+ my $manufacturer = get_manufacturer_for_property_table();
+ my $productlanguage = get_productlanguage_for_property_table($language);
+ my $productname = get_productname_for_property_table($allvariables);
+ my $productversion = get_productversion_for_property_table();
+ my $quickstarterlinkname = get_quickstarterlinkname_for_property_table($allvariables);
+
+ # Updating the values
+
+ for ( my $i = 0; $i <= $#{$propertyfile}; $i++ )
+ {
+ ${$propertyfile}[$i] =~ s/\bARPCOMMENTSTEMPLATE\b/$arpcomments/;
+ ${$propertyfile}[$i] =~ s/\bINSTALLLEVELTEMPLATE\b/$installlevel/;
+ ${$propertyfile}[$i] =~ s/\bISCHECKFORPRODUCTUPDATESTEMPLATE\b/$ischeckforproductupdates/;
+ ${$propertyfile}[$i] =~ s/\bMANUFACTURERTEMPLATE\b/$manufacturer/;
+ ${$propertyfile}[$i] =~ s/\bPRODUCTLANGUAGETEMPLATE\b/$productlanguage/;
+ ${$propertyfile}[$i] =~ s/\bPRODUCTNAMETEMPLATE\b/$productname/;
+ ${$propertyfile}[$i] =~ s/\bPRODUCTVERSIONTEMPLATE\b/$productversion/;
+ ${$propertyfile}[$i] =~ s/\bQUICKSTARTERLINKNAMETEMPLATE\b/$quickstarterlinkname/;
+ }
+
+ # Setting variables into propertytable
+ set_important_properties($propertyfile, $allvariables, $languagestringref);
+
+ # Setting feature names as properties for Windows patch mechanism
+ if ( $installer::globals::patch ) { set_featurename_properties_for_patch($propertyfile); }
+
+ # Setting variables for register for ms file types
+ set_ms_file_types_properties($propertyfile);
+
+ # Saving the file
+
+ installer::files::save_file($properyfilename ,$propertyfile);
+ my $infoline = "Updated idt file: $properyfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+####################################################################################
+# Setting language specific Properties in file Property.idt dynamically
+# Adding:
+# is1033 = 1
+# isMulti = 1
+####################################################################################
+
+sub set_languages_in_property_table
+{
+ my ($basedir, $languagesarrayref) = @_;
+
+ my $properyfilename = $basedir . $installer::globals::separator . "Property.idt";
+ my $propertyfile = installer::files::read_file($properyfilename);
+
+ # Setting the component properties saved in %installer::globals::languageproperties
+ foreach my $localproperty ( keys %installer::globals::languageproperties )
+ {
+ $onepropertyline = $localproperty . "\t" . $installer::globals::languageproperties{$localproperty} . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ # Setting the info about multilingual installation in property "isMulti"
+
+ my $propertyname = "isMulti";
+ my $ismultivalue = 0;
+
+ if ( $installer::globals::ismultilingual ) { $ismultivalue = 1; }
+
+ my $onepropertyline = $propertyname . "\t" . $ismultivalue . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+
+ # setting the ARPPRODUCTICON
+
+ if ($installer::globals::sofficeiconadded) # set in shortcut.pm
+ {
+ $onepropertyline = "ARPPRODUCTICON" . "\t" . "soffice.ico" . "\n";
+ push(@{$propertyfile}, $onepropertyline);
+ }
+
+ # Saving the file
+
+ installer::files::save_file($properyfilename ,$propertyfile);
+ my $infoline = "Added language content into idt file: $properyfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+############################################################
+# Setting the ProductCode and the UpgradeCode
+# into the Property table. Both have to be stored
+# in the global file $installer::globals::codefilename
+############################################################
+
+sub set_codes_in_property_table
+{
+ my ($basedir) = @_;
+
+ # Reading the property file
+
+ my $properyfilename = $basedir . $installer::globals::separator . "Property.idt";
+ my $propertyfile = installer::files::read_file($properyfilename);
+
+ # Updating the values
+
+ for ( my $i = 0; $i <= $#{$propertyfile}; $i++ )
+ {
+ ${$propertyfile}[$i] =~ s/\bPRODUCTCODETEMPLATE\b/$installer::globals::productcode/;
+ ${$propertyfile}[$i] =~ s/\bUPGRADECODETEMPLATE\b/$installer::globals::upgradecode/;
+ }
+
+ # Saving the property file
+
+ installer::files::save_file($properyfilename ,$propertyfile);
+ my $infoline = "Added language content into idt file: $properyfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+############################################################
+# Setting the variable REGKEYPRODPATH, that is used
+# by the language packs.
+############################################################
+
+sub set_regkeyprodpath_in_property_table
+{
+ my ($basedir, , $allvariables) = @_;
+
+ # Reading the property file
+
+ my $properyfilename = $basedir . $installer::globals::separator . "Property.idt";
+ my $propertyfile = installer::files::read_file($properyfilename);
+
+ my $name = $allvariables->{'PRODUCTNAME'};
+ my $version = $allvariables->{'PRODUCTVERSION'};
+
+ my $onepropertyline = "REGKEYPRODPATH" . "\t" . "Software" . "\\" . $installer::globals::manufacturer . "\\". $name;
+
+ push(@{$propertyfile}, $onepropertyline);
+
+ # Saving the property file
+
+ installer::files::save_file($properyfilename ,$propertyfile);
+ my $infoline = "Added language content into idt file: $properyfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+############################################################
+# Changing default for MS file type registration
+# in Beta products.
+############################################################
+
+sub update_checkbox_table
+{
+ my ($basedir, $allvariables) = @_;
+
+ if (( $allvariables->{'PRODUCTEXTENSION'} ) && ( $allvariables->{'PRODUCTEXTENSION'} eq "Beta" ))
+ {
+ my $checkboxfilename = $basedir . $installer::globals::separator . "CheckBox.idt";
+
+ if ( -f $checkboxfilename )
+ {
+ my $checkboxfile = installer::files::read_file($checkboxfilename);
+
+ my $checkboxline = "SELECT_WORD" . "\t" . "0" . "\n";
+ push(@{$checkboxfile}, $checkboxline);
+ $checkboxline = "SELECT_EXCEL" . "\t" . "0" . "\n";
+ push(@{$checkboxfile}, $checkboxline);
+ $checkboxline = "SELECT_POWERPOINT" . "\t" . "0" . "\n";
+ push(@{$checkboxfile}, $checkboxline);
+
+ # Saving the property file
+ installer::files::save_file($checkboxfilename ,$checkboxfile);
+ my $infoline = "Added ms file type defaults into idt file: $checkboxfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/registry.pm b/solenv/bin/modules/installer/windows/registry.pm
new file mode 100644
index 000000000000..cf87ba174dd0
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/registry.pm
@@ -0,0 +1,397 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::registry;
+
+use installer::files;
+use installer::globals;
+use installer::worker;
+use installer::windows::idtglobal;
+
+#####################################################
+# Generating the component name from a registryitem
+#####################################################
+
+sub get_registry_component_name
+{
+ my ($registryref, $allvariables) = @_;
+
+ # In this function exists the rule to create components from registryitems
+ # Rule:
+ # The componentname can be directly taken from the ModuleID.
+ # All registryitems belonging to one module can get the same component.
+
+ my $componentname = "";
+ my $isrootmodule = 0;
+
+ if ( $registryref->{'ModuleID'} ) { $componentname = $registryref->{'ModuleID'}; }
+
+ $componentname =~ s/\\/\_/g;
+ $componentname =~ s/\//\_/g;
+ $componentname =~ s/\-/\_/g;
+ $componentname =~ s/\_\s*$//g;
+
+ $componentname = lc($componentname); # componentnames always lowercase
+
+ if ( $componentname eq "gid_module_root" ) { $isrootmodule = 1; }
+
+ # Attention: Maximum length for the componentname is 72
+
+ $componentname =~ s/gid_module_/g_m_/g;
+ $componentname =~ s/_optional_/_o_/g;
+ $componentname =~ s/_javafilter_/_jf_/g;
+
+ $componentname = $componentname . "_registry"; # identifying this component as registryitem component
+
+ # This componentname must be more specific
+ my $addon = "_";
+ if ( $allvariables->{'PRODUCTNAME'} ) { $addon = $addon . $allvariables->{'PRODUCTNAME'}; }
+ if ( $allvariables->{'PRODUCTVERSION'} ) { $addon = $addon . $allvariables->{'PRODUCTVERSION'}; }
+ $addon = lc($addon);
+ $addon =~ s/ //g;
+ $addon =~ s/-//g;
+ $addon =~ s/\.//g;
+
+ my $styles = "";
+ if ( $registryref->{'Styles'} ) { $styles = $registryref->{'Styles'}; }
+
+ # Layer links must have unique Component GUID for all products. This is necessary, because only the
+ # uninstallation of the last product has to delete registry keys.
+ if ( $styles =~ /\bLAYER_REGISTRY\b/ )
+ {
+ $componentname = "g_m_root_registry_layer_ooo_reglayer";
+ # Styles USE_URELAYERVERSION, USE_OOOBASEVERSION
+ if ( $styles =~ /\bUSE_URELAYERVERSION\b/ ) { $addon = "_ure_" . $allvariables->{'URELAYERVERSION'}; }
+ if ( $styles =~ /\bUSE_OOOBASEVERSION\b/ ) { $addon = "_basis_" . $allvariables->{'OOOBASEVERSION'}; }
+ $addon =~ s/\.//g;
+ }
+
+ $componentname = $componentname . $addon;
+
+ if (( $styles =~ /\bLANGUAGEPACK\b/ ) && ( $installer::globals::languagepack )) { $componentname = $componentname . "_lang"; }
+ if ( $styles =~ /\bALWAYS_REQUIRED\b/ ) { $componentname = $componentname . "_forced"; }
+
+ if ( $isrootmodule ) { $installer::globals::registryrootcomponent = $componentname; }
+
+ return $componentname;
+}
+
+##############################################################
+# Returning identifier for registry table.
+##############################################################
+
+sub get_registry_identifier
+{
+ my ($registry) = @_;
+
+ my $identifier = "";
+
+ if ( $registry->{'gid'} ) { $identifier = $registry->{'gid'}; }
+
+ $identifier = lc($identifier); # always lower case
+
+ # Attention: Maximum length is 72
+
+ $identifier =~ s/gid_regitem_/g_r_/;
+ $identifier =~ s/_soffice_/_s_/;
+ $identifier =~ s/_clsid_/_c_/;
+ $identifier =~ s/_currentversion_/_cv_/;
+ $identifier =~ s/_microsoft_/_ms_/;
+ $identifier =~ s/_staroffice_/_so_/;
+ $identifier =~ s/_classpath_/_cp_/;
+ $identifier =~ s/__/_/g;
+
+ # Saving this in the registry collector
+
+ $registry->{'uniquename'} = $identifier;
+
+ return $identifier;
+}
+
+##################################################################
+# Returning root value for registry table.
+##################################################################
+
+sub get_registry_root
+{
+ my ($registry) = @_;
+
+ my $rootvalue = 0; # Default: Parent is KKEY_CLASSES_ROOT
+ my $scproot = "";
+
+ if ( $registry->{'ParentID'} ) { $scproot = $registry->{'ParentID'}; }
+
+ if ( $scproot eq "PREDEFINED_HKEY_LOCAL_MACHINE" ) { $rootvalue = -1; }
+
+ if ( $scproot eq "PREDEFINED_HKEY_CLASSES_ROOT" ) { $rootvalue = 0; }
+
+ if ( $scproot eq "PREDEFINED_HKEY_CURRENT_USER_ONLY" ) { $rootvalue = 1; }
+
+ if ( $scproot eq "PREDEFINED_HKEY_LOCAL_MACHINE_ONLY" ) { $rootvalue = 2; }
+
+ return $rootvalue;
+}
+
+##############################################################
+# Returning key for registry table.
+##############################################################
+
+sub get_registry_key
+{
+ my ($registry, $allvariableshashref) = @_;
+
+ my $key = "";
+
+ if ( $registry->{'Subkey'} ) { $key = $registry->{'Subkey'}; }
+
+ if ( $key =~ /\%/ ) { $key = installer::worker::replace_variables_in_string($key, $allvariableshashref); }
+
+ return $key;
+}
+
+##############################################################
+# Returning name for registry table.
+##############################################################
+
+sub get_registry_name
+{
+ my ($registry, $allvariableshashref) = @_;
+
+ my $name = "";
+
+ if ( $registry->{'Name'} ) { $name = $registry->{'Name'}; }
+
+ if ( $name =~ /\%/ ) { $name = installer::worker::replace_variables_in_string($name, $allvariableshashref); }
+
+ return $name;
+}
+
+##############################################################
+# Returning value for registry table.
+##############################################################
+
+sub get_registry_value
+{
+ my ($registry, $allvariableshashref) = @_;
+
+ my $value = "";
+
+ if ( $registry->{'Value'} ) { $value = $registry->{'Value'}; }
+
+ $value =~ s/\\\"/\"/g; # no more masquerading of '"'
+ $value =~ s/\\\\\s*$/\\/g; # making "\\" at end of value to "\"
+ $value =~ s/\<progpath\>/\[INSTALLLOCATION\]/;
+ $value =~ s/\[INSTALLLOCATION\]\\/\[INSTALLLOCATION\]/; # removing "\" after "[INSTALLLOCATION]"
+
+ if ( $value =~ /\%/ ) { $value = installer::worker::replace_variables_in_string($value, $allvariableshashref); }
+
+ return $value;
+}
+
+##############################################################
+# Returning 64 bit value for registry table.
+##############################################################
+
+sub get_registry_val64
+{
+ my ($registry, $allvariableshashref) = @_;
+
+ my $value = "";
+
+ if ( $registry->{'Val64'} ) { $value = $registry->{'Val64'}; }
+
+ $value =~ s/\\\"/\"/g; # no more masquerading of '"'
+ $value =~ s/\\\\\s*$/\\/g; # making "\\" at end of value to "\"
+ $value =~ s/\<progpath\>/\[INSTALLLOCATION\]/;
+ $value =~ s/\[INSTALLLOCATION\]\\/\[INSTALLLOCATION\]/; # removing "\" after "[INSTALLLOCATION]"
+
+ if ( $value =~ /\%/ ) { $value = installer::worker::replace_variables_in_string($value, $allvariableshashref); }
+
+ return $value;
+}
+
+##############################################################
+# Returning component for registry table.
+##############################################################
+
+sub get_registry_component
+{
+ my ($registry, $allvariables) = @_;
+
+ # All registry items belonging to one module can
+ # be included into one component
+
+ my $componentname = get_registry_component_name($registry, $allvariables);
+
+ # saving componentname in the registryitem collector
+
+ $registry->{'componentname'} = $componentname;
+
+ return $componentname;
+}
+
+######################################################
+# Adding the content of
+# @installer::globals::userregistrycollector
+# to the registry table. The content was collected
+# in create_files_table() in file.pm.
+######################################################
+
+sub add_userregs_to_registry_table
+{
+ my ( $registrytable, $allvariables ) = @_;
+
+ for ( my $i = 0; $i <= $#installer::globals::userregistrycollector; $i++ )
+ {
+ my $onefile = $installer::globals::userregistrycollector[$i];
+
+ my $styles = "";
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+
+ my %registry = ();
+
+ $registry{'Registry'} = $onefile->{'userregkeypath'};
+ $registry{'Root'} = "1"; # always HKCU
+ $registry{'Key'} = "Software\\$allvariables->{'MANUFACTURER'}\\$allvariables->{'PRODUCTNAME'} $allvariables->{'PRODUCTVERSION'}\\";
+ if ( $onefile->{'needs_user_registry_key'} ) { $registry{'Key'} = $registry{'Key'} . "StartMenu"; }
+ else { $registry{'Key'} = $registry{'Key'} . "ShellNew"; }
+ $registry{'Name'} = $onefile->{'Name'};
+ $registry{'Value'} = "1";
+ $registry{'Component_'} = $onefile->{'componentname'};
+
+ my $oneline = $registry{'Registry'} . "\t" . $registry{'Root'} . "\t" . $registry{'Key'} . "\t"
+ . $registry{'Name'} . "\t" . $registry{'Value'} . "\t" . $registry{'Component_'} . "\n";
+
+ push(@{$registrytable}, $oneline);
+ }
+}
+
+######################################################
+# Creating the file Registry.idt dynamically
+# Content:
+# Registry Root Key Name Value Component_
+######################################################
+
+sub create_registry_table
+{
+ my ($registryref, $allregistrycomponentsref, $basedir, $languagesarrayref, $allvariableshashref) = @_;
+
+ for ( my $m = 0; $m <= $#{$languagesarrayref}; $m++ )
+ {
+ my $onelanguage = ${$languagesarrayref}[$m];
+
+ my @registrytable = ();
+ my @reg64table = ();
+
+ installer::windows::idtglobal::write_idt_header(\@registrytable, "registry");
+ installer::windows::idtglobal::write_idt_header(\@reg64table, "reg64");
+
+ for ( my $i = 0; $i <= $#{$registryref}; $i++ )
+ {
+ my $oneregistry = ${$registryref}[$i];
+
+ # Controlling the language!
+ # Only language independent folderitems or folderitems with the correct language
+ # will be included into the table
+
+ if (! (!(( $oneregistry->{'ismultilingual'} )) || ( $oneregistry->{'specificlanguage'} eq $onelanguage )) ) { next; }
+
+ my %registry = ();
+
+ $registry{'Registry'} = get_registry_identifier($oneregistry);
+ $registry{'Root'} = get_registry_root($oneregistry);
+ $registry{'Key'} = get_registry_key($oneregistry, $allvariableshashref);
+ $registry{'Name'} = get_registry_name($oneregistry, $allvariableshashref);
+ $registry{'Value'} = get_registry_value($oneregistry, $allvariableshashref);
+ $registry{'Val64'} = get_registry_val64($oneregistry, $allvariableshashref);
+ $registry{'Component_'} = get_registry_component($oneregistry, $allvariableshashref);
+
+ # Collecting all components
+ if (!(installer::existence::exists_in_array($registry{'Component_'}, $allregistrycomponentsref)))
+ {
+ push(@{$allregistrycomponentsref}, $registry{'Component_'});
+ }
+
+ # Collecting all components with DONT_DELETE style
+ my $style = "";
+ if ( $oneregistry->{'Styles'} ) { $style = $oneregistry->{'Styles'}; }
+ if ( $style =~ /\bDONT_DELETE\b/ ) { $installer::globals::dontdeletecomponents{$registry{'Component_'}} = 1; }
+
+ # Saving upgradekey to write this into setup.ini for minor upgrades
+ if ( $style =~ /\bUPGRADEKEY\b/ ) { $installer::globals::minorupgradekey = $registry{'Key'}; }
+
+ # Collecting all registry components with ALWAYS_REQUIRED style
+ if ( ! ( $style =~ /\bALWAYS_REQUIRED\b/ ))
+ {
+ # Setting a component condition for unforced registry components!
+ # Only write into registry, if WRITE_REGISTRY is set.
+ if ( $oneregistry->{'ComponentCondition'} ) { $oneregistry->{'ComponentCondition'} = "(" . $oneregistry->{'ComponentCondition'} . ") AND (WRITE_REGISTRY=1)"; }
+ else { $oneregistry->{'ComponentCondition'} = "WRITE_REGISTRY=1"; }
+ }
+
+ # Collecting all component conditions
+ if ( $oneregistry->{'ComponentCondition'} )
+ {
+ if ( ! exists($installer::globals::componentcondition{$registry{'Component_'}}))
+ {
+ $installer::globals::componentcondition{$registry{'Component_'}} = $oneregistry->{'ComponentCondition'};
+ }
+ }
+
+ my $oneline = $registry{'Registry'} . "\t" . $registry{'Root'} . "\t" . $registry{'Key'} . "\t"
+ . $registry{'Name'} . "\t" . $registry{'Value'} . "\t" . $registry{'Component_'} . "\n";
+
+ my $oneline64 = $registry{'Registry'} . "\t" . $registry{'Root'} . "\t" . $registry{'Key'} . "\t"
+ . $registry{'Name'} . "\t" . $registry{'Val64'} . "\t" . $registry{'Component_'} . "\n";
+
+ if ( ! ( $style =~ /\bX64_ONLY\b/ )) { push(@registrytable, $oneline); } # standard registry table for 32 Bit
+ if (( $style =~ /\bX64\b/ ) || ( $style =~ /\bX64_ONLY\b/ )) { push(@reg64table , $oneline64); }
+ }
+
+ # If there are added user registry keys for files collected in
+ # @installer::globals::userregistrycollector (file.pm), then
+ # this registry keys have to be added now. This is necessary for
+ # files in PREDEFINED_OSSHELLNEWDIR, because their component
+ # needs as KeyPath a RegistryItem in HKCU.
+
+ if ( $installer::globals::addeduserregitrykeys ) { add_userregs_to_registry_table(\@registrytable, $allvariableshashref); }
+
+ # Saving the file
+
+ my $registrytablename = $basedir . $installer::globals::separator . "Registry.idt" . "." . $onelanguage;
+ installer::files::save_file($registrytablename ,\@registrytable);
+ my $infoline = "Created idt file: $registrytablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+ $registrytablename = $basedir . $installer::globals::separator . "Reg64.idt" . "." . $onelanguage;
+ installer::files::save_file($registrytablename ,\@reg64table );
+ $infoline = "Created idt file: $registrytablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/removefile.pm b/solenv/bin/modules/installer/windows/removefile.pm
new file mode 100644
index 000000000000..ec2a6142db71
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/removefile.pm
@@ -0,0 +1,152 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::removefile;
+
+use installer::files;
+use installer::globals;
+use installer::windows::idtglobal;
+
+########################################################################
+# Returning the FileKey for a folderitem for removefile table.
+########################################################################
+
+sub get_removefile_filekey
+{
+ my ($folderitem) = @_;
+
+ # returning the unique identifier
+
+ my $identifier = "remove_" . $folderitem->{'directory'};
+
+ $identifier = lc($identifier);
+
+ return $identifier;
+}
+
+########################################################################
+# Returning the Component for a folderitem for removefile table.
+########################################################################
+
+sub get_removefile_component
+{
+ my ($folderitem) = @_;
+
+ return $folderitem->{'component'};
+}
+
+########################################################################
+# Returning the FileName for a folderitem for removefile table.
+########################################################################
+
+sub get_removefile_filename
+{
+ my ($folderitem) = @_;
+
+ # return nothing: The assigned directory will be removed
+
+ return "";
+}
+
+########################################################################
+# Returning the DirProperty for a folderitem for removefile table.
+########################################################################
+
+sub get_removefile_dirproperty
+{
+ my ($folderitem) = @_;
+
+ return $folderitem->{'directory'};
+}
+
+########################################################################
+# Returning the InstallMode for a folderitem for removefile table.
+########################################################################
+
+sub get_removefile_installmode
+{
+ my ($folderitem) = @_;
+
+ # always returning "2": The file is only removed, if the assigned
+ # component is removed. Name: msidbRemoveFileInstallModeOnRemove
+
+ return 2;
+}
+
+###########################################################################################################
+# Creating the file RemoveFi.idt dynamically
+# Content:
+# FileKey Component_ FileName DirProperty InstallMode
+###########################################################################################################
+
+sub create_removefile_table
+{
+ my ($folderitemsref, $basedir) = @_;
+
+ my @removefiletable = ();
+
+ installer::windows::idtglobal::write_idt_header(\@removefiletable, "removefile");
+
+ # Only the directories created for the FolderItems have to be deleted
+ # with the information in the table RemoveFile
+
+ my @directorycollector = ();
+
+ for ( my $i = 0; $i <= $#{$folderitemsref}; $i++ )
+ {
+ my $onelink = ${$folderitemsref}[$i];
+
+ if ( $onelink->{'used'} == 0 ) { next; }
+
+ if ( installer::existence::exists_in_array($onelink->{'directory'}, \@directorycollector)) { next; }
+
+ push(@directorycollector, $onelink->{'directory'});
+
+ my %removefile = ();
+
+ $removefile{'FileKey'} = get_removefile_filekey($onelink);
+ $removefile{'Component_'} = get_removefile_component($onelink);
+ $removefile{'FileName'} = get_removefile_filename($onelink);
+ $removefile{'DirProperty'} = get_removefile_dirproperty($onelink);
+ $removefile{'InstallMode'} = get_removefile_installmode($onelink);
+
+ my $oneline = $removefile{'FileKey'} . "\t" . $removefile{'Component_'} . "\t" . $removefile{'FileName'} . "\t"
+ . $removefile{'DirProperty'} . "\t" . $removefile{'InstallMode'} . "\n";
+
+ push(@removefiletable, $oneline);
+ }
+
+ # Saving the file
+
+ my $removefiletablename = $basedir . $installer::globals::separator . "RemoveFi.idt";
+ installer::files::save_file($removefiletablename ,\@removefiletable);
+ my $infoline = "Created idt file: $removefiletablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+
+}
+
+1; \ No newline at end of file
diff --git a/solenv/bin/modules/installer/windows/selfreg.pm b/solenv/bin/modules/installer/windows/selfreg.pm
new file mode 100644
index 000000000000..70dffc3ea1af
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/selfreg.pm
@@ -0,0 +1,88 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::selfreg;
+
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::worker;
+use installer::windows::idtglobal;
+
+##############################################################
+# Returning the cost for the selfreg table.
+##############################################################
+
+sub get_selfreg_cost
+{
+ my ( $onefile ) = @_;
+
+ return "0";
+}
+
+####################################################################################
+# Creating the file SelfReg.idt dynamically
+# Content:
+# File_ Cost
+# UpgradeCode VersionMin VersionMax Language Attributes Remove ActionProperty
+####################################################################################
+
+sub create_selfreg_table
+{
+ my ($filesref, $basedir) = @_;
+
+ my @selfregtable = ();
+
+ installer::windows::idtglobal::write_idt_header(\@selfregtable, "selfreg");
+
+ # Registering all libraries with flag "SELFREG"
+
+ my $selfregfiles = installer::worker::collect_all_items_with_special_flag($filesref, "SELFREG");
+
+ for ( my $i = 0; $i <= $#{$selfregfiles}; $i++ )
+ {
+ my $onefile = ${$selfregfiles}[$i];
+
+ my %selfreg = ();
+
+ $selfreg{'File_'} = $onefile->{'uniquename'};
+ $selfreg{'Cost'} = get_selfreg_cost($onefile);
+
+ my $oneline = $selfreg{'File_'} . "\t" . $selfreg{'Cost'} . "\n";
+
+ push(@selfregtable, $oneline);
+ }
+
+ # Saving the file
+
+ my $selfregtablename = $basedir . $installer::globals::separator . "SelfReg.idt";
+ installer::files::save_file($selfregtablename ,\@selfregtable);
+ my $infoline = "Created idt file: $selfregtablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+}
+
+1; \ No newline at end of file
diff --git a/solenv/bin/modules/installer/windows/shortcut.pm b/solenv/bin/modules/installer/windows/shortcut.pm
new file mode 100644
index 000000000000..76039baf10c9
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/shortcut.pm
@@ -0,0 +1,697 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::shortcut;
+
+use installer::existence;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::windows::idtglobal;
+
+##############################################################
+# Returning the file object for the msiassembly table.
+##############################################################
+
+sub get_file_by_name
+{
+ my ( $filesref, $filename ) = @_;
+
+ my $foundfile = 0;
+ my $onefile;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ $onefile = ${$filesref}[$i];
+ my $name = $onefile->{'Name'};
+
+ if ( $name eq $filename )
+ {
+ $foundfile = 1;
+ last;
+ }
+ }
+
+ if (! $foundfile ) { $onefile = ""; }
+
+ return $onefile;
+}
+
+##############################################################
+# Returning identifier for shortcut table.
+##############################################################
+
+sub get_shortcut_identifier
+{
+ my ($shortcut) = @_;
+
+ my $identifier = $shortcut->{'gid'};
+
+ return $identifier;
+}
+
+##############################################################
+# Returning directory for shortcut table.
+##############################################################
+
+sub get_shortcut_directory
+{
+ my ($shortcut, $dirref) = @_;
+
+ # For shortcuts it is easy to convert the gid_Dir_Abc into the unique name in
+ # the directory table, for instance help_en_simpressidx.
+ # For files (components) this is not so easy, because files can be included
+ # in zip files with subdirectories that are not defined in scp.
+
+ my $onedir;
+ my $shortcutdirectory = $shortcut->{'Dir'};
+ my $directory = "";
+ my $found = 0;
+
+ for ( my $i = 0; $i <= $#{$dirref}; $i++ )
+ {
+ $onedir = ${$dirref}[$i];
+ my $directorygid = $onedir->{'Dir'};
+
+ if ( $directorygid eq $shortcutdirectory )
+ {
+ $found = 1;
+ last;
+ }
+ }
+
+ if (!($found))
+ {
+ installer::exiter::exit_program("ERROR: Did not find DirectoryID $shortcutdirectory in directory collection for shortcut", "get_shortcut_directory");
+ }
+
+ $directory = $onedir->{'uniquename'};
+
+ if ($directory eq "") { $directory = "INSTALLLOCATION"; } # Shortcuts in the root directory
+
+ return $directory;
+}
+
+##############################################################
+# Returning name for shortcut table.
+##############################################################
+
+sub get_shortcut_name
+{
+ my ($shortcut, $shortnamesref, $onelanguage) = @_;
+
+ my $returnstring;
+
+ my $name = $shortcut->{'Name'};
+
+ my $shortstring = installer::windows::idtglobal::make_eight_three_conform($name, "shortcut", $shortnamesref);
+ $shortstring =~ s/\s/\_/g; # replacing white spaces with underline
+
+ if ( $shortstring eq $name ) { $returnstring = $name; } # nothing changed
+ else {$returnstring = $shortstring . "\|" . $name; }
+
+ return $returnstring;
+}
+
+##############################################################
+# Returning component for shortcut table.
+##############################################################
+
+sub get_shortcut_component
+{
+ my ($shortcut, $filesref) = @_;
+
+ my $onefile;
+ my $component = "";
+ my $found = 0;
+ my $shortcut_fileid = $shortcut->{'FileID'};
+
+ my $absolute_filename = 0;
+ if ( $shortcut->{'Styles'} ) { $styles = $shortcut->{'Styles'}; }
+ if ( $styles =~ /\bABSOLUTE_FILENAME\b/ ) { $absolute_filename = 1; } # FileID contains an absolute filename
+ if ( $styles =~ /\bUSE_HELPER_FILENAME\b/ ) { $absolute_filename = 1; } # ComponentIDFile contains id of a helper file
+
+ # if the FileID contains an absolute filename, therefore the entry for "ComponentIDFile" has to be used.
+ if ( $absolute_filename ) { $shortcut_fileid = $shortcut->{'ComponentIDFile'}; }
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ $onefile = ${$filesref}[$i];
+ my $filegid = $onefile->{'gid'};
+
+ if ( $filegid eq $shortcut_fileid )
+ {
+ $found = 1;
+ last;
+ }
+ }
+
+ if (!($found))
+ {
+ installer::exiter::exit_program("ERROR: Did not find FileID $shortcut_fileid in file collection for shortcut", "get_shortcut_component");
+ }
+
+ $component = $onefile->{'componentname'};
+
+ # finally saving the componentname in the folderitem collector
+
+ $shortcut->{'component'} = $component;
+
+ return $component;
+}
+
+##############################################################
+# Returning target for shortcut table.
+##############################################################
+
+sub get_shortcut_target
+{
+ my ($shortcut, $filesref) = @_;
+
+ my $target = "";
+ my $found = 0;
+ my $shortcut_fileid = $shortcut->{'FileID'};
+ my $onefile;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ $onefile = ${$filesref}[$i];
+ my $filegid = $onefile->{'gid'};
+
+ if ( $filegid eq $shortcut_fileid )
+ {
+ $found = 1;
+ last;
+ }
+ }
+
+ if (!($found))
+ {
+ installer::exiter::exit_program("ERROR: Did not find FileID $shortcut_fileid in file collection for shortcut", "get_shortcut_target");
+ }
+
+ if ( $onefile->{'Name'} )
+ {
+ $target = $onefile->{'Name'};
+ }
+
+ $target = "\[\#" . $target . "\]"; # format for Non-Advertised shortcuts
+
+ return $target;
+}
+
+##############################################################
+# Returning arguments for shortcut table.
+##############################################################
+
+sub get_shortcut_arguments
+{
+ my ($shortcut) = @_;
+
+ return "";
+}
+
+##############################################################
+# Returning the localized description for shortcut table.
+##############################################################
+
+sub get_shortcut_description
+{
+ my ($shortcut, $onelanguage) = @_;
+
+ my $description = "";
+ if ( $shortcut->{'Tooltip'} ) { $description = $shortcut->{'Tooltip'}; }
+
+ return $description;
+}
+
+##############################################################
+# Returning hotkey for shortcut table.
+##############################################################
+
+sub get_shortcut_hotkey
+{
+ my ($shortcut) = @_;
+
+ return "";
+}
+
+##############################################################
+# Returning icon for shortcut table.
+##############################################################
+
+sub get_shortcut_icon
+{
+ my ($shortcut) = @_;
+
+ return "";
+}
+
+##############################################################
+# Returning iconindex for shortcut table.
+##############################################################
+
+sub get_shortcut_iconindex
+{
+ my ($shortcut) = @_;
+
+ return "";
+}
+
+##############################################################
+# Returning show command for shortcut table.
+##############################################################
+
+sub get_shortcut_showcmd
+{
+ my ($shortcut) = @_;
+
+ return "";
+}
+
+##############################################################
+# Returning working directory for shortcut table.
+##############################################################
+
+sub get_shortcut_wkdir
+{
+ my ($shortcut) = @_;
+
+ return "";
+}
+
+####################################################################
+# Returning working directory for shortcut table for FolderItems.
+####################################################################
+
+sub get_folderitem_wkdir
+{
+ my ($onelink, $dirref) = @_;
+
+ # For shortcuts it is easy to convert the gid_Dir_Abc into the unique name in
+ # the directory table, for instance help_en_simpressidx.
+
+ my $onedir;
+ my $workingdirectory = "";
+ if ( $onelink->{'WkDir'} ) { $workingdirectory = $onelink->{'WkDir'}; }
+ my $directory = "";
+
+ if ( $workingdirectory )
+ {
+ my $found = 0;
+
+ for ( my $i = 0; $i <= $#{$dirref}; $i++ )
+ {
+ $onedir = ${$dirref}[$i];
+ my $directorygid = $onedir->{'Dir'};
+
+ if ( $directorygid eq $workingdirectory )
+ {
+ $found = 1;
+ last;
+ }
+ }
+
+ if (!($found))
+ {
+ installer::exiter::exit_program("ERROR: Did not find DirectoryID $workingdirectory in directory collection for FolderItem", "get_folderitem_wkdir");
+ }
+
+ $directory = $onedir->{'uniquename'};
+
+ if ($directory eq "") { $directory = "INSTALLLOCATION"; }
+ }
+
+ return $directory;
+}
+
+###################################################################
+# Returning the directory for a folderitem for shortcut table.
+###################################################################
+
+sub get_folderitem_directory
+{
+ my ($shortcut) = @_;
+
+ # my $directory = "$installer::globals::programmenufolder"; # default
+ my $directory = "$installer::globals::officemenufolder"; # default
+
+ # The value $installer::globals::programmenufolder is not correct for the
+ # PREDEFINED folders, like PREDEFINED_AUTOSTART
+
+ if ( $shortcut->{'FolderID'} eq "PREDEFINED_AUTOSTART" )
+ {
+ $directory = $installer::globals::startupfolder;
+ }
+
+ if ( $shortcut->{'FolderID'} eq "PREDEFINED_DESKTOP" )
+ {
+ $directory = $installer::globals::desktopfolder;
+ $installer::globals::desktoplinkexists = 1;
+ }
+
+ if ( $shortcut->{'FolderID'} eq "PREDEFINED_STARTMENU" )
+ {
+ $directory = $installer::globals::startmenufolder;
+ }
+
+ # saving the directory in the folderitems collector
+
+ $shortcut->{'directory'} = $directory;
+
+ return $directory;
+}
+
+########################################################################
+# Returning the target (feature) for a folderitem for shortcut table.
+# For non-advertised shortcuts this is a formatted string.
+########################################################################
+
+sub get_folderitem_target
+{
+ my ($shortcut, $filesref) = @_;
+
+ my $onefile;
+ my $target = "";
+ my $found = 0;
+ my $shortcut_fileid = $shortcut->{'FileID'};
+
+ my $styles = "";
+ my $nonadvertised = 0;
+ my $absolute_filename = 0;
+ if ( $shortcut->{'Styles'} ) { $styles = $shortcut->{'Styles'}; }
+ if ( $styles =~ /\bNON_ADVERTISED\b/ ) { $nonadvertised = 1; } # this is a non-advertised shortcut
+ if ( $styles =~ /\bABSOLUTE_FILENAME\b/ ) { $absolute_filename = 1; } # FileID contains an absolute filename
+
+ # if the FileID contains an absolute filename this can simply be returned as target for the shortcut table.
+ if ( $absolute_filename )
+ {
+ $shortcut->{'target'} = $shortcut_fileid;
+ return $shortcut_fileid;
+ }
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ $onefile = ${$filesref}[$i];
+ my $filegid = $onefile->{'gid'};
+
+ if ( $filegid eq $shortcut_fileid )
+ {
+ $found = 1;
+ last;
+ }
+ }
+
+ if (!($found))
+ {
+ installer::exiter::exit_program("ERROR: Did not find FileID $shortcut_fileid in file collection for folderitem", "get_folderitem_target");
+ }
+
+ # Non advertised shortcuts do not return the feature, but the path to the file
+ if ( $nonadvertised )
+ {
+ $target = "\[" . $onefile->{'uniquedirname'} . "\]" . "\\" . $onefile->{'Name'};
+ $shortcut->{'target'} = $target;
+ return $target;
+ }
+
+ # the rest only for advertised shortcuts, which contain the feature in the shortcut table.
+
+ if ( $onefile->{'modules'} ) { $target = $onefile->{'modules'}; }
+
+ # If modules contains a list of modules, only taking the first one.
+ # But this should never be needed
+
+ if ( $target =~ /^\s*(.*?)\,/ ) { $target = $1; }
+
+ # Attention: Maximum feature length is 38!
+ installer::windows::idtglobal::shorten_feature_gid(\$target);
+
+ # and finally saving the target in the folderitems collector
+
+ $shortcut->{'target'} = $target;
+
+ return $target;
+}
+
+########################################################################
+# Returning the arguments for a folderitem for shortcut table.
+########################################################################
+
+sub get_folderitem_arguments
+{
+ my ($shortcut) = @_;
+
+ my $parameter = "";
+
+ if ( $shortcut->{'Parameter'} ) { $parameter = $shortcut->{'Parameter'}; }
+
+ return $parameter;
+}
+
+########################################################################
+# Returning the icon for a folderitem for shortcut table.
+# The returned value has to be defined in the icon table.
+########################################################################
+
+sub get_folderitem_icon
+{
+ my ($shortcut, $filesref, $iconfilecollector) = @_;
+
+ my $styles = "";
+ if ( $shortcut->{'Styles'} ) { $styles = $shortcut->{'Styles'}; }
+ if ( $styles =~ /\bNON_ADVERTISED\b/ ) { return ""; } # no icon for non-advertised shortcuts
+
+ my $iconfilegid = "";
+
+ if ( $shortcut->{'IconFile'} ) { $iconfilegid = $shortcut->{'IconFile'}; }
+ else { $iconfilegid = $shortcut->{'FileID'}; }
+
+ my $onefile;
+ my $found = 0;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ $onefile = ${$filesref}[$i];
+ my $filegid = $onefile->{'gid'};
+
+ if ( $filegid eq $iconfilegid )
+ {
+ $found = 1;
+ last;
+ }
+ }
+
+ if (!($found))
+ {
+ installer::exiter::exit_program("ERROR: Did not find FileID $iconfilegid in file collection", "get_folderitem_icon");
+ }
+
+ $iconfile = $onefile->{'Name'};
+
+ # collecting all icon files to copy them into the icon directory
+
+ my $sourcepath = $onefile->{'sourcepath'};
+
+ if (! installer::existence::exists_in_array($sourcepath, $iconfilecollector))
+ {
+ push(@{$iconfilecollector}, $sourcepath);
+ }
+
+ return $iconfile;
+}
+
+########################################################################
+# Returning the iconindex for a folderitem for shortcut table.
+########################################################################
+
+sub get_folderitem_iconindex
+{
+ my ($shortcut) = @_;
+
+ my $styles = "";
+ if ( $shortcut->{'Styles'} ) { $styles = $shortcut->{'Styles'}; }
+ if ( $styles =~ /\bNON_ADVERTISED\b/ ) { return ""; } # no iconindex for non-advertised shortcuts
+
+ my $iconid = 0;
+
+ if ( $shortcut->{'IconID'} ) { $iconid = $shortcut->{'IconID'}; }
+
+ return $iconid;
+}
+
+########################################################################
+# Returning the show command for a folderitem for shortcut table.
+########################################################################
+
+sub get_folderitem_showcmd
+{
+ my ($shortcut) = @_;
+
+ return "1";
+}
+
+###########################################################################################################
+# Creating the file Shortcut.idt dynamically
+# Content:
+# Shortcut Directory_ Name Component_ Target Arguments Description Hotkey Icon_ IconIndex ShowCmd WkDir
+###########################################################################################################
+
+sub create_shortcut_table
+{
+ my ($filesref, $linksref, $folderref, $folderitemsref, $dirref, $basedir, $languagesarrayref, $includepatharrayref, $iconfilecollector) = @_;
+
+ for ( my $m = 0; $m <= $#{$languagesarrayref}; $m++ )
+ {
+ my $onelanguage = ${$languagesarrayref}[$m];
+
+ my @shortcuttable = ();
+
+ my @shortnames = (); # to collect all short names
+
+ installer::windows::idtglobal::write_idt_header(\@shortcuttable, "shortcut");
+
+ # First the links, defined in scp as ShortCut
+
+ for ( my $i = 0; $i <= $#{$linksref}; $i++ )
+ {
+ my $onelink = ${$linksref}[$i];
+
+ # Controlling the language!
+ # Only language independent folderitems or folderitems with the correct language
+ # will be included into the table
+
+ if (! (!(( $onelink->{'ismultilingual'} )) || ( $onelink->{'specificlanguage'} eq $onelanguage )) ) { next; }
+
+ my %shortcut = ();
+
+ $shortcut{'Shortcut'} = get_shortcut_identifier($onelink);
+ $shortcut{'Directory_'} = get_shortcut_directory($onelink, $dirref);
+ $shortcut{'Name'} = get_shortcut_name($onelink, \@shortnames, $onelanguage); # localized name
+ $shortcut{'Component_'} = get_shortcut_component($onelink, $filesref);
+ $shortcut{'Target'} = get_shortcut_target($onelink, $filesref);
+ $shortcut{'Arguments'} = get_shortcut_arguments($onelink);
+ $shortcut{'Description'} = get_shortcut_description($onelink, $onelanguage); # localized description
+ $shortcut{'Hotkey'} = get_shortcut_hotkey($onelink);
+ $shortcut{'Icon_'} = get_shortcut_icon($onelink);
+ $shortcut{'IconIndex'} = get_shortcut_iconindex($onelink);
+ $shortcut{'ShowCmd'} = get_shortcut_showcmd($onelink);
+ $shortcut{'WkDir'} = get_shortcut_wkdir($onelink);
+
+ my $oneline = $shortcut{'Shortcut'} . "\t" . $shortcut{'Directory_'} . "\t" . $shortcut{'Name'} . "\t"
+ . $shortcut{'Component_'} . "\t" . $shortcut{'Target'} . "\t" . $shortcut{'Arguments'} . "\t"
+ . $shortcut{'Description'} . "\t" . $shortcut{'Hotkey'} . "\t" . $shortcut{'Icon_'} . "\t"
+ . $shortcut{'IconIndex'} . "\t" . $shortcut{'ShowCmd'} . "\t" . $shortcut{'WkDir'} . "\n";
+
+ push(@shortcuttable, $oneline);
+ }
+
+ # Second the entries into the start menu, defined in scp as Folder and Folderitem
+ # These shortcuts will fill the icons table.
+
+ for ( my $i = 0; $i <= $#{$folderref}; $i++ )
+ {
+ my $foldergid = ${$folderref}[$i]->{'gid'};
+
+ # iterating over all folderitems for this folder
+
+ for ( my $j = 0; $j <= $#{$folderitemsref}; $j++ )
+ {
+ my $onelink = ${$folderitemsref}[$j];
+
+ # Controlling the language!
+ # Only language independent folderitems or folderitems with the correct language
+ # will be included into the table
+
+ if (! (!(( $onelink->{'ismultilingual'} )) || ( $onelink->{'specificlanguage'} eq $onelanguage )) ) { next; }
+
+ # controlling the folder
+
+ my $localused = 0;
+
+ if ( $onelink->{'used'} ) { $localused = $onelink->{'used'}; }
+
+ if (!($localused == 1)) { $onelink->{'used'} = "0"; } # no resetting
+
+ if (!( $onelink->{'FolderID'} eq $foldergid )) { next; }
+
+ $onelink->{'used'} = "1";
+
+ my %shortcut = ();
+
+ $shortcut{'Shortcut'} = get_shortcut_identifier($onelink);
+ $shortcut{'Directory_'} = get_folderitem_directory($onelink);
+ $shortcut{'Name'} = get_shortcut_name($onelink, \@shortnames, $onelanguage); # localized name
+ $shortcut{'Component_'} = get_shortcut_component($onelink, $filesref);
+ $shortcut{'Target'} = get_folderitem_target($onelink, $filesref);
+ $shortcut{'Arguments'} = get_folderitem_arguments($onelink);
+ $shortcut{'Description'} = get_shortcut_description($onelink, $onelanguage); # localized description
+ $shortcut{'Hotkey'} = get_shortcut_hotkey($onelink);
+ $shortcut{'Icon_'} = get_folderitem_icon($onelink, $filesref, $iconfilecollector);
+ $shortcut{'IconIndex'} = get_folderitem_iconindex($onelink);
+ $shortcut{'ShowCmd'} = get_folderitem_showcmd($onelink);
+ $shortcut{'WkDir'} = get_folderitem_wkdir($onelink, $dirref);
+
+ my $oneline = $shortcut{'Shortcut'} . "\t" . $shortcut{'Directory_'} . "\t" . $shortcut{'Name'} . "\t"
+ . $shortcut{'Component_'} . "\t" . $shortcut{'Target'} . "\t" . $shortcut{'Arguments'} . "\t"
+ . $shortcut{'Description'} . "\t" . $shortcut{'Hotkey'} . "\t" . $shortcut{'Icon_'} . "\t"
+ . $shortcut{'IconIndex'} . "\t" . $shortcut{'ShowCmd'} . "\t" . $shortcut{'WkDir'} . "\n";
+
+ push(@shortcuttable, $oneline);
+ }
+ }
+
+ # The soffice.ico has to be included into the icon table
+ # as icon for the ARP applet
+
+ my $onefile = "";
+ my $sofficefile = "soffice.ico";
+
+ my $sourcepathref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$sofficefile, $includepatharrayref, 0);
+
+ if ($$sourcepathref eq "") { installer::exiter::exit_program("ERROR: Could not find $sofficefile as icon!", "create_shortcut_table"); }
+
+ if (! installer::existence::exists_in_array($$sourcepathref, $iconfilecollector))
+ {
+ unshift(@{$iconfilecollector}, $$sourcepathref);
+ $installer::globals::sofficeiconadded = 1;
+ }
+
+ my $localinfoline = "Added icon file $$sourcepathref for language pack into icon file collector.\n";
+ push(@installer::globals::logfileinfo, $localinfoline);
+
+ # Saving the file
+
+ my $shortcuttablename = $basedir . $installer::globals::separator . "Shortcut.idt" . "." . $onelanguage;
+ installer::files::save_file($shortcuttablename ,\@shortcuttable);
+ my $infoline = "Created idt file: $shortcuttablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+}
+
+
+1; \ No newline at end of file
diff --git a/solenv/bin/modules/installer/windows/sign.pm b/solenv/bin/modules/installer/windows/sign.pm
new file mode 100644
index 000000000000..70954bd9f5b1
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/sign.pm
@@ -0,0 +1,1249 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::sign;
+
+use Cwd;
+use installer::converter;
+use installer::existence;
+use installer::files;
+use installer::globals;
+use installer::scriptitems;
+use installer::worker;
+use installer::windows::admin;
+
+########################################################
+# Copying an existing Windows installation set.
+########################################################
+
+sub copy_install_set
+{
+ my ( $installsetpath ) = @_;
+
+ installer::logger::include_header_into_logfile("Start: Copying installation set $installsetpath");
+
+ my $infoline = "";
+
+ my $dirname = $installsetpath;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$dirname);
+
+ my $path = $installsetpath;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$path);
+
+ $path =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ if ( $dirname =~ /\./ ) { $dirname =~ s/\./_signed_inprogress./; }
+ else { $dirname = $dirname . "_signed_inprogress"; }
+
+ my $newpath = $path . $installer::globals::separator . $dirname;
+ my $removepath = $newpath;
+ $removepath =~ s/_inprogress/_witherror/;
+
+ if ( -d $newpath ) { installer::systemactions::remove_complete_directory($newpath, 1); }
+ if ( -d $removepath ) { installer::systemactions::remove_complete_directory($removepath, 1); }
+
+ $infoline = "Copy installation set from $installsetpath to $newpath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ $installsetpath = installer::systemactions::copy_complete_directory($installsetpath, $newpath);
+
+ installer::logger::include_header_into_logfile("End: Copying installation set $installsetpath");
+
+ return $newpath;
+}
+
+########################################################
+# Renaming an existing Windows installation set.
+########################################################
+
+sub rename_install_set
+{
+ my ( $installsetpath ) = @_;
+
+ my $infoline = "";
+
+ my $dirname = $installsetpath;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$dirname);
+
+ my $path = $installsetpath;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$path);
+
+ $path =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ if ( $dirname =~ /\./ ) { $dirname =~ s/\./_inprogress./; }
+ else { $dirname = $dirname . "_inprogress"; }
+
+ my $newpath = $path . $installer::globals::separator . $dirname;
+ my $removepath = $newpath;
+ $removepath =~ s/_inprogress/_witherror/;
+
+ if ( -d $newpath ) { installer::systemactions::remove_complete_directory($newpath, 1); }
+ if ( -d $removepath ) { installer::systemactions::remove_complete_directory($removepath, 1); }
+
+ $installsetpath = installer::systemactions::rename_directory($installsetpath, $newpath);
+
+ return $newpath;
+}
+
+#########################################################
+# Checking the local system
+# Checking existence of needed files in include path
+#########################################################
+
+sub check_system_path
+{
+ # The following files have to be found in the environment variable PATH
+ # Only, if \"-sign\" is used.
+ # Windows : "msicert.exe", "diff.exe", "msidb.exe", "signtool.exe"
+
+ my @needed_files_in_path = ("msicert.exe", "msidb.exe", "signtool.exe", "diff.exe");
+ if ( $installer::globals::internal_cabinet_signing )
+ {
+ push(@needed_files_in_path, "cabarc.exe");
+ push(@needed_files_in_path, "makecab.exe");
+ }
+
+ my $onefile;
+ my $error = 0;
+ my $pathvariable = $ENV{'PATH'};
+ my $local_pathseparator = $installer::globals::pathseparator;
+
+ if( $^O =~ /cygwin/i )
+ { # When using cygwin's perl the PATH variable is POSIX style and ...
+ $pathvariable = qx{cygpath -mp "$pathvariable"} ;
+ # has to be converted to DOS style for further use.
+ $local_pathseparator = ';';
+ }
+
+ my $patharrayref = installer::converter::convert_stringlist_into_array(\$pathvariable, $local_pathseparator);
+
+ $installer::globals::patharray = $patharrayref;
+
+ foreach my $onefile ( @needed_files_in_path )
+ {
+ installer::logger::print_message( "...... searching $onefile ..." );
+
+ my $fileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$onefile, $patharrayref , 0);
+
+ if ( $$fileref eq "" )
+ {
+ $error = 1;
+ installer::logger::print_error( "$onefile not found\n" );
+ }
+ else
+ {
+ installer::logger::print_message( "\tFound: $$fileref\n" );
+ }
+ }
+
+ $installer::globals::signfiles_checked = 1;
+
+ if ( $error ) { installer::exiter::exit_program("ERROR: Could not find all needed files in path!", "check_system_path"); }
+}
+
+######################################################
+# Making systemcall
+######################################################
+
+sub make_systemcall
+{
+ my ($systemcall, $displaysystemcall) = @_;
+
+ installer::logger::print_message( "... $displaysystemcall ...\n" );
+
+ my $success = 1;
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $displaysystemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$displaysystemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $success = 0;
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$displaysystemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return $success;
+}
+
+######################################################
+# Making systemcall with warning
+######################################################
+
+sub make_systemcall_with_warning
+{
+ my ($systemcall, $displaysystemcall) = @_;
+
+ installer::logger::print_message( "... $displaysystemcall ...\n" );
+
+ my $success = 1;
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $displaysystemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "WARNING: Could not execute \"$displaysystemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $success = 0;
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$displaysystemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return $success;
+}
+
+######################################################
+# Making systemcall with more return data
+######################################################
+
+sub execute_open_system_call
+{
+ my ( $systemcall ) = @_;
+
+ my @openoutput = ();
+ my $success = 1;
+
+ my $comspec = $ENV{COMSPEC};
+ $comspec = $comspec . " -c ";
+
+ if( $^O =~ /cygwin/i )
+ {
+ # $comspec =~ s/\\/\\\\/g;
+ # $comspec = qx{cygpath -u "$comspec"};
+ # $comspec =~ s/\s*$//g;
+ $comspec = "";
+ }
+
+ my $localsystemcall = "$comspec $systemcall 2>&1 |";
+
+ open( OPN, "$localsystemcall") or warn "Can't execute $localsystemcall\n";
+ while (<OPN>) { push(@openoutput, $_); }
+ close (OPN);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $success = 0;
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return ($success, \@openoutput);
+}
+
+########################################################
+# Reading first line of pw file.
+########################################################
+
+sub get_pw
+{
+ my ( $file ) = @_;
+
+ my $filecontent = installer::files::read_file($file);
+
+ my $pw = ${$filecontent}[0];
+ $pw =~ s/^\s*//;
+ $pw =~ s/\s*$//;
+
+ return $pw;
+}
+
+########################################################
+# Counting the keys of a hash.
+########################################################
+
+sub get_hash_count
+{
+ my ($hashref) = @_;
+
+ my $counter = 0;
+
+ foreach my $key ( keys %{$hashref} ) { $counter++; }
+
+ return $counter;
+}
+
+############################################################
+# Collect all last files in a cabinet file. This is
+# necessary to control, if the cabinet file was damaged
+# by calling signtool.exe.
+############################################################
+
+sub analyze_file_file
+{
+ my ($filecontent) = @_;
+
+ my %filenamehash = ();
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i < 3 ) { next; }
+
+ if ( ${$filecontent}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my $name = $1;
+ my $sequence = $8;
+
+ $filenamehash{$sequence} = $name;
+ }
+ }
+
+ return ( \%filenamehash );
+}
+
+############################################################
+# Collect all DiskIds to the corresponding cabinet files.
+############################################################
+
+sub analyze_media_file
+{
+ my ($filecontent) = @_;
+
+ my %diskidhash = ();
+ my %lastsequencehash = ();
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if ( $i < 3 ) { next; }
+
+ if ( ${$filecontent}[$i] =~ /^\s*(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\s*$/ )
+ {
+ my $diskid = $1;
+ my $lastsequence = $2;
+ my $cabfile = $4;
+
+ $diskidhash{$cabfile} = $diskid;
+ $lastsequencehash{$cabfile} = $lastsequence;
+ }
+ }
+
+ return ( \%diskidhash, \%lastsequencehash );
+}
+
+########################################################
+# Collect all DiskIds from database table "Media".
+########################################################
+
+sub collect_diskid_from_media_table
+{
+ my ($msidatabase, $languagestring) = @_;
+
+ # creating working directory
+ my $workdir = installer::systemactions::create_directories("media", \$languagestring);
+ installer::windows::admin::extract_tables_from_pcpfile($msidatabase, $workdir, "Media File");
+
+ # Reading tables
+ my $filename = $workdir . $installer::globals::separator . "Media.idt";
+ if ( ! -f $filename ) { installer::exiter::exit_program("ERROR: Could not find required file: $filename !", "collect_diskid_from_media_table"); }
+ my $filecontent = installer::files::read_file($filename);
+ my ( $diskidhash, $lastsequencehash ) = analyze_media_file($filecontent);
+
+ $filename = $workdir . $installer::globals::separator . "File.idt";
+ if ( ! -f $filename ) { installer::exiter::exit_program("ERROR: Could not find required file: $filename !", "collect_diskid_from_media_table"); }
+ $filecontent = installer::files::read_file($filename);
+ my $filenamehash = analyze_file_file($filecontent);
+
+ return ( $diskidhash, $filenamehash, $lastsequencehash );
+}
+
+########################################################
+# Check, if this installation set contains
+# internal cabinet files included into the msi
+# database.
+########################################################
+
+sub check_for_internal_cabfiles
+{
+ my ($cabfilehash) = @_;
+
+ my $contains_internal_cabfiles = 0;
+ my %allcabfileshash = ();
+
+ foreach my $filename ( keys %{$cabfilehash} )
+ {
+ if ( $filename =~ /^\s*\#/ ) # starting with a hash
+ {
+ $contains_internal_cabfiles = 1;
+ # setting real filename without hash as key and name with hash as value
+ my $realfilename = $filename;
+ $realfilename =~ s/^\s*\#//;
+ $allcabfileshash{$realfilename} = $filename;
+ }
+ }
+
+ return ( $contains_internal_cabfiles, \%allcabfileshash );
+}
+
+########################################################
+# Collecting all files in an installation set.
+########################################################
+
+sub analyze_installset_content
+{
+ my ( $installsetpath ) = @_;
+
+ my @sourcefiles = ();
+ my $pathstring = "";
+ installer::systemactions::read_complete_directory($installsetpath, $pathstring, \@sourcefiles);
+
+ if ( ! ( $#sourcefiles > -1 )) { installer::exiter::exit_program("ERROR: No file in installation set. Path: $installsetpath !", "analyze_installset_content"); }
+
+ my %allcabfileshash = ();
+ my %allmsidatabaseshash = ();
+ my %allfileshash = ();
+ my $contains_external_cabfiles = 0;
+ my $msidatabase = "";
+ my $contains_msidatabase = 0;
+
+ for ( my $j = 0; $j <= $#sourcefiles; $j++ )
+ {
+ if ( $sourcefiles[$j] =~ /\.cab\s*$/ ) { $allcabfileshash{$sourcefiles[$j]} = 1; }
+ else
+ {
+ if ( $sourcefiles[$j] =~ /\.txt\s*$/ ) { next; }
+ if ( $sourcefiles[$j] =~ /\.html\s*$/ ) { next; }
+ if ( $sourcefiles[$j] =~ /\.ini\s*$/ ) { next; }
+ if ( $sourcefiles[$j] =~ /\.bmp\s*$/ ) { next; }
+ if ( $sourcefiles[$j] =~ /\.msi\s*$/ )
+ {
+ if ( $msidatabase eq "" ) { $msidatabase = $sourcefiles[$j]; }
+ else { installer::exiter::exit_program("ERROR: There is more than one msi database in installation set. Path: $installsetpath !", "analyze_installset_content"); }
+ }
+ $allfileshash{$sourcefiles[$j]} = 1;
+ }
+ }
+
+ # Is there at least one cab file in the installation set?
+ my $cabcounter = get_hash_count(\%allcabfileshash);
+ if ( $cabcounter > 0 ) { $contains_external_cabfiles = 1; }
+
+ # How about a cab file without a msi database?
+ if (( $cabcounter > 0 ) && ( $msidatabase eq "" )) { installer::exiter::exit_program("ERROR: There is no msi database in the installation set, but an external cabinet file. Path: $installsetpath !", "collect_installset_content"); }
+
+ if ( $msidatabase ne "" ) { $contains_msidatabase = 1; }
+
+ return (\%allcabfileshash, \%allfileshash, $msidatabase, $contains_external_cabfiles, $contains_msidatabase, \@sourcefiles);
+}
+
+########################################################
+# Adding content of external cabinet files into the
+# msi database
+########################################################
+
+sub msicert_database
+{
+ my ($msidatabase, $allcabfiles, $cabfilehash, $internalcabfile) = @_;
+
+ my $fullsuccess = 1;
+
+ foreach my $cabfile ( keys %{$allcabfiles} )
+ {
+ my $origfilesize = -s $cabfile;
+
+ my $mediacabfilename = $cabfile;
+ if ( $internalcabfile ) { $mediacabfilename = "\#" . $mediacabfilename; }
+ if ( ! exists($cabfilehash->{$mediacabfilename}) ) { installer::exiter::exit_program("ERROR: Could not determine DiskId from media table for cabinet file \"$cabfile\" !", "msicert_database"); }
+ my $diskid = $cabfilehash->{$mediacabfilename};
+
+ my $systemcall = "msicert.exe -d $msidatabase -m $diskid -c $cabfile -h";
+ $success = make_systemcall($systemcall, $systemcall);
+ if ( ! $success ) { $fullsuccess = 0; }
+
+ # size of cabinet file must not change
+ my $finalfilesize = -s $cabfile;
+
+ if ( $origfilesize != $finalfilesize ) { installer::exiter::exit_program("ERROR: msicert.exe changed size of cabinet file !", "msicert_database"); }
+ }
+
+ return $fullsuccess;
+}
+
+########################################################
+# Checking if cabinet file was broken by signtool.
+########################################################
+
+sub cabinet_cosistency_check
+{
+ my ( $onefile, $followmeinfohash, $filenamehash, $lastsequencehash, $temppath ) = @_;
+
+ my $infoline = "Making consistency check of $onefile\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ my $expandfile = "expand.exe"; # Has to be in the path
+
+ if ( $^O =~ /cygwin/i )
+ {
+ $expandfile = qx(cygpath -u "$ENV{WINDIR}"/System32/expand.exe);
+ chomp $expandfile;
+ }
+
+ if ( $filenamehash == 0 )
+ {
+ $infoline = "Warning: Stopping consistency check: Important hash of filenames is empty!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ elsif ( $lastsequencehash == 0 )
+ {
+ $infoline = "Warning: Stopping consistency check; Important hash of last sequences is empty!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else # both hashes are available
+ {
+ # $onefile contains only the name of the cabinet file without path
+ my $sequence = $lastsequencehash->{$onefile};
+ my $lastfile = $filenamehash->{$sequence};
+ $infoline = "Check of $onefile: Sequence: $sequence is file: $lastfile\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Therefore the file $lastfile need to be binary compared.
+ # It has to be expanded from the cabinet file
+ # of the original installation set and from the
+ # newly signed cabinet file.
+
+ # How about cabinet files extracted from msi database?
+ my $finalinstalldir = $followmeinfohash->{'finalinstalldir'};
+
+ $finalinstalldir =~ s/\\\s*$//;
+ $finalinstalldir =~ s/\/\s*$//;
+ my $sourcecabfile = $finalinstalldir . $installer::globals::separator . $onefile;
+ my $currentpath = cwd();
+ my $destcabfile = $currentpath . $installer::globals::separator . $onefile;
+ # my $destcabfile = $onefile;
+
+ if ( $^O =~ /cygwin/i )
+ {
+ chomp( $destcabfile = qx{cygpath -w "$destcabfile"} );
+ $destcabfile =~ s/\\/\//g;
+ }
+
+ if ( ! -f $sourcecabfile )
+ {
+ $infoline = "WARNING: Check of cab file cannot happen, because source cabinet file was not found: $sourcecabfile\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ elsif ( ! -f $destcabfile )
+ {
+ $infoline = "WARNING: Check of cab file cannot happen, because destination cabinet file was not found: $sourcecabfile\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else # everything is okay for the check
+ {
+ my $diffpath = get_diff_path($temppath);
+
+ my $origdiffpath = $diffpath . $installer::globals::separator . "orig";
+ my $newdiffpath = $diffpath . $installer::globals::separator . "new";
+
+ if ( ! -d $origdiffpath ) { mkdir($origdiffpath); }
+ if ( ! -d $newdiffpath ) { mkdir($newdiffpath); }
+
+ my $systemcall = "$expandfile $sourcecabfile $origdiffpath -f:$lastfile ";
+ $infoline = $systemcall . "\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $success = make_systemcall($systemcall, $systemcall);
+ if ( ! $success ) { installer::exiter::exit_program("ERROR: Could not successfully execute: $systemcall !", "cabinet_cosistency_check"); }
+
+ $systemcall = "$expandfile $destcabfile $newdiffpath -f:$lastfile ";
+ $infoline = $systemcall . "\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ $success = make_systemcall($systemcall, $systemcall);
+ if ( ! $success ) { installer::exiter::exit_program("ERROR: Could not successfully execute: $systemcall !", "cabinet_cosistency_check"); }
+
+ # and finally the two files can be diffed.
+ my $origfile = $origdiffpath . $installer::globals::separator . $lastfile;
+ my $newfile = $newdiffpath . $installer::globals::separator . $lastfile;
+
+ if ( ! -f $origfile ) { installer::exiter::exit_program("ERROR: Unpacked original file not found: $origfile !", "cabinet_cosistency_check"); }
+ if ( ! -f $newfile ) { installer::exiter::exit_program("ERROR: Unpacked new file not found: $newfile !", "cabinet_cosistency_check"); }
+
+ my $origsize = -s $origfile;
+ my $newsize = -s $newfile;
+
+ if ( $origsize != $newsize ) # This shows an error!
+ {
+ $infoline = "ERROR: Different filesize after signtool.exe was used. Original: $origsize Bytes, new: $newsize. File: $lastfile\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: The cabinet file $destcabfile is broken after signtool.exe signed this file !", "cabinet_cosistency_check");
+ }
+ else
+ {
+ $infoline = "Same size of last file in cabinet file after usage of signtool.exe: $newsize (File: $lastfile)\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # Also making a binary diff?
+
+ my $difffile = "diff.exe"; # has to be in the path
+ # $systemcall = "$difffile $sourcecabfile $destcabfile"; # Test for differences
+ $systemcall = "$difffile $origfile $newfile";
+ $infoline = $systemcall . "\n";
+ $returnvalue = make_systemcall($systemcall, $systemcall);
+
+ my $success = $?;
+
+ if ( $success == 0 )
+ {
+ $infoline = "Last files are identical after signing cabinet file (File: $lastfile)\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ elsif ( $success == 1 )
+ {
+ $infoline = "ERROR: Last files are different after signing cabinet file (File: $lastfile)\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Last files are different after signing cabinet file (File: $lastfile)!", "cabinet_cosistency_check");
+ }
+ else
+ {
+ $infoline = "ERROR: Problem occured calling diff.exe (File: $lastfile)\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Problem occured calling diff.exe (File: $lastfile) !", "cabinet_cosistency_check");
+ }
+ }
+ }
+ }
+
+}
+
+########################################################
+# Signing a list of files
+########################################################
+
+sub sign_files
+{
+ my ( $followmeinfohash, $allfiles, $pw, $cabinternal, $filenamehash, $lastsequencehash, $temppath ) = @_;
+
+ my $infoline = "";
+ my $fullsuccess = 1;
+ my $maxcounter = 3;
+
+ my $productname = "";
+ if ( $followmeinfohash->{'allvariableshash'}->{'PRODUCTNAME'} ) { $productname = "/d " . "\"$followmeinfohash->{'allvariableshash'}->{'PRODUCTNAME'}\""; }
+ my $url = "";
+ if (( ! exists($followmeinfohash->{'allvariableshash'}->{'OPENSOURCE'}) ) || ( $followmeinfohash->{'allvariableshash'}->{'OPENSOURCE'} == 0 )) { $url = "/du " . "\"http://www.sun.com\""; }
+ else { $url = "/du " . "\"http://www.openoffice.org\""; }
+ my $timestampurl = "http://timestamp.verisign.com/scripts/timestamp.dll";
+
+ my $pfxfilepath = $installer::globals::pfxfile;
+
+ if( $^O =~ /cygwin/i )
+ {
+ $pfxfilepath = qx{cygpath -w "$pfxfilepath"};
+ $pfxfilepath =~ s/\\/\\\\/g;
+ $pfxfilepath =~ s/\s*$//g;
+ }
+
+ foreach my $onefile ( reverse sort keys %{$allfiles} )
+ {
+ if ( already_certified($onefile) )
+ {
+ $infoline = "Already certified: Skipping file $onefile\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ next;
+ }
+
+ my $counter = 1;
+ my $success = 0;
+
+ while (( $counter <= $maxcounter ) && ( ! $success ))
+ {
+ if ( $counter > 1 ) { installer::logger::print_message( "\n\n... repeating file $onefile ...\n" ); }
+ if ( $cabinternal ) { installer::logger::print_message(" Signing: $onefile\n"); }
+ my $systemcall = "signtool.exe sign /f \"$pfxfilepath\" /p $pw $productname $url /t \"$timestampurl\" \"$onefile\"";
+ my $displaysystemcall = "signtool.exe sign /f \"$pfxfilepath\" /p ***** $productname $url /t \"$timestampurl\" \"$onefile\"";
+ $success = make_systemcall_with_warning($systemcall, $displaysystemcall);
+ $counter++;
+ }
+
+ # Special check for cabinet files, that sometimes get damaged by signtool.exe
+ if (( $success ) && ( $onefile =~ /\.cab\s*$/ ) && ( ! $cabinternal ))
+ {
+ cabinet_cosistency_check($onefile, $followmeinfohash, $filenamehash, $lastsequencehash, $temppath);
+ }
+
+ if ( ! $success )
+ {
+ $fullsuccess = 0;
+ installer::exiter::exit_program("ERROR: Could not sign file: $onefile!", "sign_files");
+ }
+ }
+
+ return $fullsuccess;
+}
+
+##########################################################################
+# Lines in ddf files must not contain more than 256 characters
+##########################################################################
+
+sub check_ddf_file
+{
+ my ( $ddffile, $ddffilename ) = @_;
+
+ my $maxlength = 0;
+ my $maxline = 0;
+ my $linelength = 0;
+ my $linenumber = 0;
+
+ for ( my $i = 0; $i <= $#{$ddffile}; $i++ )
+ {
+ my $oneline = ${$ddffile}[$i];
+
+ $linelength = length($oneline);
+ $linenumber = $i + 1;
+
+ if ( $linelength > 256 )
+ {
+ installer::exiter::exit_program("ERROR \"$ddffilename\" line $linenumber: Lines in ddf files must not contain more than 256 characters!", "check_ddf_file");
+ }
+
+ if ( $linelength > $maxlength )
+ {
+ $maxlength = $linelength;
+ $maxline = $linenumber;
+ }
+ }
+
+ my $infoline = "Check of ddf file \"$ddffilename\": Maximum length \"$maxlength\" in line \"$maxline\" (allowed line length: 256 characters)\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+#################################################################
+# Setting the path, where the cab files are unpacked.
+#################################################################
+
+sub get_cab_path
+{
+ my ($temppath) = @_;
+
+ my $cabpath = "cabs_" . $$;
+ $cabpath = $temppath . $installer::globals::separator . $cabpath;
+ if ( ! -d $cabpath ) { installer::systemactions::create_directory($cabpath); }
+
+ return $cabpath;
+}
+
+#################################################################
+# Setting the path, where the diff can happen.
+#################################################################
+
+sub get_diff_path
+{
+ my ($temppath) = @_;
+
+ my $diffpath = "diff_" . $$;
+ $diffpath = $temppath . $installer::globals::separator . $diffpath;
+ if ( ! -d $diffpath ) { installer::systemactions::create_directory($diffpath); }
+
+ return $diffpath;
+}
+
+#################################################################
+# Exclude all cab files from the msi database.
+#################################################################
+
+sub extract_cabs_from_database
+{
+ my ($msidatabase, $allcabfiles) = @_;
+
+ installer::logger::include_header_into_logfile("Extracting cabs from msi database");
+
+ my $infoline = "";
+ my $fullsuccess = 1;
+ my $msidb = "msidb.exe"; # Has to be in the path
+
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ $msidatabase =~ s/\//\\\\/g;
+
+ foreach my $onefile ( keys %{$allcabfiles} )
+ {
+ my $systemcall = $msidb . " -d " . $msidatabase . " -x " . $onefile;
+ my $success = make_systemcall($systemcall, $systemcall);
+ if ( ! $success ) { $fullsuccess = 0; }
+
+ # and removing the stream from the database
+ $systemcall = $msidb . " -d " . $msidatabase . " -k " . $onefile;
+ $success = make_systemcall($systemcall, $systemcall);
+ if ( ! $success ) { $fullsuccess = 0; }
+ }
+
+ return $fullsuccess;
+}
+
+#################################################################
+# Include cab files into the msi database.
+#################################################################
+
+sub include_cabs_into_database
+{
+ my ($msidatabase, $allcabfiles) = @_;
+
+ installer::logger::include_header_into_logfile("Including cabs into msi database");
+
+ my $infoline = "";
+ my $fullsuccess = 1;
+ my $msidb = "msidb.exe"; # Has to be in the path
+
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ $msidatabase =~ s/\//\\\\/g;
+
+ foreach my $onefile ( keys %{$allcabfiles} )
+ {
+ my $systemcall = $msidb . " -d " . $msidatabase . " -a " . $onefile;
+ my $success = make_systemcall($systemcall, $systemcall);
+ if ( ! $success ) { $fullsuccess = 0; }
+ }
+
+ return $fullsuccess;
+}
+
+########################################################
+# Reading the order of the files inside the
+# cabinet files.
+########################################################
+
+sub read_cab_file
+{
+ my ($cabfilename) = @_;
+
+ installer::logger::print_message( "\n... reading cabinet file $cabfilename ...\n" );
+ my $infoline = "Reading cabinet file $cabfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $systemcall = "cabarc.exe" . " L " . $cabfilename;
+ push(@logfile, "$systemcall\n");
+
+ my ($success, $fileorder) = execute_open_system_call($systemcall);
+
+ my @allfiles = ();
+
+ for ( my $i = 0; $i <= $#{$fileorder}; $i++ )
+ {
+ my $line = ${$fileorder}[$i];
+ if ( $line =~ /^\s*(.*?)\s+\d+\s+\d+\/\d+\/\d+\s+\d+\:\d+\:\d+\s+[\w-]+\s*$/ )
+ {
+ my $filename = $1;
+ push(@allfiles, $filename);
+ }
+ }
+
+ return \@allfiles;
+}
+
+########################################################
+# Unpacking a cabinet file.
+########################################################
+
+sub unpack_cab_file
+{
+ my ($cabfilename, $temppath) = @_;
+
+ installer::logger::print_message( "\n... unpacking cabinet file $cabfilename ...\n" );
+ my $infoline = "Unpacking cabinet file $cabfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $dirname = $cabfilename;
+ $dirname =~ s/\.cab\s*$//;
+ my $workingpath = $temppath . $installer::globals::separator . "unpack_". $dirname . "_" . $$;
+ if ( ! -d $workingpath ) { installer::systemactions::create_directory($workingpath); }
+
+ # changing into unpack directory
+ my $from = cwd();
+ chdir($workingpath);
+
+ my $fullcabfilename = $from . $installer::globals::separator . $cabfilename;
+
+ if( $^O =~ /cygwin/i )
+ {
+ $fullcabfilename = qx{cygpath -w "$fullcabfilename"};
+ $fullcabfilename =~ s/\\/\\\\/g;
+ $fullcabfilename =~ s/\s*$//g;
+ }
+
+ my $systemcall = "cabarc.exe" . " -p X " . $fullcabfilename;
+ $success = make_systemcall($systemcall, $systemcall);
+ if ( ! $success ) { installer::exiter::exit_program("ERROR: Could not unpack cabinet file: $fullcabfilename!", "unpack_cab_file"); }
+
+ # returning to directory
+ chdir($from);
+
+ return $workingpath;
+}
+
+########################################################
+# Returning the header of a ddf file.
+########################################################
+
+sub get_ddf_file_header
+{
+ my ($ddffileref, $cabinetfile, $installdir) = @_;
+
+ my $oneline;
+ my $compressionlevel = 2;
+
+ if( $^O =~ /cygwin/i )
+ {
+ $installdir = qx{cygpath -w "$installdir"};
+ $installdir =~ s/\s*$//g;
+ }
+
+ $oneline = ".Set CabinetName1=" . $cabinetfile . "\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set ReservePerCabinetSize=128\n"; # This reserves space for a digital signature.
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set MaxDiskSize=2147483648\n"; # This allows the .cab file to get a size of 2 GB.
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set CompressionType=LZX\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set Compress=ON\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set CompressionLevel=$compressionlevel\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set Cabinet=ON\n";
+ push(@{$ddffileref} ,$oneline);
+ $oneline = ".Set DiskDirectoryTemplate=" . $installdir . "\n";
+ push(@{$ddffileref} ,$oneline);
+}
+
+########################################################
+# Writing content into ddf file.
+########################################################
+
+sub put_all_files_into_ddffile
+{
+ my ($ddffile, $allfiles, $workingpath) = @_;
+
+ $workingpath =~ s/\//\\/g;
+
+ for ( my $i = 0; $i <= $#{$allfiles}; $i++ )
+ {
+ my $filename = ${$allfiles}[$i];
+ if( $^O =~ /cygwin/i ) { $filename =~ s/\//\\/g; } # Backslash for Cygwin!
+ if ( ! -f $filename ) { installer::exiter::exit_program("ERROR: Could not find file: $filename!", "put_all_files_into_ddffile"); }
+ my $infoline = "\"" . $filename . "\"" . " " . ${$allfiles}[$i] . "\n";
+ push( @{$ddffile}, $infoline);
+ }
+}
+
+########################################################
+# Packing a cabinet file.
+########################################################
+
+sub do_pack_cab_file
+{
+ my ($cabfilename, $allfiles, $workingpath, $temppath) = @_;
+
+ installer::logger::print_message( "\n... packing cabinet file $cabfilename ...\n" );
+ my $infoline = "Packing cabinet file $cabfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( -f $cabfilename ) { unlink($cabfilename); } # removing cab file
+ if ( -f $cabfilename ) { installer::exiter::exit_program("ERROR: Failed to remove file: $cabfilename!", "do_pack_cab_file"); }
+
+ # generate ddf file for makecab.exe
+ my @ddffile = ();
+
+ my $dirname = $cabfilename;
+ $dirname =~ s/\.cab\s*$//;
+ my $ddfpath = $temppath . $installer::globals::separator . "ddf_". $dirname . "_" . $$;
+
+ my $ddffilename = $cabfilename;
+ $ddffilename =~ s/.cab/.ddf/;
+ $ddffilename = $ddfpath . $installer::globals::separator . $ddffilename;
+
+ if ( ! -d $ddfpath ) { installer::systemactions::create_directory($ddfpath); }
+
+ my $from = cwd();
+
+ chdir($workingpath); # changing into the directory with the unpacked files
+
+ get_ddf_file_header(\@ddffile, $cabfilename, $from);
+ put_all_files_into_ddffile(\@ddffile, $allfiles, $workingpath);
+ # lines in ddf files must not be longer than 256 characters
+ check_ddf_file(\@ddffile, $ddffilename);
+
+ installer::files::save_file($ddffilename, \@ddffile);
+
+ if( $^O =~ /cygwin/i )
+ {
+ $ddffilename = qx{cygpath -w "$ddffilename"};
+ $ddffilename =~ s/\\/\\\\/g;
+ $ddffilename =~ s/\s*$//g;
+ }
+
+ my $systemcall = "makecab.exe /V1 /F " . $ddffilename;
+ my $success = make_systemcall($systemcall, $systemcall);
+ if ( ! $success ) { installer::exiter::exit_program("ERROR: Could not pack cabinet file!", "do_pack_cab_file"); }
+
+ chdir($from);
+
+ return ($success);
+}
+
+########################################################
+# Extraction the file extension from a file
+########################################################
+
+sub get_extension
+{
+ my ( $file ) = @_;
+
+ my $extension = "";
+
+ if ( $file =~ /^\s*(.*)\.(\w+?)\s*$/ ) { $extension = $2; }
+
+ return $extension;
+}
+
+########################################################
+# Checking, if a file already contains a certificate.
+# This must not be overwritten.
+########################################################
+
+sub already_certified
+{
+ my ( $filename ) = @_;
+
+ my $success = 1;
+ my $is_certified = 0;
+
+ my $systemcall = "signtool.exe verify /q /pa \"$filename\"";
+ my $returnvalue = system($systemcall);
+
+ if ( $returnvalue ) { $success = 0; }
+
+ # my $success = make_systemcall($systemcall, $systemcall);
+
+ if ( $success )
+ {
+ $is_certified = 1;
+ installer::logger::print_message( "... already certified -> skipping $filename ...\n" );
+ }
+
+ return $is_certified;
+}
+
+########################################################
+# Signing the files, that are included into
+# cabinet files.
+########################################################
+
+sub sign_files_in_cabinet_files
+{
+ my ( $followmeinfohash, $allcabfiles, $pw, $temppath ) = @_;
+
+ my $complete_success = 1;
+ my $from = cwd();
+
+ foreach my $cabfilename ( keys %{$allcabfiles} )
+ {
+ my $success = 1;
+
+ # saving order of files in cab file
+ my $fileorder = read_cab_file($cabfilename);
+
+ # unpack into $working path
+ my $workingpath = unpack_cab_file($cabfilename, $temppath);
+
+ chdir($workingpath);
+
+ # sign files
+ my %allfileshash = ();
+ foreach my $onefile ( @{$fileorder} )
+ {
+ my $extension = get_extension($onefile);
+ if ( exists( $installer::globals::sign_extensions{$extension} ) )
+ {
+ $allfileshash{$onefile} = 1;
+ }
+ }
+ $success = sign_files($followmeinfohash, \%allfileshash, $pw, 1, 0, 0, $temppath);
+ if ( ! $success ) { $complete_success = 0; }
+
+ chdir($from);
+
+ # pack into new directory
+ do_pack_cab_file($cabfilename, $fileorder, $workingpath, $temppath);
+ }
+
+ return $complete_success;
+}
+
+########################################################
+# Comparing the content of two directories.
+# Only filesize is compared.
+########################################################
+
+sub compare_directories
+{
+ my ( $dir1, $dir2, $files ) = @_;
+
+ $dir1 =~ s/\\\s*//;
+ $dir2 =~ s/\\\s*//;
+ $dir1 =~ s/\/\s*//;
+ $dir2 =~ s/\/\s*//;
+
+ my $infoline = "Comparing directories: $dir1 and $dir2\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ foreach my $onefile ( @{$files} )
+ {
+ my $file1 = $dir1 . $installer::globals::separator . $onefile;
+ my $file2 = $dir2 . $installer::globals::separator . $onefile;
+
+ if ( ! -f $file1 ) { installer::exiter::exit_program("ERROR: Missing file : $file1!", "compare_directories"); }
+ if ( ! -f $file2 ) { installer::exiter::exit_program("ERROR: Missing file : $file2!", "compare_directories"); }
+
+ my $size1 = -s $file1;
+ my $size2 = -s $file2;
+
+ $infoline = "Comparing files: $file1 ($size1) and $file2 ($size2)\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $size1 != $size2 )
+ {
+ installer::exiter::exit_program("ERROR: File defect after copy (different size) $file1 ($size1 bytes) and $file2 ($size2 bytes)!", "compare_directories");
+ }
+ }
+}
+
+########################################################
+# Signing an existing Windows installation set.
+########################################################
+
+sub sign_install_set
+{
+ my ($followmeinfohash, $make_copy, $temppath) = @_;
+
+ my $installsetpath = $followmeinfohash->{'finalinstalldir'};
+
+ installer::logger::include_header_into_logfile("Start: Signing installation set $installsetpath");
+
+ my $complete_success = 1;
+ my $success = 1;
+
+ my $infoline = "Signing installation set in $installsetpath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # check required files.
+ if ( ! $installer::globals::signfiles_checked ) { check_system_path(); }
+
+ # get cerficate information
+ my $pw = get_pw($installer::globals::pwfile);
+
+ # making a copy of the installation set, if required
+ if ( $make_copy ) { $installsetpath = copy_install_set($installsetpath); }
+ else { $installsetpath = rename_install_set($installsetpath); }
+
+ # collecting all files in the installation set
+ my ($allcabfiles, $allfiles, $msidatabase, $contains_external_cabfiles, $contains_msidatabase, $sourcefiles) = analyze_installset_content($installsetpath);
+
+ if ( $make_copy ) { compare_directories($installsetpath, $followmeinfohash->{'finalinstalldir'}, $sourcefiles); }
+
+ # changing into installation set
+ my $from = cwd();
+ my $fullmsidatabase = $installsetpath . $installer::globals::separator . $msidatabase;
+
+ if( $^O =~ /cygwin/i )
+ {
+ $fullmsidatabase = qx{cygpath -w "$fullmsidatabase"};
+ $fullmsidatabase =~ s/\\/\\\\/g;
+ $fullmsidatabase =~ s/\s*$//g;
+ }
+
+ chdir($installsetpath);
+
+ if ( $contains_msidatabase )
+ {
+ # exclude media table from msi database and get all diskids.
+ my ( $cabfilehash, $filenamehash, $lastsequencehash ) = collect_diskid_from_media_table($msidatabase, $followmeinfohash->{'languagestring'});
+
+ # Check, if there are internal cab files
+ my ( $contains_internal_cabfiles, $all_internal_cab_files) = check_for_internal_cabfiles($cabfilehash);
+
+ if ( $contains_internal_cabfiles )
+ {
+ my $cabpath = get_cab_path($temppath);
+ chdir($cabpath);
+
+ # Exclude all cabinet files from database
+ $success = extract_cabs_from_database($fullmsidatabase, $all_internal_cab_files);
+ if ( ! $success ) { $complete_success = 0; }
+
+ if ( $installer::globals::internal_cabinet_signing ) { sign_files_in_cabinet_files($followmeinfohash, $all_internal_cab_files, $pw, $temppath); }
+
+ $success = sign_files($followmeinfohash, $all_internal_cab_files, $pw, 0, $filenamehash, $lastsequencehash, $temppath);
+ if ( ! $success ) { $complete_success = 0; }
+ $success = msicert_database($fullmsidatabase, $all_internal_cab_files, $cabfilehash, 1);
+ if ( ! $success ) { $complete_success = 0; }
+
+ # Include all cabinet files into database
+ $success = include_cabs_into_database($fullmsidatabase, $all_internal_cab_files);
+ if ( ! $success ) { $complete_success = 0; }
+ chdir($installsetpath);
+ }
+
+ # Warning: There might be a problem with very big cabinet files
+ # signing all external cab files first
+ if ( $contains_external_cabfiles )
+ {
+ if ( $installer::globals::internal_cabinet_signing ) { sign_files_in_cabinet_files($followmeinfohash, $allcabfiles, $pw, $temppath); }
+
+ $success = sign_files($followmeinfohash, $allcabfiles, $pw, 0, $filenamehash, $lastsequencehash, $temppath);
+ if ( ! $success ) { $complete_success = 0; }
+ $success = msicert_database($msidatabase, $allcabfiles, $cabfilehash, 0);
+ if ( ! $success ) { $complete_success = 0; }
+ }
+ }
+
+ # finally all other files can be signed
+ $success = sign_files($followmeinfohash, $allfiles, $pw, 0, 0, 0, $temppath);
+ if ( ! $success ) { $complete_success = 0; }
+
+ # and changing back
+ chdir($from);
+
+ installer::logger::include_header_into_logfile("End: Signing installation set $installsetpath");
+
+ return ($installsetpath);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/strip.pm b/solenv/bin/modules/installer/windows/strip.pm
new file mode 100644
index 000000000000..79b1046c1e8f
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/strip.pm
@@ -0,0 +1,159 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::strip;
+
+use File::Temp qw(tmpnam);
+use installer::converter;
+use installer::existence;
+use installer::globals;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::systemactions;
+
+#####################################################################
+# Checking whether a file has to be stripped
+#####################################################################
+
+sub need_to_strip
+{
+ my ( $filename ) = @_;
+
+ my $strip = 0;
+
+ # Check using the "nm" command
+
+ $filename =~ s/\\/\\\\/g;
+
+ open (FILE, "nm $filename 2>&1 |");
+ my $nmoutput = <FILE>;
+ close (FILE);
+
+ if ( $nmoutput && !( $nmoutput =~ /no symbols/i || $nmoutput =~ /not recognized/i )) { $strip = 1; }
+
+ return $strip
+}
+
+#####################################################################
+# Checking whether a file has to be stripped
+#####################################################################
+
+sub do_strip
+{
+ my ( $filename ) = @_;
+
+ my $systemcall = "strip" . " " . $filename;
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not strip $filename!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "SUCCESS: Stripped library $filename!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+#####################################################################
+# Resolving all variables in the packagename.
+#####################################################################
+
+sub strip_binaries
+{
+ my ( $filelist, $languagestringref ) = @_;
+
+ installer::logger::include_header_into_logfile("Stripping files:");
+
+ my $strippeddirbase = installer::systemactions::create_directories("stripped", $languagestringref);
+
+ if (! installer::existence::exists_in_array($strippeddirbase, \@installer::globals::removedirs))
+ {
+ push(@installer::globals::removedirs, $strippeddirbase);
+ }
+
+ my ($tmpfilehandle, $tmpfilename) = tmpnam();
+ open SOURCEPATHLIST, ">$tmpfilename" or die "oops...\n";
+ for ( my $i = 0; $i <= $#{$filelist}; $i++ )
+ {
+ print SOURCEPATHLIST "${$filelist}[$i]->{'sourcepath'}\n";
+ }
+ close SOURCEPATHLIST;
+ my @filetypelist = qx{file -f "$tmpfilename"};
+ chomp @filetypelist;
+ unlink "$tmpfilename" or die "oops\n";
+ for ( my $i = 0; $i <= $#{$filelist}; $i++ )
+ {
+ ${$filelist}[$i]->{'is_executable'} = ( $filetypelist[$i] =~ /:.*PE executable/ );
+ }
+
+ if ( $^O =~ /cygwin/i ) { installer::worker::generate_cygwin_pathes($filelist); }
+
+ for ( my $i = 0; $i <= $#{$filelist}; $i++ )
+ {
+ my $sourcefilename = ${$filelist}[$i]->{'cyg_sourcepath'};
+
+ if ( ${$filelist}[$i]->{'is_executable'} && need_to_strip($sourcefilename) )
+ {
+ my $shortfilename = $sourcefilename;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$shortfilename);
+
+ $infoline = "Strip: $shortfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # copy file into directory for stripped libraries
+
+ my $onelanguage = ${$filelist}[$i]->{'specificlanguage'};
+
+ # files without language into directory "00"
+
+ if ($onelanguage eq "") { $onelanguage = "00"; }
+
+ my $strippeddir = $strippeddirbase . $installer::globals::separator . $onelanguage;
+ installer::systemactions::create_directory($strippeddir); # creating language specific subdirectories
+
+ my $destfilename = $strippeddir . $installer::globals::separator . $shortfilename;
+ installer::systemactions::copy_one_file($sourcefilename, $destfilename);
+
+ # change sourcepath in files collector
+
+ ${$filelist}[$i]->{'sourcepath'} = $destfilename;
+
+ # strip file
+
+ do_strip($destfilename);
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/installer/windows/update.pm b/solenv/bin/modules/installer/windows/update.pm
new file mode 100644
index 000000000000..efe6949b6fc4
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/update.pm
@@ -0,0 +1,600 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::update;
+
+use installer::converter;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::pathanalyzer;
+use installer::systemactions;
+
+#################################################################################
+# Extracting all tables from an msi database
+#################################################################################
+
+sub extract_all_tables_from_msidatabase
+{
+ my ($fulldatabasepath, $workdir) = @_;
+
+ my $msidb = "msidb.exe"; # Has to be in the path
+ my $infoline = "";
+ my $systemcall = "";
+ my $returnvalue = "";
+ my $extraslash = ""; # Has to be set for non-ActiveState perl
+
+ # Export of all tables by using "*"
+
+ if ( $^O =~ /cygwin/i ) {
+ # msidb.exe really wants backslashes. (And double escaping because system() expands the string.)
+ $fulldatabasepath =~ s/\//\\\\/g;
+ $workdir =~ s/\//\\\\/g;
+ $extraslash = "\\";
+ }
+
+ $systemcall = $msidb . " -d " . $fulldatabasepath . " -f " . $workdir . " -e " . $extraslash . "*";
+ $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute $systemcall !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Could not exclude tables from msi database: $fulldatabasepath !", "extract_all_tables_from_msidatabase");
+ }
+ else
+ {
+ $infoline = "Success: Executed $systemcall successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+#################################################################################
+# Collecting the keys from the first line of the idt file
+#################################################################################
+
+sub collect_all_keys
+{
+ my ($line) = @_;
+
+ my @allkeys = ();
+ my $rownumber = 0;
+ my $onekey = "";
+
+ while ( $line =~ /^\s*(\S+?)\t(.*)$/ )
+ {
+ $onekey = $1;
+ $line = $2;
+ $rownumber++;
+ push(@allkeys, $onekey);
+ }
+
+ # and the last key
+
+ $onekey = $line;
+ $onekey =~ s/^\s*//g;
+ $onekey =~ s/\s*$//g;
+
+ $rownumber++;
+ push(@allkeys, $onekey);
+
+ return (\@allkeys, $rownumber);
+}
+
+#################################################################################
+# Analyzing the content of one line of an idt file
+#################################################################################
+
+sub get_oneline_hash
+{
+ my ($line, $allkeys, $rownumber) = @_;
+
+ my $counter = 0;
+ my %linehash = ();
+
+ $line =~ s/^\s*//;
+ $line =~ s/\s*$//;
+
+ my $value = "";
+ my $onekey = "";
+
+ while ( $line =~ /^(.*?)\t(.*)$/ )
+ {
+ $value = $1;
+ $line = $2;
+ $onekey = ${$allkeys}[$counter];
+ $linehash{$onekey} = $value;
+ $counter++;
+ }
+
+ # the last column
+
+ $value = $line;
+ $onekey = ${$allkeys}[$counter];
+
+ $linehash{$onekey} = $value;
+
+ return \%linehash;
+}
+
+#################################################################################
+# Analyzing the content of an idt file
+#################################################################################
+
+sub analyze_idt_file
+{
+ my ($filecontent) = @_;
+
+ my %table = ();
+ # keys are written in first line
+ my ($allkeys, $rownumber) = collect_all_keys(${$filecontent}[0]);
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ if (( $i == 0 ) || ( $i == 1 ) || ( $i == 2 )) { next; }
+
+ my $onelinehash = get_oneline_hash(${$filecontent}[$i], $allkeys, $rownumber);
+ my $linekey = $i - 2; # ! : The linenumber is the unique key !? Always decrease by two, because of removed first three lines.
+ $table{$linekey} = $onelinehash;
+ }
+
+ return \%table;
+}
+
+#################################################################################
+# Reading all idt files in a specified directory
+#################################################################################
+
+sub read_all_tables_from_msidatabase
+{
+ my ($workdir) = @_;
+
+ my %database = ();
+
+ my $ext = "idt";
+
+ my $allidtfiles = installer::systemactions::find_file_with_file_extension($ext, $workdir);
+
+ for ( my $i = 0; $i <= $#{$allidtfiles}; $i++ )
+ {
+ my $onefilename = ${$allidtfiles}[$i];
+ my $longonefilename = $workdir . $installer::globals::separator . $onefilename;
+ if ( ! -f $longonefilename ) { installer::exiter::exit_program("ERROR: Could not find idt file: $longonefilename!", "read_all_tables_from_msidatabase"); }
+ my $filecontent = installer::files::read_file($longonefilename);
+ my $idtcontent = analyze_idt_file($filecontent);
+ my $key = $onefilename;
+ $key =~ s/\.idt\s*$//;
+ $database{$key} = $idtcontent;
+ }
+
+ return \%database;
+}
+
+#################################################################################
+# Checking, if this is the correct database.
+#################################################################################
+
+sub correct_database
+{
+ my ($product, $pro, $langs, $languagestringref) = @_;
+
+ my $correct_database = 0;
+
+ # Comparing $product with $installer::globals::product and
+ # $pro with $installer::globals::pro and
+ # $langs with $languagestringref
+
+ my $product_is_good = 0;
+
+ my $localproduct = $installer::globals::product;
+ if ( $installer::globals::languagepack ) { $localproduct = $localproduct . "LanguagePack"; }
+
+ if ( $product eq $localproduct ) { $product_is_good = 1; }
+
+ if ( $product_is_good )
+ {
+ my $pro_is_good = 0;
+
+ if ((( $pro eq "pro" ) && ( $installer::globals::pro )) || (( $pro eq "nonpro" ) && ( ! $installer::globals::pro ))) { $pro_is_good = 1; }
+
+ if ( $pro_is_good )
+ {
+ my $langlisthash = installer::converter::convert_stringlist_into_hash(\$langs, ",");
+ my $langstringhash = installer::converter::convert_stringlist_into_hash($languagestringref, "_");
+
+ my $not_included = 0;
+ foreach my $onelang ( keys %{$langlisthash} )
+ {
+ if ( ! exists($langstringhash->{$onelang}) )
+ {
+ $not_included = 1;
+ last;
+ }
+ }
+
+ if ( ! $not_included )
+ {
+ foreach my $onelanguage ( keys %{$langstringhash} )
+ {
+ if ( ! exists($langlisthash->{$onelanguage}) )
+ {
+ $not_included = 1;
+ last;
+ }
+ }
+
+ if ( ! $not_included ) { $correct_database = 1; }
+ }
+ }
+ }
+
+ return $correct_database;
+}
+
+#################################################################################
+# Searching for the path to the reference database for this special product.
+#################################################################################
+
+sub get_databasename_from_list
+{
+ my ($filecontent, $languagestringref, $filename) = @_;
+
+ my $databasepath = "";
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ my $line = ${$filecontent}[$i];
+ if ( $line =~ /^\s*$/ ) { next; } # empty line
+ if ( $line =~ /^\s*\#/ ) { next; } # comment line
+
+ if ( $line =~ /^\s*(.+?)\s*\t+\s*(.+?)\s*\t+\s*(.+?)\s*\t+\s*(.+?)\s*$/ )
+ {
+ my $product = $1;
+ my $pro = $2;
+ my $langs = $3;
+ my $path = $4;
+
+ if (( $pro ne "pro" ) && ( $pro ne "nonpro" )) { installer::exiter::exit_program("ERROR: Wrong syntax in file: $filename. Only \"pro\" or \"nonpro\" allowed in column 1! Line: \"$line\"", "get_databasename_from_list"); }
+
+ if ( correct_database($product, $pro, $langs, $languagestringref) )
+ {
+ $databasepath = $path;
+ last;
+ }
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: Wrong syntax in file: $filename! Line: \"$line\"", "get_databasename_from_list");
+ }
+ }
+
+ return $databasepath;
+}
+
+#################################################################################
+# Reading an existing database completely
+#################################################################################
+
+sub readdatabase
+{
+ my ($allvariables, $languagestringref, $includepatharrayref) = @_;
+
+ my $database = "";
+ my $infoline = "";
+
+ if ( ! $allvariables->{'UPDATE_DATABASE_LISTNAME'} ) { installer::exiter::exit_program("ERROR: If \"UPDATE_DATABASE\" is set, \"UPDATE_DATABASE_LISTNAME\" is required.", "Main"); }
+ my $listfilename = $allvariables->{'UPDATE_DATABASE_LISTNAME'};
+
+ # Searching the list in the include pathes
+ my $listname = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$listfilename, $includepatharrayref, 1);
+ if ( $$listname eq "" ) { installer::exiter::exit_program("ERROR: List file not found: $listfilename !", "readdatabase"); }
+ my $completelistname = $$listname;
+
+ # Reading list file
+ my $listfile = installer::files::read_file($completelistname);
+
+ # Get name and path of reference database
+ my $databasename = get_databasename_from_list($listfile, $languagestringref, $completelistname);
+
+ # If the correct database was not found, this is not necessarily an error. But in this case, this is not an update packaging process!
+ if (( $databasename ) && ( $databasename ne "" )) # This is an update packaging process!
+ {
+ $installer::globals::updatedatabase = 1;
+ installer::logger::print_message( "... update process, using database $databasename ...\n" );
+ $infoline = "\nDatabase found in $completelistname: \"$databasename\"\n\n";
+ # Saving in global variable
+ $installer::globals::updatedatabasepath = $databasename;
+ }
+ else
+ {
+ # installer::logger::print_message( "... no update process, no database found ...\n" );
+ $infoline = "\nNo database found in $completelistname. This is no update process!\n\n";
+ }
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $installer::globals::updatedatabase )
+ {
+ if ( ! -f $databasename ) { installer::exiter::exit_program("ERROR: Could not find reference database: $databasename!", "readdatabase"); }
+
+ my $msifilename = $databasename;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$msifilename);
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: readdatabase start");
+
+ # create directory for unpacking
+ my $databasedir = installer::systemactions::create_directories("database", $languagestringref);
+
+ # copy database
+ my $fulldatabasepath = $databasedir . $installer::globals::separator . $msifilename;
+ installer::systemactions::copy_one_file($databasename, $fulldatabasepath);
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: readdatabase: before extracting tables");
+
+ # extract all tables from database
+ extract_all_tables_from_msidatabase($fulldatabasepath, $databasedir);
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: readdatabase: before reading tables");
+
+ # read all tables
+ $database = read_all_tables_from_msidatabase($databasedir);
+
+ # Test output:
+
+ # foreach my $key1 ( keys %{$database} )
+ # {
+ # print "Test1: $key1\n";
+ # foreach my $key2 ( keys %{$database->{$key1}} )
+ # {
+ # print "\tTest2: $key2\n";
+ # foreach my $key3 ( keys %{$database->{$key1}->{$key2}} )
+ # {
+ # print "\t\tTest3: $key3: $database->{$key1}->{$key2}->{$key3}\n";
+ # }
+ # }
+ # }
+
+ # Example: File table
+
+ # my $filetable = $database->{'File'};
+ # foreach my $linenumber ( keys %{$filetable} )
+ # {
+ # print "Test Filenumber: $linenumber\n";
+ # foreach my $key ( keys %{$filetable->{$linenumber}} )
+ # {
+ # print "\t\tTest: $key: $filetable->{$linenumber}->{$key}\n";
+ # }
+ # }
+
+ # Example: Searching for ProductCode in table Property
+
+ # my $column1 = "Property";
+ # my $column2 = "Value";
+ # my $searchkey = "ProductCode";
+ # my $propertytable = $database->{'Property'};
+ # foreach my $linenumber ( keys %{$propertytable} )
+ # {
+ # if ( $propertytable->{$linenumber}->{$column1} eq $searchkey )
+ # {
+ # print("Test: $searchkey : $propertytable->{$linenumber}->{$column2}\n");
+ # }
+ # }
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: readdatabase end");
+ }
+
+ return $database;
+}
+
+#################################################################################
+# Files can be included in merge modules. This is also important for update.
+#################################################################################
+
+sub readmergedatabase
+{
+ my ( $mergemodules, $languagestringref, $includepatharrayref ) = @_;
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: readmergedatabase start");
+
+ my $mergemoduledir = installer::systemactions::create_directories("mergedatabase", $languagestringref);
+
+ my %allmergefiles = ();
+
+ $installer::globals::mergemodulenumber = $#{$mergemodules} + 1;
+
+ foreach my $mergemodule ( @{$mergemodules} )
+ {
+ my $filename = $mergemodule->{'Name'};
+ my $mergefile = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filename, $includepatharrayref, 1);
+
+ if ( $$mergefile eq "" ) { installer::exiter::exit_program("ERROR: msm file not found: $filename !", "readmergedatabase"); }
+ my $completesource = $$mergefile;
+
+ my $mergegid = $mergemodule->{'gid'};
+ my $workdir = $mergemoduledir . $installer::globals::separator . $mergegid;
+ if ( ! -d $workdir ) { installer::systemactions::create_directory($workdir); }
+
+ my $completedest = $workdir . $installer::globals::separator . $filename;
+ installer::systemactions::copy_one_file($completesource, $completedest);
+ if ( ! -f $completedest ) { installer::exiter::exit_program("ERROR: msm file not found: $completedest !", "readmergedatabase"); }
+
+ # extract all tables from database
+ extract_all_tables_from_msidatabase($completedest, $workdir);
+
+ # read all tables
+ my $onemergefile = read_all_tables_from_msidatabase($workdir);
+
+ $allmergefiles{$mergegid} = $onemergefile;
+ }
+
+ foreach my $mergefilegid ( keys %allmergefiles )
+ {
+ my $onemergefile = $allmergefiles{$mergefilegid};
+ my $filetable = $onemergefile->{'File'};
+
+ foreach my $linenumber ( keys %{$filetable} )
+ {
+ # Collecting all files from merge modules in global hash
+ $installer::globals::mergemodulefiles{$filetable->{$linenumber}->{'File'}} = 1;
+ }
+ }
+
+ installer::logger::include_timestamp_into_logfile("Performance Info: readmergedatabase end");
+}
+
+#################################################################################
+# Creating several useful hashes from old database
+#################################################################################
+
+sub create_database_hashes
+{
+ my ( $database ) = @_;
+
+ # 1. Hash ( Component -> UniqueFileName ), required in File table.
+ # Read from File table.
+
+ my %uniquefilename = ();
+ my %allupdatesequences = ();
+ my %allupdatecomponents = ();
+ my %allupdatefileorder = ();
+ my %allupdatecomponentorder = ();
+ my %revuniquefilename = ();
+ my %revshortfilename = ();
+ my %shortdirname = ();
+ my %componentid = ();
+ my %componentidkeypath = ();
+ my %alloldproperties = ();
+ my %allupdatelastsequences = ();
+ my %allupdatediskids = ();
+
+ my $filetable = $database->{'File'};
+
+ foreach my $linenumber ( keys %{$filetable} )
+ {
+ my $comp = $filetable->{$linenumber}->{'Component_'};
+ my $uniquename = $filetable->{$linenumber}->{'File'};
+ my $filename = $filetable->{$linenumber}->{'FileName'};
+ my $sequence = $filetable->{$linenumber}->{'Sequence'};
+
+ my $shortname = "";
+ if ( $filename =~ /^\s*(.*?)\|\s*(.*?)\s*$/ )
+ {
+ $shortname = $1;
+ $filename = $2;
+ }
+
+ # unique is the combination of $component and $filename
+ my $key = "$comp/$filename";
+
+ if ( exists($uniquefilename{$key}) ) { installer::exiter::exit_program("ERROR: Component/FileName \"$key\" is not unique in table \"File\" !", "create_database_hashes"); }
+
+ my $value = $uniquename;
+ if ( $shortname ne "" ) { $value = "$uniquename;$shortname"; }
+ $uniquefilename{$key} = $value; # saving the unique keys and short names in hash
+
+ # Saving reverse keys too
+ $revuniquefilename{$uniquename} = $key;
+ if ( $shortname ne "" ) { $revshortfilename{$shortname} = $key; }
+
+ # Saving Sequences for unique names (and also components)
+ $allupdatesequences{$uniquename} = $sequence;
+ $allupdatecomponents{$uniquename} = $comp;
+
+ # Saving unique names and components for sequences
+ $allupdatefileorder{$sequence} = $uniquename;
+ $allupdatecomponentorder{$sequence} = $comp;
+ }
+
+ # 2. Hash, required in Directory table.
+
+ my $dirtable = $database->{'Directory'};
+
+ foreach my $linenumber ( keys %{$dirtable} )
+ {
+ my $dir = $dirtable->{$linenumber}->{'Directory'}; # this is a unique name
+ my $defaultdir = $dirtable->{$linenumber}->{'DefaultDir'};
+
+ my $shortname = "";
+ if ( $defaultdir =~ /^\s*(.*?)\|\s*(.*?)\s*$/ )
+ {
+ $shortname = $1;
+ $shortdirname{$dir} = $shortname; # collecting only the short names
+ }
+ }
+
+ # 3. Hash, collecting info from Component table.
+ # ComponentID and KeyPath have to be reused.
+
+ my $comptable = $database->{'Component'};
+
+ foreach my $linenumber ( keys %{$comptable} )
+ {
+ my $comp = $comptable->{$linenumber}->{'Component'};
+ my $compid = $comptable->{$linenumber}->{'ComponentId'};
+ my $keypath = $comptable->{$linenumber}->{'KeyPath'};
+
+ $componentid{$comp} = $compid;
+ $componentidkeypath{$comp} = $keypath;
+ }
+
+ # 4. Hash, property table, required for ProductCode and Installlocation.
+
+ my $proptable = $database->{'Property'};
+
+ foreach my $linenumber ( keys %{$proptable} )
+ {
+ my $prop = $proptable->{$linenumber}->{'Property'};
+ my $value = $proptable->{$linenumber}->{'Value'};
+
+ $alloldproperties{$prop} = $value;
+ }
+
+ # 5. Media table, getting last sequence
+
+ my $mediatable = $database->{'Media'};
+ $installer::globals::updatelastsequence = 0;
+
+ foreach my $linenumber ( keys %{$mediatable} )
+ {
+ my $cabname = $mediatable->{$linenumber}->{'Cabinet'};
+ my $lastsequence = $mediatable->{$linenumber}->{'LastSequence'};
+ my $diskid = $mediatable->{$linenumber}->{'DiskId'};
+ $allupdatelastsequences{$cabname} = $lastsequence;
+ $allupdatediskids{$cabname} = $diskid;
+
+ if ( $lastsequence > $installer::globals::updatelastsequence ) { $installer::globals::updatelastsequence = $lastsequence; }
+ }
+
+ $installer::globals::updatesequencecounter = $installer::globals::updatelastsequence;
+
+ return (\%uniquefilename, \%revuniquefilename, \%revshortfilename, \%allupdatesequences, \%allupdatecomponents, \%allupdatefileorder, \%allupdatecomponentorder, \%shortdirname, \%componentid, \%componentidkeypath, \%alloldproperties, \%allupdatelastsequences, \%allupdatediskids);
+}
+
+
+1; \ No newline at end of file
diff --git a/solenv/bin/modules/installer/windows/upgrade.pm b/solenv/bin/modules/installer/windows/upgrade.pm
new file mode 100644
index 000000000000..49479b26bf49
--- /dev/null
+++ b/solenv/bin/modules/installer/windows/upgrade.pm
@@ -0,0 +1,167 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::windows::upgrade;
+
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::windows::idtglobal;
+
+####################################################################################
+# Creating the file Upgrade.idt dynamically
+# Content:
+# UpgradeCode VersionMin VersionMax Language Attributes Remove ActionProperty
+####################################################################################
+
+sub create_upgrade_table
+{
+ my ($basedir, $allvariableshashref) = @_;
+
+ my @upgradetable = ();
+
+ # fix for problematic OOo 1.9 versions
+ my $include_ooo_fix = 0;
+ my $ooomaxnew = "";
+ if (($installer::globals::product =~ /^\s*OpenOffice/i ) && ( ! ( $installer::globals::product =~ /SDK/i )) && ( ! $installer::globals::languagepack ))
+ {
+ $include_ooo_fix = 1;
+ $ooomaxnew = "34.0.0";
+ }
+
+ installer::windows::idtglobal::write_idt_header(\@upgradetable, "upgrade");
+
+ # Setting also $installer::globals::msimajorproductversion, that is for example "3.0.0", to differ between old products for OOo 2.x and
+ # older products from OOo 3.x. The latter must be removed always, the removal of the first is controlled with a checkbox.
+ my $newline = $installer::globals::upgradecode . "\t" . "\t" . $installer::globals::msimajorproductversion . "\t" . "\t" . "0" . "\t" . "\t" . "OLDPRODUCTS" . "\n";
+ push(@upgradetable, $newline);
+
+ # Setting all products, that must be removed.
+ $newline = $installer::globals::upgradecode . "\t" . $installer::globals::msimajorproductversion . "\t" . $installer::globals::msiproductversion . "\t" . "\t" . "257" . "\t" . "\t" . "OLDPRODUCTSSAMEMAJOR" . "\n";
+ push(@upgradetable, $newline);
+
+ if ( ! $installer::globals::patch )
+ {
+ # preventing downgrading
+ $newline = $installer::globals::upgradecode . "\t" . $installer::globals::msiproductversion . "\t" . $ooomaxnew . "\t" . "\t" . "2" . "\t" . "\t" . "NEWPRODUCTS" . "\n";
+ push(@upgradetable, $newline);
+
+ $newline = $installer::globals::upgradecode . "\t" . $installer::globals::msiproductversion . "\t" . $ooomaxnew . "\t" . "\t" . "258" . "\t" . "\t" . "SAMEPRODUCTS" . "\n";
+ push(@upgradetable, $newline);
+
+ if ( $include_ooo_fix )
+ {
+ $newline = $installer::globals::upgradecode . "\t" . "35.0.0" . "\t" . "36.0.0" . "\t" . "\t" . "1" . "\t" . "\t" . "OLDPRODUCTS2" . "\n";
+ push(@upgradetable, $newline);
+ }
+
+ # if (( $allvariableshashref->{'PATCHUPGRADECODE'} ) && ( ! $installer::globals::languagepack ))
+ # {
+ # $newline = $allvariableshashref->{'PATCHUPGRADECODE'} . "\t" . "\t" . $installer::globals::msiproductversion . "\t" . "\t" . "1" . "\t" . "\t" . "OLDPRODUCTSPATCH" . "\n";
+ # push(@upgradetable, $newline);
+ #
+ # $newline = $allvariableshashref->{'PATCHUPGRADECODE'} . "\t" . $installer::globals::msiproductversion . "\t" . "\t" . "\t" . "2" . "\t" . "\t" . "NEWPRODUCTSPATCH" . "\n";
+ # push(@upgradetable, $newline);
+ #
+ # $newline = $allvariableshashref->{'PATCHUPGRADECODE'} . "\t" . $installer::globals::msiproductversion . "\t" . "\t" . "\t" . "258" . "\t" . "\t" . "SAMEPRODUCTSPATCH" . "\n";
+ # push(@upgradetable, $newline);
+ # }
+
+ # also searching for the beta
+
+ if (( $allvariableshashref->{'BETAUPGRADECODE'} ) && ( ! $installer::globals::languagepack ))
+ {
+ $newline = $allvariableshashref->{'BETAUPGRADECODE'} . "\t" . "1.0" . "\t" . "\t" . "\t" . "1" . "\t" . "\t" . "BETAPRODUCTS" . "\n";
+ push(@upgradetable, $newline);
+ }
+
+ # also searching for the stub
+
+ if (( $allvariableshashref->{'STUBUPGRADECODE'} ) && ( ! $installer::globals::languagepack ))
+ {
+ $newline = $allvariableshashref->{'STUBUPGRADECODE'} . "\t" . "1.0" . "\t" . "\t" . "\t" . "1" . "\t" . "\t" . "STUBPRODUCTS" . "\n";
+ push(@upgradetable, $newline);
+ }
+
+ # searching for all older patches and languagepacks (defined in a extra file)
+
+ if (( $allvariableshashref->{'REMOVE_UPGRADE_CODE_FILE'} ) && ( ! $installer::globals::languagepack ))
+ {
+ my $filename = $allvariableshashref->{'REMOVE_UPGRADE_CODE_FILE'};
+ my $langpackcodefilename = $installer::globals::idttemplatepath . $installer::globals::separator . $filename;
+ if ( ! -f $langpackcodefilename ) { installer::exiter::exit_program("ERROR: Could not find file \"$langpackcodefilename\".", "create_upgrade_table"); }
+
+ my $filecontent = installer::files::read_file($langpackcodefilename);
+ my $newlines = analyze_file_for_upgrade_table($filecontent);
+
+ for ( my $i = 0; $i <= $#{$newlines}; $i++ ) { push(@upgradetable, ${$newlines}[$i]); }
+ }
+ }
+
+ # No upgrade for Beta versions!
+
+ if (( $allvariableshashref->{'PRODUCTEXTENSION'} eq "Beta" ) && ( ! $installer::globals::patch ) && ( ! $installer::globals::languagepack ))
+ {
+ @upgradetable = ();
+ installer::windows::idtglobal::write_idt_header(\@upgradetable, "upgrade");
+ my $infoline = "Beta product -> empty Upgrade table\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ # Saving the file
+
+ my $upgradetablename = $basedir . $installer::globals::separator . "Upgrade.idt";
+ installer::files::save_file($upgradetablename ,\@upgradetable);
+ my $infoline = "Created idt file: $upgradetablename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+}
+
+##############################################################
+# Reading the file with UpgradeCodes of old products,
+# that can be removed, if the user wants to remove them.
+##############################################################
+
+sub analyze_file_for_upgrade_table
+{
+ my ($filecontent) = @_;
+
+ my @allnewlines = ();
+
+ for ( my $i = 0; $i <= $#{$filecontent}; $i++ )
+ {
+ my $line = ${$filecontent}[$i];
+ if ( $line =~ /^\s*$/ ) { next; } # empty lines can be ignored
+ if ( $line =~ /^\s*\#/ ) { next; } # comment lines starting with a hash
+
+ if ( $line =~ /^(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)\t(.*)$/ ) { push(@allnewlines, $line); }
+ else { installer::exiter::exit_program("ERROR: Wrong syntax in file for upgrade table", "analyze_file_for_upgrade_table"); }
+ }
+
+ return \@allnewlines;
+}
+
+1;
diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm
new file mode 100644
index 000000000000..564a8cb71da7
--- /dev/null
+++ b/solenv/bin/modules/installer/worker.pm
@@ -0,0 +1,3436 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::worker;
+
+use Cwd;
+use File::Copy;
+use File::stat;
+use File::Temp qw(tmpnam);
+use installer::control;
+use installer::converter;
+use installer::existence;
+use installer::exiter;
+use installer::files;
+use installer::globals;
+use installer::logger;
+use installer::mail;
+use installer::pathanalyzer;
+use installer::scpzipfiles;
+use installer::scriptitems;
+use installer::sorter;
+use installer::systemactions;
+use installer::windows::language;
+
+#####################################################################
+# Unpacking all files ending with tar.gz in a specified directory
+#####################################################################
+
+sub unpack_all_targzfiles_in_directory
+{
+ my ( $directory ) = @_;
+
+ installer::logger::include_header_into_logfile("Unpacking tar.gz files:");
+
+ installer::logger::print_message( "... unpacking tar.gz files ... \n" );
+
+ my $localdirectory = $directory . $installer::globals::separator . "packages";
+ my $alltargzfiles = installer::systemactions::find_file_with_file_extension("tar.gz", $localdirectory);
+
+ for ( my $i = 0; $i <= $#{$alltargzfiles}; $i++ )
+ {
+ my $onefile = $localdirectory . $installer::globals::separator . ${$alltargzfiles}[$i];
+
+ my $systemcall = "cd $localdirectory; cat ${$alltargzfiles}[$i] \| gunzip \| tar -xf -";
+ $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+}
+
+#########################################
+# Copying installation sets to ship
+#########################################
+
+sub copy_install_sets_to_ship
+{
+ my ( $destdir, $shipinstalldir ) = @_;
+
+ installer::logger::include_header_into_logfile("Copying installation set to ship:");
+
+ my $dirname = $destdir;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$dirname);
+ $dirname = $dirname . "_inprogress";
+ my $localshipinstalldir = $shipinstalldir . $installer::globals::separator . $dirname;
+ if ( ! -d $localshipinstalldir ) { installer::systemactions::create_directory_structure($localshipinstalldir); }
+
+ # copy installation set to /ship ($localshipinstalldir)
+ installer::logger::print_message( "... copy installation set from " . $destdir . " to " . $localshipinstalldir . "\n" );
+ installer::systemactions::copy_complete_directory($destdir, $localshipinstalldir);
+
+ if (( ! $installer::globals::iswindowsbuild ) && ( $installer::globals::addjavainstaller ))
+ {
+ # Setting Unix rights for Java starter ("setup")
+ my $localcall = "chmod 775 $localshipinstalldir/setup \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+
+ # unpacking the tar.gz file for Solaris
+ if ( $installer::globals::issolarisbuild ) { unpack_all_targzfiles_in_directory($localshipinstalldir); }
+
+ $localshipinstalldir = installer::systemactions::rename_string_in_directory($localshipinstalldir, "_inprogress", "");
+
+ return $localshipinstalldir;
+}
+
+#########################################
+# Copying installation sets to ship
+#########################################
+
+sub link_install_sets_to_ship
+{
+ my ( $destdir, $shipinstalldir ) = @_;
+
+ installer::logger::include_header_into_logfile("Linking installation set to ship:");
+
+ my $infoline = "... destination directory: $shipinstalldir ...\n";
+ installer::logger::print_message( $infoline );
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( ! -d $shipinstalldir)
+ {
+ $infoline = "Creating directory: $shipinstalldir\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::systemactions::create_directory_structure($shipinstalldir);
+ $infoline = "Created directory: $shipinstalldir\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ my $dirname = $destdir;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$dirname);
+
+ my $localshipinstalldir = $shipinstalldir . $installer::globals::separator . $dirname;
+
+ # link installation set to /ship ($localshipinstalldir)
+ installer::logger::print_message( "... linking installation set from " . $destdir . " to " . $localshipinstalldir . "\n" );
+
+ my $systemcall = "ln -s $destdir $localshipinstalldir";
+
+ $returnvalue = system($systemcall);
+
+ $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not create link \"$localshipinstalldir\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Created link \"$localshipinstalldir\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return $localshipinstalldir;
+}
+
+#########################################
+# Create checksum file
+#########################################
+
+sub make_checksum_file
+{
+ my ( $filesref, $includepatharrayref ) = @_;
+
+ my @checksum = ();
+
+ my $checksumfileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$installer::globals::checksumfile, $includepatharrayref, 1);
+ if ( $$checksumfileref eq "" ) { installer::exiter::exit_program("ERROR: Could not find file $installer::globals::checksumfile !", "make_checksum_file"); }
+
+# # very slow on Windows
+# for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+# {
+# my $onefile = ${$filesref}[$i];
+# my $systemcall = "$$checksumfileref $onefile->{'sourcepath'} |";
+# open (CHECK, "$systemcall");
+# my $localchecksum = <CHECK>;
+# close (CHECK);
+# push(@checksum, $localchecksum);
+# }
+
+ my $systemcall = "$$checksumfileref";
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ $systemcall = $systemcall . " " . $onefile->{'sourcepath'}; # very very long systemcall
+
+ if ((( $i > 0 ) && ( $i%100 == 0 )) || ( $i == $#{$filesref} )) # limiting to 100 files
+ {
+ $systemcall = $systemcall . " \|";
+
+ my @localchecksum = ();
+ open (CHECK, "$systemcall");
+ @localchecksum = <CHECK>;
+ close (CHECK);
+
+ for ( my $j = 0; $j <= $#localchecksum; $j++ ) { push(@checksum, $localchecksum[$j]); }
+
+ $systemcall = "$$checksumfileref"; # reset the system call
+ }
+ }
+
+ return \@checksum;
+}
+
+#########################################
+# Saving the checksum file
+#########################################
+
+sub save_checksum_file
+{
+ my ($current_install_number, $installchecksumdir, $checksumfile) = @_;
+
+ my $numberedchecksumfilename = $installer::globals::checksumfilename;
+ $numberedchecksumfilename =~ s/\./_$current_install_number\./; # checksum.txt -> checksum_01.txt
+ installer::files::save_file($installchecksumdir . $installer::globals::separator . $numberedchecksumfilename, $checksumfile);
+}
+
+#################################################
+# Writing some global information into
+# the list of files without flag PATCH
+#################################################
+
+sub write_nopatchlist_header
+{
+ my ( $content ) = @_;
+
+ my @header = ();
+ my $infoline = "This is a list of files, that are defined in scp-projects without\n";
+ push(@header, $infoline);
+ $infoline = "flag \"PATCH\". Important: This does not mean in any case, that \n";
+ push(@header, $infoline);
+ $infoline = "this files are included into or excluded from a patch. \n\n";
+ push(@header, $infoline);
+ $infoline = "Exception Linux: A patch rpm is a complete rpm. This means that all \n";
+ push(@header, $infoline);
+ $infoline = "files are included into a patch rpm, if only one file of the rpm has the \n";
+ push(@header, $infoline);
+ $infoline = "style \"PATCH\". \n\n";
+ push(@header, $infoline);
+
+ for ( my $i = 0; $i <= $#header; $i++ ) { push(@{$content},$header[$i]); }
+}
+
+#################################################
+# Creating the content of the list of files
+# without flag PATCH.
+# All files are saved in
+# @{$installer::globals::nopatchfilecollector}
+#################################################
+
+sub create_nopatchlist
+{
+ my @content =();
+
+ write_nopatchlist_header(\@content);
+
+ for ( my $i = 0; $i <= $#{$installer::globals::nopatchfilecollector}; $i++ )
+ {
+ my $onefile = ${$installer::globals::nopatchfilecollector}[$i];
+ my $oneline = $onefile->{'destination'};
+ if ( $onefile->{'zipfilename'} ) { $oneline = $oneline . " (" . $onefile->{'zipfilename'} . ")"; }
+ $oneline = $oneline . "\n";
+ push(@content, $oneline);
+ }
+
+ return \@content;
+}
+
+#########################################
+# Saving the patchlist file
+#########################################
+
+sub save_patchlist_file
+{
+ my ($installlogdir, $patchlistfilename) = @_;
+
+ my $installpatchlistdir = installer::systemactions::create_directory_next_to_directory($installlogdir, "patchlist");
+ $patchlistfilename =~ s/log\_/patchfiles\_/;
+ $patchlistfilename =~ s/\.log/\.txt/;
+ installer::files::save_file($installpatchlistdir . $installer::globals::separator . $patchlistfilename, \@installer::globals::patchfilecollector);
+ installer::logger::print_message( "... creating patchlist file $patchlistfilename \n" );
+
+ if (( $installer::globals::patch ) && ( ! $installer::globals::creating_windows_installer_patch )) # only for non-Windows patches
+ {
+ $patchlistfilename =~ s/patchfiles\_/nopatchfiles\_/;
+ my $nopatchlist = create_nopatchlist();
+ installer::files::save_file($installpatchlistdir . $installer::globals::separator . $patchlistfilename, $nopatchlist);
+ installer::logger::print_message( "... creating patch exclusion file $patchlistfilename \n" );
+ }
+
+}
+
+###############################################################
+# Removing all directories of a special language
+# in the directory $basedir
+###############################################################
+
+sub remove_old_installation_sets
+{
+ my ($basedir) = @_;
+
+ installer::logger::print_message( "... removing old installation directories ...\n" );
+
+ my $removedir = $basedir;
+
+ if ( -d $removedir ) { installer::systemactions::remove_complete_directory($removedir, 1); }
+
+ # looking for non successful old installation sets
+
+ $removedir = $basedir . "_witherror";
+ if ( -d $removedir ) { installer::systemactions::remove_complete_directory($removedir, 1); }
+
+ $removedir = $basedir . "_inprogress";
+ if ( -d $removedir ) { installer::systemactions::remove_complete_directory($removedir, 1); }
+
+ # finally the $basedir can be created empty
+
+ if ( $installer::globals::localinstalldirset ) { installer::systemactions::create_directory_structure($basedir); }
+
+ installer::systemactions::create_directory($basedir);
+}
+
+###############################################################
+# Removing all non successful installation sets on ship
+###############################################################
+
+sub remove_old_ship_installation_sets
+{
+ my ($fulldir, $counter) = @_;
+
+ installer::logger::print_message( "... removing old installation directories ...\n" );
+
+ my $basedir = $fulldir;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$basedir);
+
+ # collecting all directories next to the new installation directory
+ my $alldirs = installer::systemactions::get_all_directories($basedir);
+
+ if ( $fulldir =~ /^\s*(.*?inprogress\-)(\d+)(.*?)\s*$/ )
+ {
+ my $pre_inprogress = $1; # $pre still contains "inprogress"
+ my $number = $2;
+ my $post = $3;
+ my $pre_witherror = $pre_inprogress;
+ $pre_witherror =~ s/inprogress/witherror/;
+
+ for ( my $i = 0; $i <= $#{$alldirs}; $i++ )
+ {
+ if ( ${$alldirs}[$i] eq $fulldir ) { next; } # do not delete the newly created directory
+
+ if ( ${$alldirs}[$i] =~ /^\s*\Q$pre_inprogress\E\d+\Q$post\E\s*$/ ) # removing old "inprogress" directories
+ {
+ installer::systemactions::remove_complete_directory(${$alldirs}[$i], 1);
+ }
+
+ if ( ${$alldirs}[$i] =~ /^\s*\Q$pre_witherror\E\d+\Q$post\E\s*$/ ) # removing old "witherror" directories
+ {
+ installer::systemactions::remove_complete_directory(${$alldirs}[$i], 1);
+ }
+ }
+ }
+}
+
+###############################################################
+# Creating the installation directory structure
+###############################################################
+
+sub create_installation_directory
+{
+ my ($shipinstalldir, $languagestringref, $current_install_number_ref) = @_;
+
+ my $installdir = "";
+
+ my $languageref = $languagestringref;
+
+ if ( $installer::globals::updatepack )
+ {
+ $installdir = $shipinstalldir;
+ installer::systemactions::create_directory_structure($installdir);
+ $$current_install_number_ref = installer::systemactions::determine_maximum_number($installdir, $languageref);
+ $installdir = installer::systemactions::rename_string_in_directory($installdir, "number", $$current_install_number_ref);
+ remove_old_ship_installation_sets($installdir);
+ }
+ else
+ {
+ $installdir = installer::systemactions::create_directories("install", $languageref);
+ installer::logger::print_message( "... creating installation set in $installdir ...\n" );
+ remove_old_installation_sets($installdir);
+ my $inprogressinstalldir = $installdir . "_inprogress";
+ installer::systemactions::rename_directory($installdir, $inprogressinstalldir);
+ $installdir = $inprogressinstalldir;
+ }
+
+ $installer::globals::saveinstalldir = $installdir; # saving directory globally, in case of exiting
+
+ return $installdir;
+}
+
+###############################################################
+# Analyzing and creating the log file
+###############################################################
+
+sub analyze_and_save_logfile
+{
+ my ($loggingdir, $installdir, $installlogdir, $allsettingsarrayref, $languagestringref, $current_install_number) = @_;
+
+ my $is_success = 1;
+ my $finalinstalldir = "";
+
+ installer::logger::print_message( "... checking log file " . $loggingdir . $installer::globals::logfilename . "\n" );
+
+ my $contains_error = installer::control::check_logfile(\@installer::globals::logfileinfo);
+
+ # Dependent from the success, the installation directory can be renamed and mails can be send.
+
+ if ( $contains_error )
+ {
+ my $errordir = installer::systemactions::rename_string_in_directory($installdir, "_inprogress", "_witherror");
+ if ( $installer::globals::updatepack ) { installer::mail::send_fail_mail($allsettingsarrayref, $languagestringref, $errordir); }
+ # Error output to STDERR
+ for ( my $j = 0; $j <= $#installer::globals::errorlogfileinfo; $j++ )
+ {
+ my $line = $installer::globals::errorlogfileinfo[$j];
+ $line =~ s/\s*$//g;
+ installer::logger::print_error( $line );
+ }
+ $is_success = 0;
+
+ $finalinstalldir = $errordir;
+ }
+ else
+ {
+ my $destdir = "";
+
+ if ( $installer::globals::updatepack )
+ {
+ if ( $installdir =~ /_download_inprogress/ ) { $destdir = installer::systemactions::rename_string_in_directory($installdir, "_download_inprogress", "_download"); }
+ elsif ( $installdir =~ /_jds_inprogress/ ) { $destdir = installer::systemactions::rename_string_in_directory($installdir, "_jds_inprogress", "_jds"); }
+ elsif ( $installdir =~ /_msp_inprogress/ ) { $destdir = installer::systemactions::rename_string_in_directory($installdir, "_msp_inprogress", "_msp"); }
+ else
+ {
+ if ( $installdir =~ /_packed/ ) { $destdir = installer::systemactions::rename_string_in_directory($installdir, "_inprogress", ""); }
+ else { $destdir = installer::systemactions::rename_string_in_directory($installdir, "_inprogress", "_packed"); }
+ }
+ installer::mail::send_success_mail($allsettingsarrayref, $languagestringref, $destdir);
+ }
+ else
+ {
+ $destdir = installer::systemactions::rename_string_in_directory($installdir, "_inprogress", "");
+ }
+
+ $finalinstalldir = $destdir;
+ }
+
+ # Saving the logfile in the log file directory and additionally in a log directory in the install directory
+
+ my $numberedlogfilename = $installer::globals::logfilename;
+ if ( $installer::globals::updatepack ) { $numberedlogfilename =~ s /log_/log_$current_install_number\_/; }
+ installer::logger::print_message( "... creating log file $numberedlogfilename \n" );
+ installer::files::save_file($loggingdir . $numberedlogfilename, \@installer::globals::logfileinfo);
+ installer::files::save_file($installlogdir . $installer::globals::separator . $numberedlogfilename, \@installer::globals::logfileinfo);
+
+ # Saving the checksumfile in a checksum directory in the install directory
+ # installer::worker::save_checksum_file($current_install_number, $installchecksumdir, $checksumfile);
+
+ # Saving the list of patchfiles in a patchlist directory in the install directory
+ if (( $installer::globals::patch ) || ( $installer::globals::creating_windows_installer_patch )) { installer::worker::save_patchlist_file($installlogdir, $numberedlogfilename); }
+
+ if ( $installer::globals::creating_windows_installer_patch ) { $installer::globals::creating_windows_installer_patch = 0; }
+
+ # Exiting the packaging process, if an error occured.
+ # This is important, to get an error code "-1", if an error was found in the log file,
+ # that did not break the packaging process
+
+ if ( ! $is_success) { installer::exiter::exit_program("ERROR: Found an error in the logfile. Packaging failed.", "analyze_and_save_logfile"); }
+
+ return ($is_success, $finalinstalldir);
+}
+
+###############################################################
+# Analyzing and creating the log file
+###############################################################
+
+sub save_logfile_after_linking
+{
+ my ($loggingdir, $installlogdir, $current_install_number) = @_;
+
+ # Saving the logfile in the log file directory and additionally in a log directory in the install directory
+ my $numberedlogfilename = $installer::globals::logfilename;
+ if ( $installer::globals::updatepack ) { $numberedlogfilename =~ s /log_/log_$current_install_number\_/; }
+ installer::logger::print_message( "... creating log file $numberedlogfilename \n" );
+ installer::files::save_file($loggingdir . $numberedlogfilename, \@installer::globals::logfileinfo);
+ installer::files::save_file($installlogdir . $installer::globals::separator . $numberedlogfilename, \@installer::globals::logfileinfo);
+}
+
+###############################################################
+# Removing all directories that are saved in the
+# global directory @installer::globals::removedirs
+###############################################################
+
+sub clean_output_tree
+{
+ installer::logger::print_message( "... cleaning the output tree ...\n" );
+
+ for ( my $i = 0; $i <= $#installer::globals::removedirs; $i++ )
+ {
+ if ( -d $installer::globals::removedirs[$i] )
+ {
+ installer::logger::print_message( "... removing directory $installer::globals::removedirs[$i] ...\n" );
+ installer::systemactions::remove_complete_directory($installer::globals::removedirs[$i], 1);
+ }
+ }
+
+ # Last try to remove the ship test directory
+
+ if ( $installer::globals::shiptestdirectory )
+ {
+ if ( -d $installer::globals::shiptestdirectory )
+ {
+ my $infoline = "Last try to remove $installer::globals::shiptestdirectory . \n";
+ push(@installer::globals::logfileinfo, $infoline);
+ my $systemcall = "rmdir $installer::globals::shiptestdirectory";
+ my $returnvalue = system($systemcall);
+ }
+ }
+}
+
+###############################################################
+# Removing all directories that are saved in the
+# global directory @installer::globals::jdsremovedirs
+###############################################################
+
+sub clean_jds_temp_dirs
+{
+ installer::logger::print_message( "... cleaning jds directories ...\n" );
+
+ for ( my $i = 0; $i <= $#installer::globals::jdsremovedirs; $i++ )
+ {
+ if ( -d $installer::globals::jdsremovedirs[$i] )
+ {
+ installer::logger::print_message( "... removing directory $installer::globals::jdsremovedirs[$i] ...\n" );
+ installer::systemactions::remove_complete_directory($installer::globals::jdsremovedirs[$i], 1);
+ }
+ }
+}
+
+###########################################################
+# Copying a reference array
+###########################################################
+
+sub copy_array_from_references
+{
+ my ( $arrayref ) = @_;
+
+ my @newarray = ();
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ push(@newarray, ${$arrayref}[$i]);
+ }
+
+ return \@newarray;
+}
+
+###########################################################
+# Copying a reference hash
+###########################################################
+
+sub copy_hash_from_references
+{
+ my ($hashref) = @_;
+
+ my %newhash = ();
+ my $key;
+
+ foreach $key (keys %{$hashref})
+ {
+ $newhash{$key} = $hashref->{$key};
+ }
+
+ return \%newhash;
+}
+
+###########################################################
+# Setting one language in the language independent
+# array of include pathes with $(LANG)
+###########################################################
+
+sub get_language_specific_include_pathes
+{
+ my ( $patharrayref, $onelanguage ) = @_;
+
+ my @patharray = ();
+
+ for ( my $i = 0; $i <= $#{$patharrayref}; $i++ )
+ {
+ my $line = ${$patharrayref}[$i];
+ $line =~ s/\$\(LANG\)/$onelanguage/g;
+ push(@patharray ,$line);
+ }
+
+ return \@patharray;
+}
+
+##############################################################
+# Returning the first item with a defined flag
+##############################################################
+
+sub return_first_item_with_special_flag
+{
+ my ($itemsref, $flag) = @_;
+
+ my $firstitem = "";
+
+ for ( my $i = 0; $i <= $#{$itemsref}; $i++ )
+ {
+ my $oneitem = ${$itemsref}[$i];
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'} };
+
+ if ( $styles =~ /\b$flag\b/ )
+ {
+ $firstitem = $oneitem;
+ last;
+ }
+ }
+
+ return $firstitem;
+}
+
+##############################################################
+# Collecting all items with a defined flag
+##############################################################
+
+sub collect_all_items_with_special_flag
+{
+ my ($itemsref, $flag) = @_;
+
+ my @allitems = ();
+
+ for ( my $i = 0; $i <= $#{$itemsref}; $i++ )
+ {
+ my $oneitem = ${$itemsref}[$i];
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'} };
+
+ if ( $styles =~ /\b$flag\b/ )
+ {
+ push( @allitems, $oneitem );
+ }
+ }
+
+ return \@allitems;
+}
+
+##############################################################
+# Collecting all files without patch flag in
+# $installer::globals::nopatchfilecollector
+##############################################################
+
+sub collect_all_files_without_patch_flag
+{
+ my ($filesref) = @_;
+
+ my $newfiles = collect_all_items_without_special_flag($filesref, "PATCH");
+
+ for ( my $i = 0; $i <= $#{$newfiles}; $i++ ) { push(@{$installer::globals::nopatchfilecollector}, ${$newfiles}[$i]); }
+}
+
+##############################################################
+# Collecting all items without a defined flag
+##############################################################
+
+sub collect_all_items_without_special_flag
+{
+ my ($itemsref, $flag) = @_;
+
+ my @allitems = ();
+
+ for ( my $i = 0; $i <= $#{$itemsref}; $i++ )
+ {
+ my $oneitem = ${$itemsref}[$i];
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'} };
+
+ if ( !( $styles =~ /\b$flag\b/ ))
+ {
+ push( @allitems, $oneitem );
+ }
+ }
+
+ return \@allitems;
+}
+
+##############################################################
+# Removing all items with a defined flag from collector
+##############################################################
+
+sub remove_all_items_with_special_flag
+{
+ my ($itemsref, $flag) = @_;
+
+ my @allitems = ();
+
+ for ( my $i = 0; $i <= $#{$itemsref}; $i++ )
+ {
+ my $oneitem = ${$itemsref}[$i];
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'} };
+ if ( $styles =~ /\b$flag\b/ )
+ {
+ my $infoline = "Attention: Removing from collector: $oneitem->{'Name'} !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ if ( $flag eq "BINARYTABLE_ONLY" ) { push(@installer::globals::binarytableonlyfiles, $oneitem); }
+ next;
+ }
+ push( @allitems, $oneitem );
+ }
+
+ return \@allitems;
+}
+
+###########################################################
+# Mechanism for simple installation without packing
+###########################################################
+
+sub install_simple ($$$$$$)
+{
+ my ($packagename, $languagestring, $directoriesarray, $filesarray, $linksarray, $unixlinksarray) = @_;
+
+ # locate GNU cp on the system
+ my $gnucp = 'cp';
+ if ( $ENV{'GNUCOPY'} ) { $gnucp = $ENV{'GNUCOPY'}; }
+ my $copyopts = '-af';
+ $copyopts = '-PpRf' unless ( $ENV{'GNUCOPY'} ); # if not gnucopy, assume POSIX copy
+
+ installer::logger::print_message( "... installing module $packagename ...\n" );
+
+ my $destdir = $installer::globals::destdir;
+ my @lines = ();
+
+ installer::logger::print_message( "DestDir: $destdir \n" );
+ installer::logger::print_message( "Rootpath: $installer::globals::rootpath \n" );
+
+ `mkdir -p $destdir` if $destdir ne "";
+ `mkdir -p $destdir$installer::globals::rootpath`;
+
+ # Create Directories
+ for ( my $i = 0; $i <= $#{$directoriesarray}; $i++ )
+ {
+ my $onedir = ${$directoriesarray}[$i];
+ my $dir = "";
+
+ if ( $onedir->{'Dir'} ) { $dir = $onedir->{'Dir'}; }
+
+ if ((!($dir =~ /\bPREDEFINED_/ )) || ( $dir =~ /\bPREDEFINED_PROGDIR\b/ ))
+ {
+ # printf "mkdir $destdir$onedir->{'HostName'}\n";
+ mkdir $destdir . $onedir->{'HostName'};
+ push @lines, "%dir " . $onedir->{'HostName'} . "\n";
+ }
+ }
+
+ for ( my $i = 0; $i <= $#{$filesarray}; $i++ )
+ {
+ my $onefile = ${$filesarray}[$i];
+ my $unixrights = $onefile->{'UnixRights'};
+ my $destination = $onefile->{'destination'};
+ my $sourcepath = $onefile->{'sourcepath'};
+
+ # This is necessary to install SDK that includes files with $ in its name
+ # Otherwise, the following shell commands does not work and the file list
+ # is not correct
+ $destination =~ s/\$\$/\$/;
+ $sourcepath =~ s/\$\$/\$/;
+
+ push @lines, "$destination\n";
+ # printf "cp $sourcepath $destdir$destination\n";
+ copy ("$sourcepath", "$destdir$destination") || die "Can't copy file: $sourcepath -> $destdir$destination $!";
+ my $sourcestat = stat($sourcepath);
+ utime ($sourcestat->atime, $sourcestat->mtime, "$destdir$destination");
+ chmod (oct($unixrights), "$destdir$destination") || die "Can't change permissions: $!";
+ push @lines, "$destination\n";
+ }
+
+ for ( my $i = 0; $i <= $#{$linksarray}; $i++ )
+ {
+ my $onelink = ${$linksarray}[$i];
+ my $destination = $onelink->{'destination'};
+ my $destinationfile = $onelink->{'destinationfile'};
+
+ # print "link $destinationfile -> $destdir$destination\n";
+ symlink ("$destinationfile", "$destdir$destination") || die "Can't create symlink: $!";
+ push @lines, "$destination\n";
+ }
+
+ for ( my $i = 0; $i <= $#{$unixlinksarray}; $i++ )
+ {
+ my $onelink = ${$unixlinksarray}[$i];
+ my $target = $onelink->{'Target'};
+ my $destination = $onelink->{'destination'};
+
+ # print "Unix link $target -> $destdir$destination\n";
+ `ln -sf '$target' '$destdir$destination'`;
+ push @lines, "$destination\n";
+ }
+
+ if ( $destdir ne "" )
+ {
+ my $filelist;
+ my $fname = $installer::globals::destdir . "/$packagename";
+ if ($installer::globals::languagepack) { $fname .= ".$languagestring"; }
+ open ($filelist, ">$fname") || die "Can't open $fname: $!";
+ print $filelist @lines;
+ close ($filelist);
+ }
+
+}
+
+###########################################################
+# Adding shellnew files into files collector for
+# user installation
+###########################################################
+
+sub add_shellnewfile_into_filesarray
+{
+ my ($filesref, $onefile, $inffile) = @_;
+
+ my %shellnewfile = ();
+ my $shellnewfileref = \%shellnewfile;
+
+ installer::converter::copy_item_object($inffile, $shellnewfileref);
+
+ $shellnewfileref->{'Name'} = $onefile->{'Name'};
+ $shellnewfileref->{'sourcepath'} = $onefile->{'sourcepath'};
+ $shellnewfileref->{'gid'} = $onefile->{'gid'} . "_Userinstall";
+
+ # the destination has to be adapted
+ my $destination = $inffile->{'destination'};
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
+ $destination = $destination . $onefile->{'Name'};
+ $shellnewfileref->{'destination'} = $destination;
+
+ # add language specific inffile into filesarray
+ push(@{$filesref}, $shellnewfileref);
+}
+
+###########################################################
+# Replacing one placehoder in template file
+###########################################################
+
+sub replace_in_template_file
+{
+ my ($templatefile, $placeholder, $newstring) = @_;
+
+ for ( my $i = 0; $i <= $#{$templatefile}; $i++ )
+ {
+ ${$templatefile}[$i] =~ s/\Q$placeholder\E/$newstring/g;
+ }
+}
+
+###########################################################
+# Replacing one placehoder with an array in template file
+###########################################################
+
+sub replace_array_in_template_file
+{
+ my ($templatefile, $placeholder, $arrayref) = @_;
+
+ for ( my $i = 0; $i <= $#{$templatefile}; $i++ )
+ {
+ if ( ${$templatefile}[$i] =~ /\Q$placeholder\E/ )
+ {
+ my @return = splice(@{$templatefile}, $i, 1, @{$arrayref});
+ }
+ }
+}
+
+###########################################################
+# Collecting all modules from registry items
+###########################################################
+
+sub collect_all_modules
+{
+ my ($registryitemsref) = @_;
+
+ my @allmodules = ();
+
+ for ( my $i = 0; $i <= $#{$registryitemsref}; $i++ )
+ {
+ $registryitem = ${$registryitemsref}[$i];
+ my $module = $registryitem->{'ModuleID'};
+
+ if ( ! installer::existence::exists_in_array($module, \@allmodules) )
+ {
+ push(@allmodules, $module);
+ }
+ }
+
+ return \@allmodules;
+}
+
+###########################################################
+# Changing the content of the inf file
+###########################################################
+
+sub write_content_into_inf_file
+{
+ my ($templatefile, $filesref, $registryitemsref, $folderref, $folderitemsref, $modulesref, $onelanguage, $inffile, $firstlanguage, $allvariableshashref) = @_;
+
+ # First part: Shellnew files
+ # SHELLNEWFILESPLACEHOLDER
+
+ my $rootmodule = 0;
+ # inf files can be assigned to "gid_Module_Root_Files_2"
+ if ( $inffile->{'modules'} =~ /Module_Root/i ) { $rootmodule = 1; }
+
+ if ( $rootmodule )
+ {
+ my $shellnewstring = "";
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ my $directory = $onefile->{'Dir'};
+
+ if ( $directory =~ /\bPREDEFINED_OSSHELLNEWDIR\b/ )
+ {
+ $shellnewstring = $shellnewstring . $onefile->{'Name'} . "\n";
+ if (( $firstlanguage ) && ( ! $installer::globals::shellnewfilesadded )) { add_shellnewfile_into_filesarray($filesref, $onefile, $inffile); }
+ }
+ }
+
+ $shellnewstring =~ s/\s*$//;
+ replace_in_template_file($templatefile, "SHELLNEWFILESPLACEHOLDER", $shellnewstring);
+
+ $installer::globals::shellnewfilesadded = 1;
+ }
+
+ # Second part: Start menu entries
+
+ # The OfficeMenuFolder is defined as: $productname . " " . $productversion;
+
+ my $productname = $allvariableshashref->{'PRODUCTNAME'};
+ my $productversion = $allvariableshashref->{'PRODUCTVERSION'};
+ my $productkey = $productname . " " . $productversion;
+
+ replace_in_template_file($templatefile, "OFFICEFOLDERPLACEHOLDER", $productkey);
+
+ # Setting name target and infotip for all applications
+
+ for ( my $i = 0; $i <= $#{$folderitemsref}; $i++ )
+ {
+ my $folderitem = ${$folderitemsref}[$i];
+
+ my $styles = "";
+ if ( $folderitem->{'Styles'} ) { $styles = $folderitem->{'Styles'}; }
+ if ( $styles =~ /\bNON_ADVERTISED\b/ ) { next; } # no entry for non-advertised shortcuts
+
+ if (( ! $folderitem->{'ismultilingual'} ) || (( $folderitem->{'ismultilingual'} ) && ( $folderitem->{'specificlanguage'} eq $onelanguage )))
+ {
+ my $gid = $folderitem->{'gid'};
+ my $app = $gid;
+ $app =~ s/gid_Folderitem_//;
+ $app = uc($app);
+
+ my $name = $folderitem->{'Name'};
+ my $placeholder = "PLACEHOLDER_FOLDERITEM_NAME_" . $app;
+ replace_in_template_file($templatefile, $placeholder, $name);
+
+ my $tooltip = $folderitem->{'Tooltip'};
+ $placeholder = "PLACEHOLDER_FOLDERITEM_TOOLTIP_" . $app;
+ replace_in_template_file($templatefile, $placeholder, $tooltip);
+
+ my $executablegid = $folderitem->{'FileID'};
+ my $exefile = installer::existence::get_specified_file($filesref, $executablegid);
+ my $exefilename = $exefile->{'Name'};
+ $placeholder = "PLACEHOLDER_FOLDERITEM_TARGET_" . $app;
+ replace_in_template_file($templatefile, $placeholder, $exefilename);
+ }
+ }
+
+ # Third part: Windows registry entries
+
+ # collecting all modules
+
+ my $allmodules = collect_all_modules($registryitemsref);
+
+ my @registryitems = ();
+ my $allsectionsstring = "";
+
+ for ( my $j = 0; $j <= $#{$allmodules}; $j++ )
+ {
+ my $moduleid = ${$allmodules}[$j];
+
+ my $inffilemodule = $inffile->{'modules'};
+ # inf files can be assigned to "gid_Module_Root_Files_2", but RegistryItems to "gid_Module_Root"
+ if ( $inffilemodule =~ /Module_Root/i ) { $inffilemodule = $installer::globals::rootmodulegid; }
+
+ if ( ! ( $moduleid eq $inffilemodule )) { next; }
+
+ my $shortmodulename = $moduleid;
+ $shortmodulename =~ s/gid_Module_//;
+ my $sectionname = "InstRegKeys." . $shortmodulename;
+ $allsectionsstring = $allsectionsstring . $sectionname . ",";
+ my $sectionheader = "\[" . $sectionname . "\]" . "\n";
+ push(@registryitems, $sectionheader);
+
+ for ( my $i = 0; $i <= $#{$registryitemsref}; $i++ )
+ {
+ my $registryitem = ${$registryitemsref}[$i];
+
+ if ( ! ( $registryitem->{'ModuleID'} eq $moduleid )) { next; }
+
+ if (( ! $registryitem->{'ismultilingual'} ) || (( $registryitem->{'ismultilingual'} ) && ( $registryitem->{'specificlanguage'} eq $onelanguage )))
+ {
+ # Syntax: HKCR,".bau",,,"soffice.StarConfigFile.6"
+
+ my $regroot = "";
+ my $parentid = "";
+ if ( $registryitem->{'ParentID'} ) { $parentid = $registryitem->{'ParentID'}; }
+ if ( $parentid eq "PREDEFINED_HKEY_CLASSES_ROOT" ) { $regroot = "HKCR"; }
+ if ( $parentid eq "PREDEFINED_HKEY_LOCAL_MACHINE" ) { $regroot = "HKCU"; }
+
+ my $subkey = "";
+ if ( $registryitem->{'Subkey'} ) { $subkey = $registryitem->{'Subkey'}; }
+ if ( $subkey ne "" ) { $subkey = "\"" . $subkey . "\""; }
+
+ my $valueentryname = "";
+ if ( $registryitem->{'Name'} ) { $valueentryname = $registryitem->{'Name'}; }
+ if ( $valueentryname ne "" ) { $valueentryname = "\"" . $valueentryname . "\""; }
+
+ my $flag = "";
+
+ my $value = "";
+ if ( $registryitem->{'Value'} ) { $value = $registryitem->{'Value'}; }
+ if ( $value =~ /\<progpath\>/ ) { $value =~ s/\\\"/\"\"/g; } # Quoting for INF is done by double ""
+ $value =~ s/\\\"/\"/g; # no more masquerading of '"'
+ $value =~ s/\<progpath\>/\%INSTALLLOCATION\%/g;
+ if ( $value ne "" ) { $value = "\"" . $value . "\""; }
+
+ my $oneline = $regroot . "," . $subkey . "," . $valueentryname . "," . $flag . "," . $value . "\n";
+
+ push(@registryitems, $oneline);
+ }
+ }
+
+ push(@registryitems, "\n"); # empty line after each section
+ }
+
+ # replacing the $allsectionsstring
+ $allsectionsstring =~ s/\,\s*$//;
+ replace_in_template_file($templatefile, "ALLREGISTRYSECTIONSPLACEHOLDER", $allsectionsstring);
+
+ # replacing the placeholder for all registry keys
+ replace_array_in_template_file($templatefile, "REGISTRYKEYSPLACEHOLDER", \@registryitems);
+
+}
+
+###########################################################
+# Creating inf files for local user system integration
+###########################################################
+
+sub create_inf_file
+{
+ my ($filesref, $registryitemsref, $folderref, $folderitemsref, $modulesref, $languagesarrayref, $languagestringref, $allvariableshashref) = @_;
+
+ # collecting all files with flag INFFILE
+
+ my $inf_files = collect_all_items_with_special_flag($filesref ,"INFFILE");
+
+ if ( $#{$inf_files} > -1 )
+ {
+ # create new language specific inffile
+ installer::logger::include_header_into_logfile("Creating inf files:");
+
+ my $infdirname = "inffiles";
+ my $infdir = installer::systemactions::create_directories($infdirname, $languagestringref);
+
+ my $infoline = "Number of inf files: $#{$inf_files} + 1 \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # there are inffiles for all modules
+
+ for ( my $i = 0; $i <= $#{$inf_files}; $i++ )
+ {
+ my $inffile = ${$inf_files}[$i];
+ my $inf_file_name = $inffile->{'Name'};
+
+ my $templatefilename = $inffile->{'sourcepath'};
+
+ if ( ! -f $templatefilename ) { installer::exiter::exit_program("ERROR: Could not find file $templatefilename !", "create_inf_file"); }
+
+ # iterating over all languages
+
+ for ( my $j = 0; $j <= $#{$languagesarrayref}; $j++ ) # iterating over all languages
+ {
+ my $firstlanguage = 0;
+ if ( $j == 0 ) { $firstlanguage = 1; }
+
+ my $onelanguage = ${$languagesarrayref}[$j];
+
+ $infoline = "Templatefile: $inf_file_name, Language: $onelanguage \n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $templatefile = installer::files::read_file($templatefilename);
+
+ my $linesbefore = $#{$templatefile};
+
+ write_content_into_inf_file($templatefile, $filesref, $registryitemsref, $folderref, $folderitemsref, $modulesref, $onelanguage, $inffile, $firstlanguage, $allvariableshashref);
+
+ $infoline = "Lines change: From $linesbefore to $#{$templatefile}.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # rename language specific inffile
+ my $language_inf_file_name = $inf_file_name;
+ my $windowslanguage = installer::windows::language::get_windows_language($onelanguage);
+ $language_inf_file_name =~ s/\.inf/_$windowslanguage\.inf/;
+
+ my $sourcepath = $infdir . $installer::globals::separator . $language_inf_file_name;
+ installer::files::save_file($sourcepath, $templatefile);
+
+ $infoline = "Saving file: $sourcepath\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # creating new file object
+
+ my %languageinffile = ();
+ my $languageinifileref = \%languageinffile;
+
+ if ( $j < $#{$languagesarrayref} ) { installer::converter::copy_item_object($inffile, $languageinifileref); }
+ else { $languageinifileref = $inffile; }
+
+ $languageinifileref->{'Name'} = $language_inf_file_name;
+ $languageinifileref->{'sourcepath'} = $sourcepath;
+ # destination and gid also have to be adapted
+ $languageinifileref->{'gid'} = $languageinifileref->{'gid'} . "_" . $onelanguage;
+ my $destination = $languageinifileref->{'destination'};
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
+ $destination = $destination . $language_inf_file_name;
+ $languageinifileref->{'destination'} = $destination;
+
+ # add language specific inffile into filesarray
+ if ( $j < $#{$languagesarrayref} ) { push(@{$filesref}, $languageinifileref); }
+ }
+ }
+ }
+}
+
+###########################################################
+# Selecting patch items
+###########################################################
+
+sub select_patch_items
+{
+ my ( $itemsref, $itemname ) = @_;
+
+ installer::logger::include_header_into_logfile("Selecting items for patches. Item: $itemname");
+
+ my @itemsarray = ();
+
+ for ( my $i = 0; $i <= $#{$itemsref}; $i++ )
+ {
+ my $oneitem = ${$itemsref}[$i];
+
+ my $name = $oneitem->{'Name'};
+ if (( $name =~ /\bLICENSE/ ) || ( $name =~ /\bREADME/ ))
+ {
+ push(@itemsarray, $oneitem);
+ next;
+ }
+
+ # Items with style "PATCH" have to be included into the patch
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
+ if ( $styles =~ /\bPATCH\b/ ) { push(@itemsarray, $oneitem); }
+ }
+
+ return \@itemsarray;
+}
+
+###########################################################
+# Selecting patch items
+###########################################################
+
+sub select_patch_items_without_name
+{
+ my ( $itemsref, $itemname ) = @_;
+
+ installer::logger::include_header_into_logfile("Selecting RegistryItems for patches");
+
+ my @itemsarray = ();
+
+ for ( my $i = 0; $i <= $#{$itemsref}; $i++ )
+ {
+ my $oneitem = ${$itemsref}[$i];
+
+ # Items with style "PATCH" have to be included into the patch
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
+ if ( $styles =~ /\bPATCH\b/ ) { push(@itemsarray, $oneitem); }
+ }
+
+ return \@itemsarray;
+}
+
+###########################################################
+# Selecting patch items
+###########################################################
+
+sub select_langpack_items
+{
+ my ( $itemsref, $itemname ) = @_;
+
+ installer::logger::include_header_into_logfile("Selecting RegistryItems for Language Packs");
+
+ my @itemsarray = ();
+
+ for ( my $i = 0; $i <= $#{$itemsref}; $i++ )
+ {
+ my $oneitem = ${$itemsref}[$i];
+
+ # Items with style "LANGUAGEPACK" have to be included into the patch
+ my $styles = "";
+ if ( $oneitem->{'Styles'} ) { $styles = $oneitem->{'Styles'}; }
+ if (( $styles =~ /\bLANGUAGEPACK\b/ ) || ( $styles =~ /\bFORCELANGUAGEPACK\b/ )) { push(@itemsarray, $oneitem); }
+ }
+
+ return \@itemsarray;
+}
+
+###########################################################
+# Searching if LICENSE and README, which are not removed
+# in select_patch_items are really needed for the patch.
+# If not, they are removed now.
+###########################################################
+
+sub analyze_patch_files
+{
+ my ( $filesref ) = @_;
+
+ installer::logger::include_header_into_logfile("Analyzing patch files");
+
+ my @filesarray = ();
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ my $styles = "";
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+ if ( !( $styles =~ /\bPATCH\b/) ) { next; } # removing all files without flag PATCH (LICENSE, README, ...)
+
+ if ( $installer::globals::iswindowsbuild )
+ {
+ # all files of the Windows patch belong to the root module
+ $onefile->{'modules'} = $installer::globals::rootmodulegid;
+ }
+
+ push(@filesarray, $onefile);
+ }
+
+ return \@filesarray;
+}
+
+###########################################################
+# Sorting an array
+###########################################################
+
+sub sort_array
+{
+ my ( $arrayref ) = @_;
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ my $under = ${$arrayref}[$i];
+
+ for ( my $j = $i + 1; $j <= $#{$arrayref}; $j++ )
+ {
+ my $over = ${$arrayref}[$j];
+
+ if ( $under gt $over)
+ {
+ ${$arrayref}[$i] = $over;
+ ${$arrayref}[$j] = $under;
+ $under = $over;
+ }
+ }
+ }
+}
+
+###########################################################
+# Renaming linux files with flag LINUXLINK
+###########################################################
+
+sub prepare_linuxlinkfiles
+{
+ my ( $filesref ) = @_;
+
+ @installer::globals::linuxlinks = (); # empty this array, because it could be already used
+ @installer::globals::linuxpatchfiles = (); # empty this array, because it could be already used
+ @installer::globals::allfilessav = (); # empty this array, because it could be already used. Required for forced links
+
+ my @filesarray = ();
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+ my %linkfilehash = ();
+ my $linkfile = \%linkfilehash;
+ installer::converter::copy_item_object($onefile, $linkfile);
+
+ my $ispatchfile = 0;
+ my $styles = "";
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+ if ( $styles =~ /\bPATCH\b/ ) { $ispatchfile = 1; }
+
+ # Collecting all files for the mechanism with forced links
+ # Saving a copy
+ my %copyfilehash = ();
+ my $copyfile = \%copyfilehash;
+ installer::converter::copy_item_object($onefile, $copyfile);
+ push( @installer::globals::allfilessav, $copyfile);
+
+ my $original_destination = $onefile->{'destination'};
+ # $onefile->{'destination'} is used in the epm list file. This value can be changed now!
+
+ if ( $ispatchfile ) { $onefile->{'destination'} = $onefile->{'destination'} . "\.$installer::globals::linuxlibrarypatchlevel"; }
+ else { $onefile->{'destination'} = $onefile->{'destination'} . "\.$installer::globals::linuxlibrarybaselevel"; }
+
+ my $infoline = "LINUXLINK: Changing file destination from $original_destination to $onefile->{'destination'} !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # all files without PATCH flag are included into the RPM
+ if ( ! $ispatchfile ) { push( @filesarray, $onefile); }
+ else { push( @installer::globals::linuxpatchfiles, $onefile); }
+
+ # Preparing the collector for the links
+ # Setting the new file name as destination of the link
+ my $linkdestination = $linkfile->{'Name'};
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$linkdestination);
+ if ( $ispatchfile ) { $linkfile->{'destinationfile'} = $linkdestination . "\.$installer::globals::linuxlibrarypatchlevel"; }
+ else { $linkfile->{'destinationfile'} = $linkdestination . "\.$installer::globals::linuxlibrarybaselevel"; }
+ push( @installer::globals::linuxlinks, $linkfile );
+
+ $infoline = "LINUXLINK: Created link: $linkfile->{'destination'} pointing to $linkfile->{'destinationfile'} !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return \@filesarray;
+}
+
+###########################################################
+# Adding links into "u-RPMs", that have the flag
+# FORCE_INTO_UPDATE_PACKAGE
+# This is only relevant for Linux
+###########################################################
+
+sub prepare_forced_linuxlinkfiles
+{
+ my ( $linksref ) = @_;
+
+ my @linksarray = ();
+
+ for ( my $i = 0; $i <= $#{$linksref}; $i++ )
+ {
+ my $onelink = ${$linksref}[$i];
+
+ my $isforcedlink = 0;
+ my $styles = "";
+ if ( $onelink->{'Styles'} ) { $styles = $onelink->{'Styles'}; }
+ if ( $styles =~ /\bFORCE_INTO_UPDATE_PACKAGE\b/ ) { $isforcedlink = 1; }
+
+ if ( $isforcedlink )
+ {
+ my $fileid = "";
+
+ if ( $onelink->{'ShortcutID'} )
+ {
+ $fileid = $onelink->{'ShortcutID'};
+
+ my $searchedlinkfile = find_file_by_id($linksref, $fileid);
+
+ # making a copy!
+ my %linkfilehash = ();
+ my $linkfile = \%linkfilehash;
+ installer::converter::copy_item_object($searchedlinkfile, $linkfile);
+
+ $linkfile->{'Name'} = $onelink->{'Name'};
+ $linkfile->{'destinationfile'} = $linkfile->{'destination'};
+ my $linkdestination = $linkfile->{'destinationfile'};
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$linkdestination);
+ $linkfile->{'destinationfile'} = $linkdestination;
+
+ my $localdestination = $linkfile->{'destination'};
+ # Getting the path
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$localdestination);
+ $localdestination =~ s/\Q$installer::globals::separator\E\s*$//;
+ $linkfile->{'destination'} = $localdestination . $installer::globals::separator . $onelink->{'Name'};
+
+ $infoline = "Forced link into update file: $linkfile->{'destination'} pointing to $linkfile->{'destinationfile'} !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # The file, defined by the link, has to be included into the
+ # link array @installer::globals::linuxlinks
+ push( @installer::globals::linuxlinks, $linkfile );
+ }
+
+ if ( $onelink->{'FileID'} )
+ {
+ $fileid = $onelink->{'FileID'};
+
+ my $searchedlinkfile = find_file_by_id(\@installer::globals::allfilessav, $fileid);
+
+ # making a copy!
+ my %linkfilehash = ();
+ my $linkfile = \%linkfilehash;
+ installer::converter::copy_item_object($searchedlinkfile, $linkfile);
+
+ $linkfile->{'Name'} = $onelink->{'Name'};
+ $linkfile->{'destinationfile'} = $linkfile->{'destination'};
+ my $linkdestination = $linkfile->{'destinationfile'};
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$linkdestination);
+ $linkfile->{'destinationfile'} = $linkdestination;
+
+ my $localdestination = $linkfile->{'destination'};
+ # Getting the path
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$localdestination);
+ $localdestination =~ s/\Q$installer::globals::separator\E\s*$//;
+ $linkfile->{'destination'} = $localdestination . $installer::globals::separator . $onelink->{'Name'};
+
+ $infoline = "Forced link into update file: $linkfile->{'destination'} pointing to $linkfile->{'destinationfile'} !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # The file, defined by the link, has to be included into the
+ # link array @installer::globals::linuxlinks
+ push( @installer::globals::linuxlinks, $linkfile );
+ }
+
+ if ( $fileid eq "" ) { installer::exiter::exit_program("ERROR: No FileID assigned to forced link $onelink->{'gid'} !", "prepare_forced_linuxlinkfiles"); }
+
+ }
+ else
+ {
+ # Links with flag FORCE_INTO_UPDATE_PACKAGE are forced into "u"-RPM. All other
+ # links are included into the non-"u"-package.
+ push( @linksarray, $onelink );
+ }
+ }
+
+ return \@linksarray;
+}
+
+###########################################################
+# reorganizing the patchfile content,
+# sorting for directory to decrease the file size
+###########################################################
+
+sub reorg_patchfile
+{
+ my ($patchfiles, $patchfiledirectories) = @_;
+
+ my @patchfilesarray = ();
+ my $line = "";
+ my $directory = "";
+
+ # iterating over all directories, writing content into new patchfiles list
+
+ for ( my $i = 0; $i <= $#{$patchfiledirectories}; $i++ )
+ {
+ $directory = ${$patchfiledirectories}[$i];
+ $line = "[" . $directory . "]" . "\n";
+ push(@patchfilesarray, $line);
+
+ for ( my $j = 0; $j <= $#{$patchfiles}; $j++ )
+ {
+ # "\tXXXXX\t" . $olddestination . "\n";
+ if ( ${$patchfiles}[$j] =~ /^\s*(.*?)\s*\tXXXXX\t\Q$directory\E\s*$/ )
+ {
+ $line = $1 . "\n";
+ push(@patchfilesarray, $line);
+ }
+ }
+ }
+
+ return \@patchfilesarray;
+}
+
+###########################################################
+# One special file has to be the last in patchfile.txt.
+# Controlling this file, guarantees, that all files were
+# patch correctly. Using version.ini makes it easy to
+# control this by looking into the about box
+# -> shifting one section to the end
+###########################################################
+
+sub shift_section_to_end
+{
+ my ($patchfilelist) = @_;
+
+ my @patchfile = ();
+ my @lastsection = ();
+ my $lastsection = "program";
+ my $notlastsection = "Basis\\program";
+ my $record = 0;
+
+ for ( my $i = 0; $i <= $#{$patchfilelist}; $i++ )
+ {
+ my $line = ${$patchfilelist}[$i];
+
+ if (( $record ) && ( $line =~ /^\s*\[/ )) { $record = 0; }
+
+ if (( $line =~ /^\s*\[\Q$lastsection\E\\\]\s*$/ ) && ( ! ( $line =~ /\Q$notlastsection\E\\\]\s*$/ ))) { $record = 1; }
+
+ if ( $record ) { push(@lastsection, $line); }
+ else { push(@patchfile, $line); }
+ }
+
+ if ( $#lastsection > -1 )
+ {
+ for ( my $i = 0; $i <= $#lastsection; $i++ )
+ {
+ push(@patchfile, $lastsection[$i]);
+ }
+ }
+
+ return \@patchfile;
+}
+
+###########################################################
+# One special file has to be the last in patchfile.txt.
+# Controlling this file, guarantees, that all files were
+# patch correctly. Using version.ini makes it easy to
+# control this by looking into the about box
+# -> shifting one file of the last section to the end
+###########################################################
+
+sub shift_file_to_end
+{
+ my ($patchfilelist) = @_;
+
+ my @patchfile = ();
+ my $lastfilename = "version.ini";
+ my $lastfileline = "";
+ my $foundfile = 0;
+
+ # Only searching this file in the last section
+ my $lastsectionname = "";
+
+ for ( my $i = 0; $i <= $#{$patchfilelist}; $i++ )
+ {
+ my $line = ${$patchfilelist}[$i];
+ if ( $line =~ /^\s*\[(.*?)\]\s*$/ ) { $lastsectionname = $1; }
+ }
+
+ my $record = 0;
+ for ( my $i = 0; $i <= $#{$patchfilelist}; $i++ )
+ {
+ my $line = ${$patchfilelist}[$i];
+
+ if ( $line =~ /^\s*\[\Q$lastsectionname\E\]\s*$/ ) { $record = 1; }
+
+ if (( $line =~ /^\s*\"\Q$lastfilename\E\"\=/ ) && ( $record ))
+ {
+ $lastfileline = $line;
+ $foundfile = 1;
+ $record = 0;
+ next;
+ }
+
+ push(@patchfile, $line);
+ }
+
+ if ( $foundfile ) { push(@patchfile, $lastfileline); }
+
+ return \@patchfile;
+}
+
+###########################################################
+# Putting hash content into array and sorting it
+###########################################################
+
+sub sort_hash
+{
+ my ( $hashref ) = @_;
+
+ my $item = "";
+ my @sortedarray = ();
+
+ foreach $item (keys %{$hashref}) { push(@sortedarray, $item); }
+ installer::sorter::sorting_array_of_strings(\@sortedarray);
+
+ return \@sortedarray;
+}
+
+###########################################################
+# Renaming Windows files in Patch and creating file
+# patchfiles.txt
+###########################################################
+
+sub prepare_windows_patchfiles
+{
+ my ( $filesref, $languagestringref, $allvariableshashref ) = @_;
+
+ my @patchfiles = ();
+ my %patchfiledirectories = ();
+ my $patchfilename = "patchlist.txt";
+ my $patchfilename2 = "patchmsi.dll";
+
+ if ( ! $allvariableshashref->{'WINDOWSPATCHLEVEL'} ) { installer::exiter::exit_program("ERROR: No Windows patch level defined in list file (WINDOWSPATCHLEVEL) !", "prepare_windows_patchfiles"); }
+ # my $windowspatchlevel = $allvariableshashref->{'WINDOWSPATCHLEVEL'};
+ my $windowspatchlevel = $installer::globals::buildid;
+
+ # the environment variable CWS_WORK_STAMP is set only in CWS
+ if ( $ENV{'CWS_WORK_STAMP'} ) { $windowspatchlevel = $ENV{'CWS_WORK_STAMP'} . $windowspatchlevel; }
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $onefile = ${$filesref}[$i];
+
+ my $filename = $onefile->{'Name'};
+ if (( $filename eq $patchfilename ) || ( $filename eq $patchfilename2 )) { next; }
+
+ my $styles = "";
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+ if ( $styles =~ /\bDONTRENAMEINPATCH\b/ ) { next; }
+
+ # special handling for files with flag DONTSHOW. This files get the extension ".dontshow" to be filtered by dialogs.
+ my $localwindowspatchlevel = $windowspatchlevel;
+ if ( $styles =~ /\bDONTSHOW\b/ ) { $localwindowspatchlevel = $localwindowspatchlevel . "\.dontshow"; }
+
+ my $olddestination = $onefile->{'destination'};
+ my $newdestination = $olddestination . "." . $localwindowspatchlevel;
+ my $localfilename = $olddestination;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$localfilename); # file name part
+ my $line = "\"" . $localfilename . "\"" . "=" . "\"" . "\." . $localwindowspatchlevel . "\"";
+ $onefile->{'destination'} = $newdestination;
+
+ my $newfilename = $onefile->{'Name'} . "." . $localwindowspatchlevel;
+ $onefile->{'Name'} = $newfilename;
+
+ # adding section information (section is the directory)
+ my $origolddestination = $olddestination;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$olddestination); # directory part
+ if ( ! $olddestination ) { $olddestination = "_root"; }
+ if ( ! exists($patchfiledirectories{$olddestination}) ) { $patchfiledirectories{$olddestination} = 1; }
+ $line = $line . "\tXXXXX\t" . $olddestination . "\n";
+
+ push(@patchfiles, $line);
+
+ # also collecting all files from patch in @installer::globals::patchfilecollector
+ my $patchfileline = $origolddestination . "\n";
+ push(@installer::globals::patchfilecollector, $patchfileline);
+ }
+
+ my $winpatchdirname = "winpatch";
+ my $winpatchdir = installer::systemactions::create_directories($winpatchdirname, $languagestringref);
+
+ my $patchlistfile = installer::existence::get_specified_file_by_name($filesref, $patchfilename);
+
+ # reorganizing the patchfile content, sorting for directory to decrease the file size
+ my $sorteddirectorylist = sort_hash(\%patchfiledirectories);
+ my $patchfilelist = reorg_patchfile(\@patchfiles, $sorteddirectorylist);
+
+ # shifting version.ini to the end of the list, to guarantee, that all files are patched
+ # if the correct version is shown in the about box
+ $patchfilelist = shift_section_to_end($patchfilelist);
+ $patchfilelist = shift_file_to_end($patchfilelist);
+
+ # saving the file
+ $patchfilename = $winpatchdir . $installer::globals::separator . $patchfilename;
+ installer::files::save_file($patchfilename, $patchfilelist);
+
+ my $infoline = "\nCreated list of patch files: $patchfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # and assigning the new source
+ $patchlistfile->{'sourcepath'} = $patchfilename;
+
+ # and finally checking the file size
+ if ( -f $patchfilename ) # test of existence
+ {
+ my $filesize = ( -s $patchfilename );
+ $infoline = "Size of patch file list: $filesize\n\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::logger::print_message( "... size of patch list file: $filesize Byte ... \n" );
+
+ # Win 98: Maximum size of ini file is 65 kB
+ # if ( $filesize > 64000 ) { installer::exiter::exit_program("ERROR: Maximum size of patch file list is 65 kB (Win98), now reached: $filesize Byte !", "prepare_windows_patchfiles"); }
+ }
+
+}
+
+###########################################################
+# Replacing %-variables with the content
+# of $allvariableshashref
+###########################################################
+
+sub replace_variables_in_string
+{
+ my ( $string, $variableshashref ) = @_;
+
+ if ( $string =~ /^.*\%\w+.*$/ )
+ {
+ my $key;
+
+ foreach $key (keys %{$variableshashref})
+ {
+ my $value = $variableshashref->{$key};
+ $key = "\%" . $key;
+ $string =~ s/\Q$key\E/$value/g;
+ }
+ }
+
+ return $string;
+}
+
+###########################################################
+# Replacing %-variables with the content
+# of $allvariableshashref
+###########################################################
+
+sub replace_dollar_variables_in_string
+{
+ my ( $string, $variableshashref ) = @_;
+
+ if ( $string =~ /^.*\$\{\w+\}.*$/ )
+ {
+ my $key;
+
+ foreach $key (keys %{$variableshashref})
+ {
+ my $value = $variableshashref->{$key};
+ $key = "\$\{" . $key . "\}";
+ $string =~ s/\Q$key\E/$value/g;
+ }
+ }
+
+ return $string;
+}
+
+###########################################################
+# The list file contains the list of packages/RPMs that
+# have to be copied.
+###########################################################
+
+sub get_all_files_from_filelist
+{
+ my ( $listfile, $section ) = @_;
+
+ my @allpackages = ();
+
+ for ( my $i = 0; $i <= $#{$listfile}; $i++ )
+ {
+ my $line = ${$listfile}[$i];
+ if ( $line =~ /^\s*\#/ ) { next; } # this is a comment line
+ if ( $line =~ /^\s*$/ ) { next; } # empty line
+ $line =~ s/^\s*//;
+ $line =~ s/\s*$//;
+ push(@allpackages, $line);
+ }
+
+ return \@allpackages;
+}
+
+###########################################################
+# Getting one section from a file. Section begins with
+# [xyz] and ends with file end or next [abc].
+###########################################################
+
+sub get_section_from_file
+{
+ my ($file, $sectionname) = @_;
+
+ my @section = ();
+ my $record = 0;
+
+ for ( my $i = 0; $i <= $#{$file}; $i++ )
+ {
+ my $line = ${$file}[$i];
+
+ if (( $record ) && ( $line =~ /^\s*\[/ ))
+ {
+ $record = 0;
+ last;
+ }
+
+ if ( $line =~ /^\s*\[\Q$sectionname\E\]\s*$/ ) { $record = 1; }
+
+ if ( $line =~ /^\s*\[/ ) { next; } # this is a section line
+ if ( $line =~ /^\s*\#/ ) { next; } # this is a comment line
+ if ( $line =~ /^\s*$/ ) { next; } # empty line
+ $line =~ s/^\s*//;
+ $line =~ s/\s*$//;
+ if ( $record ) { push(@section, $line); }
+ }
+
+ return \@section;
+
+}
+
+#######################################################
+# Substituting one variable in the xml file
+#######################################################
+
+sub replace_one_dollar_variable
+{
+ my ($file, $variable, $searchstring) = @_;
+
+ for ( my $i = 0; $i <= $#{$file}; $i++ )
+ {
+ ${$file}[$i] =~ s/\$\{$searchstring\}/$variable/g;
+ }
+}
+
+#######################################################
+# Substituting the variables in the xml file
+#######################################################
+
+sub substitute_dollar_variables
+{
+ my ($file, $variableshashref) = @_;
+
+ my $key;
+
+ foreach $key (keys %{$variableshashref})
+ {
+ my $value = $variableshashref->{$key};
+ replace_one_dollar_variable($file, $value, $key);
+ }
+}
+
+#############################################################################
+# Collecting all packages or rpms located in the installation directory
+#############################################################################
+
+sub get_all_packages_in_installdir
+{
+ my ($directory) = @_;
+
+ my $infoline = "";
+
+ my @allpackages = ();
+ my $allpackages = \@allpackages;
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ $allpackages = installer::systemactions::find_file_with_file_extension("rpm", $directory);
+ }
+
+ if ( $installer::globals::issolarisbuild )
+ {
+ $allpackages = installer::systemactions::get_all_directories($directory);
+ }
+
+ return $allpackages;
+}
+
+###############################################################
+# The list of exclude packages can contain the
+# beginning of the package name, not the complete name.
+###############################################################
+
+sub is_matching
+{
+ my ($onepackage, $allexcludepackages ) = @_;
+
+ my $matches = 0;
+
+ for ( my $i = 0; $i <= $#{$allexcludepackages}; $i++ )
+ {
+ my $oneexcludepackage = ${$allexcludepackages}[$i];
+
+ if ( $onepackage =~ /^\s*$oneexcludepackage/ )
+ {
+ $matches = 1;
+ last;
+ }
+ }
+
+ return $matches;
+}
+
+###############################################################
+# Copying all Solaris packages or RPMs from installation set
+###############################################################
+
+sub copy_all_packages
+{
+ my ($allexcludepackages, $sourcedir, $destdir) = @_;
+
+ my $infoline = "";
+
+ $sourcedir =~ s/\/\s*$//;
+ $destdir =~ s/\/\s*$//;
+
+ # $allexcludepackages is a list of RPMs and packages, that shall NOT be included into jds product
+ my $allpackages = get_all_packages_in_installdir($sourcedir);
+
+ for ( my $i = 0; $i <= $#{$allpackages}; $i++ )
+ {
+ my $onepackage = ${$allpackages}[$i];
+
+ my $packagename = $onepackage;
+
+ if ( $installer::globals::issolarispkgbuild ) # on Solaris $onepackage contains the complete path
+ {
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$packagename);
+ }
+
+ if ( ! installer::existence::exists_in_array($packagename, $allexcludepackages))
+ {
+ if ( ! is_matching($packagename, $allexcludepackages ) )
+ {
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ my $sourcepackage = $sourcedir . $installer::globals::separator . $packagename;
+ my $destfile = $destdir . $installer::globals::separator . $packagename;
+ if ( ! -f $sourcepackage ) { installer::exiter::exit_program("ERROR: Could not find RPM $sourcepackage!", "copy_all_packages"); }
+ installer::systemactions::hardlink_one_file($sourcepackage, $destfile);
+ }
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ my $destinationdir = $destdir . $installer::globals::separator . $packagename;
+ if ( ! -d $onepackage ) { installer::exiter::exit_program("ERROR: Could not find Solaris package $onepackage!", "copy_all_packages"); }
+ # installer::systemactions::hardlink_complete_directory($onepackage, $destinationdir);
+ # installer::systemactions::copy_complete_directory($onepackage, $destinationdir);
+
+ my $systemcall = "cp -p -R $onepackage $destinationdir";
+ make_systemcall($systemcall);
+ }
+ }
+ else
+ {
+ $infoline = "Excluding package (matching): $onepackage\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ else
+ {
+ $infoline = "Excluding package (precise name): $onepackage\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+}
+
+######################################################
+# Making systemcall
+######################################################
+
+sub make_systemcall
+{
+ my ($systemcall) = @_;
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+###########################################################
+# Copying all Solaris packages or RPMs from solver
+###########################################################
+
+sub copy_additional_packages
+{
+ my ($allcopypackages, $destdir, $includepatharrayref) = @_;
+
+ my $infoline = "Copy additional packages into installation set.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ $destdir =~ s/\/\s*$//;
+
+ for ( my $i = 0; $i <= $#{$allcopypackages}; $i++ )
+ {
+ my $onepackage = ${$allcopypackages}[$i];
+ $infoline = "Copy package: $onepackage\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # this package must be delivered into the solver
+
+ my $packagesourceref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$onepackage, $includepatharrayref, 0);
+ if ($$packagesourceref eq "") { installer::exiter::exit_program("ERROR: Could not find jds file $onepackage!", "copy_additional_packages"); }
+
+ if ( $onepackage =~ /\.tar\.gz\s*$/ )
+ {
+ my $systemcall = "cd $destdir; cat $$packagesourceref | gunzip | tar -xf -";
+ make_systemcall($systemcall);
+ }
+ else
+ {
+ my $destfile = $destdir . $installer::globals::separator . $onepackage;
+ installer::systemactions::copy_one_file($$packagesourceref, $destfile);
+ }
+ }
+}
+
+###########################################################
+# Creating jds installation sets
+###########################################################
+
+sub create_jds_sets
+{
+ my ($installationdir, $allvariableshashref, $languagestringref, $languagesarrayref, $includepatharrayref) = @_;
+
+ installer::logger::print_message( "\n******************************************\n" );
+ installer::logger::print_message( "... creating jds installation set ...\n" );
+ installer::logger::print_message( "******************************************\n" );
+
+ installer::logger::include_header_into_logfile("Creating jds installation sets:");
+
+ my $firstdir = $installationdir;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$firstdir);
+
+ my $lastdir = $installationdir;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$lastdir);
+
+ if ( $lastdir =~ /\./ ) { $lastdir =~ s/\./_jds_inprogress\./ }
+ else { $lastdir = $lastdir . "_jds_inprogress"; }
+
+ # removing existing directory "_native_packed_inprogress" and "_native_packed_witherror" and "_native_packed"
+
+ my $jdsdir = $firstdir . $lastdir;
+ if ( -d $jdsdir ) { installer::systemactions::remove_complete_directory($jdsdir); }
+
+ my $olddir = $jdsdir;
+ $olddir =~ s/_inprogress/_witherror/;
+ if ( -d $olddir ) { installer::systemactions::remove_complete_directory($olddir); }
+
+ $olddir = $jdsdir;
+ $olddir =~ s/_inprogress//;
+ if ( -d $olddir ) { installer::systemactions::remove_complete_directory($olddir); }
+
+ # creating the new directory
+
+ installer::systemactions::create_directory($jdsdir);
+
+ $installer::globals::saveinstalldir = $jdsdir;
+
+ # find and read jds files list
+ my $filelistname = $installer::globals::jdsexcludefilename;
+
+ my $filelistnameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$filelistname, "", 0);
+ if ($$filelistnameref eq "") { installer::exiter::exit_program("ERROR: Could not find jds list file $filelistname!", "create_jds_sets"); }
+
+ my $listfile = installer::files::read_file($$filelistnameref);
+
+ my $infoline = "Found jds list file: $$filelistnameref\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ # substituting the variables
+ substitute_dollar_variables($listfile, $allvariableshashref);
+
+ # determining the packages/RPMs to copy
+ my $allexcludepackages = get_section_from_file($listfile, "excludefiles");
+ my $allcopypackages = get_section_from_file($listfile, "copyfiles");
+
+ # determining the source directory
+ my $alldirs = installer::systemactions::get_all_directories($installationdir);
+ my $sourcedir = ${$alldirs}[0]; # there is only one directory
+
+ if ( $installer::globals::issolarisbuild ) { $sourcedir = $installer::globals::saved_packages_path; }
+
+ # copy all packages/RPMs
+ copy_all_packages($allexcludepackages, $sourcedir, $jdsdir);
+ copy_additional_packages($allcopypackages, $jdsdir, $includepatharrayref);
+
+ return $jdsdir;
+}
+
+#############################################################################
+# Checking, whether this installation set contains the correct languages
+#############################################################################
+
+sub check_jds_language
+{
+ my ($allvariableshashref, $languagestringref) = @_;
+
+ my $infoline = "";
+
+ # languagesarrayref and $allvariableshashref->{'JDSLANG'}
+
+ if ( ! $allvariableshashref->{'JDSLANG'} ) { installer::exiter::exit_program("ERROR: For building JDS installation sets \"JDSLANG\" must be defined!", "check_jds_language"); }
+ my $languagestring = $allvariableshashref->{'JDSLANG'};
+
+ my $sortedarray1 = installer::converter::convert_stringlist_into_array(\$languagestring, ",");
+
+ installer::sorter::sorting_array_of_strings($sortedarray1);
+
+ my $sortedarray2 = installer::converter::convert_stringlist_into_array($languagestringref, "_");
+ installer::sorter::sorting_array_of_strings($sortedarray2);
+
+ my $string1 = installer::converter::convert_array_to_comma_separated_string($sortedarray1);
+ my $string2 = installer::converter::convert_array_to_comma_separated_string($sortedarray2);
+
+ my $arrays_are_equal = compare_arrays($sortedarray1, $sortedarray2);
+
+ return $arrays_are_equal;
+}
+
+###################################################################################
+# Comparing two arrays. The arrays are equal, if the complete content is equal.
+###################################################################################
+
+sub compare_arrays
+{
+ my ($array1, $array2) = @_;
+
+ my $arrays_are_equal = 1;
+
+ # checking the size
+
+ if ( ! ( $#{$array1} == $#{$array2} )) { $arrays_are_equal = 0; } # different size
+
+ if ( $arrays_are_equal ) # only make further investigations if size is equal
+ {
+ for ( my $i = 0; $i <= $#{$array1}; $i++ )
+ {
+ # ingnoring whitespaces at end and beginning
+ ${$array1}[$i] =~ s/^\s*//;
+ ${$array2}[$i] =~ s/^\s*//;
+ ${$array1}[$i] =~ s/\s*$//;
+ ${$array2}[$i] =~ s/\s*$//;
+
+ if ( ! ( ${$array1}[$i] eq ${$array2}[$i] ))
+ {
+ $arrays_are_equal = 0;
+ last;
+ }
+ }
+ }
+
+ return $arrays_are_equal;
+}
+
+#################################################################
+# Copying the files defined as ScpActions into the
+# installation set.
+#################################################################
+
+sub put_scpactions_into_installset
+{
+ my ($installdir) = @_;
+
+ installer::logger::include_header_into_logfile("Start: Copying scp action files into installation set");
+
+ for ( my $i = 0; $i <= $#installer::globals::allscpactions; $i++ )
+ {
+ my $onescpaction = $installer::globals::allscpactions[$i];
+
+ my $subdir = "";
+ if ( $onescpaction->{'Subdir'} ) { $subdir = $onescpaction->{'Subdir'}; }
+
+ if ( $onescpaction->{'Name'} eq "loader.exe" ) { next; } # do not copy this ScpAction loader
+
+ my $destdir = $installdir;
+ $destdir =~ s/\Q$installer::globals::separator\E\s*$//;
+ if ( $subdir ) { $destdir = $destdir . $installer::globals::separator . $subdir; }
+
+ my $sourcefile = $onescpaction->{'sourcepath'};
+ my $destfile = $destdir . $installer::globals::separator . $onescpaction->{'DestinationName'};
+
+ my $styles = "";
+ if ( $onescpaction->{'Styles'} ) { $styles = $onescpaction->{'Styles'}; }
+ if (( $styles =~ /\bFILE_CAN_MISS\b/ ) && ( $sourcefile eq "" )) { next; }
+
+ if (( $subdir =~ /\// ) || ( $subdir =~ /\\/ ))
+ {
+ installer::systemactions::create_directory_structure($destdir);
+ }
+ else
+ {
+ installer::systemactions::create_directory($destdir);
+ }
+
+ installer::systemactions::copy_one_file($sourcefile, $destfile);
+
+ if ( $onescpaction->{'UnixRights'} )
+ {
+ my $localcall = "chmod $onescpaction->{'UnixRights'} $destfile \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+
+ }
+
+ installer::logger::include_header_into_logfile("End: Copying scp action files into installation set");
+
+}
+
+#################################################################
+# Collecting scp actions for all languages
+#################################################################
+
+sub collect_scpactions
+{
+ my ($allscpactions) = @_;
+
+ for ( my $i = 0; $i <= $#{$allscpactions}; $i++ )
+ {
+ push(@installer::globals::allscpactions, ${$allscpactions}[$i]);
+ }
+}
+
+#################################################################
+# Setting the platform name for download
+#################################################################
+
+sub get_platform_name
+{
+ my $platformname = "";
+
+ if (( $installer::globals::islinuxintelrpmbuild ) || ( $installer::globals::islinuxinteldebbuild ))
+ {
+ $platformname = "LinuxIntel";
+ }
+ elsif (( $installer::globals::islinuxppcrpmbuild ) || ( $installer::globals::islinuxppcdebbuild ))
+ {
+ $platformname = "LinuxPowerPC";
+ }
+ elsif (( $installer::globals::islinuxx86_64rpmbuild ) || ( $installer::globals::islinuxx86_64debbuild ))
+ {
+ $platformname = "LinuxX86-64";
+ }
+ elsif ( $installer::globals::issolarissparcbuild )
+ {
+ $platformname = "SolarisSparc";
+ }
+ elsif ( $installer::globals::issolarisx86build )
+ {
+ $platformname = "Solarisx86";
+ }
+ elsif ( $installer::globals::iswindowsbuild )
+ {
+ $platformname = "Win32Intel";
+ }
+ elsif ( $installer::globals::compiler =~ /^unxmacxi/ )
+ {
+ $platformname = "MacOSXIntel";
+ }
+ elsif ( $installer::globals::compiler =~ /^unxmacxp/ )
+ {
+ $platformname = "MacOSXPowerPC";
+ }
+ else
+ {
+ # $platformname = $installer::globals::packageformat;
+ $platformname = $installer::globals::compiler;
+ }
+
+ return $platformname;
+}
+
+###########################################################
+# Adding additional variables into the variableshashref,
+# that are defined in include files in the solver. The
+# names of the include files are stored in
+# ADD_INCLUDE_FILES (comma separated list).
+###########################################################
+
+sub add_variables_from_inc_to_hashref
+{
+ my ($allvariables, $includepatharrayref) = @_;
+
+ my $infoline = "";
+ my $includefilelist = "";
+ if ( $allvariables->{'ADD_INCLUDE_FILES'} ) { $includefilelist = $allvariables->{'ADD_INCLUDE_FILES'}; }
+
+ my $includefiles = installer::converter::convert_stringlist_into_array_without_linebreak_and_quotes(\$includefilelist, ",");
+
+ for ( my $i = 0; $i <= $#{$includefiles}; $i++ )
+ {
+ my $includefilename = ${$includefiles}[$i];
+ $includefilename =~ s/^\s*//;
+ $includefilename =~ s/\s*$//;
+ $includefilenameref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$includefilename, $includepatharrayref, 1);
+ if ( $$includefilenameref eq "" ) { installer::exiter::exit_program("Include file $includefilename not found!\nADD_INCLUDE_FILES = $allvariables->{'ADD_INCLUDE_FILES'}", "add_variables_from_inc_to_hashref"); }
+
+ $infoline = "Including inc file: $$includefilenameref \n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ my $includefile = installer::files::read_file($$includefilenameref);
+
+ for ( my $j = 0; $j <= $#{$includefile}; $j++ )
+ {
+ # Analyzing all "key=value" lines
+ my $oneline = ${$includefile}[$j];
+
+ if ( $oneline =~ /^\s*(\S+)\s*\=\s*(.*?)\s*$/ ) # no white space allowed in key
+ {
+ my $key = $1;
+ my $value = $2;
+ $allvariables->{$key} = $value;
+ $infoline = "Setting of variable: $key = $value\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ }
+ }
+ }
+
+ # Allowing different Java versions for Windows and Unix. Instead of "JAVAVERSION"
+ # the property "WINDOWSJAVAVERSION" has to be used, if it is set.
+
+ if ( $installer::globals::iswindowsbuild )
+ {
+ if (( exists($allvariables->{'WINDOWSJAVAVERSION'})) && ( $allvariables->{'WINDOWSJAVAVERSION'} ne "" ))
+ {
+ $allvariables->{'JAVAVERSION'} = $allvariables->{'WINDOWSJAVAVERSION'};
+ $infoline = "Changing value of property \"JAVAVERSION\" to $allvariables->{'JAVAVERSION'} (property \"WINDOWSJAVAVERSION\").\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ }
+ }
+}
+
+##############################################
+# Collecting all files from include pathes
+##############################################
+
+sub collect_all_files_from_includepathes
+{
+ my ($patharrayref) = @_;
+
+ installer::logger::globallog("Reading all directories: Start");
+ installer::logger::print_message( "... reading include pathes ...\n" );
+ # empty the global
+
+ @installer::globals::allincludepathes =();
+ my $infoline;
+
+ for ( my $i = 0; $i <= $#{$patharrayref}; $i++ )
+ {
+ $includepath = ${$patharrayref}[$i];
+ installer::remover::remove_leading_and_ending_whitespaces(\$includepath);
+
+ if ( ! -d $includepath )
+ {
+ $infoline = "$includepath does not exist. (Can be removed from include path list?)\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ next;
+ }
+
+ my @sourcefiles = ();
+ my $pathstring = "";
+ # installer::systemactions::read_complete_directory($includepath, $pathstring, \@sourcefiles);
+ installer::systemactions::read_full_directory($includepath, $pathstring, \@sourcefiles);
+
+ if ( ! ( $#sourcefiles > -1 ))
+ {
+ $infoline = "$includepath is empty. (Can be removed from include path list?)\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+ }
+ else
+ {
+ my $number = $#sourcefiles + 1;
+ $infoline = "Directory $includepath contains $number files (including subdirs)\n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ my %allfileshash = ();
+ $allfileshash{'includepath'} = $includepath;
+
+ for ( my $j = 0; $j <= $#sourcefiles; $j++ )
+ {
+ $allfileshash{$sourcefiles[$j]} = 1;
+ }
+
+ push(@installer::globals::allincludepathes, \%allfileshash);
+ }
+ }
+
+ $installer::globals::include_pathes_read = 1;
+
+ installer::logger::globallog("Reading all directories: End");
+ push( @installer::globals::globallogfileinfo, "\n");
+}
+
+##############################################
+# Searching for a file with the gid
+##############################################
+
+sub find_file_by_id
+{
+ my ( $filesref, $gid ) = @_;
+
+ my $foundfile = 0;
+ my $onefile;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ $onefile = ${$filesref}[$i];
+ my $filegid = $onefile->{'gid'};
+
+ if ( $filegid eq $gid )
+ {
+ $foundfile = 1;
+ last;
+ }
+ }
+
+ # It does not need to exist. For example products that do not contain the libraries.
+ # if (! $foundfile ) { installer::exiter::exit_program("ERROR: No unique file name found for $filename !", "get_selfreg_file"); }
+
+ if (! $foundfile ) { $onefile = ""; }
+
+ return $onefile;
+}
+
+##############################################
+# Searching for an item with the gid
+##############################################
+
+sub find_item_by_gid
+{
+ my ( $itemsref, $gid ) = @_;
+
+ my $founditem = 0;
+ my $oneitem = "";
+
+ for ( my $i = 0; $i <= $#{$itemsref}; $i++ )
+ {
+ my $localitem = ${$itemsref}[$i];
+ my $itemgid = $localitem->{'gid'};
+
+ if ( $itemgid eq $gid )
+ {
+ $oneitem = $localitem;
+ $founditem = 1;
+ last;
+ }
+ }
+
+ return $oneitem;
+}
+
+#########################################################
+# Calling sum
+#########################################################
+
+sub call_sum
+{
+ my ($filename) = @_;
+
+ $sumfile = "/usr/bin/sum";
+
+ if ( ! -f $sumfile ) { installer::exiter::exit_program("ERROR: No file /usr/bin/sum", "call_sum"); }
+
+ my $systemcall = "$sumfile $filename |";
+
+ my $sumoutput = "";
+
+ open (SUM, "$systemcall");
+ $sumoutput = <SUM>;
+ close (SUM);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return $sumoutput;
+}
+
+#########################################################
+# Calling wc
+# wc -c pkginfo | cut -f6 -d' '
+#########################################################
+
+sub call_wc
+{
+ my ($filename) = @_;
+
+ $wcfile = "/usr/bin/wc";
+
+ if ( ! -f $wcfile ) { installer::exiter::exit_program("ERROR: No file /usr/bin/wc", "call_wc"); }
+
+ my $systemcall = "$wcfile -c $filename |";
+
+ my $wcoutput = "";
+
+ open (WC, "$systemcall");
+ $wcoutput = <WC>;
+ close (WC);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return $wcoutput;
+}
+
+##############################################
+# Setting architecture ARCH=i86pc
+# instead of ARCH=i386.
+##############################################
+
+sub set_old_architecture_string
+{
+ my ($pkginfofile) = @_;
+
+ for ( my $i = 0; $i <= $#{$pkginfofile}; $i++ )
+ {
+ if ( ${$pkginfofile}[$i] =~ /^\s*ARCH=i386\s*$/ )
+ {
+ ${$pkginfofile}[$i] =~ s/i386/i86pc/;
+ last;
+ }
+ }
+}
+
+##############################################
+# For the new copied package, it is necessary
+# that a value for the key SUNW_REQUIRES
+# is set. Otherwise this copied package
+# with ARCH=i86pc would be useless.
+##############################################
+
+sub check_requires_setting
+{
+ my ($pkginfofile) = @_;
+
+ my $found = 0;
+ my $patchid = "";
+
+ for ( my $i = 0; $i <= $#{$pkginfofile}; $i++ )
+ {
+ if ( ${$pkginfofile}[$i] =~ /^\s*SUNW_REQUIRES=(\S*?)\s*$/ )
+ {
+ $patchid = $1;
+ $found = 1;
+ last;
+ }
+ }
+
+ if (( ! $found ) || ( $patchid eq "" )) { installer::exiter::exit_program("ERROR: No patch id defined for SUNW_REQUIRES in patch pkginfo file!", "check_requires_setting"); }
+}
+
+##############################################
+# Setting checksum and wordcount for changed
+# pkginfo file into pkgmap.
+##############################################
+
+sub set_pkginfo_line
+{
+ my ($pkgmapfile, $pkginfofilename) = @_;
+
+ # 1 i pkginfo 442 34577 1166716297
+ # ->
+ # 1 i pkginfo 443 34737 1166716297
+ #
+ # wc -c pkginfo | cut -f6 -d' ' -> 442 (variable)
+ # sum pkginfo | cut -f1 -d' ' -> 34577 (variable)
+ # grep 'pkginfo' pkgmap | cut -f6 -d' ' -> 1166716297 (fix)
+
+ my $checksum = call_sum($pkginfofilename);
+ if ( $checksum =~ /^\s*(\d+)\s+.*$/ ) { $checksum = $1; }
+
+ my $wordcount = call_wc($pkginfofilename);
+ if ( $wordcount =~ /^\s*(\d+)\s+.*$/ ) { $wordcount = $1; }
+
+ for ( my $i = 0; $i <= $#{$pkgmapfile}; $i++ )
+ {
+ if ( ${$pkgmapfile}[$i] =~ /(^.*\bpkginfo\b\s+)(\d+)(\s+)(\d+)(\s+)(\d+)(\s*$)/ )
+ {
+ my $newline = $1 . $wordcount . $3 . $checksum . $5 . $6 . $7;
+ ${$pkgmapfile}[$i] = $newline;
+ last;
+ }
+ }
+}
+
+##############################################
+# Setting time stamp of copied files to avoid
+# errors from pkgchk.
+##############################################
+
+sub set_time_stamp
+{
+ my ($olddir, $newdir, $copyfiles) = @_;
+
+ for ( my $i = 0; $i <= $#{$copyfiles}; $i++ )
+ {
+ my $sourcefile = $olddir . $installer::globals::separator . ${$copyfiles}[$i];
+ my $destfile = $newdir . $installer::globals::separator . ${$copyfiles}[$i];
+
+ my $systemcall = "touch -r $sourcefile $destfile";
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: \"$systemcall\" failed!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: \"$systemcall\" !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+}
+
+############################################################
+# Generating pathes for cygwin (first version)
+# This function has problems with cygwin, if $tmpfilename
+# contains many thousand files (OpenOffice SDK).
+############################################################
+
+sub generate_cygwin_pathes_old
+{
+ my ($filesref) = @_;
+
+ my ($tmpfilehandle, $tmpfilename) = tmpnam();
+ open SOURCEPATHLIST, ">$tmpfilename" or die "oops...\n";
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ print SOURCEPATHLIST "${$filesref}[$i]->{'sourcepath'}\n";
+ }
+ close SOURCEPATHLIST;
+ my @cyg_sourcepathlist = qx{cygpath -w -f "$tmpfilename"};
+ chomp @cyg_sourcepathlist;
+ unlink "$tmpfilename" or die "oops\n";
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ ${$filesref}[$i]->{'cyg_sourcepath'} = $cyg_sourcepathlist[$i];
+ }
+
+}
+
+#################################################
+# Generating pathes for cygwin (second version)
+# This function generates smaller files for
+#################################################
+
+sub generate_cygwin_pathes
+{
+ my ($filesref) = @_;
+
+ installer::logger::include_timestamp_into_logfile("Starting generating cygwin pathes");
+
+ my $infoline = "Generating cygwin pathes (generate_cygwin_pathes)\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $max = 5000; # number of pathes in one file
+
+ my @pathcollector = ();
+ my $startnumber = 0;
+ my $counter = 0;
+
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ my $line = ${$filesref}[$i]->{'sourcepath'} . "\n";
+ push(@pathcollector, $line);
+ $counter++;
+
+ if (( $i == $#{$filesref} ) || ((( $counter % $max ) == 0 ) && ( $i > 0 )))
+ {
+ my $tmpfilename = "cygwinhelper_" . $i . ".txt";
+ my $temppath = $installer::globals::temppath;
+ $temppath =~ s/\Q$installer::globals::separator\E\s*$//;
+ $tmpfilename = $temppath . $installer::globals::separator . $tmpfilename;
+ $infoline = "Creating temporary file for cygwin conversion: $tmpfilename (contains $counter pathes)\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ if ( -f $tmpfilename ) { unlink $tmpfilename; }
+
+ installer::files::save_file($tmpfilename, \@pathcollector);
+
+ my $success = 0;
+ my @cyg_sourcepathlist = qx{cygpath -w -f "$tmpfilename"};
+ chomp @cyg_sourcepathlist;
+
+ # Validating the array, it has to contain the correct number of values
+ my $new_pathes = $#cyg_sourcepathlist + 1;
+ if ( $new_pathes == $counter ) { $success = 1; }
+
+ if ($success)
+ {
+ $infoline = "Success: Successfully converted to cygwin pathes!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "ERROR: Failed to convert to cygwin pathes!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: Failed to convert to cygwin pathes!", "generate_cygwin_pathes");
+ }
+
+ for ( my $j = 0; $j <= $#cyg_sourcepathlist; $j++ )
+ {
+ my $number = $startnumber + $j;
+ ${$filesref}[$number]->{'cyg_sourcepath'} = $cyg_sourcepathlist[$j];
+ }
+
+ if ( -f $tmpfilename ) { unlink $tmpfilename; }
+
+ @pathcollector = ();
+ $startnumber = $startnumber + $max;
+ $counter = 0;
+ }
+ }
+
+ # Checking existence fo cyg_sourcepath for every file
+ for ( my $i = 0; $i <= $#{$filesref}; $i++ )
+ {
+ if (( ! exists(${$filesref}[$i]->{'cyg_sourcepath'}) ) || ( ${$filesref}[$i]->{'cyg_sourcepath'} eq "" ))
+ {
+ $infoline = "ERROR: No cygwin sourcepath defined for file ${$filesref}[$i]->{'sourcepath'}\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ installer::exiter::exit_program("ERROR: No cygwin sourcepath defined for file ${$filesref}[$i]->{'sourcepath'}!", "generate_cygwin_pathes");
+ }
+ }
+
+ installer::logger::include_timestamp_into_logfile("Ending generating cygwin pathes");
+}
+
+##############################################
+# Include only files from install directory
+# in pkgmap file.
+##############################################
+
+sub filter_pkgmapfile
+{
+ my ($pkgmapfile) = @_;
+
+ my @pkgmap = ();
+
+ my $line = ": 1 10\n";
+ push(@pkgmap, $line);
+
+ for ( my $i = 0; $i <= $#{$pkgmapfile}; $i++ )
+ {
+ $line = ${$pkgmapfile}[$i];
+ if ( $line =~ /^\s*1\si\s/ ) { push(@pkgmap, $line); }
+ }
+
+ return \@pkgmap;
+}
+
+##############################################
+# Creating double packages for Solaris x86.
+# One package with ARCH=i386 and one with
+# ARCH=i86pc.
+##############################################
+
+sub fix_solaris_x86_patch
+{
+ my ($packagename, $subdir) = @_;
+
+ # changing into directory of packages, important for soft linking
+ my $startdir = cwd();
+ chdir($subdir);
+
+ # $packagename is: "SUNWstaroffice-core01"
+ # Current working directory is: "<path>/install/en-US_inprogress"
+
+ # create new folder in "packages": $packagename . ".i"
+ my $newpackagename = $packagename . "\.i";
+ my $newdir = $newpackagename;
+ installer::systemactions::create_directory($newdir);
+
+ # collecting all directories in the package
+ my $olddir = $packagename;
+ my $allsubdirs = installer::systemactions::get_all_directories_without_path($olddir);
+
+ # link all directories from $packagename to $packagename . ".i"
+ for ( my $i = 0; $i <= $#{$allsubdirs}; $i++ )
+ {
+ my $sourcedir = $olddir . $installer::globals::separator . ${$allsubdirs}[$i];
+ my $destdir = $newdir . $installer::globals::separator . ${$allsubdirs}[$i];
+ my $directory_depth = 2; # important for soft links, two directories already exist
+ installer::systemactions::softlink_complete_directory($sourcedir, $destdir, $directory_depth);
+ }
+
+ # copy "pkginfo" and "pkgmap" from $packagename to $packagename . ".i"
+ my @allcopyfiles = ("pkginfo", "pkgmap");
+ for ( my $i = 0; $i <= $#allcopyfiles; $i++ )
+ {
+ my $sourcefile = $olddir . $installer::globals::separator . $allcopyfiles[$i];
+ my $destfile = $newdir . $installer::globals::separator . $allcopyfiles[$i];
+ installer::systemactions::copy_one_file($sourcefile, $destfile);
+ }
+
+ # change in pkginfo in $packagename . ".i" the value for ARCH from i386 to i86pc
+ my $pkginfofilename = "pkginfo";
+ $pkginfofilename = $newdir . $installer::globals::separator . $pkginfofilename;
+
+ my $pkginfofile = installer::files::read_file($pkginfofilename);
+ set_old_architecture_string($pkginfofile);
+ installer::files::save_file($pkginfofilename, $pkginfofile);
+
+ # adapt the values in pkgmap for pkginfo file, because this file was edited
+ my $pkgmapfilename = "pkgmap";
+ $pkgmapfilename = $newdir . $installer::globals::separator . $pkgmapfilename;
+
+ my $pkgmapfile = installer::files::read_file($pkgmapfilename);
+ set_pkginfo_line($pkgmapfile, $pkginfofilename);
+ installer::files::save_file($pkgmapfilename, $pkgmapfile);
+
+ # changing back to startdir
+ chdir($startdir);
+}
+
+###################################################
+# Creating double core01 package for Solaris x86.
+# One package with ARCH=i386 and one with
+# ARCH=i86pc. This is necessary, to inform the
+# user about the missing "small patch", if
+# packages with ARCH=i86pc are installed.
+###################################################
+
+sub fix2_solaris_x86_patch
+{
+ my ($packagename, $subdir) = @_;
+
+ if ( $packagename =~ /-core01\s*$/ ) # only this one package needs to be duplicated
+ {
+ my $startdir = cwd();
+ chdir($subdir);
+
+ # $packagename is: "SUNWstaroffice-core01"
+ # Current working directory is: "<path>/install/en-US_inprogress"
+
+ # create new package in "packages": $packagename . ".i"
+ my $olddir = $packagename;
+ my $newpackagename = $packagename . "\.i";
+ my $newdir = $newpackagename;
+
+ installer::systemactions::create_directory($newdir);
+
+ my $oldinstalldir = $olddir . $installer::globals::separator . "install";
+ my $newinstalldir = $newdir . $installer::globals::separator . "install";
+
+ installer::systemactions::copy_complete_directory($oldinstalldir, $newinstalldir);
+
+ # setting time stamp of all copied files to avoid errors from pkgchk
+ my $allinstallfiles = installer::systemactions::get_all_files_from_one_directory_without_path($newinstalldir);
+ set_time_stamp($oldinstalldir, $newinstalldir, $allinstallfiles);
+
+ # copy "pkginfo" and "pkgmap" from $packagename to $packagename . ".i"
+ my @allcopyfiles = ("pkginfo", "pkgmap");
+ for ( my $i = 0; $i <= $#allcopyfiles; $i++ )
+ {
+ my $sourcefile = $olddir . $installer::globals::separator . $allcopyfiles[$i];
+ my $destfile = $newdir . $installer::globals::separator . $allcopyfiles[$i];
+ installer::systemactions::copy_one_file($sourcefile, $destfile);
+ }
+
+ # change in pkginfo in $packagename . ".i" the value for ARCH from i386 to i86pc
+ my $pkginfofilename = "pkginfo";
+ $pkginfofilename = $newdir . $installer::globals::separator . $pkginfofilename;
+
+ my $pkginfofile = installer::files::read_file($pkginfofilename);
+ set_old_architecture_string($pkginfofile);
+ check_requires_setting($pkginfofile);
+ installer::files::save_file($pkginfofilename, $pkginfofile);
+
+ # adapt the values in pkgmap for pkginfo file, because this file was edited
+ my $pkgmapfilename = "pkgmap";
+ $pkgmapfilename = $newdir . $installer::globals::separator . $pkgmapfilename;
+
+ my $pkgmapfile = installer::files::read_file($pkgmapfilename);
+ set_pkginfo_line($pkgmapfile, $pkginfofilename);
+ $pkgmapfile = filter_pkgmapfile($pkgmapfile);
+ installer::files::save_file($pkgmapfilename, $pkgmapfile);
+
+ # setting time stamp of all copied files to avoid errors from pkgchk
+ set_time_stamp($olddir, $newdir, \@allcopyfiles);
+
+ # changing back to startdir
+ chdir($startdir);
+ }
+}
+
+################################################
+# Files with flag HIDDEN get a dot at the
+# beginning of the file name. This cannot be
+# defined in scp2 project, because tooling
+# cannot handle files with beginning dot
+# correctly.
+################################################
+
+sub resolving_hidden_flag
+{
+ my ($filesarrayref, $variableshashref, $item, $languagestringref) = @_;
+
+ my $diritem = lc($item);
+ my $infoline = "";
+
+ my $hiddendirbase = installer::systemactions::create_directories("hidden_$diritem", $languagestringref);
+
+ installer::logger::include_header_into_logfile("$item with flag HIDDEN:");
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ my $onefile = ${$filesarrayref}[$i];
+ my $styles = "";
+
+ if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; }
+
+ if ( $styles =~ /\bHIDDEN\b/ )
+ {
+ # Language specific subdirectory
+
+ my $onelanguage = $onefile->{'specificlanguage'};
+
+ if ($onelanguage eq "")
+ {
+ $onelanguage = "00"; # files without language into directory "00"
+ }
+
+ my $hiddendir = $hiddendirbase . $installer::globals::separator . $onelanguage . $installer::globals::separator;
+ installer::systemactions::create_directory($hiddendir); # creating language specific directories
+
+ # copy files and edit them with the variables defined in the zip.lst
+
+ my $onefilename = $onefile->{'Name'};
+ my $newfilename = "\." . $onefilename;
+ my $sourcefile = $onefile->{'sourcepath'};
+ my $destfile = $hiddendir . $newfilename;
+
+ my $copysuccess = installer::systemactions::copy_one_file($sourcefile, $destfile);
+
+ if ( $copysuccess )
+ {
+ # $onefile->{'Name'} = $newfilename;
+ $onefile->{'sourcepath'} = $destfile;
+ $destination = $onefile->{'destination'};
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination);
+ if ( $destination eq "" ) { $onefile->{'destination'} = $newfilename; }
+ else { $onefile->{'destination'} = $destination . $installer::globals::separator . $newfilename; }
+
+ $infoline = "Success: Using file with flag HIDDEN from \"$onefile->{'sourcepath'}\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Error: Failed to copy HIDDEN file from \"$sourcefile\" to \"$destfile\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+
+ $infoline = "\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+################################################
+# Controlling that all keys in hash A are
+# also key in hash B.
+################################################
+
+sub key_in_a_is_also_key_in_b
+{
+ my ( $hashref_a, $hashref_b) = @_;
+
+ my $returnvalue = 1;
+
+ my $key;
+ foreach $key ( keys %{$hashref_a} )
+ {
+ if ( ! exists($hashref_b->{$key}) )
+ {
+ print "*****\n";
+ foreach $keyb ( keys %{$hashref_b} ) { print "$keyb : $hashref_b->{$keyb}\n"; }
+ print "*****\n";
+ $returnvalue = 0;
+ }
+ }
+
+ return $returnvalue;
+}
+
+######################################################
+# Getting the first entry from a list of languages
+######################################################
+
+sub get_first_from_list
+{
+ my ( $list ) = @_;
+
+ my $first = $list;
+
+ if ( $list =~ /^\s*(.+?),(.+)\s*$/) # "?" for minimal matching
+ {
+ $first = $1;
+ }
+
+ return $first;
+}
+
+################################################
+# Setting all spellchecker languages
+################################################
+
+sub set_spellcheckerlanguages
+{
+ my ( $productlanguagesarrayref, $allvariables ) = @_;
+
+ my %productlanguages = ();
+ for ( my $i = 0; $i <= $#{$productlanguagesarrayref}; $i++ ) { $productlanguages{${$productlanguagesarrayref}[$i]} = 1; }
+
+ my $spellcheckfilename = $allvariables->{'SPELLCHECKERFILE'};
+
+ my $spellcheckfileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$spellcheckfilename, "", 1);
+
+ if ($$spellcheckfileref eq "") { installer::exiter::exit_program("ERROR: Could not find $spellcheckfilename!", "set_spellcheckerlanguages"); }
+
+ my $infoline = "Using spellchecker file: $$spellcheckfileref \n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+
+ my $spellcheckfile = installer::files::read_file($$spellcheckfileref);
+ my %spellcheckhash = ();
+
+ for ( my $j = 0; $j <= $#{$spellcheckfile}; $j++ )
+ {
+ # Analyzing all "key=value" lines
+ my $oneline = ${$spellcheckfile}[$j];
+
+ if ( $oneline =~ /^\s*(\S+)\s*\=\s*\"(.*?)\"\s*$/ ) # no white space allowed in key
+ {
+ my $onelang = $1;
+ my $languagelist = $2;
+
+ # Special handling for language packs. Only include the first language of the language list.
+ # If no spellchecker shall be included, the keyword "EMPTY" can be used.
+
+ if ( $installer::globals::languagepack )
+ {
+ my $first = get_first_from_list($languagelist);
+
+ if ( $first eq "EMPTY" ) # no spellchecker into language pack
+ {
+ $languagelist = "";
+ }
+ else
+ {
+ $languagelist = $first;
+ }
+ }
+ else # no language pack, so EMPTY is not required
+ {
+ $languagelist =~ s/^\s*EMPTY\s*,//; # removing the entry EMPTY
+ }
+
+ $spellcheckhash{$onelang} = $languagelist;
+ }
+ }
+
+ # Collecting all required languages in %installer::globals::spellcheckerlanguagehash
+
+ foreach my $lang (keys %productlanguages)
+ {
+ my $languagelist = "";
+ if ( exists($spellcheckhash{$lang}) ) { $languagelist = $spellcheckhash{$lang}; }
+ else { $languagelist = $spellcheckhash{'en-US'}; } # defaulting to English
+
+ my $langlisthash = installer::converter::convert_stringlist_into_hash(\$languagelist, ",");
+ foreach my $onelang ( keys %{$langlisthash} ) { $installer::globals::spellcheckerlanguagehash{$onelang} = 1; }
+ }
+
+ $installer::globals::analyze_spellcheckerlanguage = 1;
+
+ # Logging
+
+ my $langstring = "";
+ foreach my $lang (sort keys %installer::globals::spellcheckerlanguagehash) { $langstring = $langstring . "," . $lang }
+ $langstring =~ s/^\s*,//;
+
+ $infoline = "Collected spellchecker languages for spellchecker: $langstring \n";
+ push( @installer::globals::globallogfileinfo, $infoline);
+}
+
+################################################
+# Including a license text into setup script
+################################################
+
+sub put_license_into_setup
+{
+ my ($installdir, $includepatharrayref) = @_;
+
+ # find and read english license file
+ my $licenselanguage = "en-US"; # always english !
+ # my $licensefilename = "LICENSE_" . $licenselanguage;
+ my $licensefilename = "license_" . $licenselanguage . ".txt";
+ my $licenseincludepatharrayref = get_language_specific_include_pathes($includepatharrayref, $licenselanguage);
+
+ my $licenseref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$licensefilename, $licenseincludepatharrayref, 0);
+ if ($$licenseref eq "") { installer::exiter::exit_program("ERROR: Could not find License file $licensefilename!", "put_license_into_setup"); }
+ my $licensefile = installer::files::read_file($$licenseref);
+
+ # Read setup
+ my $setupfilename = $installdir . $installer::globals::separator . "setup";
+ my $setupfile = installer::files::read_file($setupfilename);
+
+ # Replacement
+ my $infoline = "Adding licensefile into setup script\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $includestring = "";
+ for ( my $i = 0; $i <= $#{$licensefile}; $i++ ) { $includestring = $includestring . ${$licensefile}[$i]; }
+ for ( my $i = 0; $i <= $#{$setupfile}; $i++ ) { ${$setupfile}[$i] =~ s/LICENSEFILEPLACEHOLDER/$includestring/; }
+
+ # Write setup
+ installer::files::save_file($setupfilename, $setupfile);
+}
+
+################################################
+# Setting global path to getuid.so library
+################################################
+
+sub set_getuid_path
+{
+ my ($includepatharrayref) = @_;
+
+ my $getuidlibraryname = "getuid.so";
+ my $getuidlibraryref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$getuidlibraryname, $includepatharrayref, 0);
+ if ($$getuidlibraryref eq "") { installer::exiter::exit_program("ERROR: Could not find $getuidlibraryname!", "set_getuid_path"); }
+
+ $installer::globals::getuidpath = $$getuidlibraryref;
+ $installer::globals::getuidpathset = 1;
+}
+
+#########################################################
+# Create a tar file from the binary package
+#########################################################
+
+sub tar_package
+{
+ my ( $installdir, $packagename, $tarfilename, $getuidlibrary) = @_;
+
+ my $ldpreloadstring = "";
+ if ( $getuidlibrary ne "" ) { $ldpreloadstring = "LD_PRELOAD=" . $getuidlibrary; }
+
+ my $systemcall = "cd $installdir; $ldpreloadstring tar -cf - $packagename > $tarfilename";
+ # my $systemcall = "cd $installdir; $ldpreloadstring tar -cf - * > $tarfilename";
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ my $localcall = "chmod 775 $tarfilename \>\/dev\/null 2\>\&1";
+ $returnvalue = system($localcall);
+
+ my $fulltarfile = $installdir . $installer::globals::separator . $tarfilename;
+ my $filesize = ( -s $fulltarfile );
+
+ return $filesize;
+}
+
+#########################################################
+# Create a tar file from the binary package
+#########################################################
+
+sub untar_package
+{
+ my ( $installdir, $tarfilename, $getuidlibrary) = @_;
+
+ my $ldpreloadstring = "";
+ if ( $getuidlibrary ne "" ) { $ldpreloadstring = "LD_PRELOAD=" . $getuidlibrary; }
+
+ my $systemcall = "cd $installdir; $ldpreloadstring tar -xf $tarfilename";
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: Could not execute \"$systemcall\"!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: Executed \"$systemcall\" successfully!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ my $localcall = "chmod 775 $tarfilename \>\/dev\/null 2\>\&1";
+ $returnvalue = system($localcall);
+}
+
+#########################################################
+# Shuffle an array (Fisher Yates shuffle)
+#########################################################
+
+sub shuffle_array
+{
+ my ( $arrayref ) = @_;
+
+ # my $counter = 0;
+ # my $infoline = "Old package order: \n";
+ # push( @installer::globals::logfileinfo, $infoline);
+ # foreach my $onepackage ( @{$arrayref} )
+ # {
+ # $counter++;
+ # $infoline = "$counter: $onepackage->{'module'}\n";
+ # push( @installer::globals::logfileinfo, $infoline);
+ # }
+
+ my $i = @$arrayref;
+ while (--$i)
+ {
+ my $j = int rand ($i+1);
+ @$arrayref[$i,$j] = @$arrayref[$j,$i];
+ }
+
+ # $counter = 0;
+ # $infoline = "New package order: \n";
+ # push( @installer::globals::logfileinfo, $infoline);
+ # foreach my $onepackage ( @{$arrayref} )
+ # {
+ # $counter++;
+ # $infoline = "$counter: $onepackage->{'module'}\n";
+ # push( @installer::globals::logfileinfo, $infoline);
+ # }
+}
+
+################################################
+# Defining the English license text to add
+# it into Solaris packages.
+################################################
+
+sub set_english_license
+{
+ my $additional_license_name = $installer::globals::englishsolarislicensename; # always the English file
+ my $licensefileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$additional_license_name, "" , 0);
+ if ( $$licensefileref eq "" ) { installer::exiter::exit_program("ERROR: Could not find license file $additional_license_name!", "set_english_license"); }
+ $installer::globals::englishlicenseset = 1;
+ $installer::globals::englishlicense = installer::files::read_file($$licensefileref);
+ installer::scpzipfiles::replace_all_ziplistvariables_in_file($installer::globals::englishlicense, $variableshashref);
+}
+
+##############################################
+# Setting time stamp of copied files to avoid
+# errors from pkgchk.
+##############################################
+
+sub set_time_stamp_for_file
+{
+ my ($sourcefile, $destfile) = @_;
+
+ my $systemcall = "touch -r $sourcefile $destfile";
+
+ my $returnvalue = system($systemcall);
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: \"$systemcall\" failed!\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Success: \"$systemcall\" !\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+}
+
+##############################################
+# Setting checksum and wordcount for changed
+# pkginfo file into pkgmap.
+##############################################
+
+sub change_onefile_in_pkgmap
+{
+ my ($pkgmapfile, $fullfilename, $shortfilename) = @_;
+
+ # 1 i pkginfo 442 34577 1166716297
+ # ->
+ # 1 i pkginfo 443 34737 1166716297
+ #
+ # wc -c pkginfo | cut -f6 -d' ' -> 442 (variable)
+ # sum pkginfo | cut -f1 -d' ' -> 34577 (variable)
+ # grep 'pkginfo' pkgmap | cut -f6 -d' ' -> 1166716297 (fix)
+
+ my $checksum = call_sum($fullfilename);
+ if ( $checksum =~ /^\s*(\d+)\s+.*$/ ) { $checksum = $1; }
+
+ my $wordcount = call_wc($fullfilename);
+ if ( $wordcount =~ /^\s*(\d+)\s+.*$/ ) { $wordcount = $1; }
+
+ for ( my $i = 0; $i <= $#{$pkgmapfile}; $i++ )
+ {
+ if ( ${$pkgmapfile}[$i] =~ /(^.*\b\Q$shortfilename\E\b\s+)(\d+)(\s+)(\d+)(\s+)(\d+)(\s*$)/ )
+ {
+ my $newline = $1 . $wordcount . $3 . $checksum . $5 . $6 . $7;
+ ${$pkgmapfile}[$i] = $newline;
+ last;
+ }
+ }
+}
+
+################################################
+# Adding the content of the English license
+# file into the system integration packages.
+################################################
+
+sub add_license_into_systemintegrationpackages
+{
+ my ($destdir, $packages) = @_;
+
+ for ( my $i = 0; $i <= $#{$packages}; $i++ )
+ {
+ my $copyrightfilename = ${$packages}[$i] . $installer::globals::separator . "install" . $installer::globals::separator . "copyright";
+ if ( ! -f $copyrightfilename ) { installer::exiter::exit_program("ERROR: Could not find license file in system integration package: $copyrightfilename!", "add_license_into_systemintegrationpackages"); }
+ my $copyrightfile = installer::files::read_file($copyrightfilename);
+
+ # Saving time stamp of old copyrightfile
+ my $savcopyrightfilename = $copyrightfilename . ".sav";
+ installer::systemactions::copy_one_file($copyrightfilename, $savcopyrightfilename);
+ set_time_stamp_for_file($copyrightfilename, $savcopyrightfilename); # now $savcopyrightfile has the time stamp of $copyrightfile
+
+ # Adding license content to copyright file
+ push(@{$copyrightfile}, "\n");
+ for ( my $i = 0; $i <= $#{$installer::globals::englishlicense}; $i++ ) { push(@{$copyrightfile}, ${$installer::globals::englishlicense}[$i]); }
+ installer::files::save_file($copyrightfilename, $copyrightfile);
+
+ # Setting the old time stamp saved with $savcopyrightfilename
+ set_time_stamp_for_file($savcopyrightfilename, $copyrightfilename); # now $copyrightfile has the time stamp of $savcopyrightfile
+ unlink($savcopyrightfilename);
+
+ # Changing content of copyright file in pkgmap
+ my $pkgmapfilename = ${$packages}[$i] . $installer::globals::separator . "pkgmap";
+ if ( ! -f $pkgmapfilename ) { installer::exiter::exit_program("ERROR: Could not find pkgmap in system integration package: $pkgmapfilename!", "add_license_into_systemintegrationpackages"); }
+ my $pkgmap = installer::files::read_file($pkgmapfilename);
+ change_onefile_in_pkgmap($pkgmap, $copyrightfilename, "copyright");
+ installer::files::save_file($pkgmapfilename, $pkgmap);
+ }
+}
+
+#########################################################
+# Collecting all pkgmap files from an installation set
+#########################################################
+
+sub collectpackagemaps
+{
+ my ( $installdir, $languagestringref, $allvariables ) = @_;
+
+ installer::logger::include_header_into_logfile("Collecing all packagemaps (pkgmap):");
+
+ my $pkgmapdir = installer::systemactions::create_directories("pkgmap", $languagestringref);
+ my $subdirname = $allvariables->{'UNIXPRODUCTNAME'} . "_pkgmaps";
+ my $pkgmapsubdir = $pkgmapdir . $installer::globals::separator . $subdirname;
+ if ( -d $pkgmapsubdir ) { installer::systemactions::remove_complete_directory($pkgmapsubdir); }
+ if ( ! -d $pkgmapsubdir ) { installer::systemactions::create_directory($pkgmapsubdir); }
+
+ $installdir =~ s/\/\s*$//;
+ # Collecting all packages in $installdir and its sub package ("packages")
+ my $searchdir = $installdir . $installer::globals::separator . $installer::globals::epmoutpath;
+
+ my $allpackages = installer::systemactions::get_all_directories_without_path($searchdir);
+
+ for ( my $i = 0; $i <= $#{$allpackages}; $i++ )
+ {
+ my $pkgmapfile = $searchdir . $installer::globals::separator . ${$allpackages}[$i] . $installer::globals::separator . "pkgmap";
+ my $destfilename = $pkgmapsubdir . $installer::globals::separator . ${$allpackages}[$i] . "_pkgmap";
+ installer::systemactions::copy_one_file($pkgmapfile, $destfilename);
+ }
+
+ # Create a tar gz file with all package maps
+ my $tarfilename = $subdirname . ".tar";
+ my $targzname = $tarfilename . ".gz";
+ # my $systemcall = "cd $pkgmapdir; tar -cf - $subdirname > $tarfilename";
+ $systemcall = "cd $pkgmapdir; tar -cf - $subdirname | gzip > $targzname";
+ make_systemcall($systemcall);
+ installer::systemactions::remove_complete_directory($pkgmapsubdir, 1);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/xpdinstaller.pm b/solenv/bin/modules/installer/xpdinstaller.pm
new file mode 100644
index 000000000000..c6938292b313
--- /dev/null
+++ b/solenv/bin/modules/installer/xpdinstaller.pm
@@ -0,0 +1,1832 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+package installer::xpdinstaller;
+
+use Cwd;
+use installer::converter;
+use installer::exiter;
+use installer::globals;
+use installer::languages;
+use installer::logger;
+use installer::pathanalyzer;
+use installer::remover;
+use installer::systemactions;
+
+
+#######################################################
+# Searching for the module name and description in the
+# modules collector
+#######################################################
+
+sub get_module_name_description
+{
+ my ($modulesarrayref, $onelanguage, $gid, $type) = @_;
+
+ my $found = 0;
+
+ my $newstring = "";
+
+ for ( my $i = 0; $i <= $#{$modulesarrayref}; $i++ )
+ {
+ my $onemodule = ${$modulesarrayref}[$i];
+
+ if ( $onemodule->{'gid'} eq $gid )
+ {
+ my $typestring = $type . " " . "(" . $onelanguage . ")";
+ if ( $onemodule->{$typestring} ) { $newstring = $onemodule->{$typestring}; }
+ $found = 1;
+ }
+
+ if ( $found ) { last; }
+ }
+
+ # defaulting to english
+
+ if ( ! $found )
+ {
+ my $defaultlanguage = "en-US";
+
+ for ( my $i = 0; $i <= $#{$modulesarrayref}; $i++ )
+ {
+ my $onemodule = ${$modulesarrayref}[$i];
+
+ if ( $onemodule->{'gid'} eq $gid )
+ {
+ my $typestring = $type . " " . "(" . $defaultlanguage . ")";
+ if ( $onemodule->{$typestring} ) { $newstring = $onemodule->{$typestring}; }
+ $found = 1;
+ }
+
+ if ( $found ) { last; }
+ }
+ }
+
+ return $newstring;
+}
+
+###################################################
+# Finding module, specified by the gid
+###################################################
+
+sub get_module
+{
+ my ($modulegid, $modulesarrayref) = @_;
+
+ my $found = 0;
+ my $searchmodule = "";
+
+ for ( my $i = 0; $i <= $#{$modulesarrayref}; $i++ )
+ {
+ my $onemodule = ${$modulesarrayref}[$i];
+
+ if ( $onemodule->{'gid'} eq $modulegid )
+ {
+ $searchmodule = $onemodule;
+ $found = 1;
+ last;
+ }
+
+ # if ( ! $found ) { installer::exiter::exit_program("ERROR: Could not find module belonging to gid $modulegid!", "get_module (xpdinstaller)"); }
+ }
+
+ return $searchmodule;
+}
+
+###################################################
+# Creating package start tag
+###################################################
+
+sub get_package_tag
+{
+ my ( $module, $indent, $linkpackage ) = @_;
+
+ my $modulegid = $module->{'gid'};
+ if ( $linkpackage ) { $modulegid = $modulegid . "u"; }
+ my $parentgid = "";
+ if ( $module->{'ParentID'} ) { $parentgid = $module->{'ParentID'}; }
+ if ( $parentgid eq "" ) { $parentgid = "root"; }
+ if ( $module->{'XPDParentID'} ) { $parentgid = $module->{'XPDParentID'}; } # changing parent of "Prg" and "Opt" to "root"
+
+ my $tag = $indent . "<package " . "name=" . "\"" . $modulegid . "\" " . "parent=" . "\"" . $parentgid . "\">" . "\n";
+
+ return ( $tag, $parentgid );
+}
+
+###################################################
+# Creating display start tag
+###################################################
+
+sub get_display_tag
+{
+ my ( $module, $indent ) = @_;
+
+ # Styles=(HIDDEN_ROOT)
+ my $styles = "";
+ my $type = "";
+ if ( $module->{'Styles'} ) { $styles = $module->{'Styles'}; }
+ if ( $styles =~ /\bHIDDEN_ROOT\b/ ) { $type = "hidden"; }
+ else { $type = "show"; }
+
+ # special handling for language modules. Only visible in multilingual installation set.
+ if (( $styles =~ /\bSHOW_MULTILINGUAL_ONLY\b/ ) && ( ! $installer::globals::ismultilingual )) { $type = "hidden"; }
+
+ # special handling for the root module, which has no parent
+ my $parentgid = "";
+ if ( $module->{'ParentID'} ) { $parentgid = $module->{'ParentID'}; }
+ if ( $parentgid eq "" ) { $type = "hidden"; }
+
+ my $tag = $indent . "<display " . "type=" . "\"" . $type . "\"" . ">" . "\n";
+
+ return $tag;
+}
+
+###################################################
+# Creating installunit start tag
+###################################################
+
+sub get_installunit_tag
+{
+ my ( $indent ) = @_;
+
+ my $type = $installer::globals::packageformat;
+
+ my $tag = $indent . "<installunit " . "type=" . "\"" . $type . "\"" . ">" . "\n";
+
+ return $tag;
+}
+
+###################################################
+# Creating simple start tags
+###################################################
+
+sub get_start_tag
+{
+ my ( $tag, $indent ) = @_;
+
+ my $starttag = $indent . "<" . $tag . ">" . "\n";
+ return $starttag;
+}
+
+###################################################
+# Creating end tags
+###################################################
+
+sub get_end_tag
+{
+ my ( $tag, $indent ) = @_;
+
+ my $endtag = $indent . "</" . $tag . ">" . "\n";
+ return $endtag;
+}
+
+###################################################
+# Creating simple complete tag
+###################################################
+
+sub get_tag_line
+{
+ my ( $indent, $name, $value ) = @_;
+ $value = '' unless defined $value;
+
+ my $line = $indent . "<" . $name . ">" . $value . "</" . $name . ">" . "\n";
+
+}
+
+###################################################
+# Asking module for sortkey entry
+###################################################
+
+sub get_sortkey_value
+{
+ my ( $module ) = @_;
+
+ my $value = "9999";
+
+ if ( $module->{'Sortkey'} ) { $value = $module->{'Sortkey'}; }
+
+ return $value;
+}
+
+###################################################
+# Asking module for default entry
+###################################################
+
+sub get_default_value
+{
+ my ( $module ) = @_;
+
+ my $value = "";
+
+ if ( $module->{'Default'} ) { $value = $module->{'Default'}; } # is YES or NO
+
+ if ( $value =~ /\bNO\b/i ) { $value = "false"; }
+ else { $value = "true"; }
+
+ return $value;
+}
+
+###################################################
+# Asking module for showinuserinstall entry
+# scp style: DONTSHOWINUSERINSTALL
+###################################################
+
+sub get_showinuserinstall_value
+{
+ my ( $module ) = @_;
+
+ my $value = "true";
+
+ my $styles = "";
+ if ( $module->{'Styles'} ) { $styles = $module->{'Styles'}; }
+ if ( $styles =~ /\bDONTSHOWINUSERINSTALL\b/ ) { $value = "false"; }
+
+ return $value;
+}
+
+###################################################
+# Asking module for showinuserinstall entry
+# scp style: USERINSTALLONLY
+###################################################
+
+sub get_userinstallonly_value
+{
+ my ( $module ) = @_;
+
+ my $value = "false";
+
+ my $styles = "";
+ if ( $module->{'Styles'} ) { $styles = $module->{'Styles'}; }
+ if ( $styles =~ /\bUSERINSTALLONLY\b/ ) { $value = "true"; }
+
+ return $value;
+}
+
+###################################################
+# Asking module for dontuninstall entry
+# scp style: DONTUNINSTALL
+###################################################
+
+sub get_dontuninstall_value
+{
+ my ( $module ) = @_;
+
+ my $value = "false";
+
+ my $styles = "";
+ if ( $module->{'Styles'} ) { $styles = $module->{'Styles'}; }
+ if ( $styles =~ /\bDONTUNINSTALL\b/ ) { $value = "true"; }
+
+ return $value;
+}
+
+###################################################
+# Asking module for XpdCheckSolaris entry
+# (belongs to scp module)
+###################################################
+
+sub get_checksolaris_value
+{
+ my ( $module ) = @_;
+
+ my $value = "";
+ if ( $module->{'XpdCheckSolaris'} ) { $value = $module->{'XpdCheckSolaris'}; }
+
+ return $value;
+}
+
+###################################################
+# Asking module for isupdatepackage entry
+# scp style: ISUPDATEPACKAGE
+###################################################
+
+sub get_isupdatepackage_value
+{
+ my ( $module ) = @_;
+
+ my $value = "false";
+
+ my $styles = "";
+ if ( $module->{'Styles'} ) { $styles = $module->{'Styles'}; }
+ if ( $styles =~ /\bISUPDATEPACKAGE\b/ ) { $value = "true"; }
+
+ return $value;
+}
+
+###################################################
+# Asking module for showmultilingualonly entry
+# scp style: SHOW_MULTILINGUAL_ONLY
+###################################################
+
+sub get_showmultilingualonly_value
+{
+ my ( $module ) = @_;
+
+ my $value = "false";
+
+ my $styles = "";
+ if ( $module->{'Styles'} ) { $styles = $module->{'Styles'}; }
+ if ( $styles =~ /\bSHOW_MULTILINGUAL_ONLY\b/ ) { $value = "true"; }
+
+ return $value;
+}
+
+###################################################
+# Asking module for showmultilingualonly entry
+# scp style: SHOW_MULTILINGUAL_ONLY
+###################################################
+
+sub get_applicationmodule_value
+{
+ my ( $module ) = @_;
+
+ my $value = "false";
+
+ my $styles = "";
+ if ( $module->{'Styles'} ) { $styles = $module->{'Styles'}; }
+ if ( $styles =~ /\bAPPLICATIONMODULE\b/ ) { $value = "true"; }
+
+ return $value;
+}
+
+###################################################
+# Asking module for java module entry
+# scp style: JAVAMODULE
+###################################################
+
+sub get_isjavamodule_value
+{
+ my ( $module ) = @_;
+
+ my $value = "false";
+
+ my $styles = "";
+ if ( $module->{'Styles'} ) { $styles = $module->{'Styles'}; }
+ if ( $styles =~ /\bJAVAMODULE\b/ ) { $value = "true"; }
+
+ return $value;
+}
+
+#####################################################################
+# Asking module, if installation shall use --force
+# scp style: USEFORCE (Linux only)
+#####################################################################
+
+sub get_useforce_value
+{
+ my ( $module ) = @_;
+
+ my $value = "false";
+
+ my $styles = "";
+ if ( $module->{'Styles'} ) { $styles = $module->{'Styles'}; }
+ if ( $styles =~ /\bUSEFORCE\b/ ) { $value = "true"; }
+
+ return $value;
+}
+
+###################################################
+# Asking module, if installation can fail
+# scp style: INSTALLCANFAIL
+###################################################
+
+sub get_installcanfail_value
+{
+ my ( $module ) = @_;
+
+ my $value = "false";
+
+ my $styles = "";
+ if ( $module->{'Styles'} ) { $styles = $module->{'Styles'}; }
+ if ( $styles =~ /\bINSTALLCANFAIL\b/ ) { $value = "true"; }
+
+ return $value;
+}
+
+###################################################
+# Asking module, if installation can fail
+# scp style: INSTALLCANFAIL
+###################################################
+
+sub get_forceintoupdate_value
+{
+ my ( $module ) = @_;
+
+ my $value = "false";
+
+ my $styles = "";
+ if ( $module->{'Styles'} ) { $styles = $module->{'Styles'}; }
+ if ( $styles =~ /\bFORCEINTOUPDATE\b/ ) { $value = "true"; }
+
+ return $value;
+}
+
+###################################################
+# Substituting all occurences of "<" by "&lt;"
+# and all occurences of ">" by "&gt;"
+###################################################
+
+sub replace_brackets_in_string
+{
+ my ( $string ) = @_;
+
+ if ( $string =~ /\</ ) { $string =~ s/\</\&lt\;/g; }
+ if ( $string =~ /\>/ ) { $string =~ s/\>/\&gt\;/g; }
+
+ return $string;
+}
+
+###################################################
+# Substituting all occurences of "\uUXYZ" by
+# "&#xUXYZ;", because the use xml saxparser does
+# not know anything about this encoding. Therfore
+# the xml file can keep standard encoding "UTF-8"
+# and all strings with "\uUXYZ" do not need to
+# be converted from the Java installer.
+###################################################
+
+sub replace_javaencoding_in_string
+{
+ my ( $string ) = @_;
+
+ while ( $string =~ /(\\u\w\w\w\w)/ )
+ {
+ my $oldvalue = $1;
+ my $newvalue = "";
+ if ( $oldvalue =~ /\\u(\w\w\w\w)/ )
+ {
+ my $number = $1;
+ $newvalue = "&#x" . $number . ";";
+ }
+
+ $string =~ s/\Q$oldvalue\E/$newvalue/;
+ }
+
+ return $string;
+}
+
+###################################################
+# Collecting language dependent entries from scp
+# (Name and Description)
+###################################################
+
+sub collect_lang_values
+{
+ my ($indent, $module, $xpdfile, $searchentry, $saveentry) = @_;
+
+ foreach $key (keys %{$module})
+ {
+ my $write_line = 0;
+ my $javalanguage = "";
+
+ if ( $key =~ /^\s*\Q$searchentry\E\s+\((\S+)\)\s*$/ ) # this are the language dependent keys
+ {
+ $language = $1;
+ $javalanguage = installer::languages::get_java_language($language);
+ $write_line = 1;
+ }
+ elsif ( $key =~ /^\s*\Q$searchentry\E\s*$/ ) # this are the language independent keys
+ {
+ $javalanguage = "en_US";
+ $write_line = 1;
+ }
+
+ if ( $write_line )
+ {
+ my $value = $module->{$key};
+ $value = replace_brackets_in_string($value);
+ $value = replace_javaencoding_in_string($value);
+ my $line = $indent . "<" . $saveentry . " lang=" . "\"" . $javalanguage . "\"" . ">" . $value . "<\/" . $saveentry . ">" . "\n";
+ push(@{$xpdfile}, $line);
+ }
+ }
+}
+
+###################################################
+# Removing language dependent entries from
+# module hash (Name and Description)
+###################################################
+
+sub remove_lang_values
+{
+ my ($module, $searchentry) = @_;
+
+ my $key = "";
+
+ foreach $key (keys %{$module})
+ {
+ if ( $key =~ /^\s*\Q$searchentry\E\s+\((\S+)\)\s*$/ ) # this are the language dependent keys
+ {
+ delete($module->{$key});
+ }
+ }
+}
+
+###################################################
+# Setting package install order
+###################################################
+
+sub get_order_value
+{
+ my ( $module ) = @_;
+
+ my $value = "1000"; # Setting the default value
+
+ if ( $module->{'InstallOrder'} ) { $value = $module->{'InstallOrder'}; }
+
+ return $value;
+}
+
+###################################################
+# Checking size of package
+###################################################
+
+sub get_size_value
+{
+ my ( $packagename, $xpdinfo ) = @_;
+
+ my $value = "";
+
+ if ( $xpdinfo->{'FileSize'} )
+ {
+ $value = $xpdinfo->{'FileSize'};
+ return $value;
+ }
+
+ my $isrpmfile = 0;
+ if ( $packagename =~ /\.rpm\s*$/ ) { $isrpmfile = 1; }
+
+ if (( $installer::globals::islinuxrpmbuild ) && ( $isrpmfile ))
+ {
+ # if ( ! $installer::globals::rpmquerycommand ) { installer::exiter::exit_program("ERROR: rpm not found for querying packages!", "get_size_value"); }
+ if ( ! $installer::globals::rpmquerycommand ) { $installer::globals::rpmquerycommand = "rpm"; }
+
+ my $systemcall = "$installer::globals::rpmquerycommand -qp --queryformat \"\[\%\{FILESIZES\}\\n\]\" $packagename 2\>\&1 |";
+ my $ld_library_backup = $ENV{LD_LIBRARY_PATH};
+ if ( defined $ENV{SYSBASE}) {
+ my $sysbase = $ENV{SYSBASE};
+ if ( !defined ($ld_library_backup) or ("$ld_library_backup" eq "") ) {
+ $ld_library_backup = "" if ! defined $ld_library_backup;
+ $ENV{LD_LIBRARY_PATH} = "$sysbase/usr/lib";
+ } else {
+ $ENV{LD_LIBRARY_PATH} = "$ld_library_backup:$sysbase/lib";
+ }
+ }
+ my ($rpmout, $error) = make_systemcall_allowing_error($systemcall, 0, 1);
+ $ENV{LD_LIBRARY_PATH} = $ld_library_backup;
+ # Evaluating an error, because of rpm problems with removed LD_LIBRARY_PATH
+ if ( $error )
+ {
+ installer::logger::print_message( "... trying /usr/bin/rpm ...\n" );
+ my $systemcall = "/usr/bin/rpm -qp --queryformat \"\[\%\{FILESIZES\}\\n\]\" $packagename 2\>\&1 |";
+ ($rpmout, $error) = make_systemcall_allowing_error($systemcall, 0, 0);
+ if ( $error ) { installer::exiter::exit_program("ERROR: rpm failed to query package!", "get_size_value"); }
+ }
+ $value = do_sum($rpmout); # adding all filesizes in bytes
+ $value = $value/1000;
+
+ my $ganzzahl = int $value;
+ if ($ganzzahl < $value) { $value = $ganzzahl + 1; }
+ else { $value = $ganzzahl; }
+
+ my $rpmname = $packagename;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$rpmname);
+ $infoline = "Filesize $rpmname : $value\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ my $filename = "pkgmap";
+ $filename = $packagename . $installer::globals::separator . $filename;
+ $file = installer::files::read_file($filename);
+
+ for ( my $i = 0; $i <= $#{$file}; $i++ )
+ {
+ my $line = ${$file}[$i];
+ if ( $line =~ /^\s*\:\s+\d+\s+(\d+?)\s+/ )
+ {
+ $value = $1;
+ if ( ! ( $value%2 == 0 )) { $value = $value + 1; }
+ $value = $value/2; # not blocks, but kB
+ last;
+ }
+ }
+ }
+
+ if ( $value eq "" ) { $value = "0"; }
+
+ return $value;
+}
+
+###################################################
+# Checking md5 of package
+###################################################
+
+sub get_md5_value
+{
+ my ( $packagename, $xpdinfo ) = @_;
+
+ my $value = "";
+
+ if ( $xpdinfo->{'md5sum'} )
+ {
+ $value = $xpdinfo->{'md5sum'};
+ return $value;
+ }
+
+ if ( $installer::globals::islinuxrpmbuild )
+ {
+ my $md5file = "/usr/bin/md5sum";
+
+ if ( -x $md5file )
+ {
+ my $systemcall = "$md5file $packagename 2\>\&1 |";
+ my $md5out = make_systemcall($systemcall, 1);
+ $value = ${$md5out}[0];
+ if ( $value =~ /^\s*(\S+?)\s+.*$/ )
+ {
+ $value = $1;
+ }
+
+ my $rpmname = $packagename;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$rpmname);
+ $infoline = "md5sum of $rpmname : $value\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+
+ return $value;
+}
+
+###################################################
+# Checking name of package
+###################################################
+
+sub get_name_value
+{
+ my ( $packagename ) = @_;
+
+ my $value = $packagename;
+
+ # $packagename contains the complete path to the package
+ # Only the name of file or directory is required
+
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$value);
+
+ return $value;
+}
+
+###################################################
+# Checking full package name (Linux only)
+###################################################
+
+sub get_fullpkgname_value
+{
+ my ( $packagename, $xpdinfo ) = @_;
+
+ my $value = "";
+ my $isrpmfile = 0;
+ if ( $packagename =~ /\.rpm\s*$/ ) { $isrpmfile = 1; }
+
+ if (( $installer::globals::islinuxrpmbuild ) && ( $isrpmfile ))
+ {
+ if ( $xpdinfo->{'FullPackageName'} )
+ {
+ $value = $xpdinfo->{'FullPackageName'};
+ return $value;
+ }
+
+ # if ( ! $installer::globals::rpmquerycommand ) { installer::exiter::exit_program("ERROR: rpm not found for querying packages!", "get_fullpkgname_value"); }
+ if ( ! $installer::globals::rpmquerycommand ) { $installer::globals::rpmquerycommand = "rpm"; }
+ my $systemcall = "$installer::globals::rpmquerycommand -qp $packagename |";
+ my $ld_library_backup = $ENV{LD_LIBRARY_PATH};
+ if ( defined $ENV{SYSBASE}) {
+ my $sysbase = $ENV{SYSBASE};
+ if ( !defined ($ld_library_backup) or ("$ld_library_backup" eq "") ) {
+ $ld_library_backup = "" if ! defined $ld_library_backup;
+ $ENV{LD_LIBRARY_PATH} = "$sysbase/usr/lib";
+ } else {
+ $ENV{LD_LIBRARY_PATH} = "$ld_library_backup:$sysbase/lib";
+ }
+ }
+ my ($returnarray, $error) = make_systemcall_allowing_error($systemcall, 0, 1);
+ $ENV{LD_LIBRARY_PATH} = $ld_library_backup;
+ # Evaluating an error, because of rpm problems with removed LD_LIBRARY_PATH
+ if ( $error )
+ {
+ installer::logger::print_message( "... trying /usr/bin/rpm ...\n" );
+ my $systemcall = "/usr/bin/rpm -qp $packagename |";
+ ($returnarray, $error) = make_systemcall_allowing_error($systemcall, 0, 0);
+ if ( $error ) { installer::exiter::exit_program("ERROR: rpm failed to query package!", "get_fullpkgname_value"); }
+ }
+ $value = ${$returnarray}[0];
+ installer::remover::remove_leading_and_ending_whitespaces(\$value);
+
+ my $rpmname = $packagename;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$rpmname);
+
+ $infoline = "Full package name from $rpmname: $value\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return $value;
+}
+
+###################################################
+# Checking package version (Solaris only)
+###################################################
+
+sub get_pkgversion_value
+{
+ my ( $completepackagename, $xpdinfo ) = @_;
+
+ my $value = "";
+
+ if ( $xpdinfo->{'PkgVersion'} )
+ {
+ $value = $xpdinfo->{'PkgVersion'};
+ return $value;
+ }
+
+ if ( $installer::globals::issolarispkgbuild )
+ {
+ my $pkgfile = "pkgparam";
+ my $packagepath = $completepackagename;
+ installer::pathanalyzer::get_path_from_fullqualifiedname(\$packagepath);
+
+ my $packagename = $completepackagename;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$packagename);
+
+ my $systemcall = "$pkgfile -d $packagepath $packagename param VERSION 2\>\&1 |";
+ my $returnarray = make_systemcall($systemcall, 0);
+
+ $value = ${$returnarray}[0];
+ installer::remover::remove_leading_and_ending_whitespaces(\$value);
+ }
+
+ return $value;
+}
+
+###################################################
+# Writing subdirectory into xpd file
+###################################################
+
+sub get_subdir_value
+{
+ my ( $packagename, $subdir, $module ) = @_;
+
+ my $value = "";
+
+ if ( $subdir ) { $value = $subdir; }
+
+ if ( $module->{'Subdir'} ) { $value = $module->{'Subdir'}; }
+
+ return $value;
+}
+
+###################################################
+# Checking if package is relocatable
+###################################################
+
+sub get_relocatable_value
+{
+ my ( $module ) = @_;
+
+ my $value = "true";
+
+ my $styles = "";
+ if ( $module->{'Styles'} ) { $styles = $module->{'Styles'}; }
+ if ( $styles =~ /\bNOTRELOCATABLE\b/ ) { $value = "false"; }
+
+ return $value;
+}
+
+###################################################
+# Checking if package is relocatable
+###################################################
+
+sub get_languagespecific_value
+{
+ my ( $islanguagemodule ) = @_;
+
+ my $value = "false";
+
+ if ( defined $islanguagemodule && $islanguagemodule == 1 ) { $value = "true"; }
+
+ return $value;
+}
+
+#######################################################
+# Adding the values of the array
+#######################################################
+
+sub do_sum
+{
+ my ( $allnumbers ) = @_;
+
+ my $sum = 0;
+
+ for ( my $i = 0; $i <= $#{$allnumbers}; $i++ )
+ {
+ $sum = $sum + ${$allnumbers}[$i];
+ }
+
+ return $sum;
+}
+
+#######################################################
+# Executing one system call
+#######################################################
+
+sub make_systemcall
+{
+ my ( $systemcall, $logreturn ) = @_;
+
+ my @returns = ();
+
+ installer::logger::print_message( "... $systemcall ...\n" );
+
+ open (REG, "$systemcall");
+ while (<REG>) {push(@returns, $_); }
+ close (REG);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $logreturn )
+ {
+ for ( my $j = 0; $j <= $#returns; $j++ ) { push( @installer::globals::logfileinfo, "$returns[$j]"); }
+ }
+
+ if ($returnvalue)
+ {
+ $infoline = "ERROR: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $error_occured = 1;
+ }
+ else
+ {
+ $infoline = "SUCCESS: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return \@returns;
+}
+
+#######################################################
+# Executing one system call
+#######################################################
+
+sub make_systemcall_allowing_error
+{
+ my ( $systemcall, $logreturn, $can_fail ) = @_;
+
+ my @returns = ();
+
+ installer::logger::print_message( "... $systemcall ...\n" );
+
+ open (REG, "$systemcall");
+ while (<REG>) {push(@returns, $_); }
+ close (REG);
+
+ my $returnvalue = $?; # $? contains the return value of the systemcall
+
+ my $infoline = "Systemcall: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $logreturn )
+ {
+ for ( my $j = 0; $j <= $#returns; $j++ ) { push( @installer::globals::logfileinfo, "$returns[$j]"); }
+ }
+
+ if ($returnvalue)
+ {
+ if ( $can_fail )
+ {
+ $infoline = "WARNING: Failed system call: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $error_occured = 1;
+ }
+ else
+ {
+ $infoline = "ERROR: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ $error_occured = 1;
+ }
+ }
+ else
+ {
+ $infoline = "SUCCESS: $systemcall\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ return (\@returns, $returnvalue);
+}
+
+###################################################
+# Setting product name tag
+###################################################
+
+sub get_product_tag
+{
+ my ($allvariables, $indent) = @_;
+
+ my $productname = $allvariables->{'LCONEWORDPRODUCTNAME'};
+ my $tag = $indent . "<product " . "name=" . "\"" . $productname . "\">" . "\n";
+
+ return $tag;
+}
+
+###################################################
+# Macro tags
+###################################################
+
+sub set_macro_tag
+{
+ my ($allvariables, $indent, $key) = @_;
+
+ my $property = "";
+ my $value = "";
+
+ if ( $key eq "product_name" ) { $property = "PRODUCTNAME"; }
+ elsif ( $key eq "product_version" ) { $property = "PRODUCTVERSION"; }
+ elsif ( $key eq "product_suffix" ) { $property = "PRODUCTEXTENSION"; }
+ elsif ( $key eq "product_fullname" ) { $property = "FULLPRODUCTNAME"; }
+
+ if (( $property eq "PRODUCTNAME" ) || ( $property eq "PRODUCTVERSION" ) || ( $property eq "PRODUCTEXTENSION" ))
+ {
+ $value = $allvariables->{$property};
+ }
+
+ if ( $property eq "FULLPRODUCTNAME" )
+ {
+ $value = $allvariables->{"PRODUCTNAME"} . " " . $allvariables->{"PRODUCTVERSION"};
+ if ( $allvariables->{"PRODUCTEXTENSION"} ) { $value = $value . " " . $allvariables->{"PRODUCTEXTENSION"}; }
+ }
+
+ my $tag = $indent . "<macro " . "key=" . "\"" . $key . "\">" . $value . "\<\/macro\>" . "\n";
+
+ return $tag;
+
+}
+
+###################################################
+# Setting the minor of the product version
+# Required to check for Major Upgrades.
+###################################################
+
+sub set_minor_tag
+{
+ my ($allvariables, $indent) = @_;
+
+ my $productminor = 0;
+ if ( $allvariables->{"PACKAGEVERSION"} )
+ {
+ if ( $allvariables->{"PACKAGEVERSION"} =~ /^\s*\d+\.(\d+)/ ) { $productminor = $1; }
+ }
+ my $tag = $indent . "<productminor>" . $productminor . "</productminor>" . "\n";
+
+ return $tag;
+}
+
+###################################################
+# Setting the update behaviour
+###################################################
+
+sub set_update_tag
+{
+ my ($allvariables, $indent) = @_;
+
+ my $updateflag = "false";
+ if ( $allvariables->{"DONTUPDATE"} ) { $updateflag = "true"; }
+ my $tag = $indent . "<dontupdate>" . $updateflag . "</dontupdate>" . "\n";
+
+ return $tag;
+}
+
+###################################################
+# Setting the license dialog behaviour
+###################################################
+
+sub set_hideeula_tag
+{
+ my ($allvariables, $indent) = @_;
+
+ my $hidelicenseflag = "false";
+ if ( $allvariables->{"HIDELICENSEDIALOG"} ) { $hidelicenseflag = "true"; }
+ my $tag = $indent . "<hideeula>" . $hidelicenseflag . "</hideeula>" . "\n";
+
+ return $tag;
+}
+
+###################################################
+# Setting default directory
+###################################################
+
+sub set_defaultdir_tag
+{
+ my ($allvariables, $indent) = @_;
+
+ my $defaultdir = "";
+ if ( $allvariables->{"DEFAULTDESTPATH"} ) { $defaultdir = $allvariables->{"DEFAULTDESTPATH"}; }
+ my $tag = $indent . "<defaultdir>" . $defaultdir . "</defaultdir>" . "\n";
+
+ return $tag;
+}
+
+###################################################
+# Setting product directory
+###################################################
+
+sub set_productdir_tag
+{
+ my ($allvariables, $indent) = @_;
+
+ my $productdir = "";
+ if ( $allvariables->{"UNIXPRODUCTNAME"} )
+ {
+ $productdir = $allvariables->{"UNIXPRODUCTNAME"};
+
+ if ( $allvariables->{"BRANDPACKAGEVERSION"} )
+ {
+ $productdir = $productdir . $allvariables->{"BRANDPACKAGEVERSION"};
+# if ( $allvariables->{"LCPRODUCTEXTENSION"} ) { $productdir = $productdir . $allvariables->{"LCPRODUCTEXTENSION"}; }
+ }
+ else
+ {
+ if ( $allvariables->{"PRODUCTVERSION"} )
+ {
+ $productdir = $productdir . $allvariables->{"PRODUCTVERSION"};
+ }
+ }
+ }
+ my $tag = $indent . "<productdir>" . $productdir . "</productdir>" . "\n";
+
+ return $tag;
+}
+
+#####################################################
+# Setting the package directory in installation set
+#####################################################
+
+sub set_packagedir_tag
+{
+ my ($indent) = @_;
+
+ my $tag = $indent . "<packagedirectory>" . $installer::globals::epmoutpath . "</packagedirectory>" . "\n";
+
+ return $tag;
+}
+
+###################################################
+# Setting the packagetype of installation set
+###################################################
+
+sub set_packagetype_tag
+{
+ my ($indent) = @_;
+
+ my $tag = $indent . "<packageformat>" . $installer::globals::packageformat . "</packageformat>" . "\n";
+
+ return $tag;
+}
+
+###################################################
+# Setting the architecture of installation set
+###################################################
+
+sub set_architecture_tag
+{
+ my ($indent) = @_;
+
+ my $architecture = "";
+ if ( $installer::globals::issolarissparcbuild ) { $architecture = "sparc"; }
+ if ( $installer::globals::issolarisx86build ) { $architecture = "i386"; }
+
+ my $tag = $indent . "<architecture>" . $architecture . "</architecture>" . "\n";
+
+ return $tag;
+}
+
+###################################################
+# Setting the multi language tag
+###################################################
+
+sub set_multilanguage_tag
+{
+ my ($indent) = @_;
+
+ my $value = "false";
+ if ( $installer::globals::ismultilingual == 1 ) { $value = "true"; }
+
+ my $tag = $indent . "<multilingual>" . $value . "</multilingual>" . "\n";
+
+ return $tag;
+}
+
+###################################################
+# Setting the language tag
+###################################################
+
+sub set_language_tag
+{
+ my ($languagestringref, $indent) = @_;
+
+ my $tag = $indent . "<languages>" . $$languagestringref . "</languages>" . "\n";
+
+ return $tag;
+}
+
+###################################################
+# Collecting content for product xpd file
+###################################################
+
+# <?xml version='1.0' encoding='utf-8'?>
+#
+# <!-- General application description -->
+#
+# <product name="openoffice">
+# <macro key="product_name">Sun OpenOffice.org</macro>
+# <macro key="product_version">1.0</macro>
+# <macro key="product_suffix">Mephisto</macro>
+# <macro key="product_fullname">Sun OpenOffice.org 1.0 Mephisto</macro>
+# <defaultdir>/opt/Sun/OpenOffice.org-Mephisto</defaultdir>
+# </product>
+
+sub get_setup_file_content
+{
+ my ($allvariables, $languagestringref) = @_;
+
+ my @xpdfile = ();
+ my $noindent = "";
+ my $singleindent = " ";
+
+ my $line = "<?xml version='1.0' encoding='utf-8'?>\n\n";
+ push(@xpdfile, $line);
+ $line = "<!-- General application description -->\n\n";
+ push(@xpdfile, $line);
+
+ my $tag = get_product_tag($allvariables, $noindent);
+ push(@xpdfile, $tag);
+
+ $tag = set_macro_tag($allvariables, $singleindent, "product_name");
+ push(@xpdfile, $tag);
+ $tag = set_macro_tag($allvariables, $singleindent, "product_version");
+ push(@xpdfile, $tag);
+ $tag = set_macro_tag($allvariables, $singleindent, "product_suffix");
+ push(@xpdfile, $tag);
+ $tag = set_macro_tag($allvariables, $singleindent, "product_fullname");
+ push(@xpdfile, $tag);
+
+ $tag = set_defaultdir_tag($allvariables, $singleindent);
+ push(@xpdfile, $tag);
+
+ $tag = set_productdir_tag($allvariables, $singleindent);
+ push(@xpdfile, $tag);
+
+ $tag = set_minor_tag($allvariables, $singleindent);
+ push(@xpdfile, $tag);
+
+ $tag = set_update_tag($allvariables, $singleindent);
+ push(@xpdfile, $tag);
+
+ $tag = set_packagedir_tag($singleindent);
+ push(@xpdfile, $tag);
+
+ $tag = set_packagetype_tag($singleindent);
+ push(@xpdfile, $tag);
+
+ $tag = set_architecture_tag($singleindent);
+ push(@xpdfile, $tag);
+
+ $tag = set_multilanguage_tag($singleindent);
+ push(@xpdfile, $tag);
+
+ $tag = set_language_tag($languagestringref, $singleindent);
+ push(@xpdfile, $tag);
+
+ $tag = set_hideeula_tag($allvariables, $singleindent);
+ push(@xpdfile, $tag);
+
+ $tag = get_end_tag("product", $noindent);
+ push(@xpdfile, $tag);
+
+ return \@xpdfile;
+}
+
+###################################################
+# Collecting content for xpd file
+###################################################
+
+sub get_file_content
+{
+ my ( $module, $packagename, $solslanguage, $linkpackage, $isemptyparent, $subdir, $islanguagemodule, $onelanguage, $xpdinfo ) = @_;
+
+ my @xpdfile = ();
+ my $value = "";
+ my $line = "";
+ my $noindent = "";
+ my $singleindent = " ";
+ my $doubleindent = $singleindent . $singleindent;
+
+ my ( $tag, $parentgid ) = get_package_tag($module, $noindent, $linkpackage);
+ push(@xpdfile, $tag);
+
+ # start of installunit tag -> using info from scp module
+
+ $tag = get_display_tag($module, $singleindent);
+ push(@xpdfile, $tag);
+
+ $value = get_sortkey_value($module);
+ $line = get_tag_line($doubleindent, "sortkey", $value);
+ push(@xpdfile, $line);
+
+ $value = get_default_value($module);
+ $line = get_tag_line($doubleindent, "default", $value);
+ push(@xpdfile, $line);
+
+ $value = get_showinuserinstall_value($module);
+ $line = get_tag_line($doubleindent, "showinuserinstall", $value);
+ push(@xpdfile, $line);
+
+ $value = get_userinstallonly_value($module);
+ $line = get_tag_line($doubleindent, "showinuserinstallonly", $value);
+ push(@xpdfile, $line);
+
+ $value = get_dontuninstall_value($module);
+ $line = get_tag_line($doubleindent, "dontuninstall", $value);
+ push(@xpdfile, $line);
+
+ $value = get_checksolaris_value($module);
+ $line = get_tag_line($doubleindent, "checksolaris", $value);
+ push(@xpdfile, $line);
+
+ $value = get_isupdatepackage_value($module);
+ $line = get_tag_line($doubleindent, "isupdatepackage", $value);
+ push(@xpdfile, $line);
+
+ $value = get_showmultilingualonly_value($module);
+ $line = get_tag_line($doubleindent, "showmultilingualonly", $value);
+ push(@xpdfile, $line);
+
+ $value = get_applicationmodule_value($module);
+ $line = get_tag_line($doubleindent, "applicationmodule", $value);
+ push(@xpdfile, $line);
+
+ $value = get_isjavamodule_value($module);
+ $line = get_tag_line($doubleindent, "isjavapackage", $value);
+ push(@xpdfile, $line);
+
+ $value = get_installcanfail_value($module);
+ $line = get_tag_line($doubleindent, "installcanfail", $value);
+ push(@xpdfile, $line);
+
+ $value = get_forceintoupdate_value($module);
+ $line = get_tag_line($doubleindent, "forceintoupdate", $value);
+ push(@xpdfile, $line);
+
+ $value = get_useforce_value($module);
+ $line = get_tag_line($doubleindent, "useforce", $value);
+ push(@xpdfile, $line);
+
+ # iterating over all languages to get names and descriptions
+ collect_lang_values($doubleindent, $module, \@xpdfile, "Name", "name");
+ collect_lang_values($doubleindent, $module, \@xpdfile, "Description", "description");
+
+ $tag = get_end_tag("display", $singleindent);
+ push(@xpdfile, $tag);
+
+ # end of display tag
+
+ if ( ! $isemptyparent )
+ {
+ # start of installunit tag -> using info from package defined in packagelist
+
+ $tag = get_installunit_tag($singleindent);
+ push(@xpdfile, $tag);
+
+ $value = get_size_value($packagename, $xpdinfo);
+ $line = get_tag_line($doubleindent, "size", $value);
+ push(@xpdfile, $line);
+
+ $value = get_order_value($module);
+ $line = get_tag_line($doubleindent, "installorder", $value);
+ push(@xpdfile, $line);
+
+ $value = get_md5_value($packagename, $xpdinfo);
+ $line = get_tag_line($doubleindent, "md5", $value);
+ push(@xpdfile, $line);
+
+ $value = get_name_value($packagename);
+ $line = get_tag_line($doubleindent, "name", $value);
+ push(@xpdfile, $line);
+
+ $value = get_fullpkgname_value($packagename, $xpdinfo);
+ $line = get_tag_line($doubleindent, "fullpkgname", $value);
+ push(@xpdfile, $line);
+
+ $value = get_pkgversion_value($packagename, $xpdinfo);
+ $line = get_tag_line($doubleindent, "pkgversion", $value);
+ push(@xpdfile, $line);
+
+ $value = get_subdir_value($packagename, $subdir, $module);
+ $line = get_tag_line($doubleindent, "subdir", $value);
+ push(@xpdfile, $line);
+
+ $value = get_relocatable_value($module);
+ $line = get_tag_line($doubleindent, "relocatable", $value);
+ push(@xpdfile, $line);
+
+ $value = get_languagespecific_value($islanguagemodule);
+ $line = get_tag_line($doubleindent, "languagespecific", $value);
+ push(@xpdfile, $line);
+
+ $value = $onelanguage;
+ $line = get_tag_line($doubleindent, "language", $value);
+ push(@xpdfile, $line);
+
+ $line = get_tag_line($doubleindent, "solarislanguage", $solslanguage);
+ push(@xpdfile, $line);
+
+ $tag = get_end_tag("installunit", $singleindent);
+ push(@xpdfile, $tag);
+
+ # end of installunit tag
+ }
+
+ $tag = get_end_tag("package", $noindent);
+ push(@xpdfile, $tag);
+
+ return ( \@xpdfile, $parentgid );
+}
+
+###################################################
+# Setting xpd file name
+###################################################
+
+sub get_xpd_filename
+{
+ my ($modulegid, $linkpackage) = @_;
+
+ if ( $linkpackage ) { $modulegid = $modulegid . "u"; }
+
+ my $filename = $modulegid . ".xpd";
+
+ return $filename;
+}
+
+###################################################
+# Determine, which package was created newly
+###################################################
+
+sub determine_new_packagename
+{
+ my ( $installdir, $subdir, $xpdinfo ) = @_;
+
+ my $newpackage = "";
+ $installdir =~ s/\Q$installer::globals::separator\E\s*$//;
+ my $directory = $installdir . $installer::globals::separator . $subdir;
+ $directory =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ if ( $xpdinfo->{'RealPackageName'} )
+ {
+ $newpackage = $directory . $installer::globals::separator . $xpdinfo->{'RealPackageName'};
+ push(@installer::globals::currentcontent, $newpackage);
+ return $newpackage;
+ }
+
+ my ($newcontent, $allcontent) = installer::systemactions::find_new_content_in_directory($directory, \@installer::globals::currentcontent);
+ @installer::globals::currentcontent = ();
+ foreach my $element ( @{$allcontent} ) { push(@installer::globals::currentcontent, $element); }
+
+ my $newentriesnumber = $#{$newcontent} + 1;
+ if ( $newentriesnumber > 1 ) { installer::exiter::exit_program("ERROR: More than one new package in directory $directory", "determine_new_packagename (xpdinstaller)"); }
+ elsif ( $newentriesnumber < 1 ) { installer::exiter::exit_program("ERROR: No new package in directory $directory", "determine_new_packagename (xpdinstaller)"); }
+ $newpackage = ${$newcontent}[0];
+
+ return $newpackage;
+}
+
+###################################################
+# Checking, if the parentgid is defined in
+# another package
+###################################################
+
+sub is_empty_parent
+{
+ my ($gid, $packages) = @_;
+
+ my $is_empty_parent = 1;
+
+ for ( my $k = 0; $k <= $#{$packages}; $k++ )
+ {
+ my $onepackage = ${$packages}[$k];
+ my $packagegid = $onepackage->{'module'};
+
+ if ( $packagegid eq $gid )
+ {
+ $is_empty_parent = 0;
+ last;
+ }
+ }
+
+ return $is_empty_parent;
+}
+
+###################################################
+# Creating additional xpd files for empty parents
+###################################################
+
+sub create_emptyparents_xpd_file
+{
+ my ($parentgid, $modulesarrayref, $xpddir) = @_;
+
+ my $module = get_module($parentgid, $modulesarrayref);
+ my $grandpagid = "";
+
+ if ( $module ne "" )
+ {
+ my $packagename = "";
+ # all content saved in scp is now available and can be used to create the xpd file
+ my ( $xpdfile, $newparentgid ) = get_file_content($module, $packagename, "", 0, 1, "", 0, "", "");
+
+ $grandpagid = $newparentgid;
+
+ my $xpdfilename = get_xpd_filename($parentgid, 0);
+ $xpdfilename = $xpddir . $installer::globals::separator . $xpdfilename;
+
+ installer::files::save_file($xpdfilename, $xpdfile);
+ push(@installer::globals::allxpdfiles, $xpdfilename);
+ my $infoline = "Saving xpd file: $xpdfilename\n";
+ push(@installer::globals::logfileinfo, $infoline);
+ }
+
+ # push(@installer::globals::emptyxpdparents, $parentgid);
+ push( @installer::globals::createdxpdfiles, $parentgid);
+
+ return $grandpagid;
+}
+
+###################################################
+# Creating additional xpd files for empty parents
+###################################################
+
+sub filter_content_from_xpdfile
+{
+ my ($xpdfile) = @_;
+
+ my @newxpdfile = ();
+
+ my $include = 1;
+
+ for ( my $i = 0; $i <= $#{$xpdfile}; $i++ )
+ {
+ my $line = ${$xpdfile}[$i];
+
+ if (( $line =~ /^\s*\<installunit/ ) && ( $include )) { $include = 0; }
+ if ( $include ) { push(@newxpdfile, $line); }
+ if (( $line =~ /^\s*\<\/installunit/ ) && ( ! $include )) { $include = 1; }
+ }
+
+ return \@newxpdfile;
+}
+
+##########################################################################
+# Changing the parent inside the xpd file
+# Old: <package name="gid_Module_Root" parent="root">
+# New: <package name="gid_Module_Root_Files_1" parent="gid_Module_Root">
+##########################################################################
+
+sub change_parent_in_xpdfile
+{
+ my ($xpdfile, $modulename) = @_;
+
+ for ( my $i = 0; $i <= $#{$xpdfile}; $i++ )
+ {
+ if ( ${$xpdfile}[$i] =~ /^\s*\<package name\s*=\s*\"(\S+?)\"\s+parent\s*=\s*\"(\S+?)\"\s*\>\s*$/ )
+ {
+ my $oldname = $1;
+ my $oldparent = $2;
+
+ my $newname = $modulename;
+ my $newparent = $oldname;
+
+ ${$xpdfile}[$i] =~ s/\"\Q$oldname\E\"/\"$newname\"/;
+ ${$xpdfile}[$i] =~ s/\"\Q$oldparent\E\"/\"$newparent\"/;
+
+ last;
+ }
+ }
+}
+
+###################################################
+# Creating one xpd file for each package
+###################################################
+
+sub create_xpd_file
+{
+ my ($onepackage, $allpackages, $languagestringref, $allvariables, $modulesarrayref, $installdir, $subdir, $linkpackage, $xpdinfo) = @_;
+
+ my $infoline = "";
+ # creating the directory
+ my $xpddir = installer::systemactions::create_directories("xpdinstaller", $languagestringref);
+ $xpddir =~ s/\/\s*$//;
+ $installer::globals::xpddir = $xpddir;
+ # push(@installer::globals::removedirs, $xpddir);
+
+ my $modulegid = $onepackage->{'module'};
+
+ my $onelanguage = ""; #
+ my $solslanguage = ""; #
+ my $islanguagemodule = 0; #
+ if ( $onepackage->{'islanguagemodule'} ) { $islanguagemodule = $onepackage->{'islanguagemodule'}; } #
+ if ( $islanguagemodule ) #
+ {
+ $onelanguage = $onepackage->{'language'}; #
+ if ( $installer::globals::issolarispkgbuild ) { $solslanguage = installer::epmfile::get_solaris_language_for_langpack($onelanguage); } #
+ }
+
+ installer::logger::include_header_into_logfile("Creating xpd file ($modulegid):");
+
+ my $module = get_module($modulegid, $modulesarrayref);
+
+ if ( $module ne "" )
+ {
+ my $packagename = determine_new_packagename($installdir, $subdir, $xpdinfo);
+
+ # all content saved in scp is now available and can be used to create the xpd file
+ my ( $xpdfile, $parentgid ) = get_file_content($module, $packagename, $solslanguage, $linkpackage, 0, "", $islanguagemodule, $onelanguage, $xpdinfo);
+
+ my $xpdfilename = get_xpd_filename($modulegid, $linkpackage);
+ $xpdfilename = $xpddir . $installer::globals::separator . $xpdfilename;
+
+ # Very special handling for Root module:
+ # Because packages should only be assigned to leaves and not to knods,
+ # the root module is divided into a knod without package and a new
+ # leave with package. The name of the leave is defined at $module->{'XpdPackageName'}.
+ if ( $module->{'XpdPackageName'} )
+ {
+ my $newxpdfilename = get_xpd_filename($module->{'XpdPackageName'}, 0);
+ $newxpdfilename = $xpddir . $installer::globals::separator . $newxpdfilename;
+ my $emptyfilecontent = filter_content_from_xpdfile($xpdfile);
+
+ installer::files::save_file($xpdfilename, $emptyfilecontent);
+ push(@installer::globals::allxpdfiles, $xpdfilename);
+ $infoline = "Saving xpd file: $xpdfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ $xpdfilename = $newxpdfilename;
+ change_parent_in_xpdfile($xpdfile, $module->{'XpdPackageName'});
+ }
+
+ installer::files::save_file($xpdfilename, $xpdfile);
+ push( @installer::globals::createdxpdfiles, $modulegid);
+ push(@installer::globals::allxpdfiles, $xpdfilename);
+ $infoline = "Saving xpd file: $xpdfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $grandpagid = "root";
+ if ( $parentgid ne "root" )
+ {
+ my $create_missing_parent = is_empty_parent($parentgid, $allpackages);
+
+ # if (( $create_missing_parent ) && ( ! installer::existence::exists_in_array($parentgid, \@installer::globals::emptyxpdparents) ))
+ if (( $create_missing_parent ) && ( ! installer::existence::exists_in_array($parentgid, \@installer::globals::createdxpdfiles) ))
+ {
+ $grandpagid = create_emptyparents_xpd_file($parentgid, $modulesarrayref, $xpddir);
+ }
+ }
+
+ if ( $grandpagid ne "root" )
+ {
+ my $create_missing_parent = is_empty_parent($grandpagid, $allpackages);
+
+ # if (( $create_missing_parent ) && ( ! installer::existence::exists_in_array($parentgid, \@installer::globals::emptyxpdparents) ))
+ if (( $create_missing_parent ) && ( ! installer::existence::exists_in_array($grandpagid, \@installer::globals::createdxpdfiles) ))
+ {
+ create_emptyparents_xpd_file($grandpagid, $modulesarrayref, $xpddir);
+ }
+ }
+ }
+ else
+ {
+ installer::exiter::exit_program("ERROR: No module definition found for gid: $modulegid", "create_xpd_file (xpdinstaller)");
+ }
+
+}
+
+###################################################
+# Creating a xpd file for a copied package
+###################################################
+
+sub create_xpd_file_for_childproject
+{
+ my ($module, $destdir, $packagename, $allvariableshashref, $modulesarrayref) = @_;
+
+ my $modulegid = $module->{'gid'};
+
+ my $currentdir = cwd();
+ $destdir =~ s/\/\s*$//;
+ $currentdir =~ s/\/\s*$//;
+
+ my $completepackage = $currentdir . $installer::globals::separator . $destdir . $installer::globals::separator . $packagename;
+
+ # all content saved in scp is now available and can be used to create the xpd file
+ my ( $xpdfile, $parentgid ) = get_file_content($module, $completepackage, "", 0, 0, "", 0, "", "");
+
+ my $xpdfilename = get_xpd_filename($modulegid, 0);
+ $xpdfilename = $installer::globals::xpddir . $installer::globals::separator . $xpdfilename;
+
+ installer::files::save_file($xpdfilename, $xpdfile);
+ push( @installer::globals::createdxpdfiles, $modulegid);
+ push(@installer::globals::allxpdfiles, $xpdfilename);
+ my $infoline = "Saving xpd file: $xpdfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ if ( $parentgid ne "root" )
+ {
+ # my $create_missing_parent = is_empty_parent($parentgid, $allpackages);
+ my $create_missing_parent = 1; # -> Always missing parent by child projects!
+ # Parent is now created, if it was not created before. Attention: Parent module must not come later.
+ if (( $create_missing_parent ) && ( ! installer::existence::exists_in_array($parentgid, \@installer::globals::createdxpdfiles) ))
+ {
+ create_emptyparents_xpd_file($parentgid, $modulesarrayref, $installer::globals::xpddir);
+ }
+ }
+}
+
+##############################################################
+# Creating a xpd file for copied system integration package
+##############################################################
+
+sub create_xpd_file_for_systemintegration
+{
+ my ($module, $newcontent, $modulesarrayref, $subdir) = @_;
+
+ my $parentgid = $module->{'gid'};
+
+ # Create new visible module from scp info and create
+ # new hidden module for each package inside in tar file
+
+ for ( my $i = 0; $i <= $#{$newcontent}; $i++ )
+ {
+ my $newpackagename = ${$newcontent}[$i];
+
+ # installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$newpackagename);
+
+ my $infoline = "Creating xpd file for package: $newpackagename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+
+ my $childmodule = installer::worker::copy_hash_from_references($module);
+ $childmodule->{'ParentID'} = $module->{'gid'}; # the module gid is the new parent
+ $childmodule->{'InstallOrder'} = $installer::globals::defaultsystemintinstallorder;
+ my $number = $i + 1;
+ my $modulegid = $module->{'gid'} . "_child_" . $number; # setting a dynamic new gid
+ $childmodule->{'gid'} = $modulegid;
+ $childmodule->{'Styles'} =~ s/\)/\,HIDDEN_ROOT\)/;
+ # iterating over all languages to get names and descriptions
+ remove_lang_values($childmodule, "Name");
+ remove_lang_values($childmodule, "Description");
+
+ my $shortpackagename = $newpackagename;
+ installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$shortpackagename);
+ $childmodule->{'PackageName'} = $shortpackagename;
+ $childmodule->{'Name'} = $modulegid;
+ $childmodule->{'Description'} = $modulegid;
+
+ # Checking, if installorder can be set:
+ # scp syntax: InstallOrder = "desktop:1050, suse:1060";
+ # The string before the number can be compared with $shortpackagename
+ if ( $module->{'InstallOrder'} )
+ {
+ my $installorder = $module->{'InstallOrder'};
+ $installorder =~ s/^\s*\"//g;
+ $installorder =~ s/\"\s*$//g;
+ # $installorder is comma separated list
+ my $allorders = installer::converter::convert_stringlist_into_array(\$installorder, ",");
+ for ( my $j = 0; $j <= $#{$allorders}; $j++ )
+ {
+ my $oneitem = ${$allorders}[$j];
+ if ( $oneitem =~ /^\s*(\S+?)\s*:\s*(\S+?)\s*$/ )
+ {
+ my $name = $1;
+ my $order = $2;
+
+ if ( $shortpackagename =~ /\Q$name\E/ ) { $childmodule->{'InstallOrder'} = $order; }
+ }
+ }
+ }
+
+ # all content saved in scp is now available and can be used to create the xpd file
+ my ( $xpdfile, $parentgid_ ) = get_file_content($childmodule, $newpackagename, "", 0, 0, $subdir, 0, "", "");
+
+ my $xpdfilename = get_xpd_filename($modulegid, 0);
+ $xpdfilename = $installer::globals::xpddir . $installer::globals::separator . $xpdfilename;
+
+ installer::files::save_file($xpdfilename, $xpdfile);
+ push(@installer::globals::allxpdfiles, $xpdfilename);
+ $infoline = "Saving xpd file: $xpdfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ # Creating the top level visible xpd file
+ create_emptyparents_xpd_file($parentgid, $modulesarrayref, $installer::globals::xpddir);
+}
+
+##############################################################
+# Copying xpd files into installation set
+##############################################################
+
+sub copy_xpd_files
+{
+ my ( $destdir ) = @_;
+
+ for ( my $i = 0; $i <= $#installer::globals::allxpdfiles; $i++ )
+ {
+ if ( ! -f $installer::globals::allxpdfiles[$i] ) { installer::exiter::exit_program("ERROR: Could not find xpd file: $installer::globals::allxpdfiles[$i]!", "copy_xpd_files"); }
+ installer::systemactions::copy_one_file($installer::globals::allxpdfiles[$i], $destdir);
+ }
+}
+
+##############################################################
+# Copying all xpd files into the installation set
+##############################################################
+
+sub copy_xpd_files_into_installset
+{
+ my ($installdir) = @_;
+
+ $installdir =~ s/\Q$installer::globals::separator\E\s*$//;
+
+ my $instdir = $installdir . $installer::globals::separator . "installdata";
+ installer::systemactions::create_directory($instdir);
+
+ my $xpddir = $instdir . $installer::globals::separator . "xpd";
+ installer::systemactions::create_directory($xpddir);
+ copy_xpd_files($xpddir);
+}
+
+##############################################################
+# Creating base xpd file with product information
+##############################################################
+
+sub create_setup_xpd
+{
+ my ($allvariables, $languagestringref) = @_;
+
+ my ( $xpdfile ) = get_setup_file_content($allvariables, $languagestringref);
+
+ my $xpdfilename = $installer::globals::productxpdfile;
+ $xpdfilename = $installer::globals::xpddir . $installer::globals::separator . $xpdfilename;
+
+ installer::files::save_file($xpdfilename, $xpdfile);
+ push(@installer::globals::allxpdfiles, $xpdfilename);
+ my $infoline = "Saving xpd file: $xpdfilename\n";
+ push( @installer::globals::logfileinfo, $infoline);
+}
+
+###################################################
+# Copying the files needed by the xpd installer
+# into the installation directory
+###################################################
+
+sub create_xpd_installer
+{
+ my ( $installdir, $allvariables, $languagestringref) = @_;
+
+ installer::logger::include_header_into_logfile("Creating xpd installer:");
+
+ # create setup.xpd file
+ create_setup_xpd($allvariables, $languagestringref);
+
+ # copy xpd files into installation set
+ copy_xpd_files_into_installset($installdir);
+}
+
+1;
diff --git a/solenv/bin/modules/installer/ziplist.pm b/solenv/bin/modules/installer/ziplist.pm
new file mode 100644
index 000000000000..9a5460cacb3c
--- /dev/null
+++ b/solenv/bin/modules/installer/ziplist.pm
@@ -0,0 +1,812 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package installer::ziplist;
+
+use installer::existence;
+use installer::exiter;
+use installer::globals;
+use installer::logger;
+use installer::parameter;
+use installer::remover;
+use installer::systemactions;
+
+#################################################
+# Getting data from path file and zip list file
+#################################################
+
+sub getproductblock
+{
+ my ($fileref, $search, $inheritance) = @_;
+
+ my @searchblock = ();
+ my $searchexists = 0;
+ my $record = 0;
+ my $count = 0;
+ my $line;
+ my $inh = $inheritance ? '(?::\s*(\S+)\s*)?' : "";
+ my $parent;
+
+ for ( my $i = 0; $i <= $#{$fileref}; $i++ )
+ {
+ $line = ${$fileref}[$i];
+
+ if ( $line =~ /^\s*\Q$search\E\s*$inh$/i ) # case insensitive
+ {
+ $record = 1;
+ $searchexists = 1;
+ $parent = $1 if $inheritance;
+ }
+
+ if ($record)
+ {
+ push(@searchblock, $line);
+ }
+
+ if ( ($record) && ($line =~ /\{/) )
+ {
+ $count++;
+ }
+
+ if ( ($record) && ($line =~ /\}/) )
+ {
+ $count--;
+ }
+
+ if ( ($record) && ($line =~ /\}/) && ( $count == 0 ) )
+ {
+ $record = 0;
+ }
+ }
+
+ if (( ! $searchexists ) && ( $search ne $installer::globals::globalblock ))
+ {
+ if ($search eq $installer::globals::product )
+ {
+ installer::exiter::exit_program("ERROR: Product $installer::globals::product not defined in $installer::globals::ziplistname", "getproductblock");
+ }
+ elsif ($search eq $installer::globals::compiler )
+ {
+ installer::exiter::exit_program("ERROR: Compiler $installer::globals::compiler not defined in $installer::globals::pathfilename", "getproductblock");
+ }
+ else # this is not possible
+ {
+ installer::exiter::exit_program("ERROR: Unknown value for $search in getproductblock()", "getproductblock");
+ }
+ }
+
+ return (\@searchblock, $parent);
+}
+
+###############################################
+# Analyzing the settings in the zip list file
+###############################################
+
+sub analyze_settings_block
+{
+ my ($blockref) = @_;
+
+ my @newsettingsblock = ();
+ my $compilerstring = "";
+ my $record = 1;
+ my $counter = 0;
+
+ # Allowed values in settings block:
+ # "Settings", "Variables", "unix" (for destination path and logfile)
+ # Furthermore allowed values are $installer::globals::build (srx645) and $installer::globals::compiler (pro and nonpro (unxsols4.pro))
+
+ # Comment line in settings block begin with "#" or ";"
+
+ if ( $installer::globals::pro )
+ {
+ $compilerstring = $installer::globals::compiler . ".pro";
+ }
+ else
+ {
+ $compilerstring = $installer::globals::compiler;
+ }
+
+ for ( my $i = 0; $i <= $#{$blockref}; $i++ )
+ {
+ my $line = ${$blockref}[$i];
+ my $nextline = "";
+
+ if ( ${$blockref}[$i+1] ) { $nextline = ${$blockref}[$i+1]; }
+
+ # removing comment lines
+
+ if (($line =~ /^\s*\#/) || ($line =~ /^\s*\;/))
+ {
+ next;
+ }
+
+ # complete blocks of unknows strings are not recorded
+
+ if ((!($line =~ /^\s*\Q$compilerstring\E\s*$/i)) &&
+ (!($line =~ /^\s*\Q$installer::globals::build\E\s*$/i)) &&
+ (!($line =~ /^\s*\bSettings\b\s*$/i)) &&
+ (!($line =~ /^\s*\bVariables\b\s*$/i)) &&
+ (!($line =~ /^\s*\bunix\b\s*$/i)) &&
+ ($nextline =~ /^\s*\{\s*$/i))
+ {
+ $record = 0;
+ next; # continue with next $i
+ }
+
+ if (!( $record ))
+ {
+ if ($line =~ /^\s*\{\s*$/i)
+ {
+ $counter++;
+ }
+
+ if ($line =~ /^\s*\}\s*$/i)
+ {
+ $counter--;
+ }
+
+ if ($counter == 0)
+ {
+ $record = 1;
+ next; # continue with next $i
+ }
+ }
+
+ if ($record)
+ {
+ push(@newsettingsblock, $line);
+ }
+ }
+
+ return \@newsettingsblock;
+}
+
+########################################
+# Settings in zip list file
+########################################
+
+sub get_settings_from_ziplist
+{
+ my ($blockref) = @_;
+
+ my @allsettings = ();
+ my $isvariables = 0;
+ my $counter = 0;
+ my $variablescounter = 0;
+
+ # Take all settings from the settings block
+ # Do not take the variables from the settings block
+ # If a setting is defined more than once, take the
+ # setting with the largest counter (open brackets)
+
+ for ( my $i = 0; $i <= $#{$blockref}; $i++ )
+ {
+ my $line = ${$blockref}[$i];
+ my $nextline = "";
+
+ if ( ${$blockref}[$i+1] ) { $nextline = ${$blockref}[$i+1]; }
+
+ if (($line =~ /^\s*\S+\s*$/i) &&
+ ($nextline =~ /^\s*\{\s*$/i) &&
+ (!($line =~ /^\s*Variables\s*$/i)))
+ {
+ next;
+ }
+
+ if ($line =~ /^\s*Variables\s*$/i)
+ {
+ # This is a block of variables
+
+ $isvariables = 1;
+ next;
+ }
+
+ if ($line =~ /^\s*\{\s*$/i)
+ {
+ if ($isvariables)
+ {
+ $variablescounter++;
+ }
+ else
+ {
+ $counter++;
+ }
+
+ next;
+ }
+
+ if ($line =~ /^\s*\}\s*$/i)
+ {
+ if ($isvariables)
+ {
+ $variablescounter--;
+
+ if ($variablescounter == 0)
+ {
+ $isvariables = 0;
+ }
+ }
+ else
+ {
+ $counter--;
+ }
+
+ next;
+ }
+
+ if ($isvariables)
+ {
+ next;
+ }
+
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+
+ $line .= "\t##$counter##\n";
+
+ push(@allsettings, $line);
+ }
+
+ return \@allsettings;
+}
+
+#######################################
+# Variables from zip list file
+#######################################
+
+sub get_variables_from_ziplist
+{
+ my ($blockref) = @_;
+
+ my @allvariables = ();
+ my $isvariables = 0;
+ my $counter = 0;
+ my $variablescounter = 0;
+ my $countersum = 0;
+
+ # Take all variables from the settings block
+ # Do not take the other settings from the settings block
+ # If a variable is defined more than once, take the
+ # variable with the largest counter (open brackets)
+
+ for ( my $i = 0; $i <= $#{$blockref}; $i++ )
+ {
+ my $line = ${$blockref}[$i];
+ my $nextline = ${$blockref}[$i+1];
+
+ if ($line =~ /^\s*Variables\s*$/i)
+ {
+ # This is a block of variables
+
+ $isvariables = 1;
+ next;
+ }
+
+ if ($line =~ /^\s*\{\s*$/i)
+ {
+ if ($isvariables)
+ {
+ $variablescounter++;
+ }
+ else
+ {
+ $counter++;
+ }
+
+ next;
+ }
+
+ if ($line =~ /^\s*\}\s*$/i)
+ {
+ if ($isvariables)
+ {
+ $variablescounter--;
+
+ if ($variablescounter == 0)
+ {
+ $isvariables = 0;
+ }
+ }
+ else
+ {
+ $counter--;
+ }
+
+ next;
+ }
+
+ if (!($isvariables))
+ {
+ next;
+ }
+
+ $countersum = $counter + $variablescounter;
+
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+
+ $line .= "\t##$countersum##\n";
+
+ push(@allvariables, $line);
+ }
+
+ return \@allvariables;
+}
+
+#######################################################################
+# Removing multiple variables and settings, defined in zip list file
+#######################################################################
+
+sub remove_multiples_from_ziplist
+{
+ my ($blockref) = @_;
+
+ # remove all definitions of settings and variables
+ # that occur more than once in the zip list file.
+ # Take the one with the most open brackets. This
+ # number is stored at the end of the string.
+
+ my @newarray = ();
+ my @itemarray = ();
+ my ($line, $itemname, $itemnumber);
+
+ # first collecting all variables and settings names
+
+ for ( my $i = 0; $i <= $#{$blockref}; $i++ )
+ {
+ $line = ${$blockref}[$i];
+
+ if ($line =~ /^\s*\b(\S*)\b\s+.*\#\#\d+\#\#\s*$/i)
+ {
+ $itemname = $1;
+ }
+
+ if (! installer::existence::exists_in_array($itemname, \@itemarray))
+ {
+ push(@itemarray, $itemname);
+ }
+ }
+
+ # and now all $items can be selected with the highest number
+
+ for ( my $i = 0; $i <= $#itemarray; $i++ )
+ {
+ $itemname = $itemarray[$i];
+
+ my $itemnumbermax = 0;
+ my $printline = "";
+
+ for ( my $j = 0; $j <= $#{$blockref}; $j++ )
+ {
+ $line = ${$blockref}[$j];
+
+ if ($line =~ /^\s*\Q$itemname\E\s+.*\#\#(\d+)\#\#\s*$/)
+ {
+ $itemnumber = $1;
+
+ if ($itemnumber >= $itemnumbermax)
+ {
+ $printline = $line;
+ $itemnumbermax = $itemnumber;
+ }
+ }
+ }
+
+ # removing the ending number from the printline
+ # and putting it into the array
+
+ $printline =~ s/\#\#\d+\#\#//;
+ installer::remover::remove_leading_and_ending_whitespaces(\$line);
+ push(@newarray, $printline);
+ }
+
+ return \@newarray;
+}
+
+#########################################################
+# Reading one variable defined in the zip list file
+#########################################################
+
+sub getinfofromziplist
+{
+ my ($blockref, $variable) = @_;
+
+ my $searchstring = "";
+ my $line;
+
+ for ( my $i = 0; $i <= $#{$blockref}; $i++ )
+ {
+ $line = ${$blockref}[$i];
+
+ if ( $line =~ /^\s*\Q$variable\E\s+(.+?)\s*$/ ) # "?" for minimal matching
+ {
+ $searchstring = $1;
+ last;
+ }
+ }
+
+ return \$searchstring;
+}
+
+####################################################
+# Replacing variables in include path
+####################################################
+
+sub replace_all_variables_in_pathes
+{
+ my ( $patharrayref, $variableshashref ) = @_;
+
+ for ( my $i = 0; $i <= $#{$patharrayref}; $i++ )
+ {
+ my $line = ${$patharrayref}[$i];
+
+ my $key;
+
+ foreach $key (keys %{$variableshashref})
+ {
+ my $value = $variableshashref->{$key};
+
+ if (( $line =~ /\{$key\}/ ) && ( $value eq "" )) { $line = ".\n"; }
+
+ $line =~ s/\{\Q$key\E\}/$value/g;
+ }
+
+ ${$patharrayref}[$i] = $line;
+ }
+}
+
+####################################################
+# Replacing minor in include path
+####################################################
+
+sub replace_minor_in_pathes
+{
+ my ( $patharrayref ) = @_;
+
+ for ( my $i = 0; $i <= $#{$patharrayref}; $i++ )
+ {
+ my $line = ${$patharrayref}[$i];
+
+ if ( ! defined $ENV{CWS_WORK_STAMP} and defined $ENV{UPDMINOR} )
+# if ( $installer::globals::minor )
+ {
+ $line =~ s/\{minor\}/$installer::globals::minor/g;
+ # no difference for minor and minornonpre (ToDo ?)
+ $line =~ s/\{minornonpre\}/$installer::globals::minor/g;
+ }
+ else # building without a minor
+ {
+ $line =~ s/\.\{minor\}//g;
+ $line =~ s/\.\{minornonpre\}//g;
+ }
+
+ ${$patharrayref}[$i] = $line;
+ }
+}
+
+####################################################
+# Replacing packagetype in include path
+####################################################
+
+sub replace_packagetype_in_pathes
+{
+ my ( $patharrayref ) = @_;
+
+ for ( my $i = 0; $i <= $#{$patharrayref}; $i++ )
+ {
+ my $line = ${$patharrayref}[$i];
+
+ if (( $installer::globals::installertypedir ) && ( $line =~ /\{pkgtype\}/ ))
+ {
+ $line =~ s/\{pkgtype\}/$installer::globals::installertypedir/g;
+ }
+
+ ${$patharrayref}[$i] = $line;
+ }
+}
+
+####################################################
+# Removing ending separators in pathes
+####################################################
+
+sub remove_ending_separator
+{
+ my ( $patharrayref ) = @_;
+
+ for ( my $i = 0; $i <= $#{$patharrayref}; $i++ )
+ {
+ my $line = ${$patharrayref}[$i];
+
+ installer::remover::remove_ending_pathseparator(\$line);
+
+ $line =~ s/\s*$//;
+ $line = $line . "\n";
+
+ ${$patharrayref}[$i] = $line;
+ }
+}
+
+####################################################
+# Replacing languages in include path
+####################################################
+
+sub replace_languages_in_pathes
+{
+ my ( $patharrayref, $languagesref ) = @_;
+
+ installer::logger::include_header_into_logfile("Replacing languages in include pathes:");
+
+ my @patharray = ();
+ my $infoline = "";
+
+ for ( my $i = 0; $i <= $#{$patharrayref}; $i++ )
+ {
+ my $line = ${$patharrayref}[$i];
+
+ if ( $line =~ /\$\(LANG\)/ )
+ {
+ my $originalline = $line;
+ my $newline = "";
+
+ for ( my $j = 0; $j <= $#{$languagesref}; $j++ )
+ {
+ my $language = ${$languagesref}[$j];
+ $line =~ s/\$\(LANG\)/$language/g;
+ push(@patharray ,$line);
+ $newdir = $line;
+ $line = $originalline;
+
+ installer::remover::remove_leading_and_ending_whitespaces(\$newline);
+
+ # Is it necessary to refresh the global array, containing all files of all include pathes?
+ if ( -d $newdir )
+ {
+ # Checking if $newdir is empty
+ if ( ! installer::systemactions::is_empty_dir($newdir) )
+ {
+ $installer::globals::refresh_includepathes = 1;
+ $infoline = "Directory $newdir exists and is not empty. Refreshing global file array is required.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ else
+ {
+ $infoline = "Directory $newdir is empty. No refresh of global file array required.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ else
+ {
+ $infoline = "Directory $newdir does not exist. No refresh of global file array required.\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+ else # not language dependent include path
+ {
+ push(@patharray ,$line);
+ }
+ }
+
+ return \@patharray;
+}
+
+#####################################################
+# Collecting all files from all include paths
+#####################################################
+
+sub list_all_files_from_include_path
+{
+ my ( $patharrayref) = @_;
+
+ installer::logger::include_header_into_logfile("Include pathes:");
+
+ for ( my $i = 0; $i <= $#{$patharrayref}; $i++ )
+ {
+ my $path = ${$patharrayref}[$i];
+ installer::remover::remove_leading_and_ending_whitespaces(\$path);
+ my $infoline = "$path\n";
+ push( @installer::globals::logfileinfo, $infoline);
+ }
+
+ push( @installer::globals::logfileinfo, "\n");
+
+ return \@filesarray;
+}
+
+#####################################################
+# Collecting all files from all include paths
+#####################################################
+
+sub set_manufacturer
+{
+ my ($allvariables) = @_;
+
+ my $openofficeproductname = "OpenOffice.org";
+ my $sunname = "";
+
+
+ if ( $allvariables->{'OPENSOURCE'} && $allvariables->{'OPENSOURCE'} == 1 )
+ {
+ $installer::globals::isopensourceproduct = 1;
+ $installer::globals::manufacturer = $openofficeproductname;
+ $installer::globals::longmanufacturer = $openofficeproductname;
+ }
+ else
+ {
+ $installer::globals::isopensourceproduct = 0;
+ if (( $allvariables->{'DEFINEDMANUFACTURER'} ) && ( $allvariables->{'DEFINEDMANUFACTURER'} ne "" )) { $sunname = $allvariables->{'DEFINEDMANUFACTURER'}; }
+ else { installer::exiter::exit_program("ERROR: Property DEFINEDMANUFACTURER has to be set for this product!", "set_manufacturer"); }
+ $installer::globals::manufacturer = $sunname;
+ $installer::globals::longmanufacturer = $sunname;
+ }
+
+ $allvariables->{'MANUFACTURER'} = $installer::globals::manufacturer;
+}
+
+##############################################################
+# A ProductVersion has to be defined. If it is not set in
+# zip.lst, it is set now to "1"
+##############################################################
+
+sub set_default_productversion_if_required
+{
+ my ($allvariables) = @_;
+
+ if (!($allvariables->{'PRODUCTVERSION'}))
+ {
+ $allvariables->{'PRODUCTVERSION'} = 1; # FAKE
+ }
+
+ # Creating differentiators for BUILD_SPECIAL in layering
+ if ( ! $ENV{'BUILD_SPECIAL'} )
+ {
+ if ( $allvariables->{'REGISTRYLAYERNAME'} ) { $allvariables->{'REGISTRYLAYERNAME'} = $allvariables->{'REGISTRYLAYERNAME'} . "_"; }
+ if (( $installer::globals::iswindowsbuild ) && ( $allvariables->{'BASISROOTNAME'} )) { $allvariables->{'BASISROOTNAME'} = $allvariables->{'BASISROOTNAME'} . "_"; }
+ }
+}
+
+####################################################
+# Removing .. in pathes
+####################################################
+
+sub simplify_path
+{
+ my ( $pathref ) = @_;
+
+ my $oldpath = $$pathref;
+
+ my $change = 0;
+
+ while ( $oldpath =~ /(^.*)(\Q$installer::globals::separator\E.*\w+?)(\Q$installer::globals::separator\E\.\.)(\Q$installer::globals::separator\E.*$)/ )
+ {
+ my $part1 = $1;
+ my $part2 = $4;
+ $oldpath = $part1 . $part2;
+ $change = 1;
+ }
+
+ if ( $change ) { $$pathref = $oldpath . "\n"; }
+}
+
+####################################################
+# Removing ending separators in pathes
+####################################################
+
+sub resolve_relative_pathes
+{
+ my ( $patharrayref ) = @_;
+
+ for ( my $i = 0; $i <= $#{$patharrayref}; $i++ )
+ {
+ installer::parameter::make_path_absolute(\${$patharrayref}[$i]);
+ simplify_path(\${$patharrayref}[$i]);
+ }
+}
+
+####################################################
+# Replacing variables inside zip list variables
+# Example: {milestone} to be replaced by
+# $installer::globals::lastminor
+####################################################
+
+sub replace_variables_in_ziplist_variables
+{
+ my ($blockref) = @_;
+
+ my $milestonevariable = $installer::globals::lastminor;
+ $milestonevariable =~ s/m//;
+ $milestonevariable =~ s/s/\./;
+
+ my $localminor = $installer::globals::lastminor;
+ if ( $installer::globals::minor ) { $localminor = $installer::globals::minor; }
+
+ my $buildidstringcws = $installer::globals::build . $localminor . "(Build:" . $installer::globals::buildid . ")";
+
+ # the environment variable CWS_WORK_STAMP is set only in CWS
+ if ( $ENV{'CWS_WORK_STAMP'} ) { $buildidstringcws = $buildidstringcws . "\[CWS\:" . $ENV{'CWS_WORK_STAMP'} . "\]"; }
+
+ for ( my $i = 0; $i <= $#{$blockref}; $i++ )
+ {
+ if ($installer::globals::lastminor) { ${$blockref}[$i] =~ s/\{milestone\}/$milestonevariable/; }
+ else { ${$blockref}[$i] =~ s/\{milestone\}//; }
+ if ( $localminor ) { ${$blockref}[$i] =~ s/\{minor\}/$localminor/; }
+ else { ${$blockref}[$i] =~ s/\{minor\}//; }
+ if ( $installer::globals::buildid ) { ${$blockref}[$i] =~ s/\{buildid\}/$installer::globals::buildid/; }
+ else { ${$blockref}[$i] =~ s/\{buildid\}//; }
+ if ( $installer::globals::build ) { ${$blockref}[$i] =~ s/\{buildsource\}/$installer::globals::build/; }
+ else { ${$blockref}[$i] =~ s/\{build\}//; }
+ ${$blockref}[$i] =~ s/\{buildidcws\}/$buildidstringcws/;
+ }
+}
+
+###########################################################
+# Overwrite the vendor string in openoffice.lst that is defined in configure
+###########################################################
+
+sub overwrite_ooovendor
+{
+ my ($variableshashref) = @_;
+ $variableshashref->{'OOOVENDOR'} = $ENV{'OOO_VENDOR'} , if( defined $ENV{'OOO_VENDOR'} && $ENV{'OOO_VENDOR'} ne "" );
+}
+
+###########################################################
+# Adding the lowercase variables into the variableshashref
+###########################################################
+
+sub add_variables_to_allvariableshashref
+{
+ my ($variableshashref) = @_;
+
+ my $lcvariable = lc($variableshashref->{'PRODUCTNAME'});
+ $variableshashref->{'LCPRODUCTNAME'} = $lcvariable;
+
+ if ($variableshashref->{'SHORT_PRODUCTEXTENSION'})
+ {
+ $variableshashref->{'LCPRODUCTEXTENSION'} = "\-" . lc($variableshashref->{'SHORT_PRODUCTEXTENSION'}); # including the "-" !
+ }
+ else
+ {
+ $variableshashref->{'LCPRODUCTEXTENSION'} = "";
+ }
+
+ if ( $installer::globals::patch ) { $variableshashref->{'PRODUCTADDON'} = $installer::globals::patchaddon; }
+ elsif ( $installer::globals::languagepack ) { $variableshashref->{'PRODUCTADDON'} = $installer::globals::languagepackaddon; }
+ else { $variableshashref->{'PRODUCTADDON'} = ""; }
+
+ my $localbuild = $installer::globals::build;
+ if ( $localbuild =~ /^\s*(\w+?)(\d+)\s*$/ ) { $localbuild = $2; } # using "680" instead of "src680"
+ $variableshashref->{'PRODUCTMAJOR'} = $localbuild;
+
+ my $localminor = "";
+ if ( $installer::globals::minor ne "" ) { $localminor = $installer::globals::minor; }
+ else { $localminor = $installer::globals::lastminor; }
+ if ( $localminor =~ /^\s*\w(\d+)\w*\s*$/ ) { $localminor = $1; }
+ $variableshashref->{'PRODUCTMINOR'} = $localminor;
+
+ $variableshashref->{'PRODUCTBUILDID'} = $installer::globals::buildid;
+ $variableshashref->{'SYSTEM_LIBTEXTCAT_DATA'} = $ENV{'SYSTEM_LIBTEXTCAT_DATA'} , if( defined $ENV{'SYSTEM_LIBTEXTCAT_DATA'} && $ENV{'SYSTEM_LIBTEXTCAT_DATA'} ne "" );
+}
+
+1;
diff --git a/solenv/bin/modules/macosxotoolhelper.pm b/solenv/bin/modules/macosxotoolhelper.pm
new file mode 100644
index 000000000000..96ad8b2ed6f4
--- /dev/null
+++ b/solenv/bin/modules/macosxotoolhelper.pm
@@ -0,0 +1,44 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package macosxotoolhelper;
+require Exporter;
+our @ISA = Exporter;
+our @EXPORT = otoolD;
+
+sub otoolD($) {
+ my ($file) = @_;
+ my $call = "otool -D $file";
+ open(IN, "-|", $call) or die "cannot $call";
+ my $line = <IN>;
+ $line =~ /^$file:\n$/ or
+ die "unexpected otool -D output (\"$line\", expecting \"$file:\")";
+ $line = <IN>;
+ <IN> == undef or die "unexpected otool -D output";
+ close(IN);
+ return $line;
+}
diff --git a/solenv/bin/modules/osarch.pm b/solenv/bin/modules/osarch.pm
new file mode 100755
index 000000000000..205e4c933193
--- /dev/null
+++ b/solenv/bin/modules/osarch.pm
@@ -0,0 +1,195 @@
+#!/usr/bin/perl -w
+
+# ***********************************************************************
+# Description:
+# Filename: osarch.pm
+# Autor: EG
+# Date: 28.10.96
+# $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/solenv/bin/modules/osarch.pm,v 1.3 2008-08-18 13:11:04 vg Exp $
+# Copyright: STAR DIVISION
+# **********************************************************************/
+
+package osarch;
+
+$m_str = `uname -m`;
+$s_str = `uname -s`;
+chop( $m_str, $s_str );
+
+%osTable = ("SunOS", "solaris",
+ "HP-UX", "hpux",
+ "AIX", "aix",
+ "OS/390", "s390",
+ "Linux", "linux",
+ "FreeBSD", "freebsd",
+ "NetBSD", "netbsd",
+ "OSF1", "decunix",
+ "SCO_SV", "scoosr5",
+# "SCO_SV", "scouw21",
+ "Darwin", "macosxp",
+ "Mac OS", "macosxp",
+ "SINIX-N", "sinix"
+ );
+
+%osDefTable = ("SunOS", "-DSYSV -DSOLARIS",
+ "HP-UX", "-DSYSV -DHPUX",
+ "AIX", "-DSYSV -DAIX",
+ "Linux", "-DLINUX",
+ "FreeBSD", "-DFREEBSD",
+ "NetBSD", "-DNETBSD",
+ "OSF1", "-DSYSV -DDECUNIX",
+ "SCO_SV", "-DSYSV -DSCO -DSCO_OSR5",
+# "SCO_SV", "-DSYSV -DSCO -DSCO_UW21",
+ "Darwin", "-DBSD -DMACOSX",
+ "Mac OS", "-DBSD -DMACOSX",
+ "SINIX-N", "-DSYSV -DSINIX"
+ );
+
+%osDosTable = ("SunOS", "sol",
+ "HP-UX", "hpx",
+ "AIX", "aix",
+ "OS/390", "mvs",
+ "Linux", "lng",
+ "FreeBSD", "fbsd",
+ "NetBSD", "bsd",
+ "SCO_SV", "sco",
+ "Darwin", "macx",
+ "Mac OS", "macx",
+ "SINIX-N", "sni"
+ );
+
+%archTable = ("sun4c", "sparc",
+ "sun4m", "sparc",
+ "sun4u", "sparc",
+ "9000/712", "hp9000",
+ "9000/715", "hp9000",
+ "9000/778", "hp9000",
+ "000029484600", "rs6000", # salsa
+ "000328144600", "rs6000", # lambada
+ "00245D29E000", "rs6000", # segv
+ "00245C46E000", "rs6000", # bus
+ "002012974600", "rs6000", # tango
+ "0006404C4C00", "rs6000", # jive
+ "2003", "g3", # ezopen4
+ "i86pc", "x86", # blauwal
+ "i386", "x86", # SCO_SV, NetBSD, FreeBSD
+ "i486", "x86", # tiger
+ "i586", "x86", # blauwal
+ "i686", "x86",
+ "prep", "ppc", # hooge
+ "ppc", "ppc", # ppc-linux
+ "alpha", "alpha",
+ "RM400", "rm400", # garbo
+ "IP22", "mips", # voyager
+ "IP32", "mips", # giotto
+ "Power Macintosh", "ppc", # NetBSD/arm32
+ "arm32", "arm32" # NetBSD/arm32
+ );
+
+%archDefTable=("sun4c", "-DSPARC -DSUN -DSUN4", # hawai
+ "sun4m", "-DSPARC -DSUN -DSUN4", # broccoli
+ "sun4u", "-DSPARC -DSUN -DSUN4", # broccoli
+ "9000/712", "-DHP9000", # tuborg
+ "9000/715", "-DHP9000", # koepi
+ "9000/778", "-DHP9000", # jever, flens
+ "000029484600", "-DRS6000", # salsa
+ "000328144600", "-DRS6000", # lambada
+ "00245D29E000", "-DRS6000", # segv
+ "00245C46E000", "-DRS6000", # segv
+ "002012974600", "-DRS6000", # tango
+ "0006404C4C00", "-DRS6000", # jive
+ "2003", "-DG3", # ezopen4
+ "i86pc", "-DX86 -DINTEL",# gepard
+ "i386", "-DX86", # SCO_SV, NetBSD, FreeBSD
+ "i486", "-DX86", # tiger
+ "i586", "-DX86", # blauwal
+ "i686", "-DX86", #
+ "prep", "-DPPC", # hooge
+ "ppc", "-DPPC", # ppc-linux
+ "alpha", "-DALPHA", # mars
+ "RM400", "-DMIPS -DRM400", # ekberg, garbo
+ "IP22", "-DMIPS", # voyager
+ "IP32", "-DMIPS", # giotto
+ "Power Macintosh", "-DPPC", # NetBSD/arm32
+ "arm32", "-DARM32" # NetBSD/arm32
+ );
+
+%archDosTable=("sun4c", "s", # hawai
+ "sun4m", "s", # broccoli
+ "sun4u", "s", # broccoli
+ "9000/712", "r", # tuborg
+ "9000/715", "r", # koepi
+ "9000/778", "r", # jever, flens
+ "000029484600", "p", # salsa
+ "000328144600", "p", # lambada
+ "00245D29E000", "p", # segv
+ "00245C46E000", "p", # segv
+ "002012974600", "p", # tango
+ "0006404C4C00", "p", # jive
+ "2003", "g", # ezopen4
+ "i86pc", "i", # gepard
+ "i386", "i", # SCO_SV, NetBSD, FreeBSD
+ "i486", "i", # tiger
+ "i586", "i", # blauwal
+ "i686", "i",
+ "prep", "p", # hooge
+ "ppc", "p", # ppc-linux
+ "alpha", "a", # mars
+ "RM400", "m", # ekberg, garbo
+ "IP22", "m", # voyager
+ "IP32", "m", # giotto
+ "Power Macintosh", "p", # NetBSD/arm32
+ "arm32", "a" # NetBSD/arm32
+ );
+
+$main::solarDef = $osDefTable{ $s_str }.' '.$archDefTable{ $m_str };
+
+$main::solarOS = $osTable{ $s_str };
+$main::solarMT = $archTable{ $m_str };
+
+$main::solarArch = $main::solarOS.$main::solarMT;
+$main::solarOldArch = $main::solarArch; # for compatibility
+
+$main::solarDOS = 'unx'.$osDosTable{ $s_str }. $archDosTable{ $m_str };
+
+sub main::osarch
+{
+ local ( $flag ) = @_;
+
+ $perlFlag = $flag eq 'perl';
+ $defFlag = $flag eq 'def';
+ $oldFlag = $flag eq 'old';
+ $dirFlag = $flag eq 'dir';
+ $dosFlag = $flag eq 'dos';
+
+ local( $result ) = ( '' );
+
+ if ( $perlFlag )
+ {
+ $result .= '$solarDef = '."'$main::solarDef';\n";
+ $result .= '$solarArch = '."'$main::solarArch';\n";
+ $result .= '$solarOldArch = '."'$main::solarOldArch';\n";
+ $result .= '$solarOS = '."'$main::solarOS';\n";
+ $result .= '$solarMT = '."'$main::solarMT';\n";
+ $result .= '$solarDOS = '."'$main::solarDOS';";
+ }
+ elsif ( $defFlag )
+ {
+ $result = $main::solarDef;
+ }
+ elsif ( $dirFlag )
+ {
+ $result = "$main::solarOS-$main::solarMT";
+ }
+ elsif ( $dosFlag )
+ {
+ $result = $main::solarDOS;
+ }
+ else
+ {
+ $result = $oldFlag ? $main::solarOldArch : $main::solarArch;
+ }
+
+ return $result;
+}
+
+1;
diff --git a/solenv/bin/modules/packager/check.pm b/solenv/bin/modules/packager/check.pm
new file mode 100644
index 000000000000..8811451cd27c
--- /dev/null
+++ b/solenv/bin/modules/packager/check.pm
@@ -0,0 +1,88 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package packager::check;
+
+use packager::exiter;
+use packager::globals;
+
+##############################################
+# Check 1: The package list has to exist
+##############################################
+
+sub check_packlist
+{
+ my $projectdir = $ENV{'PRJ'};
+ $projectdir =~ s/$packager::globals::separator\s*$//;
+ $packager::globals::packlistname = $projectdir . $packager::globals::separator . "util" . $packager::globals::separator . $packager::globals::packlistname;
+
+ if ( ! -f $packager::globals::packlistname )
+ {
+ packager::exiter::exit_program("ERROR: Package list not found: $packager::globals::packlistname", "check_packlist");
+ }
+}
+
+#############################################################
+# Check 2: The environment variable OUTPATH has to be set
+#############################################################
+
+sub check_environment
+{
+ if ( ! $ENV{'OUTPATH'} )
+ {
+ packager::exiter::exit_program("ERROR: Environment variable OUTPATH not set!", "check_environment");
+ }
+
+ if ( ! $ENV{'PRJ'} )
+ {
+ packager::exiter::exit_program("ERROR: Environment variable PRJ not set!", "check_environment");
+ }
+}
+
+#############################################################
+# Check 3: Checking the parameter. Only "-i" is valid
+#############################################################
+
+sub check_parameter
+{
+ while ( $#ARGV >= 0 )
+ {
+ my $param = shift(@ARGV);
+
+ if ($param eq "-i") { $packager::globals::ignoreerrors = 1; }
+ else
+ {
+ print("\n*************************************\n");
+ print("Sorry, unknown parameter: $param");
+ print("\n*************************************\n");
+ usage();
+ exit(-1);
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/packager/existence.pm b/solenv/bin/modules/packager/existence.pm
new file mode 100644
index 000000000000..81f13395befc
--- /dev/null
+++ b/solenv/bin/modules/packager/existence.pm
@@ -0,0 +1,52 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package packager::existence;
+
+#############################
+# Test of existence
+#############################
+
+sub exists_in_array
+{
+ my ($searchstring, $arrayref) = @_;
+
+ my $alreadyexists = 0;
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ if ( ${$arrayref}[$i] eq $searchstring)
+ {
+ $alreadyexists = 1;
+ last;
+ }
+ }
+
+ return $alreadyexists;
+}
+
+1;
diff --git a/solenv/bin/modules/packager/exiter.pm b/solenv/bin/modules/packager/exiter.pm
new file mode 100644
index 000000000000..d81d5f148f15
--- /dev/null
+++ b/solenv/bin/modules/packager/exiter.pm
@@ -0,0 +1,71 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package packager::exiter;
+
+use packager::files;
+use packager::globals;
+
+############################################
+# Exiting the program with an error
+# This function is used instead of "die"
+############################################
+
+sub exit_program
+{
+ my ($message, $function) = @_;
+
+ my $infoline;
+
+ $infoline = "\n***************************************************************\n";
+ push(@packager::globals::logfileinfo, $infoline);
+ print("$infoline");
+
+ $infoline = "$message\n";
+ push(@packager::globals::logfileinfo, $infoline);
+ print("$infoline");
+
+ $infoline = "in function: $function\n";
+ push(@packager::globals::logfileinfo, $infoline);
+ print("$infoline");
+
+ $infoline = "***************************************************************\n";
+ push(@packager::globals::logfileinfo, $infoline);
+
+ if ( $packager::globals::logging )
+ {
+ packager::files::save_file($packager::globals::logfilename ,\@packager::globals::logfileinfo);
+ print("Saved logfile: $packager::globals::logfilename\n");
+ }
+
+ print("$infoline");
+
+ exit(-1);
+}
+
+1;
diff --git a/solenv/bin/modules/packager/files.pm b/solenv/bin/modules/packager/files.pm
new file mode 100644
index 000000000000..295f55fade45
--- /dev/null
+++ b/solenv/bin/modules/packager/files.pm
@@ -0,0 +1,184 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package packager::files;
+
+use packager::exiter;
+
+############################################
+# File Operations
+############################################
+
+sub check_file
+{
+ my ($arg) = @_;
+
+ if(!( -f $arg ))
+ {
+ packager::exiter::exit_program("ERROR: Cannot find file $arg", "check_file");
+ }
+}
+
+sub read_file
+{
+ my ($localfile) = @_;
+
+ if ( ! open( IN, $localfile ) ) {
+ # try again - sometimes we get errors caused by race conditions in parallel builds
+ sleep 5;
+ open( IN, $localfile ) or packager::exiter::exit_program("ERROR: Cannot open file: $localfile", "read_file");
+ }
+ my @localfile = <IN>;
+ close( IN );
+
+ return \@localfile;
+}
+
+###########################################
+# Saving files
+###########################################
+
+sub save_file
+{
+ my ($savefile, $savecontent) = @_;
+ open( OUT, ">$savefile" );
+ print OUT @{$savecontent};
+ close( OUT);
+ if (! -f $savefile) { packager::exiter::exit_program("ERROR: Cannot write file: $savefile", "save_file"); }
+}
+
+######################################################
+# Creating a new direcotory
+######################################################
+
+sub create_directory
+{
+ my ($directory) = @_;
+
+ my $returnvalue = 1;
+
+ if (!(-d $directory))
+ {
+ $returnvalue = mkdir($directory, 0775);
+
+ if ($returnvalue)
+ {
+ $infoline = "\nCreated directory: $directory\n";
+ push(@packager::globals::logfileinfo, $infoline);
+
+ if ($packager::globals::isunix)
+ {
+ my $localcall = "chmod 775 $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ }
+ else
+ {
+ packager::exiter::exit_program("ERROR: Could not create directory: $directory", "create_directory");
+ }
+ }
+}
+
+######################################################
+# Creating a unique directory with number extension
+######################################################
+
+sub create_unique_directory
+{
+ my ($directory) = @_;
+
+ $directory =~ s/\Q$packager::globals::separator\E\s*$//;
+ $directory = $directory . "_INCREASINGNUMBER";
+
+ my $counter = 1;
+ my $created = 0;
+ my $localdirectory = "";
+
+ do
+ {
+ $localdirectory = $directory;
+ $localdirectory =~ s/INCREASINGNUMBER/$counter/;
+ $counter++;
+
+ if ( ! -d $localdirectory )
+ {
+ create_directory($localdirectory);
+ $created = 1;
+ }
+ }
+ while ( ! $created );
+
+ return $localdirectory;
+}
+
+######################################################
+# Removing a complete directory with subdirectories
+######################################################
+
+sub remove_complete_directory
+{
+ my ($directory) = @_;
+
+ my @content = ();
+
+ $directory =~ s/\Q$packager::globals::separator\E\s*$//;
+
+ if ( -d $directory )
+ {
+ opendir(DIR, $directory);
+ @content = readdir(DIR);
+ closedir(DIR);
+
+ my $oneitem;
+
+ foreach $oneitem (@content)
+ {
+ if ((!($oneitem eq ".")) && (!($oneitem eq "..")))
+ {
+ my $item = $directory . $packager::globals::separator . $oneitem;
+
+ if ( -f $item ) # deleting files
+ {
+ unlink($item);
+ }
+
+ if ( -d $item ) # recursive
+ {
+ remove_complete_directory($item, 0);
+ }
+ }
+ }
+
+ # try to remove empty directory
+
+ rmdir $directory;
+
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/packager/globals.pm b/solenv/bin/modules/packager/globals.pm
new file mode 100644
index 000000000000..955a1598adc8
--- /dev/null
+++ b/solenv/bin/modules/packager/globals.pm
@@ -0,0 +1,54 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package packager::globals;
+
+############################################
+# Global settings
+############################################
+
+BEGIN
+{
+ $prog="packager";
+
+ $packlistname = "pack.lst";
+ $compiler = "";
+ $ignoreerrors = 0;
+
+ $logging = 0;
+ $logfilename = "packager_logfile.log"; # the default logfile name for global errors
+ @logfileinfo = ();
+
+ $plat = $^O;
+
+ $separator = "/";
+ $iswin = 0;
+ $isunix = 1;
+
+}
+
+1;
diff --git a/solenv/bin/modules/packager/work.pm b/solenv/bin/modules/packager/work.pm
new file mode 100644
index 000000000000..ae0c743a635f
--- /dev/null
+++ b/solenv/bin/modules/packager/work.pm
@@ -0,0 +1,327 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package packager::work;
+
+use packager::exiter;
+use packager::existence;
+use packager::files;
+use packager::globals;
+
+###########################################
+# Setting global variables
+###########################################
+
+sub set_global_variable
+{
+ my $compiler = $ENV{'OUTPATH'};
+
+ if ( $ENV{'PROEXT'} ) { $compiler = $compiler . $ENV{'PROEXT'}; }
+
+ $packager::globals::compiler = $compiler;
+}
+
+#############################################################################
+# Converting a string list with separator $listseparator
+# into an array
+#############################################################################
+
+sub convert_stringlist_into_array
+{
+ my ( $includestringref, $listseparator ) = @_;
+
+ my @newarray = ();
+ my $first;
+ my $last = ${$includestringref};
+
+ while ( $last =~ /^\s*(.+?)\Q$listseparator\E(.+)\s*$/) # "$" for minimal matching
+ {
+ $first = $1;
+ $last = $2;
+ push(@newarray, "$first");
+ }
+
+ push(@newarray, "$last");
+
+ return \@newarray;
+}
+
+###########################################
+# Generating a list of package calls
+# corresponding to the package list
+###########################################
+
+sub create_package_todos
+{
+ my ( $packagelist ) = @_;
+
+ my @targets = (); # only used, if the build server is not used
+
+ for ( my $i = 0; $i <= $#{$packagelist}; $i++ )
+ {
+ my $line = ${$packagelist}[$i];
+
+ if ( $line =~ /^\s*\#/ ) { next; } # comment line
+
+ if ( $line =~ /^\s*(\w+?)\s+(\S+?)\s+(\S+?)\s+(\w+?)\s*$/ )
+ {
+ my $product = $1;
+ my $compilerlist = $2;
+ my $languagelist = $3;
+ my $target = $4;
+
+ $product =~ s/\s//g;
+ $compilerlist =~ s/\s//g;
+ $languagelist =~ s/\s//g;
+ $target =~ s/\s//g;
+
+ my $compilers = convert_stringlist_into_array(\$compilerlist, ",");
+
+ # is the compiler of this "build" part of the compiler list in pack.lst ?
+
+ if ( packager::existence::exists_in_array($packager::globals::compiler, $compilers) )
+ {
+ # products are separated in pack.lst by "|"
+
+ my $languagesets = convert_stringlist_into_array(\$languagelist, "\|");
+
+ # now all information is available to create the targets for the systemcalls
+
+ for ( my $j = 0; $j <= $#{$languagesets}; $j++ )
+ {
+ my $languagestring = ${$languagesets}[$j];
+ $languagestring =~ s/\,/\_/g; # comma in pack.lst becomes "_" in dmake command
+
+ my $target = $target . "_" . $languagestring;
+ push(@targets, $target);
+
+ my $insertline = $target . "\n";
+ push( @packager::globals::logfileinfo, $insertline);
+ }
+ }
+ }
+ }
+
+ return \@targets;
+}
+
+###########################################
+# Executing the generated system calls
+###########################################
+
+sub execute_system_calls
+{
+ my ( $targets ) = @_;
+
+ for ( my $i = 0; $i <= $#{$targets}; $i++ )
+ {
+ my $systemcall = "dmake " . ${$targets}[$i];
+
+ my $infoline = "Packager: $systemcall\n";
+ print $infoline;
+ push( @packager::globals::logfileinfo, $infoline);
+
+ my $returnvalue = system($systemcall);
+
+ $infoline = "Packager finished: $systemcall\n";
+ print $infoline;
+ push( @packager::globals::logfileinfo, $infoline);
+
+ if ( $returnvalue )
+ {
+ $infoline = "\nERROR: Packager $systemcall\n";
+ print $infoline;
+ push( @packager::globals::logfileinfo, $infoline);
+ if (!($packager::globals::ignoreerrors)) { packager::exiter::exit_program("ERROR: Packing not successful : $systemcall", "execute_system_calls"); }
+ }
+ }
+}
+
+##############################################################
+# Starting the build server with the generated system calls
+##############################################################
+
+sub start_build_server
+{
+ my ( $targets ) = @_;
+
+ # preparing the directory structure
+
+ my $prj = $ENV{PRJ}; # for example "..";
+ my $platform = $ENV{INPATH}; # wntmsci10.pro, unxsols4.pro
+ my $platformpath = $prj . $packager::globals::separator . $platform;
+ if ( ! -d $platformpath ) { packager::files::create_directory($miscpath); }
+ my $miscpath = $platformpath . $packager::globals::separator . "misc";
+ if ( ! -d $miscpath ) { packager::files::create_directory($miscpath); }
+ $miscpath = $miscpath . $packager::globals::separator . "temp";
+ if ( -d $miscpath ) { packager::files::remove_complete_directory($miscpath); } # removing old files !
+ if ( ! -d $miscpath ) { packager::files::create_directory($miscpath); }
+
+ my $prjroot = ".." . $packager::globals::separator . ".." . $packager::globals::separator . ".." . $packager::globals::separator . ".."; # platform/misc/temp/uniquetempdir
+
+ my $makefilepath = $prj . $packager::globals::separator . "util" . $packager::globals::separator . "makefile.mk";
+
+ if ( ! $ENV{'PRJNAME'} ) { packager::exiter::exit_program("ERROR: Environment variable PRJNAME not set!", "do_broadcast"); }
+ my $prjname = $ENV{PRJNAME};
+
+ my $pkgformat = $ENV{PKGFORMAT};
+
+ my $prjdep = $prjname . "\\" . "util"; # always windows like path
+ my @targetdirs;
+ my @targetlines = ();
+ # iterating over all targets
+ for ( my $i = 0; $i <= $#{$targets}; $i++ )
+ {
+ my $target = ${$targets}[$i];
+ my $tempdir = $miscpath . $packager::globals::separator . $target;
+ $tempdir = packager::files::create_unique_directory ($tempdir);
+ @targetlines=();
+ push( @targetlines, "\ngenerated_target : $target\n\n"); # to be included into the makefile.mk
+
+ if ( defined $pkgformat ) {
+ push( @targetlines, "\n$target : ".'$$@{$(PKGFORMAT:^".")}'."\n\n"); # to be included into the makefile.mk
+ }
+
+ generate_makefile($tempdir, $makefilepath, $prjroot, $target, \@targetlines);
+
+ do_broadcast($tempdir, $prjname, $prj, $platform, $prjdep);
+ push @targetdirs, $tempdir;
+ }
+}
+
+##############################################################
+# Generating the makefile in the temporary directory
+##############################################################
+
+sub generate_makefile
+{
+ my ( $tempdir, $makefilepath, $prjroot, $target, $targetlines_ref ) = @_;
+
+ my $makefile = packager::files::read_file($makefilepath);
+
+ my @targetlines = ();
+ push( @targetlines, @{$targetlines_ref}); # to be included into the makefile.mk
+
+ $prjroot = $prjroot . "\n";
+
+ my $uniquename = $tempdir;
+ get_filename_from_path(\$uniquename);
+ $uniquename = $uniquename . "\n";
+
+ my $counter = 0;
+ my $increase = 1;
+
+ for ( my $i = 0; $i <= $#{$makefile}; $i++ )
+ {
+ if ( ${$makefile}[$i] =~ /^\s*TARGET\s*=.*/ ) { ${$makefile}[$i] = "TARGET=" . $uniquename; } # setting the new project root
+
+ if ( ${$makefile}[$i] =~ /^\s*PRJ\s*=.*/ ) { ${$makefile}[$i] = "PRJ=" . $prjroot; } # setting the new project root
+
+ if ( ${$makefile}[$i] =~ /^\s*\.INCLUDE[\t ]*:[\t ]*target.mk[\t ]*$/ ) { $increase = 0; } # no more increase of the counter
+
+ if ( $increase ) { $counter++; }
+ }
+
+ splice(@{$makefile}, $counter, 0, @targetlines); # including the new target lines at position $counter
+
+ my $newmakefilepath = $tempdir . $packager::globals::separator . "makefile.mk";
+ packager::files::save_file($newmakefilepath, $makefile);
+}
+
+##############################################################
+# Generating the broadcasts for the build server
+##############################################################
+
+sub do_broadcast
+{
+ use File::Temp;
+
+ my ( $tempdir, $prjname, $prj, $platform, $prjdep ) = @_;
+
+ # Syntax: cmd_bcst -s 18 "Version;Environment;Project;Verzeichnis;Restriction[;Abhaengigkeit1][;Abhaengigkeit n]..."
+ # Example: cmd_bcst -s 18 "SRC680;wntmsci10.pro;instsetoo_native;;instsetoo_native\bla1;instsetoo_native\util"
+
+ if ( ! $ENV{'WORK_STAMP'} ) { packager::exiter::exit_program("ERROR: Environment variable WORK_STAMP not set!", "do_broadcast"); }
+ my $workstamp = $ENV{WORK_STAMP};
+ my $cwsworkstamp = $ENV{CWS_WORK_STAMP};
+
+ my $prjdir = $tempdir;
+ $prjdir =~ s/$prj/$prjname/;
+ $prjdir =~ s/\//\\/g; # convert to windows path syntax
+
+ my $tempfiledir = $ENV{TMP};
+ $tempfiledir = $tempdir if ( ! defined $tempfiledir );
+ my ( $tmpfile_handle, $tmpfile_name ) = mkstemp( $tempfiledir . $packager::globals::separator . "packagerXXXXX");
+ if ( ! $tmpfile_handle ) {
+ packager::exiter::exit_program("ERROR: Couldn't open temporary file \"$tmpfile_name\"!", "do_broadcast");
+ }
+ if (defined($cwsworkstamp)) {
+ print $tmpfile_handle "\"$cwsworkstamp;$platform;$prjname;$prjdir;nobase;$prjdep\"";
+ print "to tmpfile: \"$cwsworkstamp;$platform;$prjname;$prjdir;nobase;$prjdep\"\n";
+ }
+ else {
+ print $tmpfile_handle "\"$workstamp;$platform;$prjname;$prjdir;nobase;$prjdep\"";
+ print "to tmpfile: \"$workstamp;$platform;$prjname;$prjdir;nobase;$prjdep\"\n";
+ }
+ close $tmpfile_handle;
+ my $returnvalue = system("cmd_bcst -s 18 \@$tmpfile_name");
+ print "cmd_bcst -s 18 \@$tmpfile_name\n";
+ unlink "$tmpfile_name";
+
+ if ( $returnvalue ) # an error occured
+ {
+ if (!($packager::globals::ignoreerrors)) { packager::exiter::exit_program("ERROR: Packing not successful!", "do_broadcast"); }
+ }
+}
+
+##############################################################
+# Returning the name of file or directory from complete path
+##############################################################
+
+sub get_filename_from_path
+{
+ my ($longfilenameref) = @_;
+
+ if ( $packager::globals::isunix )
+ {
+ if ( $$longfilenameref =~ /^.*\/(\S.+\S?)/ )
+ {
+ $$longfilenameref = $1;
+ }
+ }
+
+ if ( $packager::globals::iswin )
+ {
+ if ( $$longfilenameref =~ /^.*\\(\S.+\S?)/ )
+ {
+ $$longfilenameref = $1;
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/par2script/check.pm b/solenv/bin/modules/par2script/check.pm
new file mode 100644
index 000000000000..78808cee9191
--- /dev/null
+++ b/solenv/bin/modules/par2script/check.pm
@@ -0,0 +1,347 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package par2script::check;
+
+use par2script::globals;
+
+################################
+# Checks of the setup script
+################################
+
+########################################################
+# Checking if all defined directories are needed
+########################################################
+
+sub check_needed_directories
+{
+ my $allfiles = $par2script::globals::definitions{'File'};
+ my $alldirs = $par2script::globals::definitions{'Directory'};
+
+ # checking if all defined directories are needed
+
+ my $dir;
+ foreach $dir ( keys %{$alldirs} )
+ {
+ # I. directory has create flag
+ if (( exists($alldirs->{$dir}->{'Styles'}) ) && ( $alldirs->{$dir}->{'Styles'} =~ /\bCREATE\b/ )) { next; }
+
+ # II. there is at least one file in the directory
+ my $fileinside = 0;
+ my $file;
+ foreach $file ( keys %{$allfiles} )
+ {
+ if (( $allfiles->{$file}->{'Dir'} eq $dir ) || ( $allfiles->{$file}->{'NetDir'} eq $dir ))
+ {
+ $fileinside = 1;
+ last;
+ }
+ }
+ if ( $fileinside ) { next; }
+
+ # III. the directory is parent for another directory
+ my $isparent = 0;
+ my $onedir;
+ foreach $onedir ( keys %{$alldirs} )
+ {
+ if ( $alldirs->{$onedir}->{'ParentID'} eq $dir )
+ {
+ $isparent = 1;
+ last;
+ }
+ }
+ if ( $isparent ) { next; }
+
+ # no condition is true -> directory definition is superfluous
+ my $infoline = "\tINFO: Directory definition $dir is superfluous\n";
+ # print $infoline;
+ push(@par2script::globals::logfileinfo, $infoline);
+ }
+}
+
+##################################################
+# Checking if the directories in the item
+# definitions are defined.
+##################################################
+
+sub check_directories_in_item_definitions
+{
+ my $item;
+ foreach $item ( @par2script::globals::items_with_directories )
+ {
+ my $allitems = $par2script::globals::definitions{$item};
+
+ my $onegid;
+ foreach $onegid ( keys %{$allitems} )
+ {
+ if ( ! exists($allitems->{$onegid}->{'Dir'}) ) { die "\nERROR: No directory defined for item: $onegid!\n\n"; }
+ my $dir = $allitems->{$onegid}->{'Dir'};
+ if (( $dir eq "PD_PROGDIR" ) || ( $dir =~ /PREDEFINED_/ )) { next; }
+
+ # checking if this directoryid is defined
+ if ( ! exists($par2script::globals::definitions{'Directory'}->{$dir}) )
+ {
+ die "\nERROR: Directory $dir in item $onegid not defined!\n\n";
+ }
+ }
+ }
+}
+
+########################################################
+# Checking for all Items, that know their modules,
+# whether these modules exist.
+########################################################
+
+sub check_module_existence
+{
+ my $item;
+ foreach $item ( @par2script::globals::items_with_moduleid )
+ {
+ my $allitems = $par2script::globals::definitions{$item};
+
+ my $onegid;
+ foreach $onegid ( keys %{$allitems} )
+ {
+ if ( ! exists($allitems->{$onegid}->{'ModuleID'}) ) { die "\nERROR: No ModuleID defined for item: $onegid!\n\n"; }
+ my $moduleid = $allitems->{$onegid}->{'ModuleID'};
+
+ # checking if this directoryid is defined
+ if ( ! exists($par2script::globals::definitions{'Module'}->{$moduleid}) )
+ {
+ die "\nERROR: ModuleID $moduleid in item $onegid not defined!\n\n";
+ }
+ }
+ }
+}
+
+########################################################
+# Every script has to contain exactly one root module.
+# This module has no ParentID or an empty ParentID.
+########################################################
+
+sub check_rootmodule
+{
+ my $rootgid = "";
+ my $foundroot = 0;
+
+ my $allmodules = $par2script::globals::definitions{'Module'};
+
+ my $modulegid = "";
+ foreach $modulegid (keys %{$allmodules} )
+ {
+ if (( ! exists($allmodules->{$modulegid}->{'ParentID'}) ) || ( $allmodules->{$modulegid}->{'ParentID'} eq "" ))
+ {
+ if ( $foundroot )
+ {
+ die "\nERROR: More than one Root module. Only one module without ParentID or with empty ParentID allowed ($rootgid and $modulegid).\n";
+ }
+ $rootgid = $modulegid;
+ $foundroot = 1;
+ }
+ }
+
+ if ( ! $foundroot )
+ {
+ die "\nERROR: Could not find Root module. Did not find module without ParentID or with empty ParentID.\n";
+ }
+
+ print " $rootgid\n";
+
+}
+
+########################################################
+# File, Shortcut, Directory, Unixlink must not
+# contain a ModuleID
+########################################################
+
+sub check_moduleid_at_items
+{
+ my $item;
+ foreach $item ( @par2script::globals::items_without_moduleid )
+ {
+ my $allitems = $par2script::globals::definitions{$item};
+
+ my $onegid;
+ foreach $onegid ( keys %{$allitems} )
+ {
+ if ( exists($allitems->{$onegid}->{'ModuleID'}) )
+ {
+ die "\nERROR: ModuleID assigned to $onegid! No module assignment to $item!\n\n";
+ }
+ }
+ }
+}
+
+########################################################
+# Controlling existence of multi assignments
+########################################################
+
+sub check_multiple_assignments
+{
+ my @multiassignments = ();
+ my $error;
+
+ my $topitem;
+ foreach $topitem ( keys %par2script::globals::assignedgids )
+ {
+ my $item;
+ foreach $item ( keys %{$par2script::globals::assignedgids{$topitem}} )
+ {
+ if ( $par2script::globals::assignedgids{$topitem}->{$item} > 1 )
+ {
+ $error = 1;
+ my $string = "\tGID: $item Assignments: $par2script::globals::assignedgids{$topitem}->{$item}";
+ push(@multiassignments, $string);
+ }
+ }
+ }
+
+ if ( $error ) { par2script::exiter::multiassignmenterror(\@multiassignments); }
+}
+
+########################################################
+# Check, if a defined directory has a flag CREATE
+########################################################
+
+sub contains_create_flag
+{
+ my ($gid) = @_;
+
+ my $createflag = 0;
+
+ if (( exists($par2script::globals::definitions{'Directory'}->{$gid}->{'Styles'}) ) &&
+ ( $par2script::globals::definitions{'Directory'}->{$gid}->{'Styles'} =~ /\bCREATE\b/ ))
+ {
+ $createflag = 1;
+ }
+
+ return $createflag;
+}
+
+########################################################
+# Controlling existence of definitions without
+# any assignment
+########################################################
+
+sub check_missing_assignments
+{
+ # If defined gids for "File", "Directory" or "Unixlink" are not assigned,
+ # this causes an error.
+ # Directories only have to be assigned, if they have the flag "CREATE".
+
+ my @missingassignments = ();
+ $error = 0;
+
+ my $item;
+ foreach $item ( @par2script::globals::items_assigned_at_modules )
+ {
+ my $assignedgids = $par2script::globals::assignedgids{$item};
+ my $definedgids = $par2script::globals::definitions{$item};
+
+ my $gid;
+ foreach $gid ( keys %{$definedgids} )
+ {
+ if ( $item eq "Directory" ) { if ( ! contains_create_flag($gid) ) { next; } }
+
+ if ( ! exists( $assignedgids->{$gid} ))
+ {
+ $error = 1;
+ push(@missingassignments, $gid);
+ }
+ }
+ }
+
+ if ( $error ) { par2script::exiter::missingassignmenterror(\@missingassignments); }
+}
+
+#############################################################
+# Controlling if for all shortcuts with file assignment
+# the file is defined. And for all shortcuts with
+# shortcut assignment the shortcut has to be defined.
+#############################################################
+
+sub check_shortcut_assignments
+{
+ my $allshortcuts = $par2script::globals::definitions{'Shortcut'};
+ my $allfiles = $par2script::globals::definitions{'File'};
+
+ my $shortcut;
+ foreach $shortcut ( keys %{$allshortcuts} )
+ {
+ if (( exists($allshortcuts->{$shortcut}->{'FileID'}) ) &&
+ ( ! exists($allfiles->{$allshortcuts->{$shortcut}->{'FileID'}}) ))
+ {
+ # die "\nERROR: FileID $allshortcuts->{$shortcut}->{'FileID'} has no definition at shortcut $shortcut !\n";
+ print "\n\tWARNING: FileID $allshortcuts->{$shortcut}->{'FileID'} has no definition at shortcut $shortcut !\n";
+ }
+
+ if (( exists($allshortcuts->{$shortcut}->{'ShortcutID'}) ) &&
+ ( ! exists($allshortcuts->{$allshortcuts->{$shortcut}->{'ShortcutID'}}) ))
+ {
+ die "\nERROR: ShortcutID $allshortcuts->{$shortcut}->{'ShortcutID'} has no definition at shortcut $shortcut !\n";
+ }
+
+ if (( ! exists($allshortcuts->{$shortcut}->{'ShortcutID'}) ) &&
+ ( ! exists($allshortcuts->{$shortcut}->{'FileID'}) ))
+ {
+ die "\nERROR: Shortcut requires assignment to \"ShortcutID\" or \"FileID\". Missing at shortcut $shortcut !\n";
+ }
+ }
+}
+
+#############################################################
+# Controlling if for Modules and Directories, the parents
+# are defined. If not, this can lead to a problem during
+# script creation, because only recursively added
+# Modules or Directories are added to the script.
+#############################################################
+
+sub check_missing_parents
+{
+ my @parentitems = ("Module", "Directory");
+ my %rootparents = ("PREDEFINED_PROGDIR" => "1");
+
+ my $oneitem;
+ foreach $oneitem ( @parentitems )
+ {
+ my $alldefinitions = $par2script::globals::definitions{$oneitem};
+
+ my $onegid;
+ foreach $onegid ( keys %{$alldefinitions} )
+ {
+ # If there is a ParentID used, it must be defined
+ if (( exists($alldefinitions->{$onegid}->{'ParentID'}) ) &&
+ ( ! exists($alldefinitions->{$alldefinitions->{$onegid}->{'ParentID'}}) ) &&
+ ( ! exists($rootparents{$alldefinitions->{$onegid}->{'ParentID'}}) ))
+ {
+ die "\nERROR: Parent \"$alldefinitions->{$onegid}->{'ParentID'}\" at $oneitem \"$onegid\" is not defined!\n";
+ }
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/par2script/converter.pm b/solenv/bin/modules/par2script/converter.pm
new file mode 100644
index 000000000000..49f0d62d4c64
--- /dev/null
+++ b/solenv/bin/modules/par2script/converter.pm
@@ -0,0 +1,142 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package par2script::converter;
+
+use par2script::remover;
+
+#############################
+# Converter
+#############################
+
+sub convert_array_to_hash
+{
+ my ($arrayref) = @_;
+
+ my ($line, $key, $value);
+
+ my %newhash = ();
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ $line = ${$arrayref}[$i];
+
+ if ( $line =~ /^\s*(\w+?)\s+(.*?)\s*$/ )
+ {
+ $key = $1;
+ $value = $2;
+ $newhash{$key} = $value;
+ }
+ }
+
+ return \%newhash;
+}
+
+sub convert_hash_into_array
+{
+ my ($hashref) = @_;
+
+ my @array = ();
+ my ($key, $value, $input);
+
+ foreach $key (keys %{$hashref})
+ {
+ $value = $hashref->{$key};
+ $input = "$key = $value\n";
+ push(@array ,$input);
+ }
+
+ return \@array
+}
+
+sub convert_stringlist_into_array_2
+{
+ my ( $input, $separator ) = @_;
+
+ my @newarray = ();
+ my $first = "";
+ my $last = "";
+
+ $last = $input;
+
+ while ( $last =~ /^\s*(.+?)\s*\Q$separator\E\s*(.+)\s*$/) # "$" for minimal matching
+ {
+ $first = $1;
+ $last = $2;
+ par2script::remover::remove_leading_and_ending_whitespaces(\$first);
+ if ( $first ) { push(@newarray, $first); }
+ }
+
+ par2script::remover::remove_leading_and_ending_whitespaces(\$last);
+ if ( $last ) { push(@newarray, $last); }
+
+ return \@newarray;
+}
+
+sub convert_stringlist_into_array
+{
+ my ( $includestringref, $separator ) = @_;
+
+ my @newarray = ();
+ my ($first, $last);
+
+ $last = ${$includestringref};
+
+ while ( $last =~ /^\s*(.+?)\s*\Q$separator\E\s*(.+)\s*$/) # "$" for minimal matching
+ {
+ $first = $1;
+ $last = $2;
+ par2script::remover::remove_leading_and_ending_whitespaces(\$first);
+ push(@newarray, $first);
+ }
+
+ par2script::remover::remove_leading_and_ending_whitespaces(\$last);
+ push(@newarray, $last);
+
+ return \@newarray;
+}
+
+#############################################################################
+# The file name contains for some files "/". If this programs runs on
+# a windows platform, this has to be converted to "\".
+#############################################################################
+
+sub convert_slash_to_backslash
+{
+ my ($filesarrayref) = @_;
+
+ my ($onefile, $filename);
+
+ for ( my $i = 0; $i <= $#{$filesarrayref}; $i++ )
+ {
+ $onefile = ${$filesarrayref}[$i];
+ $onefile->{'Name'} =~ s/\//\\/g;
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/par2script/existence.pm b/solenv/bin/modules/par2script/existence.pm
new file mode 100644
index 000000000000..08fb8eda4c7c
--- /dev/null
+++ b/solenv/bin/modules/par2script/existence.pm
@@ -0,0 +1,74 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package par2script::existence;
+
+#############################
+# Test of existence
+#############################
+
+sub exists_in_array
+{
+ my ($searchstring, $arrayref) = @_;
+
+ my $alreadyexists = 0;
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ if ( ${$arrayref}[$i] eq $searchstring)
+ {
+ $alreadyexists = 1;
+ last;
+ }
+ }
+
+ return $alreadyexists;
+}
+
+sub exists_in_array_of_hashes
+{
+ my ($searchkey, $searchvalue, $arrayref) = @_;
+
+ my $hashref;
+ my $valueexists = 0;
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ $hashref = ${$arrayref}[$i];
+
+ if ( $hashref->{$searchkey} eq $searchvalue )
+ {
+ $valueexists = 1;
+ last;
+ }
+ }
+
+ return $valueexists;
+}
+
+1;
diff --git a/solenv/bin/modules/par2script/exiter.pm b/solenv/bin/modules/par2script/exiter.pm
new file mode 100644
index 000000000000..24399422dc73
--- /dev/null
+++ b/solenv/bin/modules/par2script/exiter.pm
@@ -0,0 +1,122 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package par2script::exiter;
+
+use par2script::files;
+use par2script::globals;
+
+############################################
+# Exiting the program with an error
+# This function is used instead of "die"
+############################################
+
+sub exit_program
+{
+ my ($message, $function) = @_;
+
+ my $infoline;
+
+ $infoline = "\n***************************************************************\n";
+ push(@par2script::globals::logfileinfo, $infoline);
+ print("$infoline");
+
+ $infoline = "$message\n";
+ push(@par2script::globals::logfileinfo, $infoline);
+ print("$infoline");
+
+ $infoline = "in function: $function\n";
+ push(@par2script::globals::logfileinfo, $infoline);
+ print("$infoline");
+
+ $infoline = "***************************************************************\n";
+ push(@par2script::globals::logfileinfo, $infoline);
+
+ if ($par2script::globals::logging)
+ {
+ par2script::files::save_file($par2script::globals::logfilename, \@par2script::globals::logfileinfo);
+ print("Saved logfile: $par2script::globals::logfilename\n");
+ }
+
+ print("$infoline");
+
+ exit(-1);
+}
+
+#####################################
+# Error, because a gid is defined
+# more than once
+#####################################
+
+sub multidefinitionerror
+{
+ my ( $multidefinitiongids ) = @_;
+ print "************************************************\n";
+ print "ERROR: multiple definition of gids:\n";
+ print "************************************************\n";
+
+ my $gid;
+ foreach $gid ( @{$multidefinitiongids} ) { print "\t$gid\n"; }
+ exit(-1);
+}
+
+#####################################
+# Error, because a gid is assigned
+# more than once
+#####################################
+
+sub multiassignmenterror
+{
+ my ( $multiassignmentgids ) = @_;
+ #print "************************************************\n";
+ #print "ERROR: multiple assignments of gids:\n";
+ #print "************************************************\n";
+
+ my $line;
+ foreach $line ( @{$multiassignmentgids} ) { print "\t$line\n"; }
+ # exit(-1);
+}
+
+#####################################
+# Error, because a defined gid
+# is not assigned
+#####################################
+
+sub missingassignmenterror
+{
+ my ( $missingassignmentgids ) = @_;
+ print "********************************************************\n";
+ print "ERROR: Missing assignments for the following GIDs:\n";
+ print "********************************************************\n";
+
+ my $gid;
+ foreach $gid ( @{$missingassignmentgids} ) { print "\t$gid\n"; }
+ exit(-1);
+}
+
+1;
diff --git a/solenv/bin/modules/par2script/files.pm b/solenv/bin/modules/par2script/files.pm
new file mode 100644
index 000000000000..3b7e70d2d4a9
--- /dev/null
+++ b/solenv/bin/modules/par2script/files.pm
@@ -0,0 +1,124 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package par2script::files;
+
+use par2script::exiter;
+
+############################################
+# File Operations
+############################################
+
+sub check_file
+{
+ my ($arg) = @_;
+
+ if(!( -f $arg ))
+ {
+ par2script::exiter::exit_program("ERROR: Cannot find file $arg", "check_file");
+ }
+}
+
+sub read_file
+{
+ my ($localfile) = @_;
+
+ my @localfile = ();
+
+ open( IN, "<$localfile" ) || par2script::exiter::exit_program("ERROR: Cannot open file: $localfile", "read_file");
+ while ( <IN> ) { push(@localfile, $_); }
+ close( IN );
+
+ return \@localfile;
+}
+
+###########################################
+# Saving files, arrays and hashes
+###########################################
+
+sub save_file
+{
+ my ($savefile, $savecontent) = @_;
+ open( OUT, ">$savefile" );
+ print OUT @{$savecontent};
+ close( OUT);
+ if (! -f $savefile) { pre2par::exiter::exit_program("ERROR: Cannot write file: $savefile", "save_file"); }
+}
+
+sub save_hash
+{
+ my ($savefile, $hashref) = @_;
+
+ my @printcontent = ();
+
+ my ($itemkey, $itemvalue, $line);
+
+ foreach $itemkey ( keys %{$hashref} )
+ {
+ $line = "";
+ $itemvalue = $hashref->{$itemkey};
+ $line = $itemkey . "=" . $itemvalue . "\n";
+ push(@printcontent, $line);
+ }
+
+ open( OUT, ">$savefile" );
+ print OUT @printcontent;
+ close( OUT);
+}
+
+sub save_array_of_hashes
+{
+ my ($savefile, $arrayref) = @_;
+
+ my @printcontent = ();
+
+ my ($itemkey, $itemvalue, $line, $hashref);
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ $line = "";
+ $hashref = ${$arrayref}[$i];
+
+ foreach $itemkey ( keys %{$hashref} )
+ {
+ $itemvalue = $hashref->{$itemkey};
+
+ $line = $line . $itemkey . "=" . $itemvalue . "\t";
+ }
+
+ $line = $line . "\n";
+
+ push(@printcontent, $line);
+ }
+
+ open( OUT, ">$savefile" );
+ print OUT @printcontent;
+ close( OUT);
+}
+
+1;
diff --git a/solenv/bin/modules/par2script/globals.pm b/solenv/bin/modules/par2script/globals.pm
new file mode 100644
index 000000000000..9a3c06f23879
--- /dev/null
+++ b/solenv/bin/modules/par2script/globals.pm
@@ -0,0 +1,81 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package par2script::globals;
+
+############################################
+# Global settings
+############################################
+
+BEGIN
+{
+ $prog="par2script";
+
+ $includepathlist = "";
+ $scriptname = "";
+ $parfilelistorig = "";
+ $parfilelist = "";
+
+ @allitems = ("Installation", "ScpAction", "Directory", "File",
+ "Shortcut", "Unixlink", "Module", "Profile", "ProfileItem",
+ "Folder", "FolderItem", "RegistryItem", "WindowsCustomAction",
+ "MergeModule");
+
+ @items_assigned_at_modules = ("File", "Directory", "Unixlink");
+ @items_with_directories = ("File", "Profile", "Shortcut", "Unixlink");
+ @items_with_moduleid = ("Profile", "ProfileItem", "FolderItem", "RegistryItem");
+ @items_without_moduleid = ("File", "Directory", "Shortcut", "Unixlink");
+
+ %searchkeys = ("File" => "Files", "Directory" => "Dirs", "Unixlink" => "Unixlinks");
+
+ $logging = 0;
+ $logfilename = "logfile.log"; # the default logfile name for global errors
+ @logfileinfo = ();
+
+ $multidefinitionerror = 0;
+ $multiassignmenterror = 0;
+
+ %definitions;
+ %assignedgids;
+
+ $plat = $^O;
+
+ $separator = "/";
+ $pathseparator = "\:";
+ $isunix = 1;
+ $iswin = 0;
+
+ $islinux = 0;
+ $issolaris = 0;
+
+ if ( $plat =~ /linux/i ) { $islinux = 1; }
+ if ( $plat =~ /solaris/i ) { $issolaris = 1; }
+
+}
+
+1;
diff --git a/solenv/bin/modules/par2script/module.pm b/solenv/bin/modules/par2script/module.pm
new file mode 100644
index 000000000000..00b341306db2
--- /dev/null
+++ b/solenv/bin/modules/par2script/module.pm
@@ -0,0 +1,264 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package par2script::module;
+
+use par2script::converter;
+use par2script::exiter;
+
+###########################################
+# Removing undefined gids
+# from modules
+###########################################
+
+sub remove_from_modules
+{
+ my ($gid, $item) = @_;
+
+ my $counter = 0;
+
+ if ( ! exists($par2script::globals::searchkeys{$item}) ) { par2script::exiter::exit_program("ERROR: Unknown type \"$item\" at modules.", "remove_from_modules"); }
+ my $searchkey = $par2script::globals::searchkeys{$item};
+
+ my $allmodules = $par2script::globals::definitions{'Module'};
+
+ my $onemodule;
+ foreach $onemodule (keys %{$allmodules})
+ {
+ if (( exists($allmodules->{$onemodule}->{$searchkey}) ) && ( $allmodules->{$onemodule}->{$searchkey} =~ /\b$gid\b/ ))
+ {
+ my $infoline = "WARNING: Removing $gid because of missing definition\n";
+ # print $infoline;
+ push(@par2script::globals::logfileinfo, $infoline);
+
+ $allmodules->{$onemodule}->{$searchkey} =~ s/\b$gid\b//;
+ $allmodules->{$onemodule}->{$searchkey} =~ s/\,\s*\,/\,/;
+ $allmodules->{$onemodule}->{$searchkey} =~ s/\(\s*\,\s*/\(/;
+ $allmodules->{$onemodule}->{$searchkey} =~ s/\s*\,\s*\)/\)/;
+
+ if (( $allmodules->{$onemodule}->{$searchkey} =~ /\(\s*\,\s*\)/ ) ||
+ ( $allmodules->{$onemodule}->{$searchkey} =~ /\(\s*\)/ ))
+ {
+ delete($allmodules->{$onemodule}->{$searchkey});
+ }
+
+ $counter++;
+ }
+ }
+
+ return $counter;
+}
+
+###########################################
+# Removing undefined gids automatically
+# from modules
+###########################################
+
+sub remove_undefined_gids_from_modules
+{
+ # If assigned gids for "File", "Directory" or "Unixlink" are not defined,
+ # they are automatically removed from the module
+
+ foreach $item ( @par2script::globals::items_assigned_at_modules )
+ {
+ my $assignedgids = $par2script::globals::assignedgids{$item};
+ my $definedgids = $par2script::globals::definitions{$item};
+
+ my $gid;
+ foreach $gid ( keys %{$assignedgids} )
+ {
+ if ( ! exists( $definedgids->{$gid} ))
+ {
+ # deleting entry in module definition
+ my $number_of_removals = remove_from_modules($gid, $item);
+ # decreasing counter in assignments
+ if ( $assignedgids->{$gid} > $number_of_removals ) { $assignedgids->{$gid} = $assignedgids->{$gid} - $number_of_removals; }
+ else { delete($assignedgids->{$gid}); }
+ }
+ }
+ }
+}
+
+############################################
+# Getting the gid of the root module. The
+# root module has no ParentID or an empty
+# ParentID.
+############################################
+
+sub get_rootmodule_gid
+{
+ my $rootgid = "";
+ my $foundroot = 0;
+
+ my $allmodules = $par2script::globals::definitions{'Module'};
+
+ my $modulegid = "";
+ foreach $modulegid (keys %{$allmodules} )
+ {
+ # print "Module $modulegid\n";
+ # my $content = "";
+ # foreach $content (sort keys %{$allmodules->{$modulegid}}) { print "\t$content = $allmodules->{$modulegid}->{$content};\n"; }
+ # print "End\n";
+ # print "\n";
+
+ if (( ! exists($allmodules->{$modulegid}->{'ParentID'})) || ( $allmodules->{$modulegid}->{'ParentID'} eq "" ))
+ {
+ if ( $foundroot ) { par2script::exiter::exit_program("ERROR: More than one Root module. Only one module without ParentID or with empty ParentID allowed ($rootgid and $modulegid).", "get_rootmodule_gid"); }
+ $rootgid = $modulegid;
+ $foundroot = 1;
+ }
+ }
+
+ if ( ! $foundroot ) { par2script::exiter::exit_program("ERROR: Could not find Root module. Did not find module without ParentID or with empty ParentID.", "get_rootmodule_gid"); }
+
+ return $rootgid;
+}
+
+####################################
+# Adding defined items without
+# assignment to the root module.
+####################################
+
+sub add_to_root_module
+{
+ # If defined gids for "File", "Directory" or "Unixlink" are not assigned,
+ # they are automatically assigned to the root module
+
+ my $rootmodulegid = get_rootmodule_gid();
+
+ my $item;
+ foreach $item ( @par2script::globals::items_assigned_at_modules )
+ {
+ my $assignedgids = $par2script::globals::assignedgids{$item};
+ my $definedgids = $par2script::globals::definitions{$item};
+
+ my $gidstring = "";
+
+ # Perhaps there are already items assigned to the root
+ if ( ! exists($par2script::globals::searchkeys{$item}) ) { par2script::exiter::exit_program("ERROR: Unknown type \"$item\" at modules.", "remove_from_modules"); }
+ my $modulekey = $par2script::globals::searchkeys{$item};
+ if ( exists($par2script::globals::definitions{'Module'}->{$rootmodulegid}->{$modulekey}) )
+ {
+ $gidstring = $par2script::globals::definitions{'Module'}->{$rootmodulegid}->{$modulekey};
+ $gidstring =~ s/\(//;
+ $gidstring =~ s/\)//;
+ }
+
+ my $gid;
+ foreach $gid ( keys %{$definedgids} )
+ {
+ if ( ! exists( $assignedgids->{$gid} ))
+ {
+ if ( $gidstring eq "" )
+ {
+ $gidstring = $gid;
+ }
+ else
+ {
+ $gidstring = "$gidstring,$gid";
+ }
+
+ $assignedgids->{$gid} = 1;
+ }
+ }
+
+ if ( $gidstring ne "" )
+ {
+ $gidstring = "\($gidstring\)";
+ $par2script::globals::definitions{'Module'}->{$rootmodulegid}->{$modulekey} = $gidstring;
+ }
+ }
+}
+
+###################################################
+# Including \n in a very long string
+###################################################
+
+sub include_linebreaks
+{
+ my ($allgidstring) = @_;
+
+ my $newline = "";
+ my $newlength = 0;
+
+ $allgidstring =~ s/\(//;
+ $allgidstring =~ s/\)//;
+
+ my $allgids = par2script::converter::convert_stringlist_into_array_2($allgidstring, ",");
+
+ if ( $#{$allgids} > -1 )
+ {
+ my $onegid;
+ foreach $onegid ( @{$allgids} )
+ {
+ $newline = "$newline$onegid,";
+ $newlength = $newlength + length($onegid) + 1; # +1 for the comma
+
+ if ( $newlength > 80 )
+ {
+ $newline = $newline . "\n\t\t\t\t";
+ $newlength = 0;
+ }
+ }
+ }
+
+ $newline =~ s/,\s*$//;
+ $newline = "($newline)";
+
+ return $newline;
+}
+
+###################################################
+# Shorten the lines that belong to modules, if
+# the length of the line is greater 100
+###################################################
+
+sub shorten_lines_at_modules
+{
+ my $item;
+ foreach $item ( @par2script::globals::items_assigned_at_modules )
+ {
+ if ( ! exists($par2script::globals::searchkeys{$item}) ) { par2script::exiter::exit_program("ERROR: Unknown type \"$item\" at modules.", "shorten_lines_at_modules"); }
+ my $searchkey = $par2script::globals::searchkeys{$item};
+
+ my $allmodules = $par2script::globals::definitions{'Module'};
+
+ my $onemodule;
+ foreach $onemodule (keys %{$allmodules})
+ {
+ if (( exists($allmodules->{$onemodule}->{$searchkey}) ) &&
+ ( length($allmodules->{$onemodule}->{$searchkey}) > 100 ))
+ {
+ # including "\n\t\t\t\t"
+ my $newstring = include_linebreaks($allmodules->{$onemodule}->{$searchkey});
+ $allmodules->{$onemodule}->{$searchkey} = $newstring;
+ }
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/par2script/parameter.pm b/solenv/bin/modules/par2script/parameter.pm
new file mode 100644
index 000000000000..9c8abec78a0c
--- /dev/null
+++ b/solenv/bin/modules/par2script/parameter.pm
@@ -0,0 +1,154 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package par2script::parameter;
+
+use Cwd;
+use par2script::files;
+use par2script::globals;
+use par2script::systemactions;
+
+############################################
+# Parameter Operations
+############################################
+
+###############################################################################
+# Usage:
+# perl par2script.pl -i ..\wntmsci8.pro\par,o:\SRX645\wntmsci8.pro\par.m24
+# @@C:\DOCUMEN~1\is\LOCALS~1\Temp\mk6pd
+# -o ..\wntmsci8.pro\bin\osl\setup_osl.inf
+###############################################################################
+
+sub usage
+{
+ print <<Ende;
+
+--------------------------------------------------------------
+$par2script::globals::prog
+The following parameter are needed:
+-i: include pathes, comma separated list
+-o: setup script file name
+-v: writing logfile.txt (optional)
+\@\@list: list of all par files
+
+Example:
+ perl par2script.pl -i ..\\wntmsci8\\par\,o\:\\SRX645\\wntmsci8\\par.m24
+ \@\@C\:\\DOCUMEN\~1\\is\\LOCALS\~1\\Temp\\mk6pd
+ -o ..\\wntmsci8.pro\\bin\\osl\\setup_osl.inf \[-v\]
+
+--------------------------------------------------------------
+Ende
+ exit(-1);
+}
+
+#####################################
+# Reading parameter
+#####################################
+
+sub getparameter
+{
+ while ( $#ARGV >= 0 )
+ {
+ my $param = shift(@ARGV);
+
+ if ($param eq "-o") { $par2script::globals::scriptname = shift(@ARGV); }
+ elsif ($param eq "-v") { $par2script::globals::logging = 1; }
+ elsif ($param =~ /\@\@/) { $par2script::globals::parfilelistorig = $param; }
+ elsif ($param eq "-i") { $par2script::globals::includepathlist = shift(@ARGV); }
+ elsif (($param =~ /\//) || ($param =~ /\\/)) # another include parameter!
+ {
+ $par2script::globals::includepathlist = $par2script::globals::includepathlist . "," . $param;
+ }
+ else
+ {
+ print("\n*************************************\n");
+ print("Sorry, unknown parameter: $param");
+ print("\n*************************************\n");
+ usage();
+ exit(-1);
+ }
+ }
+}
+
+############################################
+# Controlling the fundamental parameter
+# (required for every process)
+############################################
+
+sub control_parameter
+{
+ if ($par2script::globals::includepathlist eq "")
+ {
+ print "\n************************************************\n";
+ print "Error: Include pathes not set not set (-i)!";
+ print "\n************************************************\n";
+ usage();
+ exit(-1);
+ }
+
+ if ($par2script::globals::scriptname eq "")
+ {
+ print "\n************************************************\n";
+ print "Error: Name of the setup script not set (-o)!";
+ print "\n************************************************\n";
+ usage();
+ exit(-1);
+ }
+
+ if ($par2script::globals::parfilelistorig eq "")
+ {
+ print "\n************************************************\n";
+ print "Error: List of par files not set!";
+ print "\n************************************************\n";
+ usage();
+ exit(-1);
+ }
+
+ # The par file list has to exist
+
+ $par2script::globals::parfilelist = $par2script::globals::parfilelistorig;
+ $par2script::globals::parfilelist =~ s/\@\@//;
+ par2script::files::check_file($par2script::globals::parfilelist);
+}
+
+#####################################
+# Writing parameter to shell
+#####################################
+
+sub outputparameter
+{
+ my $outputline = "\n$par2script::globals::prog -i $par2script::globals::includepathlist $par2script::globals::parfilelistorig -o $par2script::globals::scriptname";
+
+ if ($par2script::globals::logging) { $outputline .= " -v"; }
+
+ $outputline .= "\n";
+
+ print $outputline;
+}
+
+1;
diff --git a/solenv/bin/modules/par2script/remover.pm b/solenv/bin/modules/par2script/remover.pm
new file mode 100644
index 000000000000..ba981f914881
--- /dev/null
+++ b/solenv/bin/modules/par2script/remover.pm
@@ -0,0 +1,75 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package par2script::remover;
+
+############################################
+# Remover
+############################################
+
+sub remove_leading_and_ending_whitespaces
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/^\s*//g;
+ $$stringref =~ s/\s*$//g;
+}
+
+sub remove_leading_and_ending_comma
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/^\s*\,//g;
+ $$stringref =~ s/\,\s*$//g;
+}
+
+sub remove_leading_and_ending_quotationmarks
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/^\s*\"//g;
+ $$stringref =~ s/\"\s*$//g;
+}
+
+sub remove_leading_and_ending_slashes
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/^\s*\///g;
+ $$stringref =~ s/\/\s*$//g;
+}
+
+sub remove_leading_and_ending_backslashes
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/^\s*\\//g;
+ $$stringref =~ s/\\\s*$//g;
+}
+
+1;
diff --git a/solenv/bin/modules/par2script/shortcut.pm b/solenv/bin/modules/par2script/shortcut.pm
new file mode 100644
index 000000000000..ecaa1506beb1
--- /dev/null
+++ b/solenv/bin/modules/par2script/shortcut.pm
@@ -0,0 +1,75 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package par2script::shortcut;
+
+use par2script::work;
+
+############################################################
+# Writing shortcuts to files behind the correct files and
+# then shortcuts to shortcuts behind these shortcuts.
+############################################################
+
+sub shift_shortcut_positions
+{
+ my ($script) = @_;
+
+ my $allshortcutgids = par2script::work::get_all_gids_from_script($script, "Shortcut");
+
+ # first all shortcuts that are assigned to files
+
+ for ( my $i = 0; $i <= $#{$allshortcutgids}; $i++ )
+ {
+ my $codeblock = par2script::work::get_definitionblock_from_script($script, ${$allshortcutgids}[$i]);
+
+ my $filegid = par2script::work::get_value_from_definitionblock($codeblock, "FileID");
+
+ if (!($filegid eq ""))
+ {
+ par2script::work::remove_definitionblock_from_script($script, ${$allshortcutgids}[$i]);
+ par2script::work::add_definitionblock_into_script($script, $codeblock, $filegid);
+ }
+ }
+
+ # secondly all shortcuts that are assigned to other shortcuts
+
+ for ( my $i = 0; $i <= $#{$allshortcutgids}; $i++ )
+ {
+ my $codeblock = par2script::work::get_definitionblock_from_script($script, ${$allshortcutgids}[$i]);
+ my $shortcutgid = par2script::work::get_value_from_definitionblock($codeblock, "ShortcutID");
+
+ if (!($shortcutgid eq ""))
+ {
+ par2script::work::remove_definitionblock_from_script($script, ${$allshortcutgids}[$i]);
+ par2script::work::add_definitionblock_into_script($script, $codeblock, $shortcutgid);
+ }
+ }
+}
+
+
+1;
diff --git a/solenv/bin/modules/par2script/systemactions.pm b/solenv/bin/modules/par2script/systemactions.pm
new file mode 100644
index 000000000000..f5a8db9979a7
--- /dev/null
+++ b/solenv/bin/modules/par2script/systemactions.pm
@@ -0,0 +1,184 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package par2script::systemactions;
+
+use File::Copy;
+use par2script::exiter;
+use par2script::globals;
+
+######################################################
+# Creating a new direcotory
+######################################################
+
+sub create_directory
+{
+ my ($directory) = @_;
+
+ my $returnvalue = 1;
+
+ if (!(-d $directory))
+ {
+ $returnvalue = mkdir($directory, 0775);
+
+ if ($returnvalue)
+ {
+ $infoline = "Created directory: $directory\n";
+ push(@par2script::globals::logfileinfo, $infoline);
+
+ if ($par2script::globals::isunix)
+ {
+ my $localcall = "chmod 775 $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ }
+ else
+ {
+ par2script::exiter::exit_program("Error: Could not create directory: $directory", "create_directory");
+ }
+ }
+}
+
+#######################################################################
+# Creating the directories, in which files are generated or unzipped
+#######################################################################
+
+sub create_directories
+{
+ my ($directory, $languagesref) =@_;
+
+ $par2script::globals::unpackpath =~ s/\Q$par2script::globals::separator\E\s*$//; # removing ending slashes and backslashes
+
+ my $path = $par2script::globals::unpackpath; # this path already exists
+
+ $path = $path . $par2script::globals::separator . $par2script::globals::build . $par2script::globals::separator;
+ create_directory($path);
+
+ $path = $path . $par2script::globals::minor . $par2script::globals::separator;
+ create_directory($path);
+
+ if ($directory eq "unzip" )
+ {
+ $path = $path . "common" . $par2script::globals::productextension . $par2script::globals::separator;
+ create_directory($path);
+
+ $path = $path . $directory . $par2script::globals::separator;
+ create_directory($path);
+ }
+ else
+ {
+ $path = $path . $par2script::globals::compiler . $par2script::globals::productextension . $par2script::globals::separator;
+ create_directory($path);
+
+ $path = $path . $par2script::globals::product . $par2script::globals::separator;
+ create_directory($path);
+
+ $path = $path . $directory . $par2script::globals::separator;
+ create_directory($path);
+
+ if (!($$languagesref eq "" )) # this will be a path like "01_49", for Profiles and ConfigurationFiles, idt-Files
+ {
+ $path = $path . $$languagesref . $par2script::globals::separator;
+ create_directory($path);
+ }
+ }
+
+ $path =~ s/\Q$par2script::globals::separator\E\s*$//;
+
+ return $path;
+}
+
+########################
+# Copying one file
+########################
+
+sub copy_one_file
+{
+ my ($source, $dest) = @_;
+
+ my ($copyreturn, $returnvalue);
+ my $infoline;
+
+ $copyreturn = copy($source, $dest);
+
+ if ($copyreturn)
+ {
+ $infoline = "Copy: $source to $dest\n";
+ $returnvalue = 1;
+ }
+ else
+ {
+ $infoline = "Error: Could not copy $source to $dest\n";
+ $returnvalue = 0;
+ }
+
+ push(@par2script::globals::logfileinfo, $infoline);
+
+ return $returnvalue;
+}
+
+##########################################
+# Copying all files from one directory
+# to another directory
+##########################################
+
+sub copy_directory
+{
+ my ($sourcedir, $destdir) = @_;
+
+ my ($onefile, $sourcefile, $destfile);
+ my @sourcefiles = ();
+
+ $sourcedir =~ s/\Q$par2script::globals::separator\E\s*$//;
+ $destdir =~ s/\Q$par2script::globals::separator\E\s*$//;
+
+ $infoline = "\n";
+ push(@par2script::globals::logfileinfo, $infoline);
+ $infoline = "Copying files from directory $sourcedir to directory $destdir\n";
+ push(@par2script::globals::logfileinfo, $infoline);
+
+ opendir(DIR, $sourcedir);
+ @sourcefiles = readdir(DIR);
+ closedir(DIR);
+
+ foreach $onefile (@sourcefiles)
+ {
+ if ((!($onefile eq ".")) && (!($onefile eq "..")))
+ {
+ $sourcefile = $sourcedir . $par2script::globals::separator . $onefile;
+ $destfile = $destdir . $par2script::globals::separator . $onefile;
+ if ( -f $sourcefile ) # only files, no directories
+ {
+ copy_one_file($sourcefile, $destfile);
+ }
+ }
+ }
+}
+
+
+1;
diff --git a/solenv/bin/modules/par2script/undefine.pm b/solenv/bin/modules/par2script/undefine.pm
new file mode 100644
index 000000000000..5fc1d18ebd3d
--- /dev/null
+++ b/solenv/bin/modules/par2script/undefine.pm
@@ -0,0 +1,144 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package par2script::undefine;
+
+use par2script::globals;
+
+##########################################################
+# Removing in the script all the gids, that are listed
+# in undefine scp files
+##########################################################
+
+sub undefine_gids
+{
+ my ($parfilecontent) = @_;
+
+ my $item;
+ foreach $item ( @par2script::globals::allitems )
+ {
+ my $unitem = "Un$item";
+
+ for ( my $i = 0; $i <= $#{$parfilecontent}; $i++ )
+ {
+ if ( ${$parfilecontent}[$i] =~ /^\s*$unitem\s*(\w+?)\s*$/ )
+ {
+ my $gid = $1;
+ delete($par2script::globals::definitions{$item}->{$gid});
+ }
+ }
+ }
+}
+
+##########################################################
+# Collecting all subdirectories of a specified directory
+##########################################################
+
+sub collect_children_dirs
+{
+ my ($gid, $collector) = @_;
+
+ my $diritem = "Directory";
+ my $parentkey = "ParentID";
+
+ if ( exists($par2script::globals::definitions{$diritem}) )
+ {
+ my $onedefinition;
+
+ foreach $onedefinition (keys %{$par2script::globals::definitions{$diritem}})
+ {
+ if ( $par2script::globals::definitions{$diritem}->{$onedefinition}->{$parentkey} eq $gid )
+ {
+ push(@{$collector}, $onedefinition);
+ collect_children_dirs($onedefinition, $collector);
+ }
+ }
+ }
+}
+
+##########################################################
+# Removing in the script complete profiles.
+# This includes the Profile and its ProfileItems.
+##########################################################
+
+sub remove_complete_item
+{
+ my ($item, $parfilecontent) = @_;
+
+ my $removeitem = "Remove$item";
+ my $dependentkey = "";
+ my $collect_children = 0;
+ my @gidcollector = ();
+ my @dependentitems = ();
+
+ if ( $item eq "Profile" )
+ {
+ @dependentitems = ("ProfileItem");
+ $dependentkey = "ProfileID";
+ }
+ elsif ( $item eq "Directory" )
+ {
+ @dependentitems = ("File", "Shortcut", "Unixlink");
+ $dependentkey = "Dir";
+ $collect_children = 1;
+ }
+
+ for ( my $i = 0; $i <= $#{$parfilecontent}; $i++ )
+ {
+ if ( ${$parfilecontent}[$i] =~ /^\s*$removeitem\s*(\w+?)\s*$/ )
+ {
+ my $onegid = $1;
+ push(@gidcollector, $onegid);
+ if ( $collect_children ) { collect_children_dirs($onegid, \@gidcollector); }
+
+ my $gid;
+ foreach $gid (@gidcollector)
+ {
+ delete($par2script::globals::definitions{$item}->{$gid});
+
+ # also deleting all dependent items, for example "ProfileItems" whose "ProfileID" is this "Profile"
+ my $depitem;
+ foreach $depitem ( @dependentitems )
+ {
+ if ( exists($par2script::globals::definitions{$depitem}) )
+ {
+ my $onedefinition;
+ foreach $onedefinition (keys %{$par2script::globals::definitions{$depitem}})
+ {
+ if ( $par2script::globals::definitions{$depitem}->{$onedefinition}->{$dependentkey} eq $gid )
+ {
+ delete($par2script::globals::definitions{$depitem}->{$onedefinition});
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/par2script/work.pm b/solenv/bin/modules/par2script/work.pm
new file mode 100644
index 000000000000..fd266e306d04
--- /dev/null
+++ b/solenv/bin/modules/par2script/work.pm
@@ -0,0 +1,416 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package par2script::work;
+
+use par2script::existence;
+use par2script::globals;
+use par2script::remover;
+
+############################################
+# par2script working module
+############################################
+
+sub analyze_comma_separated_list
+{
+ my ($list, $listref) = @_; # second parameter is optional
+
+ my @list = ();
+ my $locallistref;
+
+ if (!( $listref )) { $locallistref = \@list; }
+ else { $locallistref = $listref; }
+
+ par2script::remover::remove_leading_and_ending_comma(\$list);
+ par2script::remover::remove_leading_and_ending_whitespaces(\$list);
+
+ while ( $list =~ /^\s*(.*?)\s*\,\s*(.*)\s*$/ )
+ {
+ my $oneentry = $1;
+ $list = $2;
+ par2script::remover::remove_leading_and_ending_whitespaces(\$oneentry);
+ push(@{$locallistref}, $oneentry);
+ }
+
+ # the last entry
+
+ par2script::remover::remove_leading_and_ending_whitespaces(\$list);
+ push(@{$locallistref}, $list);
+
+ return $locallistref;
+}
+
+############################################
+# setting list of include pathes
+############################################
+
+sub setincludes
+{
+ my ($list) = @_;
+
+ # input is the comma separated list of include pathes
+
+ my $includes = analyze_comma_separated_list($list);
+
+ return $includes;
+}
+
+############################################
+# setting list of all par files
+############################################
+
+sub setparfiles
+{
+ my ($filename) = @_;
+
+ # input is the name of the list file
+ $filename =~ s/\@//; # removing the leading \@
+
+ my $filecontent = par2script::files::read_file($filename);
+
+ my @parfiles = ();
+ my $parfilesref = \@parfiles;
+
+ foreach ( @{$filecontent} ) { $parfilesref = analyze_comma_separated_list($_, $parfilesref); }
+
+ return $parfilesref;
+}
+
+############################################
+# finding the correct include path
+# for the par files
+############################################
+
+sub make_complete_pathes_for_parfiles
+{
+ my ($parfiles, $includes) = @_;
+
+ my $oneparfile;
+
+ foreach $oneparfile ( @{$parfiles} )
+ {
+ my $foundparfile = 0;
+ my $includepath;
+
+ foreach $includepath ( @{$includes} )
+ {
+ my $parfile = "$includepath/$oneparfile";
+
+ if ( -f $parfile )
+ {
+ $foundparfile = 1;
+ $oneparfile = $parfile;
+ last;
+ }
+ }
+
+ if ( ! $foundparfile )
+ {
+ die "ERROR: Could not find parfile ${$parfiles}[$i] in includes pathes: $par2script::globals::includepathlist !\n";
+ }
+ }
+}
+
+######################################################
+# collecting one special item in the par files and
+# including it into the "definitions" hash
+######################################################
+
+sub collect_definitions
+{
+ my ($parfilecontent) = @_;
+
+ my $multidefinitionerror = 0;
+ my @multidefinitiongids = ();
+
+
+ foreach $oneitem ( @par2script::globals::allitems )
+ {
+ my $docollect = 0;
+ my $gid = "";
+ my %allitemhash = ();
+
+ for ( my $i = 0; $i <= $#{$parfilecontent}; $i++ )
+ {
+ my $line = ${$parfilecontent}[$i];
+
+ if ( $line =~ /^\s*$oneitem\s+(\w+)\s*$/ )
+ {
+ $gid = $1;
+ $docollect = 1;
+ }
+ else
+ {
+ $docollect = 0;
+ }
+
+ if ( $docollect )
+ {
+ my $currentline = $i;
+ my %oneitemhash;
+
+ while (! ( ${$parfilecontent}[$currentline] =~ /^\s*End\s*$/i ) )
+ {
+ if ( ${$parfilecontent}[$currentline] =~ /^\s*(.+?)\s*\=\s*(.+?)\s*\;\s*$/ ) # only oneliner!
+ {
+ $itemkey = $1;
+ $itemvalue = $2;
+
+ if ( $oneitem eq "Directory" ) { if ( $itemkey =~ "DosName" ) { $itemkey =~ s/DosName/HostName/; } }
+ if (( $oneitem eq "Directory" ) || ( $oneitem eq "File" ) || ( $oneitem eq "Unixlink" )) { if ( $itemvalue eq "PD_PROGDIR" ) { $itemvalue = "PREDEFINED_PROGDIR"; }}
+ if (( $itemkey eq "Styles" ) && ( $itemvalue =~ /^\s*(\w+)(\s*\;\s*)$/ )) { $itemvalue = "($1)$2"; }
+
+ $oneitemhash{$itemkey} = $itemvalue;
+ }
+
+ $currentline++;
+ }
+
+ # no hyphen allowed in gids -> cannot happen here because (\w+) is required for gids
+ if ( $gid =~ /-/ ) { par2script::exiter::exit_program("ERROR: No hyphen allowed in global id: $gid", "test_of_hyphen"); }
+
+ # test of uniqueness
+ if ( exists($allitemhash{$gid}) )
+ {
+ $multidefinitionerror = 1;
+ push(@multidefinitiongids, $gid);
+ }
+
+ $allitemhash{$gid} = \%oneitemhash;
+ }
+ }
+
+ $par2script::globals::definitions{$oneitem} = \%allitemhash;
+ }
+
+ if ( $multidefinitionerror ) { par2script::exiter::multidefinitionerror(\@multidefinitiongids); }
+
+ # foreach $key (keys %par2script::globals::definitions)
+ # {
+ # print "Key: $key \n";
+ #
+ # foreach $key (keys %{$par2script::globals::definitions{$key}})
+ # {
+ # print "\t$key \n";
+ # }
+ # }
+}
+
+######################################################
+# Filling content into the script
+######################################################
+
+sub put_oneitem_into_script
+{
+ my ( $script, $item, $itemhash, $itemkey ) = @_;
+
+ push(@{$script}, "$item $itemkey\n" );
+ my $content = "";
+ foreach $content (sort keys %{$itemhash->{$itemkey}}) { push(@{$script}, "\t$content = $itemhash->{$itemkey}->{$content};\n" ); }
+ push(@{$script}, "End\n" );
+ push(@{$script}, "\n" );
+}
+
+######################################################
+# Creating the script
+######################################################
+
+sub create_script
+{
+ my @script = ();
+ my $oneitem;
+
+ foreach $oneitem ( @par2script::globals::allitems )
+ {
+ if ( exists($par2script::globals::definitions{$oneitem}) )
+ {
+ if ( $oneitem eq "Shortcut" ) { next; } # "Shortcuts" after "Files"
+
+ if (( $oneitem eq "Module" ) || ( $oneitem eq "Directory" )) { write_sorted_items(\@script, $oneitem); }
+ else { write_unsorted_items(\@script, $oneitem); }
+ }
+ }
+
+ return \@script;
+}
+
+######################################################
+# Adding script content for the unsorted items
+######################################################
+
+sub write_unsorted_items
+{
+ my ( $script, $oneitem ) = @_;
+
+ my $itemhash = $par2script::globals::definitions{$oneitem};
+
+ my $itemkey = "";
+ foreach $itemkey (sort keys %{$itemhash})
+ {
+ put_oneitem_into_script($script, $oneitem, $itemhash, $itemkey);
+
+ # special handling for Shortcuts after Files
+ if (( $oneitem eq "File" ) && ( exists($par2script::globals::definitions{"Shortcut"}) ))
+ {
+ my $shortcutkey;
+ foreach $shortcutkey ( keys %{$par2script::globals::definitions{"Shortcut"}} )
+ {
+ if ( $par2script::globals::definitions{"Shortcut"}->{$shortcutkey}->{'FileID'} eq $itemkey )
+ {
+ put_oneitem_into_script($script, "Shortcut", $par2script::globals::definitions{"Shortcut"}, $shortcutkey);
+
+ # and Shortcut to Shortcut also
+ my $internshortcutkey;
+ foreach $internshortcutkey ( keys %{$par2script::globals::definitions{"Shortcut"}} )
+ {
+ if ( $par2script::globals::definitions{"Shortcut"}->{$internshortcutkey}->{'ShortcutID'} eq $shortcutkey )
+ {
+ put_oneitem_into_script($script, "Shortcut", $par2script::globals::definitions{"Shortcut"}, $internshortcutkey);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+######################################################
+# Collecting all children of a specified parent
+######################################################
+
+sub collect_children
+{
+ my ( $itemhash, $parent, $order ) = @_;
+
+ my $item;
+ foreach $item ( keys %{$itemhash} )
+ {
+ if ( $itemhash->{$item}->{'ParentID'} eq $parent )
+ {
+ push(@{$order}, $item);
+ my $newparent = $item;
+ collect_children($itemhash, $newparent, $order);
+ }
+ }
+}
+
+######################################################
+# Adding script content for the sorted items
+######################################################
+
+sub write_sorted_items
+{
+ my ( $script, $oneitem ) = @_;
+
+ my $itemhash = $par2script::globals::definitions{$oneitem};
+
+ my @itemorder = ();
+ my @startparents = ();
+
+ if ( $oneitem eq "Module" ) { push(@startparents, ""); }
+ elsif ( $oneitem eq "Directory" ) { push(@startparents, "PREDEFINED_PROGDIR"); }
+ else { die "ERROR: No root parent defined for item type $oneitem !\n"; }
+
+ # supporting more than one toplevel item
+ my $parent;
+ foreach $parent ( @startparents ) { collect_children($itemhash, $parent, \@itemorder); }
+
+ my $itemkey;
+ foreach $itemkey ( @itemorder ) { put_oneitem_into_script($script, $oneitem, $itemhash, $itemkey); }
+}
+
+#######################################################################
+# Collecting all assigned gids of the type "item" from the modules
+# in the par files. Using a hash!
+#######################################################################
+
+sub collect_assigned_gids
+{
+ my $allmodules = $par2script::globals::definitions{'Module'};
+
+ my $item;
+ foreach $item ( @par2script::globals::items_assigned_at_modules )
+ {
+ if ( ! exists($par2script::globals::searchkeys{$item}) ) { par2script::exiter::exit_program("ERROR: Unknown type \"$item\" at modules.", "collect_assigned_gids"); }
+
+ my $searchkey = $par2script::globals::searchkeys{$item};
+
+ my %assignitems = ();
+ my $modulegid = "";
+
+ foreach $modulegid (keys %{$allmodules} )
+ {
+ # print "Module $modulegid\n";
+ # my $content = "";
+ # foreach $content (sort keys %{$allmodules->{$modulegid}}) { print "\t$content = $allmodules->{$modulegid}->{$content};\n"; }
+ # print "End\n";
+ # print "\n";
+
+ if ( exists($allmodules->{$modulegid}->{$searchkey}) )
+ {
+ my $list = $allmodules->{$modulegid}->{$searchkey};
+ if ( $list =~ /^\s*\((.*?)\)\s*(.*?)\s*$/ ) { $list = $1; }
+ else { par2script::exiter::exit_program("ERROR: Invalid module list: $list", "collect_assigned_gids"); }
+ my $allassigneditems = par2script::converter::convert_stringlist_into_array_2($list, ",");
+
+ my $gid;
+ foreach $gid ( @{$allassigneditems} )
+ {
+ if ( exists($assignitems{$gid}) ) { $assignitems{$gid} = $assignitems{$gid} + 1; }
+ else { $assignitems{$gid} = 1; }
+ }
+ }
+ }
+
+ $par2script::globals::assignedgids{$item} = \%assignitems;
+ }
+}
+
+##################################################
+# Collecting the content of all par files.
+# Then the files do not need to be opened twice.
+##################################################
+
+sub read_all_parfiles
+{
+ my ($parfiles) = @_;
+
+ my @parfilecontent = ();
+ my $parfilename;
+
+ foreach $parfilename ( @{$parfiles} )
+ {
+ my $parfile = par2script::files::read_file($parfilename);
+ foreach ( @{$parfile} ) { push(@parfilecontent, $_); }
+ push(@parfilecontent, "\n");
+ }
+
+ return \@parfilecontent;
+}
+
+1;
diff --git a/solenv/bin/modules/pre2par/directory.pm b/solenv/bin/modules/pre2par/directory.pm
new file mode 100644
index 000000000000..2253c54bc47a
--- /dev/null
+++ b/solenv/bin/modules/pre2par/directory.pm
@@ -0,0 +1,54 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package pre2par::directory;
+
+use pre2par::pathanalyzer;
+use pre2par::systemactions;
+
+############################################
+# Checking, whether the output directories
+# exist. If not, they are created.
+############################################
+
+sub check_directory
+{
+ my ($parfilename) = @_;
+
+ my $productdirectory = $parfilename;
+ pre2par::pathanalyzer::get_path_from_fullqualifiedname(\$productdirectory);
+ $productdirectory =~ s/\Q$pre2par::globals::separator\E\s*$//;
+
+ my $pardirectory = $productdirectory;
+ pre2par::pathanalyzer::get_path_from_fullqualifiedname(\$pardirectory);
+ $pardirectory =~ s/\Q$pre2par::globals::separator\E\s*$//;
+
+ if ( ! -d $pardirectory ) { pre2par::systemactions::create_directory($pardirectory); }
+ if ( ! -d $productdirectory ) { pre2par::systemactions::create_directory($productdirectory); }
+}
+
+1; \ No newline at end of file
diff --git a/solenv/bin/modules/pre2par/existence.pm b/solenv/bin/modules/pre2par/existence.pm
new file mode 100644
index 000000000000..1775f1d9394c
--- /dev/null
+++ b/solenv/bin/modules/pre2par/existence.pm
@@ -0,0 +1,74 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package pre2par::existence;
+
+#############################
+# Test of existence
+#############################
+
+sub exists_in_array
+{
+ my ($searchstring, $arrayref) = @_;
+
+ my $alreadyexists = 0;
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ if ( ${$arrayref}[$i] eq $searchstring)
+ {
+ $alreadyexists = 1;
+ last;
+ }
+ }
+
+ return $alreadyexists;
+}
+
+sub exists_in_array_of_hashes
+{
+ my ($searchkey, $searchvalue, $arrayref) = @_;
+
+ my $hashref;
+ my $valueexists = 0;
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ $hashref = ${$arrayref}[$i];
+
+ if ( $hashref->{$searchkey} eq $searchvalue )
+ {
+ $valueexists = 1;
+ last;
+ }
+ }
+
+ return $valueexists;
+}
+
+1;
diff --git a/solenv/bin/modules/pre2par/exiter.pm b/solenv/bin/modules/pre2par/exiter.pm
new file mode 100644
index 000000000000..fe992aad4253
--- /dev/null
+++ b/solenv/bin/modules/pre2par/exiter.pm
@@ -0,0 +1,70 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package pre2par::exiter;
+
+use pre2par::files;
+use pre2par::globals;
+
+############################################
+# Exiting the program with an error
+# This function is used instead of "die"
+############################################
+
+sub exit_program
+{
+ my ($message, $function) = @_;
+
+ my $infoline;
+
+ $infoline = "\n***************************************************************\n";
+ push(@pre2par::globals::logfileinfo, $infoline);
+ print("$infoline");
+
+ $infoline = "$message\n";
+ push(@pre2par::globals::logfileinfo, $infoline);
+ print("$infoline");
+
+ $infoline = "in function: $function\n";
+ push(@pre2par::globals::logfileinfo, $infoline);
+ print("$infoline");
+
+ $infoline = "***************************************************************\n";
+ push(@pre2par::globals::logfileinfo, $infoline);
+
+ if ($pre2par::globals::logging)
+ {
+ pre2par::files::save_file($pre2par::globals::logfilename ,\@pre2par::globals::logfileinfo);
+ print("Saved logfile: $pre2par::globals::logfilename\n");
+ }
+
+ print("$infoline");
+
+ exit(-1);
+}
+
+1;
diff --git a/solenv/bin/modules/pre2par/files.pm b/solenv/bin/modules/pre2par/files.pm
new file mode 100644
index 000000000000..e3de88b6dd4e
--- /dev/null
+++ b/solenv/bin/modules/pre2par/files.pm
@@ -0,0 +1,125 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package pre2par::files;
+
+use pre2par::exiter;
+
+############################################
+# File Operations
+############################################
+
+sub check_file
+{
+ my ($arg) = @_;
+
+ if(!( -f $arg ))
+ {
+ pre2par::exiter::exit_program("ERROR: Cannot find file $arg", "check_file");
+ }
+}
+
+sub read_file
+{
+ my ($localfile) = @_;
+
+ my @localfile = ();
+
+ open( IN, "<$localfile" ) || pre2par::exiter::exit_program("ERROR: Cannot open file: $localfile", "read_file");
+ while ( <IN> ) { push(@localfile, $_); }
+ close( IN );
+
+ return \@localfile;
+}
+
+###########################################
+# Saving files, arrays and hashes
+###########################################
+
+sub save_file
+{
+ my ($savefile, $savecontent) = @_;
+ if (-f $savefile) { unlink $savefile };
+ if (-f $savefile) { pre2par::exiter::exit_program("ERROR: Cannot delete existing file: $savefile", "save_file"); };
+ open( OUT, ">$savefile" );
+ print OUT @{$savecontent};
+ close( OUT);
+ if (! -f $savefile) { pre2par::exiter::exit_program("ERROR: Cannot write file: $savefile", "save_file"); }
+}
+
+sub save_hash
+{
+ my ($savefile, $hashref) = @_;
+
+ my @printcontent = ();
+
+ my ($itemkey, $itemvalue, $line);
+
+ foreach $itemkey ( keys %{$hashref} )
+ {
+ $line = "";
+ $itemvalue = $hashref->{$itemkey};
+ $line = $itemkey . "=" . $itemvalue . "\n";
+ push(@printcontent, $line);
+ }
+
+ open( OUT, ">$savefile" );
+ print OUT @printcontent;
+ close( OUT);
+}
+
+sub save_array_of_hashes
+{
+ my ($savefile, $arrayref) = @_;
+
+ my @printcontent = ();
+
+ my ($itemkey, $itemvalue, $line, $hashref);
+
+ for ( my $i = 0; $i <= $#{$arrayref}; $i++ )
+ {
+ $line = "";
+ $hashref = ${$arrayref}[$i];
+
+ foreach $itemkey ( keys %{$hashref} )
+ {
+ $itemvalue = $hashref->{$itemkey};
+
+ $line = $line . $itemkey . "=" . $itemvalue . "\t";
+ }
+
+ $line = $line . "\n";
+
+ push(@printcontent, $line);
+ }
+
+ open( OUT, ">$savefile" );
+ print OUT @printcontent;
+ close( OUT);
+}
+
+1;
diff --git a/solenv/bin/modules/pre2par/globals.pm b/solenv/bin/modules/pre2par/globals.pm
new file mode 100644
index 000000000000..a0a50dc11958
--- /dev/null
+++ b/solenv/bin/modules/pre2par/globals.pm
@@ -0,0 +1,68 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package pre2par::globals;
+
+############################################
+# Global settings
+############################################
+
+BEGIN
+{
+ $prog="pre2par";
+
+ $prefilename = "";
+ $parfilename = "";
+ $langfilename = "";
+
+ @allitems = ("Installation", "ScpAction", "HelpText", "Directory", "DataCarrier", "StarRegistry", "File",
+ "Shortcut", "Custom", "Unixlink", "Procedure", "Module", "Profile", "ProfileItem",
+ "Folder", "FolderItem", "RegistryItem", "StarRegistryItem", "WindowsCustomAction",
+ "MergeModule");
+
+ $logging = 0;
+ $logfilename = "logfile.log"; # the default logfile name for global errors
+ @logfileinfo = ();
+
+ $plat = $^O;
+
+ $separator = "/";
+ $pathseparator = "\:";
+ $isunix = 1;
+ $iswin = 0;
+
+ $islinux = 0;
+ $issolaris = 0;
+
+ if ( $plat =~ /linux/i ) { $islinux = 1; }
+ if ( $plat =~ /kfreebsd/i ) { $islinux = 1; }
+ if ( $plat =~ /solaris/i ) { $issolaris = 1; }
+
+}
+
+1;
diff --git a/solenv/bin/modules/pre2par/language.pm b/solenv/bin/modules/pre2par/language.pm
new file mode 100644
index 000000000000..b5dc336ba847
--- /dev/null
+++ b/solenv/bin/modules/pre2par/language.pm
@@ -0,0 +1,172 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+package pre2par::language;
+
+use pre2par::existence;
+
+##############################################################
+# Returning a specific language string from the block
+# of all translations
+##############################################################
+
+sub get_language_string_from_language_block
+{
+ my ($language_block, $language) = @_;
+
+ my $newstring = "";
+
+ for ( my $i = 0; $i <= $#{$language_block}; $i++ )
+ {
+
+ if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*\"(.*)\"\s*$/ )
+ {
+ $newstring = $1;
+ $newstring =~ s/\"/\\\"/g; # masquerading all '"' in the string
+ $newstring = "\"" . $newstring . "\"";
+ last;
+ }
+ }
+
+ # defaulting to english!
+
+ if ( $newstring eq "" )
+ {
+ $language = "en-US"; # defaulting to english
+
+ for ( my $i = 0; $i <= $#{$language_block}; $i++ )
+ {
+ if ( ${$language_block}[$i] =~ /^\s*$language\s*\=\s*(\".*\")\s*$/ )
+ {
+ $newstring = $1;
+ last;
+ }
+ }
+ }
+
+ return $newstring;
+}
+
+##############################################################
+# Returning the complete block in all languages
+# for a specified string
+##############################################################
+
+sub get_language_block_from_language_file
+{
+ my ($searchstring, $langfile) = @_;
+
+ my @language_block = ();
+
+ for ( my $i = 0; $i <= $#{$langfile}; $i++ )
+ {
+ if ( ${$langfile}[$i] =~ /^\s*\[\s*$searchstring\s*\]\s*$/ )
+ {
+ my $counter = $i;
+
+ push(@language_block, ${$langfile}[$counter]);
+ $counter++;
+
+ while (( $counter <= $#{$langfile} ) && (!( ${$langfile}[$counter] =~ /^\s*\[/ )))
+ {
+ push(@language_block, ${$langfile}[$counter]);
+ $counter++;
+ }
+
+ last;
+ }
+ }
+
+ return \@language_block;
+}
+
+############################################
+# collecting all replace strings
+# in a language file
+############################################
+
+sub get_all_replace_strings
+{
+ my ($langfile) = @_;
+
+ my @allstrings = ();
+
+ for ( my $i = 0; $i <= $#{$langfile}; $i++ )
+ {
+ if ( ${$langfile}[$i] =~ /^\s*\[\s*(.*?)\s*\]\s*$/ )
+ {
+ my $replacestring = $1;
+ if (! pre2par::existence::exists_in_array($replacestring, \@allstrings))
+ {
+ push(@allstrings, $replacestring);
+ }
+ }
+ }
+
+ return \@allstrings;
+}
+
+############################################
+# localizing the par file with the
+# corresponding language file
+############################################
+
+sub localize
+{
+ my ($parfile, $langfile) = @_;
+
+ my $allreplacestrings = get_all_replace_strings($langfile);
+
+ for ( my $i = 0; $i <= $#{$parfile}; $i++ )
+ {
+ my $oneline = ${$parfile}[$i];
+
+ for ( my $j = 0; $j <= $#{$allreplacestrings}; $j++ )
+ {
+ if ( $oneline =~ /\b${$allreplacestrings}[$j]\b/ ) # Not for basic scripts
+ {
+ my $oldstring = ${$allreplacestrings}[$j];
+
+ if ( $oneline =~ /^\s*\w+\s*\(([\w-]+)\)\s*\=/ )
+ {
+ my $language = $1; # can be "01" or "en" or "en-US" or ...
+
+ my $languageblock = get_language_block_from_language_file($oldstring, $langfile);
+ my $newstring = get_language_string_from_language_block($languageblock, $language);
+
+ if ( $newstring eq "" ) { $newstring = "\"" . $oldstring . "\""; }
+
+ $oneline =~ s/$oldstring/$newstring/g;
+
+ ${$parfile}[$i] = $oneline;
+ }
+ }
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/pre2par/parameter.pm b/solenv/bin/modules/pre2par/parameter.pm
new file mode 100644
index 000000000000..763f1963051c
--- /dev/null
+++ b/solenv/bin/modules/pre2par/parameter.pm
@@ -0,0 +1,178 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package pre2par::parameter;
+
+use Cwd;
+use pre2par::files;
+use pre2par::globals;
+use pre2par::systemactions;
+
+############################################
+# Parameter Operations
+############################################
+
+sub usage
+{
+ print <<Ende;
+---------------------------------------------------------
+$pre2par::globals::prog
+The following parameter are needed:
+-s: path to the pre file
+-o: path to the par file
+-l: path to the ulf file (mlf or jlf file)
+-v: log process (optional)
+
+Example:
+
+perl pre2par.pl -l test.mlf -s readme.pre -o readme.par -v
+
+---------------------------------------------------------
+Ende
+ exit(-1);
+}
+
+#####################################
+# Reading parameter
+#####################################
+
+sub getparameter
+{
+ while ( $#ARGV >= 0 )
+ {
+ my $param = shift(@ARGV);
+
+ if ($param eq "-s") { $pre2par::globals::prefilename = shift(@ARGV); }
+ elsif ($param eq "-o") { $pre2par::globals::parfilename = shift(@ARGV); }
+ elsif ($param eq "-l") { $pre2par::globals::langfilename = shift(@ARGV); }
+ elsif ($param eq "-v") { $pre2par::globals::logging = 1; }
+ else
+ {
+ print("\n*************************************\n");
+ print("Sorry, unknown parameter: $param");
+ print("\n*************************************\n");
+ usage();
+ exit(-1);
+ }
+ }
+}
+
+############################################
+# Controlling the fundamental parameter
+# (required for every process)
+############################################
+
+sub control_parameter
+{
+ if ($pre2par::globals::prefilename eq "")
+ {
+ print "\n************************************************\n";
+ print "Error: Name of the input file not set (-s)!";
+ print "\n************************************************\n";
+ usage();
+ exit(-1);
+ }
+
+ if ($pre2par::globals::parfilename eq "")
+ {
+ print "\n************************************************\n";
+ print "Error: Name of the output file not set (-o)!";
+ print "\n************************************************\n";
+ usage();
+ exit(-1);
+ }
+
+ if (!($pre2par::globals::prefilename =~ /\.pre\s*$/))
+ {
+ print "\n************************************************\n";
+ print "Error: Input file is no .pre file!";
+ print "\n************************************************\n";
+ usage();
+ exit(-1);
+ }
+
+ if (!($pre2par::globals::parfilename =~ /\.par\s*$/))
+ {
+ print "\n************************************************\n";
+ print "Error: Output file is no .par file!";
+ print "\n************************************************\n";
+ usage();
+ exit(-1);
+ }
+
+ # The input file has to exist
+
+ pre2par::files::check_file($pre2par::globals::prefilename);
+}
+
+##########################################################
+# The path parameters can be relative or absolute.
+# This function creates absolute pathes.
+##########################################################
+
+sub make_path_absolute
+{
+ my ($pathref) = @_;
+
+ if ( $pre2par::globals::isunix )
+ {
+ if (!($$pathref =~ /^\s*\//)) # this is a relative unix path
+ {
+ $$pathref = cwd() . $pre2par::globals::separator . $$pathref;
+ }
+ }
+
+ if ( $pre2par::globals::iswin )
+ {
+ if (!($$pathref =~ /^\s*\w\:/)) # this is a relative windows path
+ {
+ $$pathref = cwd() . $pre2par::globals::separator . $$pathref;
+ $$pathref =~ s/\//\\/g;
+ }
+ }
+
+ $$pathref =~ s/\Q$pre2par::globals::separator\E\s*$//; # removing ending slashes
+}
+
+#####################################
+# Writing parameter to shell
+#####################################
+
+sub outputparameter
+{
+ $pre2par::globals::logging ? ($logoption = " -v") : ($logoption = "");
+ print "\n$pre2par::globals::prog -l $pre2par::globals::langfilename -s $pre2par::globals::prefilename -o $pre2par::globals::parfilename$logoption\n";
+
+# print "\n********************************************************\n";
+# print "This is $pre2par::globals::prog, version 1.0\n";
+# print "Input file: $pre2par::globals::prefilename\n";
+# print "Output file: $pre2par::globals::parfilename\n";
+# print "********************************************************\n";
+}
+
+1;
diff --git a/solenv/bin/modules/pre2par/pathanalyzer.pm b/solenv/bin/modules/pre2par/pathanalyzer.pm
new file mode 100644
index 000000000000..f45a0808d53a
--- /dev/null
+++ b/solenv/bin/modules/pre2par/pathanalyzer.pm
@@ -0,0 +1,75 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package pre2par::pathanalyzer;
+
+use pre2par::globals;
+
+###########################################
+# Path analyzer
+###########################################
+
+sub get_path_from_fullqualifiedname
+{
+ my ($longfilenameref) = @_;
+
+ if ( $$longfilenameref =~ /\Q$pre2par::globals::separator\E/ ) # Is there a separator in the path? Otherwise the path is empty.
+ {
+ if ( $$longfilenameref =~ /^\s*(\S.*\S\Q$pre2par::globals::separator\E)(\S.+?\S)/ )
+ {
+ $$longfilenameref = $1;
+ }
+ }
+ else
+ {
+ $$longfilenameref = ""; # there is no path
+ }
+}
+
+sub make_absolute_filename_to_relative_filename
+{
+ my ($longfilenameref) = @_;
+
+ if ( $pre2par::globals::isunix )
+ {
+ if ( $$longfilenameref =~ /^.*\/(\S.+\S?)/ )
+ {
+ $$longfilenameref = $1;
+ }
+ }
+
+ if ( $pre2par::globals::iswin )
+ {
+ if ( $$longfilenameref =~ /^.*\\(\S.+\S?)/ )
+ {
+ $$longfilenameref = $1;
+ }
+ }
+}
+
+1;
diff --git a/solenv/bin/modules/pre2par/remover.pm b/solenv/bin/modules/pre2par/remover.pm
new file mode 100644
index 000000000000..4efe6ea0610c
--- /dev/null
+++ b/solenv/bin/modules/pre2par/remover.pm
@@ -0,0 +1,67 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package pre2par::remover;
+
+############################################
+# Remover
+############################################
+
+sub remove_leading_and_ending_whitespaces
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/^\s*//g;
+ $$stringref =~ s/\s*$//g;
+}
+
+sub remove_leading_and_ending_quotationmarks
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/^\s*\"//g;
+ $$stringref =~ s/\"\s*$//g;
+}
+
+sub remove_leading_and_ending_slashes
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/^\s*\///g;
+ $$stringref =~ s/\/\s*$//g;
+}
+
+sub remove_leading_and_ending_backslashes
+{
+ my ( $stringref ) = @_;
+
+ $$stringref =~ s/^\s*\\//g;
+ $$stringref =~ s/\\\s*$//g;
+}
+
+1;
diff --git a/solenv/bin/modules/pre2par/systemactions.pm b/solenv/bin/modules/pre2par/systemactions.pm
new file mode 100644
index 000000000000..e084d7753f48
--- /dev/null
+++ b/solenv/bin/modules/pre2par/systemactions.pm
@@ -0,0 +1,206 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package pre2par::systemactions;
+
+use File::Copy;
+use pre2par::exiter;
+use pre2par::globals;
+
+######################################################
+# Creating a new direcotory
+######################################################
+
+sub create_directory
+{
+ my ($directory) = @_;
+
+ my $returnvalue = 1;
+ my $infoline = "";
+
+ if ($directory eq "" )
+ {
+ return 0;
+ }
+
+ if (!(-d $directory))
+ {
+ $returnvalue = mkdir($directory, 0775);
+
+ if ($returnvalue)
+ {
+ $infoline = "Created directory: $directory\n";
+ push(@pre2par::globals::logfileinfo, $infoline);
+
+ if ($pre2par::globals::isunix)
+ {
+ my $localcall = "chmod 775 $directory \>\/dev\/null 2\>\&1";
+ system($localcall);
+ }
+ }
+ else
+ {
+ # New solution in parallel packing: It is possible, that the directory now exists, although it
+ # was not created in this process. There is only an important error, if the directory does not
+ # exist now.
+
+ if (!(-d $directory))
+ {
+ pre2par::exiter::exit_program("Error: Could not create directory: $directory", "create_directory");
+ }
+ else
+ {
+ $infoline = "\nAnother process created this directory in exactly this moment :-) : $directory\n";
+ push(@pre2par::globals::logfileinfo, $infoline);
+ }
+ }
+ }
+ else
+ {
+ $infoline = "\nAlready existing directory, did not create: $directory\n";
+ push(@pre2par::globals::logfileinfo, $infoline);
+ }
+}
+
+#######################################################################
+# Creating the directories, in which files are generated or unzipped
+#######################################################################
+
+sub create_directories
+{
+ my ($directory, $languagesref) =@_;
+
+ $pre2par::globals::unpackpath =~ s/\Q$pre2par::globals::separator\E\s*$//; # removing ending slashes and backslashes
+
+ my $path = $pre2par::globals::unpackpath; # this path already exists
+
+ $path = $path . $pre2par::globals::separator . $pre2par::globals::build . $pre2par::globals::separator;
+ create_directory($path);
+
+ $path = $path . $pre2par::globals::minor . $pre2par::globals::separator;
+ create_directory($path);
+
+ if ($directory eq "unzip" )
+ {
+ $path = $path . "common" . $pre2par::globals::productextension . $pre2par::globals::separator;
+ create_directory($path);
+
+ $path = $path . $directory . $pre2par::globals::separator;
+ create_directory($path);
+ }
+ else
+ {
+ $path = $path . $pre2par::globals::compiler . $pre2par::globals::productextension . $pre2par::globals::separator;
+ create_directory($path);
+
+ $path = $path . $pre2par::globals::product . $pre2par::globals::separator;
+ create_directory($path);
+
+ $path = $path . $directory . $pre2par::globals::separator;
+ create_directory($path);
+
+ if (!($$languagesref eq "" )) # this will be a path like "01_49", for Profiles and ConfigurationFiles, idt-Files
+ {
+ $path = $path . $$languagesref . $pre2par::globals::separator;
+ create_directory($path);
+ }
+ }
+
+ $path =~ s/\Q$pre2par::globals::separator\E\s*$//;
+
+ return $path;
+}
+
+########################
+# Copying one file
+########################
+
+sub copy_one_file
+{
+ my ($source, $dest) = @_;
+
+ my ($copyreturn, $returnvalue, $infoline);
+
+ $copyreturn = copy($source, $dest);
+
+ if ($copyreturn)
+ {
+ $infoline = "Copy: $source to $dest\n";
+ $returnvalue = 1;
+ }
+ else
+ {
+ $infoline = "Error: Could not copy $source to $dest\n";
+ $returnvalue = 0;
+ }
+
+ push(@pre2par::globals::logfileinfo, $infoline);
+
+ return $returnvalue;
+}
+
+##########################################
+# Copying all files from one directory
+# to another directory
+##########################################
+
+sub copy_directory
+{
+ my ($sourcedir, $destdir) = @_;
+
+ my ($onefile, $sourcefile, $destfile);
+ my @sourcefiles = ();
+
+ $sourcedir =~ s/\Q$pre2par::globals::separator\E\s*$//;
+ $destdir =~ s/\Q$pre2par::globals::separator\E\s*$//;
+
+ $infoline = "\n";
+ push(@pre2par::globals::logfileinfo, $infoline);
+ $infoline = "Copying files from directory $sourcedir to directory $destdir\n";
+ push(@pre2par::globals::logfileinfo, $infoline);
+
+ opendir(DIR, $sourcedir);
+ @sourcefiles = readdir(DIR);
+ closedir(DIR);
+
+ foreach $onefile (@sourcefiles)
+ {
+ if ((!($onefile eq ".")) && (!($onefile eq "..")))
+ {
+ $sourcefile = $sourcedir . $pre2par::globals::separator . $onefile;
+ $destfile = $destdir . $pre2par::globals::separator . $onefile;
+ if ( -f $sourcefile ) # only files, no directories
+ {
+ copy_one_file($sourcefile, $destfile);
+ }
+ }
+ }
+}
+
+
+1;
diff --git a/solenv/bin/modules/pre2par/work.pm b/solenv/bin/modules/pre2par/work.pm
new file mode 100644
index 000000000000..d70f75e80b2e
--- /dev/null
+++ b/solenv/bin/modules/pre2par/work.pm
@@ -0,0 +1,363 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+package pre2par::work;
+
+use pre2par::exiter;
+use pre2par::remover;
+use pre2par::pathanalyzer;
+
+############################################
+# pre2par working module
+############################################
+
+############################################
+# procedure to split a line, that contains
+# more than one par file lines
+############################################
+
+sub split_line
+{
+ my ($line, $parfile) = @_;
+
+ while ( $line =~ /^((?:[^"]|\"(?:[^"\\]|\\.)*\")*?\;\s+)\s*(.*)$/ )
+ {
+ my $oneline = $1;
+ $line = $2;
+ pre2par::remover::remove_leading_and_ending_whitespaces(\$oneline);
+ $oneline = $oneline . "\n";
+ push(@{$parfile}, $oneline);
+
+ if ( $line =~ /^\s*End\s+(\w+.*$)/i )
+ {
+ $line = $1;
+ push(@{$parfile}, "End\n\n");
+ }
+ }
+
+ # the last line
+
+ pre2par::remover::remove_leading_and_ending_whitespaces(\$line);
+ $line = $line . "\n";
+ push(@{$parfile}, $line);
+
+ if ( $line =~ /^\s*End\s*$/i ) { push(@{$parfile}, "\n"); }
+}
+
+###################################################################
+# Preprocessing the pre file to split all lines with semicolon
+###################################################################
+
+sub preprocess_macros
+{
+ my ($prefile) = @_;
+
+ my @newprefile = ();
+
+ for ( my $i = 0; $i <= $#{$prefile}; $i++ )
+ {
+ my $oneline = ${$prefile}[$i];
+ if ( $oneline =~ /\;\s*\w+/ )
+ {
+ split_line($oneline, \@newprefile);
+ }
+ else
+ {
+ push(@newprefile, $oneline);
+ }
+ }
+
+ return \@newprefile;
+}
+
+############################################
+# main working procedure
+############################################
+
+sub convert
+{
+ my ($prefile) = @_;
+
+ my @parfile = ();
+
+ my $iscodesection = 0;
+ my $ismultiliner = 0;
+ my $globalline = "";
+
+ # Preprocessing the pre file to split all lines with semicolon
+ $prefile = preprocess_macros($prefile);
+
+ for ( my $i = 0; $i <= $#{$prefile}; $i++ )
+ {
+ my $oneline = ${$prefile}[$i];
+
+ if ($iscodesection)
+ {
+ if ( $oneline =~ /^\s*\}\;\s*$/ )
+ {
+ $iscodesection = 0;
+ }
+ else # nothing to do for code inside a code section
+ {
+ push(@parfile, $oneline);
+ next;
+ }
+ }
+
+ if ( $oneline =~ /^\s*$/ ) { next; }
+
+ if ( $oneline =~ /^\s*Code\s+\=\s+\{/ )
+ {
+ $iscodesection = 1;
+ }
+
+ pre2par::remover::remove_leading_and_ending_whitespaces(\$oneline);
+
+ my $insertemptyline = 0;
+
+ if ( $oneline =~ /^\s*End\s*$/i ) { $insertemptyline = 1; }
+
+ # Sometimes the complete file is in one line, then the gid line has to be separated
+
+ if ( $oneline =~ /^\s*(\w+\s+\w+)\s+(\w+\s+\=.*$)/ ) # three words before the equal sign
+ {
+ my $gidline = $1;
+ $oneline = $2;
+ $gidline = $gidline . "\n";
+
+ push(@parfile, $gidline);
+ }
+
+ if ( $oneline =~ /\;\s*\w+/ )
+ {
+ split_line($oneline, \@parfile);
+ next;
+ }
+
+ # searching for lines with brackets, like Customs = { ..., which can be parted above several lines
+
+ if ( $oneline =~ /^\s*\w+\s+\=\s*\(.*\)\s*\;\s*$/ ) # only one line
+ {
+ if (( ! ( $oneline =~ /^\s*Assignment\d+\s*\=/ )) && ( ! ( $oneline =~ /^\s*PatchAssignment\d+\s*\=/ )))
+ {
+ $oneline =~ s/\s//g; # removing whitespaces in lists
+ $oneline =~ s/\=/\ \=\ /; # adding whitespace around equals sign
+ }
+ }
+
+ if ( $oneline =~ /^\s*\w+\s+\=\s*$/ )
+ {
+ $oneline =~ s/\s*$//;
+ pre2par::exiter::exit_program("Error: Illegal syntax, no line break after eqals sign allowed. Line: \"$oneline\"", "convert");
+ }
+
+ if (( $oneline =~ /^\s*\w+\s+\=\s*\(/ ) && (!( $oneline =~ /\)\s*\;\s*$/ ))) # several lines
+ {
+ $ismultiliner = 1;
+ $oneline =~ s/\s//g;
+ $globalline .= $oneline;
+ next; # not including yet
+ }
+
+ if ( $ismultiliner )
+ {
+ $oneline =~ s/\s//g;
+ $globalline .= $oneline;
+
+ if ( $oneline =~ /\)\s*\;\s*$/ ) { $ismultiliner = 0; }
+
+ if (! ( $ismultiliner ))
+ {
+ $globalline =~ s/\=/\ \=\ /; # adding whitespace around equals sign
+ $globalline .= "\n";
+ push(@parfile, $globalline);
+ $globalline = "";
+ }
+
+ next;
+ }
+
+ $oneline = $oneline . "\n";
+
+ $oneline =~ s/\s*\=\s*/ \= /; # nice, to have only one whitespace around equal signs
+
+ # Concatenate adjacent string literals:
+ while ($oneline =~
+ s/^((?:[^"]*
+ \"(?:[^\\"]|\\.)*\"
+ (?:[^"]*[^[:blank:]"][^"]*\"(?:[^\\"]|\\.)*\")*)*
+ [^"]*
+ \"(?:[^\\"]|\\.)*)
+ \"[[:blank:]]*\"
+ ((?:[^\\"]|\\.)*\")
+ /\1\2/x)
+ {}
+
+ push(@parfile, $oneline);
+
+ if ($insertemptyline) { push(@parfile, "\n"); }
+
+ }
+
+ return \@parfile;
+}
+
+############################################
+# formatting the par file
+############################################
+
+sub formatter
+{
+ my ($parfile) = @_;
+
+ my $iscodesection = 0;
+
+ my $tabcounter = 0;
+ my $isinsideitem = 0;
+ my $currentitem;
+
+ for ( my $i = 0; $i <= $#{$parfile}; $i++ )
+ {
+ my $oneline = ${$parfile}[$i];
+ my $isitemline = 0;
+
+ if (! $isinsideitem )
+ {
+ for ( my $j = 0; $j <= $#pre2par::globals::allitems; $j++ )
+ {
+ if ( $oneline =~ /^\s*$pre2par::globals::allitems[$j]\s+\w+\s*$/ )
+ {
+ $currentitem = $pre2par::globals::allitems[$j];
+ $isitemline = 1;
+ $isinsideitem = 1;
+ $tabcounter = 0;
+ last;
+ }
+ }
+ }
+
+ if ( $isitemline )
+ {
+ next; # nothing to do
+ }
+
+ if ( $oneline =~ /^\s*end\s*$/i )
+ {
+ $isinsideitem = 0;
+ $tabcounter--;
+ }
+
+ if ( $isinsideitem )
+ {
+ $oneline = "\t" . $oneline;
+ ${$parfile}[$i] = $oneline;
+ }
+ }
+}
+
+###################################################
+# Returning the language file name
+###################################################
+
+sub getlangfilename
+{
+ return $pre2par::globals::langfilename;
+}
+
+###################################################
+# Creating the ulf file name from the
+# corresponding pre file name
+###################################################
+
+sub getulffilename
+{
+ my ($prefilename) = @_;
+
+ my $ulffilename = $prefilename;
+ $ulffilename =~ s/\.pre\s*$/\.ulf/;
+ pre2par::pathanalyzer::make_absolute_filename_to_relative_filename(\$ulffilename);
+
+ return $ulffilename;
+}
+
+############################################
+# Checking if a file exists
+############################################
+
+sub fileexists
+{
+ my ($langfilename) = @_;
+
+ my $fileexists = 0;
+
+ if( -f $langfilename ) { $fileexists = 1; }
+
+ return $fileexists;
+}
+
+############################################
+# Checking the existence of ulf and
+# jlf/mlf files
+############################################
+
+sub check_existence_of_langfiles
+{
+ my ($langfilename, $ulffilename) = @_;
+
+ my $do_localize = 0;
+
+ if (( fileexists($ulffilename) ) && ( ! fileexists($langfilename) )) { pre2par::exiter::exit_program("Error: Did not find language file $langfilename", "check_existence_of_langfiles"); }
+ if (( fileexists($ulffilename) ) && ( fileexists($langfilename) )) { $do_localize = 1; }
+
+ return $do_localize;
+}
+
+############################################
+# Checking that the pre file has content
+############################################
+
+sub check_content
+{
+ my ($filecontent, $filename) = @_;
+
+ if ( $#{$filecontent} < 0 ) { pre2par::exiter::exit_program("Error: $filename has no content!", "check_content"); }
+}
+
+############################################
+# Checking content of par files.
+# Currently only size.
+############################################
+
+sub diff_content
+{
+ my ($content1, $content2, $filename) = @_;
+
+ if ( $#{$content1} != $#{$content2} ) { pre2par::exiter::exit_program("Error: $filename was not saved correctly!", "diff_content"); }
+}
+
+1;
diff --git a/solenv/bin/msg_filter b/solenv/bin/msg_filter
new file mode 100755
index 000000000000..a7149c35a699
--- /dev/null
+++ b/solenv/bin/msg_filter
@@ -0,0 +1,61 @@
+: # -*- perl -*-
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+# This is a script to get rid of bogus error messages that are spit out
+# by the compiler - sub 30/11/1999
+
+# Lines that contain `xxxx' where xxxx belongs to the list knownMessages
+# and is surrounded by a backtick (`) and a forward tick (')
+# will not be seen in the compiler output
+
+
+@knownMessages = (
+"__pure_virtual",
+"__vt_9bad_alloc",
+"__vt_9exception",
+"_._9bad_alloc",
+"__cp_push_exception",
+"__uncatch_exception",
+"__rtti_user",
+"__rtti_si",
+"__throw",
+"terminate__Fv",
+"__cp_pop_exception",
+"__builtin_vec_new",
+"__cmpdi2",
+"__builtin_vec_delete",
+"__cp_eh_info",
+"__builtin_delete",
+"__builtin_new",
+"__eh_alloc",
+"__check_eh_spec",
+"_type_match_rtti",
+"__rtti_class",
+"set_new_handler_FPFv_v",
+"__throw_type_match_rtti",
+"__check_eh_spec",
+"exception_type_info",
+"exception type_info function",
+"exception type_info node",
+"exception virtual table",
+"terminate(void)"
+);
+
+# Create a hash %msgHash from list @knownMessages
+foreach $msg (@knownMessages) {
+ $msgHash {$msg}++;
+}
+while ( <STDIN> ) {
+
+ if (/\`([\s\w]+)\'/) {
+ $entry = $1;
+ if (defined($entry)) {
+ if (!exists $msgHash{$entry}) {
+ print $_;
+ }
+ }
+ }
+ else {
+ print $_;
+ }
+}
diff --git a/solenv/bin/newfolderforce b/solenv/bin/newfolderforce
new file mode 100644
index 000000000000..8f77f3990acc
--- /dev/null
+++ b/solenv/bin/newfolderforce
@@ -0,0 +1 @@
+#rg 16.6.98 if {#} != 1 echo emuliert "mkdir -p" echo d.h. des gesamte Directory-Baum wird angelegt exit end set wo "{1}" set regex "" set exit 0 for i in in 1 2 3 4 5 6 7 8 9 10 set regex "{regex}[Â:]+:" (evaluate "{wo}" =~ /([:]+{regex})¨1Å/) > Dev:null if not `exists -d "{¨1}"` newfolder "{¨1}" end end set exit 1 \ No newline at end of file
diff --git a/solenv/bin/oochkpatch b/solenv/bin/oochkpatch
new file mode 100755
index 000000000000..719f0765bcff
--- /dev/null
+++ b/solenv/bin/oochkpatch
@@ -0,0 +1,6 @@
+#!/bin/sh
+if [ x${SOLARENV}x = xx ]; then
+ echo No environment found, please use 'configure' or 'setsolar'
+ exit 1
+fi
+exec perl -w $SOLARENV/bin/oochkpatch.pl "$@"
diff --git a/solenv/bin/oochkpatch.btm b/solenv/bin/oochkpatch.btm
new file mode 100755
index 000000000000..9d17c2f76e79
--- /dev/null
+++ b/solenv/bin/oochkpatch.btm
@@ -0,0 +1,2 @@
+@echo off
+call perl5 %SOLARENV\bin\oochkpatch.pl %1&
diff --git a/solenv/bin/oochkpatch.pl b/solenv/bin/oochkpatch.pl
new file mode 100644
index 000000000000..0234c6d5cf92
--- /dev/null
+++ b/solenv/bin/oochkpatch.pl
@@ -0,0 +1,301 @@
+:
+ eval 'exec perl -S $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+#
+# oochkpatch - check patch flags against CWS modules
+#
+
+require File::Temp;
+require File::Find;
+require Getopt::Long;
+require Pod::Usage;
+use Pod::Usage;
+use Getopt::Long;
+use File::Temp qw/ tempfile tempdir /;
+use File::Find;
+
+
+# configuration goes here
+##########################################################
+
+# uncomment this, if in pure OOo environment
+#my $toplevel_module = "instsetoo_native";
+#my $scp_module = "scp2";
+#my $setup_file = "setup_osl";
+
+# uncomment this, if within the StarOffice environment
+my $toplevel_module = "instset_native";
+my $scp_module = "scp2so";
+my $setup_file = "setup";
+
+my $deliver = "solenv/bin/deliver.pl";
+my $build = "solenv/bin/build.pl";
+
+# list of hardcoded exceptions (files that are _never_ considered
+# missing from the patch)
+my %hardcoded_exceptions = ('build.lst' => 1);
+
+
+# no configuration below this point, please!
+##########################################################
+
+# defaults
+my $from_module = "";
+my $verbose = '';
+my $help = '';
+my $man = '';
+my $modules = '';
+my $from = '';
+my $perl = '';
+
+GetOptions('help|?' => \$help,
+ 'man' => \$man,
+ 'verbose' => \$verbose,
+ 'from=s' => \$from_module ) or pod2usage(2);
+pod2usage(1) if $help;
+pod2usage(-exitstatus => 0, -verbose => 2) if $man;
+
+# process remaining args
+print "Processing args...\n" if $verbose;
+foreach my $argument (@ARGV)
+{
+ print " Checking module ", $argument, "\n" if $verbose;
+ push @modules, $argument;
+}
+
+# platform-dependent stuff
+if( $^O eq 'MSWin32' )
+{
+ $perl = "$ENV{COMSPEC} -c $ENV{PERL}";
+ $setup_file = $setup_file . ".inf";
+}
+else
+{
+ $perl = 'perl';
+ $setup_file = $setup_file . ".ins";
+};
+
+# read some SOLAR stuff from env
+my $SRC_ROOT = $ENV{"SRC_ROOT"};
+my $INPATH = $ENV{"INPATH"};
+
+# process --from modules
+if( $from_module )
+{
+ print "Checking all modules upwards and including ", $from_module, "\n" if $verbose;
+
+ # append build.pl-generated list of modules
+ chdir "$SRC_ROOT/$toplevel_module" or
+ chdir "$SRC_ROOT/$toplevel_module.lnk" or die "ERROR: cannot cd to $SRC_ROOT/$toplevel_module!";
+ open(ALLMODULES,
+ "$perl $SRC_ROOT/$build --all:$from_module --show 2>&1 |") or die "ERROR: cannot build --show!\n";
+ while(<ALLMODULES>)
+ {
+ if( /Building project/ )
+ {
+ my @module = split( /\s+/, $_ );
+ print " which is ", $module[2], "\n" if $verbose;
+ push(@modules,$module[2]);
+ }
+ }
+}
+
+die "ERROR: no modules to check!\n" if !@modules;
+
+$tempdir = tempdir( TMPDIR => 1, CLEANUP => 1);
+
+# generate list of files with PATCH flag
+print "Generating list of files which have the PATCH flag...\n" if $verbose;
+
+my $path_to_setup_file = $SRC_ROOT."/".$scp_module."/".$INPATH."/bin/osl/".$setup_file;
+my $alternate_path_to_setup_file = $SRC_ROOT."/".$scp_module.".lnk/".$INPATH."/bin/osl/".$setup_file;
+my $in_file_block=0;
+my $patch_flag=0;
+my $file_name='';
+my $base;
+my $ext;
+my %pack_files;
+open(SETUP, "<".$path_to_setup_file) or
+ open(SETUP, "<".$alternate_path_to_setup_file) or die "ERROR: cannot open $path_to_setup_file!\n";
+while(<SETUP>)
+{
+ if( /^File\s+/ && !$in_file_block )
+ {
+ $in_file_block = 1;
+ $patch_flag=0;
+ $file_name='';
+ }
+ elsif( /^End/ && $file_name ne '' && $in_file_block )
+ {
+ $file_name =~ s/["']//g;
+ $pack_files{$file_name} = $patch_flag;
+
+ if( $patch_flag )
+ {
+ print( " File $file_name included in patch\n") if $verbose;
+ }
+ else
+ {
+ print( " File $file_name NOT included in patch\n") if $verbose;
+ }
+
+ $in_file_block = 0;
+ }
+ elsif( /^\s+Styles\s*=\s*.*PATCH/ && $in_file_block )
+ {
+ $patch_flag = 1;
+ }
+ elsif( ($res) = /^\s+Name\s*=\s*(.*);/ )
+ {
+ $file_name = $res;
+ }
+}
+
+# generate list of delivered files
+print "Generating list of delivered libs...\n" if $verbose;
+
+# first, deliver all modules to tempdir
+foreach my $module (@modules)
+{
+ print " dummy-delivering $module...\n" if $verbose;
+ chdir "$SRC_ROOT/$module" or
+ chdir "$SRC_ROOT/$module.lnk" or die "ERROR: cannot cd to $SRC_ROOT/$module!";
+ `$perl $SRC_ROOT/$deliver $tempdir`;
+}
+
+# now, check all files in delivered dirs for containedness in PATCH
+# set
+print "Checking against delivered files...\n" if $verbose;
+find(\&wanted, $tempdir );
+
+sub wanted
+{
+ my $fname;
+
+ if( -f )
+ {
+ $fname = $_;
+ if( !exists $pack_files{$fname} )
+ {
+ print " File $fname is not packed.\n" if $verbose;
+ }
+ elsif( $pack_files{$fname} == 0 )
+ {
+ if( !$hardcoded_exceptions{ $fname } )
+ {
+ # file not in patch set, and not in exception list
+ print " File $fname is packed, but NOT included in patch set and part of delivered output\n" if $verbose;
+ print "$fname\n" if !$verbose;
+ }
+ else
+ {
+ print " File $fname is NOT included in patch set, but member of hardcoded exception list\n" if $verbose;
+ }
+ }
+ elsif( $pack_files{$fname} == 1 )
+ {
+ print " File $fname packed and patched.\n" if $verbose;
+ }
+ }
+}
+
+
+__END__
+
+=head1 NAME
+
+oochkpatch.pl - Verify patch flags against module libraries
+
+=head1 SYNOPSIS
+
+oochkpatch.pl [options] [module-name ...]
+
+ Options:
+ --help|-h brief help message
+ --man|-m full documentation
+ --verbose|-v tell what's happening
+ --from=module check all modules from
+ given one upwards
+
+=head1 OPTIONS
+
+=over 8
+
+=item B<--help>
+
+Print a brief help message and exits.
+
+=item B<--man>
+
+Prints the manual page and exits.
+
+=item B<--verbose>
+
+Verbosely tell what's currently happening
+
+=item B<--from=module>
+
+Assumes OOo was built incompatibly from given module
+upwards, and check against all libs from all upwards modules.
+Further modules can be given at the command line, which are merged
+with the ones generated from this option
+
+=back
+
+=head1 DESCRIPTION
+
+B<This program> will compare all libs delivered from the specified modules
+against the set of files marked with the B<patch> flag in scp2. Useful to check
+if the patch set is complete. Please note that this program needs to be run in
+a solar shell, i.e. the OOo build environment needs to be set up in the shell.
+
+There's kind of a heuristic involved, to determine exactly which files
+to check against includedness in the patch set (since e.g. all headers
+are delivered, but clearly need not be checked against patch
+flags). It works by first collecting all files that are mentioned in
+the pack master file, and then checking all files delivered from the
+specified modules against that pack list: if the file is not packed,
+or if it's packed and has the patch flag set, all is well. Otherwise,
+the file in question potentially misses the patch flag (because one of
+the modified modules contains it).
+
+=head1 EXAMPLE
+
+To determine the set of libs not yet carrying the patch flag for a CWS
+containing sfx2, svx, and vcl, which is incompatible from sfx2
+upwards, use something like this:
+
+oochkpatch.pl --from=sfx2 `cwsquery modules`
+
+This puts every module upwards and including sfx2 in the check list,
+plus vcl. Note that with this approach, you'll usually get a larger
+set of files for the patch than necessary - but at least you get all
+files that might have changed theoretically.
+
+=cut
diff --git a/solenv/bin/packager.pl b/solenv/bin/packager.pl
new file mode 100644
index 000000000000..75d929ab86d6
--- /dev/null
+++ b/solenv/bin/packager.pl
@@ -0,0 +1,61 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+use lib ("$ENV{SOLARENV}/bin/modules");
+
+use Cwd;
+use packager::check;
+use packager::files;
+use packager::globals;
+use packager::work;
+
+####################################
+# Main program
+####################################
+
+packager::check::check_environment();
+packager::check::check_packlist();
+packager::check::check_parameter();
+
+packager::work::set_global_variable();
+
+my $packagelist = packager::files::read_file($packager::globals::packlistname);
+
+my $targets = packager::work::create_package_todos($packagelist);
+
+if ( $ENV{'BSCLIENT'} ) { packager::work::start_build_server($targets); }
+else { packager::work::execute_system_calls($targets); }
+
+if ( $packager::globals::logging )
+{
+ packager::files::save_file($packager::globals::logfilename, \@packager::globals::logfileinfo);
+ print "Log file written: $packager::globals::logfilename\n";
+}
+
+####################################
+# End main program
+####################################
diff --git a/solenv/bin/packcomponents.xslt b/solenv/bin/packcomponents.xslt
new file mode 100644
index 000000000000..6e037a677f73
--- /dev/null
+++ b/solenv/bin/packcomponents.xslt
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:uc="http://openoffice.org/2010/uno-components">
+ <xsl:param name="prefix"/>
+ <xsl:strip-space elements="*"/>
+ <xsl:template match="/">
+ <xsl:element name="components"
+ namespace="http://openoffice.org/2010/uno-components">
+ <xsl:for-each select="list/filename">
+ <xsl:variable name="doc" select="document(concat($prefix, .))"/>
+ <xsl:choose>
+ <xsl:when test="count($doc/uc:component) = 1">
+ <xsl:copy-of select="$doc/uc:component"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">
+ <xsl:text>cannot process </xsl:text>
+ <xsl:value-of select="."/>
+ </xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/solenv/bin/packimages.pl b/solenv/bin/packimages.pl
new file mode 100755
index 000000000000..9466110124d2
--- /dev/null
+++ b/solenv/bin/packimages.pl
@@ -0,0 +1,437 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#
+# packimages.pl - pack images into archives
+#
+
+use strict;
+use Getopt::Long;
+use File::Find;
+use File::Basename;
+use Archive::Zip qw(:ERROR_CODES :CONSTANTS);
+
+#### globals ####
+
+my $img_global = '%GLOBALRES%'; # 'global' image prefix
+my $img_module = '%MODULE%'; # 'module' image prefix
+
+my $out_file; # path to output archive
+my $tmp_out_file; # path to temporary output file
+my $global_path; # path to global images directory
+my $module_path; # path to module images directory
+my $sort_file; # path to file containing sorting data
+my @custom_path; # path to custom images directory
+my @imagelist_path; # pathes to directories containing the image lists
+my $verbose; # be verbose
+my $extra_verbose; # be extra verbose
+my $do_rebuild = 0; # is rebuilding zipfile required?
+
+my @custom_list;
+#### script id #####
+
+( my $script_name = $0 ) =~ s/^.*\b(\w+)\.pl$/$1/;
+
+my $script_rev;
+my $id_str = ' $Revision: 1.17 $ ';
+$id_str =~ /Revision:\s+(\S+)\s+\$/
+ ? ($script_rev = $1) : ($script_rev = "-");
+
+print "$script_name -- version: $script_rev\n";
+
+#### main #####
+
+parse_options();
+my $image_lists_ref = get_image_lists();
+my %image_lists_hash;
+foreach ( @{$image_lists_ref} ) {
+ $image_lists_hash{$_}="";
+}
+$do_rebuild = is_file_newer(\%image_lists_hash) if $do_rebuild == 0;
+my ($global_hash_ref, $module_hash_ref, $custom_hash_ref) = iterate_image_lists($image_lists_ref);
+# custom_hash filled from filesystem lookup
+find_custom($custom_hash_ref);
+my $zip_hash_ref = create_zip_list($global_hash_ref, $module_hash_ref, $custom_hash_ref);
+$do_rebuild = is_file_newer($zip_hash_ref) if $do_rebuild == 0;
+if ( $do_rebuild == 1 ) {
+ create_zip_archive($zip_hash_ref);
+ replace_file($tmp_out_file, $out_file);
+ print_message("packing $out_file finished.");
+} else {
+ print_message("$out_file up to date. nothing to do.");
+}
+
+exit(0);
+
+#### subroutines ####
+
+sub parse_options
+{
+ my $opt_help;
+ my $p = Getopt::Long::Parser->new();
+ my @custom_path_list;
+ my $custom_path_extended;
+ my $success =$p->getoptions(
+ '-h' => \$opt_help,
+ '-o=s' => \$out_file,
+ '-g=s' => \$global_path,
+ '-s=s' => \$sort_file,
+ '-m=s' => \$module_path,
+ '-c=s' => \@custom_path_list,
+ '-e=s' => \$custom_path_extended,
+ '-l=s' => \@imagelist_path,
+ '-v' => \$verbose,
+ '-vv' => \$extra_verbose
+ );
+ push @custom_path_list, $custom_path_extended if ($custom_path_extended);
+ if ( $opt_help || !$success || !$out_file || !$global_path
+ || !$module_path || !@custom_path_list || !@imagelist_path )
+ {
+ usage();
+ exit(1);
+ }
+ #define intermediate output file
+ $tmp_out_file="$out_file"."$$".$ENV{INPATH};
+ # Sanity checks.
+
+ # Check if out_file can be written.
+ my $out_dir = dirname($out_file);
+
+ # Check paths.
+ foreach ($out_dir, $global_path, $module_path, @imagelist_path) {
+ print_error("no such directory: '$_'", 2) if ! -d $_;
+ print_error("can't search directory: '$_'", 2) if ! -x $_;
+ }
+ print_error("directory is not writable: '$out_dir'", 2) if ! -w $out_dir;
+
+ # Use just the working paths
+ @custom_path = ();
+ foreach (@custom_path_list) {
+ if ( ! -d $_ ) {
+ print_warning("skipping non-existing directory: '$_'", 2);
+ }
+ elsif ( ! -x $_ ) {
+ print_error("can't search directory: '$_'", 2);
+ }
+ else {
+ push @custom_path, $_;
+ }
+ }
+}
+
+sub get_image_lists
+{
+ my @image_lists;
+ my $glob_imagelist_path;
+
+ foreach ( @imagelist_path ) {
+ $glob_imagelist_path = $_;
+ # cygwin perl
+ chomp( $glob_imagelist_path = qx{cygpath -u "$glob_imagelist_path"} ) if "$^O" eq "cygwin";
+ push @image_lists, glob("$glob_imagelist_path/*.ilst");
+ }
+ if ( !@image_lists ) {
+ print_error("can't find any image lists in '@imagelist_path'", 3);
+ }
+
+ return wantarray ? @image_lists : \@image_lists;
+}
+
+sub iterate_image_lists
+{
+ my $image_lists_ref = shift;
+
+ my %global_hash;
+ my %module_hash;
+ my %custom_hash;
+
+ foreach my $i ( @{$image_lists_ref} ) {
+ parse_image_list($i, \%global_hash, \%module_hash, \%custom_hash);
+ }
+
+ return (\%global_hash, \%module_hash, \%custom_hash);
+}
+
+sub parse_image_list
+{
+ my $image_list = shift;
+ my $global_hash_ref = shift;
+ my $module_hash_ref = shift;
+ my $custom_hash_ref = shift;
+
+ print_message("parsing '$image_list' ...") if $verbose;
+ my $linecount = 0;
+ open(IMAGE_LIST, "< $image_list") or die "ERROR: can't open $image_list: $!";
+ while ( <IMAGE_LIST> ) {
+ $linecount++;
+ next if /^\s*#/;
+ next if /^\s*$/;
+ # clean up trailing whitespace
+ tr/\r\n//d;
+ s/\s+$//;
+ # clean up backslashes and double slashes
+ tr{\\}{/}s;
+ tr{/}{}s;
+ # hack "res" back into globals
+ if ( /^\Q$img_global\E\/(.*)$/o ) {
+ $global_hash_ref->{"res/".$1}++;
+ next;
+ }
+ if ( /^\Q$img_module\E\/(.*)$/o ) {
+ $module_hash_ref->{$1}++;
+ next;
+ }
+ # parse failed if we reach this point, bail out
+ close(IMAGE_LIST);
+ print_error("can't parse line $linecount from file '$image_list'", 4);
+ }
+ close(IMAGE_LIST);
+
+ return ($global_hash_ref, $module_hash_ref, $custom_hash_ref);
+}
+
+sub find_custom
+{
+ my $custom_hash_ref = shift;
+ my $keep_back;
+ for my $path (@custom_path) {
+ find({ wanted => \&wanted, no_chdir => 0 }, $path);
+ foreach ( @custom_list ) {
+ if ( /^\Q$path\E\/(.*)$/ ) {
+ $keep_back=$1;
+ if (!defined $custom_hash_ref->{$keep_back}) {
+ $custom_hash_ref->{$keep_back} = $path;
+ }
+ }
+ }
+ }
+}
+
+sub wanted
+{
+ my $file = $_;
+
+ if ( $file =~ /.*\.png$/ && -f $file ) {
+ push @custom_list, $File::Find::name;
+ }
+}
+
+sub create_zip_list
+{
+ my $global_hash_ref = shift;
+ my $module_hash_ref = shift;
+ my $custom_hash_ref = shift;
+
+ my %zip_hash;
+ my @warn_list;
+
+ print_message("assemble image list ...") if $verbose;
+ foreach ( keys %{$global_hash_ref} ) {
+ # check if in 'global' and in 'module' list and add to warn list
+ if ( exists $module_hash_ref->{$_} ) {
+ push(@warn_list, $_);
+ next;
+ }
+ if ( exists $custom_hash_ref->{$_} ) {
+ $zip_hash{$_} = $custom_hash_ref->{$_};
+ next;
+ }
+ # it's neither in 'module' nor 'custom', record it in zip hash
+ $zip_hash{$_} = $global_path;
+ }
+ foreach ( keys %{$module_hash_ref} ) {
+ if ( exists $custom_hash_ref->{$_} ) {
+ $zip_hash{$_} = $custom_hash_ref->{$_};
+ next;
+ }
+ # it's not in 'custom', record it in zip hash
+ $zip_hash{$_} = $module_path;
+ }
+
+ if ( @warn_list ) {
+ foreach ( @warn_list ) {
+ print_warning("$_ is duplicated in 'global' and 'module' list");
+ }
+ }
+
+ return \%zip_hash
+}
+
+sub is_file_newer
+{
+ my $test_hash_ref = shift;
+ my $reference_stamp = 0;
+
+ print_message("checking timestamps ...") if $verbose;
+ if ( -e $out_file ) {
+ $reference_stamp = (stat($out_file))[9];
+ print_message("found $out_file with $reference_stamp ...") if $verbose;
+ }
+ return 1 if $reference_stamp == 0;
+
+ foreach ( sort keys %{$test_hash_ref} ) {
+ my $path = $test_hash_ref->{$_};
+ $path .= "/" if "$path" ne "";
+ $path .= "$_";
+ print_message("checking '$path' ...") if $extra_verbose;
+ my $mtime = (stat($path))[9];
+ return 1 if $reference_stamp < $mtime;
+ }
+ return 0;
+}
+
+sub optimize_zip_layout($)
+{
+ my $zip_hash_ref = shift;
+
+ if (!defined $sort_file) {
+ print_message("no sort file - sorting alphabetically ...") if $verbose;
+ return sort keys %{$zip_hash_ref};
+ }
+ print_message("sorting from $sort_file ...") if $verbose;
+
+ my $orderh;
+ my %included;
+ my @sorted;
+ open ($orderh, $sort_file) || die "Can't open $sort_file: $!";
+ while (<$orderh>) {
+ /^\#.*/ && next; # comments
+ s/[\r\n]*$//;
+ /^\s*$/ && next;
+ my $file = $_;
+ if (!defined $zip_hash_ref->{$file}) {
+ print "unknown file '$file'\n" if ($extra_verbose);
+ } else {
+ push @sorted, $file;
+ $included{$file} = 1;
+ }
+ }
+ close ($orderh);
+
+ for my $img (sort keys %{$zip_hash_ref}) {
+ push @sorted, $img if (!$included{$img});
+ }
+
+ print_message("done sort ...") if $verbose;
+
+ return @sorted;
+}
+
+sub create_zip_archive
+{
+ my $zip_hash_ref = shift;
+
+ print_message("creating image archive ...") if $verbose;
+ my $zip = Archive::Zip->new();
+
+# FIXME: test - $member = addfile ... $member->desiredCompressionMethod( COMPRESSION_STORED );
+# any measurable performance win/loss ?
+ foreach ( optimize_zip_layout($zip_hash_ref) ) {
+ my $path = $zip_hash_ref->{$_} . "/$_";
+ print_message("zipping '$path' ...") if $extra_verbose;
+ my $member = $zip->addFile($path, $_);
+ if ( !$member ) {
+ print_error("can't add file '$path' to image zip archive: $!", 5);
+ }
+ }
+ my $status = $zip->writeToFileNamed($tmp_out_file);
+ if ( $status != AZ_OK ) {
+ print_error("write image zip archive '$tmp_out_file' failed. Reason: $status", 6);
+ }
+ return;
+}
+
+sub replace_file
+{
+ my $source_file = shift;
+ my $dest_file = shift;
+ my $result = 0;
+
+ $result = unlink($dest_file) if -f $dest_file;
+ if ( $result != 1 && -f $dest_file ) {
+ unlink $source_file;
+ print_error("couldn't remove '$dest_file'",1);
+ } else {
+ if ( !rename($source_file, $dest_file)) {
+ unlink $source_file;
+ print_error("couldn't rename '$source_file'",1);
+ }
+ }
+ return;
+}
+
+sub usage
+{
+ print STDERR "Usage: packimages.pl [-h] -o out_file -g g_path -m m_path -c c_path -l imagelist_path\n";
+ print STDERR "Creates archive of images\n";
+ print STDERR "Options:\n";
+ print STDERR " -h print this help\n";
+ print STDERR " -o out_file path to output archive\n";
+ print STDERR " -g g_path path to global images directory\n";
+ print STDERR " -m m_path path to module images directory\n";
+ print STDERR " -c c_path path to custom images directory\n";
+ print STDERR " -s sort_file path to image sort order file\n";
+ print STDERR " -l imagelist_path path to directory containing image lists (may appear mutiple times)\n";
+ print STDERR " -v verbose\n";
+ print STDERR " -vv very verbose\n";
+}
+
+sub print_message
+{
+ my $message = shift;
+
+ print "$script_name: ";
+ print "$message\n";
+ return;
+}
+
+sub print_warning
+{
+ my $message = shift;
+
+ print STDERR "$script_name: ";
+ print STDERR "WARNING $message\n";
+ return;
+}
+
+sub print_error
+{
+ my $message = shift;
+ my $error_code = shift;
+
+ print STDERR "$script_name: ";
+ print STDERR "ERROR: $message\n";
+
+ if ( $error_code ) {
+ print STDERR "\nFAILURE: $script_name aborted.\n";
+ exit($error_code);
+ }
+ return;
+}
diff --git a/solenv/bin/packmodule b/solenv/bin/packmodule
new file mode 100755
index 000000000000..dd1ac0439308
--- /dev/null
+++ b/solenv/bin/packmodule
@@ -0,0 +1,58 @@
+#! /usr/bin/env python
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+import os, os.path, sys, zipfile
+
+def paths_to_pack(loglines):
+ """Returns a generator iterating the outdir fields (with platform) of gb_deliver.log lines."""
+ return (line.split()[2] for line in loglines)
+
+def stripped_paths_to_pack(loglines):
+ """returns a generator iterating the outdir fields (stripped of the platform) of gb_deliver.log lines."""
+ return (path.partition('/')[2] for path in paths_to_pack(loglines))
+
+def main(args):
+ """creates/overwrites a file at OUTDIR/zip/MODULE.zip containing the contents of the gb_deliver.log."""
+ if len(args) != 3:
+ print('usage: packmodule OUTDIR MODULE')
+ sys.exit(2)
+ (executable, outdir, module) = args
+ os.chdir(outdir)
+ zipdir = 'zip'
+ try:
+ os.makedirs(zipdir)
+ except OSError:
+ pass
+ deliverlog = open(os.path.join('inc', module, 'gb_deliver.log'))
+ packedmodule = zipfile.ZipFile(os.path.join(zipdir,module+'.zip'), 'w')
+ [packedmodule.write(path) for path in stripped_paths_to_pack(deliverlog)]
+ packedmodule.close()
+
+if __name__ == "__main__":
+ main(sys.argv)
+
+# vim:set et sw=4 ts=4 filetype=python:
diff --git a/solenv/bin/packregistry.xslt b/solenv/bin/packregistry.xslt
new file mode 100644
index 000000000000..7c118f90136f
--- /dev/null
+++ b/solenv/bin/packregistry.xslt
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+**********************************************************************-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:oor="http://openoffice.org/2001/registry">
+ <xsl:param name="prefix"/>
+ <xsl:strip-space elements="*"/>
+ <xsl:preserve-space elements="value it"/>
+ <!-- TODO: strip space from "value" elements that have "it" children -->
+ <xsl:template match="/">
+ <oor:data xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <xsl:copy-of select="list/dependency"/>
+<!--
+ <xsl:copy-of select="document(list/filename)/oor:component-schema"/>
+ <xsl:copy-of select="document(list/filename)/oor:component-data"/>
+
+ instead of the below for-each would only issue warnings, not errors, for
+ non-existing or otherwise bad input files; it is important that the input
+ filename list is already sorted in an order suitable for the configmgr
+ (e.g., xcs files preceeding xcu files).
+-->
+ <xsl:for-each select="list/filename">
+ <xsl:variable name="doc" select="document(concat($prefix, .))"/>
+ <xsl:choose>
+ <xsl:when test="count($doc/oor:component-schema) = 1">
+ <xsl:apply-templates select="$doc/oor:component-schema"/>
+ </xsl:when>
+ <xsl:when test="count($doc/oor:component-data) = 1">
+ <xsl:apply-templates select="$doc/oor:component-data"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">
+ <xsl:text>cannot process </xsl:text>
+ <xsl:value-of select="."/>
+ </xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </oor:data>
+ </xsl:template>
+ <xsl:template
+ match="oor:component-schema|oor:component-data|templates|component|group|
+ set|node-ref|prop|item|value|it|unicode|node">
+ <xsl:copy copy-namespaces="no">
+ <!-- prune oor:component-data xmlns:install="..." namespaces (would only
+ work in XSLT 2.0, however) -->
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+ <xsl:template match="value[it]">
+ <xsl:copy copy-namespaces="no">
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates select="*"/>
+ <!-- ignore text elements (which must be whitespace only) -->
+ </xsl:copy>
+ </xsl:template>
+ <xsl:template match="info|import|uses|constraints"/>
+ <!-- TODO: no longer strip elements when they are eventually read by
+ configmgr implementation -->
+ <xsl:template match="@*">
+ <xsl:copy/>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/solenv/bin/par2script.pl b/solenv/bin/par2script.pl
new file mode 100644
index 000000000000..06928ad68439
--- /dev/null
+++ b/solenv/bin/par2script.pl
@@ -0,0 +1,115 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+use lib ("$ENV{SOLARENV}/bin/modules");
+
+use Cwd;
+use par2script::check;
+use par2script::files;
+use par2script::globals;
+use par2script::parameter;
+use par2script::module;
+use par2script::undefine;
+use par2script::work;
+
+####################################
+# Main program
+####################################
+
+par2script::parameter::getparameter();
+par2script::parameter::control_parameter();
+par2script::parameter::outputparameter();
+
+my $includes = par2script::work::setincludes($par2script::globals::includepathlist);
+my $parfiles = par2script::work::setparfiles($par2script::globals::parfilelist);
+
+par2script::work::make_complete_pathes_for_parfiles($parfiles, $includes);
+
+print "Reading par files\n";
+my $parfilecontent = par2script::work::read_all_parfiles($parfiles);
+
+print "Collecting items\n";
+par2script::work::collect_definitions($parfilecontent);
+
+print "Collecting assigned items\n";
+par2script::work::collect_assigned_gids();
+
+# print "First control of multiple assignments\n";
+# par2script::check::check_multiple_assignments();
+
+print "Searching for Undefinitions\n";
+par2script::undefine::undefine_gids($parfilecontent);
+par2script::undefine::remove_complete_item("Directory", $parfilecontent);
+par2script::undefine::remove_complete_item("Profile", $parfilecontent);
+
+print "Removing assigned GIDs without definitions\n";
+par2script::module::remove_undefined_gids_from_modules();
+
+print "Adding definitions without assignment to the root\n";
+par2script::module::add_to_root_module();
+
+print "Control of multiple assignments\n";
+par2script::check::check_multiple_assignments();
+
+print "Control of definitions with missing assignments\n";
+par2script::check::check_missing_assignments();
+
+# checking the setup script
+print "Checking directory definitions ...\n";
+par2script::check::check_needed_directories();
+par2script::check::check_directories_in_item_definitions();
+print "Checking module definitions ...\n";
+par2script::check::check_module_existence();
+print "Checking module assignments ...\n";
+par2script::check::check_moduleid_at_items();
+print "Checking Root Module ...";
+par2script::check::check_rootmodule();
+print "Checking Shortcut assignments ...\n";
+par2script::check::check_shortcut_assignments();
+print "Checking missing parents ...\n";
+par2script::check::check_missing_parents();
+
+print "Shorten lines at modules\n";
+par2script::module::shorten_lines_at_modules();
+
+# Now the script can be created
+print "Creating setup script\n";
+my $setupscript = par2script::work::create_script();
+
+print "Saving script\n";
+par2script::files::save_file($par2script::globals::scriptname, $setupscript);
+
+# logging, if set
+if ($par2script::globals::logging)
+{
+ par2script::files::save_file($par2script::globals::logfilename, \@par2script::globals::logfileinfo);
+ print "Log file written: $par2script::globals::logfilename\n";
+}
+
+####################################
+# End main program
+####################################
diff --git a/solenv/bin/patch_sanitizer.pl b/solenv/bin/patch_sanitizer.pl
new file mode 100755
index 000000000000..25260f9274c1
--- /dev/null
+++ b/solenv/bin/patch_sanitizer.pl
@@ -0,0 +1,126 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+use utf8;
+use warnings;
+use strict;
+
+# command line arguments
+my $oldpatchfile = shift;
+my $newpatchfile = shift;
+my $sortedfile = shift;
+
+show_help() unless defined $oldpatchfile and defined $newpatchfile and defined $sortedfile;
+
+my %oldpatchfile = parse_patch($oldpatchfile);
+my %newpatchfile = parse_patch($newpatchfile);
+
+open SORTEDPATCH, "> $sortedfile";
+
+foreach my $file (sort (keys %newpatchfile)) {
+ print SORTEDPATCH $file."\t";
+ if (defined($oldpatchfile{$file})) {
+ if ( (join '', @{$oldpatchfile{$file}{'data'}}) eq (join '', @{$newpatchfile{$file}{'data'}}) ) {
+ # patch data for the file hasn't been modified, use the header from
+ # the old patch, to reduce noise (keep the old timestamps)
+ print SORTEDPATCH $oldpatchfile{$file}{'origtimestamp'}."\n";
+ print SORTEDPATCH $oldpatchfile{$file}{'patchedfilename'}."\t";
+ print SORTEDPATCH $oldpatchfile{$file}{'patchedtimestamp'}."\n";
+ print SORTEDPATCH @{$oldpatchfile{$file}{'data'}};
+ next;
+ }
+ }
+ # either file wasn't patched before, or the patchset changed, so use the new
+ # values for it..
+ print SORTEDPATCH $newpatchfile{$file}{'origtimestamp'}."\n";
+ print SORTEDPATCH $newpatchfile{$file}{'patchedfilename'}."\t";
+ print SORTEDPATCH $newpatchfile{$file}{'patchedtimestamp'}."\n";
+ print SORTEDPATCH @{$newpatchfile{$file}{'data'}};
+}
+close SORTEDPATCH;
+
+###############
+# Helper subs
+###############
+sub show_help {
+ print "Usage: $0 oldpatch newpatch outputfilename\n";
+ print "oldpatch and newpatch can be the very same file\n";
+ print "will output a sanitized form of newpatch to outputfilename\n";
+ print "if outputfilename is '-', the patch will be printed to stdout\n";
+ print "sanitized means: It will avoid all unnecessary changes\n";
+ exit 1;
+}
+sub parse_patch {
+ my $patchfile = shift;
+ my $patchtype;
+ my $pfirst;
+ my $psecond;
+
+ my %hunks = ();
+ my $origfilename;
+ open PATCHFILE, "< $patchfile" or die "Cannot open file $patchfile $!";
+ my @patchfile = <PATCHFILE>;
+ close PATCHFILE;
+ return %hunks if ( $#patchfile == -1 );
+ if ( $patchfile[0] =~ /^---/ ) {
+ $patchtype = "unified";
+ $pfirst = '^--- [^\*]*$';
+ $psecond = '^\+\+\+ [^\*]*$';
+ } elsif ( $patchfile[0] =~ /^\*\*\*/ ) {
+ $patchtype = "content";
+ $pfirst = '^\*\*\* [^\*]*$';
+ $psecond = '^--- .*\t.*$';
+ } else {
+ die "unknown patch format\n";
+ }
+
+ foreach (@patchfile) {
+ if ( /$pfirst/ ) {
+ my $timestamp;
+ # extract the filename, to be able to compare the old
+ # with the new file...
+ ($origfilename, $timestamp) = split(/\t/, $_, 2);
+ chomp $timestamp;
+ # ideally convert the timestamp to iso-format...
+ $hunks{$origfilename}{'origtimestamp'} = $timestamp;
+ next;
+ } elsif ( $_ =~ /$psecond/ ) {
+ my ($filename, $timestamp) = split(/\t/, $_, 2);
+ chomp $timestamp;
+ # ideally convert the timestamp to iso-format...
+ $hunks{$origfilename}{'patchedfilename'} = $filename;
+ $hunks{$origfilename}{'patchedtimestamp'} = $timestamp;
+ next;
+ }
+ push (@{$hunks{$origfilename}{'data'}}, $_);
+
+ }
+ return %hunks;
+}
diff --git a/solenv/bin/pchdelta b/solenv/bin/pchdelta
new file mode 100755
index 000000000000..e33db2f96c84
--- /dev/null
+++ b/solenv/bin/pchdelta
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Wrapper around the pchdelta.py script
+bash -c "unset PYTHONHOME PYTHONPATH; /usr/bin/python ../solenv/bin/pchdelta.py $*"
diff --git a/solenv/bin/pchdelta.py b/solenv/bin/pchdelta.py
new file mode 100755
index 000000000000..52a0df4ecc5d
--- /dev/null
+++ b/solenv/bin/pchdelta.py
@@ -0,0 +1,149 @@
+#!/usr/bin/python
+
+# ------------------------------------------------------------------------------
+# Hacky little delta debug tool to figure out the proper includes for a pch file
+#
+# Usage:
+#
+# pchdelta.py <pch_target> <dir1> [<dir2> <dir3> ...]
+#
+# <pch_target> File to perform delta debugging on. The section to test
+# is delimeted by '//---MARKER---' lines.
+# <dir1> .. <dirn> Sequence of directories to run dmake in to test if the
+# modification works
+#
+# Examples:
+#
+# pchdelta.py inc/pch/precompiled_sfx2.hxx inc source/dialog
+#
+# Run pchdelta inside sfx2 first building the pch files and then files in
+# source/dialog
+#
+# ------------------------------------------------------------------------------
+
+import os
+import os.path
+import sys
+
+# C++
+MARKER="//---MARKER---\n"
+
+# dmake
+#MARKER="#---MARKER---\n"
+
+# ------------------------------------------------------------------------------
+# Sequentially build all argument directories from scratch
+
+def testSequenceBuild(dirlist):
+ cwd = os.path.abspath(os.getcwd())
+ for path in dirlist:
+ os.chdir(path)
+ buildcommand = "dmake -u"
+ buildcommand += " >>" + cwd + "/buildlog.txt 2>&1"
+ buildresult = os.system(buildcommand)
+ os.chdir(cwd)
+ if buildresult != 0:
+ return False
+ return True
+
+# ------------------------------------------------------------------------------
+# Dump out the delta file with corresponding markers
+
+def writePch(pchname, header, footer, acceptedlines, testlines):
+ outputfile = file(pchname, "w")
+ outputfile.write(header)
+ outputfile.write(MARKER)
+ outputfile.write("\n".join(acceptedlines))
+ if len(testlines) > 0:
+ outputfile.write("\n\n//---Candidate marker---\n")
+ outputfile.write("\n".join(testlines) + "\n")
+ outputfile.write("//---Candidate marker end---\n")
+ outputfile.write(MARKER)
+ outputfile.write(footer)
+ outputfile.close()
+
+
+# ------------------------------------------------------------------------------
+# Recursive tester routine. Test the segment given and if an error is
+# encountered splits the segment into <fanout> subsegment and recurses. Failing
+# one liners are rejected. The set of accepted lines are built sequentially from
+# the beginning.
+
+def binaryTest(dirlist, lines, pchname, header, footer, acceptedlines, indent, startpoint):
+ linecount = len(lines)
+ if linecount == 0:
+ return
+ # Test if this slice passes the buildtest
+ writePch(pchname, header, footer, acceptedlines, lines)
+ if testSequenceBuild(dirlist):
+ return acceptedlines + lines
+
+ # Reject one liners
+ if linecount == 1:
+ print indent + "Rejected: " + lines[0]
+ return acceptedlines
+
+ # Recurse with multiline slices
+ fanout = 4
+ splits = []
+ for i in range(3):
+ splits.append(linecount * (i + 1) / fanout)
+ splits.append(linecount)
+
+ splitstart = 0
+ for splitend in splits:
+ # avoid splitting in case we have no resulting lines
+ if (splitend - splitstart) == 0:
+ continue
+ splitslice = lines[splitstart:splitend]
+ print indent + "[" + str(startpoint + splitstart) + ":" + str(startpoint + splitend) + "] (" + str(splitend - splitstart) + ")"
+ acceptedlines = binaryTest(dirlist, splitslice, pchname, header, footer, acceptedlines, indent + " ", startpoint + splitstart)
+ splitstart = splitend
+
+ return acceptedlines
+
+# ------------------------------------------------------------------------------
+# Main entry point
+
+if len(sys.argv) < 3:
+ print "Usage: " + sys.argv[0] + " <pch_target> <dir1> [<dir2> <dir3> ...]"
+ sys.exit(1)
+
+pchname = os.path.abspath(sys.argv[1])
+dirlist = sys.argv[2:]
+
+# remove old build log file
+if os.path.exists("buildlog.txt"):
+ os.remove("buildlog.txt")
+
+# test for corner case of everything working from the start
+if testSequenceBuild(dirlist):
+ print "pch working, nothing to do."
+ sys.exit(0)
+
+# Open the header file for reading
+inputfile = file(pchname, "r+")
+inputdata = inputfile.read()
+inputfile.close()
+
+segments = inputdata.split(MARKER)
+header = segments[0]
+footer = segments[2]
+lines = segments[1].split("\n")
+
+writePch(pchname + "_backup", header, footer, lines, [])
+
+# test for corner case of no convergence possible
+writePch(pchname, header, footer, [], [])
+if not testSequenceBuild(dirlist):
+ writePch(pchname, header, footer, lines, [])
+ print "Building with no candidate lines failed. Convergence questionable, aborting."
+ sys.exit(0)
+
+# Starting pruning
+print "Starting evaluation of " + str(len(lines)) + " lines"
+acceptedlines = binaryTest(dirlist, lines, pchname, header, footer, [], "", 0)
+writePch(pchname, header, footer, acceptedlines, [])
+
+
+
diff --git a/solenv/bin/pre2par.pl b/solenv/bin/pre2par.pl
new file mode 100644
index 000000000000..f279ae106797
--- /dev/null
+++ b/solenv/bin/pre2par.pl
@@ -0,0 +1,74 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+use lib ("$ENV{SOLARENV}/bin/modules");
+
+use Cwd;
+use pre2par::directory;
+use pre2par::files;
+use pre2par::globals;
+use pre2par::language;
+use pre2par::parameter;
+use pre2par::work;
+
+####################################
+# Main program
+####################################
+
+pre2par::parameter::getparameter();
+pre2par::parameter::control_parameter();
+
+pre2par::directory::check_directory($pre2par::globals::parfilename);
+
+my $prefile = pre2par::files::read_file($pre2par::globals::prefilename);
+
+pre2par::work::check_content($prefile, $pre2par::globals::prefilename);
+
+my $parfile = pre2par::work::convert($prefile);
+
+pre2par::work::formatter($parfile);
+
+my $langfilename = pre2par::work::getlangfilename();
+my $ulffilename = pre2par::work::getulffilename($pre2par::globals::prefilename);
+
+my $dolocalization = pre2par::work::check_existence_of_langfiles($langfilename, $ulffilename);
+
+if ( $dolocalization )
+{
+ my $langfile = pre2par::files::read_file($langfilename);
+ pre2par::language::localize($parfile, $langfile);
+}
+
+pre2par::files::save_file($pre2par::globals::parfilename, $parfile);
+
+# checking of par file was written correctly
+my $parfilecomp = pre2par::files::read_file($pre2par::globals::parfilename);
+pre2par::work::diff_content($parfile, $parfilecomp, $pre2par::globals::parfilename);
+
+####################################
+# End main program
+####################################
diff --git a/solenv/bin/receditor b/solenv/bin/receditor
new file mode 100755
index 000000000000..1b4046010485
--- /dev/null
+++ b/solenv/bin/receditor
@@ -0,0 +1,6 @@
+#!/bin/sh
+if [ x${SOLARENV}x = xx ]; then
+ echo No environment found, please use 'configure' or 'setsolar'
+ exit 1
+fi
+exec java -DSOLARSRC=${SOLARSRC} -DWORK_STAMP=${WORK_STAMP} -jar ${SOLARVER}/${INPATH}/bin${UPDMINOREXT}/receditor.jar
diff --git a/solenv/bin/relocate b/solenv/bin/relocate
new file mode 100755
index 000000000000..2158d5d7314c
--- /dev/null
+++ b/solenv/bin/relocate
@@ -0,0 +1,233 @@
+:
+ eval 'exec perl -S $0 ${1+"$@"}'
+ if 0;
+
+#*************************************************************************
+#
+# This tool makes it easy to cleanly re-locate a
+# build, eg. after you have copied or moved it to a new
+# path. It tries to re-write all the hard-coded path logic
+# internally.
+#
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+sub sniff_set($)
+{
+ my $build_dir = shift;
+ my ($dirhandle, $fname);
+
+ opendir ($dirhandle, $build_dir) || die "Can't open $build_dir";
+ while ($fname = readdir ($dirhandle)) {
+ $fname =~ /[Ss]et.sh$/ && last;
+ }
+ closedir ($dirhandle);
+
+ return $fname;
+}
+
+sub sed_file($$$)
+{
+ my ($old_fname, $function, $state) = @_;
+ my $tmp_fname = "$old_fname.new";
+ my $old_file;
+ my $new_file;
+
+ open ($old_file, $old_fname) || die "Can't open $old_fname: $!";
+ open ($new_file, ">$tmp_fname") || die "Can't open $tmp_fname: $!";
+
+ while (<$old_file>) {
+ my $value = &$function($state, $_);
+ print $new_file $value;
+ }
+
+ close ($new_file) || die "Failed to close $tmp_fname: $!";
+ close ($old_file) || die "Failed to close $old_fname: $!";
+
+ rename $tmp_fname, $old_fname || die "Failed to replace $old_fname: $!";
+}
+
+sub rewrite_value($$)
+{
+ my ($state, $value) = @_;
+
+ $value =~ s/$state->{'old_root'}/$state->{'new_root'}/g;
+ $value =~ s/$state->{'win32_old_root'}/$state->{'win32_new_root'}/g;
+
+ return $value;
+}
+
+sub rewrite_set($$$)
+{
+ my $new_root = shift;
+ my $old_root = shift;
+ my $set = shift;
+ my $tmp;
+ my %state;
+
+ print " $set\n";
+
+# unix style
+ $state{'old_root'} = $old_root;
+ $state{'new_root'} = $new_root;
+# win32 style
+ $tmp = $old_root;
+ $tmp =~ s/\//\\\\\\\\\\\\\\\\/g;
+ $state{'win32_old_root'} = $tmp;
+ $tmp = $new_root;
+ $tmp =~ s/\//\\\\\\\\/g;
+ $state{'win32_new_root'} = $tmp;
+
+ sed_file ("$new_root/$set", \&rewrite_value, \%state);
+
+ my $tcsh_set = $set;
+ $tcsh_set =~ s/\.sh$//;
+
+ print " $tcsh_set\n";
+
+ sed_file ("$new_root/$tcsh_set", \&rewrite_value, \%state);
+}
+
+sub find_old_root($$)
+{
+ my $new_root = shift;
+ my $set = shift;
+ my $fname = "$new_root/$set";
+ my $old_root;
+ my $file;
+
+ open ($file, $fname) || die "Can't open $fname: $!";
+
+ while (<$file>) {
+ if (/\s*([^=]+)\s*=\s*\"([^\"]+)\"/) {
+ my ($name, $value) = ($1, $2);
+
+ if ($name eq 'SRC_ROOT') {
+ $old_root = $value;
+ last;
+ }
+ }
+ }
+
+ close ($file) || die "Failed to close $fname: $!";
+
+ return $old_root;
+}
+
+sub rewrite_product_deps($$$)
+{
+ my $new_root = shift;
+ my $product_path = shift;
+ my $old_root = shift;
+
+ my $path = "$new_root/$product_path/misc";
+ my $misc_dir;
+ opendir ($misc_dir, $path) || return;
+ my $name;
+ while ($name = readdir ($misc_dir)) {
+# Should try re-writing these - but perhaps this would
+# screw with timestamps ?
+ if ($name =~ m/\.dpcc$/ || $name =~ m/\.dpslo$/ || $name =~ m/\.dpobj$/) {
+ unlink ("$path/$name");
+ }
+ }
+ closedir ($misc_dir);
+}
+
+sub rewrite_dpcc($$)
+{
+ my $new_root = shift;
+ my $old_root = shift;
+
+ my $top_dir;
+ my $idx = 0;
+ opendir ($top_dir, $new_root) || die "Can't open $new_root: $!";
+ my $name;
+ while ($name = readdir ($top_dir)) {
+ my $sub_dir;
+ opendir ($sub_dir, "$new_root/$name") || next;
+ my $sub_name;
+ while ($sub_name = readdir ($sub_dir)) {
+ if ($sub_name =~ /\.pro$/) {
+ $idx || print "\n ";
+ if ($idx++ == 6) {
+ $idx = 0;
+ }
+ print "$name ";
+ rewrite_product_deps ($new_root, "$name/$sub_name", $old_root);
+ }
+ }
+ closedir ($sub_dir);
+ }
+ closedir ($top_dir);
+}
+
+sub rewrite_bootstrap($$)
+{
+ my $new_root = shift;
+ my $old_root = shift;
+
+ print " bootstrap\n";
+
+ my %state;
+ $state{'old_root'} = $old_root;
+ $state{'new_root'} = $new_root;
+
+ my $rewrite = sub { my $state = shift; my $value = shift;
+ $value =~ s/$state->{'old_root'}/$state->{'new_root'}/g;
+ return $value; };
+ sed_file ("$new_root/bootstrap", $rewrite, \%state);
+ `chmod +x $new_root/bootstrap`;
+}
+
+for $a (@ARGV) {
+ if ($a eq '--help' || $a eq '-h') {
+ print "relocate: syntax\n";
+ print " relocate /path/to/new/ooo/source_root\n";
+ }
+}
+
+$OOO_BUILD = shift (@ARGV) || die "Pass path to relocated source tree";
+substr ($OOO_BUILD, 0, 1) eq '/' || die "relocate requires absolute paths";
+
+my $set;
+
+$set = sniff_set($OOO_BUILD) || die "Can't find env. set";
+$OLD_ROOT = find_old_root($OOO_BUILD, $set);
+
+print "Relocate: $OLD_ROOT -> $OOO_BUILD\n";
+
+print "re-writing environment:\n";
+
+rewrite_set($OOO_BUILD, $OLD_ROOT, $set);
+rewrite_bootstrap($OOO_BUILD, $OLD_ROOT);
+
+print "re-writing dependencies:\n";
+
+rewrite_dpcc($OOO_BUILD, $OLD_ROOT);
+
+print "done.\n";
diff --git a/solenv/bin/rmdir.pl b/solenv/bin/rmdir.pl
new file mode 100644
index 000000000000..8feb1603fb44
--- /dev/null
+++ b/solenv/bin/rmdir.pl
@@ -0,0 +1,46 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+my $r_code=0;
+if ( ! defined $ARGV[0] || "$ARGV[0]" eq "" ) {
+ print STDERR "Nothing to delete\n";
+ exit 1;
+}
+while ( defined $ARGV[0] ) {
+if ( rmdir $ARGV[0] ) {
+# exit 0;
+} else {
+ print STDERR "ERROR removing $ARGV[0]: $!\n";
+ $r_code = 1;
+}
+shift @ARGV;
+}
+exit $r_code;
+
diff --git a/solenv/bin/rpm-wrapper b/solenv/bin/rpm-wrapper
new file mode 100755
index 000000000000..f4234a9c5d89
--- /dev/null
+++ b/solenv/bin/rpm-wrapper
@@ -0,0 +1,49 @@
+#!/bin/bash
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+# At least on v20z-so3, when /so/env/bt_linux_libc2.11/DEV300/bin/rpm is called
+# and internally looks for a ld-linux.so.2, it picks up
+# /lib/tls/i686/cmov/ld-linux.so.2 and SIGSEGVs. This is prevented by
+# adding /so/env/bt_linux_libc2.11/DEV300/lib to the LD_LIBRARY_PATH, thus
+# picking up the ld-linux.so.2 from there:
+
+set -e
+if [ "$OUTPATH" = "unxlngi6" ]
+then
+LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${LIBRARY_PATH?} \
+ ${BUILD_TOOLS?}/rpmbuild "$@"
+else
+if [ "$OUTPATH" = "unxlngx6" ]
+then
+LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${LIBRARY_PATH?} \
+ ${BUILD_TOOLS?}/rpmbuild "$@"
+else
+LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${COMPATH?}/lib \
+ ${BUILD_TOOLS?}/rpm "$@"
+fi
+fi
diff --git a/solenv/bin/slfl.pl b/solenv/bin/slfl.pl
new file mode 100755
index 000000000000..638e15140718
--- /dev/null
+++ b/solenv/bin/slfl.pl
@@ -0,0 +1,176 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+# Description: Wrapper script to change '/' to '\' in command-line
+# arguments.
+
+#---------------------------------------------------------------------------
+# external modules
+use Text::ParseWords;
+
+# global vars
+@params = ();
+
+#---------------------------------------------------------------------------
+# procedures
+
+
+#----------------------------------------------------------
+# Function name: WinFormat
+# Description: Format variables to Windows Format.
+# Arguments: 1. Variable (string) with one token
+# Return value: Reformatted String
+#----------------------------------------------------------
+sub WinFormat {
+ my $variable = shift @_;
+
+ $variable =~ s!(.)/!$1\\!g; # Replace all but the leading slashes with backslashes
+
+ if ( defined $debug ) {
+ print(STDERR "WinFormat:\nresult:$variable\n");
+ }
+
+ return $variable;
+}
+
+#----------------------------------------------------------
+# Function name: replace_cyg
+# Description: Process all arguments and change them to Windows Format.
+# Arguments: Reference to array with arguments
+# Return value: -
+#----------------------------------------------------------
+sub replace_cyg {
+ my $args = shift;
+ my( @cmd_file, @cmd_temp );
+ my $atchars;
+ foreach my $para ( @$args ) {
+ if ( $para =~ "^@" ) {
+ # it's a command file
+ if ( defined $debug ) {
+ print(STDERR "----------------------------\n");
+ }
+ ;
+ # Workaround, iz28717, keep number of @'s.
+ $para =~ s/(^\@+)//;
+ $atchars = $1;
+ $filename = $para;
+ if ( defined $debug ) {
+ print(STDERR "filename = $filename \n");
+ }
+ ;
+ # open this command file for reading
+ open(CMD, "$filename");
+ while ( <CMD> ) {
+ # Remove DOS lineendings. Bug in Cygwin / Perl?
+ $_ =~ s/\r//g;
+ # Remove lineendings and trailing spaces. ( Needed by &parse_line )
+ $_ =~ s/\n$//g;
+ $_ =~ s/\s+$//g;
+ # Fill all tokens into array
+ @cmd_temp = &parse_line('\s+', 1, $_ );
+ if ( $#cmd_temp > -1 ) {
+ push( @cmd_file, @cmd_temp);
+ }
+ }
+ close(CMD);
+ # reformat all tokens
+ replace_cyg(\@cmd_file);
+ if ( defined $debug ) {
+ print(STDERR "Tokens processed:\n");
+ }
+ ;
+ foreach $i (@cmd_file) {
+ if ( defined $debug ) {
+ print(STDERR "!".$i."!\n");
+ }
+ ;
+ }
+ # open this filename for writing (truncate) Textmode?
+ open(CMD, '>', $filename);
+ # write all tokens back into this file
+ print(CMD join(' ', @cmd_file));
+ close(CMD);
+ # convert '@filename' to dos style
+ $para = WinFormat( $para );
+ if ( defined $debug ) {
+ print(STDERR "----------------------------\n");
+ }
+ ;
+ if ( (defined $debug_light) or (defined $debug) ) {
+ print(STDERR "\nParameter in File:".join(' ', @cmd_file).":\n");
+ }
+ $para = $atchars.$para;
+ } else {
+ # it's just a parameter
+ if ( defined $debug ) {
+ print(STDERR "\nParameter:---${para}---\n");
+ }
+ ;
+ # If $tmp1 is empty then $para is a parameter.
+ my $is_no_para = 1;
+ # remove .exe and convert to lower case
+ $shortcommand = lc $command ;
+ $shortcommand =~ s/\.exe$//;
+ $shortcommand =~ /([^\/]+$)/;
+ $shortcommand = $1;
+ if ( $is_no_para ) {
+ $para = WinFormat($para);
+ }
+ if ( defined $debug ) {
+ print(STDERR "Converted line:${para}:\n" );
+ }
+ } # else
+ } # foreach loop
+}
+
+
+#---------------------------------------------------------------------------
+# main
+@params = @ARGV;
+
+$command = shift(@params);
+
+while ( $command =~ /^-/ )
+{
+ if ( $command eq "-dbg" ) {
+ $debug="true";
+ }
+ elsif ( $command eq "-ldbg" ) {
+ $debug_light="true";
+ }
+
+ $command = shift(@params);
+}
+
+if ( (defined $debug_light) or (defined $debug) ) { print( STDERR "Command: $command\n" ); }
+
+replace_cyg(\@params);
+if ( (defined $debug_light) or (defined $debug) ) { print(STDERR "\n---------------------\nExecute: $command @params\n----------------\n");};
+exec( "$command", @params) or die( "\nError: slfl.pl: executing $command failed!\n" );
+
diff --git a/solenv/bin/soirpm.sh b/solenv/bin/soirpm.sh
new file mode 100755
index 000000000000..86f8a3e269fd
--- /dev/null
+++ b/solenv/bin/soirpm.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+#*************************************************************************
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+LIBRPMBUILD=$(find ${COMPATH} -name 'librpmbuild-4.1*' -print)
+# echo $(dirname $LIBRPMBUILD)
+LD_LIBRARY_PATH=$(dirname ${LIBRPMBUILD}) ${BUILD_TOOLS?}/rpm "$@"
+# LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${COMPATH?}/lib \
+# ${BUILD_TOOLS?}/rpm "$@"
diff --git a/solenv/bin/sort.pl b/solenv/bin/sort.pl
new file mode 100644
index 000000000000..b157ed119aa2
--- /dev/null
+++ b/solenv/bin/sort.pl
@@ -0,0 +1,50 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#
+# sort.pl - Simply sort the input from stdin and pipe it to stdout.
+# The sort needs to be *independent* of the settings of
+# LC_ALL resp. LC_COLLATE
+#
+
+use strict;
+# be explicit: we want the perl standard sorting regardless the locale
+no locale;
+
+
+my @buffer;
+
+while(<>) {
+ push(@buffer, $_);
+}
+
+foreach (sort @buffer) {
+ print $_;
+}
diff --git a/solenv/bin/subsequenttests b/solenv/bin/subsequenttests
new file mode 100755
index 000000000000..8b52f45a6b12
--- /dev/null
+++ b/solenv/bin/subsequenttests
@@ -0,0 +1,158 @@
+eval 'exec "$PERL" -Sw "$0" "$@"'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#***********************************************************************/
+
+use lib("$ENV{SOLARENV}/bin/modules");
+use SourceConfig;
+
+my $keep_going = 0;
+my $dry_run = 0;
+my $max_running = 1;
+while (@ARGV) {
+ my $arg = shift(@ARGV);
+ if ($arg =~ /^-P([1-9]\d*)$/) {
+ $max_running = $1;
+ } elsif ($arg eq '--') {
+ last;
+ } else {
+ my $n = substr($arg, 0, 1) eq '-' ? 1 : 0;
+ while ($n && $n < length($arg)) {
+ my $c = substr($arg, $n++, 1);
+ if ($c eq 'k') {
+ $keep_going = 1;
+ } elsif ($c eq 'n') {
+ $dry_run = 1;
+ } else {
+ $n = 0;
+ last;
+ }
+ }
+ if (!$n) {
+ print STDERR "unknown argument \"$arg\"\n";
+ print STDERR "usage: $0 [-kn] [-P<n>] [-- <args>]\n";
+ print STDERR " -k continue with other dmake invocations upon\n";
+ print STDERR " failure\n";
+ print STDERR " -n write directories that would be processed\n";
+ print STDERR " to standard output\n";
+ print STDERR " -P<n> number of parallel dmake invocations\n";
+ print STDERR " <args> are passed to dmake invocations\n";
+ exit(1);
+ }
+ }
+}
+
+my @testpaths = ();
+my $sc = SourceConfig->new($ENV{'SOLARSRC'});
+my $module;
+foreach $module ($sc->get_active_modules()) {
+ my $buildlst = $sc->get_module_build_list($module);
+ next unless defined($buildlst);
+ my %deps = ();
+ open(BUILDLST, $buildlst) or die("cannot open $buildlst");
+ while (<BUILDLST>) {
+ next unless
+ /^\s*\w+\s+(\S+)\s+nmake\s+-\s+all\s+(\S+)(\s+(:?\S+\s+)*)NULL\s*$/;
+ my ($dir, $id, $ids) = ($1, $2, $3);
+ $dir =~ s|\\|/|g;
+ $dir =~ s|^[^/]+||;
+ my $path = $sc->get_module_path($module) . $dir;
+ my $makefile = $path . '/makefile.mk';
+ open(MAKEFILE, $makefile) or die("cannot open $makefile");
+ while (<MAKEFILE>) {
+ if (/\bOOO_SUBSEQUENT_TESTS\b/) {
+ push(@testpaths, $path);
+ $deps{$id} = $ids;
+ last;
+ }
+ }
+ close(MAKEFILE);
+ }
+ close(BUILDLST);
+ my $id1;
+ foreach $id1 (keys(%deps)) {
+ my ($id2, $ids);
+ while (($id2, $ids) = each(%deps)) {
+ $ids !~ /\s\Q$id1\E\s/ or die("$module: $id2 depends on $id1");
+ }
+ }
+}
+
+if ($dry_run) {
+ foreach $path (@testpaths) {
+ print "$path\n";
+ }
+ exit(0);
+}
+
+my $cmd = 'dmake';
+foreach (@ARGV) {
+ s/'/'\''/g;
+ $cmd .= " '" . $_ . "'";
+}
+$cmd .= ' 2>&1 |';
+
+my %pids = ();
+my @failedpaths = ();
+my $running = 0;
+my $counter = 0;
+while (@testpaths || $running > 0) {
+ while (@testpaths && $running < $max_running) {
+ my $testpath = shift(@testpaths);
+ ++$counter;
+ print("$counter: make $testpath\n");
+ my $pid = fork();
+ defined($pid) or die("$counter: $!");
+ if ($pid == 0) {
+ chdir($testpath) or die("$counter: $!");
+ $ENV{'OOO_SUBSEQUENT_TESTS'} = 'TRUE';
+ open(OUTPUT, $cmd) or die("$counter: $!");
+ while (<OUTPUT>) {
+ s/\r?\n$//;
+ print("$counter: $_\n");
+ }
+ close(OUTPUT);
+ exit($? == 0 ? 0 : 1);
+ }
+ $pids{$pid} = $testpath;
+ ++$running;
+ }
+ my $pid = wait();
+ $pid != -1 or die($!);
+ my $testpath = delete($pids{$pid});
+ defined($testpath) or die("unmatched PID $pid");
+ if ($? != 0) {
+ push(@failedpaths, $testpath);
+ @testpaths = () unless $keep_going;
+ }
+ --$running;
+}
+my $failedpath;
+foreach $failedpath (@failedpaths) {
+ print STDERR "failed in $failedpath\n";
+}
+exit(scalar(@failedpaths) == 0 ? 0 : 1);
diff --git a/solenv/bin/touch.pl b/solenv/bin/touch.pl
new file mode 100644
index 000000000000..4c7719cbbbc4
--- /dev/null
+++ b/solenv/bin/touch.pl
@@ -0,0 +1,42 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+#
+# workaround for broken 4nt
+# internal touch command
+#
+
+foreach my $filename (@ARGV) {
+ open KKK, ">>$filename" or die "ERROR: cannot open $filename!\n";
+ $size=(stat($filename))[7];
+ print KKK "x";
+ truncate KKK, $size;
+ close KKK;
+}
+
diff --git a/solenv/bin/transform_description.pl b/solenv/bin/transform_description.pl
new file mode 100644
index 000000000000..87dcb21deb53
--- /dev/null
+++ b/solenv/bin/transform_description.pl
@@ -0,0 +1,138 @@
+#!/usr/bin/perl
+#*************************************************************************
+#*
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#************************************************************************/
+
+parse_args();
+execute_args();
+exit(0);
+
+my $source = undef;
+my $dest = undef;
+my @languages = undef;
+
+sub parse_args
+{
+ # at most two arguments
+ explain(), exit(100) if ( $#ARGV > 1 );
+
+ # destination file is the second argument, if present
+ $dest = $ARGV[1] if ( $#ARGV > 0 );
+
+ # source file is the first argument if present
+ if ( $#ARGV > -1 )
+ {
+ $source = $ARGV[0];
+ if ( ! -f $source )
+ {
+ print STDERR "$source is not a valid file, aborting";
+ exit(101);
+ }
+ }
+
+ # check which languages to use
+ my $languages = $ENV{WITH_LANG};
+ if ( ( ! defined $languages ) || ( "$languages" eq "" ) )
+ {
+ print STDERR "$0: WITH_LANG not set or empty, defaulting to 'en-US'\n";
+ $languages = "en-US";
+ }
+ @languages = split ( ' ', $languages );
+}
+
+sub execute_args
+{
+ my @description = ();
+ if ( defined $source )
+ {
+ open SOURCE, "$source" || die "could not open $source: $?\n";
+ @description = <SOURCE>;
+ close SOURCE;
+ }
+ else
+ {
+ @description = <STDIN>;
+ }
+
+ if ( defined $dest )
+ {
+ open DEST, ">$dest" || die "could not open $dest for writing: $?\n";
+ }
+
+ foreach (@description)
+ {
+ chomp; s/\r//;
+
+ if ( /\#LANG\#/ )
+ {
+ foreach $lang ( @languages )
+ {
+ my $transformed = $_;
+ $transformed =~ s/\#LANG#/$lang/g;
+ if ( defined $dest )
+ {
+ print DEST "$transformed\n";
+ }
+ else
+ {
+ print STDOUT "$transformed\n";
+ }
+ }
+ }
+ else
+ {
+ if ( defined $dest )
+ {
+ print DEST "$_\n";
+ }
+ else
+ {
+ print STDOUT "$_\n";
+ }
+ }
+ }
+
+ close DEST if ( defined $dest );
+}
+
+# explains the program's usage
+sub explain
+{
+ print STDOUT "usage:\n";
+ print STDOUT " $0 [<description_file> [<output_file>]]\n";
+ print STDOUT " transforms the given extension description file\n";
+ print STDOUT "\n";
+ print STDOUT " If <output_file> is not given, STDOUT is used.\n";
+ print STDOUT " If <description_file> is not given, STDIN is used.\n";
+ print STDOUT "\n";
+ print STDOUT " The following transformations are done at the moment:\n";
+ print STDOUT " - duplicate all lines containing #LANG#, for ever token of \$WITH_LANG\n";
+ print STDOUT " replacing every occurance of \$LANG with a token\n";
+ print STDOUT "\n";
+ print STDOUT " And yes, the functionality of this script should be\n";
+ print STDOUT " - moved to solenv/inc/tg_ext.mk\n";
+ print STDOUT " - implemented as XSLT, to be much less error-prone\n";
+}
diff --git a/solenv/bin/unxmap-to-macosx-explist.awk b/solenv/bin/unxmap-to-macosx-explist.awk
new file mode 100644
index 000000000000..b791d46a291c
--- /dev/null
+++ b/solenv/bin/unxmap-to-macosx-explist.awk
@@ -0,0 +1,63 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# Generate an exported symbols list out of a map file (as use on Linux/Solaris) in order to
+# build shared libraries on Mac OS X
+#
+# The below code fails may fail with 'perverted' mapfiles (using a strange line layout etc.)
+
+# Skip 'SECTION_NAME {' lines
+/^[\t ]*.*[\t ]*\{/ { next }
+
+# Skip 'global:' or 'local:' lines
+/global:/ || /local:/ { next }
+
+# Skip '*;' lines
+/^[\t ]*\*;[\t ]*/ { next }
+
+# Skip section end '}?;' lines
+/^[\t ]*\}[\t ]*.*[;]*/ { next }
+
+# Skip comment or empty lines
+/^[\t ]*#.*/ || /^[\t ]*$/ || /^$/ { next }
+
+# Echo all lines containing symbol names and prefix them with '_'
+# because symbols on Mac OS X start always with '__'
+{
+ # There may appear multiple symbols in one line
+ # e.g. "sym1; sym2; # and finally a comment"
+ # take this into account
+ for (i = 1; i <= NF ; i++) {
+ if ($i !~ /^[\t ]*#.*/) { # as long as the current field doesn't start with '#'
+ gsub(/[\t ;]/, "", $i) # Remove leading spaces and trailing ';'
+ printf("_%s\n",$i)
+ }
+ else { # ignore everything after a '#' (comment) sign
+ break
+ }
+ }
+}
diff --git a/solenv/bin/update_module_ignore_lists.pl b/solenv/bin/update_module_ignore_lists.pl
new file mode 100644
index 000000000000..88d73a0217d6
--- /dev/null
+++ b/solenv/bin/update_module_ignore_lists.pl
@@ -0,0 +1,255 @@
+:
+ eval 'exec perl -S $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+use Cwd;
+use File::Temp qw/ tempfile tempdir /;
+
+my $verbosity = 1; # will be adjusted to the value of $Env{VERBOSE} below
+
+# platforms which are not supported anymore, and thus can be filtered from the svn:ignore list
+my %obsolete_platforms = (
+ );
+ # (none so far)
+
+# platforms whose output trees should appear in all modules' svn:ignore list
+my @platforms = (
+ "common",
+ "unxlngi6",
+ "unxlngx6",
+ "unxsols4",
+ "unxsolu4",
+ "unxsoli4",
+ "wntmsci12",
+ "unxmacxi",
+ "unxubit8",
+ "unxaixp",
+ "unxbsda",
+ "unxbsdi2",
+ "unxbsdi",
+ "unxbsds",
+ "unxfbsdi",
+ "unxfbsd",
+ "unxfbsdx",
+ "unxhpgr",
+ "unxhpxr",
+ "unxirgm",
+ "unxirxm3",
+ "unxirxm",
+ "unxlnga",
+ "unxlngm68k",
+ "unxlngmips",
+ "unxlngp",
+ "unxlngppc4",
+ "unxlngppc64",
+ "unxlngppc",
+ "unxlngr",
+ "unxlngs3904",
+ "unxlngs390x",
+ "unxlngs",
+ "unxlnxi",
+ "unxmacxp",
+ "unxsogi",
+ "unxsogs"
+ );
+
+
+# .........................................................................
+# retrieves the repository URL of the SVN working copy in the current directory
+sub retrieve_repo_url
+{
+ open( SVN, "svn info 2>&1 |" );
+ my @result = <SVN>;
+ close( SVN );
+
+ foreach (@result)
+ {
+ chomp;
+ next if ( ! /^URL: / );
+ s/^URL: //;
+ return $_;
+ }
+ return undef;
+}
+
+# .........................................................................
+# gets the "modules" below the given SVN repository URL, by calling "svn list"
+sub get_modules
+{
+ my @modules = ();
+
+ open( SVN, "svn list $_ 2>&1 |" );
+ my @result = <SVN>;
+ close( SVN );
+
+ foreach (@result)
+ {
+ chomp;
+ s/\/$//;
+ push @modules, $_;
+ }
+
+ return @modules;
+}
+
+# .........................................................................
+sub set_ignore_property
+{
+ my ($repo_url, @modules) = @_;
+
+ # max length of a module name
+ my $max_len = 0;
+ foreach ( @modules ) { $max_len = length( $_ ) if ( length( $_ ) > $max_len ); }
+
+ my $updated = 0;
+
+ my $current = 0;
+ my $count = $#modules + 1;
+ foreach $module ( @modules )
+ {
+ ++$current;
+
+ # print progress
+ if ( $verbosity > 1 )
+ {
+ my $progress = "$module ";
+ $progress .= "(" . $current . "/" . $count . ")";
+
+ my $dots = 3 + ( $max_len - length($module) );
+ $dots += int( digits( $count ) ) - int( digits( $current ) );
+
+ $progress .= ( "." x $dots );
+ $progress .= " ";
+
+ print STDOUT $progress;
+ }
+ elsif ( $verbosity > 0 )
+ {
+ print STDOUT ".";
+ }
+
+ # retrieve the current ignore list
+ open( SVN, "svn propget svn:ignore $module 2>&1 |" );
+ my @ignore_list = <SVN>;
+ close( SVN );
+
+ # the last item in the list is an empty string, usually. Don't let it confuse the below
+ # code
+ my $supposed_empty = pop @ignore_list;
+ chomp( $supposed_empty );
+ push( @ignore_list, $supposed_empty ) if ( !( $supposed_empty =~ /^$/ ) );
+
+ # filter out obsolte entries
+ my @stripped_ignore_list = ();
+ foreach $ignore_entry (@ignore_list)
+ {
+ chomp( $ignore_entry );
+ next if ( $ignore_entry =~ /^$/ );
+
+ if ( ( exists $obsolete_platforms{$ignore_entry} )
+ || ( exists $obsolete_platforms{"$ignore_entry.pro"} )
+ )
+ {
+ next;
+ }
+ push @stripped_ignore_list, $ignore_entry;
+ }
+ my $removed = $#ignore_list - $#stripped_ignore_list;
+ @ignore_list = @stripped_ignore_list;
+
+ # append the platforms which should appear in the ignore list
+ my %ignore_list = ();
+ foreach (@ignore_list) { $ignore_list{$_} = 1; }
+ foreach $platform_entry ( @platforms )
+ {
+ $ignore_list{$platform_entry} = 1;
+ $ignore_list{"$platform_entry.pro"} = 1;
+ }
+ my @extended_ignore_list = keys %ignore_list;
+ my $added = $#extended_ignore_list - $#ignore_list;
+ @ignore_list = @extended_ignore_list;
+
+ if ( $removed || $added )
+ {
+ # create a temporary file taking the new content of the svn_ignore property
+ my $temp_dir = tempdir( CLEANUP => 1 );
+ my ($fh, $filename) = tempfile( DIR => $dir );
+ open( IGNORE, ">$filename" );
+ print IGNORE join "\n", @ignore_list;
+ close( IGNORE );
+
+ # actually set the property
+ open( SVN, "svn propset -F $filename svn:ignore $module 2>&1 |" );
+
+ ++$updated;
+ }
+
+ # statistics
+ print STDOUT "done (removed/added: $removed/$added)\n" if $verbosity > 1;
+ }
+
+ print STDOUT "\n" if $verbosity eq 1;
+ print STDOUT "$updated module(s) updated\n" if $verbosity > 0;
+}
+
+# .........................................................................
+sub digits
+{
+ my ($number, $base) = @_;
+ $base = 10 if !defined $base;
+ return log($number)/log($base);
+}
+
+# .........................................................................
+# 'main'
+
+# initialize verbosity
+my $verbose = $ENV{VERBOSE};
+if ( defined $verbose )
+{
+ $verbose = uc( $verbose );
+ $verbosity = 2 if ( $verbose eq "TRUE" );
+ $verbosity = 0 if ( $verbose eq "FALSE" );
+}
+
+# work on the current directory
+my $working_copy_root = cwd();
+die "current directory does not contain an SVN working copy" if !-d $working_copy_root . "/\.svn";
+
+# retrieve repository URL
+my $repo_url = retrieve_repo_url();
+die "unable to retrieve repository URL" if !defined $repo_url;
+print STDOUT "repository URL: $repo_url\n" if $verbosity > 1;
+
+# list modules
+my @modules = get_modules( $repo_url );
+print STDOUT "processing " . ( $#modules + 1 ) . " modules\n" if $verbosity > 0;
+
+# process modules, by setting the svn:ignore property
+set_ignore_property( $repo_url, @modules );
diff --git a/solenv/bin/zipdep.pl b/solenv/bin/zipdep.pl
new file mode 100755
index 000000000000..f19f79f00e52
--- /dev/null
+++ b/solenv/bin/zipdep.pl
@@ -0,0 +1,337 @@
+:
+eval 'exec perl -wS $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#
+# mapgen - generate a dependencies file for zip commando
+#
+use Cwd;
+
+#### script id #####
+
+( $script_name = $0 ) =~ s/^.*\b(\w+)\.pl$/$1/;
+
+$id_str = ' $Revision: 1.12 $ ';
+$id_str =~ /Revision:\s+(\S+)\s+\$/
+ ? ($script_rev = $1) : ($script_rev = "-");
+
+print STDERR "$script_name -- version: $script_rev\n";
+print STDERR "Multi Platform Enabled Edition\n";
+
+#########################
+# #
+# Globale Variablen #
+# #
+#########################
+
+$zip_file = '';
+$R = '';
+$r = '';
+$exclude = '';
+$include = '';
+@given_patterns = (); # patterns(files) list from command line
+%files_in_arch = ();
+@exc_patterns = (); # array of all patterns for files to be excluded
+@inc_patterns = (); # array of all patterns for files to be included
+%exc_files_hash = (); # hash of files to be excluded (according to @exc_patterns)
+%inc_files_hash = (); # hash of files to be included (according to @inc_patterns)
+$prefix = '';
+
+#### main ####
+
+&get_options;
+&get_zip_content;
+&write_zip_file;
+
+#### end of main procedure ####
+
+#########################
+# #
+# Procedures #
+# #
+#########################
+
+#
+# procedure writes zipdep file
+#
+sub write_zip_file {
+ my @dependencies = keys %files_in_arch;
+ if ($#dependencies != -1) {
+ print "\n". &convert_slashes($zip_file) . ' :';
+ foreach (@dependencies) {
+ next if (-d);
+ print " \\\n\t" . $prefix . &convert_slashes($_);
+ };
+ print "\n\n";
+ };
+};
+
+#
+# convert slashes
+#
+sub convert_slashes {
+ my $path = shift;
+ $path =~ s/\//\$\//g;
+ $path =~ s/\\/\$\//g;
+ return $path;
+};
+
+#
+# convert slashes to internal perl representation
+#
+sub perled_slashes {
+ my $path = shift;
+ $path =~ s/\\/\//g;
+ $path =~ s/\/+/\//g;
+ return $path;
+};
+
+#
+# Collect all files to zip in @patterns_array array
+#
+sub get_zip_content {
+ &get_zip_entries(\@given_patterns);
+ my $file_name = '';
+ foreach $file_name (keys %files_in_arch) {
+ if (-d $file_name) {
+ &get_dir_content($file_name, \%files_in_arch) if ($r || $R);
+ undef $files_in_arch{$file_name};
+ };
+ };
+ &remove_uncompliant(\@given_patterns) if ($R);
+ &get_patterns_files(\@exc_patterns, \%exc_files_hash) if ($exclude);
+ &get_patterns_files(\@inc_patterns, \%inc_files_hash) if ($include);
+ foreach my $file_name (keys %exc_files_hash) {
+ if (defined $files_in_arch{$file_name}) {
+ delete $files_in_arch{$file_name};
+ #print STDERR "excluded $file_name\n";
+ };
+ };
+ if ($include) {
+ foreach my $file_name (keys %files_in_arch) {
+ if (!(defined $inc_files_hash{$file_name})) {
+ delete $files_in_arch{$file_name};
+ };
+ };
+ }
+};
+
+#
+# Procedure removes from %files_in_arch all files which
+# are not compliant to patterns in @given_patterns
+#
+sub remove_uncompliant {
+ my $given_patterns = shift;
+ my @reg_exps = ();
+ my $pattern = '';
+ foreach $pattern (@$given_patterns) {
+ push(@reg_exps, &make_reg_exp($pattern));
+ };
+ # write file name as a value for the path(key)
+ foreach my $file (keys %files_in_arch) {
+ next if (-d $file);
+ #print "$file\n";
+ if ($file =~ /[\\ | \/](.+)$/) {
+ $files_in_arch{$file} = $1;
+ } else {
+ $files_in_arch{$file} = $file;
+ };
+ };
+ foreach $pattern (@reg_exps) {
+ foreach my $file (keys %files_in_arch) {
+ if (!($files_in_arch{$file} =~ /$pattern/)) {
+ delete $files_in_arch{$file};
+ #} else {
+ # print "Complient: $file\n";
+ };
+ };
+ };
+};
+
+#
+# Procedure adds/removes to/from %files_in_arch all files, that are
+# compliant to the patterns in array passed
+#
+sub get_zip_entries {
+ if ($R) {
+ opendir DIR, '.';
+ my @dir_content = readdir(DIR);
+ close DIR;
+ foreach my $file_name(@dir_content) {
+ $file_name =~ /^\.$/ and next;
+ $file_name =~ /^\.\.$/ and next;
+ $files_in_arch{$file_name}++;
+ #print "included $file_name\n";
+ };
+ } else {
+ my $patterns_array = shift;
+ my $pattern = '';
+ foreach $pattern (@$patterns_array) {
+ if ((-d $pattern) || (-f $pattern)) {
+ $files_in_arch{$pattern}++;
+ next;
+ }
+ my $file_name = '';
+ foreach $file_name (glob $pattern) {
+ #next if (!(-d $file_name) || !(-f $file_name));
+ $files_in_arch{$file_name}++;
+ };
+ };
+ }
+};
+
+#
+# Procedure converts given parameter to a regular expression
+#
+sub make_reg_exp {
+ my $arg = shift;
+ $arg =~ s/\\/\\\\/g;
+ $arg =~ s/\//\\\//g;
+ $arg =~ s/\./\\\./g;
+ $arg =~ s/\+/\\\+/g;
+ $arg =~ s/\{/\\\{/g;
+ $arg =~ s/\}/\\\}/g;
+ $arg =~ s/\*/\.\*/g;
+ $arg =~ s/\?/\./g;
+ #$arg = '/'.$arg.'/';
+ #print "Regular expression: $arg\n";
+ return $arg;
+};
+
+#
+# Procedure retrieves shell pattern and converts them into regular expressions
+#
+sub get_patterns {
+ my $patterns = shift;
+ my $arg = '';
+ while ($arg = shift @ARGV) {
+ $arg =~ /^-/ and unshift(@ARGV, $arg) and return;
+ if (!$zip_file) {
+ $zip_file = $arg;
+ next;
+ };
+ $arg = &make_reg_exp($arg);
+ push(@$patterns, $arg);
+ };
+};
+
+#
+# Get all options passed
+#
+sub get_options {
+ my ($arg);
+ &usage() && exit(0) if ($#ARGV == -1);
+ while ($arg = shift @ARGV) {
+ $arg = &perled_slashes($arg);
+ #print STDERR "$arg\n";
+ $arg =~ /^-R$/ and $R = 1 and next;
+ $arg =~ /^-r$/ and $r = 1 and next;
+ $arg =~ /^-x$/ and $exclude = 1 and &get_patterns(\@exc_patterns) and next;
+ $arg =~ /^-i$/ and $include = 1 and &get_patterns(\@inc_patterns) and next;
+ $arg =~ /^-prefix$/ and $prefix = shift @ARGV and next;
+ $arg =~ /^-b$/ and shift @ARGV and next;
+ $arg =~ /^-n$/ and shift @ARGV and next;
+ $arg =~ /^-t$/ and shift @ARGV and next;
+ $arg =~ /^-tt$/ and shift @ARGV and next;
+ $arg =~ /^-h$/ and &usage and exit(0);
+ $arg =~ /^--help$/ and &usage and exit(0);
+ $arg =~ /^-?$/ and &usage and exit(0);
+ if ($arg =~ /^-(\w)(\w+)$/) {
+ unshift (@ARGV, '-'.$1);
+ unshift (@ARGV, '-'.$2);
+ next;
+ };
+# just ignore other switches...
+ $arg =~ /^-(\w+)$/ and next;
+ $arg =~ /^\/\?$/ and &usage and exit(0);
+ $zip_file = $arg and next if (!$zip_file);
+ push(@given_patterns, $arg);
+ };
+ &print_error('error: Invalid command arguments (do not specify both -r and -R)') if ($r && $R);
+ if ($r && ($#given_patterns == -1)) {
+ &print_error('no list specified');
+ };
+};
+
+#
+# Procedure fills out passed hash with files from passed dir
+# compliant to the pattern from @$patterns
+#
+sub get_patterns_files {
+ my $patterns_array = shift;
+ my $files_hash = shift;
+ my @zip_files = keys %files_in_arch;
+ foreach my $pattern (@$patterns_array) {
+ my @fit_pattern = grep /$pattern/, @zip_files;
+ foreach my $entry (@fit_pattern) {
+ $$files_hash{$entry}++;
+ #print "$entry\n";
+ };
+ };
+};
+
+#
+# Get dir stuff to pack
+#
+sub get_dir_content {
+ my $dir = shift;
+ my $dir_hash_ref = shift;
+ my $entry = '';
+ if (opendir(DIR, $dir)) {
+ my @prj_dir_list = readdir(DIR);
+ closedir (DIR);
+ foreach $entry (@prj_dir_list) {
+ $entry =~ /^\.$/ and next;
+ $entry =~ /^\.\.$/ and next;
+
+ $entry = $dir . '/' . $entry;
+ # if $enry is a dir - read all its files,
+ # otherwise store $entry itself
+ if (-d $entry) {
+ &get_dir_content($entry, $dir_hash_ref);
+ } else {
+ $$dir_hash_ref{$entry}++;
+ };
+ };
+ };
+ return '1';
+};
+
+sub print_error {
+ my $message = shift;
+ print STDERR "\nERROR: $message\n";
+ exit (1);
+};
+
+sub usage {
+ print STDERR " zipdep [-aABcdDeEfFghjklLmoqrRSTuvVwXyz] [-b path]\n";
+ print STDERR " [-n suffixes] [-t mmddyyyy] [-tt mmddyyyy] [ zipfile [\n";
+ print STDERR " file1 file2 ...]] [-xi list]\n";
+}
+
diff --git a/solenv/config/sdev300.ini b/solenv/config/sdev300.ini
new file mode 100644
index 000000000000..ce459e176b77
--- /dev/null
+++ b/solenv/config/sdev300.ini
@@ -0,0 +1,3346 @@
+common
+{
+ environment
+ {
+ common
+ {
+ ADDED_MODULES solenv default_images custom_images ooo_custom_images external_images postprocess instset_native instsetoo_native smoketest_native smoketestoo_native
+ BIG_SVX TRUE
+ BMP_WRITES_FLAG TRUE
+ BUILD_SPECIAL TRUE
+ BUILD_STAX YES
+ BUILD_TYPE SO OOo EXT BINFILTER MORE_FONTS BSH CURL DICTIONARIES HSQLDB HUNSPELL HYPHEN MYTHES JPEG LIBXML2 LIBXMLSEC LPSOLVE MOZ NEON TWAIN PYTHON ZLIB SANE UNIXODBC X11_EXTENSIONS LIBWPD EPM ODK MSFONTEXTRACT MATHMLDTD BOOST MDDS EXPAT CRASHREP BERKELEYDB LIBXSLT SUN AGG GTK ICU SYSTRAY_GTK JAVAINSTALLER2 VIGRA OPENSSL JFREEREPORT APACHE_COMMONS TOMCAT REPORTBUILDER SDEXT SWEXT XPDF LUCENE REDLAND SAXON WRITER2LATEX NSS L10N GRAPHITE MYSQLCPPCONN MYSQLC CPPUNIT LIBTEXTCAT LIBTEXTCATDATA AFMS
+ CONFIG_PROJECT config_office
+ DIC_ALL TRUE
+ ENABLEUNICODE TRUE
+ ENABLE_AGG YES
+ ENABLE_CUPS TRUE
+ ENABLE_DIRECTX TRUE
+ ENABLE_FONTCONFIG TRUE
+ ENABLE_GTK TRUE
+ ENABLE_MEDIAWIKI YES
+ ENABLE_MINIMIZER YES
+ ENABLE_MYSQLC YES
+ ENABLE_NSS_MODULE YES
+ ENABLE_RANDR TRUE
+ ENABLE_REPORTBUILDER YES
+ ENABLE_SVCTAGS YES
+ ENABLE_VBA YES
+ ISERVER iserver.germany.sun.com
+ LU_HGFLAG ""
+ LU_NOSOURCE ""
+ LU_RFLAG ""
+ NEW_JAR_PACK TRUE
+ NO_REC_RES TRUE
+ OOODMAKEMODE YES
+ OOO_SHELL /bin/bash
+ PCLEAN_PATH xxx
+ RES_ENUS TRUE
+ RES_GER TRUE
+ rsc_once TRUE
+ SHIPDRIVE /so/install
+ STLPORT4 NO_STLPORT4
+ STLPORT_VER 400
+ WITH_FONTOOO YES
+ WITH_LDAP YES
+ wrapper_override_cc_wrapper TRUE
+ MAXPROC maxproc=15
+ XINERAMA_LINK dynamic
+ }
+ common:0 IF %UPDATER% == YES
+ {
+ DEFAULT_TO_ENGLISH_FOR_PACKING 1
+ DISABLE_SAL_DBGBOX 1
+ }
+ common:1 IF X%CWS_WORK_STAMP%X != XX
+ {
+ CWS_WORK_STAMP_EXT _%CWS_WORK_STAMP%
+ }
+ common:2 IF %UPDATER% == YES
+ {
+ WITH_LANG en-US de
+ BUILD_TYPE l10n
+ }
+ common:3 IF %UPDATER% != YES
+ {
+ }
+ crashdump
+ {
+ ENABLE_CRASHDUMP TRUE
+ }
+ hg
+ {
+ LU_HGFLAG hg_source
+ }
+ maxproc
+ {
+ MAXPROC maxproc=%MAXPROCESS%
+ }
+ minorext
+ {
+ UPDMINOREXT .%UPDMINOR%
+ }
+ nosource
+ {
+ LU_NOSOURCE no_source
+ }
+ pro:0 IF %UPDATER% == YES
+ {
+ product full
+ PROEXT .pro
+ PROFULLSWITCH product=full
+ WITH_LANG en-US de es fr hu it ja ko nl pl pt pt-BR ru sv th tr zh-CN zh-TW ar
+ }
+ pro:1 IF %UPDATER% != YES
+ {
+ product full
+ PROEXT .pro
+ PROFULLSWITCH product=full
+ }
+ r_only
+ {
+ LU_RFLAG r_only
+ }
+ tmp
+ {
+ SOL_TMP %SOL_TMP_DIR%
+ }
+ verbose
+ {
+ VERBOSE VERBOSE
+ }
+ }
+ extern
+ {
+ ENVROOT
+ PATH
+ SRC_ROOT
+ UPDATER
+ }
+ order minorext common:2 common:3 pro:0 pro:1 common common:0 cwsname common:1 tmp crashdump maxproc hg r_only nosource
+ reset
+ {
+ ALT_L10N_MODULE
+ ENVCFLAGS
+ HOMEDRIVE
+ HOMEPATH
+ JAVAHOME
+ JAVA_HOME
+ LU_HGFLAG
+ LU_NOSOURCE
+ LU_RFLAGS
+ MKDIRHIER
+ PROEXT
+ PROFULLSWITCH
+ SHIPDRIVE
+ SOLARSRC
+ SOLAR_JAVA
+ SPEW
+ STLPORT4
+ UPDMINOREXT
+ WITH_FONTOOO
+ WITH_LANG
+ }
+ restore
+ {
+ PATH
+ }
+ standlst
+ {
+ DRIVE_O %WORK_STAMP%/drives/o:/UnixVolume
+ DRIVE_S %WORK_STAMP%/drives/s:/UnixVolume
+ }
+ switches
+ {
+ crashdump
+ cwsname CWS_WORK_STAMP
+ envroot
+ hg
+ minorext
+ nosource
+ pro
+ maxproc MAXPROCESS
+ r_only
+ tmp SOL_TMP_DIR
+ verbose VERBOSE
+ }
+}
+finish
+{
+ environment
+ {
+ cap
+ {
+ SOLARSRC %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%
+ SOURCE_ROOT_DIR $expand(%SOLARSRC%/..)
+ }
+ cax
+ {
+ SOLARSRC %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%
+ SOURCE_ROOT_DIR $expand(%SOLARSRC%/..)
+ }
+ common_0:0 IF %OS% == MACOSX
+ {
+ ENABLE_GTK
+ SOLARINCLUDES -I%SOLARVERSION%$/%INPATH%$/inc%UPDMINOREXT% -I%SOLARENV%$/%OUTPATH%$/inc -I%SOLARENV%$/inc %SOLAREXTRAINC%
+ }
+ common_0:3 IF %SOLARINCLUDES% ==
+ {
+ SOLARINCLUDES -I%SOLARVERSION%$/%INPATH%$/inc%UPDMINOREXT% %PSDKINC% -I%COMPATH%$/include -I%SOLARENV%$/inc %SOLAREXTRAINC%
+ }
+ common_1
+ {
+ BISON_HAIRY %SOLARROOT%$/btools$/bison.hairy
+ BISON_SIMPLE %SOLARROOT%$/btools$/bison.simple
+ DPKG %BUILD_TOOLS%$/dpkg
+ OOO_JUNIT_JAR %SOLARROOT%$/btools$/junit-4.8.1.jar
+ PATH .$:$cp(%SOLARENV%$/bin)$:$cp(%COMMON_BUILD_TOOLS%)$:$cp(%BUILD_TOOLS%$/dmake412)$:$cp(%BUILD_TOOLS%)$:$cp(%COMMON_ENV_TOOLS%)$:$cp(%ENV_TOOLS%)$:$cp(%COMPATH%$/bin)$:$cp(%JDKPATH%)$:$cp(%PATHEXTRA%)$:%PATH%
+ PATH_SEPERATOR $;
+ SOLARINC -I%SOLAR_STLPATH% -I%SOLARVERSION%$/%INPATH%$/inc%UPDMINOREXT%$/external %SOLARINCLUDES%
+ SOLARLIB -L%SOLARVER%/%INPATH%/lib%UPDMINOREXT% %JDKLIBS% %SOLAREXTRALIB%
+ SOLARSRC %SRC_ROOT%
+ SOURCE_ROOT_DIR $expand(%SOLARSRC%/..)
+ ANT_HOME %COMMON_BUILD_TOOLS%$/apache-ant-1.7.1
+ DBGSV_INIT %SOLARENV%/bin/dbgsv.ini
+ WORKDIR %SOLARVERSION%/%INPATH%/workdir
+ OUTDIR %SOLARVERSION%/%INPATH%
+
+ }
+ common_2:0 IF X%CWS_WORK_STAMP%X == XX
+ {
+ MWS_BUILD TRUE
+ DELIVER_TO_ZIP TRUE
+ gb_MAKETARGET packmodule
+ }
+ common_a
+ {
+ *o: cd %SOLARSRC%
+ ALT_L10N_MODULE $expand(%SOLARSRC%/..)/sun/l10n_so
+ TARFILE_LOCATION %SOURCE_ROOT_DIR%/ext_sources
+ gb_REPOS %SOURCE_ROOT_DIR%/ooo %SOURCE_ROOT_DIR%/sun
+ gb_LOCALBUILDDIR %SOL_TMP%/gb_%CWS_WORK_STAMP%/%WORK_STAMP%
+ }
+ common_jre:0 IF %JREPATH% ==
+ {
+ HIER set
+ }
+ common_jre:1 IF %LD_LIBRARY_PATH% ==
+ {
+ PATH %PATH%$:$cp(%JREPATH%)
+ }
+ cwsname:0 IF X%SOURCE_ROOT_USED%X == XX
+ {
+ *build
+ *deliver
+ DMAKEROOT SOURCE_ROOT_not_used
+ SOLARINC SOURCE_ROOT_not_used
+ SOLARINCLUDE SOURCE_ROOT_not_used
+ SOLARSRC SOURCE_ROOT_not_used
+ SOLARVER SOURCE_ROOT_not_used
+ SOLARVERSION SOURCE_ROOT_not_used
+ SOLAR_SOURCE_ROOT SOURCE_ROOT_not_used
+ SO_GEN_ERROR Error - Using -cwsname without -sourceroot switch is harmful...
+ SO_GEN_ERROR2 ...resetting path to source tree
+ SRC_ROOT SOURCE_ROOT_not_used
+ }
+ cwsname:1 IF X%SOURCE_ROOT%X == XX
+ {
+ *build
+ *deliver
+ DMAKEROOT SOURCE_ROOT_not_set
+ SOLARINC SOURCE_ROOT_not_set
+ SOLARINCLUDE SOURCE_ROOT_not_set
+ SOLARSRC SOURCE_ROOT_not_set
+ SOLARVER SOURCE_ROOT_not_set
+ SOLARVERSION SOURCE_ROOT_not_set
+ SOLAR_SOURCE_ROOT SOURCE_ROOT_not_set
+ SO_GEN_ERROR Error - Using -cwsname without SOURCE_ROOT set is harmful...
+ SO_GEN_ERROR2 ...resetting path to source tree
+ SRC_ROOT SOURCE_ROOT_not_set
+ }
+ cwsname:2 IF X%UPDMINOR%X == XX
+ {
+ *build
+ *deliver
+ DMAKEROOT UPDMINOR_not_used
+ SOLARINC UPDMINOR_not_used
+ SOLARINCLUDE UPDMINOR_not_used
+ SOLARSRC UPDMINOR_not_used
+ SOLARVER UPDMINOR_not_used
+ SOLARVERSION UPDMINOR_not_used
+ SOLAR_SOURCE_ROOT UPDMINOR_not_used
+ SO_GEN_ERROR Error - Using -cwsname without -ver switch is harmful...
+ SO_GEN_ERROR2 ...resetting path to source tree
+ SRC_ROOT UPDMINOR_not_used
+ }
+ jdk14
+ {
+ CLASSPATH .$;%JAVA_HOME%$/jre$/lib$/rt.jar
+ ILIB %LIB%$;%JDKLIB%
+ LIB %LIB%$;%JDKLIB%
+ JAVA_TARGET_FLAG -target 1.4
+ }
+ jdk15
+ {
+ CLASSPATH .$;%JAVA_HOME%$/jre$/lib$/rt.jar
+ ILIB %LIB%$;%JDKLIB%
+ LIB %LIB%$;%JDKLIB%
+ JAVA_TARGET_FLAG -target 1.5
+ }
+ l10n
+ {
+ framework %L10N_framework%
+ L10N-framework %L10N_framework%
+ }
+ ojdk16
+ {
+ CLASSPATH .$;%JAVA_HOME%$/jre$/lib$/rt.jar
+ ILIB %LIB%$;%JDKLIB%
+ LIB %LIB%$;%JDKLIB%
+ JAVA_TARGET_FLAG -target 1.6
+ }
+ }
+ order cwsname:0 cwsname:1 cwsname:2 common_0:0 common_0:1 common_0:2 common_0:3 jdk14 jdk15 ojdk16 common_1 common_2:0 l10n common_jre:0 common_jre:1 cax cap common_a
+ switches
+ {
+ cwsname CWS_WORK_STAMP
+ }
+}
+unxfbsdi
+{
+ environment
+ {
+ bs_sourceroot
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT_USED TRUE
+ }
+ cap
+ {
+ COPYALL TRUE
+ COPY_PACKED TRUE
+ DEVROOT %SOL_TMP%$/r
+ PCLEAN_PATH %SOLARROOT%/etools
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ cax
+ {
+ COPYALL FALSE
+ DEVROOT %SOL_TMP%$/r
+ PCLEAN_PATH %SOL_TMP%$/r/etools
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ common
+ {
+ *build nice perl %SOLARENV%/bin/build.pl %PROFULLSWITCH%
+ *build_client nice perl %SOLARENV%/bin/build_client.pl
+ *copyprj perl %COMMON_ENV_TOOLS%/copyprj.pl
+ *deliver perl %SOLARENV%/bin/deliver.pl
+ *mkout perl %SOLARENV%/bin/mkout.pl
+ *r: cd %SOLARROOT%
+ *s: cd %SOLARVERSION%
+ *zipdep perl %SOLARENV%/bin/zipdep.pl
+ COPYPRJ perl %COMMON_ENV_TOOLS%/copyprj.pl
+ DELIVER perl %SOLARENV%/bin/deliver.pl
+ DMAKEROOT %SOLARENV%/inc/startup
+ LD_LIBRARY_PATH .:%SOLARVERSION%/%INPATH%/lib%UPDMINOREXT%:%COMPATH%/libexec
+ MKOUT perl %SOLARENV%/bin/mkout.pl
+ PATHEXTRA %combin%:/usr/bin:/bin:/usr/sbin:/etc:/usr/bin/X11
+ SOLAREXTRAINC -I%SOLAR_STLPATH% -I%SYSBASE%/usr/include -I%SYSBASE%/usr/include/X11
+ SOLAREXTRALIB -L../lib -L%SYSBASE%/usr/X11R6/lib -L%SYSBASE%/usr/lib -L/usr/X11R6/lib -L%SOLAR_STLLIBPATH%
+ SOLAR_JAVA TRUE
+ ZIPDEP perl %SOLARENV%/bin/zipdep.pl
+ ENABLE_GCONF TRUE
+ ENABLE_GNOMEVFS TRUE
+ }
+ common0
+ {
+ SOLAR_ENV_ROOT /so/env
+ SOLAR_SOURCE_ROOT %DRIVE_O%
+ }
+ common1
+ {
+ COMPATH %SOLAR_ENV_ROOT%$/gcc_3.0.1_linux_libc2.11_turbolinux
+ DEVROOT %SOLAR_ENV_ROOT%
+ PKGFORMAT some_dummy
+ SHARED_SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv
+ SHARED_SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv
+ SOLARROOT %SOLAR_ENV_ROOT%
+ SOLARVER %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLAR_JDK13PATH %SOLAR_ENV_ROOT%/Linux_JDK_1.3.1
+ SOLAR_JDK14PATH %SOLAR_ENV_ROOT%/Linux_JDK_1.4.2_11
+ SOLAR_JDK15PATH %SOLAR_ENV_ROOT%/Linux_JDK_1.5.0_06
+ SO_PACK %SOLAR_ENV_ROOT%/pack/%WORK_STAMP%
+ SRC_ROOT %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%
+ }
+ common2
+ {
+ BUILD_TOOLS %SOLARROOT%/bt_unxfbsdi/bin
+ COM GCC
+ COMMON_BUILD_TOOLS %SOLARROOT%$/btools
+ COMMON_ENV_TOOLS %SOLARROOT%$/etools
+ CPU I
+ CPUNAME INTEL
+ CVER C300
+ ENV_TOOLS %SOLARROOT%/et_unxfbsdi/bin
+ GUI UNX
+ GUIBASE unx
+ GVER VCL
+ INPATH unxfbsdi%PROEXT%
+ JDK13PATH %SOLAR_JDK13PATH%
+ JDK14PATH %SOLAR_JDK14PATH%
+ JDK15PATH %SOLAR_JDK15PATH%
+ NO_BSYMBOLIC True
+ OS FREEBSD
+ OUTPATH unxfbsdi
+ SOLAR_STLLIBPATH %SOLARVERSION%$/unxfbsdi%PROEXT%$/lib%UPDMINOREXT%
+ SOLAR_STLPATH %SOLARVERSION%$/unxfbsdi%PROEXT%$/inc%UPDMINOREXT%$/stl
+ SYSBASE %SOLAR_SYSBASE_ROOT%
+ TEMP /tmp
+ TMP /tmp
+ }
+ compath
+ {
+ COMPATH %STAR_COMPATH%
+ }
+ debug
+ {
+ LD_LIBRARY_PATH %SOLARROOT%/solenv/unxlngi4/lib/debug:%LD_LIBRARY_PATH%
+ }
+ distroot:0 if X%DIST_ROOT%X != XX
+ {
+ SHARED_SOLARVERSION %DIST_ROOT%/%WORK_STAMP%
+ SOLARVER %DIST_ROOT%/%WORK_STAMP%
+ SOLARVERSION %DIST_ROOT%/%WORK_STAMP%
+ }
+ envroot:0 IF X%ENV_ROOT%X != XX
+ {
+ SOLAR_ENV_ROOT %ENV_ROOT%
+ }
+ jdk14
+ {
+ JAVA_HOME %JDK14PATH%
+ JDKINC %JDK14PATH%/include:%JDK14PATH%/include/linux
+ JDKINCS -I%JDK14PATH%/include -I%JDK14PATH%/include/linux
+ JDKLIB %JDK14PATH%/jre/lib:%JDK14PATH%/jre/lib/i386:%JDK14PATH%/jre/lib/i386/client
+ JDKLIBS -L%JDK14PATH%/jre/lib -L%JDK14PATH%/jre/lib/i386 -L%JDK14PATH%/jre/lib/i386/client
+ JDKPATH %JDK14PATH%/bin
+ JDK_VERSION 142
+ XCLASSPATH .:%JDK14PATH%/jre/lib/rt.jar
+ }
+ jdk14path:0 IF X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK14PATH %JDK_PATH%
+ }
+ jdk15
+ {
+ JAVA_HOME %JDK15PATH%
+ JDKINC %JDK15PATH%/include:%JDK15PATH%/include/linux
+ JDKINCS -I%JDK15PATH%/include -I%JDK15PATH%/include/linux
+ JDKLIB %JDK15PATH%/jre/lib:%JDK15PATH%/jre/lib/i386:%JDK15PATH%/jre/lib/i386/client
+ JDKLIBS -L%JDK15PATH%/jre/lib -L%JDK15PATH%/jre/lib/i386 -L%JDK15PATH%/jre/lib/i386/client
+ JDKPATH %JDK15PATH%/bin
+ JDK_VERSION 150
+ XCLASSPATH .:%JDK15PATH%/jre/lib/rt.jar
+ }
+ jdk15path:0 IF X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK15PATH %JDK_PATH%
+ }
+ pro
+ {
+ PROSWITCH -DPRODUCT
+ }
+ sourceroot:0 IF X%SOURCE_ROOT%X != XX
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT%
+ SOURCE_ROOT_USED TRUE
+ }
+ sysbaseroot
+ {
+ SOLAR_SYSBASE_ROOT %SYSBASE_ROOT%
+ }
+ }
+ extern
+ {
+ DIST_ROOT
+ ENV_ROOT
+ HOME
+ JDK_PATH
+ LOCALINI
+ SOL_TMP
+ SOURCE_ROOT
+ SYSBASE_ROOT
+ USER
+ }
+ order common0 bs_sourceroot envroot:0 sourceroot:0 sysbaseroot common1 jdk14path:0 jdk15path:0 distroot:0 cap cax compath common2 pro common jdk14 jdk15 debug
+ reset
+ {
+ CLASSPATH
+ COPYALL
+ }
+ restore
+ {
+ INCLUDE
+ }
+ script
+ {
+ csh
+ {
+ 400: if ( ${?COPYALL} ) $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 600: umask 002
+ 800: rehash
+ 820: wrapfetch.sh
+ 850: if ( "$?SO_GEN_ERROR" == 0 ) setenv SO_GEN_ERROR
+ 851: if ( "$?SO_GEN_ERROR2" == 0 ) setenv SO_GEN_ERROR2
+ 900: if ( "$?SO_GEN_ERROR" == 1 ) echo $SO_GEN_ERROR
+ 901: if ( "$?SO_GEN_ERROR2" == 1 ) echo $SO_GEN_ERROR2
+ }
+ sh
+ {
+ 400: if [ $COPYALL ]; then
+ 410: $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 415: fi
+ 600: umask 002
+ 800: hash -r
+ 820: wrapfetch.sh
+ 850: if [ "0$SO_GEN_ERROR" -eq 0 ]; then
+ 851: export SO_GEN_ERROR
+ 852: fi
+ 860: if [ "0$SO_GEN_ERROR2" -eq 0 ]; then
+ 861: export SO_GEN_ERROR2
+ 862: fi
+ 870: if [ "0$SO_GEN_ERROR" -ne 0 ]; then
+ 871: echo $SO_GEN_ERROR
+ 872: fi
+ 880: if [ "0$SO_GEN_ERROR2" -ne 0 ]; then
+ 881: echo $SO_GEN_ERROR2
+ 882: fi
+ }
+ }
+ switches
+ {
+ bs_sourceroot SOURCE_ROOT_TMP
+ bsclient
+ cap
+ cax
+ compath STAR_COMPATH
+ debug
+ distroot
+ envroot
+ jdk14
+ jdk14path
+ jdk15
+ jdk15path
+ l10n L10N_framework
+ pro
+ sourceroot
+ sysbaseroot
+ }
+}
+unxlngi6
+{
+ environment
+ {
+ bs_sourceroot
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT_USED TRUE
+ }
+ cap
+ {
+ COPYALL TRUE
+ COPY_PACKED TRUE
+ DEVROOT %SOL_TMP%$/r
+ PCLEAN_PATH %SOLARROOT%/etools
+ PERL %SOL_TMP%$/r$/bt_linux_libc2.5$/%WORK_STAMP%$/bin$/perl
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ cax
+ {
+ COPYALL FALSE
+ DEVROOT %SOL_TMP%$/r
+ PCLEAN_PATH %SOL_TMP%$/r/etools
+ PERL %SOL_TMP%$/r$/bt_linux_libc2.5$/%WORK_STAMP%$/bin$/perl
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ common
+ {
+ *build nice %PERL% %SOLARENV%/bin/build.pl %PROFULLSWITCH%
+ *build_client nice %PERL% %SOLARENV%/bin/build_client.pl
+ *copyprj %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ *deliver %PERL% %SOLARENV%/bin/deliver.pl
+ *mkout %PERL% %SOLARENV%/bin/mkout.pl
+ *r: cd %SOLARROOT%
+ *s: cd %SOLARVERSION%
+ *zipdep %PERL% %SOLARENV%/bin/zipdep.pl
+ COPYPRJ %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ DELIVER %PERL% %SOLARENV%/bin/deliver.pl
+ DMAKEROOT %SOLARENV%/inc/startup
+ HAVE_GCC_VISIBILITY_FEATURE TRUE
+ HAVE_LD_BSYMBOLIC_FUNCTIONS TRUE
+ HAVE_LD_HASH_STYLE TRUE
+ LIBRARY_PATH %SYSBASE%/usr/lib
+ MKOUT %PERL% %SOLARENV%/bin/mkout.pl
+ PATHEXTRA %combin%:/usr/bin:/bin:/usr/sbin:/etc:/usr/bin/X11
+ FREETYPE_CFLAGS -I%SYSBASE%/usr/include/freetype2
+ SOLAREXTRAINC -I%SOLAR_STLPATH% -I%SYSBASE%/usr/include -I%SYSBASE%/usr/include/X11 -I%SYSBASE%/include
+ SOLAREXTRALIB -L../lib -L%SYSBASE%/usr/X11R6/lib -L%SYSBASE%/usr/lib -L/usr/X11R6/lib -L%SOLAR_STLLIBPATH%
+ SOLAR_JAVA TRUE
+ ZIPDEP %PERL% %SOLARENV%/bin/zipdep.pl
+ ENABLE_GCONF TRUE
+ ENABLE_GNOMEVFS TRUE
+ GNUCOPY cp
+ }
+ common0
+ {
+ SOLAR_ENV_ROOT /so/env
+ SOLAR_SOURCE_ROOT %DRIVE_O%
+ SOLAR_SYSBASE_ROOT /so/env/gcc_4.2.3_linux_libc2.5/glibc2.5
+ }
+ common1
+ {
+ COMPATH %SOLAR_ENV_ROOT%$/gcc_4.2.3_linux_libc2.5
+ DEVROOT %SOLAR_ENV_ROOT%
+ LFS_CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+ PERL %SOLAR_ENV_ROOT%/bt_linux_libc2.5/%WORK_STAMP%/bin/perl
+ PKGFORMAT rpm
+ SHARED_SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv
+ SHARED_SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv
+ SOLARROOT %SOLAR_ENV_ROOT%
+ SOLARVER %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLAR_JDK13PATH %SOLAR_ENV_ROOT%/Linux_JDK_1.3.1
+ SOLAR_JDK14PATH %SOLAR_ENV_ROOT%/Linux_JDK_1.4.2_11
+ SOLAR_JDK15PATH %SOLAR_ENV_ROOT%/Linux_JDK_1.5.0_06
+ SOLAR_OJDK16PATH %SOLAR_ENV_ROOT%/openjdk-6-b08-linux-i586
+ SO_PACK %SOLAR_ENV_ROOT%/pack/%WORK_STAMP%
+ SRC_ROOT %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%
+ PKG_CONFIG_LIBDIR %SOLAR_SYSBASE_ROOT%/usr/lib/pkgconfig
+ }
+ common2
+ {
+ ENABLE_GRAPHITE TRUE
+ ENABLE_GSTREAMER TRUE
+ BUILD_TOOLS %SOLARROOT%/bt_linux_libc2.5/%WORK_STAMP%/bin
+ COM GCC
+ COMMON_BUILD_TOOLS %SOLARROOT%$/btools
+ COMMON_ENV_TOOLS %SOLARROOT%$/etools
+ CPU I
+ CPUNAME INTEL
+ CVER C432
+ ENABLE_KAB TRUE
+ ENABLE_KDE TRUE
+ ENABLE_EVOAB2 TRUE
+ ENV_TOOLS %SOLARROOT%/et_linux_libc2.5/%WORK_STAMP%/bin
+ GUI UNX
+ GUIBASE unx
+ GVER VCL
+ INPATH unxlngi6%PROEXT%
+ JDK13PATH %SOLAR_JDK13PATH%
+ JDK14PATH %SOLAR_JDK14PATH%
+ JDK15PATH %SOLAR_JDK15PATH%
+ KDE_ROOT /so/env/kde/linux/kde-3.2.2
+ LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxlngi6
+ NO_BSYMBOLIC True
+ OJDK16PATH %SOLAR_OJDK16PATH%
+ OS LINUX
+ OUTPATH unxlngi6
+ RPM %SOLARENV%/bin/rpm-wrapper
+ SOLAR_STLLIBPATH %SOLARVERSION%$/unxlngi6%PROEXT%$/lib%UPDMINOREXT%
+ SOLAR_STLPATH %SOLARVERSION%$/unxlngi6%PROEXT%$/inc%UPDMINOREXT%$/stl
+ SYSBASE %SOLAR_SYSBASE_ROOT%
+ TEMP /tmp
+ TMP /tmp
+ }
+ common3:0 IF X%UPDATER%X == XX
+ {
+ FORCE2ARCHIVE TRUE
+ }
+ compath
+ {
+ COMPATH %STAR_COMPATH%
+ }
+ distroot:0 if X%DIST_ROOT%X != XX
+ {
+ SHARED_SOLARVERSION %DIST_ROOT%/%WORK_STAMP%
+ SOLARVER %DIST_ROOT%/%WORK_STAMP%
+ SOLARVERSION %DIST_ROOT%/%WORK_STAMP%
+ }
+ envroot:0 IF X%ENV_ROOT%X != XX
+ {
+ SOLAR_ENV_ROOT %ENV_ROOT%
+ }
+ jdk14
+ {
+ JAVA_HOME %JDK14PATH%
+ JDKINC %JDK14PATH%/include:%JDK14PATH%/include/linux
+ JDKINCS -I%JDK14PATH%/include -I%JDK14PATH%/include/linux
+ JDKLIB %JDK14PATH%/jre/lib:%JDK14PATH%/jre/lib/i386:%JDK14PATH%/jre/lib/i386/client
+ JDKLIBS -L%JDK14PATH%/jre/lib -L%JDK14PATH%/jre/lib/i386 -L%JDK14PATH%/jre/lib/i386/client
+ JDKPATH %JDK14PATH%/bin
+ JDK_VERSION 142
+ XCLASSPATH .:%JDK14PATH%/jre/lib/rt.jar
+ }
+ jdk14path:0 IF X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK14PATH %JDK_PATH%
+ }
+ jdk15
+ {
+ JAVA_HOME %JDK15PATH%
+ JDKINC %JDK15PATH%/include:%JDK15PATH%/include/linux
+ JDKINCS -I%JDK15PATH%/include -I%JDK15PATH%/include/linux
+ JDKLIB %JDK15PATH%/jre/lib:%JDK15PATH%/jre/lib/i386:%JDK15PATH%/jre/lib/i386/client:%JDK15PATH%/jre/lib/i386/xawt
+ JDKLIBS -L%JDK15PATH%/jre/lib -L%JDK15PATH%/jre/lib/i386 -L%JDK15PATH%/jre/lib/i386/client
+ JDKPATH %JDK15PATH%/bin
+ JDK_VERSION 150
+ XCLASSPATH .:%JDK15PATH%/jre/lib/rt.jar
+ }
+ jdk15path:0 IF X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK15PATH %JDK_PATH%
+ }
+ ojdk16
+ {
+ JAVA_HOME %OJDK16PATH%
+ JDKINC %OJDK16PATH%/include:%OJDK16PATH%/include/linux
+ JDKINCS -I%OJDK16PATH%/include -I%OJDK16PATH%/include/linux
+ JDKLIB %OJDK16PATH%/jre/lib:%OJDK16PATH%/jre/lib/i386:%OJDK16PATH%/jre/lib/i386/client:%OJDK16PATH%/jre/lib/i386/xawt
+ JDKLIBS -L%OJDK16PATH%/jre/lib -L%OJDK16PATH%/jre/lib/i386 -L%OJDK16PATH%/jre/lib/i386/client
+ JDKPATH %OJDK16PATH%/bin
+ JDK_VERSION 160
+ XCLASSPATH .:%OJDK16PATH%/jre/lib/rt.jar
+ }
+ ojdk16path:0 IF X%JDK_PATH%X != XX
+ {
+ SOLAR_OJDK16PATH %JDK_PATH%
+ }
+ pro
+ {
+ PROSWITCH -DPRODUCT
+ }
+ sourceroot:0 IF X%SOURCE_ROOT%X != XX
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT%
+ SOURCE_ROOT_USED TRUE
+ }
+ sysbaseroot
+ {
+ SOLAR_SYSBASE_ROOT %SYSBASE_ROOT%
+ }
+ }
+ extern
+ {
+ DIST_ROOT
+ ENV_ROOT
+ HOME
+ JDK_PATH
+ LOCALINI
+ SOL_TMP
+ SOURCE_ROOT
+ SYSBASE_ROOT
+ USER
+ }
+ order common0 bs_sourceroot envroot:0 sourceroot:0 sysbaseroot common1 jdk14path:0 jdk15path:0 ojdk16path:0 distroot:0 cap cax compath common2 pro common3:0 common jdk14 jdk15 ojdk16
+ reset
+ {
+ CLASSPATH
+ COPYALL
+ }
+ restore
+ {
+ INCLUDE
+ }
+ script
+ {
+ csh
+ {
+ 400: if ( ${?COPYALL} ) $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 600: umask 002
+ 800: rehash
+ 820: wrapfetch.sh
+ 850: if ( "$?SO_GEN_ERROR" == 0 ) setenv SO_GEN_ERROR
+ 851: if ( "$?SO_GEN_ERROR2" == 0 ) setenv SO_GEN_ERROR2
+ 900: if ( "$?SO_GEN_ERROR" == 1 ) echo $SO_GEN_ERROR
+ 901: if ( "$?SO_GEN_ERROR2" == 1 ) echo $SO_GEN_ERROR2
+ }
+ sh
+ {
+ 400: if [ $COPYALL ]; then
+ 410: $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 415: fi
+ 600: umask 002
+ 800: hash -r
+ 820: wrapfetch.sh
+ 850: if [ "0$SO_GEN_ERROR" -eq 0 ]; then
+ 851: export SO_GEN_ERROR
+ 852: fi
+ 860: if [ "0$SO_GEN_ERROR2" -eq 0 ]; then
+ 861: export SO_GEN_ERROR2
+ 862: fi
+ 870: if [ "0$SO_GEN_ERROR" -ne 0 ]; then
+ 871: echo $SO_GEN_ERROR
+ 872: fi
+ 880: if [ "0$SO_GEN_ERROR2" -ne 0 ]; then
+ 881: echo $SO_GEN_ERROR2
+ 882: fi
+ }
+ }
+ switches
+ {
+ bs_sourceroot SOURCE_ROOT_TMP
+ bsclient
+ cap
+ cax
+ compath STAR_COMPATH
+ debug
+ distroot
+ envroot
+ jdk14
+ jdk14path
+ jdk15
+ jdk15path
+ l10n L10N_framework
+ ojdk16
+ ojdk16path
+ pro
+ sourceroot
+ sysbaseroot
+ }
+}
+
+unxlngx6
+{
+ environment
+ {
+ bs_sourceroot
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT_USED TRUE
+ }
+ cap
+ {
+ COPYALL TRUE
+ COPY_PACKED TRUE
+ DEVROOT %SOL_TMP%$/r
+ PCLEAN_PATH %SOLARROOT%/etools
+ PERL %SOL_TMP%$/r$/bt_linux64_libc2.5$/%WORK_STAMP%$/bin$/perl
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ cax
+ {
+ COPYALL FALSE
+ DEVROOT %SOL_TMP%$/r
+ PCLEAN_PATH %SOL_TMP%$/r/etools
+ PERL %SOL_TMP%$/r$/bt_linux64_libc2.5$/%WORK_STAMP%$/bin$/perl
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ common
+ {
+ *build nice %PERL% %SOLARENV%/bin/build.pl %PROFULLSWITCH%
+ *build_client nice %PERL% %SOLARENV%/bin/build_client.pl
+ *copyprj %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ *deliver %PERL% %SOLARENV%/bin/deliver.pl
+ *mkout %PERL% %SOLARENV%/bin/mkout.pl
+ *r: cd %SOLARROOT%
+ *s: cd %SOLARVERSION%
+ *zipdep %PERL% %SOLARENV%/bin/zipdep.pl
+ COPYPRJ %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ DELIVER %PERL% %SOLARENV%/bin/deliver.pl
+ DMAKEROOT %SOLARENV%/inc/startup
+ HAVE_GCC_VISIBILITY_FEATURE TRUE
+ HAVE_LD_BSYMBOLIC_FUNCTIONS TRUE
+ HAVE_LD_HASH_STYLE TRUE
+ LIBRARY_PATH %SYSBASE%/usr/lib64
+ MKOUT %PERL% %SOLARENV%/bin/mkout.pl
+ PATHEXTRA %combin%:/usr/bin:/bin:/usr/sbin:/etc:/usr/bin/X11
+ FREETYPE_CFLAGS -I%SYSBASE%/usr/include/freetype2
+ SOLAREXTRAINC -I%SOLAR_STLPATH% -I%SYSBASE%/usr/include -I%SYSBASE%/usr/include/X11 -I%SYSBASE%/include
+ SOLAREXTRALIB -L../lib64 -L%SYSBASE%/usr/lib64 -L%SOLAR_STLLIBPATH%
+ SOLAR_JAVA TRUE
+ ZIPDEP %PERL% %SOLARENV%/bin/zipdep.pl
+ ENABLE_GCONF TRUE
+ ENABLE_GNOMEVFS TRUE
+ }
+ common0
+ {
+ SOLAR_ENV_ROOT /so/env
+ SOLAR_SOURCE_ROOT %DRIVE_O%
+ SOLAR_SYSBASE_ROOT /so/env/gcc_4.2.3_linux64_libc2.5/glibc2.5
+ }
+ common1
+ {
+ COMPATH %SOLAR_ENV_ROOT%$/gcc_4.2.3_linux64_libc2.5
+ DEVROOT %SOLAR_ENV_ROOT%
+ PERL %SOLAR_ENV_ROOT%/bt_linux64_libc2.5/%WORK_STAMP%/bin/perl
+ PKGFORMAT rpm
+ SHARED_SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv
+ SHARED_SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv
+ SOLARROOT %SOLAR_ENV_ROOT%
+ SOLARVER %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLAR_JDK14PATH %SOLAR_ENV_ROOT%/Linux_JDK_1.4.2.32
+ SOLAR_JDK15PATH %SOLAR_ENV_ROOT%/Linux_JDK_1.5.0_15.x64
+ SOLAR_OJDK16PATH %SOLAR_ENV_ROOT%/openjdk-6-b08-linux-amd64
+ SO_PACK %SOLAR_ENV_ROOT%/pack/%WORK_STAMP%
+ SRC_ROOT %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%
+ USE_SYSTEM_STL YES
+ XAU_LIBS -lXau
+ PKG_CONFIG_LIBDIR %SOLAR_SYSBASE_ROOT%/usr/lib/pkgconfig
+ }
+ common2
+ {
+ PKG_CONFIG_PATH %COMPATH%/glibc2.5/usr/lib64/pkgconfig
+ ENABLE_GRAPHITE TRUE
+ ENABLE_GSTREAMER TRUE
+ BUILD_TOOLS %SOLARROOT%/bt_linux64_libc2.5/%WORK_STAMP%/bin
+ COM GCC
+ COMMON_BUILD_TOOLS %SOLARROOT%$/btools
+ COMMON_ENV_TOOLS %SOLARROOT%$/etools
+ CPU X
+ CPUNAME INTEL
+ CVER C341
+ ENABLE_KAB TRUE
+ ENABLE_KDE TRUE
+ ENV_TOOLS %SOLARROOT%/et_linux64_libc2.5/%WORK_STAMP%/bin
+ GUI UNX
+ GUIBASE unx
+ GUIENV sal
+ GVER VCL
+ INPATH unxlngx6%PROEXT%
+ JDK14PATH %SOLAR_JDK14PATH%
+ JDK15PATH %SOLAR_JDK15PATH%
+ KDE_ROOT /so/env/kde/linux-x64/kde-3.5.10
+ LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxlngx6
+ NO_BSYMBOLIC True
+ OJDK16PATH %SOLAR_OJDK16PATH%
+ OS LINUX
+ OUTPATH unxlngx6
+ PA_VER 18
+ RPM %SOLARENV%/bin/rpm-wrapper
+ SOLARUPD %UPD%
+ SOLAR_STLLIBPATH %SOLARVERSION%$/unxlngx6%PROEXT%$/lib%UPDMINOREXT%
+ SOLAR_STLPATH %SOLARVERSION%$/unxlngx6%PROEXT%$/inc%UPDMINOREXT%$/stl
+ SYSBASE %SOLAR_SYSBASE_ROOT%
+ TEMP /tmp
+ TMP /tmp
+ }
+ common3:0 IF X%UPDATER%X == XX
+ {
+ FORCE2ARCHIVE TRUE
+ }
+ compath
+ {
+ COMPATH %STAR_COMPATH%
+ }
+ distroot:0 if X%DIST_ROOT%X != XX
+ {
+ SHARED_SOLARVERSION %DIST_ROOT%/%WORK_STAMP%
+ SOLARVER %DIST_ROOT%/%WORK_STAMP%
+ SOLARVERSION %DIST_ROOT%/%WORK_STAMP%
+ }
+ envroot:0 IF X%ENV_ROOT%X != XX
+ {
+ SOLAR_ENV_ROOT %ENV_ROOT%
+ }
+ jdk14
+ {
+ JAVA_HOME %JDK15PATH%
+ JDKINC %JDK15PATH%/include:%JDK15PATH%/include/linux
+ JDKINCS -I%JDK15PATH%/include -I%JDK15PATH%/include/linux
+ JDKLIB %JDK15PATH%/jre/lib:%JDK15PATH%/jre/lib/amd64:%JDK15PATH%/jre/lib/amd64/server:%JDK15PATH%/jre/lib/amd64/xawt
+ JDKLIBS -L%JDK15PATH%/jre/lib -L%JDK15PATH%/jre/lib/amd64 -L%JDK15PATH%/jre/lib/amd64/server
+ JDKPATH %JDK15PATH%/bin
+ JDK_VERSION 150
+ XCLASSPATH .:%JDK15PATH%/jre/lib/rt.jar
+ }
+ jdk14path:0 IF X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK14PATH %JDK_PATH%
+ }
+ jdk15
+ {
+ JAVA_HOME %JDK15PATH%
+ JDKINC %JDK15PATH%/include:%JDK15PATH%/include/linux
+ JDKINCS -I%JDK15PATH%/include -I%JDK15PATH%/include/linux
+ JDKLIB %JDK15PATH%/jre/lib:%JDK15PATH%/jre/lib/amd64:%JDK15PATH%/jre/lib/amd64/server:%JDK15PATH%/jre/lib/amd64/xawt
+ JDKLIBS -L%JDK15PATH%/jre/lib -L%JDK15PATH%/jre/lib/amd64 -L%JDK15PATH%/jre/lib/amd64/server
+ JDKPATH %JDK15PATH%/bin
+ JDK_VERSION 150
+ XCLASSPATH .:%JDK15PATH%/jre/lib/rt.jar
+ }
+ jdk15path:0 IF X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK15PATH %JDK_PATH%
+ }
+ ojdk16
+ {
+ JAVA_HOME %OJDK16PATH%
+ JDKINC %OJDK16PATH%/include:%OJDK16PATH%/include/linux
+ JDKINCS -I%OJDK16PATH%/include -I%OJDK16PATH%/include/linux
+ JDKLIB %OJDK16PATH%/jre/lib:%OJDK16PATH%/jre/lib/amd64:%OJDK16PATH%/jre/lib/amd64/server:%OJDK16PATH%/jre/lib/amd64/xawt
+ JDKLIBS -L%OJDK16PATH%/jre/lib -L%OJDK16PATH%/jre/lib/amd64 -L%OJDK16PATH%/jre/lib/amd64/server
+ JDKPATH %OJDK16PATH%/bin
+ JDK_VERSION 160
+ XCLASSPATH .:%OJDK16PATH%/jre/lib/rt.jar
+ }
+ ojdk16path:0 IF X%JDK_PATH%X != XX
+ {
+ SOLAR_OJDK16PATH %JDK_PATH%
+ }
+ pro
+ {
+ PROSWITCH -DPRODUCT
+ }
+ sourceroot:0 IF X%SOURCE_ROOT%X != XX
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT%
+ SOURCE_ROOT_USED TRUE
+ }
+ sysbaseroot
+ {
+ SOLAR_SYSBASE_ROOT %SYSBASE_ROOT%
+ }
+ }
+ extern
+ {
+ DIST_ROOT
+ ENV_ROOT
+ HOME
+ JDK_PATH
+ LOCALINI
+ SOL_TMP
+ SOURCE_ROOT
+ SYSBASE_ROOT
+ USER
+ }
+ order common0 bs_sourceroot envroot:0 sourceroot:0 sysbaseroot common1 jdk14path:0 jdk15path:0 ojdk16path:0 distroot:0 cap cax compath common2 common3:0 pro common jdk14 jdk15 ojdk16
+ reset
+ {
+ CLASSPATH
+ COPYALL
+ }
+ restore
+ {
+ INCLUDE
+ }
+ script
+ {
+ csh
+ {
+ 400: if ( ${?COPYALL} ) $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 600: umask 002
+ 800: rehash
+ 820: wrapfetch.sh
+ 850: if ( "$?SO_GEN_ERROR" == 0 ) setenv SO_GEN_ERROR
+ 851: if ( "$?SO_GEN_ERROR2" == 0 ) setenv SO_GEN_ERROR2
+ 900: if ( "$?SO_GEN_ERROR" == 1 ) echo $SO_GEN_ERROR
+ 901: if ( "$?SO_GEN_ERROR2" == 1 ) echo $SO_GEN_ERROR2
+ }
+ sh
+ {
+ 400: if [ $COPYALL ]; then
+ 410: $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 415: fi
+ 600: umask 002
+ 800: hash -r
+ 820: wrapfetch.sh
+ 850: if [ "0$SO_GEN_ERROR" -eq 0 ]; then
+ 851: export SO_GEN_ERROR
+ 852: fi
+ 860: if [ "0$SO_GEN_ERROR2" -eq 0 ]; then
+ 861: export SO_GEN_ERROR2
+ 862: fi
+ 870: if [ "0$SO_GEN_ERROR" -ne 0 ]; then
+ 871: echo $SO_GEN_ERROR
+ 872: fi
+ 880: if [ "0$SO_GEN_ERROR2" -ne 0 ]; then
+ 881: echo $SO_GEN_ERROR2
+ 882: fi
+ }
+ }
+ switches
+ {
+ bs_sourceroot SOURCE_ROOT_TMP
+ bsclient
+ cap
+ cax
+ compath STAR_COMPATH
+ debug
+ distroot
+ envroot
+ jdk14
+ jdk14path
+ jdk15
+ jdk15path
+ l10n L10N_framework
+ ojdk16
+ ojdk16path
+ pro
+ sourceroot
+ sysbaseroot
+ }
+}
+
+unxmacxi
+{
+ environment
+ {
+ bs_sourceroot
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT_USED TRUE
+ }
+ cap
+ {
+ COPYALL TRUE
+ COPY_PACKED TRUE
+ DEVROOT %SOL_TMP%$/r
+ PCLEAN_PATH %SOLARROOT%/etools
+ PERL %SOL_TMP%$/r$/bt_macosx_intel$/%WORK_STAMP%$/bin$/perl
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ cax
+ {
+ COPYALL FALSE
+ DEVROOT %SOL_TMP%$/r
+ PCLEAN_PATH %SOL_TMP%$/r/etools
+ PERL %SOL_TMP%$/r$/bt_macosx_intel$/%WORK_STAMP%$/bin$/perl
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ common
+ {
+ *build nice %PERL% %SOLARENV%/bin/build.pl %PROFULLSWITCH%
+ *build_client nice %PERL% %SOLARENV%/bin/build_client.pl
+ *copyprj %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ *deliver %PERL% %SOLARENV%/bin/deliver.pl
+ *mkout %PERL% %SOLARENV%/bin/mkout.pl
+ *r: cd %SOLARROOT%
+ *s: cd %SOLARVERSION%
+ *zipdep %PERL% %SOLARENV%/bin/zipdep.pl
+ COPYPRJ %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ DELIVER %PERL% %SOLARENV%/bin/deliver.pl
+ DMAKEROOT %SOLARENV%/inc/startup
+ HAVE_GCC_VISIBILITY_FEATURE TRUE
+ LIBRARY_PATH %SYSBASE%/usr/lib
+ MKOUT %PERL% %SOLARENV%/bin/mkout.pl
+ PATHEXTRA %combin%:/usr/bin:/bin:/usr/sbin:/etc
+ SOLAREXTRAINC -I%SOLAR_STLPATH% -I%SYSBASE%/usr/include/c++/4.0.0 -I%SYSBASE%/usr/include/c++/4.0.0/i686-apple-darwin8 -I%SYSBASE%/usr/lib/gcc/i686-apple-darwin8/4.0.1/include -I%SYSBASE%/usr/include/python2.3 -I%SYSBASE%/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1/include -I%SYSBASE%/MacOSX10.4u.sdk/Developer/Headers/FlatCarbon
+ SOLAREXTRALIB -L%SOLAR_STLLIBPATH%
+ SOLAR_JAVA TRUE
+ ZIPDEP %PERL% %SOLARENV%/bin/zipdep.pl
+ GNUCOPY gnucp
+ }
+ common0
+ {
+ GXX_INCLUDE_PATH /so/env/gcc_4.0.1_macosx/usr/include/c++/4.0.0
+ SOLAR_ENV_ROOT /so/env
+ SOLAR_SOURCE_ROOT %DRIVE_O%
+ SOLAR_SYSBASE_ROOT /so/env/gcc_4.0.1_macosx
+ MACDEVSDK /so/env/gcc_4.0.1_macosx/MacOSX10.4u.sdk
+ }
+ common1
+ {
+ BUILD_OS_APPLEOSX TRUE
+ BUILD_OS_MAJOR 10
+ BUILD_OS_MINOR 4
+ BUILD_OS_REV 10
+ COMPATH %SOLAR_ENV_ROOT%$/gcc_4.0.1_macosx
+ DEVROOT %SOLAR_ENV_ROOT%
+ DISABLE_DEPRECATION_WARNING TRUE
+ EXTRA_CDEFS -DBUILD_OS_APPLEOSX -DBUILD_OS_MAJOR=10 -DBUILD_OS_MINOR=4 -DBUILD_OS_REV=10
+ EXTRA_CFLAGS -isysroot %COMPATH%/MacOSX10.4u.sdk
+ EXTRA_LINKFLAGS -Wl,-syslibroot,%COMPATH%/MacOSX10.4u.sdk
+ LFS_CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+ LIBXML_CFLAGS -I%COMPATH%/MacOSX10.4u.sdk/usr/include/libxml2
+ LIBXML_LIBS -L%COMPATH%/MacOSX10.4u.sdk/usr/lib -lxml2 -lz -lpthread -liconv -lm
+ LIBXSLT_CFLAGS -I%COMPATH%/MacOSX10.4u.sdk/usr/include/libxml2
+ LIBXSLT_LIBS -L%COMPATH%/MacOSX10.4u.sdk/usr/lib -lxslt -lxml2 -lz -lpthread -liconv -lm
+ MACOSX_DEPLOYMENT_TARGET 10.4
+ OPENSSL_LIBS -lssl -lcrypto
+ PERL %SOLAR_ENV_ROOT%/bt_macosx_intel/%WORK_STAMP%/bin/perl
+ PKGFORMAT dmg
+ SHARED_SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv
+ SHARED_SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv
+ SOLARROOT %SOLAR_ENV_ROOT%
+ SOLARVER %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLAR_JDK14PATH %SOLAR_ENV_ROOT%/mac_jdk14_unknown
+ SOLAR_JDK15PATH %SOLAR_ENV_ROOT%/MacOSX_JDK_1.5.0_07.intel
+ SO_PACK %SOLAR_ENV_ROOT%/pack/%WORK_STAMP%
+ SRC_ROOT %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%
+ SYSTEM_CURL YES
+ SYSTEM_LIBXML YES
+ SYSTEM_LIBXSLT YES
+ SYSTEM_OPENSSL YES
+ SYSTEM_PYTHON YES
+ SYSTEM_ZLIB YES
+ USE_SYSTEM_STL YES
+ BUILD_PIXMAN YES
+ WITH_MOZILLA YES
+ }
+ common2
+ {
+ BUILD_TOOLS %SOLARROOT%/bt_macosx_intel/%WORK_STAMP%/bin
+ COM GCC
+ COMMON_BUILD_TOOLS %SOLARROOT%$/btools
+ COMMON_ENV_TOOLS %SOLARROOT%$/etools
+ CPU I
+ CPUNAME INTEL
+ CVER C341
+ ENV_TOOLS %SOLARROOT%/et_macosx_intel/%WORK_STAMP%/bin
+ GUI UNX
+ GUIBASE aqua
+ GVER VCL
+ INPATH unxmacxi%PROEXT%
+ JDK13PATH %SOLAR_JDK13PATH%
+ JDK14PATH %SOLAR_JDK15PATH%
+ JDK15PATH %SOLAR_JDK15PATH%
+ LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxmacxi
+ NO_BSYMBOLIC True
+ OS MACOSX
+ OUTPATH unxmacxi
+ PA_VER 18
+ SOLAR_STLLIBPATH %SOLARVERSION%$/unxmacxi%PROEXT%$/lib%UPDMINOREXT%
+ SOLAR_STLPATH %SOLARVERSION%$/unxmacxi%PROEXT%$/inc%UPDMINOREXT%$/stl
+ SYSBASE %SOLAR_SYSBASE_ROOT%
+ TEMP /tmp
+ TMP /tmp
+ }
+ compath
+ {
+ COMPATH %STAR_COMPATH%
+ }
+ distroot:0 if X%DIST_ROOT%X != XX
+ {
+ SHARED_SOLARVERSION %DIST_ROOT%/%WORK_STAMP%
+ SOLARVER %DIST_ROOT%/%WORK_STAMP%
+ SOLARVERSION %DIST_ROOT%/%WORK_STAMP%
+ }
+ envroot:0 IF X%ENV_ROOT%X != XX
+ {
+ SOLAR_ENV_ROOT %ENV_ROOT%
+ }
+ jdk14
+ {
+ JAVA_HOME %JDK15PATH%
+ JDKINC %JDK15PATH%/include:%JDK15PATH%/include/linux
+ JDKINCS -I%JDK15PATH%/include -I%JDK15PATH%/include/linux
+ JDKLIB %JDK15PATH%/jre/lib
+ JDKLIBS -L%JDK15PATH%/jre/lib
+ JDKPATH %JDK15PATH%/bin
+ JDK_VERSION 150
+ XCLASSPATH .:%JDK15PATH%/jre/lib/rt.jar
+ }
+ jdk14path:0 IF X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK14PATH %JDK_PATH%
+ }
+ jdk15
+ {
+ JAVA_HOME %JDK15PATH%
+ JDKINC %JDK15PATH%/include:%JDK15PATH%/include/linux
+ JDKINCS -I%JDK15PATH%/include -I%JDK15PATH%/include/linux
+ JDKLIB %JDK15PATH%/jre/lib
+ JDKLIBS -L%JDK15PATH%/jre/lib
+ JDKPATH %JDK15PATH%/bin
+ JDK_VERSION 150
+ XCLASSPATH .:%JDK15PATH%/jre/lib/rt.jar
+ }
+ jdk15path:0 IF X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK15PATH %JDK_PATH%
+ }
+ pro
+ {
+ PROSWITCH -DPRODUCT
+ }
+ sourceroot:0 IF X%SOURCE_ROOT%X != XX
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT%
+ SOURCE_ROOT_USED TRUE
+ }
+ sysbaseroot
+ {
+ SOLAR_SYSBASE_ROOT %SYSBASE_ROOT%
+ }
+ }
+ extern
+ {
+ DIST_ROOT
+ ENV_ROOT
+ HOME
+ JDK_PATH
+ LOCALINI
+ SOL_TMP
+ SOURCE_ROOT
+ SYSBASE_ROOT
+ USER
+ }
+ order common0 bs_sourceroot envroot:0 sourceroot:0 sysbaseroot common1 jdk14path:0 jdk15path:0 distroot:0 cap cax compath common2 pro common jdk14 jdk15
+ reset
+ {
+ CLASSPATH
+ COPYALL
+ }
+ restore
+ {
+ INCLUDE
+ }
+ script
+ {
+ csh
+ {
+ 400: if ( ${?COPYALL} ) $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 600: umask 002
+ 800: rehash
+ 820: wrapfetch.sh
+ 850: if ( "$?SO_GEN_ERROR" == 0 ) setenv SO_GEN_ERROR
+ 851: if ( "$?SO_GEN_ERROR2" == 0 ) setenv SO_GEN_ERROR2
+ 900: if ( "$?SO_GEN_ERROR" == 1 ) echo $SO_GEN_ERROR
+ 901: if ( "$?SO_GEN_ERROR2" == 1 ) echo $SO_GEN_ERROR2
+ }
+ sh
+ {
+ 400: if [ $COPYALL ]; then
+ 410: $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 415: fi
+ 600: umask 002
+ 800: hash -r
+ 820: wrapfetch.sh
+ 850: if [ "0$SO_GEN_ERROR" -eq 0 ]; then
+ 851: export SO_GEN_ERROR
+ 852: fi
+ 860: if [ "0$SO_GEN_ERROR2" -eq 0 ]; then
+ 861: export SO_GEN_ERROR2
+ 862: fi
+ 870: if [ "0$SO_GEN_ERROR" -ne 0 ]; then
+ 871: echo $SO_GEN_ERROR
+ 872: fi
+ 880: if [ "0$SO_GEN_ERROR2" -ne 0 ]; then
+ 881: echo $SO_GEN_ERROR2
+ 882: fi
+ }
+ }
+ switches
+ {
+ bs_sourceroot SOURCE_ROOT_TMP
+ bsclient
+ cap
+ cax
+ compath STAR_COMPATH
+ debug
+ distroot
+ envroot
+ jdk14
+ jdk14path
+ jdk15
+ jdk15path
+ l10n L10N_framework
+ pro
+ sourceroot
+ sysbaseroot
+ }
+}
+unxsoli4
+{
+ environment
+ {
+ bs_sourceroot
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT_USED TRUE
+ }
+ cap
+ {
+ COPYALL TRUE
+ COPY_PACKED TRUE
+ DEVROOT %SOL_TMP%$/r
+ PCLEAN_PATH %SOLARROOT%/etools
+ PERL %SOL_TMP%$/r$/bt_solaris_intel$/bin$/perl
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ cax
+ {
+ COPYALL FALSE
+ DEVROOT %SOL_TMP%$/r
+ PCLEAN_PATH %SOL_TMP%$/r/etools
+ PERL %SOL_TMP%$/r$/bt_solaris_intel$/bin$/perl
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ common
+ {
+ *build nice %PERL% %SOLARENV%/bin/build.pl %PROFULLSWITCH%
+ *build_client nice %PERL% %SOLARENV%/bin/build_client.pl
+ *copyprj %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ *deliver %PERL% %SOLARENV%/bin/deliver.pl
+ *mkout %PERL% %SOLARENV%/bin/mkout.pl
+ *r: cd %SOLARROOT%
+ *s: cd %SOLARVERSION%
+ *zipdep %PERL% %SOLARENV%/bin/zipdep.pl
+ COPYPRJ %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ DELIVER %PERL% %SOLARENV%/bin/deliver.pl
+ DMAKEROOT %SOLARENV%/inc/startup
+ MKOUT %PERL% %SOLARENV%/bin/mkout.pl
+ PATHEXTRA /usr/ccs/bin:/usr/bin:/bin:/usr/sbin:/etc:/usr/bin/X11:/opt/langtools/bin:/usr/dt/bin
+ FREETYPE_CFLAGS -I%SYSBASE%/usr/sfw/include -I%SYSBASE%/usr/sfw/include/freetype2
+ SOLAREXTRAINC -I%SOLAR_STLPATH% -I%SYSBASE%/usr/include
+ SOLAREXTRALIB -L%COMPATH%$/lib -L../lib -L%SYSBASE%/usr/lib -L%SYSBASE%/usr/sfw/lib -L/lib -L/usr/lib -L/usr/dt/lib -L/usr/openwin/lib -L%SOLAR_STLLIBPATH%
+ SOLAR_JAVA TRUE
+ ZIPDEP %PERL% %SOLARENV%/bin/zipdep.pl
+ __cdpath %DRIVE_O%/%WORK_STAMP%/ooo%UPDMINOREXT%
+ ENABLE_GCONF TRUE
+ ENABLE_GNOMEVFS TRUE
+ GNUCOPY gnucp
+ }
+ common0
+ {
+ SOLAR_ENV_ROOT /so/env
+ SOLAR_SOURCE_ROOT %DRIVE_O%
+ SOLAR_SYSBASE_ROOT /so/env/solaris_2.10_intel
+ }
+ common1
+ {
+ COMPATH /so/env/compilers/SUNWS12_p/intel/SUNWspro
+ DEVROOT %SOLAR_ENV_ROOT%
+ LFS_CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+ PERL %SOLAR_ENV_ROOT%/bt_solaris_intel/bin/perl
+ PKGFORMAT pkg
+ SHARED_SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv
+ SHARED_SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv
+ SOLARROOT %SOLAR_ENV_ROOT%
+ SOLARVER %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLAR_JDK13PATH %SOLAR_ENV_ROOT%/Solaris_JDK_1.3.1_01.intel
+ SOLAR_JDK14PATH %SOLAR_ENV_ROOT%/Solaris_JDK_1.4.2_11.intel
+ SOLAR_JDK15PATH %SOLAR_ENV_ROOT%/Solaris_JDK_1.5.0_06.intel
+ SOLAR_OJDK16PATH %SOLAR_ENV_ROOT%/openjdk-6-b08-solaris-i586
+ SO_PACK %SOLAR_ENV_ROOT%/pack/%WORK_STAMP%
+ SRC_ROOT %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%
+ }
+ common2
+ {
+ BUILD_TOOLS %SOLARROOT%/bt_solaris_intel/%WORK_STAMP%/bin
+ COM C52
+ COMEX 4
+ COMMON_BUILD_TOOLS %SOLARROOT%$/btools
+ COMMON_ENV_TOOLS %SOLARROOT%$/etools
+ CPU I
+ CPUNAME INTEL
+ CVER C52
+ ENABLE_EVOAB2 TRUE
+ ENV_TOOLS %SOLARROOT%/et_solaris_intel/%WORK_STAMP%/bin
+ GUI UNX
+ GUIBASE unx
+ GVER VCL
+ INPATH unxsoli4%PROEXT%
+ JDK13PATH %SOLAR_JDK13PATH%
+ JDK14PATH %SOLAR_JDK14PATH%
+ JDK15PATH %SOLAR_JDK15PATH%
+ LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxsoli4
+ OJDK16PATH %SOLAR_OJDK16PATH%
+ OS SOLARIS
+ OUTPATH unxsoli4
+ SOLAR_STLLIBPATH %SOLARVERSION%$/unxsoli4%PROEXT%$/lib%UPDMINOREXT%
+ SOLAR_STLPATH %SOLARVERSION%$/unxsoli4%PROEXT%$/inc%UPDMINOREXT%$/stl
+ SYSBASE %SOLAR_SYSBASE_ROOT%
+ TEMP /var/tmp
+ TMP /var/tmp
+ }
+ compath
+ {
+ COMPATH %STAR_COMPATH%
+ }
+ distroot:0 if X%DIST_ROOT%X != XX
+ {
+ SHARED_SOLARVERSION %DIST_ROOT%/%WORK_STAMP%
+ SOLARVER %DIST_ROOT%/%WORK_STAMP%
+ SOLARVERSION %DIST_ROOT%/%WORK_STAMP%
+ }
+ envroot:0 if X%ENV_ROOT%X != XX
+ {
+ SOLAR_ENV_ROOT %ENV_ROOT%
+ }
+ jdk14
+ {
+ JAVA_HOME %JDK14PATH%
+ JDKINC %JDK14PATH%/include:%JDK14PATH%/include/solaris
+ JDKINCS -I%JDK14PATH%/include -I%JDK14PATH%/include/solaris
+ JDKLIB %JDK14PATH%/jre/lib/i386:%JDK14PATH%/lib:%JDK14PATH%/jre/lib/i386/native_threads:%JDK14PATH%/jre/plugin/i386:%JDK14PATH%/jre/lib/i386/motif21
+ JDKLIBS -L%JDK14PATH%/jre/lib/i386 -L%JDK14PATH%/lib -L%JDK14PATH%/jre/lib/i386/native_threads -L%JDK14PATH%/jre/plugin/i386 -L%JDK14PATH%/jre/lib/i386/motif21
+ JDKPATH %JDK14PATH%/bin
+ JDK_VERSION 142
+ XCLASSPATH .:%JDK14PATH%/jre/lib/rt.jar
+ }
+ jdk14path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK14PATH %JDK_PATH%
+ }
+ jdk15
+ {
+ JAVA_HOME %JDK15PATH%
+ JDKINC %JDK15PATH%/include:%JDK15PATH%/include/solaris
+ JDKINCS -I%JDK15PATH%/include -I%JDK15PATH%/include/solaris
+ JDKLIB %JDK15PATH%/jre/lib/i386:%JDK15PATH%/lib:%JDK15PATH%/jre/lib/i386/native_threads:%JDK15PATH%/jre/plugin/i386:%JDK15PATH%/jre/lib/i386/motif21
+ JDKLIBS -L%JDK15PATH%/jre/lib/i386 -L%JDK15PATH%/lib -L%JDK15PATH%/jre/lib/i386/native_threads -L%JDK15PATH%/jre/plugin/i386 -L%JDK15PATH%/jre/lib/i386/motif21
+ JDKPATH %JDK15PATH%/bin
+ JDK_VERSION 150
+ XCLASSPATH .:%JDK15PATH%/jre/lib/rt.jar
+ }
+ jdk15path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK15PATH %JDK_PATH%
+ }
+ ojdk16
+ {
+ JAVA_HOME %OJDK16PATH%
+ JDKINC %OJDK16PATH%/include:%OJDK16PATH%/include/solaris
+ JDKINCS -I%OJDK16PATH%/include -I%OJDK16PATH%/include/solaris
+ JDKLIB %OJDK16PATH%/jre/lib/i386:%OJDK16PATH%/lib:%OJDK16PATH%/jre/lib/i386/native_threads:%OJDK16PATH%/jre/plugin/i386:%OJDK16PATH%/jre/lib/i386/xawt
+ JDKLIBS -L%OJDK16PATH%/jre/lib/i386 -L%OJDK16PATH%/lib -L%OJDK16PATH%/jre/lib/i386/native_threads -L%OJDK16PATH%/jre/plugin/i386 -L%OJDK16PATH%/jre/lib/i386/xawt
+ JDKPATH %OJDK16PATH%/bin
+ JDK_VERSION 160
+ XCLASSPATH .:%OJDK16PATH%/jre/lib/rt.jar
+ }
+ ojdk16path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_OJDK16PATH %JDK_PATH%
+ }
+ pro
+ {
+ PROSWITCH -DPRODUCT
+ }
+ sourceroot:0 if X%SOURCE_ROOT%X != XX
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT%
+ SOURCE_ROOT_USED TRUE
+ }
+ sysbaseroot
+ {
+ SOLAR_SYSBASE_ROOT %SYSBASE_ROOT%
+ }
+ }
+ extern
+ {
+ DIST_ROOT
+ ENV_ROOT
+ HOME
+ JDK_PATH
+ LOCALINI
+ SOL_TMP
+ SOURCE_ROOT
+ SYSBASE_ROOT
+ USER
+ }
+ order common0 bs_sourceroot envroot:0 sourceroot:0 common1 distroot:0 jdk14path:0 jdk15path:0 ojdk16path:0 sysbaseroot cap cax compath common2 pro common jdk14 jdk15 ojdk16
+ reset
+ {
+ CLASSPATH
+ }
+ script
+ {
+ csh
+ {
+ 400: if ( ${?COPYALL} ) $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 600: umask 002
+ 800: rehash
+ 820: wrapfetch.sh
+ 850: if ( "$?SO_GEN_ERROR" == 0 ) setenv SO_GEN_ERROR
+ 851: if ( "$?SO_GEN_ERROR2" == 0 ) setenv SO_GEN_ERROR2
+ 900: if ( "$?SO_GEN_ERROR" == 1 ) echo $SO_GEN_ERROR
+ 901: if ( "$?SO_GEN_ERROR2" == 1 ) echo $SO_GEN_ERROR2
+ }
+ sh
+ {
+ 400: if [ $COPYALL ]; then
+ 410: $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 415: fi
+ 600: umask 002
+ 800: hash -r
+ 820: wrapfetch.sh
+ 850: if [ "0$SO_GEN_ERROR" -eq 0 ]; then
+ 851: export SO_GEN_ERROR
+ 852: fi
+ 860: if [ "0$SO_GEN_ERROR2" -eq 0 ]; then
+ 861: export SO_GEN_ERROR2
+ 862: fi
+ 870: if [ "0$SO_GEN_ERROR" -ne 0 ]; then
+ 871: echo $SO_GEN_ERROR
+ 872: fi
+ 880: if [ "0$SO_GEN_ERROR2" -ne 0 ]; then
+ 881: echo $SO_GEN_ERROR2
+ 882: fi
+ }
+ }
+ switches
+ {
+ bs_sourceroot SOURCE_ROOT_TMP
+ bsclient
+ cap
+ cax
+ compath STAR_COMPATH
+ distroot
+ envroot
+ jdk14
+ jdk14path
+ jdk15
+ jdk15path
+ l10n L10N_framework
+ ojdk16
+ ojdk16path
+ pro
+ sourceroot
+ sysbaseroot
+ }
+}
+unxsols4
+{
+ environment
+ {
+ bs_sourceroot
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT_USED TRUE
+ }
+ cap
+ {
+ COPYALL TRUE
+ COPY_PACKED TRUE
+ DEVROOT %SOL_TMP%$/r
+ PCLEAN_PATH %SOLARROOT%/etools
+ PERL %SOL_TMP%$/r$/bt_solaris_sparc$/bin$/perl
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ cax
+ {
+ COPYALL FALSE
+ DEVROOT %SOL_TMP%$/r
+ PCLEAN_PATH %SOL_TMP%$/r/etools
+ PERL %SOL_TMP%$/r$/bt_solaris_sparc$/bin$/perl
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ common
+ {
+ *build nice %PERL% %SOLARENV%/bin/build.pl %PROFULLSWITCH%
+ *build_client nice %PERL% %SOLARENV%/bin/build_client.pl
+ *copyprj %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ *deliver %PERL% %SOLARENV%/bin/deliver.pl
+ *mkout %PERL% %SOLARENV%/bin/mkout.pl
+ *r: cd %SOLARROOT%
+ *s: cd %SOLARVERSION%
+ *zipdep %PERL% %SOLARENV%/bin/zipdep.pl
+ COPYPRJ %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ DELIVER %PERL% %SOLARENV%/bin/deliver.pl
+ DMAKEROOT %SOLARENV%/inc/startup
+ MKOUT %PERL% %SOLARENV%/bin/mkout.pl
+ PATHEXTRA /usr/ccs/bin:/usr/bin:/bin:/usr/sbin:/etc:/usr/bin/X11:/opt/langtools/bin:/usr/dt/bin
+ FREETYPE_CFLAGS -I%SYSBASE%/usr/sfw/include -I%SYSBASE%/usr/sfw/include/freetype2
+ SOLAREXTRAINC -I%SOLAR_STLPATH% -I%SYSBASE%/usr/include
+ SOLAREXTRALIB -L%COMPATH%$/lib -L../lib -L%SYSBASE%/usr/lib -L%SYSBASE%/usr/sfw/lib -L/lib -L/usr/lib -L/usr/dt/lib -L/usr/openwin/lib -L%SOLAR_STLLIBPATH%
+ SOLAR_JAVA TRUE
+ ZIPDEP %PERL% %SOLARENV%/bin/zipdep.pl
+ __cdpath %DRIVE_O%/%WORK_STAMP%/ooo%UPDMINOREXT%
+ ENABLE_GCONF TRUE
+ ENABLE_GNOMEVFS TRUE
+ GNUCOPY gnucp
+ }
+ common0
+ {
+ SOLAR_ENV_ROOT /so/env
+ SOLAR_LICENSE_FILE /opt/SUNWspro/license_dir/sunpro.lic,1
+ SOLAR_SOURCE_ROOT %DRIVE_O%
+ SOLAR_SYSBASE_ROOT /so/env/solaris_2.10_sparc
+ }
+ common1
+ {
+ COMPATH /so/env/compilers/SUNWS12_p/sparc/SUNWspro
+ DEVROOT %SOLAR_ENV_ROOT%
+ LFS_CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+ PERL %SOLAR_ENV_ROOT%/bt_solaris_sparc/bin/perl
+ PKGFORMAT pkg
+ SHARED_SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv
+ SHARED_SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv
+ SOLARROOT %SOLAR_ENV_ROOT%
+ SOLARVER %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLAR_JDK13PATH %SOLAR_ENV_ROOT%/Solaris_JDK_1.3.1_01.sparc
+ SOLAR_JDK14PATH %SOLAR_ENV_ROOT%/Solaris_JDK_1.4.2_11.sparc
+ SOLAR_JDK15PATH %SOLAR_ENV_ROOT%/Solaris_JDK_1.5.0_06.sparc
+ SOLAR_OJDK16PATH %SOLAR_ENV_ROOT%/openjdk-6-b08-solaris-sparc
+ SO_PACK %SOLAR_ENV_ROOT%/pack/%WORK_STAMP%
+ SRC_ROOT %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%
+ }
+ common2
+ {
+ BUILD_TOOLS %SOLARROOT%/bt_solaris_sparc/%WORK_STAMP%/bin
+ COM C52
+ COMEX 4
+ COMMON_BUILD_TOOLS %SOLARROOT%$/btools
+ COMMON_ENV_TOOLS %SOLARROOT%$/etools
+ CPU S
+ CPUNAME SPARC
+ CVER C52
+ ENABLE_EVOAB2 TRUE
+ ENV_TOOLS %SOLARROOT%/et_solaris_sparc/%WORK_STAMP%/bin
+ GUI UNX
+ GUIBASE unx
+ GVER VCL
+ INPATH unxsols4%PROEXT%
+ JDK13PATH %SOLAR_JDK13PATH%
+ JDK14PATH %SOLAR_JDK14PATH%
+ JDK15PATH %SOLAR_JDK15PATH%
+ LIBMYSQL_PATH %SOLARROOT%/mysql-connector-c-6.0.2/unxsols4
+ LM_LICENSE_FILE %SOLAR_LICENSE_FILE%
+ OJDK16PATH %SOLAR_OJDK16PATH%
+ OS SOLARIS
+ OUTPATH unxsols4
+ SOLAR_STLLIBPATH %SOLARVERSION%$/unxsols4%PROEXT%$/lib%UPDMINOREXT%
+ SOLAR_STLPATH %SOLARVERSION%$/unxsols4%PROEXT%$/inc%UPDMINOREXT%$/stl
+ SYSBASE %SOLAR_SYSBASE_ROOT%
+ TEMP /var/tmp
+ TMP /var/tmp
+ }
+ common:3 IF %UPDATER% == YES
+ {
+ TEMP /tmp
+ TMP /tmp
+ }
+ compath
+ {
+ COMPATH %STAR_COMPATH%
+ }
+ distroot:0 if X%DIST_ROOT%X != XX
+ {
+ SHARED_SOLARVERSION %DIST_ROOT%/%WORK_STAMP%
+ SOLARVER %DIST_ROOT%/%WORK_STAMP%
+ SOLARVERSION %DIST_ROOT%/%WORK_STAMP%
+ }
+ envroot:0 if X%ENV_ROOT%X != XX
+ {
+ SOLAR_ENV_ROOT %ENV_ROOT%
+ }
+ jdk14
+ {
+ JAVA_HOME %JDK14PATH%
+ JDKINC %JDK14PATH%/include:%JDK14PATH%/include/solaris
+ JDKINCS -I%JDK14PATH%/include -I%JDK14PATH%/include/solaris
+ JDKLIB %JDK14PATH%/jre/lib/sparc:%JDK14PATH%/lib:%JDK14PATH%/jre/lib/sparc/native_threads:%JDK14PATH%/jre/plugin/sparc:%JDK14PATH%/jre/lib/sparc/motif21
+ JDKLIBS -L%JDK14PATH%/jre/lib/sparc -L%JDK14PATH%/lib -L%JDK14PATH%/jre/lib/sparc/native_threads -L%JDK14PATH%/jre/plugin/sparc -L%JDK14PATH%/jre/lib/sparc/motif21
+ JDKPATH %JDK14PATH%/bin
+ JDK_VERSION 142
+ XCLASSPATH .:%JDK14PATH%/jre/lib/rt.jar
+ }
+ jdk14path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK14PATH %JDK_PATH%
+ }
+ jdk15
+ {
+ JAVA_HOME %JDK15PATH%
+ JDKINC %JDK15PATH%/include:%JDK15PATH%/include/solaris
+ JDKINCS -I%JDK15PATH%/include -I%JDK15PATH%/include/solaris
+ JDKLIB %JDK15PATH%/jre/lib/sparc:%JDK15PATH%/lib:%JDK15PATH%/jre/lib/sparc/native_threads:%JDK15PATH%/jre/plugin/sparc:%JDK15PATH%/jre/lib/sparc/motif21
+ JDKLIBS -L%JDK15PATH%/jre/lib/sparc -L%JDK15PATH%/lib -L%JDK15PATH%/jre/lib/sparc/native_threads -L%JDK15PATH%/jre/plugin/sparc -L%JDK15PATH%/jre/lib/sparc/motif21
+ JDKPATH %JDK15PATH%/bin
+ JDK_VERSION 150
+ XCLASSPATH .:%JDK15PATH%/jre/lib/rt.jar
+ }
+ jdk15path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK15PATH %JDK_PATH%
+ }
+ ojdk16
+ {
+ JAVA_HOME %OJDK16PATH%
+ JDKINC %OJDK16PATH%/include:%OJDK16PATH%/include/solaris
+ JDKINCS -I%OJDK16PATH%/include -I%OJDK16PATH%/include/solaris
+ JDKLIB %OJDK16PATH%/jre/lib/sparc:%OJDK16PATH%/lib:%OJDK16PATH%/jre/lib/sparc/native_threads:%OJDK16PATH%/jre/plugin/sparc:%OJDK16PATH%/jre/lib/sparc/xawt
+ JDKLIBS -L%OJDK16PATH%/jre/lib/sparc -L%OJDK16PATH%/lib -L%OJDK16PATH%/jre/lib/sparc/native_threads -L%OJDK16PATH%/jre/plugin/sparc -L%OJDK16PATH%/jre/lib/sparc/xawt
+ JDKPATH %OJDK16PATH%/bin
+ JDK_VERSION 160
+ XCLASSPATH .:%OJDK16PATH%/jre/lib/rt.jar
+ }
+ ojdk16path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_OJDK16PATH %JDK_PATH%
+ }
+ pro
+ {
+ PROSWITCH -DPRODUCT
+ }
+ sourceroot:0 if X%SOURCE_ROOT%X != XX
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT%
+ SOURCE_ROOT_USED TRUE
+ }
+ sysbaseroot
+ {
+ SOLAR_SYSBASE_ROOT %SYSBASE_ROOT%
+ }
+ }
+ extern
+ {
+ DIST_ROOT
+ ENV_ROOT
+ HOME
+ JDK_PATH
+ LM_LICENSE_FILE
+ LOCALINI
+ SOL_TMP
+ SOURCE_ROOT
+ SYSBASE_ROOT
+ USER
+ }
+ order common0 bs_sourceroot envroot:0 sourceroot:0 common1 distroot:0 jdk14path:0 jdk15path:0 ojdk16path:0 sysbaseroot cap cax compath common2 common:3 pro common jdk14 jdk15 ojdk16
+ reset
+ {
+ CLASSPATH
+ }
+ script
+ {
+ csh
+ {
+ 400: if ( ${?COPYALL} ) $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 600: umask 002
+ 800: rehash
+ 820: wrapfetch.sh
+ 850: if ( "$?SO_GEN_ERROR" == 0 ) setenv SO_GEN_ERROR
+ 851: if ( "$?SO_GEN_ERROR2" == 0 ) setenv SO_GEN_ERROR2
+ 900: if ( "$?SO_GEN_ERROR" == 1 ) echo $SO_GEN_ERROR
+ 901: if ( "$?SO_GEN_ERROR2" == 1 ) echo $SO_GEN_ERROR2
+ }
+ sh
+ {
+ 400: if [ $COPYALL ]; then
+ 410: $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 415: fi
+ 600: umask 002
+ 800: hash -r
+ 820: wrapfetch.sh
+ 850: if [ "0$SO_GEN_ERROR" -eq 0 ]; then
+ 851: export SO_GEN_ERROR
+ 852: fi
+ 860: if [ "0$SO_GEN_ERROR2" -eq 0 ]; then
+ 861: export SO_GEN_ERROR2
+ 862: fi
+ 870: if [ "0$SO_GEN_ERROR" -ne 0 ]; then
+ 871: echo $SO_GEN_ERROR
+ 872: fi
+ 880: if [ "0$SO_GEN_ERROR2" -ne 0 ]; then
+ 881: echo $SO_GEN_ERROR2
+ 882: fi
+ }
+ }
+ switches
+ {
+ bs_sourceroot SOURCE_ROOT_TMP
+ bsclient
+ cap
+ cax
+ compath STAR_COMPATH
+ distroot
+ envroot
+ jdk14
+ jdk14path
+ jdk15
+ jdk15path
+ l10n L10N_framework
+ ojdk16
+ ojdk16path
+ pro
+ sourceroot
+ sysbaseroot
+ }
+}
+unxsolu4
+{
+ environment
+ {
+ bs_sourceroot
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT_USED TRUE
+ }
+ cap
+ {
+ COPYALL TRUE
+ COPY_PACKED TRUE
+ DEVROOT %SOL_TMP%$/r
+ PCLEAN_PATH %SOLARROOT%/etools
+ PERL %SOL_TMP%$/r$/bt_solaris_sparc$/bin$/perl
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ cax
+ {
+ COPYALL FALSE
+ DEVROOT %SOL_TMP%$/r
+ PCLEAN_PATH %SOL_TMP%$/r/etools
+ PERL %SOL_TMP%$/r$/bt_solaris_sparc$/bin$/perl
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ common
+ {
+ *build nice %PERL% %SOLARENV%/bin/build.pl %PROFULLSWITCH%
+ *build_client nice %PERL% %SOLARENV%/bin/build_client.pl
+ *copyprj %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ *deliver %PERL% %SOLARENV%/bin/deliver.pl
+ *mkout %PERL% %SOLARENV%/bin/mkout.pl
+ *r: cd %SOLARROOT%
+ *s: cd %SOLARVERSION%
+ *zipdep %PERL% %SOLARENV%/bin/zipdep.pl
+ COPYPRJ %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ DELIVER %PERL% %SOLARENV%/bin/deliver.pl
+ DMAKEROOT %SOLARENV%/inc/startup
+ FREETYPE_CFLAGS -I%SYSBASE%/usr/sfw/include -I%SYSBASE%/usr/sfw/include/freetype2
+ FREETYPE_LIBS -L%SYSBASE%/usr/sfw/lib/sparcv9 -lfreetype
+ LIBXML_CFLAGS -I%SYSBASE%/usr/include/libxml2
+ LIBXML_LIBS -L%SYSBASE%/usr/lib/sparcv9 -lxml2 -lpthread -lz -lm -lsocket -lnsl
+ LIBXSLT_CFLAGS -I%SYSBASE%/usr/include/libxml2
+ LIBXSLT_LIBS -L%SYSBASE%/usr/lib/sparcv9 -lxslt -lxml2 -lpthread -lz -lm -lsocket -lnsl
+ MKOUT %PERL% %SOLARENV%/bin/mkout.pl
+ PATHEXTRA /usr/ccs/bin:/usr/bin:/bin:/usr/sbin:/etc:/usr/bin/X11:/opt/langtools/bin:/usr/dt/bin
+ SOLAREXTRAINC -I%SOLAR_STLPATH% -I%SYSBASE%/usr/include
+ SOLAREXTRALIB -L%COMPATH%$/lib -L../lib -L%SYSBASE%/usr/lib -L/lib -L/usr/lib -L/usr/dt/lib -L/usr/openwin/lib -L%SOLAR_STLLIBPATH%
+ SOLAR_JAVA TRUE
+ SYSTEM_FREETYPE YES
+ SYSTEM_LIBXML YES
+ SYSTEM_LIBXSLT YES
+ ZIPDEP %PERL% %SOLARENV%/bin/zipdep.pl
+ __cdpath %DRIVE_O%/%WORK_STAMP%/ooo%UPDMINOREXT%
+ ENABLE_GCONF TRUE
+# ENABLE_GNOMEVFS TRUE
+ }
+ common0
+ {
+ SOLAR_ENV_ROOT /so/env
+ SOLAR_SOURCE_ROOT %DRIVE_O%
+ SOLAR_SYSBASE_ROOT /so/env/solaris_2.10_sparc
+ }
+ common1
+ {
+ COMPATH /so/env/compilers/SUNWS12m1/sparc/SUNWspro
+ DEVROOT %SOLAR_ENV_ROOT%
+ PERL %SOLAR_ENV_ROOT%/bt_solaris_sparc/bin/perl
+ PKGFORMAT pkg
+ SHARED_SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv
+ SHARED_SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLARENV %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%/solenv
+ SOLARROOT %SOLAR_ENV_ROOT%
+ SOLARVER %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLARVERSION %SOLAR_SOURCE_ROOT%/%WORK_STAMP%
+ SOLAR_JDK15PATH %SOLAR_ENV_ROOT%/Solaris_JDK_1.5.0_15.sparc
+ SO_PACK %SOLAR_ENV_ROOT%/pack/%WORK_STAMP%
+ SRC_ROOT %SOLAR_SOURCE_ROOT%/%WORK_STAMP%/ooo%UPDMINOREXT%
+ USE_SYSTEM_STL YES
+ }
+ common2
+ {
+ BUILD_TOOLS %SOLARROOT%/bt_solaris_sparc/%WORK_STAMP%/bin
+ COM C52
+ COMEX 4
+ COMMON_BUILD_TOOLS %SOLARROOT%$/btools
+ COMMON_ENV_TOOLS %SOLARROOT%$/etools
+ CPU U
+ CPUNAME SPARC
+ CVER C52
+ ENV_TOOLS %SOLARROOT%/et_solaris_sparc/%WORK_STAMP%/bin
+ GUI UNX
+ GUIBASE unx
+ GVER VCL
+ INPATH unxsolu4%PROEXT%
+ JDK15PATH %SOLAR_JDK15PATH%
+ OS SOLARIS
+ OUTPATH unxsolu4
+ SOLAR_STLLIBPATH %SOLARVERSION%$/unxsolu4%PROEXT%$/lib%UPDMINOREXT%
+ SOLAR_STLPATH %SOLARVERSION%$/unxsolu4%PROEXT%$/inc%UPDMINOREXT%$/stl
+ SYSBASE %SOLAR_SYSBASE_ROOT%
+ TEMP /var/tmp
+ TMP /var/tmp
+ }
+ common:3 IF %UPDATER% == YES
+ {
+ TEMP /tmp
+ TMP /tmp
+ }
+ compath
+ {
+ COMPATH %STAR_COMPATH%
+ }
+ distroot:0 if X%DIST_ROOT%X != XX
+ {
+ SHARED_SOLARVERSION %DIST_ROOT%/%WORK_STAMP%
+ SOLARVER %DIST_ROOT%/%WORK_STAMP%
+ SOLARVERSION %DIST_ROOT%/%WORK_STAMP%
+ }
+ envroot:0 if X%ENV_ROOT%X != XX
+ {
+ SOLAR_ENV_ROOT %ENV_ROOT%
+ }
+ jdk15
+ {
+ JAVA_HOME %JDK15PATH%
+ JDKINC %JDK15PATH%/include:%JDK15PATH%/include/solaris
+ JDKINCS -I%JDK15PATH%/include -I%JDK15PATH%/include/solaris
+ JDKLIB %JDK15PATH%/jre/lib/sparcv9:%JDK15PATH%/lib:%JDK15PATH%/jre/lib/sparcv9/native_threads:%JDK15PATH%/jre/lib/sparcv9/server:%JDK15PATH%/jre/plugin/sparcv9:%JDK15PATH%/jre/lib/sparcv9/motif21
+ JDKLIBS -L%JDK15PATH%/jre/lib/sparcv9 -L%JDK15PATH%/lib -L%JDK15PATH%/jre/lib/sparcv9/native_threads -L%JDK15PATH%/jre/lib/sparcv9/server -L%JDK15PATH%/jre/plugin/sparcv9 -L%JDK15PATH%/jre/lib/sparcv9/motif21
+ JDKPATH %JDK15PATH%/bin/sparcv9
+ JDK_VERSION 150
+ XCLASSPATH .:%JDK15PATH%/jre/lib/rt.jar
+ }
+ jdk15path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK15PATH %JDK_PATH%
+ }
+ pro
+ {
+ PROSWITCH -DPRODUCT
+ }
+ sourceroot:0 if X%SOURCE_ROOT%X != XX
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT%
+ SOURCE_ROOT_USED TRUE
+ }
+ sysbaseroot
+ {
+ SOLAR_SYSBASE_ROOT %SYSBASE_ROOT%
+ }
+ }
+ extern
+ {
+ DIST_ROOT
+ ENV_ROOT
+ HOME
+ JDK_PATH
+ LM_LICENSE_FILE
+ LOCALINI
+ SOL_TMP
+ SOURCE_ROOT
+ SYSBASE_ROOT
+ USER
+ }
+ order common0 bs_sourceroot envroot:0 sourceroot:0 common1 distroot:0 jdk15path:0 sysbaseroot cap cax compath common2 common:3 pro common jdk15
+ reset
+ {
+ CLASSPATH
+ }
+ script
+ {
+ csh
+ {
+ 400: if ( ${?COPYALL} ) $SOLAR_ENV_ROOT/etools/lucopy.pl all $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 600: umask 002
+ 800: rehash
+ 820: wrapfetch.sh
+ 850: if ( "$?SO_GEN_ERROR" == 0 ) setenv SO_GEN_ERROR
+ 851: if ( "$?SO_GEN_ERROR2" == 0 ) setenv SO_GEN_ERROR2
+ 900: if ( "$?SO_GEN_ERROR" == 1 ) echo $SO_GEN_ERROR
+ 901: if ( "$?SO_GEN_ERROR2" == 1 ) echo $SO_GEN_ERROR2
+ }
+ sh
+ {
+ 400: if [ $COPYALL ]; then
+ 410: $SOLAR_ENV_ROOT/etools/lucopy.pl all $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 415: fi
+ 600: umask 002
+ 800: hash -r
+ 820: wrapfetch.sh
+ 850: if [ "0$SO_GEN_ERROR" -eq 0 ]; then
+ 851: export SO_GEN_ERROR
+ 852: fi
+ 860: if [ "0$SO_GEN_ERROR2" -eq 0 ]; then
+ 861: export SO_GEN_ERROR2
+ 862: fi
+ 870: if [ "0$SO_GEN_ERROR" -ne 0 ]; then
+ 871: echo $SO_GEN_ERROR
+ 872: fi
+ 880: if [ "0$SO_GEN_ERROR2" -ne 0 ]; then
+ 881: echo $SO_GEN_ERROR2
+ 882: fi
+ }
+ }
+ switches
+ {
+ bs_sourceroot SOURCE_ROOT_TMP
+ bsclient
+ cap
+ cax
+ compath STAR_COMPATH
+ distroot
+ envroot
+ jdk15
+ jdk15path
+ l10n L10N_framework
+ pro
+ sourceroot
+ sysbaseroot
+ }
+}
+wntgcci1
+{
+ environment
+ {
+ bs_sourceroot
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT_USED TRUE
+ }
+ cap
+ {
+ COMPATH %SOL_TMP%$/r$/MinGW
+ COPYALL TRUE
+ COPY_PACKED TRUE
+ DEVROOT %SOL_TMP%$/r
+ FSDK %SOL_TMP%$/r$/msvc7net$/FrameworkSDK
+ NSIS_PATH %SOL_TMP%$/r$/NSIS_242_unicode
+ PCLEAN_PATH %SOLARROOT%$/etw
+ PERL %SOL_TMP%$/r$/btw$/perl$/bin$/perl
+ PSDK %SOL_TMP%$/r$/MinGW$/w32api
+ SHARED_COM_SDK_PATH %SOL_TMP%$/r$/msvc7net$/Common7$/ide
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ cax
+ {
+ COMPATH %SOL_TMP%$/r$/MinGW
+ COPYALL FALSE
+ FSDK %SOL_TMP%$/r$/msvc7net$/FrameworkSDK
+ NSIS_PATH %SOL_TMP%$/r$/NSIS_242_unicode
+ PCLEAN_PATH %SOL_TMP%$/r$/etw
+ PERL %SOL_TMP%$/r$/btw$/perl$/bin$/perl
+ PSDK %SOL_TMP%$/r$/MinGW$/w32api
+ SHARED_COM_SDK_PATH %SOL_TMP%$/r$/msvc7net$/Common7$/ide
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ common
+ {
+ *build %PERL% %SOLARENV%$/bin$/build.pl %PROFULLSWITCH%
+ *build_client %PERL% %SOLARENV%$/bin$/build_client.pl
+ *copyprj %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ *deliver %PERL% %SOLARENV%$/bin$/deliver.pl
+ *dmake *dmake %PROFULLSWITCH%
+ *mkout %PERL% %SOLARENV%$/bin$/mkout.pl
+ *o cd %SOLARENV%$/..
+ *r cd %SOLARROOT%
+ *s cd %SOLARVERSION%
+ *zipdep %PERL% %SOLARENV%$/bin$/zipdep.pl
+ BIG_SVX
+ COPYPRJ %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ DELIVER %PERL% %SOLARENV%$/bin$/deliver.pl
+ DMAKEROOT %SOLARENV%$/inc$/startup
+ ILIB .$:%UPDMINOREXT%$:%SOLARVERSION%$/%INPATH%$/lib%UPDMINOREXT%$:%PSDK%$/lib$:%FSDK%$/lib$:%COMPATH%$/lib$:
+ JDK13PATH %SOLAR_JDK13PATH%
+ JDK14PATH %SOLAR_JDK14PATH%
+ JDK15PATH %SOLAR_JDK15PATH%
+ LIB .$:%UPDMINOREXT%$:%SOLARVERSION%$/%INPATH%$/lib%UPDMINOREXT%$:%PSDK%$/lib$:%PSDK%$/lib$/x86$:%FSDK%$/lib$:%COMPATH%$/lib$:%SOLAR_STLLIBPATH%
+ MKOUT %PERL% %SOLARENV%$/bin$/mkout.pl
+ PATH %PATH%$:%SOLARVERSION%$/%INPATH%$/lib%UPDMINOREXT%$:%SHARED_COM_SDK_PATH%$:%PSDK%$/bin$:%FSDK%$/bin
+ PSDKINC -I%PSDK%$/include
+ SOLAREXTRAINC -I%COMPATH%$/lib$/gcc-lib$/mingw32$/3.2$/include -I%DSDK%$/include
+ SOLAR_JAVA TRUE
+ XCLASSPATH .
+ ZIPDEP %PERL% %SOLARENV%$/bin$/zipdep.pl
+ }
+ common0
+ {
+ SOLAR_ENV_ROOT r:
+ SOLAR_SOURCE_ROOT o:
+ }
+ common1
+ {
+ COMPATH %SOLAR_ENV_ROOT%$/MinGW
+ # FSDK %SOLAR_ENV_ROOT%$/msvc7net$/FrameworkSDK
+ DEVROOT %SOLAR_ENV_ROOT%
+ NSIS_PATH %SOLAR_ENV_ROOT%$/NSIS_242_unicode
+ PERL %SOLAR_ENV_ROOT%$/btw$/perl$/bin$/perl
+ PKGFORMAT some_dummy
+ PSDK %SOLAR_ENV_ROOT%$/MinGW$/w32api
+ SHARED_COM_SDK_PATH %SOLAR_ENV_ROOT%$/msvc7net$/Common7$/ide
+ SHARED_SOLARENV %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SHARED_SOLARVERSION %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%
+ SOLARENV %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOLAR_ENV_ROOT%
+ SOLARVER %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%
+ SOLARVERSION %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%
+ SO_PACK %SOLAR_ENV_ROOT%$/pack$/%WORK_STAMP%
+ SRC_ROOT %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%
+ }
+ common2
+ {
+ ENABLE_GRAPHITE TRUE
+ BUILD_TOOLS %SOLARROOT%$/btw$/%WORK_STAMP%
+ CALL_CDECL TRUE
+ CDPATHx %CDPATH%$:..$:..$/..$:..$/..$/..$:..$/source$:..$/..$/source$:o:$/%WORK_STAMP%$/ooo%UPDMINOREXT%
+ COM GCC
+ COMMON_BUILD_TOOLS %SOLARROOT%$/btools
+ COMMON_ENV_TOOLS %SOLARROOT%$/etools
+ COMP_ENV wntgcci1
+ CPU I
+ CPUNAME INTEL
+ CVER M1300
+ DYNAMIC_CRT TRUE
+ ENV_TOOLS %SOLARROOT%$/etw$/%WORK_STAMP%
+ GUI WNT
+ GUIBASE WIN
+ GVER NT351
+ INPATH wntgcci1%PROEXT%
+ OS WNT
+ OUTPATH wntgcci1
+ SET_EXEPTIONS TRUE
+ SOLAR_JDK13PATH %SOLARROOT%$/jdk1.3
+ SOLAR_JDK14PATH %SOLARROOT%$/j2sdk1.4.2_11
+ SOLAR_JDK15PATH %SOLARROOT%$/jdk1.5.0.06
+ SOLAR_STLPATH %SOLARVERSION%$/wntgcci1%PROEXT%$/inc%UPDMINOREXT%$/stl
+ SORT sort -T %TMP%
+ use_shl_versions TRUE
+ }
+ compath
+ {
+ COMPATH %STAR_COMPATH%
+ }
+ distroot:0 if X%DIST_ROOT%X != XX
+ {
+ SHARED_SOLARVERSION %DIST_ROOT%$/%WORK_STAMP%
+ SOLARVER %DIST_ROOT%$/%WORK_STAMP%
+ SOLARVERSION %DIST_ROOT%$/%WORK_STAMP%
+ }
+ envroot:0 IF X%ENV_ROOT%X != XX
+ {
+ SOLAR_ENV_ROOT %ENV_ROOT%
+ }
+ jdk14
+ {
+ HOMEDRIVE %DEVROOT%
+ HOMEPATH $/jdk141
+ JAVAHOME %JDK14PATH%
+ JAVA_HOME %JDK14PATH%
+ JDKINC %JDK14PATH%$/include$/win32$:%JDK14PATH%$/include
+ JDKINCS -I%JDK14PATH%$/include -I%JDK14PATH%$/include$/win32
+ JDKLIB -L%JDK14PATH%$/lib
+ JDKLIBS -L%JDK14PATH%$/lib
+ JDKPATH %JDK14PATH%$/bin
+ JDK_VERSION 142
+ JREPATH %JDK14PATH%$/jre$/bin$/client
+ XCLASSPATH .$:%JDK14PATH%$/jre$/lib$/rt.jar
+ }
+ jdk14path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK14PATH %JDK_PATH%
+ }
+ jdk15
+ {
+ HOMEDRIVE %DEVROOT%
+ HOMEPATH $/jdk151
+ JAVAHOME %JDK15PATH%
+ JAVA_HOME %JDK15PATH%
+ JDKINC %JDK15PATH%$/include$/win32$:%JDK15PATH%$/include
+ JDKINCS -I%JDK15PATH%$/include -I%JDK15PATH%$/include$/win32
+ JDKLIB -L%JDK15PATH%$/lib
+ JDKLIBS -L%JDK15PATH%$/lib
+ JDKPATH %JDK15PATH%$/bin
+ JDK_VERSION 150
+ JREPATH %JDK15PATH%$/jre$/bin$/client
+ XCLASSPATH .$:%JDK15PATH%$/jre$/lib$/rt.jar
+ }
+ jdk15path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK15PATH %JDK_PATH%
+ }
+ psdk
+ {
+ PSDK %STAR_PSDK%
+ }
+ sourceroot:0 if X%SOURCE_ROOT%X != XX
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT%
+ SOURCE_ROOT_USED TRUE
+ }
+ }
+ extern
+ {
+ COMSPEC
+ DIST_ROOT
+ ENV_ROOT
+ JDK_PATH
+ LOCALINI
+ SOL_TMP
+ SOURCE_ROOT
+ }
+ order common0 bs_sourceroot envroot:0 sourceroot:0 common1 distroot:0 cap cax psdk compath common2 jdk14path:0 jdk15path:0 common jdk14 jdk15
+ reset
+ {
+ COPYALL
+ NSIS_PATH
+ SOLAR_ENV_ROOT
+ WST
+ }
+ script
+ {
+ csh
+ {
+ 150: setenv MYENV_PATH $PATH
+ 160: setenv PATH $SSX_PATH
+ 200: if ( ${?COPYALL} ) $SOLAR_ENV_ROOT/btw/perl/bin/perl $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 260: setenv PATH $MYENV_PATH
+ 270: unsetenv MYENV_PATH
+ 850: if ( "$?SO_GEN_ERROR" == 0 ) setenv SO_GEN_ERROR
+ 851: if ( "$?SO_GEN_ERROR2" == 0 ) setenv SO_GEN_ERROR2
+ 900: if ( "$?SO_GEN_ERROR" == 1 ) echo $SO_GEN_ERROR
+ 901: if ( "$?SO_GEN_ERROR2" == 1 ) echo $SO_GEN_ERROR2
+ }
+ sh
+ {
+ 150: export MYENV_PATH=$PATH
+ 160: export PATH=$SSX_PATH
+ 260: export PATH=$MYENV_PATH
+ 270: unset MYENV_PATH
+ 400: if [ $COPYALL ]; then
+ 410: $SOLAR_ENV_ROOT/btw/perl/bin/perl $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 415: fi
+ 850: if [ "0$SO_GEN_ERROR" -eq 0 ]; then
+ 851: export SO_GEN_ERROR
+ 852: fi
+ 860: if [ "0$SO_GEN_ERROR2" -eq 0 ]; then
+ 861: export SO_GEN_ERROR
+ 862: fi
+ 870: if [ "0$SO_GEN_ERROR" -eq 0 ]; then
+ 871: echo $SO_GEN_ERROR
+ 872: fi
+ 880: if [ "0$SO_GEN_ERROR2" -eq 0 ]; then
+ 881: echo $SO_GEN_ERROR
+ 882: fi
+ }
+ }
+ switches
+ {
+ bs_sourceroot SOURCE_ROOT_TMP
+ bsclient
+ cap
+ cax
+ compath STAR_COMPATH
+ distroot
+ envroot
+ jdk14
+ jdk14path
+ jdk15
+ jdk15path
+ l10n L10N_framework
+ pro
+ psdk STAR_PSDK
+ sourceroot
+ }
+}
+wntmsci11
+{
+ environment
+ {
+ bs_sourceroot
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT %SOURCE_ROOT_TMP%
+ SOURCE_ROOT_USED TRUE
+ }
+ cap
+ {
+ COMPATH %SOL_TMP%$/r$/msvc8p
+ COMPROOT %SOL_TMP%$/r$/msvc8p
+ COPYALL TRUE
+ COPY_PACKED TRUE
+ DEVROOT %SOL_TMP%$/r
+ DSDK %SOL_TMP%$/r$/msvc8p$/DirectXSDK
+ FSDK %SOL_TMP%$/r$/msvc8p$/Sdk$/v2.0
+ PCLEAN_PATH %SOLARROOT%$/etw
+ PERL %SOL_TMP%$/r$/btw$/perl$/bin$/perl
+ PSDK %SOL_TMP%$/r$/msvc8p$/PlatformSDK
+ SHARED_COM_SDK_PATH %SOL_TMP%$/r$/msvc8p$/Common7$/ide
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ cax
+ {
+ COMPATH %SOL_TMP%$/r$/msvc8p
+ COMPROOT %SOL_TMP%$/r$/msvc8p
+ COPYALL FALSE
+ DSDK %COMPATH%$/DirectXSDK
+ FSDK %COMPATH%$/Sdk$/v2.0
+ PCLEAN_PATH %SOL_TMP%$/r$/etw
+ PERL %SOL_TMP%$/r$/btw$/perl$/bin$/perl
+ PSDK %COMPATH%$/PlatformSDK
+ SHARED_COM_SDK_PATH %COMPATH%$/Common7$/ide
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+ }
+ common
+ {
+ *build %PERL% %SOLARENV%$/bin$/build.pl %PROFULLSWITCH%
+ *build_client %PERL% %SOLARENV%$/bin$/build_client.pl
+ *copyprj %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ *deliver %PERL% %SOLARENV%$/bin$/deliver.pl
+ *mkout %PERL% %SOLARENV%$/bin$/mkout.pl
+ *mwscommit %PERL% %COMMON_ENV_TOOLS%/mwscommit.pl
+ *o cdd %SOLARENV%$/..
+ *r cdd %SOLARROOT%
+ *s cdd %SOLARVERSION%
+ *zipdep %PERL% %SOLARENV%$/bin$/zipdep.pl
+ BIG_SVX
+ COPYPRJ %PERL% %COMMON_ENV_TOOLS%/copyprj.pl
+ DELIVER %PERL% %SOLARENV%$/bin$/deliver.pl
+ DMAKEROOT %SOLARENV%$/inc$/startup
+ ILIB .$:%SOLARVERSION%$/%INPATH%$/lib%UPDMINOREXT%$:%PSDK%$/vc$/lib$:%PSDK%$/lib$:%FSDK%$/lib$:%DSDK%$/lib$/x86
+ JDK13PATH %SOLAR_JDK13PATH%
+ JDK14PATH %SOLAR_JDK14PATH%
+ JDK15PATH %SOLAR_JDK15PATH%
+ LIB .$:%SOLARVERSION%$/%INPATH%$/lib%UPDMINOREXT%$:%PSDK%$/vc$/lib$:%PSDK%$/lib$:%FSDK%$/lib$:%DSDK%$/lib$/x86$:%SOLAR_STLLIBPATH%
+ MKOUT %PERL% %SOLARENV%$/bin$/mkout.pl
+ MWSCOMMIT %PERL% %COMMON_ENV_TOOLS%/mwscommit.pl
+ PATH %PATH%$:%SHARED_COM_SDK_PATH%$:%PSDK%$/vc$/bin$:%PSDK%$/bin$:%FSDK%$/bin$:%DSDK%$/bin$/Utilities$/bin$/x86$:%PACKMS%
+ PROF_EDITION TRUE
+ PSDKINC -I%PSDK%$/vc$/include -I%PSDK%$/include -I%COMPATH%$/PlatformSDK_VC8$/include
+ SOLAREXTRAINC -I%DSDK%$/include
+ SOLAR_JAVA TRUE
+ TRUSTED_MANIFEST_LOCATION %SOLARENV%$/inc
+ VISTA_MANIFEST TRUE
+ WINDOWS_VISTA_PSDK TRUE
+ XCLASSPATH .
+ ZIPDEP %PERL% %SOLARENV%$/bin$/zipdep.pl
+ }
+ common0
+ {
+ BS_ROOT n:
+ SOLAR_ENV_ROOT r:
+ SOLAR_SOURCE_ROOT o:
+ }
+ common1
+ {
+ COMPATH %SOLAR_ENV_ROOT%$/msvc8p
+ COMPROOT %SOLAR_ENV_ROOT%$/msvc8p
+ DEVROOT %SOLAR_ENV_ROOT%
+ DSDK %SOLAR_ENV_ROOT%$/msvc8p$/DirectXSDK
+ FSDK %SOLAR_ENV_ROOT%$/msvc8p$/Sdk$/v2.0
+ PERL %SOLAR_ENV_ROOT%$/btw$/perl$/bin$/perl
+ PKGFORMAT msi
+ PSDK %SOLAR_ENV_ROOT%$/msvc8p$/PlatformSDK
+ SHARED_COM_SDK_PATH %SOLAR_ENV_ROOT%$/msvc8p$/Common7$/ide
+ SHARED_SOLARENV %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SHARED_SOLARVERSION %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%
+ SOLARENV %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOLAR_ENV_ROOT%
+ SOLARVER %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%
+ SOLARVERSION %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%
+ SO_PACK %SOLAR_ENV_ROOT%$/pack$/%WORK_STAMP%
+ SRC_ROOT %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%
+ }
+ common2
+ {
+ ENABLE_GRAPHITE TRUE
+ BUILD_TOOLS %SOLARROOT%$/btw$/%WORK_STAMP%
+ CALL_CDECL TRUE
+ CDPATHx %CDPATH%$:..$:..$/..$:..$/..$/..$:..$/source$:..$/..$/source$:o:$/%WORK_STAMP%$/ooo%UPDMINOREXT%
+ COM MSC
+ COMEX 11
+ COMMON_BUILD_TOOLS %SOLARROOT%$/btools
+ COMMON_ENV_TOOLS %SOLARROOT%$/etools
+ COMP_ENV wntmsci11
+ CPU I
+ CPUNAME INTEL
+ CVER M1400
+ DYNAMIC_CRT TRUE
+ ENV_TOOLS %SOLARROOT%$/etw$/%WORK_STAMP%
+ GUI WNT
+ GUIBASE WIN
+ GVER NT351
+ INPATH wntmsci11%PROEXT%
+ OS WNT
+ OUTPATH wntmsci11
+ PACKMS %SO_PACK%$/wntmsci11$/MS
+ SET_EXEPTIONS TRUE
+ SHIPDRIVE %BS_ROOT%$/ship$/install
+ SOLAR_JDK13PATH %SOLARROOT%$/jdk1.3
+ SOLAR_JDK14PATH %SOLARROOT%$/j2sdk1.4.2_11
+ SOLAR_JDK15PATH %SOLARROOT%$/jdk1.5.0.06
+ SOLAR_STLPATH %SOLARVERSION%$/wntmsci11%PROEXT%$/inc%UPDMINOREXT%$/stl
+ SORT sort -T %TMP%
+ use_shl_versions TRUE
+ }
+ compath
+ {
+ COMPATH %STAR_COMPATH%
+ }
+ distroot:0 if X%DIST_ROOT%X != XX
+ {
+ SHARED_SOLARVERSION %DIST_ROOT%$/%WORK_STAMP%
+ SOLARVER %DIST_ROOT%$/%WORK_STAMP%
+ SOLARVERSION %DIST_ROOT%$/%WORK_STAMP%
+ }
+ envroot:0 IF X%ENV_ROOT%X != XX
+ {
+ SOLAR_ENV_ROOT %ENV_ROOT%
+ }
+ jdk14
+ {
+ HOMEDRIVE %DEVROOT%
+ HOMEPATH $/jdk141
+ JAVAHOME %JDK14PATH%
+ JAVA_HOME %JDK14PATH%
+ JDKINC %JDK14PATH%$/include$/win32$:%JDK14PATH%$/include
+ JDKINCS -I%JDK14PATH%$/include -I%JDK14PATH%$/include$/win32
+ JDKLIB %JDK14PATH%$/lib
+ JDKLIBS %JDK14PATH%$/lib
+ JDKPATH %JDK14PATH%$/bin
+ JDK_VERSION 142
+ JREPATH %JDK14PATH%$/jre$/bin$/client
+ XCLASSPATH .$:%JDK14PATH%$/jre$/lib$/rt.jar
+ }
+ jdk14path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK14PATH %JDK_PATH%
+ }
+ jdk15
+ {
+ HOMEDRIVE %DEVROOT%
+ HOMEPATH $/jdk151
+ JAVAHOME %JDK15PATH%
+ JAVA_HOME %JDK15PATH%
+ JDKINC %JDK15PATH%$/include$/win32$:%JDK15PATH%$/include
+ JDKINCS -I%JDK15PATH%$/include -I%JDK15PATH%$/include$/win32
+ JDKLIB %JDK15PATH%$/lib
+ JDKLIBS %JDK15PATH%$/lib
+ JDKPATH %JDK15PATH%$/bin
+ JDK_VERSION 150
+ JREPATH %JDK15PATH%$/jre$/bin$/client
+ XCLASSPATH .$:%JDK15PATH%$/jre$/lib$/rt.jar
+ }
+ jdk15path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK15PATH %JDK_PATH%
+ }
+ psdk
+ {
+ PSDK %STAR_PSDK%
+ }
+ sourceroot:0 if X%SOURCE_ROOT%X != XX
+ {
+ SOLAR_SOURCE_ROOT %SOURCE_ROOT%
+ SOURCE_ROOT_USED TRUE
+ }
+ }
+ extern
+ {
+ COMSPEC
+ DIST_ROOT
+ ENV_ROOT
+ JDK_PATH
+ LOCALINI
+ SOL_TMP
+ SOURCE_ROOT
+ }
+ order common0 bs_sourceroot envroot:0 sourceroot:0 common1 distroot:0 cap cax psdk compath common2 jdk14path:0 jdk15path:0 common jdk14 jdk15
+ reset
+ {
+ COPYALL
+ SOLAR_ENV_ROOT
+ WST
+ }
+ script
+ {
+ post
+ {
+ 150: set MYENV_PATH=%PATH
+ 160: set PATH=%SSX_PATH
+ 200: if "%COPYALL%"=="TRUE" %SOLAR_ENV_ROOT%\btw\perl\bin\perl %SOLAR_ENV_ROOT%\etools\lucopy.pl -all %BTARGET% $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 260: set PATH=%MYENV_PATH
+ 270: unset MYENV_PATH
+ 400: if "%SO_GEN_ERROR%" NE "" @echo %SO_GEN_ERROR%
+ 401: if "%SO_GEN_ERROR2%" NE "" echo %SO_GEN_ERROR2%
+ }
+ }
+ switches
+ {
+ bs_sourceroot SOURCE_ROOT_TMP
+ bsclient
+ cap
+ cax
+ compath STAR_COMPATH
+ distroot
+ envroot
+ jdk14
+ jdk14path
+ jdk15
+ jdk15path
+ l10n L10N_framework
+ pro
+ psdk STAR_PSDK
+ sourceroot
+ }
+}
+wntmsci12
+{
+ environment
+ {
+ bs_sourceroot
+ {
+ SOLAR_SOURCE_ROOT $dp(%SOURCE_ROOT_TMP%)
+ SOURCE_ROOT $dp(%SOURCE_ROOT_TMP%)
+ SOURCE_ROOT_USED TRUE
+ }
+ cap
+ {
+ BUILD_TOOLS %SOL_TMP%$/btw$/%BTOOLDIR%
+ COMPATH %SOL_TMP%$/r$/msvc9p
+ COMPROOT %SOL_TMP%$/r$/msvc9p
+ COPYALL TRUE
+ COPY_PACKED TRUE
+ DEVROOT %SOL_TMP%$/r
+ DSDK %SOL_TMP%$/r$/msvc9p$/DirectXSDK
+ ENV_TOOLS %SOL_TMP%$/r$/etw$/%WORK_STAMP%
+ FSDK %SOL_TMP%$/r$/msvc9p$/Sdk$/v3.5
+ F20SDK %SOL_TMP%$/r$/msvc9p$/Sdk$/v2.0
+ NSIS_PATH %SOL_TMP%$/r$/NSIS_242_unicode
+ PCLEAN_PATH %SOLARROOT%$/etw
+ PERL %SOL_TMP%$/r$/%PERLDIR%
+ PSDK %SOL_TMP%$/r$/msvc9p$/PlatformSDK$/v6.1
+ SHARED_COM_SDK_PATH %SOL_TMP%$/r$/msvc9p$/Common7$/IDE
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+# TOUCH %SOL_TMP%$/r$/btw$/%BTOOLDIR%$/touch.exe
+
+ }
+ cax
+ {
+ BUILD_TOOLS %SOL_TMP%$/r$/btw$/%BTOOLDIR%
+ COMPATH %SOL_TMP%$/r$/msvc9p
+ COMPROOT %SOL_TMP%$/r$/msvc9p
+ COPYALL FALSE
+ DSDK %COMPATH%$/DirectXSDK
+ ENV_TOOLS %SOL_TMP%$/r$/etw$/%WORK_STAMP%
+ FSDK %COMPATH%$/Sdk$/v3.5
+ F20SDK %SOL_TMP%$/r$/msvc9p$/Sdk$/v2.0
+ NSIS_PATH %SOL_TMP%$/r$/NSIS_242_unicode
+ PCLEAN_PATH %SOL_TMP%$/r$/etw
+ PERL %SOL_TMP%$/r$/%PERLDIR%
+ PSDK %COMPATH%$/PlatformSDK$/v6.1
+ SHARED_COM_SDK_PATH %COMPATH%$/Common7$/IDE
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+# TOUCH %SOL_TMP%$/r$/btw$/%BTOOLDIR%$/touch.exe
+ }
+ common
+ {
+ *build %PERL% %SOLARENV%$/bin$/build.pl %PROFULLSWITCH%
+ *build_client %PERL% %SOLARENV%$/bin$/build_client.pl
+ *copyprj %PERL% %COMMON_ENV_TOOLS%$/copyprj.pl
+ *deliver %PERL% %SOLARENV%$/bin$/deliver.pl
+ *mkout %PERL% %SOLARENV%$/bin$/mkout.pl
+ *mwscommit %PERL% %COMMON_ENV_TOOLS%$/mwscommit.pl
+ *o cd %SOLARENV%$/..
+ *r cd %SOLARROOT%
+ *s cd %SOLARVERSION%
+ *zipdep %PERL% %SOLARENV%$/bin$/zipdep.pl
+ *z_ooo %PERL% %SOLARENV%$/bin$/z_ooo.pl
+ BIG_SVX
+ COPYPRJ %PERL% %COMMON_ENV_TOOLS%$/copyprj.pl
+ CXX_X64_BINARY %COMPROOT%$/bin$/x86_amd64$/cl.exe
+ DELIVER %PERL% %SOLARENV%$/bin$/deliver.pl
+ DMAKEROOT %SOLARENV%$/inc$/startup
+ ENABLE_PCH TRUE
+ ILIB .;%SOLARVERSION%$/%INPATH%$/lib%UPDMINOREXT%;%COMPATH%$/lib;%PSDK%$/lib;%DSDK%$/lib$/x86
+ JDK13PATH %SOLAR_JDK13PATH%
+ JDK14PATH %SOLAR_JDK14PATH%
+ JDK15PATH %SOLAR_JDK15PATH%
+ LIB .;%SOLARVERSION%$/%INPATH%$/lib%UPDMINOREXT%;%COMPATH%$/lib;%PSDK%$/lib;%DSDK%$/lib$/x86;%SOLAR_STLLIBPATH%
+ LIBMGR_X64_BINARY %COMPROOT%$/bin$/x86_amd64$/lib.exe
+ LINK_X64_BINARY %COMPROOT%$/bin$/x86_amd64$/link.exe
+ MKOUT %PERL% %SOLARENV%$/bin$/mkout.pl
+ MWSCOMMIT %PERL% %COMMON_ENV_TOOLS%$/mwscommit.pl
+ OJDK16PATH %SOLAR_OJDK16PATH%
+ PATH $cp(%PSDK%$/Bin)$:%PATH%$:$cp(%SHARED_COM_SDK_PATH%)$:$cp(%COMPATH%$/bin)$:$cp(%FSDK%)$:$cp(%F20SDK%)$/bin$:$cp(%DSDK%$/Utilities$/bin$/x86)$:$cp(%PACKMS%)
+ PROF_EDITION TRUE
+ PSDKINC -I%PSDK%$/include
+ SOLAREXTRAINC -I%DSDK%$/include
+ SOLAR_JAVA TRUE
+ TRUSTED_MANIFEST_LOCATION %SOLARENV%$/inc
+ USE_DIRECTX5 TRUE
+ WINDOWS_VISTA_PSDK TRUE
+ SYSBASE TRUE
+ WITH_VC_REDIST TRUE
+ XCLASSPATH .
+ ZIPDEP %PERL% %SOLARENV%$/bin$/zipdep.pl
+ BUILD_X64 TRUE
+ CHECK_LUCENCE_INDEXER_OUTPUT TRUE
+ GNUCOPY cp
+ }
+ common0
+ {
+ BS_ROOT n:
+ SOLAR_ENV_ROOT r:
+ SOLAR_SOURCE_ROOT o:
+ BTOOLDIR %WORK_STAMP%$/cygtools
+ PERLDIR btw$/%WORK_STAMP%$/cygtools$/perl
+ }
+ common02
+ {
+ PERL perl
+ }
+ common1
+ {
+ COMPATH %SOLAR_ENV_ROOT%$/msvc9p
+ COMPROOT %SOLAR_ENV_ROOT%$/msvc9p
+ DEVROOT %SOLAR_ENV_ROOT%
+ DSDK %SOLAR_ENV_ROOT%$/msvc9p$/DirectXSDK
+ FSDK %SOLAR_ENV_ROOT%$/msvc9p$/Sdk$/v3.5
+ F20SDK %SOLAR_ENV_ROOT%$/msvc9p$/Sdk$/v2.0
+ NSIS_PATH %SOLAR_ENV_ROOT%$/NSIS_242_unicode
+ PERL %SOLAR_ENV_ROOT%$/%PERLDIR%
+ PKGFORMAT msi
+ PSDK %SOLAR_ENV_ROOT%$/msvc9p$/PlatformSDK$/v6.1
+ SHARED_COM_SDK_PATH %SOLAR_ENV_ROOT%$/msvc9p$/Common7$/ide
+ SHARED_SOLARENV %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SHARED_SOLARVERSION %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%
+ SOLARENV %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOLAR_ENV_ROOT%
+ SOLARVER %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%
+ SOLARVERSION %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%
+ SO_PACK %SOLAR_ENV_ROOT%$/pack$/%WORK_STAMP%
+ SRC_ROOT %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%
+# TEMP $dp(%TEMP%)
+# TMP $dp(%TMP%)
+ }
+ common2
+ {
+ ENABLE_GRAPHITE TRUE
+ BUILD_TOOLS %SOLARROOT%$/btw$/%BTOOLDIR%
+ CALL_CDECL TRUE
+ CDPATHx %CDPATH%$:..$:..$/..$:..$/..$/..$:..$/source$:..$/..$/source$:$cp(%SOLAR_SOURCE_ROOT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%)
+ COM MSC
+ COMEX 12
+ COMMON_BUILD_TOOLS $cp(%SOLARROOT%$/btools)
+ COMMON_ENV_TOOLS %SOLARROOT%$/etools
+ COMP_ENV wntmsci12
+ CPU I
+ CPUNAME INTEL
+ CVER M1500
+ DYNAMIC_CRT TRUE
+ ENV_TOOLS %SOLARROOT%$/etw$/%WORK_STAMP%
+ GUI WNT
+ GUIBASE WIN
+ GVER NT351
+ INPATH wntmsci12%PROEXT%
+ LIBMYSQL_PATH %SOLARROOT%$/mysql-connector-c-6.0.2$/wntmsci12
+ MOZILLABUILD %SOLARROOT%/mozilla-build-1.3
+ OS WNT
+ OUTPATH wntmsci12
+ PACKMS %SO_PACK%$/wntmsci12$/MS
+ SET_EXEPTIONS TRUE
+ SHIPDRIVE %SOLAR_ENV_ROOT%$/ship$/install
+ SOLAR_JDK13PATH %SOLARROOT%$/jdk1.3
+ SOLAR_JDK14PATH %SOLARROOT%$/j2sdk1.4.2_11
+ SOLAR_JDK15PATH %SOLARROOT%$/jdk1.5.0.06
+ SOLAR_OJDK16PATH %SOLARROOT%$/openjdk-6-b08-windows-i586
+ SOLAR_STLPATH %SOLARVERSION%$/wntmsci12%PROEXT%$/inc%UPDMINOREXT%$/stl
+ SORT sort -T %TMP%
+# TOUCH %SOLARROOT%$/btw$/%BTOOLDIR%$/touch.exe
+ use_shl_versions TRUE
+ }
+ common:3 IF %UPDATER% == YES
+ {
+ SHIPDRIVE %BS_ROOT%$/ship$/install
+ }
+ compath
+ {
+ COMPATH $dp(%STAR_COMPATH%)
+ }
+ distroot:0 if X%DIST_ROOT%X != XX
+ {
+ SHARED_SOLARVERSION $dp(%DIST_ROOT%$/%WORK_STAMP%)
+ SOLARVER $dp(%DIST_ROOT%$/%WORK_STAMP%)
+ SOLARVERSION $dp(%DIST_ROOT%$/%WORK_STAMP%)
+ }
+ envroot:0 IF X%ENV_ROOT%X != XX
+ {
+ SOLAR_ENV_ROOT $dp(%ENV_ROOT%)
+ }
+ jdk14
+ {
+# HOMEDRIVE %DEVROOT%
+# HOMEPATH $/jdk141
+ JAVAHOME %JDK14PATH%
+ JAVA_HOME %JDK14PATH%
+ JDKINC %JDK14PATH%$/include$/win32;%JDK14PATH%$/include
+ JDKINCS -I%JDK14PATH%$/include -I%JDK14PATH%$/include$/win32
+ JDKLIB %JDK14PATH%$/lib
+ JDKLIBS %JDK14PATH%$/lib
+ JDKPATH %JDK14PATH%$/bin
+ JDK_VERSION 142
+ JREPATH %JDK14PATH%$/jre$/bin$/client
+ XCLASSPATH .;%JDK14PATH%$/jre$/lib$/rt.jar
+ }
+ jdk14path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK14PATH $dp(%JDK_PATH%)
+ }
+ jdk15
+ {
+# HOMEDRIVE %DEVROOT%
+# HOMEPATH $/jdk151
+ JAVAHOME %JDK15PATH%
+ JAVA_HOME %JDK15PATH%
+ JDKINC %JDK15PATH%$/include$/win32;%JDK15PATH%$/include
+ JDKINCS -I%JDK15PATH%$/include -I%JDK15PATH%$/include$/win32
+ JDKLIB %JDK15PATH%$/lib
+ JDKLIBS %JDK15PATH%$/lib
+ JDKPATH %JDK15PATH%$/bin
+ JDK_VERSION 150
+ JREPATH %JDK15PATH%$/jre$/bin$/client
+ XCLASSPATH .;%JDK15PATH%$/jre$/lib$/rt.jar
+ }
+ jdk15path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK15PATH $dp(%JDK_PATH%)
+ }
+ ojdk16
+ {
+# HOMEDRIVE %DEVROOT%
+# HOMEPATH $/openjdk-6-b08-windows-i586
+ JAVA_HOME %OJDK16PATH%
+ JDKINC %OJDK16PATH%$/include$/win32;%OJDK16PATH%$/include
+ JDKINCS -I%OJDK16PATH%$/include -I%OJDK16PATH%$/include$/win32
+ JDKLIB %OJDK16PATH%$/lib
+ JDKLIBS %OJDK16PATH%$/lib
+ JDKPATH %OJDK16PATH%$/bin
+ JDK_VERSION 160
+ JREPATH %OJDK16PATH%$/jre$/bin$/client
+ XCLASSPATH .;%OJDK16PATH%$/jre$/lib$/rt.jar
+ }
+ ojdk16path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_OJDK16PATH $dp(%JDK_PATH%)
+ }
+ pro
+ {
+ RES_ENUS TRUE
+ }
+ psdk
+ {
+ PSDK $dp(%STAR_PSDK%)
+ }
+ sourceroot:0 if X%SOURCE_ROOT%X != XX
+ {
+ SOLAR_SOURCE_ROOT $dp(%SOURCE_ROOT%)
+ SOURCE_ROOT_USED TRUE
+ }
+ tmp
+ {
+ SOL_TMP $dp(%SOL_TMP_DIR%)
+ }
+ }
+ extern
+ {
+ COMSPEC
+ DIST_ROOT
+ ENV_ROOT
+ JDK_PATH
+ LOCALINI
+ OSTYPE
+ $dp(SOL_TMP)
+ $dp(SOURCE_ROOT)
+ $dp(TMP)
+ $dp(TEMP)
+ }
+ order common0 bs_sourceroot tmp envroot:0 sourceroot:0 pro common1 distroot:0 cap cax common02 psdk compath common2 common:3 jdk14path:0 jdk15path:0 ojdk16path:0 common jdk14 jdk15 ojdk16
+ reset
+ {
+ COPYALL
+ CXX_X64_BINARY
+ DB2IMP
+ GCRINC
+ GCRLIB
+ GCRPATH
+ LIBMGR_X64_BINARY
+ LINK_X64_BINARY
+ NSIS_PATH
+ OLD_CHAOS
+ PERLDIR
+ SOLAR_ENV_ROOT
+ TFDEF
+ TFDIR
+ WST
+ }
+ script
+ {
+ sh
+ {
+ 400: if [ $COPYALL ]; then
+ 410: perl $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 415: fi
+ 600: umask 002
+ 800: hash -r
+ 820: wrapfetch.sh
+ 850: if [ "0$SO_GEN_ERROR" -eq 0 ]; then
+ 851: export SO_GEN_ERROR
+ 852: fi
+ 860: if [ "0$SO_GEN_ERROR2" -eq 0 ]; then
+ 861: export SO_GEN_ERROR2
+ 862: fi
+ 870: if [ "0$SO_GEN_ERROR" -ne 0 ]; then
+ 871: echo $SO_GEN_ERROR
+ 872: fi
+ 880: if [ "0$SO_GEN_ERROR2" -ne 0 ]; then
+ 881: echo $SO_GEN_ERROR2
+ 882: fi
+ }
+ }
+ switches
+ {
+ bs_sourceroot SOURCE_ROOT_TMP
+ bsclient
+ cap
+ cax
+ compath STAR_COMPATH
+ distroot
+ envroot
+ jdk14
+ jdk14path
+ jdk15
+ jdk15path
+ l10n L10N_framework
+ ojdk16
+ ojdk16path
+ pro
+ psdk STAR_PSDK
+ sourceroot
+ tmp SOL_TMP_DIR
+ }
+}
+wntmsci13
+{
+ environment
+ {
+ bs_sourceroot
+ {
+ SOLAR_SOURCE_ROOT $dp(%SOURCE_ROOT_TMP%)
+ SOURCE_ROOT $dp(%SOURCE_ROOT_TMP%)
+ SOURCE_ROOT_USED TRUE
+ }
+ cap
+ {
+ BUILD_TOOLS %SOL_TMP%$/r$/btw$/%BTOOLDIR%
+ COMPATH %SOL_TMP%$/r$/msvc9p
+ COMPROOT %SOL_TMP%$/r$/msvc9p
+ COPYALL TRUE
+ COPY_PACKED TRUE
+ DEVROOT %SOL_TMP%$/r
+ DSDK %SOL_TMP%$/r$/msvc9p$/DirectXSDK
+ ENV_TOOLS %SOL_TMP%$/r$/etw$/%WORK_STAMP%
+ FSDK %SOL_TMP%$/r$/msvc9p$/Sdk$/v3.5
+ F20SDK %SOL_TMP%$/r$/msvc9p$/Sdk$/v2.0
+ NSIS_PATH %SOL_TMP%$/r$/NSIS_242_unicode
+ PCLEAN_PATH %SOLARROOT%$/etw
+ PERL %SOL_TMP%$/r$/%PERLDIR%
+ PSDK %SOL_TMP%$/r$/msvc9p$/PlatformSDK$/v6.1
+ SHARED_COM_SDK_PATH %SOL_TMP%$/r$/msvc9p$/Common7$/IDE
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+# TOUCH %SOL_TMP%$/r$/btw$/%BTOOLDIR%$/touch.exe
+
+ }
+ cax
+ {
+ BUILD_TOOLS %SOL_TMP%$/r$/btw$/%BTOOLDIR%
+ COMPATH %SOL_TMP%$/r$/msvc9p
+ COMPROOT %SOL_TMP%$/r$/msvc9p
+ COPYALL FALSE
+ DSDK %COMPATH%$/DirectXSDK
+ ENV_TOOLS %SOL_TMP%$/r$/etw$/%WORK_STAMP%
+ FSDK %COMPATH%$/Sdk$/v3.5
+ F20SDK %SOL_TMP%$/r$/msvc9p$/Sdk$/v2.0
+ NSIS_PATH %SOL_TMP%$/r$/NSIS_242_unicode
+ PCLEAN_PATH %SOL_TMP%$/r$/etw
+ PERL %SOL_TMP%$/r$/%PERLDIR%
+ PSDK %COMPATH%$/PlatformSDK$/v6.1
+ SHARED_COM_SDK_PATH %COMPATH%$/Common7$/IDE
+ SOLARENV %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOL_TMP%$/r
+ SOLARVER %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SOLARVERSION %SOL_TMP%$/o%CWS_WORK_STAMP_EXT%$/%WORK_STAMP%
+ SO_PACK %SOL_TMP%$/r$/pack$/%WORK_STAMP%
+# TOUCH %SOL_TMP%$/r$/btw$/%BTOOLDIR%$/touch.exe
+ }
+ common
+ {
+ *build %PERL% %SOLARENV%$/bin$/build.pl %PROFULLSWITCH%
+ *build_client %PERL% %SOLARENV%$/bin$/build_client.pl
+ *copyprj %PERL% %COMMON_ENV_TOOLS%$/copyprj.pl
+ *deliver %PERL% %SOLARENV%$/bin$/deliver.pl
+ *mkout %PERL% %SOLARENV%$/bin$/mkout.pl
+ *mwscommit %PERL% %COMMON_ENV_TOOLS%$/mwscommit.pl
+ *o cd %SOLARENV%$/..
+ *r cd %SOLARROOT%
+ *s cd %SOLARVERSION%
+ *zipdep %PERL% %SOLARENV%$/bin$/zipdep.pl
+ *z_ooo %PERL% %SOLARENV%$/bin$/z_ooo.pl
+ BIG_SVX
+ COPYPRJ %PERL% %COMMON_ENV_TOOLS%$/copyprj.pl
+ CXX_X64_BINARY %COMPROOT%$/bin$/x86_amd64$/cl.exe
+ DELIVER %PERL% %SOLARENV%$/bin$/deliver.pl
+ DMAKEROOT %SOLARENV%$/inc$/startup
+ ENABLE_PCH TRUE
+ ILIB .;%SOLARVERSION%$/%INPATH%$/lib%UPDMINOREXT%;%COMPATH%$/lib;%PSDK%$/lib;%DSDK%$/lib$/x86
+ JDK13PATH %SOLAR_JDK13PATH%
+ JDK14PATH %SOLAR_JDK14PATH%
+ JDK15PATH %SOLAR_JDK15PATH%
+ LIB .;%SOLARVERSION%$/%INPATH%$/lib%UPDMINOREXT%;%COMPATH%$/lib;%PSDK%$/lib;%DSDK%$/lib$/x86;%SOLAR_STLLIBPATH%
+ LIBMGR_X64_BINARY %COMPROOT%$/bin$/x86_amd64$/lib.exe
+ LINK_X64_BINARY %COMPROOT%$/bin$/x86_amd64$/link.exe
+ MKOUT %PERL% %SOLARENV%$/bin$/mkout.pl
+ MWSCOMMIT %PERL% %COMMON_ENV_TOOLS%$/mwscommit.pl
+ OJDK16PATH %SOLAR_OJDK16PATH%
+ PATH $cp(%PSDK%$/Bin)$:%PATH%$:$cp(%SHARED_COM_SDK_PATH%)$:$cp(%COMPATH%$/bin)$:$cp(%FSDK%)$:$cp(%F20SDK%)$/bin$:$cp(%DSDK%$/Utilities$/bin$/x86)$:$cp(%PACKMS%)
+ PROF_EDITION TRUE
+ PSDKINC -I%PSDK%$/include
+ SOLAREXTRAINC -I%DSDK%$/include
+ SOLAR_JAVA TRUE
+ TRUSTED_MANIFEST_LOCATION %SOLARENV%$/inc
+ USE_DIRECTX5 TRUE
+ WINDOWS_VISTA_PSDK TRUE
+ SYSBASE TRUE
+ WITH_VC_REDIST TRUE
+ XCLASSPATH .
+ ZIPDEP %PERL% %SOLARENV%$/bin$/zipdep.pl
+ BUILD_X64 TRUE
+ GNUCOPY cp
+ }
+ common0
+ {
+ BS_ROOT n:
+ SOLAR_ENV_ROOT r:
+ SOLAR_SOURCE_ROOT o:
+ BTOOLDIR %WORK_STAMP%$/cygtools
+ PERLDIR btw$/%WORK_STAMP%$/cygtools$/perl
+ }
+ common02
+ {
+ PERL perl
+ }
+ common1
+ {
+ COMPATH %SOLAR_ENV_ROOT%$/msvc9p
+ COMPROOT %SOLAR_ENV_ROOT%$/msvc9p
+ DEVROOT %SOLAR_ENV_ROOT%
+ DSDK %SOLAR_ENV_ROOT%$/msvc9p$/DirectXSDK
+ FSDK %SOLAR_ENV_ROOT%$/msvc9p$/Sdk$/v3.5
+ F20SDK %SOLAR_ENV_ROOT%$/msvc9p$/Sdk$/v2.0
+ NSIS_PATH %SOLAR_ENV_ROOT%$/NSIS_242_unicode
+ PERL %SOLAR_ENV_ROOT%$/%PERLDIR%
+ PKGFORMAT msi
+ PSDK %SOLAR_ENV_ROOT%$/msvc9p$/PlatformSDK$/v6.1
+ SHARED_COM_SDK_PATH %SOLAR_ENV_ROOT%$/msvc9p$/Common7$/ide
+ SHARED_SOLARENV %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SHARED_SOLARVERSION %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%
+ SOLARENV %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%$/solenv
+ SOLARROOT %SOLAR_ENV_ROOT%
+ SOLARVER %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%
+ SOLARVERSION %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%
+ SO_PACK %SOLAR_ENV_ROOT%$/pack$/%WORK_STAMP%
+ SRC_ROOT %SOLAR_SOURCE_ROOT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%
+# TEMP $dp(%TEMP%)
+# TMP $dp(%TMP%)
+ }
+ common2
+ {
+ ENABLE_GRAPHITE TRUE
+ BUILD_TOOLS %SOLARROOT%$/btw$/%BTOOLDIR%
+ CALL_CDECL TRUE
+ CDPATHx %CDPATH%$:..$:..$/..$:..$/..$/..$:..$/source$:..$/..$/source$:$cp(%SOLAR_SOURCE_ROOT%$/%WORK_STAMP%$/ooo%UPDMINOREXT%)
+ COM MSC
+ COMEX 12
+ COMMON_BUILD_TOOLS $cp(%SOLARROOT%$/btools)
+ COMMON_ENV_TOOLS %SOLARROOT%$/etools
+ COMP_ENV wntmsci13
+ CPU I
+ CPUNAME INTEL
+ CVER M1500
+ DYNAMIC_CRT TRUE
+ ENV_TOOLS %SOLARROOT%$/etw$/%WORK_STAMP%
+ GUI WNT
+ GUIBASE WIN
+ GVER NT351
+ INPATH wntmsci13%PROEXT%
+ MOZILLABUILD %SOLARROOT%/mozilla-build-1.3
+ OS WNT
+ OUTPATH wntmsci13
+ PACKMS %SO_PACK%$/wntmsci13$/MS
+ SET_EXEPTIONS TRUE
+ SHIPDRIVE %SOLAR_ENV_ROOT%$/ship$/install
+ SOLAR_JDK13PATH %SOLARROOT%$/jdk1.3
+ SOLAR_JDK14PATH %SOLARROOT%$/j2sdk1.4.2_11
+ SOLAR_JDK15PATH %SOLARROOT%$/jdk1.5.0.06
+ SOLAR_OJDK16PATH %SOLARROOT%$/openjdk-6-b08-windows-i586
+ SOLAR_STLPATH %SOLARVERSION%$/wntmsci13%PROEXT%$/inc%UPDMINOREXT%$/stl
+ SORT sort -T %TMP%
+# TOUCH %SOLARROOT%$/btw$/%BTOOLDIR%$/touch.exe
+ use_shl_versions TRUE
+ }
+ common:3 IF %UPDATER% == YES
+ {
+ SHIPDRIVE %BS_ROOT%$/ship$/install
+ }
+ compath
+ {
+ COMPATH $dp(%STAR_COMPATH%)
+ }
+ distroot:0 if X%DIST_ROOT%X != XX
+ {
+ SHARED_SOLARVERSION $dp(%DIST_ROOT%$/%WORK_STAMP%)
+ SOLARVER $dp(%DIST_ROOT%$/%WORK_STAMP%)
+ SOLARVERSION $dp(%DIST_ROOT%$/%WORK_STAMP%)
+ }
+ envroot:0 IF X%ENV_ROOT%X != XX
+ {
+ SOLAR_ENV_ROOT $dp(%ENV_ROOT%)
+ }
+ jdk14
+ {
+# HOMEDRIVE %DEVROOT%
+# HOMEPATH $/jdk141
+ JAVAHOME %JDK14PATH%
+ JAVA_HOME %JDK14PATH%
+ JDKINC %JDK14PATH%$/include$/win32;%JDK14PATH%$/include
+ JDKINCS -I%JDK14PATH%$/include -I%JDK14PATH%$/include$/win32
+ JDKLIB %JDK14PATH%$/lib
+ JDKLIBS %JDK14PATH%$/lib
+ JDKPATH %JDK14PATH%$/bin
+ JDK_VERSION 142
+ JREPATH %JDK14PATH%$/jre$/bin$/client
+ XCLASSPATH .;%JDK14PATH%$/jre$/lib$/rt.jar
+ }
+ jdk14path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK14PATH $dp(%JDK_PATH%)
+ }
+ jdk15
+ {
+# HOMEDRIVE %DEVROOT%
+# HOMEPATH $/jdk151
+ JAVAHOME %JDK15PATH%
+ JAVA_HOME %JDK15PATH%
+ JDKINC %JDK15PATH%$/include$/win32;%JDK15PATH%$/include
+ JDKINCS -I%JDK15PATH%$/include -I%JDK15PATH%$/include$/win32
+ JDKLIB %JDK15PATH%$/lib
+ JDKLIBS %JDK15PATH%$/lib
+ JDKPATH %JDK15PATH%$/bin
+ JDK_VERSION 150
+ JREPATH %JDK15PATH%$/jre$/bin$/client
+ XCLASSPATH .;%JDK15PATH%$/jre$/lib$/rt.jar
+ }
+ jdk15path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_JDK15PATH $dp(%JDK_PATH%)
+ }
+ ojdk16
+ {
+# HOMEDRIVE %DEVROOT%
+# HOMEPATH $/openjdk-6-b08-windows-i586
+ JAVA_HOME %OJDK16PATH%
+ JDKINC %OJDK16PATH%$/include$/win32;%OJDK16PATH%$/include
+ JDKINCS -I%OJDK16PATH%$/include -I%OJDK16PATH%$/include$/win32
+ JDKLIB %OJDK16PATH%$/lib
+ JDKLIBS %OJDK16PATH%$/lib
+ JDKPATH %OJDK16PATH%$/bin
+ JDK_VERSION 160
+ JREPATH %OJDK16PATH%$/jre$/bin$/client
+ XCLASSPATH .;%OJDK16PATH%$/jre$/lib$/rt.jar
+ }
+ ojdk16path:0 if X%JDK_PATH%X != XX
+ {
+ SOLAR_OJDK16PATH $dp(%JDK_PATH%)
+ }
+ pro
+ {
+ RES_ENUS TRUE
+ }
+ psdk
+ {
+ PSDK $dp(%STAR_PSDK%)
+ }
+ sourceroot:0 if X%SOURCE_ROOT%X != XX
+ {
+ SOLAR_SOURCE_ROOT $dp(%SOURCE_ROOT%)
+ SOURCE_ROOT_USED TRUE
+ }
+ tmp
+ {
+ SOL_TMP $dp(%SOL_TMP_DIR%)
+ }
+ }
+ extern
+ {
+ COMSPEC
+ DIST_ROOT
+ ENV_ROOT
+ JDK_PATH
+ LOCALINI
+ OSTYPE
+ $dp(SOL_TMP)
+ $dp(SOURCE_ROOT)
+ $dp(TMP)
+ $dp(TEMP)
+ }
+ order common0 bs_sourceroot tmp envroot:0 sourceroot:0 pro common1 distroot:0 cap cax common02 psdk compath common2 common:3 jdk14path:0 jdk15path:0 ojdk16path:0 common jdk14 jdk15 ojdk16
+ reset
+ {
+ COPYALL
+ CXX_X64_BINARY
+ DB2IMP
+ GCRINC
+ GCRLIB
+ GCRPATH
+ LIBMGR_X64_BINARY
+ LINK_X64_BINARY
+ NSIS_PATH
+ OLD_CHAOS
+ PERLDIR
+ SOLAR_ENV_ROOT
+ TFDEF
+ TFDIR
+ WST
+ }
+ script
+ {
+ sh
+ {
+ 400: if [ $COPYALL ]; then
+ 410: perl $SOLAR_ENV_ROOT/etools/lucopy.pl all $MAXPROC $LU_HGFLAG $LU_RFLAG $LU_NOSOURCE
+ 415: fi
+ 600: umask 002
+ 800: hash -r
+ 820: wrapfetch.sh
+ 850: if [ "0$SO_GEN_ERROR" -eq 0 ]; then
+ 851: export SO_GEN_ERROR
+ 852: fi
+ 860: if [ "0$SO_GEN_ERROR2" -eq 0 ]; then
+ 861: export SO_GEN_ERROR2
+ 862: fi
+ 870: if [ "0$SO_GEN_ERROR" -ne 0 ]; then
+ 871: echo $SO_GEN_ERROR
+ 872: fi
+ 880: if [ "0$SO_GEN_ERROR2" -ne 0 ]; then
+ 881: echo $SO_GEN_ERROR2
+ 882: fi
+ }
+ }
+ switches
+ {
+ bs_sourceroot SOURCE_ROOT_TMP
+ bsclient
+ cap
+ cax
+ compath STAR_COMPATH
+ distroot
+ envroot
+ jdk14
+ jdk14path
+ jdk15
+ jdk15path
+ l10n L10N_framework
+ ojdk16
+ ojdk16path
+ pro
+ psdk STAR_PSDK
+ sourceroot
+ tmp SOL_TMP_DIR
+ }
+}
+
diff --git a/solenv/config/ssolar.cmn b/solenv/config/ssolar.cmn
new file mode 100644
index 000000000000..ac84aee99684
--- /dev/null
+++ b/solenv/config/ssolar.cmn
@@ -0,0 +1,337 @@
+common
+{
+ switches
+ {
+ pro
+ bsclient
+ }
+ extern
+ {
+ PATH
+ TMP
+ VCSID
+ }
+ reset
+ {
+ *o:
+ *r:
+ *s:
+ *mkout
+ *deliver
+ *dmake
+ *copyprj
+ __mgrdir
+ gb_LOCALBUILDDIR
+ product
+ rsc_once
+ wrapper_override_cc_wrapper
+ *zipdep
+ ALT_L10N_MODULE
+ AWK
+ BIG_SVX
+ BIG_TOOLS
+ BISON_HAIRY
+ BISON_PKGDATADIR
+ BISON_SIMPLE
+ BMP_WRITES_FLAG
+ bndchk
+ BSCLIENT
+ BTARGET
+ BUILD_OS_APPLEOSX
+ BUILD_OS_MINOR
+ BUILD_OS_REV
+ BUILD_OS_MAJOR
+ BUILD_PIXMAN
+ BUILD_TOOLS
+ BUILD_TYPE
+ BUILD_SPECIAL
+ BUILD_STAX
+ BUILD_X64
+ CLASSPATH
+ CALL_CDECL
+ CHECK_LUCENCE_INDEXER_OUTPUT
+ COMEX
+ common_build
+ COMMON_OUTDIR
+ COPYALL
+ COPY_PACKED
+ CVS_HEAD
+ CVSROOT
+ CWS_WORK_STAMP
+ CWS_WORK_STAMP_EXT
+ DB2IMP
+ DB2INC
+ DB2LIB
+ DB2PATH
+ DEFAULT_TO_ENGLISH_FOR_PACKING
+ DIRECTX_SUPPORT
+ DISABLE_ADO
+ DISABLE_ATL
+ DISABLE_ENHANCED_COMID
+ DISABLE_JAVA
+ DISABLE_SAL_DBGBOX
+ DELIVER
+ DIC_ALL
+ DPKG
+ DYLD_LIBRARY_PATH
+ LD_LIBRARY_PATH
+ DMAKE_INC
+ DMAKE
+ DRIVE_O
+ DRIVE_S
+ DYNAMIC_CRT
+ ENABLE_AGG
+ ENABLE_CRASHDUMP
+ ENABLE_CUPS
+ ENABLE_DIRECTX
+ ENABLE_EVOAB2
+ ENABLE_FONTCONFIG
+ ENABLE_GTK
+ ENABLE_GCONF
+ ENABLE_GNOMEVFS
+ ENABLE_KDE
+ ENABLE_MEDIAWIKI
+ ENABLE_MINIMIZER
+ ENABLE_NSS_MODULE
+ ENABLE_PASF
+ ENABLE_RANDR
+ ENABLE_REPORTBUILDER
+ ENABLE_REPORTDESIGN
+ ENABLE_SVCTAGS
+ ENABLE_VBA
+ FORCE2ARCHIVE
+ PA_VER
+ ENABLE_NAS
+ ENABLE_PCH
+ SYSTEM_CURL
+ SYSTEM_CPPUNIT
+ SYSTEM_FREETYPE
+ FREETYPE_CFLAGS
+ FREETYPE_LIBS
+ SYSTEM_LIBXML
+ LIBXML_CFLAGS
+ LIBXML_LIBS
+ SYSTEM_LIBXSLT
+ LIBXSLT_CFLAGS
+ LIBXSLT_LIBS
+ SYSTEM_ZLIB
+ SYSTEM_PYTHON
+ SYSTEM_PORTAUDIO
+ SYSTEM_SNDFILE
+ ENABLEUNICODE
+ ENVCDEFS
+ HAVE_GCC_VISIBILITY_FEATURE
+ GCRINC
+ GCRLIB
+ GCRPATH
+ GLIBC
+ GNUCOPY
+ GXX_INCLUDE_PATH
+ HBTOOLKIT
+ HOMEDRIVE
+ HOMEPATH
+ IENV
+ INCLUDE
+ JAVA_HOME
+ JAVAHOME
+ JDK_VERSION
+ JDKINC
+ JDKINCS
+ JDKLIB
+ JDKLIBS
+ JDKPATH
+ JDK_PATH
+ L10N-framework
+ L10N_framework
+ LFS_CFLAGS
+ LOCALINI
+ MACOSX_DEPLOYMENT_TARGET
+ MK_UNROLL
+ MKDIR
+ MKOUT
+ MKSPATH
+ MULTITHREAD_OBJ
+ MWS_BUILD
+ NEW_JAR_PACK
+ NO_BSYMBOLIC
+ NO_HIDS
+ NO_DEFAULT_STL
+ NO_REC_RES
+ no_transex
+ NOSOLAR_JAVA
+ NSIS_PATH
+ ODBCINC
+ ODBCLIB
+ ODBCPATH
+ ODBCVER
+ OLD_CHAOS
+ OOO_JUNIT_JAR
+ OOO_SHELL
+ PACKMS
+ PCLEAN_PATH
+ PKGCONFIG_ROOT
+ PKG_CONFIG_PATH
+ PKGFORMAT
+ PRE
+ PREBUILD_MOZAB
+ PRODUCTENVCACHE
+ PRODUCTNAME
+ PROEXT
+ PROF_EDITION
+ PROFILE
+ profile
+ PROSWITCH
+ PTHREAD_CFLAGS
+ REMOTE_BUILD_FLAG
+ RES_ARAB
+ RES_CHINSIM
+ RES_CHINTRAD
+ RES_DAN
+ RES_DTCH
+ RES_ENUS
+ RES_FREN
+ RES_GER
+ RES_GREEK
+ RES_ITAL
+ RES_JAPN
+ RES_KOREAN
+ RES_POL
+ RES_PORT
+ RES_RUSS
+ RES_SPAN
+ RES_SWED
+ RES_THAI
+ RES_TURK
+ RES_HINDI
+ RES_PORTBR
+ RES_HEBREW
+ RES_HUNG
+ RPM
+ WITH_LANG
+ WITH_MOZILLA
+ ROOTDIR
+ RSCRES
+ SCPLINKVERSION
+ SET_EXCEPTIONS
+ SHARED_SOLARVERSION
+ SO_PACK
+ SOLAR_JAVA
+ SOLAR_PLUGIN
+ SOLARINC
+ SOLARLIB
+ SOLARUPD
+ SOLARVERSION
+ SOURCE_ROOT_USED
+ SOURCE_ROOT_DIR
+ STAR_REGISTRY
+ STAR_RESOURCEPATH
+ STLPORT4
+ STLPORT_VER
+ SYSPATH
+ TARFILE_LOCATION
+ TF_CAPELLA
+ TF_CFG
+ TF_CFGDATA
+ TF_CNTEX
+ TF_FILTER
+ TF_FILEURL
+ TF_NEWEX
+ TF_SDBAPI
+ TF_UCB
+ TF_SVDATA
+ TFDEF
+ TFDIR
+ TIMELOG
+ truetime
+ TRUSTED_MANIFEST_LOCATION
+ UDKSTAMP
+ URD_ONLY
+ USE_DIRECTX5
+ USE_MAPFILES
+ USE_NEW_SDK
+ USE_PCH
+ USE_SYSTEM_STL
+ use_cygcp
+ use_shl_versions
+ VCL
+ VERBOSE
+ VISTA_MANIFEST
+ XAU_LIBS
+ WINDOWS_VISTA_PSDK
+ WITH_LDAP
+ WITH_VC_REDIST
+ WST
+ XCLASSPATH
+ XSLTPROC
+ ZIPDEP
+ ZIPSOURCE
+ AGG_VERSION
+ ANT_HOME
+ ANT_LIB
+ ANT
+ AWTLIB
+ CC
+ CXX
+ EXCEPTIONS
+ GXX_INCLUDE_PATH
+ EXTERNAL_WARNINGS_NOT_ERRORS
+ GNUMAKE
+ HAVE_LD_HASH_STYLE
+ JAVACOMPILER
+ JAVADOC
+ JAVAIFLAGS
+ JDK
+ NO_HIDS
+ PAM_LINK
+ PAM
+ PSPRINT
+ PYTHONHOME
+ PYTHONPATH
+ SOLAR_PLUGIN
+ URE_BOOTSTRAP
+ USE_FT_EMBOLDEN
+ USE_XINERAMA
+ VBA_EXTENSION
+ XINERAMA_LINK
+ }
+ restore
+ {
+ PATH
+ }
+ order pro common bsclient
+ environment
+ {
+ pro
+ {
+ PROEXT .pro
+ }
+ common
+ {
+ SO_GEN_ERROR
+ SO_GEN_ERROR2
+ CVS_HEAD DEV300
+ }
+ bsclient
+ {
+ BSCLIENT TRUE
+ DISABLE_SAL_DBGBOX TRUE
+ }
+ }
+}
+
+unxsogs
+{
+}
+
+unxfbsdi
+{
+}
+
+unxsols4
+{
+}
+
+unxmacxp
+{
+}
+
diff --git a/solenv/doc/gbuild/doxygen.cfg b/solenv/doc/gbuild/doxygen.cfg
new file mode 100644
index 000000000000..2345b58d5c30
--- /dev/null
+++ b/solenv/doc/gbuild/doxygen.cfg
@@ -0,0 +1,1510 @@
+# Doxyfile 1.5.8
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = gbuild
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./output
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
+# Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it parses.
+# With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this tag.
+# The format is ext=language, where ext is a file extension, and language is one of
+# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
+# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
+# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
+# use: inc=Fortran f=C
+
+EXTENSION_MAPPING = mk=IDL
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = solenv/gbuild
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS = *.mk
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.openoffice.gbuild
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE =
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
+# For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION =
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to FRAME, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature. Other possible values
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list;
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
+# disables this behavior completely. For backwards compatibility with previous
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
+# respectively.
+
+GENERATE_TREEVIEW = NONE
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Options related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/solenv/doc/gbuild/solenv/gbuild/alllangres.mk b/solenv/doc/gbuild/solenv/gbuild/alllangres.mk
new file mode 100644
index 000000000000..8d5034e881dd
--- /dev/null
+++ b/solenv/doc/gbuild/solenv/gbuild/alllangres.mk
@@ -0,0 +1,90 @@
+#include <types.h>
+
+namespace gb
+{
+ class SrsTarget;
+ class ResTarget;
+ class AllLangResTarget;
+
+ class SrsPartTarget : public Target, public HasDependencies, public UsesRsc
+ {
+ private:
+ /// SrsPartTarget s do not need to be explicitly constructed.
+
+ /// They are a helper class for the SrsTarget class.
+ /// They are named after the path of their source file (without
+ /// file extension) from the root of their source repository.
+ SrsPartTarget(String name);
+ friend class SrsTarget;
+
+ /// Platformdependant command to generate the dependencies for the srs target.
+ static const Command command_dep(
+ String srsname,
+ Path sourcefile,
+ List<Path> include,
+ List<String> defs);
+ };
+
+ class SrsTarget : public Target, public HasDependencies, public IsCleanable
+ {
+ public:
+ /// Sets defines for srs processing.
+ /// \$\$(DEFS) contains the current flags and can be used, if
+ /// just a few need to be modified.
+ void set_defs(List<String> defs);
+ /// Sets the include paths for srs processing.
+ /// \$\$(INCLUDE) contains the current paths and can be used, if
+ /// just a few need to be modified.
+ void set_include(List<String> include);
+ /// Adds a SrsPartTarget to be processed.
+ void add_file(SrsPartTarget part);
+ /// Adds multiple SrsPartTarget s to be processed.
+ void add_files(List<SrsPartTarget> parts);
+ private:
+ /// SrsTarget s do not need to be explicitly constructed.
+
+ /// They are a helper class for the ResTarget class.
+ SrsTarget(String name);
+ friend class ResTarget;
+
+ List<String> DEFS;
+ List<String> INCLUDE
+ List<SrsPartTarget> PARTS;
+ static const List<String> DEFAULTDEFS;
+ };
+
+ class ResTarget : public Target, public IsCleanable, public HasSrs
+ {
+ public:
+ void add_file(Path file);
+ void add_files(List<Path> files);
+ private:
+ /// ResTarget do not need to be explicitly constructed.
+
+ /// They are a helper class for the AllLangResTarget class.
+ ResTarget(String name, String library, Language lang, Path reslocation);
+ friend class AllLangResTarget;
+
+ String LIBRARY;
+ Language LANGUAGE;
+ Path RESLOCATION;
+ };
+
+ class AllLangResTarget : public Target, public IsCleanable, public HasSrs
+ {
+ public:
+ AllLangResTarget(String name);
+ /// Sets the location where resources are to be found. reslocation is a path relative to the default_images directory.
+ /// Resources will be found in reslocation itself and in the subdirectories res/ and imglst/ of it and again in subdirectories
+ /// of those named as the language of the processed resource. In addition, resources are found in the res/ directory directly
+ /// below default_images and the subdirectory of it named as the language of the processed resource.
+ void set_reslocation(Path reslocation);
+ private:
+ /// Sets the languages for which to create resources.
+ static void set_langs(List<Language> langs);
+
+ /// The list of languages that need to be build.
+ static List<Language> LANGS;
+ };
+}
+/* vim: set filetype=cpp : */
diff --git a/solenv/doc/gbuild/solenv/gbuild/executable.mk b/solenv/doc/gbuild/solenv/gbuild/executable.mk
new file mode 100644
index 000000000000..8f7fcc9b0ce9
--- /dev/null
+++ b/solenv/doc/gbuild/solenv/gbuild/executable.mk
@@ -0,0 +1,25 @@
+#include <types.h>
+
+namespace gb
+{
+ using namespace types;
+
+ class LinkTarget;
+
+ class Executable : public IsCleanable, public HasDependencies, public IsLinking, public DeliversHeaders, public HasCompileSettings, public Target
+ {
+ public:
+ Executable(String name);
+
+ private:
+ /// private helper function for the constructor
+ void Executable_impl(LinkTarget library_linktarget);
+ /// platformdependant additional setup for constructor (used on Windows only)
+ void Executable_platform(LinkTarget library_linktarget);
+ /// helper function to wrap LinkTargets functions (this is more or less pimpl ...)
+ void forward_to_linktarget(Function f);
+
+ static const List<String> TARGETTYPEFLAGS;
+ };
+}
+/* vim: set filetype=cpp : */
diff --git a/solenv/doc/gbuild/solenv/gbuild/gbuild.mk b/solenv/doc/gbuild/solenv/gbuild/gbuild.mk
new file mode 100644
index 000000000000..97ca9b252789
--- /dev/null
+++ b/solenv/doc/gbuild/solenv/gbuild/gbuild.mk
@@ -0,0 +1,82 @@
+
+#include <types.mk>
+using namespace gb::types;
+
+// GNU make specific setup
+static const Command SHELL;
+
+
+// gbuild root directorys
+static Path SRCDIR;
+static Path OUTDIR;
+static Path WORKDIR;
+
+// Expected from configure/environment
+static const Integer OSL_DEBUG_LEVEL;
+static const List<Path> JDKINCS;
+static const List<Path> SOLARINC;
+static const List<Path> SOLARLIB;
+static const Path GBUILDDIR;
+static const Path INPATH;
+static const Path JAVA_HOME;
+static const Path UPD;
+static const String CVER;
+static const String LIBXML_CFLAGS;
+static const String OS;
+static const String STLPORT_VER;
+static const Bool DEBUG;
+static const Bool PRODUCT;
+
+// gbuild global variables derived from the configure/environment
+// some of these are defined per platform
+namespace gb
+{
+ /// building with generated dependencies
+ static const Bool FULLDEPS;
+ /// product build or non-product build with additional assertions and tests
+ static const Bool PRODUCT;
+ /// command to run awk scripts
+ static const Command AWK;
+ /// command to compile c source files
+ static const Command CC;
+ /// command to compile c++ source files
+ static const Command CXX;
+ /// command to process input with a gcc compatible preprocessor
+ static const Command GCCP;
+ /// command to link objects on the microsoft toolchain
+ static const Command LINK;
+ /// command to create a unique temporary file
+ static const Command MKTEMP;
+ /// debuglevel:
+ /// 0=no debugging,
+ /// 1=non-product build,
+ /// 2=debugging build (either product or nonproduct)
+ static const Integer DEBUGLEVEL;
+ /// compiler specific optimization flags
+ static const List<String> COMPILEROPTFLAGS;
+ /// default c compilation compiler flags
+ static const List<String> CFLAGS;
+ /// compiler specific defines
+ static const List<String> COMPILERDEFS;
+ /// cpu-specific default defines
+ static const List<String> CPUDEFS;
+ /// default c++ compilation compiler flags
+ static const List<String> CXXFLAGS;
+ /// platform- and compilerindependent default defines
+ static const List<String> GLOBALDEFS;
+ /// default objective c++ compilation compiler flags
+ static const List<String> OBJCXXFLAGS;
+ /// platfomspecific default defines
+ static const List<String> OSDEFS;
+ /// ?
+ static const Path SDKDIR;
+};
+
+// GXX_INCLUDE_PATH (Linux)
+// PTHREAD_CFLAGS (Linux)
+// SYSTEM_ICU (Linux)
+// SYSTEM_JPEG (Linux)
+// SYSTEM_LIBXML (Linux)
+// USE_SYSTEM_STL (Linux)
+
+/* vim: set filetype=cpp : */
diff --git a/solenv/doc/gbuild/solenv/gbuild/helper.mk b/solenv/doc/gbuild/solenv/gbuild/helper.mk
new file mode 100644
index 000000000000..3fa666b857a8
--- /dev/null
+++ b/solenv/doc/gbuild/solenv/gbuild/helper.mk
@@ -0,0 +1,42 @@
+#include <types.h>
+
+String NEWLINE;
+String COMMA;
+
+namespace gb
+{
+ using namespace types;
+
+ class Helper
+ {
+ public:
+ /// Abbreviates the common directory roots in a command
+ static Command abbreviate_dirs(Command c);
+ /// Announces the start/end of an task.
+ static void announce(String announcement);
+ /// Creates the default get_clean_target() function for the type.
+ static void make_clean_target(TargetType t);
+ /// Creates the default get_clean_target() function for the types.
+ static void make_clean_targets(List<TargetType> ts);
+ /// Creates the default get_dep_target() function for the type.
+ static void make_dep_target(TargetType t);
+ /// Creates the default get_dep_target() function for the types.
+ static void make_dep_targets(List<TargetType> ts);
+ /// Creates the default get_dep_target() function for the type modifying the \$(OUTDIR).
+ static void make_outdir_clean_target(TargetType t);
+ /// Creates the default get_dep_target() function for types modifying the \$(OUTDIR).
+ static void make_outdir_clean_targets(List<TargetType> ts);
+ /// Returns the clean target of a target modifying the \$(OUTDIR).
+ static Path get_outdir_clean_target(Path target);
+
+ /// The path to a zero length file.
+ static const Path NULLFILE;
+ /// The path to the misc directory for temporary files etc.
+ static const Path MISC;
+ /// The path to a phony target, that is always outdated.
+ static const Path PHONY;
+ /// Internally used dummy file.
+ static const Path MISCDUMMY;
+ };
+}
+/* vim: set filetype=cpp : */
diff --git a/solenv/doc/gbuild/solenv/gbuild/library.mk b/solenv/doc/gbuild/solenv/gbuild/library.mk
new file mode 100644
index 000000000000..eba19a86156a
--- /dev/null
+++ b/solenv/doc/gbuild/solenv/gbuild/library.mk
@@ -0,0 +1,41 @@
+#include <types.h>
+
+namespace gb
+{
+ using namespace types;
+
+ class LinkTarget;
+
+ class Library : public IsCleanable, public HasDependencies, public IsLinking, public DeliversHeaders, public HasCompileSettings, public Target
+ {
+ public:
+ Library(String name);
+ /// Returns how the library is named in the filesystem on the current platform.
+ /// Library filename schemes are defined in solenv/gbuild/libnames.mk (with some platformdependant hacks in solenv/gbuild/platform/*.mk.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
+ Path get_filename();
+
+ private:
+ /// private helper function for the constructor
+ void Library_impl(LinkTarget library_linktarget);
+ /// platformdependant additional setup for constructor (used on Windows only)
+ void Library_platform(
+ LinkTarget library_linktarget,
+ Path dllfile);
+ /// helper function to wrap LinkTargets functions (this is more or less pimpl ...)
+ void forward_to_linktarget(Function f);
+
+ /// List of buildable libraries (i.e. libraries that are not expected to exist outside of \$(OUTDIR) on the system).
+ static const List<Library> TARGETS;
+ /// List of additional defines for compiling objects for libraries
+ static const List<String> DEFS;
+ /// List of additional flags for linking a library
+ static const List<String> TARGETTYPEFLAGS;
+ /// Mapping from symbolic library names to dll filenames
+ static const Map<Library,Path> DLLFILENAMES;
+ /// Mapping from symbolic library names to filenames
+ static const Map<Library,Path> FILENAMES;
+ };
+}
+/* vim: set filetype=cpp : */
diff --git a/solenv/doc/gbuild/solenv/gbuild/linktarget.mk b/solenv/doc/gbuild/solenv/gbuild/linktarget.mk
new file mode 100644
index 000000000000..5fb7ead86b83
--- /dev/null
+++ b/solenv/doc/gbuild/solenv/gbuild/linktarget.mk
@@ -0,0 +1,128 @@
+#include <types.h>
+
+namespace gb
+{
+ using namespace types;
+
+ class LinkTarget;
+ class Library;
+ class StaticLibrary;
+ class SdiTarget;
+ class Package;
+
+ /// CObjects are never used standalone. They only exist as part of a
+ /// LinkTarget.
+ class CObject : public HasSource, public HasDependencies, public Target
+ {
+ public:
+ Path get_source();
+ private:
+ /// CObjects do not need to be explicitly constructed.
+ /// They are named after the path of their source file (without
+ /// file extension) from the root of their source repository.
+ CObject(String name);
+ friend class LinkTarget;
+
+ /// Platformdependent command to compile a plain C object.
+ static const Command command(
+ Path objectfile,
+ String name,
+ Path sourcefile,
+ List<String> defs,
+ List<String> cxxflags,
+ List<Path> include);
+ /// Platformdependent command to generate plain C object dependencies.
+ static const Command command_dep(
+ Path depfile,
+ String name,
+ Path sourcefile,
+ List<String> defs,
+ List<String> cxxflags,
+ List<Path> include);
+ };
+
+ /// CxxObjects are never used standalone. They only exist as part of a
+ /// LinkTarget.
+ class CxxObject : public HasSource, public HasDependencies, public Target
+ {
+ public:
+ Path get_source();
+ private:
+ /// CxxObjects do not need to be explicitly constructed.
+ /// They are named after the path of their source file (without
+ /// file extension) from the root of their source repository.
+ CxxObject(String name);
+ friend class LinkTarget;
+
+ /// Platformdependent command to compile a C++ object.
+ static const Command command(
+ Path objectfile,
+ String name,
+ Path sourcefile,
+ List<String> defs,
+ List<String> cxxflags,
+ List<Path> include);
+ /// Platformdependent command to generate C++ object dependencies.
+ static const Command command_dep(
+ Path objectfile,
+ String name,
+ Path sourcefile,
+ List<String> defs,
+ List<String> cxxflags,
+ List<Path> include);
+ };
+
+ class LinkTarget : public IsCleanable, public HasDependencies, public IsLinking, public DeliversHeaders, public HasCompileSettings, public Target
+ {
+ public:
+ LinkTarget(String name);
+
+ private:
+ void get_external_headers_check();
+ void add_internal_headers(const List<Target>& internal_headers);
+
+ /// @warning Evil Hack: SELF is set to the name of the LinkTarget
+ /// in the constructor. If SELF is not set to the LinkTarget name in
+ /// the execution of the header rule, the LinkTarget is used (linked
+ /// against) but was never defined. This might work out, if the
+ /// LinkTarget has been provided by other means (for example:
+ /// build.pl/dmake), but it should never happen in a project where
+ /// all LinkTarget s are controlled by gbuild.
+ LinkTarget& SELF;
+ List<CObject> COBJECTS;
+ List<CxxObject> CXXOBJECTS;
+ List<Library> LINKED_LIBS;
+ List<Path> AUXTARGETS;
+ List<Path> INCLUDE;
+ List<Path> INCLUDE_STL;
+ List<StaticLibrary> LINKED_STATIC_LIBS;
+ List<String> CFLAGS;
+ List<String> CXXFLAGS;
+ List<String> DEFS;
+ List<String> LDFLAGS;
+ List<String> TARGETTYPE_FLAGS;
+ Path DLLTARGET;
+
+ /// Platformdependent command for linking.
+ static const Command command (
+ Path linktargetfile,
+ String linktargetname,
+ List<String> linkflags,
+ List<Library> linked_libs,
+ List<StaticLibrary> linked_static_libs,
+ List<CObject> cobjects,
+ List<CxxObject> cxxobjects);
+ /// Command to collect all dependencies of this LinkTarget.
+ static const Command command_dep(
+ Path depfile,
+ String linktargetname,
+ List<CObject> cobjects,
+ List<CxxObject> cxxobjects);
+ static const List<String> DEFAULTDEFS;
+ static const List<String> CXXFLAGS;
+ static const List<String> LDFLAGS;
+ static const List<Path> INCLUDE;
+ static const List<Path> INCLUDE_STL;
+ };
+}
+/* vim: set filetype=cpp : */
diff --git a/solenv/doc/gbuild/solenv/gbuild/package.mk b/solenv/doc/gbuild/solenv/gbuild/package.mk
new file mode 100644
index 000000000000..53daeb5c80af
--- /dev/null
+++ b/solenv/doc/gbuild/solenv/gbuild/package.mk
@@ -0,0 +1,30 @@
+#include <types.h>
+
+namespace gb
+{
+ using namespace types;
+ class PackagePart
+ {
+ private:
+ /// PackagePart s do not need to be explicitly constructed.
+ /// They are named after the path of their source file (without
+ /// file extension) from the root of their source repository.
+ PackagePart(String name, Path Source);
+ friend Package;
+ /// Returns a list of aboslute paths where files are copied to with the PackagePart class.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
+ static const List<Path> get_destinations();
+ };
+
+ class Package : public Target, public IsCleanable
+ {
+ public:
+ /// Creates a new package that copies files from source_dir to the \$(OUTDIR).
+ Package(String name, Path source_dir);
+ /// Adds a file to the package. destination is the relative path in
+ /// the \$(OUTDIR) and source is the relative path in the source_dir.
+ add_file(Path destination, Path source);
+ }
+}
+/* vim: set filetype=cpp : */
diff --git a/solenv/doc/gbuild/solenv/gbuild/sdi.mk b/solenv/doc/gbuild/solenv/gbuild/sdi.mk
new file mode 100644
index 000000000000..f9f913fb141c
--- /dev/null
+++ b/solenv/doc/gbuild/solenv/gbuild/sdi.mk
@@ -0,0 +1,23 @@
+#include <types.h>
+
+namespace gb
+{
+ using namespace types;
+
+ class SdiTarget : public Target, public IsCleanable
+ {
+ public:
+ /// Creates a new SdiTarget.
+ SdiTarget(String name, String exports);
+ /// Sets the include paths for this SdiTarget.
+ set_include(List<Path> includes);
+ private:
+ /// The command to execute svidl.
+ static const Command SVIDLCOMMAND;
+ /// The target on with to depend to make sure the svidl executable is available.
+ static const Path SVIDLTARGET;
+ /// The target on with to depend to make sure the auxiliary files (libraries etc.) for the svidl executable are available.
+ static const Path SVIDLAUXDEPS;
+ };
+}
+/* vim: set filetype=cpp : */
diff --git a/solenv/doc/gbuild/solenv/gbuild/static_library.mk b/solenv/doc/gbuild/solenv/gbuild/static_library.mk
new file mode 100644
index 000000000000..787c6e732ede
--- /dev/null
+++ b/solenv/doc/gbuild/solenv/gbuild/static_library.mk
@@ -0,0 +1,39 @@
+#include <types.h>
+
+namespace gb
+{
+ using namespace types;
+
+ class LinkTarget;
+
+ class StaticLibrary : public IsCleanable, public HasDependencies, public IsLinking, public DeliversHeaders, public HasCompileSettings, public Target
+ {
+ public:
+ StaticLibrary(String name);
+ /// Returns how the library is named in the filesystem on the current platform.
+ /// StaticLibrary filename schemes are defined in solenv/gbuild/libnames.mk (with some platformdependant hacks in solenv/gbuild/platform/*.mk.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
+ Path get_filename();
+
+ private:
+ /// private helper function for the constructor
+ void StaticLibrary_impl(LinkTarget library_linktarget);
+ /// helper function to wrap LinkTargets functions (this is more or less pimpl ...).
+ void forward_to_linktarget(Function f);
+
+ /// List of buildable static libraries (i.e. static libraries that are not expected to exist outside of \$(OUTDIR) on the system).
+ static const List<StaticLibrary> TARGETS;
+ /// List of additional defines for compiling objects for static libraries
+ static const List<String> DEFS;
+ /// List of additional flags for linking a static library
+ static const List<String> TARGETTYPEFLAGS;
+ /// Mapping from symbolic static library names to filenames
+ static const Map<StaticLibrary,Path> FILENAMES;
+ /// location to place static libraries in the \$(OUTDIR)
+ static const Path OUTDIRLOCATION;
+ /// platformdependant file extension for static libraries
+ static const String PLAINEXT;
+ };
+}
+/* vim: set filetype=cpp : */
diff --git a/solenv/doc/gbuild/solenv/gbuild/types.mk b/solenv/doc/gbuild/solenv/gbuild/types.mk
new file mode 100644
index 000000000000..ecb736834736
--- /dev/null
+++ b/solenv/doc/gbuild/solenv/gbuild/types.mk
@@ -0,0 +1,169 @@
+namespace gb {
+ class CObject;
+ class CxxObject;
+ class Library;
+ class StaticLibrary;
+ class Package;
+ class SdiTarget;
+};
+
+namespace gb { namespace types
+{
+ /// A type of target, with its set of rules etc., as used in the build system.
+ class TargetType {};
+ /// A plain old string.
+ class String {};
+ /// A partial, relative or absolute filesystem path.
+ class Path {};
+ /// A target to be build.
+ class Target
+ {
+ public:
+ /// The absolute filesystem path representing the target.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
+ Path get_target();
+ };
+ /// A partial or complete shell-command.
+ class Command {};
+ /// A integer number.
+ class Integer {};
+ /// A boolean value.
+
+ /// There are const boolean values true and false for
+ /// comparisons (written as $(true) and $(false) in makefiles.
+ class Bool {};
+ /// A language (for localisation)
+
+ /// A language represented by its ISO 639-1:2002 code.
+ class Language {};
+ /// A List of objects.
+
+ /// A List of objects represented by a whitespace separated list
+ /// in makefiles.
+ template <typename T>
+ class List<T> {};
+
+ /// A Mapping from with a key of type K and a value of type V
+
+ /// A Mapping is represented by a whitespace separated list
+ /// of key-value pairs. Key and value are separated by a colon (:).
+ template <typename K, typename V>
+ class Map<K,V> {};
+ /// A target that can be cleaned.
+ class IsCleanable
+ {
+ public:
+ /// The (phony) absolute filesystem path to clean the target.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
+ Path get_clean_target();
+ };
+ /// A target that has generated dependencies.
+ class HasDependencies
+ {
+ public:
+ /// The absolute filesystem path to the file containing the dependencies.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
+ Path get_dep_target();
+ };
+ /// A target that has a source file from which it is generated.
+ class HasSource
+ {
+ public:
+ /// The absolute filesystem path to the source file.
+ Path get_source();
+ };
+ /// A target that links objects and libraries.
+ class IsLinking
+ {
+ public:
+ /// Add a CObject to be compiled and linked.
+ void add_cobject(CObject cobject);
+ /// Add multiple CObject s to be compiled and linked.
+ void add_cobjects(List<CObject> cobjects);
+ /// Add a CxxObject to be compiled and linked.
+ void add_cxxobject(CxxObject cobject);
+ /// Add multiple CxxObject s to be compiled and linked.
+ void add_cxxobjects(List<CxxObject> cobjects);
+ /// Add multiple CxxObject s to be compiled and linked (with exceptions enabled).
+ void add_exception_objects(List<CxxObject> cobject);
+ /// Add libraries to link against dynamically.
+ void add_linked_libs(List<Library> linked_libs);
+ /// Add libraries to link against statically.
+ void add_linked_static_libs(List<StaticLibrary> linked_static_libs);
+ /// Add multiple CxxObject s to be compiled and linked (without exceptions enabled).
+ /// @deprecated We should not care about disabling exception.
+ void add_noexception_objects(List<CxxObject> cobject);
+ /// Set auxiliary files that are produced by linking (for cleanup and copying).
+ void set_auxtargets(List<Path> auxtargets);
+ /// Set the location for the produced DLL (used on Windows only).
+ void set_dll_target(Path dlltarget);
+ /// Set additional flags for the link command.
+ void set_ldflags(List<Path> ldflags);
+ };
+ /// A target that delivers headers of some kind.
+ class DeliversHeaders
+ {
+ public:
+ /// The absolute filesystem path which is touched when all headers for this target are prepared.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
+ Path get_headers_target();
+ /// The absolute filesystem path which is touched when all external headers for this target are prepared.
+
+ /// This function needs to be defined in solenv/gbuild/target_names.mk so that it is available to everywhere.
+ Path get_external_headers_target();
+ /// Add multiple Packages that need to be delivered/generated
+ /// before compilation or dependency generation can start.
+ void add_package_headers(List<Package> packages);
+ /// Add multiple SdiTargets that need to be delivered/generated
+ /// before compilation or dependency generation can start.
+ void add_sdi_headers(List<SdiTarget> sdis);
+ };
+ /// A target where settings for the compilation can be set.
+ class HasCompileSettings
+ {
+ public:
+ /// Sets flags for plain C compilation.
+ /// \$\$(CFLAGS) contains the current flags and can be used if
+ /// just a few need to be modified.
+ void set_cflags(List<String> cflags);
+ /// Sets flags for C++ compilation.
+ /// \$\$(CXXFLAGS) contains the current flags and can be used if
+ /// just a few need to be modified.
+ void set_cxxflags(List<String> cxxflags);
+ /// Sets defines for C/C++ compilation.
+ /// \$\$(DEFS) contains the current flags and can be used if
+ /// just a few need to be modified.
+ void set_defs(List<String> defs);
+ /// Sets the include paths for C/C++ compilation.
+ /// \$\$(INCLUDE) contains the current paths and can be used if
+ /// just a few need to be modified.
+ void set_include(List<Path> include);
+ /// Sets the stl include paths for C++ compilation.
+ /// \$\$(INCLUDE_STL) contains the current paths and can be used if
+ /// just a few need to be modified.
+ void set_include_stl(List<Path> include_stl);
+ };
+ /// A target using the resource compiler
+ class UsesRsc
+ {
+ public:
+ /// The command to execute rsc.
+ static const Command RSCCOMMAND;
+ /// The target on with to depend to make sure the rsc executable is available.
+ static const Path RSCTARGET;
+ };
+ /// A target processing a set of srs files
+ class HasSrs
+ {
+ public:
+ /// Add a SrsTarget to be processed.
+ void add_one_srs(SrsTarget srs);
+ /// Add multiple SrsTarget s to be processed.
+ void add_srs(List<SrsTarget> srs);
+ };
+}};
+/* vim: set filetype=cpp : */
diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk
new file mode 100644
index 000000000000..b937ac7a35b5
--- /dev/null
+++ b/solenv/gbuild/AllLangResTarget.mk
@@ -0,0 +1,324 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# SrsPartMergeTarget class
+
+gb_SrsPartMergeTarget_TRANSEXTARGET := $(call gb_Executable_get_target,transex3)
+gb_SrsPartMergeTarget_TRANSEXAUXDEPS := $(call gb_Library_get_target,tl) $(call gb_Library_get_target,sal)
+# gb_SrsPartMergeTarget_TRANSEXPRECOMMAND is set by the platforms
+
+gb_SrsPartMergeTarget_TRANSEXCOMMAND := $(gb_SrsPartMergeTarget_TRANSEXPRECOMMAND) $(gb_SrsPartMergeTarget_TRANSEXTARGET)
+gb_SrsPartMergeTarget_SDFLOCATION := $(SRCDIR)/l10n/$(INPATH)/misc/sdf/
+gb_SrsPartMergeTarget_REPOS := $(gb_REPOS)
+
+define gb_SrsPartMergeTarget__command
+$(call gb_Output_announce,$(3),$(true),srs,1)
+$(call gb_Helper_abbreviate_dirs_native,\
+ mkdir -p $(dir $(1)) && \
+ $(gb_SrsPartMergeTarget_TRANSEXCOMMAND) \
+ -p $(firstword $(subst /, ,$(2))) \
+ -i $(3) \
+ -o $(1) \
+ -m $(4) \
+ -l all)
+
+endef
+
+define gb_SrsPartMergeTarget__rules
+$$(call gb_SrsPartMergeTarget_get_target,%) : $(1)/% $$(gb_Helper_MISCDUMMY) | $$(gb_SrsPartMergeTarget_TRANSEXTARGET) $$(gb_SrsPartMergeTarget_TRANSEXAUXDEPS)
+ $$(call gb_SrsPartMergeTarget__command,$$@,$$*,$$<,$$(SDF))
+
+endef
+
+$(foreach repo,$(gb_SrsPartMergeTarget_REPOS),$(eval $(call gb_SrsPartMergeTarget__rules,$(repo))))
+
+# SrsPartTarget class
+
+gb_SrsPartTarget_REPOS := $(gb_REPOS)
+# defined by platform
+# gb_SrsPartTarget_RSCTARGET
+# gb_SrsPartTarget_RSCCOMMAND
+# gb_SrsPartTarget__command_dep
+
+define gb_SrsPartTarget__command
+$(call gb_Helper_abbreviate_dirs_native,\
+ mkdir -p $(dir $(1)) && \
+ RESPONSEFILE=`$(gb_MKTEMP) $(gb_Helper_MISC)` && \
+ echo "-s \
+ $(4) \
+ -I$(dir $(3)) \
+ $(5) \
+ -fp=$(1) \
+ $(6)" > $${RESPONSEFILE} && \
+ $(gb_SrsPartTarget_RSCCOMMAND) -presponse @$${RESPONSEFILE} && \
+ rm -rf $${RESPONSEFILE})
+
+endef
+
+define gb_SrsPartTarget__rules
+$$(call gb_SrsPartTarget_get_target,%) : $(1)/% $$(gb_Helper_MISCDUMMY) | $$(gb_SrsPartTarget_RSCTARGET)
+ $$(call gb_SrsPartTarget__command_dep,$$*,$$<,$$(INCLUDE),$$(DEFS))
+ $$(call gb_SrsPartTarget__command,$$@,$$*,$$<,$$(INCLUDE),$$(DEFS),$$(lastword $$< $$(MERGEDFILE)))
+
+ifeq ($(gb_FULLDEPS),$(true))
+$$(call gb_SrsPartTarget_get_dep_target,%) : $(1)/% $$(gb_Helper_MISCDUMMY)
+ $$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $$(dir $$@) && \
+ echo '$$(call gb_SrsPartTarget_get_target,$$*) : $$(gb_Helper_PHONY)' > $$@)
+endif
+
+endef
+
+$(foreach repo,$(gb_SrsPartTarget_REPOS),$(eval $(call gb_SrsPartTarget__rules,$(repo))))
+
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_SrsPartTarget_get_dep_target,%) :
+ $(eval $(call gb_Output_error,Unable to find resource definition file $* in repositories: $(gb_SrsPartTarget_REPOS)))
+endif
+
+
+define gb_SrsPartTarget_SrsPartTarget
+ifeq ($(strip $(WITH_LANG)),)
+$(call gb_SrsPartTarget_get_target,$(1)) : MERGEDFILE :=
+else
+$(call gb_SrsPartTarget_get_target,$(1)) : MERGEDFILE := $(call gb_SrsPartMergeTarget_get_target,$(1))
+$(call gb_SrsPartTarget_get_target,$(1)) : $(call gb_SrsPartMergeTarget_get_target,$(1))
+$(call gb_SrsPartMergeTarget_get_target,$(1)) : SDF := $(gb_SrsPartMergeTarget_SDFLOCATION)$(dir $(1))localize.sdf
+endif
+
+endef
+
+
+# SrsTarget class
+
+gb_SrsTarget_DEFAULTDEFS := $(gb_GLOBALDEFS)
+
+.PHONY : $(call gb_SrsTarget_get_clean_target,%)
+$(call gb_SrsTarget_get_clean_target,%) :
+ $(call gb_Output_announce,$*,$(false),SRS,1)
+ -$(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_SrsTarget_get_target,$*) \
+ $(call gb_SrsTarget_get_dep_target,$*) \
+ $(foreach part,$(PARTS),$(call gb_SrsPartTarget_get_target,$(part))) \
+ $(foreach part,$(PARTS),$(call gb_SrsPartTarget_get_dep_target,$(part))) \
+ $(foreach part,$(PARTS),$(call gb_SrsPartMergeTarget_get_target,$(part))))
+
+ifeq ($(gb_FULLDEPS),$(true))
+define gb_SrsTarget__command_dep
+$(call gb_Output_announce,SRS:$(2),$(true),DEP,1)
+$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $(1)) && \
+ cat $(3) > $(1))
+endef
+endif
+
+$(call gb_SrsTarget_get_target,%) :
+ $(call gb_SrsTarget__command_dep,$(call gb_SrsTarget_get_dep_target,$*),$*,$(foreach part,$(PARTS),$(call gb_SrsPartTarget_get_dep_target,$(part))))
+ $(call gb_Output_announce,$*,$(true),SRS,1)
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && \
+ cat $^ > $@)
+
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_SrsTarget_get_dep_target,%) :
+ $(call gb_SrsTarget__command_dep,$@,$*,$^)
+endif
+
+define gb_SrsTarget_SrsTarget
+$(call gb_SrsTarget_get_target,$(1)) : DEFS := $(gb_SrsTarget_DEFAULTDEFS)
+$(call gb_SrsTarget_get_target,$(1)) : INCLUDE := $(SOLARINC)
+$(call gb_SrsTarget_get_clean_target,$(1)) : PARTS :=
+$(call gb_SrsTarget_get_target,$(1)) : PARTS :=
+ifeq ($(gb_FULLDEPS),$(true))
+ifneq ($(wildcard $(call gb_SrsTarget_get_dep_target,$(1))),)
+include $(call gb_SrsTarget_get_dep_target,$(1))
+else
+$(firstword $(MAKEFILE_LIST)) : $(call gb_SrsTarget_get_dep_target,$(1))
+endif
+endif
+
+endef
+
+define gb_SrsTarget_set_defs
+$(call gb_SrsTarget_get_target,$(1)) : DEFS := $(2)
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_SrsTarget_get_dep_target,$(1)) : DEFS := $(2)
+endif
+
+endef
+
+define gb_SrsTarget_set_include
+$(call gb_SrsTarget_get_target,$(1)) : INCLUDE := $(2)
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_SrsTarget_get_dep_target,$(1)) : INCLUDE := $(2)
+endif
+
+endef
+
+define gb_SrsTarget_add_file
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_SrsTarget_get_dep_target,$(1)) : $(call gb_SrsPartTarget_get_dep_target,$(2))
+endif
+$(call gb_SrsPartTarget_SrsPartTarget,$(2))
+$(call gb_SrsTarget_get_target,$(1)) : $(call gb_SrsPartTarget_get_target,$(2))
+$(call gb_SrsTarget_get_clean_target,$(1)) : PARTS += $(2)
+$(call gb_SrsTarget_get_target,$(1)) : PARTS += $(2)
+
+endef
+
+define gb_SrsTarget_add_files
+$(foreach file,$(2),$(call gb_SrsTarget_add_file,$(1),$(file)))
+
+endef
+
+
+# ResTarget
+
+gb_ResTarget_RSCTARGET := $(gb_SrsPartTarget_RSCTARGET)
+gb_ResTarget_RSCCOMMAND := $(gb_SrsPartTarget_RSCCOMMAND)
+gb_ResTarget_DEFIMAGESLOCATION := $(SRCDIR)/default_images/
+
+$(call gb_ResTarget_get_clean_target,%) :
+ $(call gb_Output_announce,$*,$(false),RES,2)
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_ResTarget_get_target,$*) $(call gb_ResTarget_get_imagelist_target,$*) $(call gb_ResTarget_get_outdir_target,$*) $(call gb_ResTarget_get_outdir_imagelist_target,$*))
+
+$(call gb_ResTarget_get_target,%) : $(gb_Helper_MISCDUMMY) | $(gb_ResTarget_RSCTARGET)
+ $(call gb_Output_announce,$*,$(true),RES,2)
+ $(call gb_Helper_abbreviate_dirs_native,\
+ mkdir -p $(dir $@) $(OUTDIR)/bin \
+ $(dir $(call gb_ResTarget_get_imagelist_target,$*)) && \
+ RESPONSEFILE=`$(gb_MKTEMP) $(gb_Helper_MISC)` && \
+ echo "-r -p \
+ -lg$(LANGUAGE) \
+ -fs=$@ \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/$(LIBRARY)) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst/$(LANGUAGE)) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res/$(LANGUAGE)) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res) \
+ -lip=$(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)) \
+ -lip=$(gb_ResTarget_DEFIMAGESLOCATION)res/$(LANGUAGE) \
+ -lip=$(gb_ResTarget_DEFIMAGESLOCATION)res \
+ -subMODULE=$(dir $(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION))) \
+ -subGLOBALRES=$(gb_ResTarget_DEFIMAGESLOCATION)res \
+ -oil=$(dir $(call gb_ResTarget_get_imagelist_target,$*)) \
+ $(filter-out $(gb_Helper_MISCDUMMY),$^)" > $${RESPONSEFILE} && \
+ $(gb_ResTarget_RSCCOMMAND) @$${RESPONSEFILE} && \
+ rm -f $${RESPONSEFILE})
+
+$(call gb_ResTarget_get_outdir_target,%) :
+ $(call gb_Helper_abbreviate_dirs,\
+ $(call gb_Deliver_deliver,$<,$@) && \
+ $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(ILSTTARGET)),$(ILSTTARGET)))
+
+define gb_ResTarget_ResTarget
+$(call gb_ResTarget_get_target,$(1)) : LIBRARY = $(2)
+$(call gb_ResTarget_get_target,$(1)) : LANGUAGE = $(3)
+$(call gb_ResTarget_get_target,$(1)) : RESLOCATION = $(2)
+$(call gb_AllLangResTarget_get_target,$(2)) : $(call gb_ResTarget_get_outdir_target,$(1))
+$(call gb_AllLangResTarget_get_clean_target,$(2)) : $(call gb_ResTarget_get_clean_target,$(1))
+$(call gb_ResTarget_get_imagelist_target,$(1)) : $(call gb_ResTarget_get_target,$(1))
+
+$(call gb_ResTarget_get_outdir_target,$(1)) : $(call gb_ResTarget_get_target,$(1))
+$(call gb_ResTarget_get_outdir_target,$(1)) : ILSTTARGET = $(call gb_ResTarget_get_outdir_imagelist_target,$(1))
+$(call gb_Deliver_add_deliverable,$(call gb_ResTarget_get_outdir_target,$(1)),$(call gb_ResTarget_get_target,$(1)))
+$(call gb_Deliver_add_deliverable,$(call gb_ResTarget_get_outdir_imagelist_target,$(1)),$(call gb_ResTarget_get_imagelist_target,$(1)))
+
+endef
+
+define gb_ResTarget_add_file
+$(call gb_ResTarget_get_target,$(1)) : $(2)
+
+endef
+
+define gb_ResTarget_add_one_srs
+$(call gb_ResTarget_add_file,$(1),$(call gb_SrsTarget_get_target,$(2)))
+$(call gb_ResTarget_get_clean_target,$(1)) : $(call gb_SrsTarget_get_clean_target,$(2))
+
+endef
+
+define gb_ResTarget_add_files
+$(foreach file,$(2),\
+ $(call gb_ResTarget_add_file,$(1),$(file)))
+
+endef
+
+define gb_ResTarget_add_srs
+$(foreach srs,$(2),\
+ $(call gb_ResTarget_add_one_srs,$(1),$(srs)))
+
+endef
+
+define gb_ResTarget_set_reslocation
+$(call gb_ResTarget_get_target,$(1)) : RESLOCATION = $(2)
+
+endef
+
+
+# AllLangResTarget
+
+gb_AllLangResTarget_LANGS := en-US $(WITH_LANG)
+
+define gb_AllLangResTarget_set_langs
+gb_AllLangResTarget_LANGS := $(1)
+endef
+
+$(call gb_AllLangResTarget_get_clean_target,%) :
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_AllLangResTarget_get_target,$*))
+
+$(call gb_AllLangResTarget_get_target,%) :
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && touch $@)
+
+define gb_AllLangResTarget_AllLangResTarget
+$(foreach lang,$(gb_AllLangResTarget_LANGS),\
+ $(call gb_ResTarget_ResTarget,$(1)$(lang),$(1),$(lang)))
+$$(eval $$(call gb_Module_register_target,$(call gb_AllLangResTarget_get_target,$(1)),$(call gb_AllLangResTarget_get_clean_target,$(1))))
+
+endef
+
+define gb_AllLangResTarget_add_one_srs
+$(foreach lang,$(gb_AllLangResTarget_LANGS),\
+ $(call gb_ResTarget_add_one_srs,$(1)$(lang),$(2)))
+
+endef
+
+define gb_AllLangResTarget_add_srs
+$(foreach srs,$(2),\
+ $(call gb_AllLangResTarget_add_one_srs,$(1),$(srs)))
+
+endef
+
+define gb_AllLangResTarget_set_reslocation
+$(foreach lang,$(gb_AllLangResTarget_LANGS),\
+ $(call gb_ResTarget_set_reslocation,$(1)$(lang),$(2)))
+
+endef
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/BuildDirs.mk b/solenv/gbuild/BuildDirs.mk
new file mode 100644
index 000000000000..e31712016f7f
--- /dev/null
+++ b/solenv/gbuild/BuildDirs.mk
@@ -0,0 +1,59 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# extend for JDK include (seems only needed in setsolar env?)
+SOLARINC += $(JDKINCS)
+
+OUTDIR := $(SOLARVERSION)/$(INPATH)
+WORKDIR := $(SOLARVERSION)/$(INPATH)/workdir
+
+# Override for SetupLocal
+ifneq ($(and $(gb_LOCALBUILDDIR),$(wildcard $(gb_LOCALBUILDDIR)/SetupLocal.mk)),)
+include $(gb_LOCALBUILDDIR)/SetupLocal.mk
+endif
+
+ifeq ($(strip $(gb_REPOS)),)
+gb_REPOS := $(SOLARSRC)
+endif
+
+# HACK
+# unixify windoze paths
+ifeq ($(OS),WNT)
+override WORKDIR := $(shell cygpath -u $(WORKDIR))
+override OUTDIR := $(shell cygpath -u $(OUTDIR))
+override gb_REPOS := $(shell cygpath -u $(gb_REPOS))
+endif
+
+REPODIR := $(patsubst %/,%,$(dir $(firstword $(gb_REPOS))))
+
+ifeq ($(filter setuplocal removelocal,$(MAKECMDGOALS)),)
+ifneq ($(filter-out $(foreach repo,$(gb_REPOS),$(realpath $(repo))/%),$(realpath $(firstword $(MAKEFILE_LIST)))),)
+$(eval $(call gb_Output_error,The initial makefile $(realpath $(firstword $(MAKEFILE_LIST))) is not in the repositories $(foreach repo,$(gb_REPOS),$(realpath $(repo))).,ALL))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/ComponentTarget.mk b/solenv/gbuild/ComponentTarget.mk
new file mode 100644
index 000000000000..15d162ee29c3
--- /dev/null
+++ b/solenv/gbuild/ComponentTarget.mk
@@ -0,0 +1,77 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+gb_ComponentTarget_REPOS := $(gb_REPOS)
+
+ifeq ($(SYSTEM_LIBXSLT),YES)
+gb_ComponentTarget_XSLTPROCTARGET :=
+gb_ComponentTarget_XSLTPROCCOMMAND := xsltproc
+else
+gb_ComponentTarget_XSLTPROCTARGET := $(call gb_Executable_get_target,xsltproc)
+gb_ComponentTarget_XSLTPROCCOMMAND := $(gb_ComponentTarget_XSLTPROCPRECOMMAND) $(gb_ComponentTarget_XSLTPROCTARGET)
+endif
+gb_ComponentTarget_XSLTCOMMANDFILE := $(SOLARENV)/bin/createcomponent.xslt
+gb_ComponentTarget_get_source = $(1)/$(2).component
+
+# gb_ComponentTarget_PREFIXBASISNATIVE is set by the platform
+
+define gb_ComponentTarget__command
+$(call gb_Output_announce,$(3),$(true),CMP,1)
+$(call gb_Helper_abbreviate_dirs_native,\
+ mkdir -p $(dir $(1)) && \
+ $(gb_ComponentTarget_XSLTPROCCOMMAND) --nonet --stringparam uri \
+ '$(gb_ComponentTarget_PREFIXBASISNATIVE)$(LIBFILENAME)' -o $(1) \
+ $(gb_ComponentTarget_XSLTCOMMANDFILE) $(2))
+
+endef
+
+define gb_ComponentTarget__rules
+$$(call gb_ComponentTarget_get_target,%) : $$(call gb_ComponentTarget_get_source,$(1),%) | $(gb_ComponentTarget_XSLTPROCTARGET)
+ $$(call gb_ComponentTarget__command,$$@,$$<,$$*)
+
+$$(call gb_ComponentTarget_get_clean_target,%) :
+ $$(call gb_Output_announce,$$*,$(false),CMP,1)
+ rm -f $$(call gb_ComponentTarget_get_outdir_target,$$*) $$(call gb_ComponentTarget_get_target,$$*)
+
+endef
+
+$(foreach repo,$(gb_ComponentTarget_REPOS),$(eval $(call gb_ComponentTarget__rules,$(repo))))
+
+$(call gb_ComponentTarget_get_target,%) :
+ $(eval $(call gb_Outpt_error,Unable to find component file $(call gb_ComponentTarget_get_source,,$*) in the repositories: $(gb_ComponentTarget_REPOS) or xlstproc is missing.))
+
+$(call gb_ComponentTarget_get_external_target,%) :
+ $(call gb_Deliver_deliver,$<,$@)
+
+define gb_ComponentTarget_ComponentTarget
+$(call gb_ComponentTarget_get_target,$(1)) : LIBFILENAME := $(or $(3),$(2))
+$(call gb_ComponentTarget_get_outdir_target,$(1)) : $(call gb_ComponentTarget_get_target,$(1))
+$(call gb_Deliver_add_deliverable,$(call gb_ComponentTarget_get_outdir_target,$(1)),$(call gb_ComponentTarget_get_target,$(1)))
+
+endef
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/Deliver.mk b/solenv/gbuild/Deliver.mk
new file mode 100644
index 000000000000..315c9df621f1
--- /dev/null
+++ b/solenv/gbuild/Deliver.mk
@@ -0,0 +1,82 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+gb_Deliver_GNUCOPY := $(GNUCOPY)
+
+# if ($true) then old files will get removed from the target location before
+# they are copied there. In multi-user environments, this is needed you need to
+# be the owner of the target file to be able to modify timestamps
+gb_Deliver_CLEARONDELIVER := $(true)
+
+define gb_Deliver_init
+gb_Deliver_DELIVERABLES :=
+
+endef
+
+define gb_Deliver_add_deliverable
+gb_Deliver_DELIVERABLES += $$(patsubst $(REPODIR)/%,%,$(2)):$$(patsubst $(REPODIR)/%,%,$(1))
+$(if $(gb_HIRESTIME),,.LOW_RESOLUTION_TIME : $(1))
+
+endef
+
+ifeq ($(strip $(gb_Deliver_GNUCOPY)),)
+define gb_Deliver_deliver
+mkdir -p $(dir $(2)) && $(if $(gb_Deliver_CLEARONDELIVER),rm -f $(2) &&) cp -f $(1) $(2) && touch -r $(1) $(2)
+endef
+else
+define gb_Deliver_deliver
+mkdir -p $(dir $(2)) && $(gb_Deliver_GNUCOPY) $(if $(gb_Deliver_CLEARONDELIVER),--remove-destination) --force --preserve=timestamps $(1) $(2)
+endef
+endif
+
+
+# We are currently only creating a deliver.log, if only one module gets build.
+# As it is possible to add gbuild modules into other (which is done for example for
+# the toplevel ooo module already) it does not make sense to create a deliver.log once
+# fully migrated. The whole process should be rethought then.
+# We need the trailing whitespace so that the newline of echo does not become part of the last record.
+define gb_Deliver_setdeliverlogcommand
+ifeq ($$(words $(gb_Module_ALLMODULES)),1)
+$$(eval $$(call gb_Output_announce,$$(strip $$(gb_Module_ALLMODULES)),$$(true),LOG,1))
+deliverlog : COMMAND := mkdir -p $$(OUTDIR)/inc/$$(strip $$(gb_Module_ALLMODULES)) &&
+deliverlog : COMMAND += echo "$$(sort $$(gb_Deliver_DELIVERABLES)) " | $(gb_AWK) -f $$(GBUILDDIR)/processdelivered.awk > $$(OUTDIR)/inc/$$(strip $(gb_Module_ALLMODULES))/gb_deliver.log
+else
+$$(eval $$(call gb_Output_announce,more than one module - creating no deliver.log,$$(true),LOG,1))
+deliverlog : COMMAND := true
+endif
+endef
+
+# FIXME: this does not really work for real multi repository builds, but the
+# deliver.log format is broken in that case anyway
+.PHONY : deliverlog
+deliverlog:
+ $(eval $(call gb_Deliver_setdeliverlogcommand))
+ $(call gb_Helper_abbreviate_dirs, $(COMMAND))
+
+all : deliverlog
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
new file mode 100644
index 000000000000..341f7c7b66fd
--- /dev/null
+++ b/solenv/gbuild/Executable.mk
@@ -0,0 +1,92 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+# Executable class
+
+# defined by platform
+# gb_Executable_TARGETTYPEFLAGS
+# gb_Executable_Executable_platform
+
+.PHONY : $(call gb_Executable_get_clean_target,%)
+$(call gb_Executable_get_clean_target,%) :
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_Executable_get_target,$*) \
+ $(AUXTARGETS))
+
+$(call gb_Executable_get_target,%) :
+ $(call gb_Helper_abbreviate_dirs,\
+ $(call gb_Deliver_deliver,$<,$@) \
+ $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target))))
+
+define gb_Executable_Executable
+$(call gb_Executable__Executable_impl,$(1),Executable/$(1)$(gb_Executable_EXT))
+
+endef
+
+define gb_Executable__Executable_impl
+$(call gb_LinkTarget_LinkTarget,$(2))
+$(call gb_LinkTarget_set_targettype_flags,$(2),$(gb_Executable_TARGETTYPEFLAGS) $(call gb_Executable_get_rpath,$(1)))
+$(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2))
+$(call gb_Executable_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
+$(call gb_Executable_Executable_platform,$(1),$(2))
+$$(eval $$(call gb_Module_register_target,$(call gb_Executable_get_target,$(1)),$(call gb_Executable_get_clean_target,$(1))))
+$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)))
+
+endef
+
+define gb_Executable_forward_to_Linktarget
+gb_Executable_$(1) = $$(call gb_LinkTarget_$(1),Executable/$$(1)$$(gb_Executable_EXT),$$(2),$$(3))
+
+endef
+
+$(eval $(foreach method,\
+ add_cobject \
+ add_cobjects \
+ add_cxxobject \
+ add_cxxobjects \
+ add_objcxxobject \
+ add_objcxxobjects \
+ add_exception_objects \
+ add_noexception_objects \
+ set_cflags \
+ set_cxxflags \
+ set_objcxxflags \
+ set_defs \
+ set_include \
+ set_ldflags \
+ set_library_path_flags \
+ add_linked_libs \
+ add_linked_static_libs \
+ add_package_headers \
+ add_sdi_headers \
+ add_precompiled_header \
+,\
+ $(call gb_Executable_forward_to_Linktarget,$(method))\
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk
new file mode 100644
index 000000000000..c5fe87bbc343
--- /dev/null
+++ b/solenv/gbuild/Helper.mk
@@ -0,0 +1,156 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+gb_Helper_NULLFILE := /dev/null
+
+gb_Helper_MISC := $(WORKDIR)/Misc
+
+# general propose phony target
+gb_Helper_PHONY := $(gb_Helper_MISC)/PHONY
+
+# general propose empty dummy target
+gb_Helper_MISCDUMMY := $(gb_Helper_MISC)/DUMMY
+
+.PHONY : $(WORKDIR)/Misc/PHONY
+$(gb_Helper_MISCDUMMY) :
+ @mkdir -p $(dir $@) && touch $@
+
+define gb_Helper_abbreviate_dirs
+R=$(REPODIR) && \
+$(subst $(REPODIR)/,$$R/,S=$(SRCDIR) && \
+$(subst $(SRCDIR)/,$$S/,O=$(OUTDIR)) && \
+$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,W=$(WORKDIR) && $(subst $(WORKDIR)/,$$W/,$(1)))))
+endef
+
+define gb_Helper_make_clean_target
+gb_$(1)_get_clean_target = $(WORKDIR)/Clean/$(1)/$$(1)
+
+endef
+
+define gb_Helper_make_outdir_clean_target
+gb_$(1)_get_clean_target = $$(subst $(OUTDIR)/,$(WORKDIR)/Clean/OutDir/,$$(call gb_$(1)_get_target,$$(1)))
+
+endef
+
+define gb_Helper_make_dep_target
+gb_$(1)_get_dep_target = $(WORKDIR)/Dep/$(1)/$$(1).d
+
+endef
+
+define gb_Helper_make_clean_targets
+$(foreach targettype,$(1),\
+ $(call gb_Helper_make_clean_target,$(targettype)))
+
+endef
+
+define gb_Helper_make_outdir_clean_targets
+$(foreach targettype,$(1),\
+ $(call gb_Helper_make_outdir_clean_target,$(targettype)))
+
+endef
+
+define gb_Helper_make_dep_targets
+$(foreach targettype,$(1),\
+ $(call gb_Helper_make_dep_target,$(targettype)))
+
+endef
+
+define gb_Helper_get_outdir_clean_target
+$$(subst $(OUTDIR)/,$(WORKDIR)/Clean/OutDir/,$(1))
+endef
+
+define gb_Helper_register_repository
+gb_Helper_CURRENTREPOSITORY := $(1)
+
+endef
+
+define gb_Helper_add_repository
+gb_Helper_CURRENTREPOSITORY :=
+include $(1)/Repository.mk
+ifeq ($$(gb_Helper_CURRENTREPOSITORY),)
+$$(eval $$(call gb_Output_error,No call to gb_Helper_register_repository in Repository.mk for repository $(1)))
+endif
+$$(gb_Helper_CURRENTREPOSITORY) := $(1)
+
+endef
+
+define gb_Helper_add_repositories
+$(foreach repo,$(1),$(call gb_Helper_add_repository,$(repo)))
+
+endef
+
+define gb_Helper_init_registries
+gb_Executable_VALIDGROUPS := UREBIN SDK OOO BRAND NONE
+gb_Library_VALIDGROUPS := OOOLIBS PLAINLIBS_NONE PLAINLIBS_URE PLAINLIBS_OOO RTLIBS RTVERLIBS STLLIBS UNOLIBS_URE UNOLIBS_OOO UNOVERLIBS
+gb_StaticLibrary_VALIDGROUPS := PLAINLIBS
+
+$$(foreach group,$$(gb_Executable_VALIDGROUPS),$$(eval gb_Executable_$$(group) :=))
+$$(foreach group,$$(gb_Library_VALIDGROUPS),$$(eval gb_Library_$$(group) :=))
+$$(foreach group,$$(gb_StaticLibrary_VALIDGROUPS),$$(eval gb_StaticLibrary_$$(group) :=))
+
+endef
+
+define gb_Helper_collect_libtargets
+gb_Library_TARGETS := $$(foreach group,$$(gb_Library_VALIDGROUPS),$$(gb_Library_$$(group)))
+gb_StaticLibrary_TARGETS := $$(foreach group,$$(gb_StaticLibrary_VALIDGROUPS),$$(gb_StaticLibrary_$$(group)))
+
+endef
+
+define gb_Helper_collect_knownlibs
+gb_Library_KNOWNLIBS := $$(foreach group,$$(gb_Library_VALIDGROUPS),$$(gb_Library_$$(group)))
+gb_StaticLibrary_KNOWNLIBS := $$(foreach group,$$(gb_StaticLibrary_VALIDGROUPS),$$(gb_StaticLibrary_$$(group)))
+
+endef
+
+define gb_Helper_register_executables
+ifeq ($$(filter $(1),$$(gb_Executable_VALIDGROUPS)),)
+$$(eval $$(call gb_Output_error,$(1) is not a valid group for executables. Valid groups are: $$(gb_Executable_VALIDGROUPS)))
+endif
+
+gb_Executable_$(1) += $(2)
+
+endef
+
+define gb_Helper_register_libraries
+ifeq ($$(filter $(1),$$(gb_Library_VALIDGROUPS)),)
+$$(eval $$(call gb_Output_error,$(1) is not a valid group for libraries. Valid groups are: $$(gb_Library_VALIDGROUPS)))
+endif
+
+gb_Library_$(1) += $(2)
+
+endef
+
+define gb_Helper_register_static_libraries
+ifeq ($$(filter $(1),$$(gb_StaticLibrary_VALIDGROUPS)),)
+$$(eval $$(call gb_Output_error,$(1) is not a valid group for static libraries. Valid groups are: $$(gb_StaticLibrary_VALIDGROUPS)))
+endif
+
+gb_StaticLibrary_$(1) += $(2)
+
+endef
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
new file mode 100644
index 000000000000..9a0c0aadf9bf
--- /dev/null
+++ b/solenv/gbuild/Library.mk
@@ -0,0 +1,117 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+# Library class
+
+# defined globally in gbuild.mk
+# gb_Library_OUTDIRLOCATION := $(OUTDIR)/lib
+# gb_Library_DLLDIR := $(WORKDIR)/LinkTarget/Library
+# defined by platform
+# gb_Library_DEFS
+# gb_Library_DLLFILENAMES
+# gb_Library_FILENAMES
+# gb_Library_TARGETS
+# gb_Library_TARGETTYPEFLAGS
+# gb_Library_Library_platform
+
+
+# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
+.PHONY : $(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT)
+$(WORKDIR)/Clean/OutDir/lib/%$(gb_Library_PLAINEXT) : $(call gb_LinkTarget_get_clean_target,$(call gb_Library_get_linktargetname,%$(gb_Library_PLAINEXT)))
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -f $(OUTDIR)/lib/$*$(gb_Library_PLAINEXT) \
+ $(AUXTARGETS))
+
+# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
+$(gb_Library_OUTDIRLOCATION)/%$(gb_Library_PLAINEXT) :
+ $(call gb_Helper_abbreviate_dirs,\
+ $(call gb_Deliver_deliver,$<,$@) \
+ $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target))))
+
+define gb_Library_Library
+ifeq (,$$(findstring $(1),$$(gb_Library_KNOWNLIBS)))
+$$(eval $$(call gb_Output_info,Currently known libraries are: $(sort $(gb_Library_KNOWNLIBS)),ALL))
+$$(eval $$(call gb_Output_error,Library $(1) must be registered in Repository.mk))
+endif
+$(call gb_Library_get_target,$(1)) : AUXTARGETS :=
+$(call gb_Library__Library_impl,$(1),$(call gb_Library_get_linktargetname,$(call gb_Library_get_filename,$(1))))
+
+endef
+
+define gb_Library__Library_impl
+$(call gb_LinkTarget_LinkTarget,$(2))
+$(call gb_LinkTarget_set_targettype_flags,$(2),$(gb_Library_TARGETTYPEFLAGS) $(call gb_Library_get_rpath,$(1)))
+$(call gb_LinkTarget_set_defs,$(2),\
+ $$(DEFS) \
+ $(gb_Library_DEFS) \
+)
+$(call gb_Library_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2))
+$(call gb_Library_Library_platform,$(1),$(2),$(gb_Library_DLLDIR)/$(call gb_Library_get_dllname,$(1)))
+$$(eval $$(call gb_Module_register_target,$(call gb_Library_get_target,$(1)),$(call gb_Library_get_clean_target,$(1))))
+$(call gb_Deliver_add_deliverable,$(call gb_Library_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)))
+
+endef
+
+define gb_Library_set_componentfile
+$(call gb_ComponentTarget_ComponentTarget,$(2),$(call gb_Library_get_filename,$(1)),$(call gb_Library_get_dllname,$(1)))
+$(call gb_Library_get_target,$(1)) : $(call gb_ComponentTarget_get_outdir_target,$(2))
+$(call gb_Library_get_clean_target,$(1)) : $(call gb_ComponentTarget_get_clean_target,$(2))
+
+endef
+
+define gb_Library__forward_to_Linktarget
+gb_Library_$(1) = $$(call gb_LinkTarget_$(1),$(call gb_Library_get_linktargetname,$$(call gb_Library_get_filename,$$(1))),$$(2),$$(3))
+
+endef
+
+$(eval $(foreach method,\
+ add_cobject \
+ add_cobjects \
+ add_cxxobject \
+ add_cxxobjects \
+ add_objcxxobject \
+ add_objcxxobjects \
+ add_exception_objects \
+ add_noexception_objects \
+ set_cflags \
+ set_cxxflags \
+ set_objcxxflags \
+ set_defs \
+ set_include \
+ set_ldflags \
+ set_library_path_flags \
+ add_linked_libs \
+ add_linked_static_libs \
+ add_package_headers \
+ add_sdi_headers \
+ add_precompiled_header \
+,\
+ $(call gb_Library__forward_to_Linktarget,$(method))\
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
new file mode 100644
index 000000000000..da16f6763002
--- /dev/null
+++ b/solenv/gbuild/LinkTarget.mk
@@ -0,0 +1,569 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+# CObject class
+
+gb_CObject_REPOS := $(gb_REPOS)
+
+gb_CObject_get_source = $(1)/$(2).c
+# defined by platform
+# gb_CObject__command
+
+# this rule generates an "always rebuild" dep file, to have something to include.
+# the dep file will be overridden on the fly, when the object is compiled
+ifeq ($(gb_FULLDEPS),$(true))
+define gb_CObject__command_dep
+mkdir -p $(dir $(1)) && \
+ echo '$(call gb_CObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1)
+
+endef
+else
+gb_CObject__command_dep =
+endif
+
+define gb_CObject__rules
+$$(call gb_CObject_get_target,%) : $$(call gb_CObject_get_source,$(1),%)
+ $$(call gb_CObject__command,$$@,$$*,$$<,$$(DEFS),$$(CFLAGS),$$(INCLUDE))
+
+ifeq ($(gb_FULLDEPS),$(true))
+$$(call gb_CObject_get_dep_target,%) : $$(call gb_CObject_get_source,$(1),%)
+ $$(call gb_CObject__command_dep,$$@,$$*,$$<,$$(DEFS),$$(CFLAGS),$$(INCLUDE))
+endif
+
+endef
+
+$(foreach repo,$(gb_CObject_REPOS),$(eval $(call gb_CObject__rules,$(repo))))
+
+$(call gb_CObject_get_dep_target,%) :
+ $(eval $(call gb_Output_error,Unable to find plain C file $(call gb_CObject_get_source,,$*) in the repositories: $(gb_CObject_REPOS)))
+
+gb_CObject_CObject =
+
+
+# CxxObject class
+
+gb_CxxObject_REPOS := $(gb_REPOS)
+
+gb_CxxObject_get_source = $(1)/$(2).cxx
+# defined by platform
+# gb_CxxObject__command
+
+# This rule generates an "always rebuild" dep file, to have something to
+# include. The dep file will be overridden on the fly, when the object is
+# compiled.
+ifeq ($(gb_FULLDEPS),$(true))
+define gb_CxxObject__command_dep
+mkdir -p $(dir $(1)) && \
+ echo '$(call gb_CxxObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1)
+
+endef
+else
+gb_CxxObject__command_dep =
+endif
+
+# Only enable PCH if the PCH_CXXFLAGS and the PCH_DEFS (from the linktarget)
+# are the same as the CXXFLAGS and DEFS we want to use for this object. This
+# should usually be the case. The DEFS/CXXFLAGS would have too be manually
+# overridden for one object file for them to differ. PCH_CXXFLAGS/PCH_DEFS
+# should never be overridden on an object -- they should be the same as for the
+# whole linktarget. In general it should be cleaner to use a static library
+# compiled with different flags and link that in rather than mixing different
+# flags in one linktarget.
+define gb_CxxObject__set_pchflags
+ifeq ($(gb_ENABLE_PCH),$(true))
+ifneq ($(strip $$(PCH_NAME)),)
+ifeq ($$(sort $$(PCH_CXXFLAGS) $$(PCH_DEFS) $$(gb_LinkTarget_EXCEPTIONFLAGS)),$$(sort $$(CXXFLAGS) $$(DEFS)))
+$$@ : PCHFLAGS := $$(call gb_PrecompiledHeader_get_enableflags,$$(PCH_NAME))
+else
+ifeq ($$(sort $$(PCH_CXXFLAGS) $$(PCH_DEFS) $$(gb_LinkTarget_NOEXCEPTIONFLAGS)),$$(sort $$(CXXFLAGS) $$(DEFS)))
+$$@ : PCHFLAGS := $$(call gb_NoexPrecompiledHeader_get_enableflags,$$(PCH_NAME))
+else
+$$(info No precompiled header available for $$*.)
+$$(info precompiled header flags ( ex) : $$(sort $$(PCH_CXXFLAGS) $$(PCH_DEFS) $$(gb_LinkTarget_EXCEPTIONFLAGS)))
+$$(info precompiled header flags (noex) : $$(sort $$(PCH_CXXFLAGS) $$(PCH_DEFS) $$(gb_LinkTarget_NOEXCEPTIONFLAGS)))
+$$(info . object flags : $$(sort $$(CXXFLAGS) $$(DEFS)))
+$$@ : PCHFLAGS :=
+endif
+endif
+endif
+endif
+endef
+
+define gb_CxxObject__rules
+$$(call gb_CxxObject_get_target,%) : $$(call gb_CxxObject_get_source,$(1),%)
+ $$(eval $$(gb_CxxObject__set_pchflags))
+ $$(call gb_CxxObject__command,$$@,$$*,$$<,$$(DEFS),$$(CXXFLAGS) $$(PCHFLAGS),$$(INCLUDE_STL) $$(INCLUDE))
+
+ifeq ($(gb_FULLDEPS),$(true))
+$$(call gb_CxxObject_get_dep_target,%) : $$(call gb_CxxObject_get_source,$(1),%)
+ $$(eval $$(gb_CxxObject__set_pchflags))
+ $$(call gb_CxxObject__command_dep,$$@,$$*,$$<,$$(DEFS),$$(CXXFLAGS) $$(PCHFLAGS),$$(INCLUDE_STL) $$(INCLUDE))
+endif
+
+endef
+
+$(foreach repo,$(gb_CxxObject_REPOS),$(eval $(call gb_CxxObject__rules,$(repo))))
+
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_CxxObject_get_dep_target,%) :
+ $(eval $(call gb_Output_error,Unable to find C++ file $(call gb_CxxObject_get_source,,$*) in repositories: $(gb_CxxObject_REPOS)))
+
+endif
+
+gb_CxxObject_CxxObject =
+
+
+# ObjCxxObject class
+#
+gb_ObjCxxObject_REPOS := $(gb_REPOS)
+
+gb_ObjCxxObject_get_source = $(1)/$(2).mm
+# defined by platform
+# gb_ObjCxxObject__command
+
+# this rule generates an "always rebuild" dep file, to have something to include.
+# the dep file will be overridden on the fly, when the object is compiled
+ifeq ($(gb_FULLDEPS),$(true))
+define gb_ObjCxxObject__command_dep
+mkdir -p $(dir $(1)) && \
+ echo '$(call gb_ObjCxxObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1)
+
+endef
+else
+gb_ObjCxxObject__command_dep =
+endif
+
+define gb_ObjCxxObject__rules
+$$(call gb_ObjCxxObject_get_target,%) : $$(call gb_ObjCxxObject_get_source,$(1),%)
+ $$(call gb_ObjCxxObject__command,$$@,$$*,$$<,$$(DEFS),$$(OBJCXXFLAGS),$$(INCLUDE_STL) $$(INCLUDE))
+
+ifeq ($(gb_FULLDEPS),$(true))
+$$(call gb_ObjCxxObject_get_dep_target,%) : $$(call gb_ObjCxxObject_get_source,$(1),%)
+ $$(call gb_ObjCxxObject__command_dep,$$@,$$*,$$<,$$(DEFS),$$(OBJCXXFLAGS),$$(INCLUDE_STL) $$(INCLUDE))
+endif
+
+endef
+
+$(foreach repo,$(gb_ObjCxxObject_REPOS),$(eval $(call gb_ObjCxxObject__rules,$(repo))))
+
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_ObjCxxObject_get_dep_target,%) :
+ $(eval $(call gb_Output_error,Unable to find Objective C++ file $(call gb_ObjCxxObject_get_source,,$*) in repositories: $(gb_ObjCxxObject_REPOS)))
+endif
+
+gb_ObjCxxObject_ObjCxxObject =
+
+
+
+# LinkTarget class
+
+gb_LinkTarget_DEFAULTDEFS := $(gb_GLOBALDEFS)
+# defined by platform
+# gb_LinkTarget_CXXFLAGS
+# gb_LinkTarget_LDFLAGS
+# gb_LinkTarget_INCLUDE
+# gb_LinkTarget_INCLUDE_STL
+
+.PHONY : $(call gb_LinkTarget_get_clean_target,%)
+$(call gb_LinkTarget_get_clean_target,%) :
+ $(call gb_Output_announce,$*,$(false),LNK,4)
+ -$(call gb_Helper_abbreviate_dirs,\
+ rm -f \
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
+ $(foreach object,$(COBJECTS),$(call gb_CObject_get_dep_target,$(object))) \
+ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_dep_target,$(object))) \
+ $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \
+ $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_dep_target,$(object))) \
+ $(call gb_LinkTarget_get_target,$*) \
+ $(call gb_LinkTarget_get_dep_target,$*) \
+ $(call gb_LinkTarget_get_headers_target,$*) \
+ $(call gb_LinkTarget_get_external_headers_target,$*) \
+ $(DLLTARGET) \
+ $(AUXTARGETS))
+
+# cat the deps of all objects in one file, then we need only open that one file
+define gb_LinkTarget__command_dep
+$(call gb_Output_announce,LNK:$(2),$(true),DEP,1)
+$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $(1)) && \
+ cat $(gb_Helper_NULLFILE)\
+ $(foreach object,$(3),$(call gb_CObject_get_dep_target,$(object))) \
+ $(foreach object,$(4),$(call gb_CxxObject_get_dep_target,$(object))) \
+ $(foreach object,$(5),$(call gb_ObjCxxObject_get_dep_target,$(object))) > $(1))
+endef
+
+$(call gb_LinkTarget_get_target,%) : $(call gb_LinkTarget_get_headers_target,%) $(gb_Helper_MISCDUMMY)
+ $(call gb_LinkTarget__command,$@,$*,$(TARGETTYPE_FLAGS) $(LDFLAGS),$(LINKED_LIBS),$(LINKED_STATIC_LIBS),$(COBJECTS),$(CXXOBJECTS),$(OBJCXXOBJECTS))
+
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_LinkTarget_get_target,%) : $(call gb_LinkTarget_get_dep_target,%)
+$(call gb_LinkTarget_get_dep_target,%) : | $(call gb_LinkTarget_get_headers_target,%)
+ $(call gb_LinkTarget__command_dep,$@,$*,$(COBJECTS),$(CXXOBJECTS),$(OBJCXXOBJECTS))
+endif
+
+# Ok, this is some dark voodoo: When declaring a linktarget with
+# gb_LinkTarget_LinkTarget we set SELF in the headertarget to name of the
+# target. When the rule for the headertarget is executed and SELF does not
+# match the target name, we are depending on a linktarget that was never
+# declared. In a full build exclusively in gbuild that should never happen.
+# However, partial gbuild build will not know about how to build lower level
+# linktargets, just as gbuild can not know about linktargets generated in the
+# old build.pl/dmake system. Once all is migrated, gbuild should error out
+# when is is told to depend on a linktarget it does not know about and not
+# only warn.
+define gb_LinkTarget__get_external_headers_check
+ifneq ($$(SELF),$$*)
+$$(eval $$(call gb_Output_info,LinkTarget $$* not defined: Assuming headers to be there!,ALL))
+endif
+$$@ : COMMAND := $$(call gb_Helper_abbreviate_dirs, mkdir -p $$(dir $$@) && touch $$@)
+
+endef
+
+$(call gb_LinkTarget_get_external_headers_target,%) :
+ $(eval $(gb_LinkTarget__get_external_headers_check))
+ $(COMMAND)
+
+$(call gb_LinkTarget_get_headers_target,%) : $(call gb_LinkTarget_get_external_headers_target,%)
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && touch $@)
+
+# Explanation of some of the targets:
+# - gb_LinkTarget_get_external_headers_target is the targets that guarantees all
+# headers from linked against libraries are in OUTDIR.
+# - gb_LinkTarget_get_headers_target is the target that guarantees all headers
+# from the linked against the libraries and the linktargets own headers
+# (including generated headers) are in the OUTDIR.
+# - gb_LinkTarget_get_target links the objects into a file in WORKDIR.
+# gb_LinkTarget_get_target depends on gb_LinkTarget_get_headers_target which in
+# turn depends gb_LinkTarget_get_external_headers_target.
+# gb_LinkTarget_get_target depends additionally on the objects, which in turn
+# depend build-order only on the gb_LinkTarget_get_headers_target. The build
+# order-only dependency ensures all headers to be there for compiling and
+# dependency generation without causing all objects to be rebuild when one
+# header changes. Only the ones with an explicit dependency in their generated
+# dependency file will be rebuild.
+#
+# gb_LinkTarget_get_target is the target that links the objects into a file in
+# WORKDIR
+# Explanation of some of the variables:
+# - AUXTARGETS are the additionally generated files that need to be cleaned out
+# on clean.
+# - PCH_CXXFLAGS and PCH_DEFS are the flags that the precompiled headers will
+# be compiled with. They should never be overridden in a single object
+# files.
+# - TARGETTYPEFLAGS are the flags that are needed for a specific kind of target
+# (shl,exe...) They are mostly used by the platforms.
+#
+# Since most variables are set on the linktarget and not on the object, the
+# object learns about these setting via GNU makes scoping of target variables.
+# Therefore it is important that objects are only directly depended on by the
+# linktarget. This for example means that you cannot build a single object
+# alone, because then you would directly depend on the object.
+define gb_LinkTarget_LinkTarget
+$(call gb_LinkTarget_get_clean_target,$(1)) : AUXTARGETS :=
+$(call gb_LinkTarget_get_external_headers_target,$(1)) : SELF := $(1)
+$(call gb_LinkTarget_get_target,$(1)) : DLLTARGET :=
+$(call gb_LinkTarget_get_clean_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : COBJECTS :=
+$(call gb_LinkTarget_get_clean_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : CXXOBJECTS :=
+$(call gb_LinkTarget_get_clean_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : OBJCXXOBJECTS :=
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : CFLAGS := $$(gb_LinkTarget_CFLAGS)
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : CXXFLAGS := $$(gb_LinkTarget_CXXFLAGS)
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : PCH_CXXFLAGS := $$(gb_LinkTarget_CXXFLAGS)
+$(call gb_LinkTarget_get_target,$(1)) : OBJCXXFLAGS := $$(gb_LinkTarget_OBJCXXFLAGS)
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : DEFS := $$(gb_LinkTarget_DEFAULTDEFS)
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : PCH_DEFS := $$(gb_LinkTarget_DEFAULTDEFS)
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : INCLUDE := $$(gb_LinkTarget_INCLUDE)
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : INCLUDE_STL := $$(gb_LinkTarget_INCLUDE_STL)
+$(call gb_LinkTarget_get_target,$(1)) : LDFLAGS := $$(gb_LinkTarget_LDFLAGS)
+$(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS :=
+$(call gb_LinkTarget_get_target,$(1)) : LINKED_STATIC_LIBS :=
+$(call gb_LinkTarget_get_target,$(1)) : TARGETTYPE_FLAGS :=
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : PCH_NAME :=
+
+ifeq ($(gb_FULLDEPS),$(true))
+ifneq ($(wildcard $(call gb_LinkTarget_get_dep_target,$(1))),)
+include $(call gb_LinkTarget_get_dep_target,$(1))
+else
+$(firstword $(MAKEFILE_LIST)) : $(call gb_LinkTarget_get_dep_target,$(1))
+endif
+$(call gb_LinkTarget_get_dep_target,$(1)) : COBJECTS :=
+$(call gb_LinkTarget_get_dep_target,$(1)) : CXXOBJECTS :=
+$(call gb_LinkTarget_get_dep_target,$(1)) : OBJCXXOBJECTS :=
+$(call gb_LinkTarget_get_dep_target,$(1)) : CFLAGS := $$(gb_LinkTarget_CFLAGS)
+$(call gb_LinkTarget_get_dep_target,$(1)) : CXXFLAGS := $$(gb_LinkTarget_CXXFLAGS)
+$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_CXXFLAGS := $$(gb_LinkTarget_CXXFLAGS)
+$(call gb_LinkTarget_get_dep_target,$(1)) : OBJCXXFLAGS := $$(gb_LinkTarget_OBJCXXFLAGS)
+$(call gb_LinkTarget_get_dep_target,$(1)) : DEFS := $$(gb_LinkTarget_DEFAULTDEFS)
+$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_DEFS := $$(gb_LinkTarget_DEFAULTDEFS)
+$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE := $$(gb_LinkTarget_INCLUDE)
+$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE_STL := $$(gb_LinkTarget_INCLUDE_STL)
+$(call gb_LinkTarget_get_dep_target,$(1)) : TARGETTYPE_FLAGS :=
+$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_NAME :=
+endif
+
+endef
+
+define gb_LinkTarget_set_defs
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : DEFS := $(2)
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : PCH_DEFS := $(2)
+
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_LinkTarget_get_dep_target,$(1)) : DEFS := $(2)
+$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_DEFS := $(2)
+endif
+
+endef
+
+define gb_LinkTarget_set_cflags
+$(call gb_LinkTarget_get_target,$(1)) : CFLAGS := $(2)
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_LinkTarget_get_dep_target,$(1)) : CFLAGS := $(2)
+endif
+
+endef
+
+define gb_LinkTarget_set_cxxflags
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : CXXFLAGS := $(2)
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : PCH_CXXFLAGS := $(2)
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_LinkTarget_get_dep_target,$(1)) : CXXFLAGS := $(2)
+$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_CXXFLAGS := $(2)
+endif
+
+endef
+
+define gb_LinkTarget_set_objcxxflags
+$(call gb_LinkTarget_get_target,$(1)) : OBJCXXFLAGS := $(2)
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_LinkTarget_get_dep_target,$(1)) : OBJCXXFLAGS := $(2)
+endif
+
+endef
+
+define gb_LinkTarget_set_include
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : INCLUDE := $(2)
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE := $(2)
+endif
+
+endef
+
+define gb_LinkTarget_set_include_stl
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : INCLUDE_STL := $(2)
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE_STL := $(2)
+endif
+
+endef
+
+define gb_LinkTarget_set_ldflags
+$(call gb_LinkTarget_get_target,$(1)) : LDFLAGS := $(2)
+endef
+
+define gb_LinkTarget_add_linked_libs
+ifneq (,$$(filter-out $(gb_Library_KNOWNLIBS),$(2)))
+$$(eval $$(call gb_Output_info,currently known libraries are: $(sort $(gb_Library_KNOWNLIBS)),ALL))
+$$(eval $$(call gb_Output_error,Cannot link against library/libraries $$(filter-out $(gb_Library_KNOWNLIBS),$(2)). Libraries must be registered in Repository.mk))
+endif
+
+$(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS += $(2)
+
+$(call gb_LinkTarget_get_target,$(1)) : $$(foreach lib,$(2),$$(call gb_Library_get_target,$$(lib)))
+$(call gb_LinkTarget_get_external_headers_target,$(1)) : \
+$$(foreach lib,$(2),$$(call gb_Library_get_headers_target,$$(lib)))
+
+endef
+
+define gb_LinkTarget_add_linked_static_libs
+ifneq (,$$(filter-out $(gb_StaticLibrary_KNOWNLIBS),$(2)))
+$$(eval $$(call gb_Output_info, currently known static libraries are: $(sort $(gb_StaticLibrary_KNOWNLIBS)),ALL))
+$$(eval $$(call gb_Output_error,Cannot link against static library/libraries $$(filter-out $(gb_StaticLibrary_KNOWNLIBS),$(2)). Static libraries must be registered in Repository.mk))
+endif
+
+$(call gb_LinkTarget_get_target,$(1)) : LINKED_STATIC_LIBS += $(2)
+
+$(call gb_LinkTarget_get_target,$(1)) : $$(foreach lib,$(2),$$(call gb_StaticLibrary_get_target,$$(lib)))
+$(call gb_LinkTarget_get_external_headers_target,$(1)) : \
+$$(foreach lib,$(2),$$(call gb_StaticLibrary_get_headers_target,$$(lib)))
+
+endef
+
+define gb_LinkTarget_add_cobject
+$(call gb_LinkTarget_get_target,$(1)) : COBJECTS += $(2)
+$(call gb_LinkTarget_get_clean_target,$(1)) : COBJECTS += $(2)
+
+$(call gb_LinkTarget_get_target,$(1)) : $(call gb_CObject_get_target,$(2))
+$(call gb_CObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1))
+$(call gb_CObject_get_target,$(2)) : CFLAGS += $(3)
+
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_LinkTarget_get_dep_target,$(1)) : COBJECTS += $(2)
+$(call gb_LinkTarget_get_dep_target,$(1)) : $(call gb_CObject_get_dep_target,$(2))
+endif
+
+endef
+
+define gb_LinkTarget_add_cxxobject
+$(call gb_LinkTarget_get_target,$(1)) : CXXOBJECTS += $(2)
+$(call gb_LinkTarget_get_clean_target,$(1)) : CXXOBJECTS += $(2)
+
+$(call gb_LinkTarget_get_target,$(1)) : $(call gb_CxxObject_get_target,$(2))
+$(call gb_CxxObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1))
+$(call gb_CxxObject_get_target,$(2)) : CXXFLAGS += $(3)
+
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_LinkTarget_get_dep_target,$(1)) : CXXOBJECTS += $(2)
+$(call gb_LinkTarget_get_dep_target,$(1)) : $(call gb_CxxObject_get_dep_target,$(2))
+endif
+
+endef
+
+define gb_LinkTarget_add_objcxxobject
+$(call gb_LinkTarget_get_target,$(1)) : OBJCXXOBJECTS += $(2)
+$(call gb_LinkTarget_get_clean_target,$(1)) : OBJCXXOBJECTS += $(2)
+
+$(call gb_LinkTarget_get_target,$(1)) : $(call gb_ObjCxxObject_get_target,$(2))
+$(call gb_ObjCxxObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1))
+$(call gb_ObjCxxObject_get_target,$(2)) : OBJCXXFLAGS += $(3)
+
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_LinkTarget_get_dep_target,$(1)) : OBJCXXOBJECTS += $(2)
+$(call gb_LinkTarget_get_dep_target,$(1)) : $(call gb_ObjCxxObject_get_dep_target,$(2))
+endif
+
+endef
+
+define gb_LinkTarget_add_noexception_object
+$(call gb_LinkTarget_add_cxxobject,$(1),$(2),$(gb_LinkTarget_NOEXCEPTIONFLAGS))
+endef
+
+define gb_LinkTarget_add_exception_object
+$(call gb_LinkTarget_add_cxxobject,$(1),$(2),$(gb_LinkTarget_EXCEPTIONFLAGS))
+endef
+
+define gb_LinkTarget_add_cobjects
+$(foreach obj,$(2),$(call gb_LinkTarget_add_cobject,$(1),$(obj),$(3)))
+endef
+
+define gb_LinkTarget_add_cxxobjects
+$(foreach obj,$(2),$(call gb_LinkTarget_add_cxxobject,$(1),$(obj),$(3)))
+endef
+
+define gb_LinkTarget_add_objcxxobjects
+$(foreach obj,$(2),$(call gb_LinkTarget_add_objcxxobject,$(1),$(obj),$(3)))
+endef
+
+define gb_LinkTarget_add_noexception_objects
+$(foreach obj,$(2),$(call gb_LinkTarget_add_noexception_object,$(1),$(obj)))
+endef
+
+define gb_LinkTarget_add_exception_objects
+$(foreach obj,$(2),$(call gb_LinkTarget_add_exception_object,$(1),$(obj)))
+endef
+
+define gb_LinkTarget_set_targettype_flags
+$(call gb_LinkTarget_get_target,$(1)) \
+$(call gb_LinkTarget_get_dep_target,$(1)) : TARGETTYPE_FLAGS := $(2)
+endef
+
+define gb_LinkTarget_set_dlltarget
+$(call gb_LinkTarget_get_clean_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : DLLTARGET := $(2)
+endef
+
+define gb_LinkTarget_set_auxtargets
+$(call gb_LinkTarget_get_clean_target,$(1)) : AUXTARGETS := $(2)
+endef
+
+define gb_LinkTarget__add_internal_headers
+$(call gb_LinkTarget_get_headers_target,$(1)) : $(2)
+$(2) :| $(call gb_LinkTarget_get_external_headers_target,$(1))
+
+endef
+
+define gb_LinkTarget_add_package_headers
+$(call gb_LinkTarget__add_internal_headers,$(1),$(foreach package,$(2),$(call gb_Package_get_target,$(package))))
+$(call gb_LinkTarget_get_clean_target,$(1)) : $(foreach package,$(2),$(call gb_Package_get_clean_target,$(package)))
+
+endef
+
+define gb_LinkTarget_add_sdi_headers
+$(call gb_LinkTarget__add_internal_headers,$(1),$(foreach sdi,$(2),$(call gb_SdiTarget_get_target,$(sdi))))
+$(call gb_LinkTarget_get_clean_target,$(1)) : $(foreach sdi,$(2),$(call gb_SdiTarget_get_clean_target,$(sdi)))
+endef
+
+define gb_LinkTarget__add_precompiled_header_impl
+$(call gb_LinkTarget__add_internal_headers,$(1),$(call gb_PrecompiledHeader_get_target,$(3)))
+$(call gb_LinkTarget_get_clean_target,$(1)) : $(call gb_PrecompiledHeader_get_clean_target,$(3))
+$(call gb_PrecompiledHeader_get_target,$(3)) : $(2).cxx
+
+$(call gb_LinkTarget__add_internal_headers,$(1),$(call gb_NoexPrecompiledHeader_get_target,$(3)))
+$(call gb_LinkTarget_get_clean_target,$(1)) : $(call gb_NoexPrecompiledHeader_get_clean_target,$(3))
+$(call gb_NoexPrecompiledHeader_get_target,$(3)) : $(2).cxx
+
+$(call gb_LinkTarget_get_target,$(1)) : PCH_NAME := $(3)
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : DEFS := $$(DEFS) -DPRECOMPILED_HEADERS
+$(call gb_LinkTarget_get_headers_target,$(1)) \
+$(call gb_LinkTarget_get_target,$(1)) : PCH_DEFS = $$(DEFS)
+ifeq ($(gb_FULLDEPS),$(true))
+-include \
+ $(call gb_PrecompiledHeader_get_dep_target,$(3)) \
+ $(call gb_NoexPrecompiledHeader_get_dep_target,$(3))
+$(call gb_LinkTarget_get_dep_target,$(1)) : DEFS := $$(DEFS) -DPRECOMPILED_HEADERS
+$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_DEFS = $$(DEFS)
+endif
+
+endef
+
+define gb_LinkTarget_add_precompiled_header
+ifeq ($(gb_ENABLE_PCH),$(true))
+$(call gb_LinkTarget__add_precompiled_header_impl,$(1),$(2),$(notdir $(2)))
+endif
+
+endef
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/Module.mk b/solenv/gbuild/Module.mk
new file mode 100644
index 000000000000..afc40a835cfe
--- /dev/null
+++ b/solenv/gbuild/Module.mk
@@ -0,0 +1,128 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+# Module class
+
+gb_Module_ALLMODULES :=
+gb_Module_MODULELOCATIONS :=
+gb_Module_TARGETSTACK :=
+gb_Module_CLEANTARGETSTACK :=
+
+.PHONY : $(call gb_Module_get_clean_target,%)
+$(call gb_Module_get_clean_target,%) :
+ $(call gb_Output_announce,$*,$(false),MOD,5)
+ $(call gb_Output_announce_title,module $* cleared.)
+ -$(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_Module_get_target,$*))
+
+$(call gb_Module_get_target,%) :
+ $(call gb_Output_announce,$*,$(true),MOD,5)
+ $(call gb_Output_announce_title,module $* done.)
+ -$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && \
+ touch $@)
+
+.PHONY : all clean
+.DEFAULT_GOAL := all
+
+all :
+ $(call gb_Output_announce,top level modules: $(foreach module,$(filter-out deliverlog,$^),$(notdir $(module))),$(true),ALL,6)
+ $(call gb_Output_announce,loaded modules: $(sort $(gb_Module_ALLMODULES)),$(true),ALL,6)
+ $(call gb_Output_announce_title,all done.)
+ $(call gb_Output_announce_bell)
+
+clean :
+ $(call gb_Output_announce,top level modules: $(foreach module,$^,$(notdir $(module))),$(false),ALL,6)
+ $(call gb_Output_announce,loaded modules: $(sort $(gb_Module_ALLMODULES)),$(false),ALL,6)
+ $(call gb_Output_announce_title,all cleared.)
+ $(call gb_Output_announce_bell)
+
+define gb_Module_Module
+gb_Module_ALLMODULES += $(1)
+gb_Module_MODULELOCATIONS += $(1):$(dir $(realpath $(lastword $(MAKEFILE_LIST))))
+$$(eval $$(call gb_Module_register_target,$(call gb_Module_get_target,$(1)),$(call gb_Module_get_clean_target,$(1))))
+
+endef
+
+# This is called inside the included file and pushes one target on each stack.
+# This has to be called with full late evaluation ($$(eval $$(call ))) and
+# should never be inlined ($(call )) as the calls defining it might be sourced
+# before gb_Module.
+define gb_Module_register_target
+gb_Module_TARGETSTACK := $(1) $(gb_Module_TARGETSTACK)
+gb_Module_CLEANTARGETSTACK := $(2) $(gb_Module_CLEANTARGETSTACK)
+
+endef
+
+# Here we include the file (in it there will be a call to
+# gb_Module_register_target) and pop one target from each stack afterwards.
+define gb_Module_add_target
+include $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Module_MODULELOCATIONS)))/$(2).mk
+$(call gb_Module_get_target,$(1)) : $$(firstword $$(gb_Module_TARGETSTACK))
+$(call gb_Module_get_clean_target,$(1)) : $$(firstword $$(gb_Module_CLEANTARGETSTACK))
+gb_Module_TARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_TARGETSTACK)),$$(gb_Module_TARGETSTACK))
+gb_Module_CLEANTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_CLEANTARGETSTACK)),$$(gb_Module_CLEANTARGETSTACK))
+
+endef
+
+define gb_Module_add_moduledir
+$(call gb_Module_add_target,$(1),$(2)/Module_$(2))
+endef
+
+define gb_Module_add_targets
+$(foreach target,$(2),$(call gb_Module_add_target,$(1),$(target)))
+endef
+
+define gb_Module_add_moduledirs
+$(foreach target,$(2),$(call gb_Module_add_moduledir,$(1),$(target)))
+endef
+
+define gb_Module_make_global_targets
+ifneq ($$(gb_Module_TARGETSTACK),)
+$$(eval $$(call gb_Output_error,Corrupted module target stack!))
+endif
+
+include $(1)
+
+all : $$(firstword $$(gb_Module_TARGETSTACK))
+clean : $$(firstword $$(gb_Module_CLEANTARGETSTACK))
+
+ifneq ($$(words $$(gb_Module_TARGETSTACK)),1)
+$$(eval $$(call gb_Output_error,Corrupted module target stack!))
+endif
+
+gb_Module_TARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_TARGETSTACK)),$$(gb_Module_TARGETSTACK))
+gb_Module_CLEANTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_CLEANTARGETSTACK)),$$(gb_Module_CLEANTARGETSTACK))
+
+ifneq ($$(gb_Module_TARGETSTACK),)
+$$(eval $$(call gb_Output_error,Corrupted module target stack!))
+endif
+
+endef
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/Output.mk b/solenv/gbuild/Output.mk
new file mode 100644
index 000000000000..dabb9b080d09
--- /dev/null
+++ b/solenv/gbuild/Output.mk
@@ -0,0 +1,147 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# user notifications and formatting
+
+define gb_Output__format_type
+[ $(word 2,$(1) build clean) $(2) ]
+endef
+
+define gb_Output__format_target
+$(1)
+endef
+
+define gb_Output_error
+$(error $(1))
+endef
+
+define gb_Output_announce_title
+endef
+
+define gb_Output_announce_bell
+endef
+
+define gb_Output_info
+$(info [ info $(2) ] $(1))
+endef
+
+define gb_Output_warn
+$(warning $(NEWLINE)[ WARN $(2) ] !!!$(NEWLINE)[ WARN $(2) ] !!! $(1)$(NEWLINE)[ WARN $(2) ] !!!)
+endef
+
+gb_Output_ESCAPE := $(shell echo|awk 'BEGIN { printf "%c", 27 }' -)
+gb_Output_BELL := $(shell echo|awk 'BEGIN { printf "%c", 7 }' -)
+
+# only enable colorized output if
+# - gb_COLOR is set
+# - we have a known term
+ifneq ($(strip $(gb_COLOR)),)
+ifneq ($(filter $(TERM),Eterm aterm gnome kterm linux rxvt rxvt-unicode screen xterm xterm-color),)
+
+gb_Output_COLOR_RESET := $(gb_Output_ESCAPE)[0m
+gb_Output_COLOR_RESETANDESCAPE := $(gb_Output_COLOR_RESET)$(gb_Output_ESCAPE)
+
+gb_Output_COLOR_OUTBUILD_LEVEL1 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
+gb_Output_COLOR_OUTBUILD_LEVEL2 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
+gb_Output_COLOR_OUTBUILD_LEVEL3 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
+gb_Output_COLOR_OUTBUILD_LEVEL4 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
+gb_Output_COLOR_OUTBUILD_LEVEL5 := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;46m
+gb_Output_COLOR_OUTBUILD_LEVEL6 := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;44m
+
+gb_Output_COLOR_INBUILD_LEVEL1 := $(gb_Output_COLOR_RESETANDESCAPE)[36;40m
+gb_Output_COLOR_INBUILD_LEVEL2 := $(gb_Output_COLOR_RESETANDESCAPE)[36;1;40m
+gb_Output_COLOR_INBUILD_LEVEL3 := $(gb_Output_COLOR_RESETANDESCAPE)[32;40m
+gb_Output_COLOR_INBUILD_LEVEL4 := $(gb_Output_COLOR_RESETANDESCAPE)[32;1;40m
+gb_Output_COLOR_INBUILD_LEVEL5 := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;46m
+gb_Output_COLOR_INBUILD_LEVEL6 := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;44m
+
+gb_Output_COLOR_OUTCLEAN_LEVEL1 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
+gb_Output_COLOR_OUTCLEAN_LEVEL2 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
+gb_Output_COLOR_OUTCLEAN_LEVEL3 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
+gb_Output_COLOR_OUTCLEAN_LEVEL4 := $(gb_Output_COLOR_RESETANDESCAPE)[37;40m
+gb_Output_COLOR_OUTCLEAN_LEVEL5 := $(gb_Output_COLOR_RESETANDESCAPE)[33;1;41m
+gb_Output_COLOR_OUTCLEAN_LEVEL6 := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;41m
+
+gb_Output_COLOR_INCLEAN_LEVEL1 := $(gb_Output_COLOR_RESETANDESCAPE)[33;40m
+gb_Output_COLOR_INCLEAN_LEVEL2 := $(gb_Output_COLOR_RESETANDESCAPE)[33;1;40m
+gb_Output_COLOR_INCLEAN_LEVEL3 := $(gb_Output_COLOR_RESETANDESCAPE)[31;40m
+gb_Output_COLOR_INCLEAN_LEVEL4 := $(gb_Output_COLOR_RESETANDESCAPE)[31;1;40m
+gb_Output_COLOR_INCLEAN_LEVEL5 := $(gb_Output_COLOR_RESETANDESCAPE)[33;1;41m
+gb_Output_COLOR_INCLEAN_LEVEL6 := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;41m
+
+gb_Output_COLOR_ERROR := $(gb_Output_COLOR_RESETANDESCAPE)[37;1;41m
+
+define gb_Output__format_type
+$(subst :, ,$(word 2,$(1) \
+ $(gb_Output_COLOR_OUTBUILD_LEVEL$(3))[:$(gb_Output_COLOR_INBUILD_LEVEL$(3))__.oO:$(subst $(WHITESPACE),:,$(2))$(gb_Output_COLOR_OUTBUILD_LEVEL$(3)):] \
+ $(gb_Output_COLOR_OUTCLEAN_LEVEL$(3))[:$(gb_Output_COLOR_INCLEAN_LEVEL$(3))Xx.__:$(subst $(WHITESPACE),:,$(2))$(gb_Output_COLOR_OUTCLEAN_LEVEL$(3)):]))$(gb_Output_COLOR_RESET)
+endef
+
+define gb_Output_info
+$(info $(gb_Output_COLOR_OUTBUILD_LEVEL6)[ $(gb_Output_COLOR_INBUILD_LEVEL6)info $(2)$(gb_Output_COLOR_OUTBUILD_LEVEL6) ]$(gb_Output_COLOR_RESET) $(1))
+endef
+
+define gb_Output_warn
+$(warning $(NEWLINE)$(gb_Output_COLOR_OUTCLEAN_LEVEL6)[ $(gb_Output_COLOR_INCLEAN_LEVEL6)WARN $(2)$(gb_Output_COLOR_OUTCLEAN_LEVEL6) ]$(gb_Output_COLOR_RESET) !!!$(NEWLINE)$(gb_Output_COLOR_OUTCLEAN_LEVEL6)[ $(gb_Output_COLOR_INCLEAN_LEVEL6)WARN $(2)$(gb_Output_COLOR_OUTCLEAN_LEVEL6) ]$(gb_Output_COLOR_RESET) !!! $(1)$(NEWLINE)$(gb_Output_COLOR_OUTCLEAN_LEVEL6)[ $(gb_Output_COLOR_INCLEAN_LEVEL6)WARN $(2)$(gb_Output_COLOR_OUTCLEAN_LEVEL6) ]$(gb_Output_COLOR_RESET) !!!)
+endef
+
+define gb_Output_error
+$(error $(gb_Output_COLOR_ERROR)$(1)$(gb_Output_COLOR_RESET))
+endef
+
+endif
+endif
+
+# only enable title output if
+# - gb_TITLES is set
+# - we have a known term
+ifneq ($(strip $(gb_TITLES)),)
+ifneq ($(filter $(TERM),Eterm aterm gnome kterm rxvt rxvt-unicode screen xterm xterm-color),)
+define gb_Output_announce_title
+$(info $(gb_Output_ESCAPE)]2;gbuild: $(1)$(gb_Output_BELL)$(gb_Output_ESCAPE)[A)
+endef
+
+$(call gb_Output_announce_title,...)
+
+endif
+endif
+
+# only enable bell output if
+# - gb_BELL is set
+# - gb_TTY is true (not piping to a file)
+ifneq ($(strip $(gb_BELL)),)
+define gb_Output_announce_bell
+$(info $(gb_Output_BELL)$(gb_Output_ESCAPE)[A)
+endef
+endif
+
+define gb_Output_announce
+$(info $(call gb_Output__format_type,$(2),$(3),$(4)) $(call gb_Output__format_target,$(1)))
+endef
+
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/Package.mk b/solenv/gbuild/Package.mk
new file mode 100644
index 000000000000..7ed91db48a06
--- /dev/null
+++ b/solenv/gbuild/Package.mk
@@ -0,0 +1,67 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+# PackagePart class
+
+$(foreach destination,$(call gb_PackagePart_get_destinations), $(destination)/%) :
+ $(call gb_Deliver_deliver,$<,$@)
+
+define gb_PackagePart_PackagePart
+$(OUTDIR)/$(1) : $(2)
+$(call gb_Deliver_add_deliverable,$(OUTDIR)/$(1),$(2))
+
+endef
+
+
+# Package class
+
+.PHONY : $(call gb_Package_get_clean_target,%)
+$(call gb_Package_get_clean_target,%) :
+ $(call gb_Output_announce,$*,$(false),PKG,2)
+ -$(call gb_Helper_abbreviate_dirs,\
+ rm -f $(FILES))
+
+$(call gb_Package_get_target,%) :
+ $(call gb_Output_announce,$*,$(true),PKG,2)
+ mkdir -p $(dir $@) && touch $@
+
+define gb_Package_Package
+gb_Package_SOURCEDIR_$(1) := $(2)
+$(call gb_Package_get_clean_target,$(1)) : FILES := $(call gb_Package_get_target,$(1))
+$$(eval $$(call gb_Module_register_target,$(call gb_Package_get_target,$(1)),$(call gb_Package_get_clean_target,$(1))))
+
+endef
+
+define gb_Package_add_file
+$(call gb_Package_get_target,$(1)) : $(OUTDIR)/$(2)
+$(call gb_Package_get_clean_target,$(1)) : FILES += $(OUTDIR)/$(2)
+$(call gb_PackagePart_PackagePart,$(2),$$(gb_Package_SOURCEDIR_$(1))/$(3))
+$(OUTDIR)/$(2) : $$(gb_Package_SOURCEDIR_$(1))/$(3)
+endef
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/PrecompiledHeaders.mk b/solenv/gbuild/PrecompiledHeaders.mk
new file mode 100644
index 000000000000..23e075f2adb3
--- /dev/null
+++ b/solenv/gbuild/PrecompiledHeaders.mk
@@ -0,0 +1,75 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+# PrecompiledHeader class
+
+ifeq ($(gb_ENABLE_PCH),$(true))
+
+# gb_PrecompiledHeader_get_enableflags defined by platform
+ifeq ($(gb_DEBUGLEVEL),2)
+gb_PrecompiledHeader_DEBUGDIR := debug
+gb_NoexPrecompiledHeader_DEBUGDIR := debug
+else
+gb_PrecompiledHeader_DEBUGDIR := nodebug
+gb_NoexPrecompiledHeader_DEBUGDIR := nodebug
+endif
+
+$(call gb_PrecompiledHeader_get_dep_target,%) :
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && \
+ echo '$(call gb_PrecompiledHeader_get_target,$*) : $$(gb_Helper_PHONY)' > $@)
+
+$(call gb_NoexPrecompiledHeader_get_dep_target,%) :
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && \
+ echo '$(call gb_NoexPrecompiledHeader_get_target,$*) : $$(gb_Helper_PHONY)' > $@)
+
+$(call gb_PrecompiledHeader_get_target,%) :
+ $(call gb_PrecompiledHeader__command,$@,$*,$<,$(PCH_DEFS),$(PCH_CXXFLAGS) $(gb_PrecompiledHeader_EXCEPTIONFLAGS),$(INCLUDE_STL) $(INCLUDE))
+
+$(call gb_NoexPrecompiledHeader_get_target,%) :
+ $(call gb_NoexPrecompiledHeader__command,$@,$*,$<,$(PCH_DEFS),$(PCH_CXXFLAGS) $(gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS),$(INCLUDE_STL) $(INCLUDE))
+
+.PHONY : $(call gb_PrecompiledHeader_get_clean_target,%) $(call gb_NoExPrecompiledHeader_get_clean_target,%)
+$(call gb_PrecompiledHeader_get_clean_target,%) :
+ $(call gb_Output_announce,$*,$(false),PCH,1)
+ -$(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_PrecompiledHeader_get_target,$*) \
+ $(call gb_PrecompiledHeader_get_target,$*).pdb \
+ $(call gb_PrecompiledHeader_get_dep_target,$*))
+
+
+$(call gb_NoexPrecompiledHeader_get_clean_target,%) :
+ $(call gb_Output_announce,$*,$(false),PCH,1)
+ -$(call gb_Helper_abbreviate_dirs,\
+ rm -f $(call gb_NoexPrecompiledHeader_get_target,$*) \
+ $(call gb_NoexPrecompiledHeader_get_target,$*).pdb \
+ $(call gb_NoexPrecompiledHeader_get_dep_target,$*))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/SdiTarget.mk b/solenv/gbuild/SdiTarget.mk
new file mode 100644
index 000000000000..0281337fc85f
--- /dev/null
+++ b/solenv/gbuild/SdiTarget.mk
@@ -0,0 +1,72 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# SdiTarget is evil, in that it does not support multiple repositories for now (hardcoded to SRCDIR)
+# Also there is no way to cleanly deliver the generated header to OUTDIR.
+# (This can be workarounded by using gb_Package, but really should not.)
+
+# SdiTarget class
+
+gb_SdiTarget_SVIDLTARGET := $(call gb_Executable_get_target,svidl)
+gb_SdiTarget_SVIDLAUXDEPS := $(call gb_Library_get_target,tl) $(call gb_Library_get_target,sal)
+gb_SdiTarget_SVIDLCOMMAND := $(gb_SdiTarget_SVIDLPRECOMMAND) $(gb_SdiTarget_SVIDLTARGET)
+
+$(call gb_SdiTarget_get_target,%) : $(SRCDIR)/%.sdi | $(gb_SdiTarget_SVIDLTARGET) $(gb_SdiTarget_SVIDLAUXDEPS)
+ $(call gb_Output_announce,$*,$(true),SDI,1)
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $(WORKDIR)/inc/$*) $(dir $@))
+ $(call gb_Helper_abbreviate_dirs_native,\
+ cd $(dir $<) && \
+ $(gb_SdiTarget_SVIDLCOMMAND) -quiet \
+ $(INCLUDE) \
+ -fs$@.hxx \
+ -fd$@.ilb \
+ -fl$@.lst \
+ -fz$@.sid \
+ -fx$(EXPORTS) \
+ -fm$@ \
+ $<)
+
+.PHONY : $(call gb_SdiTarget_get_clean_target,%)
+$(call gb_SdiTarget_get_clean_target,%) :
+ $(call gb_Output_announce,$*,$(false),SDI,1)
+ -$(call gb_Helper_abbreviate_dirs,\
+ rm -f $(foreach ext,.hxx .ilb .lst .sid,\
+ $(call gb_SdiTarget_get_target,$*)$(ext)) \
+ $(call gb_SdiTarget_get_target,$*))
+
+define gb_SdiTarget_SdiTarget
+$(call gb_SdiTarget_get_target,$(1)) : INCLUDE := -I$(WORKDIR)/inc/ $$(subst -I. ,-I$$(dir $(SRCDIR)/$(1)) ,$$(SOLARINC))
+$(call gb_SdiTarget_get_target,$(1)) : EXPORTS := $(SRCDIR)/$(2).sdi
+endef
+
+define gb_SdiTarget_set_include
+$(call gb_SdiTarget_get_target,$(1)) : INCLUDE := $(2)
+
+endef
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk
new file mode 100644
index 000000000000..6d1f07b068f1
--- /dev/null
+++ b/solenv/gbuild/StaticLibrary.mk
@@ -0,0 +1,107 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+# Static Library class
+
+# defined globally in gbuild.mk
+# gb_StaticLibrary_OUTDIRLOCATION := $(OUTDIR)/lib
+# defined by platform
+# gb_StaticLibrary_DEFS
+# gb_StaticLibrary_FILENAMES
+# gb_StaticLibrary_TARGETS
+# gb_StaticLibrary_TARGETTYPEFLAGS
+
+
+# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
+.PHONY : $(WORKDIR)/Clean/OutDir/lib/%$(gb_StaticLibrary_PLAINEXT)
+$(WORKDIR)/Clean/OutDir/lib/%$(gb_StaticLibrary_PLAINEXT) : $(call gb_LinkTarget_get_clean_target,$(call gb_StaticLibrary_get_linktargetname,%$(gb_StaticLibrary_PLAINEXT)))
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -f $(OUTDIR)/lib/$*$(gb_StaticLibrary_PLAINEXT) \
+ $(AUXTARGETS))
+
+# EVIL: gb_StaticLibrary and gb_Library need the same deliver rule because they are indistinguishable on windows
+$(gb_StaticLibrary_OUTDIRLOCATION)/%$(gb_StaticLibrary_PLAINEXT) :
+ $(call gb_Helper_abbreviate_dirs,\
+ $(call gb_Deliver_deliver,$<,$@) \
+ $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target))))
+
+define gb_StaticLibrary_StaticLibrary
+ifeq (,$$(findstring $(1),$$(gb_StaticLibrary_KNOWNLIBS)))
+$$(eval $$(call gb_Output_info,Currently known static libraries are: $(sort $(gb_StaticLibrary_KNOWNLIBS)),ALL))
+$$(eval $$(call gb_Output_error,Static library $(1) must be registered in Repository.mk))
+endif
+$(call gb_StaticLibrary_get_target,$(1)) : AUXTARGETS :=
+$(call gb_StaticLibrary__StaticLibrary_impl,$(1),$(call gb_StaticLibrary_get_linktargetname,$(call gb_StaticLibrary_get_filename,$(1))))
+
+endef
+
+define gb_StaticLibrary__StaticLibrary_impl
+$(call gb_LinkTarget_LinkTarget,$(2))
+$(call gb_LinkTarget_set_targettype_flags,$(2),$(gb_StaticLibrary_TARGETTYPEFLAGS))
+$(call gb_LinkTarget_set_defs,$(2),\
+ $$(DEFS) \
+ $(gb_StaticLibrary_DEFS) \
+)
+$(call gb_StaticLibrary_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2))
+$(call gb_StaticLibrary_StaticLibrary_platform,$(1),$(2))
+$$(eval $$(call gb_Module_register_target,$(call gb_StaticLibrary_get_target,$(1)),$(call gb_StaticLibrary_get_clean_target,$(1))))
+$(call gb_Deliver_add_deliverable,$(call gb_StaticLibrary_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)))
+
+endef
+
+define gb_StaticLibrary_forward_to_Linktarget
+gb_StaticLibrary_$(1) = $$(call gb_LinkTarget_$(1),$(call gb_StaticLibrary_get_linktargetname,$$(call gb_StaticLibrary_get_filename,$$(1))),$$(2),$$(3))
+
+endef
+
+$(eval $(foreach method,\
+ add_cobject \
+ add_cobjects \
+ add_cxxobject \
+ add_cxxobjects \
+ add_objcxxobject \
+ add_objcxxobjects \
+ add_exception_objects \
+ add_noexception_objects \
+ set_cflags \
+ set_cxxflags \
+ set_objcxxflags \
+ set_defs \
+ set_include \
+ set_ldflags \
+ set_library_path_flags \
+ add_linked_libs \
+ add_linked_static_libs \
+ add_package_headers \
+ add_sdi_headers \
+ add_precompiled_header \
+,\
+ $(call gb_StaticLibrary_forward_to_Linktarget,$(method))\
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
new file mode 100644
index 000000000000..933fc48c09d4
--- /dev/null
+++ b/solenv/gbuild/TargetLocations.mk
@@ -0,0 +1,145 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# outdir target pattern
+
+gb_ComponentTarget_get_outdir_target = $(OUTDIR)/xml/component/$(1).component
+gb_Executable_get_target = $(OUTDIR)/bin/$(1)$(gb_Executable_EXT)
+gb_PackagePart_get_destinations = $(OUTDIR)/xml $(OUTDIR)/inc $(OUTDIR)/bin
+gb_PackagePart_get_target = $(OUTDIR)/$(1)
+gb_ResTarget_get_outdir_imagelist_target = $(OUTDIR)/res/img/$(1).ilst
+gb_ResTarget_get_outdir_target = $(OUTDIR)/bin/$(1).res
+
+define gb_Library_get_target
+$(patsubst $(1):%,$(gb_Library_OUTDIRLOCATION)/%,$(filter $(filter $(1),$(gb_Library_TARGETS)):%,$(gb_Library_FILENAMES)))
+endef
+
+define gb_StaticLibrary_get_target
+$(patsubst $(1):%,$(gb_StaticLibrary_OUTDIRLOCATION)/%,$(filter $(filter $(1),$(gb_StaticLibrary_TARGETS)):%,$(gb_StaticLibrary_FILENAMES)))
+endef
+
+
+# workdir target patterns
+
+gb_AllLangResTarget_get_target = $(WORKDIR)/AllLangRes/$(1)
+gb_CObject_get_target = $(WORKDIR)/CObject/$(1).o
+gb_ComponentTarget_get_target = $(WORKDIR)/ComponentTarget/$(1).component
+gb_CxxObject_get_target = $(WORKDIR)/CxxObject/$(1).o
+gb_Executable_get_external_headers_target = $(WORKDIR)/ExternalHeaders/Executable/$(1)
+gb_Executable_get_headers_target = $(WORKDIR)/Headers/Executable/$(1)
+gb_LinkTarget_get_external_headers_target = $(WORKDIR)/ExternalHeaders/$(1)
+gb_LinkTarget_get_headers_target = $(WORKDIR)/Headers/$(1)
+gb_LinkTarget_get_target = $(WORKDIR)/LinkTarget/$(1)
+gb_Module_get_target = $(WORKDIR)/Module/$(1)
+gb_NoexPrecompiledHeader_get_dep_target = $(WORKDIR)/Dep/NoexPrecompiledHeader/$(gb_NoexPrecompiledHeader_DEBUGDIR)/$(1).hxx.pch.d
+gb_NoexPrecompiledHeader_get_target = $(WORKDIR)/NoexPrecompiledHeader/$(gb_NoexPrecompiledHeader_DEBUGDIR)/$(1).hxx.pch
+gb_ObjCxxObject_get_target = $(WORKDIR)/ObjCxxObject/$(1).o
+gb_Package_get_target = $(WORKDIR)/Package/$(1)
+gb_PrecompiledHeader_get_dep_target = $(WORKDIR)/Dep/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/$(1).hxx.pch.d
+gb_PrecompiledHeader_get_target = $(WORKDIR)/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/$(1).hxx.pch
+gb_ResTarget_get_imagelist_target = $(WORKDIR)/ResTarget/$(1).ilst
+gb_ResTarget_get_target = $(WORKDIR)/ResTarget/$(1).res
+gb_SdiTarget_get_target = $(WORKDIR)/SdiTarget/$(1)
+gb_SrsPartMergeTarget_get_target = $(WORKDIR)/SrsPartMergeTarget/$(1)
+gb_SrsPartTarget_get_target = $(WORKDIR)/SrsPartTarget/$(1)
+gb_SrsTarget_get_target = $(WORKDIR)/SrsTarget/$(1).srs
+
+define gb_Library_get_external_headers_target
+$(patsubst $(1):%,$(WORKDIR)/ExternalHeaders/Library/%,$(filter $(1):%,$(gb_Library_FILENAMES)))
+endef
+
+define gb_Library_get_headers_target
+$(patsubst $(1):%,$(WORKDIR)/Headers/Library/%,$(filter $(1):%,$(gb_Library_FILENAMES)))
+endef
+
+define gb_StaticLibrary_get_external_headers_target
+$(patsubst $(1):%,$(WORKDIR)/ExternalHeaders/StaticLibrary/%,$(filter $(1):%,$(gb_StaticLibrary_FILENAMES)))
+endef
+
+define gb_StaticLibrary_get_headers_target
+$(patsubst $(1):%,$(WORKDIR)/Headers/StaticLibrary/%,$(filter $(1):%,$(gb_StaticLibrary_FILENAMES)))
+endef
+
+$(eval $(call gb_Helper_make_clean_targets,\
+ AllLangResTarget \
+ ComponentTarget \
+ LinkTarget \
+ Module \
+ NoexPrecompiledHeader \
+ PackagePart \
+ PrecompiledHeader \
+ ResTarget \
+ SdiTarget \
+ SrsTarget \
+))
+
+$(eval $(call gb_Helper_make_outdir_clean_targets,\
+ Executable \
+ Library \
+ Package \
+ StaticLibrary \
+))
+
+$(eval $(call gb_Helper_make_dep_targets,\
+ CObject \
+ CxxObject \
+ ObjCxxObject \
+ LinkTarget \
+ SrsPartTarget \
+ SrsTarget \
+))
+
+
+# other getters
+
+gb_Library_get_linktargetname = Library/$(1)
+gb_StaticLibrary_get_linktargetname = StaticLibrary/$(1)
+
+define gb_Library_get_layer
+$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_LAYER)))
+endef
+
+define gb_Executable_get_layer
+$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Executable_LAYER)))
+endef
+
+define gb_Library_get_filename
+$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_FILENAMES)))
+endef
+
+define gb_StaticLibrary_get_filename
+$(patsubst $(1):%,%,$(filter $(1):%,$(gb_StaticLibrary_FILENAMES)))
+endef
+
+
+# static members declared here because they are used globally
+
+gb_Library_OUTDIRLOCATION = $(OUTDIR)/lib
+gb_Library_DLLDIR = $(WORKDIR)/LinkTarget/Library
+gb_StaticLibrary_OUTDIRLOCATION = $(OUTDIR)/lib
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/extensions/PackModule.mk b/solenv/gbuild/extensions/PackModule.mk
new file mode 100644
index 000000000000..237ffcf72670
--- /dev/null
+++ b/solenv/gbuild/extensions/PackModule.mk
@@ -0,0 +1,62 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# this is an optional extension to gbuild
+# it depends on scripts outside the gbuild directory
+# nothing in the gbuild core should ever depend on it
+
+.PHONY : packmodule cleanpackmodule
+
+define gb_PackModule_setpackmodulecommand
+ifeq ($$(words $(gb_Module_ALLMODULES)),1)
+$$(eval $$(call gb_Output_announce,$$(strip $$(gb_Module_ALLMODULES)),$$(true),ZIP,5))
+packmodule : COMMAND := $$(SOLARENV)/bin/packmodule $$(OUTDIR) $$(strip $$(gb_Module_ALLMODULES))
+else
+$$(eval $$(call gb_Output_announce,more than one module - creating no zipped package,$$(true),ZIP,5))
+packmodule : COMMAND := true
+endif
+endef
+
+packmodule : all
+ $(eval $(call gb_PackModule_setpackmodulecommand))
+ $(COMMAND)
+
+define gb_PackModule_setcleanpackmodulecommand
+ifeq ($$(words $(gb_Module_ALLMODULES)),1)
+$$(eval $$(call gb_Output_announce,$$(strip $$(gb_Module_ALLMODULES)),$$(false),ZIP,5))
+cleanpackmodule : COMMAND := rm -f $$(OUTDIR)/zip/$$(strip $$(gb_Module_ALLMODULES)).zip
+else
+$$(eval $$(call gb_Output_announce,more than one module - deleting no zipped package,$$(false),ZIP,5))
+cleanpackmodule : COMMAND := true
+endif
+endef
+
+cleanpackmodule : clean
+ $(eval $(call gb_PackModule_setcleanpackmodulecommand))
+ $(COMMAND)
+
+# vim: set noet ts=4 sw=4:
diff --git a/solenv/gbuild/extensions/SetupLocal.mk b/solenv/gbuild/extensions/SetupLocal.mk
new file mode 100644
index 000000000000..483b8a163056
--- /dev/null
+++ b/solenv/gbuild/extensions/SetupLocal.mk
@@ -0,0 +1,68 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+.PHONY : setuplocal removelocal
+ifneq ($(gb_LOCALBUILDDIR),)
+ifneq ($(wildcard $(gb_LOCALBUILDDIR)/SetupLocal.mk),)
+setuplocal :
+ $(eval $(call gb_Output_error,$(gb_LOCALBUILDDIR) exists already.))
+
+else
+
+setuplocal :
+ $(eval MODULE := $(firstword $(MODULE) $(lastword $(subst /, ,$(dir $(realpath $(firstword $(MAKEFILE_LIST))))))))
+ $(eval modulerepo := $(patsubst %/$(MODULE),%,$(foreach repo,$(gb_REPOS),$(wildcard $(repo)/$(MODULE)))))
+ $(eval $(call gb_Output_announce,setting up local build directory (module: $(MODULE)).,$(true),SYC,5))
+ mkdir -p $(gb_LOCALBUILDDIR)/srcdir $(gb_LOCALBUILDDIR)/workdir $(gb_LOCALBUILDDIR)/outdir
+ rsync --archive --exclude 'workdir/**' $(SOLARVERSION)/$(INPATH)/ $(gb_LOCALBUILDDIR)/outdir
+ cp $(modulerepo)/Repository.mk $(gb_LOCALBUILDDIR)/srcdir/Repository.mk
+ cp $(modulerepo)/RepositoryFixes.mk $(gb_LOCALBUILDDIR)/srcdir/RepositoryFixes.mk
+ rsync --archive $(modulerepo)/$(MODULE)/ $(gb_LOCALBUILDDIR)/srcdir/$(MODULE)
+ echo "gb_REPOS := $(gb_LOCALBUILDDIR)/srcdir $(filter-out $(patsubst %/$(MODULE),%,$(foreach repo,$(gb_REPOS),$(wildcard $(repo)/$(MODULE)))),$(gb_REPOS))" > $(gb_LOCALBUILDDIR)/SetupLocal.mk
+ echo "#original gb_REPOS was $(gb_REPOS)" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
+ echo "OUTDIR := $(gb_LOCALBUILDDIR)/outdir" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
+ echo "#original OUTDIR was $(OUTDIR)" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
+ echo "WORKDIR := $(gb_LOCALBUILDDIR)/workdir" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
+ echo "#original WORKDIR was $(WORKDIR)" >> $(gb_LOCALBUILDDIR)/SetupLocal.mk
+
+endif
+
+removelocal :
+ $(eval $(call gb_Output_warn,removing directory $(gb_LOCALBUILDDIR).,SYC))
+ sleep 10
+ rm -rf $(gb_LOCALBUILDDIR)
+
+else
+setuplocal:
+ $(eval $(call gb_Output_error,setuplocal: gb_LOCALBUILDDIR is not set.))
+
+removelocal:
+ $(eval $(call gb_Output_error,setuplocal: gb_LOCALBUILDDIR is not set.))
+
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
new file mode 100644
index 000000000000..193ca6d3bab3
--- /dev/null
+++ b/solenv/gbuild/gbuild.mk
@@ -0,0 +1,212 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# vars needed from the env/calling makefile
+
+# CVER
+# DEBUG
+# GBUILDDIR
+# INPATH
+# JAVA_HOME
+# JDKINCS
+# LIBXML_CFLAGS
+# OS
+# PRODUCT
+# SOLARINC
+# SOLARLIB
+# STLPORT_VER
+# UPD
+
+# GXX_INCLUDE_PATH (Linux)
+# PTHREAD_CFLAGS (Linux)
+# SYSTEM_ICU (Linux)
+# SYSTEM_JPEG (Linux)
+# SYSTEM_LIBXML (Linux)
+# USE_SYSTEM_STL (Linux)
+
+SHELL := /bin/sh
+true := T
+false :=
+define NEWLINE
+
+
+endef
+
+define WHITESPACE
+
+endef
+
+COMMA :=,
+
+include $(GBUILDDIR)/Output.mk
+
+# BuildDirs uses the Output functions already
+include $(GBUILDDIR)/BuildDirs.mk
+
+
+ifneq ($(strip $(PRODUCT)$(product)),)
+gb_PRODUCT := $(true)
+else
+ifneq ($(strip $(product)),)
+gb_PRODUCT := $(true)
+else
+gb_PRODUCT := $(false)
+endif
+endif
+
+ifneq ($(strip $(DEBUG)$(debug)),)
+gb_DEBUGLEVEL := 2
+else
+ifeq ($(gb_PRODUCT),$(true))
+gb_DEBUGLEVEL := 0
+else
+gb_DEBUGLEVEL := 1
+endif
+endif
+
+ifneq ($(strip $(ENABLE_PCH)),)
+gb_ENABLE_PCH := $(true)
+else
+gb_ENABLE_PCH := $(false)
+endif
+
+# for clean, setuplocal and removelocal goals we switch off dependencies
+ifneq ($(filter clean setuplocal removelocal,$(MAKECMDGOALS)),)
+gb_FULLDEPS := $(false)
+else
+gb_FULLDEPS := $(true)
+endif
+
+include $(GBUILDDIR)/Helper.mk
+include $(GBUILDDIR)/TargetLocations.mk
+
+$(eval $(call gb_Helper_init_registries))
+$(eval $(call gb_Helper_add_repositories,$(gb_REPOS)))
+$(eval $(call gb_Helper_collect_libtargets))
+
+ifeq ($(OS),LINUX)
+include $(GBUILDDIR)/platform/linux.mk
+else
+ifeq ($(OS),WNT)
+include $(GBUILDDIR)/platform/windows.mk
+else
+ifeq ($(OS),SOLARIS)
+include $(GBUILDDIR)/platform/solaris.mk
+else
+ifeq ($(OS),MACOSX)
+include $(GBUILDDIR)/platform/macosx.mk
+else
+$(eval $(call gb_Output_error,Unsupported OS: $(OS)))
+endif
+endif
+endif
+endif
+
+include $(foreach repo,$(gb_REPOS),$(repo)/RepositoryFixes.mk)
+
+$(eval $(call gb_Helper_collect_knownlibs))
+
+gb_GLOBALDEFS := \
+ -D_REENTRANT \
+ -DCUI \
+ -DENABLE_LAYOUT_EXPERIMENTAL=0 \
+ -DENABLE_LAYOUT=0 \
+ -DOSL_DEBUG_LEVEL=$(gb_DEBUGLEVEL) \
+ -DSOLAR_JAVA \
+ -DSTLPORT_VERSION=$(STLPORT_VER) \
+ -DSUPD=$(UPD) \
+ -DVCL \
+ $(gb_OSDEFS) \
+ $(gb_COMPILERDEFS) \
+ $(gb_CPUDEFS) \
+
+ifeq ($(gb_PRODUCT),$(true))
+gb_GLOBALDEFS += \
+ -DPRODUCT \
+ -DPRODUCT_FULL \
+
+else
+gb_GLOBALDEFS += \
+ -DDBG_UTIL \
+ -D_STLP_DEBUG \
+ -D_DEBUG \
+
+endif
+
+ifeq ($(gb_DEBUGLEVEL),2)
+gb_GLOBALDEFS += \
+ -DDEBUG \
+
+else
+gb_GLOBALDEFS += \
+ -DOPTIMIZE \
+ -DNDEBUG \
+
+endif
+
+gb_GLOBALDEFS := $(sort $(gb_GLOBALDEFS))
+
+include $(GBUILDDIR)/Deliver.mk
+
+$(eval $(call gb_Deliver_init))
+
+# We are using a set of scopes that we might as well call classes.
+
+# It is important to include them in the right order as that is
+# -- at least in part -- defining precedence. This is not an issue in the
+# WORKDIR as there are no nameing collisions there, but OUTDIR is a mess
+# and precedence is important there. This is also platform dependant.
+# For example:
+# $(OUTDIR)/bin/% for executables collides
+# with $(OUTDIR)/bin/%.res for resources on unix
+# $(OUTDIR)/lib/%.lib collides
+# on windows (static and dynamic libs)
+# $(OUTDIR)/xml/% for packageparts collides
+# with $(OUTDIR)/xml/component/%.component for components
+# This is less of an issue with GNU Make versions > 3.82 which matches for
+# shortest stem instead of first match. However, upon intoduction this version
+# is not available everywhere by default.
+
+include $(foreach class, \
+ ComponentTarget \
+ AllLangResTarget \
+ LinkTarget \
+ Library \
+ StaticLibrary \
+ Executable \
+ SdiTarget \
+ Package \
+ PrecompiledHeaders \
+ Module \
+,$(GBUILDDIR)/$(class).mk)
+
+# optional extensions that should never be essential
+ifneq ($(wildcard $(GBUILDDIR)/extensions/*.mk),)
+include $(wildcard $(GBUILDDIR)/extensions/*.mk)
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk
new file mode 100755
index 000000000000..f8505ccd39fd
--- /dev/null
+++ b/solenv/gbuild/platform/linux.mk
@@ -0,0 +1,346 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+GUI := UNX
+COM := GCC
+
+gb_MKTEMP := mktemp -p
+
+gb_CC := gcc
+gb_CXX := g++
+gb_GCCP := gcc
+gb_AWK := awk
+
+# normalize setsolar and configure env.
+ifeq ($(CPU),X)
+CPUNAME := X86_64
+endif
+
+# use CC/CXX if they are nondefaults
+ifneq ($(origin CC),default)
+gb_CC := $(CC)
+gb_GCCP := $(CC)
+endif
+ifneq ($(origin CXX),default)
+gb_CXX := $(CXX)
+endif
+
+gb_OSDEFS := \
+ -DLINUX \
+ -D_PTHREADS \
+ -DUNIX \
+ -DUNX \
+ $(PTHREAD_CFLAGS) \
+
+ifeq ($(GXX_INCLUDE_PATH),)
+GXX_INCLUDE_PATH=$(COMPATH)/include/c++/$(shell gcc -dumpversion)
+endif
+
+gb_COMPILERDEFS := \
+ -DGCC \
+ -D$(CVER) \
+ -DCVER=$(CVER) \
+ -DGLIBC=2 \
+ -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \
+ -DHAVE_GCC_VISIBILITY_FEATURE \
+ -DCPPU_ENV=gcc3 \
+
+ifeq ($(CPUNAME),X86_64)
+gb_CPUDEFS := -D$(CPUNAME)
+else
+gb_CPUDEFS := -DX86
+endif
+
+gb_CFLAGS := \
+ -Wall \
+ -Wendif-labels \
+ -Wextra \
+ -fmessage-length=0 \
+ -fno-strict-aliasing \
+ -fpic \
+ -fvisibility=hidden \
+ -pipe \
+
+gb_CXXFLAGS := \
+ -Wall \
+ -Wendif-labels \
+ -Wextra \
+ -Wno-ctor-dtor-privacy \
+ -Wno-non-virtual-dtor \
+ -Wreturn-type \
+ -Wshadow \
+ -Wuninitialized \
+ -fmessage-length=0 \
+ -fno-strict-aliasing \
+ -fno-use-cxa-atexit \
+ -fpic \
+ -fvisibility=hidden \
+ -fvisibility-inlines-hidden \
+ -pipe \
+
+ifneq ($(SYSBASE),)
+gb_CXXFLAGS += --sysroot=$(SYSBASE)
+gb_CFLAGS += --sysroot=$(SYSBASE)
+endif
+gb_LinkTarget_EXCEPTIONFLAGS := \
+ -DEXCEPTIONS_ON \
+ -fexceptions \
+ -fno-enforce-eh-specs \
+
+gb_LinkTarget_NOEXCEPTIONFLAGS := \
+ -DEXCEPTIONS_OFF \
+ -fno-exceptions \
+
+gb_LinkTarget_LDFLAGS := \
+ -Wl,--sysroot=$(SYSBASE) \
+ -Wl,-rpath-link=$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib \
+ -Wl,--hash-style=both \
+ -Wl,-z,combreloc \
+ -Wl,-z,defs \
+ $(subst -L../lib , ,$(SOLARLIB)) \
+
+ifneq ($(HAVE_LD_BSYMBOLIC_FUNCTIONS),)
+gb_LinkTarget_LDFLAGS += \
+ -Wl,--dynamic-list-cpp-new \
+ -Wl,--dynamic-list-cpp-typeinfo \
+ -Wl,-Bsymbolic-functions \
+
+endif
+
+ifeq ($(gb_DEBUGLEVEL),2)
+gb_COMPILEROPTFLAGS := -O0
+else
+gb_COMPILEROPTFLAGS := -Os
+endif
+
+
+# Helper class
+
+gb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs)
+
+# CObject class
+
+define gb_CObject__command
+$(call gb_Output_announce,$(2),$(true),C ,3)
+$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $(1)) && \
+ mkdir -p $(dir $(call gb_CObject_get_dep_target,$(2))) && \
+ $(gb_CC) \
+ -c $(3) \
+ -o $(1) \
+ -MMD -MT $(call gb_CObject_get_target,$(2)) \
+ -MF $(call gb_CObject_get_dep_target,$(2)) \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(6))
+endef
+
+
+# CxxObject class
+
+define gb_CxxObject__command
+$(call gb_Output_announce,$(2),$(true),CXX,3)
+$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $(1)) && \
+ mkdir -p $(dir $(call gb_CxxObject_get_dep_target,$(2))) && \
+ $(gb_CXX) \
+ -c $(3) \
+ -o $(1) \
+ -MMD -MT $(call gb_CxxObject_get_target,$(2)) \
+ -MF $(call gb_CxxObject_get_dep_target,$(2)) \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(6))
+endef
+
+
+# LinkTarget class
+
+define gb_LinkTarget__get_rpath_for_layer
+$(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS)))
+endef
+
+gb_LinkTarget__RPATHS := \
+ URELIB:'$$$$ORIGIN' \
+ UREBIN:'$$$$ORIGIN/../lib:$$$$ORIGIN' \
+ OOOLIB:'$$$$ORIGIN:$$$$ORIGIN/../ure-link/lib' \
+ BRAND:'$$$$ORIGIN:$$$$ORIGIN/../basis-link/program:$$$$ORIGIN/../basis-link/ure-link/lib' \
+ SDKBIN:'$$$$ORIGIN/../../ure-link/lib' \
+ NONEBIN:'$$$$ORIGIN/../lib:$$$$ORIGIN' \
+
+gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_COMPILEROPTFLAGS)
+gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_COMPILEROPTFLAGS)
+
+ifeq ($(gb_DEBUGLEVEL),2)
+gb_LinkTarget_CXXFLAGS += -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline
+gb_LinkTarget_CFLAGS += -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline
+
+endif
+
+gb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC)))
+gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
+
+define gb_LinkTarget__command
+$(call gb_Output_announce,$(2),$(true),LNK,4)
+$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $(1)) && \
+ $(gb_CXX) \
+ $(3) \
+ $(patsubst lib%.so,-l%,$(foreach lib,$(4),$(call gb_Library_get_filename,$(lib)))) \
+ $(foreach object,$(6),$(call gb_CObject_get_target,$(object))) \
+ $(foreach object,$(7),$(call gb_CxxObject_get_target,$(object))) \
+ -Wl$(COMMA)--start-group $(foreach lib,$(5),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \
+ -o $(1))
+endef
+
+
+# Library class
+
+gb_Library_DEFS := -D_DLL_
+gb_Library_TARGETTYPEFLAGS := -shared -Wl,-z,noexecstack
+gb_Library_SYSPRE := lib
+gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_
+gb_Library_PLAINEXT := .so
+gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT)
+ifeq ($(gb_PRODUCT),$(true))
+gb_Library_STLEXT := port_gcc$(gb_Library_PLAINEXT)
+else
+gb_Library_STLEXT := port_gcc_stldebug$(gb_Library_PLAINEXT)
+endif
+
+ifeq ($(CPUNAME),X86_64)
+gb_Library_OOOEXT := lx$(gb_Library_PLAINEXT)
+gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
+else
+gb_Library_OOOEXT := li$(gb_Library_PLAINEXT)
+gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
+endif
+
+gb_Library_PLAINLIBS_NONE += \
+ dl \
+ jpeg \
+ m \
+ pthread \
+ X11 \
+ z
+
+gb_Library_FILENAMES := \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_STLEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
+
+
+gb_Library_Library_platform =
+
+define gb_Library_get_rpath
+-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1))) \
+-Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)
+endef
+
+gb_Library_LAYER := \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
+
+
+# StaticLibrary class
+
+gb_StaticLibrary_DEFS :=
+gb_StaticLibrary_TARGETTYPEFLAGS := -Wl,-z,noexecstack -static -nostdlib
+gb_StaticLibrary_SYSPRE := lib
+gb_StaticLibrary_PLAINEXT := .a
+gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
+
+gb_StaticLibrary_FILENAMES := \
+ $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
+ $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
+
+gb_StaticLibrary_StaticLibrary_platform =
+
+# Executable class
+
+gb_Executable_EXT :=
+gb_Executable_TARGETTYPEFLAGS :=
+gb_Executable_Executable_platform =
+
+gb_Executable_LAYER := \
+ $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
+ $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
+ $(foreach exe,$(gb_Executable_OOO),$(exe):OOOLIB) \
+ $(foreach exe,$(gb_Executable_BRAND),$(exe):BRAND) \
+ $(foreach exe,$(gb_Executable_NONE),$(exe):NONEBIN) \
+
+
+define gb_Executable_get_rpath
+-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1))) \
+-Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)
+endef
+
+# SdiTarget class
+
+gb_SdiTarget_SVIDLPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
+
+# SrsPartMergeTarget
+
+gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
+
+# SrsPartTarget class
+
+gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc
+gb_SrsPartTarget_RSCCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
+
+define gb_SrsPartTarget__command_dep
+$(call gb_Helper_abbreviate_dirs,\
+ $(gb_GCCP) \
+ -MM -MT $(call gb_SrsPartTarget_get_target,$(1)) \
+ $(3) \
+ $(4) \
+ -c -x c++-header $(2) \
+ -o $(call gb_SrsPartTarget_get_dep_target,$(1)))
+endef
+
+
+# ComponentTarget
+
+gb_ComponentTarget_XSLTPROCPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
+gb_ComponentTarget_PREFIXBASISNATIVE := vnd.sun.star.expand:$$OOO_BASE_DIR/program/
+
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
new file mode 100755
index 000000000000..742d2aef82fc
--- /dev/null
+++ b/solenv/gbuild/platform/macosx.mk
@@ -0,0 +1,391 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+GUI := UNX
+COM := GCC
+
+gb_MKTEMP := TMPDIR= mktemp -t
+
+gb_CC := $(CC)
+gb_CXX := $(CXX)
+gb_GCCP := $(CC)
+gb_AWK := awk
+
+
+gb_OSDEFS := \
+ -D$(OS) \
+ -D$(GUI) \
+ -DUNIX \
+ -D_PTHREADS \
+ -D_REENTRANT \
+ -DNO_PTHREAD_PRIORITY \
+ -DQUARTZ \
+ $(EXTRA_CDEFS) \
+# $(PTHREAD_CFLAGS) \
+
+gb_COMPILERDEFS := \
+ -D$(COM) \
+ -DGLIBC=2 \
+ -D_USE_NAMESPACE=1 \
+ -DHAVE_GCC_VISIBILITY_FEATURE \
+ -DCPPU_ENV=gcc3 \
+ -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) \
+# -D$(CVER) \
+# -DCVER=$(CVER) \
+
+ifeq ($(CPUNAME),INTEL)
+gb_CPUDEFS := -DX86
+else # ifeq ($(CPUNAME),POWERPC)
+gb_CPUDEFS := -DPOWERPC -DPPC
+endif
+
+ifeq ($(strip $(SYSBASE)),)
+gb_SDKDIR := /Developer/SDKs/MacOSX10.4u.sdk
+else
+gb_SDKDIR := $(SYSBASE)/MacOSX10.4u.sdk
+endif
+
+
+gb_CFLAGS := \
+ -isysroot $(gb_SDKDIR) \
+ -fsigned-char \
+ -fmessage-length=0 \
+ -malign-natural \
+ -Wall \
+ -Wendif-labels \
+ -fno-strict-aliasing \
+ -fPIC \
+ -fno-common \
+ -pipe \
+# -fvisibility=hidden \
+
+gb_CXXFLAGS := \
+ -isysroot $(gb_SDKDIR) \
+ -fsigned-char \
+ -fmessage-length=0 \
+ -malign-natural \
+ -Wall \
+ -Wendif-labels \
+ -Wno-long-double \
+ -Wno-ctor-dtor-privacy \
+ -Wno-non-virtual-dtor \
+ -fno-strict-aliasing \
+ -fPIC \
+ -fno-common \
+ -pipe \
+# -fvisibility=hidden \
+# -fvisibility-inlines-hidden \
+
+# these are to get g++ to switch to Objective-C++ mode
+# (see toolkit module for a case where it is necessary to do it this way)
+gb_OBJCXXFLAGS := -x objective-c++ -fobjc-exceptions
+
+gb_CFLAGS_WERROR := \
+ -Werror \
+
+gb_CXXFLAGS_WERROR := \
+ -Werror \
+
+gb_LinkTarget_EXCEPTIONFLAGS := \
+ -DEXCEPTIONS_ON \
+ -fexceptions \
+ -fno-enforce-eh-specs \
+
+gb_LinkTarget_NOEXCEPTIONFLAGS := \
+ -DEXCEPTIONS_OFF \
+ -fno-exceptions \
+
+gb_LinkTarget_LDFLAGS := \
+ -Wl,-syslibroot,$(gb_SDKDIR) \
+ $(subst -L../lib , ,$(SOLARLIB)) \
+#man ld says: obsolete -Wl,-multiply_defined,suppress \
+
+ifeq ($(gb_DEBUGLEVEL),2)
+gb_COMPILEROPTFLAGS := -O0
+else
+gb_COMPILEROPTFLAGS := -O2
+endif
+
+
+# Helper class
+
+gb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs)
+
+
+# CObject class
+
+define gb_CObject__command
+$(call gb_Output_announce,$(2),$(true),C ,3)
+$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $(1)) && \
+ mkdir -p $(dir $(call gb_CObject_get_dep_target,$(2))) && \
+ $(gb_CC) \
+ $(4) $(5) \
+ -c $(3) \
+ -o $(1) \
+ -MMD -MT $(call gb_CObject_get_target,$(2)) \
+ -MF $(call gb_CObject_get_dep_target,$(2)) \
+ -I$(dir $(3)) \
+ $(6))
+endef
+
+
+# CxxObject class
+
+# N.B: $(4) or $(5) may contain -x objective-c++, which must come before -c
+define gb_CxxObject__command
+$(call gb_Output_announce,$(2),$(true),CXX,3)
+$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $(1)) && \
+ mkdir -p $(dir $(call gb_CxxObject_get_dep_target,$(2))) && \
+ $(gb_CXX) \
+ $(4) $(5) \
+ -c $(3) \
+ -o $(1) \
+ -MMD -MT $(call gb_CxxObject_get_target,$(2)) \
+ -MF $(call gb_CxxObject_get_dep_target,$(2)) \
+ -I$(dir $(3)) \
+ $(6))
+endef
+
+
+# ObjCxxObject class
+
+define gb_ObjCxxObject__command
+$(call gb_Output_announce,$(2),$(true),OCX,3)
+$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $(1)) && \
+ mkdir -p $(dir $(call gb_ObjCxxObject_get_dep_target,$(2))) && \
+ $(gb_CXX) \
+ $(4) $(5) \
+ -c $(3) \
+ -o $(1) \
+ -MMD -MT $(call gb_ObjCxxObject_get_target,$(2)) \
+ -MF $(call gb_ObjCxxObject_get_dep_target,$(2)) \
+ -I$(dir $(3)) \
+ $(6))
+endef
+
+
+# LinkTarget class
+
+define gb_LinkTarget__get_rpath_for_layer
+$(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget_RPATHS)))
+endef
+
+gb_LinkTarget_RPATHS := \
+ URELIB:@__________________________________________________URELIB/ \
+ UREBIN: \
+ OOOLIB:@__________________________________________________OOO/ \
+ BRAND: \
+ SDKBIN: \
+ NONEBIN: \
+
+define gb_LinkTarget__get_installname
+$(if $(2),-install_name '$(2)$(1)',)
+endef
+
+gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_COMPILEROPTFLAGS)
+gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_COMPILEROPTFLAGS)
+gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) $(gb_COMPILEROPTFLAGS)
+
+ifeq ($(gb_DEBUGLEVEL),2)
+gb_LinkTarget_CFLAGS += -g
+gb_LinkTarget_CXXFLAGS += -g
+gb_LinkTarget_OBJCXXFLAGS += -g
+endif
+
+gb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC)))
+gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
+
+# FIXME the DYLIB_FILE mess is only necessary because
+# solver layout is different from installation layout
+# FIXME framework handling very hackish
+define gb_LinkTarget__command
+$(call gb_Output_announce,$(2),$(true),LNK,4)
+$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $(1)) && \
+ DYLIB_FILE=`$(gb_MKTEMP) $(dir $(1))` && \
+ $(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl $(3) $(patsubst lib%.dylib,-l%,$(foreach lib,$(4),$(call gb_Library_get_filename,$(lib)))) > $${DYLIB_FILE} && \
+ $(gb_CXX) \
+ $(3) \
+ $(patsubst lib%.dylib,-l%,$(foreach lib,$(filter-out $(gb_Library__FRAMEWORKS),$(4)),$(call gb_Library_get_filename,$(lib)))) \
+ $(addprefix -framework ,$(filter $(gb_Library__FRAMEWORKS),$(4))) \
+ $(foreach object,$(6),$(call gb_CObject_get_target,$(object))) \
+ $(foreach object,$(7),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach object,$(8),$(call gb_ObjCxxObject_get_target,$(object))) \
+ $(foreach lib,$(5),$(call gb_StaticLibrary_get_target,$(lib))) \
+ -o $(1) \
+ `cat $${DYLIB_FILE}` && \
+ $(if $(filter shl exe,$(TARGETTYPE)),$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl $(TARGETTYPE) $(LAYER) $(1) &&,) \
+ $(if $(filter shl,$(TARGETTYPE)),macosx-create-bundle $(1) &&,) \
+ rm -f $${DYLIB_FILE})
+endef
+
+
+# Library class
+
+gb_Library_DEFS :=
+gb_Library_TARGETTYPEFLAGS := -dynamiclib -single_module
+gb_Library_SYSPRE := lib
+gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_
+gb_Library_PLAINEXT := .dylib
+gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT)
+ifeq ($(gb_PRODUCT),$(true))
+gb_Library_STLEXT := port_gcc$(gb_Library_PLAINEXT)
+else
+gb_Library_STLEXT := port_gcc_stldebug$(gb_Library_PLAINEXT)
+endif
+
+ifeq ($(CPUNAME),INTEL)
+gb_Library_OOOEXT := mxi$(gb_Library_PLAINEXT)
+gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
+else # ifeq ($(CPUNAME),POWERPC)
+gb_Library_OOOEXT := mxp$(gb_Library_PLAINEXT)
+gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
+endif
+
+gb_Library__FRAMEWORKS += \
+ Cocoa \
+
+gb_Library_PLAINLIBS_NONE += \
+ Cocoa \
+ objc \
+ jpeg \
+ m \
+ pthread \
+ z \
+
+gb_Library_FILENAMES := \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_STLEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
+
+
+# HACK
+# SUBSTITING OOOLIB with OOO to make the perl script happy
+define gb_Library_Library_platform
+$(call gb_LinkTarget_get_target,$(2)) : TARGETTYPE := shl
+$(call gb_LinkTarget_get_target,$(2)) : LAYER :=$(subst OOOLIB,OOO,$(call gb_Library_get_layer,$(1)))
+
+endef
+
+define gb_Library_get_rpath
+$(call gb_LinkTarget__get_installname,$(call gb_Library_get_filename,$(1)),$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1))))
+endef
+
+gb_Library_LAYER := \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
+
+
+# StaticLibrary class
+
+gb_StaticLibrary_DEFS :=
+gb_StaticLibrary_TARGETTYPEFLAGS := -static -nostdlib
+gb_StaticLibrary_SYSPRE := lib
+gb_StaticLibrary_PLAINEXT := .a
+gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
+
+gb_StaticLibrary_FILENAMES := \
+ $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
+ $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
+
+define gb_StaticLibrary_StaticLibrary_platform
+$(call gb_LinkTarget_get_target,$(2)) : TARGETTYPE := staticlib
+$(call gb_LinkTarget_get_target,$(2)) : LAYER :=
+
+endef
+
+# Executable class
+
+gb_Executable_EXT :=
+gb_Executable_TARGETTYPEFLAGS := -bind_at_load
+
+# HACK
+# SUBSTITING OOOLIB with OOO to make the perl script happy
+define gb_Executable_Library_platform
+$(call gb_LinkTarget_get_target,$(2)) : TARGETTYPE := exe
+$(call gb_LinkTarget_get_target,$(2)) : LAYER :=$(subst OOOLIB,OOO,$(call gb_Executable_get_layer,$(1)))
+
+endef
+
+define gb_Executable_get_rpath
+$(call gb_LinkTarget__get_installname,$(1),$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Executable_get_layer,$(1))))
+endef
+
+gb_Executable_LAYER := \
+ $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
+ $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
+ $(foreach exe,$(gb_Executable_OOO),$(exe):OOOLIB) \
+ $(foreach exe,$(gb_Executable_BRAND),$(exe):BRAND) \
+ $(foreach exe,$(gb_Executable_NONE),$(exe):NONEBIN) \
+
+
+# SdiTarget class
+
+gb_SdiTarget_SVIDLPRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib
+
+# SrsPartMergeTarget
+
+gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib
+
+# SrsPartTarget class
+
+gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc
+gb_SrsPartTarget_RSCCOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
+
+define gb_SrsPartTarget__command_dep
+$(call gb_Helper_abbreviate_dirs,\
+ $(gb_GCCP) \
+ -MM -MT $(call gb_SrsPartTarget_get_target,$(1)) \
+ $(3) \
+ $(4) \
+ -c -x c++-header $(2) \
+ -o $(call gb_SrsPartTarget_get_dep_target,$(1)))
+endef
+
+# ComponentTarget
+
+gb_ComponentTarget_XSLTPROCPRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib
+gb_ComponentTarget_PREFIXBASISNATIVE := vnd.sun.star.expand:$$OOO_BASE_DIR/program/
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
new file mode 100755
index 000000000000..b2e4ab3b8b44
--- /dev/null
+++ b/solenv/gbuild/platform/solaris.mk
@@ -0,0 +1,330 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+GUI := UNX
+COM := C52
+
+gb_MKTEMP := mktemp -p
+gb_AWK := nawk
+
+gb_CC := cc
+gb_CXX := CC
+gb_GCCP := cc
+
+gb_OSDEFS := \
+ -D$(OS) \
+ -D$(GUI) \
+ -DSYSV \
+ -DSUN \
+ -DSUN4 \
+ -D_REENTRANT \
+ -D_POSIX_PTHREAD_SEMANTICS \
+ -D_PTHREADS \
+ -DUNIX \
+# $(PTHREAD_CFLAGS) \
+
+gb_COMPILERDEFS := \
+ -D$(COM) \
+ -DCPPU_ENV=sunpro5 \
+# -D$(CVER) \
+# -DCVER=$(CVER) \
+
+gb_CPUDEFS := -D$(CPUNAME)
+ifeq ($(CPUNAME),SPARC)
+gb_CPUDEFS += -D__sparcv8plus
+endif
+
+gb_CFLAGS := \
+ -temp=/tmp \
+ -KPIC \
+ -mt \
+ -xldscope=hidden \
+ -xCC \
+ -xc99=none \
+
+gb_CXXFLAGS := \
+ -temp=/tmp \
+ -KPIC \
+ -mt \
+ -xldscope=hidden \
+ -features=no%altspell \
+ -library=no%Cstd \
+ +w2 \
+ -erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,anonnotype \
+
+gb_CFLAGS_WERROR := \
+ -errwarn=%all \
+
+gb_CXXFLAGS_WERROR := \
+ -xwe \
+
+gb_LinkTarget_EXCEPTIONFLAGS := \
+ -DEXCEPTIONS_ON \
+
+gb_LinkTarget_NOEXCEPTIONFLAGS := \
+ -DEXCEPTIONS_OFF \
+ -noex \
+
+gb_LinkTarget_LDFLAGS := \
+ $(subst -L../lib , ,$(SOLARLIB)) \
+ -temp=/tmp \
+ -w \
+ -mt \
+ -z combreloc \
+ -norunpath \
+ -PIC \
+ -library=no%Cstd \
+
+ifeq ($(gb_DEBUGLEVEL),2)
+gb_COMPILEROPTFLAGS :=
+else
+ifeq ($(CPUNAME),INTEL)
+gb_COMPILEROPTFLAGS := -xarch=generic -xO3
+else # ifeq ($(CPUNAME),SPARC)
+# -m32 -xarch=sparc restrict target to 32 bit sparc
+# -xO3 optimization level 3
+# -xspace don't do optimizations which do increase binary size
+# -xprefetch=yes do prefetching (helps on UltraSparc III)
+gb_COMPILEROPTFLAGS := -m32 -xarch=sparc -xO3 -xspace -xprefetch=yes
+endif
+endif
+
+
+# Helper class
+
+gb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs)
+
+# CObject class
+
+define gb_CObject__command
+$(call gb_Output_announce,$(2),$(true),C ,3)
+$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $(1)) && \
+ rm -f $(call gb_CObject_get_dep_target,$(2)) && \
+ mkdir -p $(dir $(call gb_CObject_get_dep_target,$(2))) && \
+ $(gb_CC) \
+ -c $(3) \
+ -o $(1) \
+ -xMMD \
+ -xMF $(call gb_CObject_get_dep_target,$(2)) \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(6))
+endef
+
+
+# CxxObject class
+
+define gb_CxxObject__command
+$(call gb_Output_announce,$(2),$(true),CXX,3)
+$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $(1)) && \
+ mkdir -p $(dir $(call gb_CxxObject_get_dep_target,$(2))) && \
+ $(gb_CXX) \
+ -c $(3) \
+ -o $(1) \
+ -xMMD \
+ -xMF $(call gb_CxxObject_get_dep_target,$(2)) \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(6))
+endef
+
+
+# LinkTarget class
+
+define gb_LinkTarget__get_rpath_for_layer
+$(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS)))
+endef
+
+gb_LinkTarget__RPATHS := \
+ URELIB:$$$$ORIGIN \
+ UREBIN:$$$$ORIGIN/../lib:$$$$ORIGIN \
+ OOOLIB:$$$$ORIGIN:$$$$ORIGIN/../ure-link/lib \
+ BRAND:$$$$ORIGIN:$$$$ORIGIN/../basis-link/program:$$$$ORIGIN/../basis-link/ure-link/lib \
+ SDKBIN:$$$$ORIGIN/../../ure-link/lib \
+ NONEBIN:$$$$ORIGIN/../lib:$$$$ORIGIN \
+
+gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_COMPILEROPTFLAGS)
+gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_COMPILEROPTFLAGS)
+
+ifeq ($(gb_DEBUGLEVEL),2)
+gb_LinkTarget_CXXFLAGS += -g
+gb_LinkTarget_CFLAGS += -g
+endif
+
+gb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC)))
+gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
+
+define gb_LinkTarget__command
+$(call gb_Output_announce,$(2),$(true),LNK,4)
+$(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $(1)) && \
+ $(gb_CXX) \
+ $(3) \
+ $(patsubst lib%.so,-l%,$(foreach lib,$(4),$(call gb_Library_get_filename,$(lib)))) \
+ $(foreach object,$(6),$(call gb_CObject_get_target,$(object))) \
+ $(foreach object,$(7),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach lib,$(5),$(call gb_StaticLibrary_get_target,$(lib))) \
+ -o $(1))
+endef
+
+
+# Library class
+
+gb_Library_DEFS :=
+gb_Library_TARGETTYPEFLAGS := -Bdynamic -z text -G
+gb_Library_SYSPRE := lib
+gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_
+gb_Library_PLAINEXT := .so
+gb_Library_RTEXT := C52$(gb_Library_PLAINEXT)
+ifeq ($(gb_PRODUCT),$(true))
+gb_Library_STLEXT := port_sunpro$(gb_Library_PLAINEXT)
+else
+gb_Library_STLEXT := port_sunpro_debug$(gb_Library_PLAINEXT)
+endif
+
+ifeq ($(CPUNAME),INTEL)
+gb_Library_OOOEXT := si$(gb_Library_PLAINEXT)
+gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
+else # ifeq ($(CPUNAME),SPARC)
+gb_Library_OOOEXT := ss$(gb_Library_PLAINEXT)
+gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT)
+endif
+
+gb_Library_PLAINLIBS_NONE += \
+ dl \
+ jpeg \
+ m \
+ pthread \
+ X11 \
+ z
+
+gb_Library_FILENAMES := \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_STLEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \
+
+
+gb_Library__Library_platform =
+
+define gb_Library_get_rpath
+'-R$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))'
+endef
+
+gb_Library_LAYER := \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):URELIB) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
+
+
+# StaticLibrary class
+
+gb_StaticLibrary_DEFS :=
+gb_StaticLibrary_TARGETTYPEFLAGS := \
+ -Bstatic \
+ -xar \
+
+gb_StaticLibrary_SYSPRE := lib
+gb_StaticLibrary_PLAINEXT := .a
+gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
+
+gb_StaticLibrary_FILENAMES := \
+ $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
+ $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
+
+gb_StaticLibrary_StaticLibrary_platform =
+
+# Executable class
+
+gb_Executable_EXT :=
+gb_Executable_TARGETTYPEFLAGS :=
+gb_Executable__Executable_platform =
+
+define gb_Executable_get_rpath
+'-R$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Executable_get_layer,$(1)))'
+endef
+
+gb_Executable_LAYER := \
+ $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \
+ $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \
+ $(foreach exe,$(gb_Executable_OOO),$(exe):OOOLIB) \
+ $(foreach exe,$(gb_Executable_BRAND),$(exe):BRAND) \
+ $(foreach exe,$(gb_Executable_NONE),$(exe):NONEBIN) \
+
+
+# SdiTarget class
+
+gb_SdiTarget_SVIDLPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
+
+# SrsPartMergeTarget
+
+gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
+
+# SrsPartTarget class
+
+gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc
+gb_SrsPartTarget_RSCCOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
+
+# Sun cc/CC support -xM1/-xMF flags, but unfortunately refuse input files that
+# do not have the right suffix, so use makedepend here...
+define gb_SrsPartTarget__command_dep
+$(call gb_Helper_abbreviate_dirs_native,\
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(3) $(4) \
+ $(2) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_SrsPartTarget_get_dep_target,$(1)))
+endef
+
+
+# ComponentTarget
+
+gb_ComponentTarget_XSLTPROCPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
+gb_ComponentTarget_PREFIXBASISNATIVE := vnd.sun.star.expand:$$OOO_BASE_DIR/program/
+
+# vim: set noet sw=4 ts=4:
+
diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk
new file mode 100755
index 000000000000..a25d21ff5e79
--- /dev/null
+++ b/solenv/gbuild/platform/windows.mk
@@ -0,0 +1,566 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2009 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+GUI := WNT
+COM := MSC
+
+gb_MKTEMP := mktemp -p
+
+gb_CC := cl
+gb_CXX := cl
+gb_LINK := link
+gb_AWK := awk
+
+gb_OSDEFS := \
+ -DWINVER=0x0500 \
+ -D_WIN32_IE=0x0500 \
+ -DNT351 \
+ -DWIN32 \
+ -DWNT \
+
+gb_COMPILERDEFS := \
+ -DMSC \
+ -D_CRT_NON_CONFORMING_SWPRINTFS \
+ -D_CRT_NONSTDC_NO_DEPRECATE \
+ -D_CRT_SECURE_NO_DEPRECATE \
+ -D_MT \
+ -DBOOST_MEM_FN_ENABLE_CDECL \
+ -DCPPU_ENV=msci \
+ -DFULL_DESK \
+ -DM1500 \
+
+gb_CPUDEFS := -DINTEL -D_X86_=1
+
+gb_CFLAGS := \
+ -Gd \
+ -GR \
+ -Gs \
+ -GS \
+ -Gy \
+ -nologo \
+ -Wall \
+ -wd4005 \
+ -wd4061 \
+ -wd4127 \
+ -wd4180 \
+ -wd4189 \
+ -wd4191 \
+ -wd4217 \
+ -wd4250 \
+ -wd4251 \
+ -wd4255 \
+ -wd4275 \
+ -wd4290 \
+ -wd4294 \
+ -wd4350 \
+ -wd4355 \
+ -wd4365 \
+ -wd4503 \
+ -wd4505 \
+ -wd4511 \
+ -wd4512 \
+ -wd4514 \
+ -wd4611 \
+ -wd4619 \
+ -wd4625 \
+ -wd4626 \
+ -wd4640 \
+ -wd4668 \
+ -wd4675 \
+ -wd4692 \
+ -wd4710 \
+ -wd4711 \
+ -wd4738 \
+ -wd4786 \
+ -wd4800 \
+ -wd4820 \
+ -wd4826 \
+ -WX \
+ -Zc:forScope,wchar_t- \
+ -Zm500 \
+
+gb_CXXFLAGS := \
+ -Gd \
+ -GR \
+ -Gs \
+ -GS \
+ -Gy \
+ -nologo \
+ -Wall \
+ -wd4005 \
+ -wd4061 \
+ -wd4127 \
+ -wd4180 \
+ -wd4189 \
+ -wd4191 \
+ -wd4217 \
+ -wd4250 \
+ -wd4251 \
+ -wd4275 \
+ -wd4290 \
+ -wd4294 \
+ -wd4350 \
+ -wd4355 \
+ -wd4365 \
+ -wd4503 \
+ -wd4505 \
+ -wd4511 \
+ -wd4512 \
+ -wd4514 \
+ -wd4611 \
+ -wd4619 \
+ -wd4625 \
+ -wd4626 \
+ -wd4640 \
+ -wd4668 \
+ -wd4675 \
+ -wd4692 \
+ -wd4710 \
+ -wd4711 \
+ -wd4738 \
+ -wd4786 \
+ -wd4800 \
+ -wd4820 \
+ -wd4826 \
+ -WX \
+ -Zc:forScope,wchar_t- \
+ -Zm500 \
+
+gb_LinkTarget_EXCEPTIONFLAGS := \
+ -DEXCEPTIONS_ON \
+ -EHa \
+
+gb_PrecompiledHeader_EXCEPTIONFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS)
+
+
+gb_LinkTarget_NOEXCEPTIONFLAGS := \
+ -DEXCEPTIONS_OFF \
+
+gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS := $(gb_LinkTarget_NOEXCEPTIONFLAGS)
+
+gb_LinkTarget_LDFLAGS := \
+ -MACHINE:IX86 \
+ -NODEFAULTLIB \
+ -OPT:NOREF \
+ -SUBSYSTEM:CONSOLE \
+ -safeseh \
+ -nxcompat \
+ -dynamicbase \
+ $(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
+
+ifneq ($(ENABLE_CRASHDUMP),)
+gb_LinkTarget_LDFLAGS += -DEBUG
+gb_CFLAGS+=-Zi
+gb_CXXFLAGS+=-Zi
+endif
+
+ifeq ($(gb_DEBUGLEVEL),2)
+gb_CXXFLAGS +=-Zi
+gb_CFLAGS +=-Zi
+gb_COMPILEROPTFLAGS :=
+gb_LinkTarget_LDFLAGS += -DEBUG
+else
+gb_COMPILEROPTFLAGS := -Ob1 -Oxs -Oy-
+endif
+
+
+# Helper class
+
+gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR))
+gb_Helper_WORKDIR_NATIVE := $(shell cygpath -m $(WORKDIR))
+gb_Helper_OUTDIR_NATIVE := $(shell cygpath -m $(OUTDIR))
+gb_Helper_REPODIR_NATIVE := $(shell cygpath -m $(REPODIR))
+
+define gb_Helper_abbreviate_dirs_native
+R=$(gb_Helper_REPODIR_NATIVE) && \
+$(subst $(gb_Helper_REPODIR_NATIVE)/,$$R/,S=$(gb_Helper_SRCDIR_NATIVE) && \
+$(subst $(gb_Helper_SRCDIR_NATIVE)/,$$S/,O=$(gb_Helper_OUTDIR_NATIVE)) && \
+$(subst $(gb_Helper_SRCDIR_NATIVE)/,$$S/,$(subst $(REPODIR)/,$$R/,$(subst $(SRCDIR)/,$$S/,$(subst $(gb_Helper_OUTDIR_NATIVE)/,$$O/,$(subst $(OUTDIR)/,$$O/,W=$(gb_Helper_WORKDIR_NATIVE) && $(subst $(gb_Helper_WORKDIR_NATIVE)/,$$W/,$(subst $(WORKDIR)/,$$W/,$(1)))))))))
+endef
+
+# CObject class
+
+ifeq ($(gb_FULLDEPS),$(true))
+define gb_CObject__command_deponcompile
+$(call gb_Helper_abbreviate_dirs_native,\
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
+ -I$(dir $(3)) \
+ $(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \
+ $(3) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(1) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_CObject_get_dep_target,$(2)))
+endef
+else
+CObject__command_deponcompile =
+endif
+
+define gb_CObject__command
+$(call gb_Output_announce,$(2),$(true),C ,3)
+$(call gb_Helper_abbreviate_dirs_native,\
+ mkdir -p $(dir $(1)) && \
+ unset INCLUDE && \
+ $(gb_CC) \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(6) \
+ -c $(3) \
+ -Fo$(1))
+$(call gb_CObject__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
+endef
+
+
+
+# CxxObject class
+
+ifeq ($(gb_FULLDEPS),$(true))
+define gb_CxxObject__command_deponcompile
+$(call gb_Helper_abbreviate_dirs_native,\
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
+ -I$(dir $(3)) \
+ $(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \
+ $(3) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(1) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_CxxObject_get_dep_target,$(2)))
+endef
+else
+gb_CxxObject__command_deponcompile =
+endif
+
+define gb_CxxObject__command
+$(call gb_Output_announce,$(2),$(true),CXX,3)
+$(call gb_Helper_abbreviate_dirs_native,\
+ mkdir -p $(dir $(1)) && \
+ unset INCLUDE && \
+ $(gb_CXX) \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(6) \
+ -c $(3) \
+ -Fo$(1))
+$(call gb_CxxObject__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
+
+endef
+
+
+# PrecompiledHeader class
+
+gb_PrecompiledHeader_get_enableflags = -Yu$(1).hxx \
+ -Fp$(call gb_PrecompiledHeader_get_target,$(1)) \
+ -Fd$(call gb_PrecompiledHeader_get_target,$(1)).pdb
+
+ifeq ($(gb_FULLDEPS),$(true))
+define gb_PrecompiledHeader__command_deponcompile
+$(call gb_Helper_abbreviate_dirs_native,\
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \
+ $(3) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(1) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_PrecompiledHeader_get_dep_target,$(2)))
+endef
+else
+gb_PrecompiledHeader__command_deponcompile =
+endif
+
+define gb_PrecompiledHeader__command
+$(call gb_Output_announce,$(2),$(true),PCH,1)
+$(call gb_Helper_abbreviate_dirs_native,\
+ mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2))) && \
+ unset INCLUDE && \
+ $(gb_CXX) \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(6) \
+ -c $(3) \
+ -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fd$(1).pdb -Fo$(1).obj)
+rm $(1).obj
+$(call gb_PrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
+
+endef
+
+# NoexPrecompiledHeader class
+
+gb_NoexPrecompiledHeader_get_enableflags = -Yu$(1).hxx \
+ -Fp$(call gb_NoexPrecompiledHeader_get_target,$(1)) \
+ -Fd$(call gb_NoexPrecompiledHeader_get_target,$(1)).pdb
+
+ifeq ($(gb_FULLDEPS),$(true))
+define gb_NoexPrecompiledHeader__command_deponcompile
+$(call gb_Helper_abbreviate_dirs_native,\
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \
+ $(3) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(1) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_NoexPrecompiledHeader_get_dep_target,$(2)))
+endef
+else
+gb_NoexPrecompiledHeader__command_deponcompile =
+endif
+
+define gb_NoexPrecompiledHeader__command
+$(call gb_Output_announce,$(2),$(true),PCH,1)
+$(call gb_Helper_abbreviate_dirs_native,\
+ mkdir -p $(dir $(1)) $(dir $(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) && \
+ unset INCLUDE && \
+ $(gb_CXX) \
+ $(4) $(5) \
+ -I$(dir $(3)) \
+ $(6) \
+ -c $(3) \
+ -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fd$(1).pdb -Fo$(1).obj)
+rm $(1).obj
+$(call gb_NoexPrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
+
+endef
+
+
+# LinkTarget class
+
+gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_COMPILEROPTFLAGS)
+gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_COMPILEROPTFLAGS)
+
+gb_LinkTarget_INCLUDE :=\
+ $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \
+ $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \
+
+gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC)))
+
+define gb_LinkTarget__command
+$(call gb_Output_announce,$(2),$(true),LNK,4)
+$(call gb_Helper_abbreviate_dirs_native,\
+ mkdir -p $(dir $(1)) && \
+ RESPONSEFILE=$$(mktemp --tmpdir=$(gb_Helper_MISC)) && \
+ echo "$(foreach object,$(7),$(call gb_CxxObject_get_target,$(object))) \
+ $(foreach object,$(6),$(call gb_CObject_get_target,$(object)))" > $${RESPONSEFILE} && \
+ $(gb_LINK) \
+ $(3) \
+ @$${RESPONSEFILE} \
+ $(foreach lib,$(4),$(call gb_Library_get_filename,$(lib))) \
+ $(foreach lib,$(5),$(call gb_StaticLibrary_get_filename,$(lib))) \
+ $(subst -out: -implib:$(1),-out:$(1),-out:$(DLLTARGET) -implib:$(1)) && rm $${RESPONSEFILE})
+endef
+
+
+# Library class
+
+gb_Library_DEFS := -D_DLL_ -D_DLL
+gb_Library_TARGETTYPEFLAGS := -DLL
+gb_Library_get_rpath :=
+
+gb_Library_SYSPRE := i
+gb_Library_PLAINEXT := .lib
+
+gb_Library_PLAINLIBS_NONE += \
+ advapi32 \
+ gdi32 \
+ gnu_getopt \
+ kernel32 \
+ msvcrt \
+ mpr \
+ oldnames \
+ ole32 \
+ oleaut32 \
+ shell32 \
+ unicows \
+ user32 \
+ uuid \
+ uwinapi \
+ z \
+
+gb_LinkTarget_LAYER := \
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):OOOLIB) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOOLIB) \
+
+gb_Library_FILENAMES :=\
+ $(foreach lib,$(gb_Library_TARGETS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \
+
+gb_Library_DLLEXT := .dll
+gb_Library_MAJORVER := 3
+gb_Library_RTEXT := MSC$(gb_Library_DLLEXT)
+ifeq ($(gb_PRODUCT),$(true))
+gb_Library_STLEXT := port_vc7145$(gb_Library_DLLEXT)
+else
+gb_Library_STLEXT := port_vc7145_stldebug$(gb_Library_DLLEXT)
+endif
+gb_Library_OOOEXT := mi$(gb_Library_DLLEXT)
+gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT)
+gb_Library_UNOVEREXT := $(gb_Library_MAJORVER)$(gb_Library_DLLEXT)
+gb_Library_RTVEREXT := $(gb_Library_MAJORVER)$(gb_Library_RTEXT)
+
+gb_Library_DLLFILENAMES :=\
+ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \
+ $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \
+ $(foreach lib,$(gb_Library_RTLIBS),$(lib):$(lib)$(gb_Library_RTEXT)) \
+ $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \
+ $(foreach lib,$(gb_Library_STLLIBS),$(lib):$(lib)$(gb_Library_STLEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNOEXT)) \
+ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \
+
+
+define gb_Library_Library_platform
+$(call gb_LinkTarget_set_dlltarget,$(2),$(3))
+
+$(call gb_LinkTarget_set_auxtargets,$(2),\
+ $(patsubst %.lib,%.exp,$(call gb_LinkTarget_get_target,$(2))) \
+ $(3).manifest \
+ $(patsubst %.dll,%.pdb,$(3)) \
+ $(patsubst %.dll,%.ilk,$(3)) \
+)
+
+$(call gb_Library_get_target,$(1)) \
+$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3))
+
+ifneq ($(ENABLE_CRASHDUMP),)
+$(call gb_Library_get_target,$(1)) \
+$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS += \
+ $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.pdb,$(3))) \
+ $(OUTDIR)/bin/$(notdir $(patsubst %.dll,%.ilk,$(3))) \
+
+endif
+
+$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3))
+
+endef
+
+define gb_Library_get_dllname
+$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES)))
+endef
+
+
+# StaticLibrary class
+
+gb_StaticLibrary_DEFS :=
+gb_StaticLibrary_TARGETTYPEFLAGS := -LIB
+gb_StaticLibrary_SYSPRE :=
+gb_StaticLibrary_PLAINEXT := .lib
+gb_StaticLibrary_JPEGEXT := lib$(gb_StaticLibrary_PLAINEXT)
+
+gb_StaticLibrary_FILENAMES := \
+ $(foreach lib,$(gb_StaticLibrary_JPEGLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_JPEGEXT)) \
+ $(foreach lib,$(gb_StaticLibrary_PLAINLIBS),$(lib):$(gb_StaticLibrary_SYSPRE)$(lib)$(gb_StaticLibrary_PLAINEXT)) \
+
+gb_StaticLibrary_FILENAMES := $(patsubst salcpprt:salcpprt%,salcpprt:cpprtl%,$(gb_StaticLibrary_FILENAMES))
+
+gb_StaticLibrary_StaticLibrary_platform =
+
+# Executable class
+
+gb_Executable_EXT := .exe
+gb_Executable_TARGETTYPEFLAGS := -RELEASE -BASE:0x1b000000 -OPT:NOREF -INCREMENTAL:NO -DEBUG
+gb_Executable_get_rpath :=
+
+define gb_Executable_Executable_platform
+$(call gb_LinkTarget_set_auxtargets,$(2),\
+ $(patsubst %.exe,%.pdb,$(call gb_LinkTarget_get_target,$(2))) \
+ $(call gb_LinkTarget_get_target,$(2)).manifest \
+)
+
+$(call gb_Executable_get_target,$(1)) \
+$(call gb_Executable_get_clean_target,$(1)) : AUXTARGETS := $(call gb_Executable_get_target,$(1)).manifest
+$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)).manifest,$(call gb_LinkTarget_get_target,$(2)).manifest)
+
+endef
+
+# SdiTarget class
+
+gb_SdiTarget_SVIDLPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
+
+# SrsPartMergeTarget
+
+gb_SrsPartMergeTarget_TRANSEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
+
+# SrsPartTarget class
+
+gb_SrsPartTarget_RSCTARGET := $(OUTDIR)/bin/rsc.exe
+gb_SrsPartTarget_RSCCOMMAND := SOLARBINDIR=$(OUTDIR)/bin $(gb_SrsPartTarget_RSCTARGET)
+
+ifeq ($(gb_FULLDEPS),$(true))
+define gb_SrsPartTarget__command_dep
+$(call gb_Helper_abbreviate_dirs_native,\
+ $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
+ $(3) $(4) \
+ $(2) \
+ -f - \
+ | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
+ -v OBJECTFILE=$(call gb_SrsPartTarget_get_target,$(1)) \
+ -v OUTDIR=$(OUTDIR)/ \
+ -v WORKDIR=$(WORKDIR)/ \
+ -v SRCDIR=$(SRCDIR)/ \
+ -v REPODIR=$(REPODIR)/ \
+ > $(call gb_SrsPartTarget_get_dep_target,$(1)))
+endef
+else
+gb_SrsPartTarget__command_dep =
+endif
+
+
+# ComponentTarget
+
+gb_ComponentTarget_XSLTPROCPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
+gb_ComponentTarget_PREFIXBASISNATIVE := vnd.sun.star.expand:$$BRAND_BASE_DIR/program/
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/processdelivered.awk b/solenv/gbuild/processdelivered.awk
new file mode 100644
index 000000000000..7bf574c45524
--- /dev/null
+++ b/solenv/gbuild/processdelivered.awk
@@ -0,0 +1,35 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+BEGIN {
+ RS=" "
+ FS=":"
+}
+
+length($1) > 0 && length($2) > 0 {
+ print "COPY " $1 " " $2;
+}
diff --git a/solenv/gbuild/processdeps.awk b/solenv/gbuild/processdeps.awk
new file mode 100644
index 000000000000..c5efb1e0ad3d
--- /dev/null
+++ b/solenv/gbuild/processdeps.awk
@@ -0,0 +1,74 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# this awk script mangles makedepend output for a single object file
+# usage:
+# awk -f .../processdeps.awk \
+# -v OUTDIR=outdir \
+# -v SRCDIR=srcdir \
+# -v WORKDIR=workdir \
+# -v REPODIR=repodir \
+# -v OBJECTFILE=objectfile
+# called like this the script will read from stdin
+# and write to stdout. It will:
+# - replace the objectfile with the one given on the commandline
+# - normalize paths to mixed paths (replacing all \ with /)
+# - replace the string given as WORKDIR with $(WORKDIR)/
+# - replace the string given as OUTDIR with $(OUTDIR)/
+# - replace the string given as SRCDIR with $(SRCDIR)/
+# - replace the string given as REPODIR with $(REPODIR)/
+# - translates absolute mixed windows paths to cygwin paths by
+# substituting a path starting with X:... to /cygdrive/X/...
+
+function mangle_path(path) {
+ gsub("\\\\", "/", path);
+ if( path ~ /^[a-zA-Z]:/ )
+ path = toupper(substr(path,0,1)) substr(path,2);
+ gsub(WORKDIR, "$(WORKDIR)/", path);
+ gsub(OUTDIR, "$(OUTDIR)/", path);
+ gsub(SRCDIR, "$(SRCDIR)/", path);
+ gsub(REPODIR, "$(REPODIR)/", path);
+ if( path ~ /^[a-zA-Z]:/ )
+ path = "/cygdrive/" tolower(substr(path,0,1)) substr(path,3);
+ return path;
+}
+
+BEGIN {
+# print "# WORKDIR=" WORKDIR;
+# print "# OUTDIR=" OUTDIR;
+# print "# SRCDIR=" SRCDIR;
+# print "# REPODIR=" REPODIR;
+ print mangle_path(OBJECTFILE) ": \\";
+}
+
+/^[^#]/ {
+ print "\t" mangle_path($2) " \\";
+}
+
+END {
+ print "\n";
+}
diff --git a/solenv/inc/_cppunit.mk b/solenv/inc/_cppunit.mk
new file mode 100644
index 000000000000..8d9e45d33331
--- /dev/null
+++ b/solenv/inc/_cppunit.mk
@@ -0,0 +1,120 @@
+# unroll begin
+# ---- create the test libraries ------------------------------------
+
+.IF "$(SHL1TARGET)"!=""
+ALLTAR : test1
+test1 .PHONY : $(SHL1TARGETN)
+ @echo ----------------------------------------------------------
+ @echo - start unit test \#1 on library $(SHL1TARGETN)
+ @echo ----------------------------------------------------------
+ $(CPPUNITTESTER) $(SHL1TARGETN)
+.ENDIF
+
+# unroll begin
+# ---- create the test libraries ------------------------------------
+
+.IF "$(SHL2TARGET)"!=""
+ALLTAR : test2
+test2 .PHONY : $(SHL2TARGETN)
+ @echo ----------------------------------------------------------
+ @echo - start unit test \#2 on library $(SHL2TARGETN)
+ @echo ----------------------------------------------------------
+ $(CPPUNITTESTER) $(SHL2TARGETN)
+.ENDIF
+
+# unroll begin
+# ---- create the test libraries ------------------------------------
+
+.IF "$(SHL3TARGET)"!=""
+ALLTAR : test3
+test3 .PHONY : $(SHL3TARGETN)
+ @echo ----------------------------------------------------------
+ @echo - start unit test \#3 on library $(SHL3TARGETN)
+ @echo ----------------------------------------------------------
+ $(CPPUNITTESTER) $(SHL3TARGETN)
+.ENDIF
+
+# unroll begin
+# ---- create the test libraries ------------------------------------
+
+.IF "$(SHL4TARGET)"!=""
+ALLTAR : test4
+test4 .PHONY : $(SHL4TARGETN)
+ @echo ----------------------------------------------------------
+ @echo - start unit test \#4 on library $(SHL4TARGETN)
+ @echo ----------------------------------------------------------
+ $(CPPUNITTESTER) $(SHL4TARGETN)
+.ENDIF
+
+# unroll begin
+# ---- create the test libraries ------------------------------------
+
+.IF "$(SHL5TARGET)"!=""
+ALLTAR : test5
+test5 .PHONY : $(SHL5TARGETN)
+ @echo ----------------------------------------------------------
+ @echo - start unit test \#5 on library $(SHL5TARGETN)
+ @echo ----------------------------------------------------------
+ $(CPPUNITTESTER) $(SHL5TARGETN)
+.ENDIF
+
+# unroll begin
+# ---- create the test libraries ------------------------------------
+
+.IF "$(SHL6TARGET)"!=""
+ALLTAR : test6
+test6 .PHONY : $(SHL6TARGETN)
+ @echo ----------------------------------------------------------
+ @echo - start unit test \#6 on library $(SHL6TARGETN)
+ @echo ----------------------------------------------------------
+ $(CPPUNITTESTER) $(SHL6TARGETN)
+.ENDIF
+
+# unroll begin
+# ---- create the test libraries ------------------------------------
+
+.IF "$(SHL7TARGET)"!=""
+ALLTAR : test7
+test7 .PHONY : $(SHL7TARGETN)
+ @echo ----------------------------------------------------------
+ @echo - start unit test \#7 on library $(SHL7TARGETN)
+ @echo ----------------------------------------------------------
+ $(CPPUNITTESTER) $(SHL7TARGETN)
+.ENDIF
+
+# unroll begin
+# ---- create the test libraries ------------------------------------
+
+.IF "$(SHL8TARGET)"!=""
+ALLTAR : test8
+test8 .PHONY : $(SHL8TARGETN)
+ @echo ----------------------------------------------------------
+ @echo - start unit test \#8 on library $(SHL8TARGETN)
+ @echo ----------------------------------------------------------
+ $(CPPUNITTESTER) $(SHL8TARGETN)
+.ENDIF
+
+# unroll begin
+# ---- create the test libraries ------------------------------------
+
+.IF "$(SHL9TARGET)"!=""
+ALLTAR : test9
+test9 .PHONY : $(SHL9TARGETN)
+ @echo ----------------------------------------------------------
+ @echo - start unit test \#9 on library $(SHL9TARGETN)
+ @echo ----------------------------------------------------------
+ $(CPPUNITTESTER) $(SHL9TARGETN)
+.ENDIF
+
+# unroll begin
+# ---- create the test libraries ------------------------------------
+
+.IF "$(SHL10TARGET)"!=""
+ALLTAR : test10
+test10 .PHONY : $(SHL10TARGETN)
+ @echo ----------------------------------------------------------
+ @echo - start unit test \#10 on library $(SHL10TARGETN)
+ @echo ----------------------------------------------------------
+ $(CPPUNITTESTER) $(SHL10TARGETN)
+.ENDIF
+
diff --git a/solenv/inc/_tg_app.mk b/solenv/inc/_tg_app.mk
new file mode 100644
index 000000000000..960c8d229b76
--- /dev/null
+++ b/solenv/inc/_tg_app.mk
@@ -0,0 +1,2840 @@
+# unroll begin
+
+.IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
+APP1DEF = $(MISC)/$(APP1TARGET).def
+.ENDIF
+
+.IF "$(APP1LINKTYPE)" != ""
+#must be either STATIC or SHARED
+APP1LINKTYPEFLAG=$(APPLINK$(APP1LINKTYPE))
+.ENDIF
+
+# decide how to link
+.IF "$(APP1CODETYPE)"=="C"
+APP1LINKER=$(LINKC)
+APP1STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
+APP1LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(APP1CODETYPE)"=="C"
+APP1LINKER=$(LINK)
+APP1STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
+APP1LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(APP1CODETYPE)"=="C"
+
+APP1RPATH*=OOO
+LINKFLAGSRUNPATH_$(APP1RPATH)*=/ERROR:/Bad_APP1RPATH_value
+.IF "$(OS)" != "MACOSX"
+APP1LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP1RPATH))
+.ENDIF
+
+.IF "$(APP1STACK)" != ""
+.IF "$(LINKFLAGSTACK)" != ""
+APP1STACKN=$(LINKFLAGSTACK)$(APP1STACK)
+.ENDIF
+.ELSE
+APP1STACKN=
+.ENDIF
+
+.IF "$(APP1NOSAL)"==""
+.IF "$(TARGETTYPE)" == "GUI"
+APP1OBJS+= $(STDOBJVCL)
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)$(COM)" == "WNTGCC"
+APP1RESO=
+.IF "$(APP1LINKRES)" != "" || "$(APP1RES)" != ""
+APP1RESO=$(MISC)/$(APP1TARGET:b)_res.o
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)" == "UNX"
+APP1DEPN+:=$(APP1DEPNU)
+USE_APP1DEF=
+.ENDIF
+
+.IF "$(APP1TARGETN)"!=""
+
+.IF "$(APP1PRODUCTNAME)"!=""
+APP1PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP1PRODUCTNAME)\"
+.ENDIF # "$(APP1PRODUCTNAME)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(APP1LIBS)"!=""
+$(MISC)/$(APP1TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP1LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF #"$(APP1LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(APP1TARGETN:b)_linkinc.ls
+$(APP1TARGETN) : $(LINKINCTARGETS)
+.ENDIF # "$(linkinc)"!=""
+
+# Allow for target specific LIBSALCPPRT override
+APP1LIBSALCPPRT*=$(LIBSALCPPRT)
+
+.IF "$(GUI)" == "OS2"
+_APP1IMP_ORD = $(APP1STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(APP1STDLIBS:^"$(LB)/")
+APP1IMP_ORD = $(foreach,i,$(_APP1IMP_ORD) $(shell @-ls $i))
+.ELSE
+APP1IMP_ORD =
+.ENDIF
+
+$(APP1TARGETN): $(APP1OBJS) $(APP1LIBS) \
+ $(APP1RES) \
+ $(APP1IMP_ORD) \
+ $(APP1ICON) $(APP1DEPN) $(USE_APP1DEF)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_1.cmd
+ @-$(RM) $(MISC)/$(@:b).strip
+ @echo $(STDSLO) $(APP1OBJS:s/.obj/.o/) \
+ `cat /dev/null $(APP1LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(APP1LINKER) $(APP1LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
+ $(APP1LINKTYPEFLAG) $(APP1STDLIBS) $(APP1STDLIB) $(STDLIB1) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_1.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_1.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_1.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_1.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_1.cmd
+# Need to strip __objcInit symbol to avoid duplicate symbols when loading
+# libraries at runtime
+ @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
+ @strip -i -R $(MISC)/$(@:b).strip -X $@
+ @ls -l $@
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ app $(APP1RPATH) $@
+.IF "$(TARGETTYPE)"=="GUI"
+ @echo "Making: " $(@:f).app
+ @macosx-create-bundle $@
+.ENDIF # "$(TARGETTYPE)"=="GUI"
+.ELSE # "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_1.cmd
+ @echo $(APP1LINKER) $(APP1LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP1OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_1.cmd
+ @cat $(mktmp /dev/null $(APP1LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_1.cmd
+ @echo $(APP1LINKTYPEFLAG) $(APP1LIBSALCPPRT) $(APP1STDLIBS) $(APP1STDLIB) $(STDLIB1) -o $@ >> $(MISC)/$(TARGET).$(@:b)_1.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_1.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_1.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+ .ENDIF
+.ENDIF # "$(OS)"=="MACOSX"
+.ENDIF
+.IF "$(GUI)" == "WNT"
+ @@-$(MKDIR) $(@:d:d)
+.IF "$(APP1LINKRES)" != ""
+ @@-$(RM) $(MISC)/$(APP1LINKRES:b).rc
+.IF "$(APP1ICON)" != ""
+ @-echo 1 ICON $(EMQ)"$(APP1ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP1LINKRES:b).rc
+.ENDIF # "$(APP1ICON)" != ""
+.IF "$(APP1VERINFO)" != ""
+ @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP1LINKRES:b).rc
+ @-echo $(EMQ)#include $(EMQ)"$(APP1VERINFO)$(EMQ)" >> $(MISC)/$(APP1LINKRES:b).rc
+.ENDIF # "$(APP1VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(APP1PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP1LINKRES:b).rc
+.ENDIF # "$(APP1LINKRES)" != ""
+.IF "$(COM)" == "GCC"
+ @echo mingw
+.IF "$(APP1LINKRES)" != "" || "$(APP1RES)" != ""
+ @cat $(APP1LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP1RES)) > $(MISC)/$(@:b)_all.res
+ windres $(MISC)/$(@:b)_all.res $(APP1RESO)
+.ENDIF
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP1BASEX) $(APP1STACKN) -o $@ $(APP1OBJS) \
+ -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP1RESO) \
+ `$(TYPE) /dev/null $(APP1LIBS) | sed s#$(ROUT)#$(OUT)#g` \
+ $(APP_LINKTYPE) $(APP1LIBSALCPPRT) \
+ -Wl,--start-group $(APP1STDLIBS) -Wl,--end-group $(APP1STDLIB) \
+ $(STDLIB1) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_1.cmd
+ # need this empty line, else dmake somehow gets confused by the .IFs and .ENDIFs
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_1.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_1.cmd
+ @ls -l $@
+.ELSE # "$(COM)" == "GCC"
+.IF "$(linkinc)" == ""
+ $(COMMAND_ECHO)$(APP1LINKER) @$(mktmp \
+ $(APP1LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP1BASEX) \
+ $(APP1STACKN) \
+ -out:$@ \
+ -map:$(MISC)/{$(subst,/,_ $(APP1TARGET)).map} \
+ $(STDOBJ) \
+ $(APP1LINKRES) \
+ $(APP1RES) \
+ $(APP1OBJS) \
+ $(APP1LIBS) \
+ $(APP1STDLIBS) \
+ $(APP1STDLIB) $(STDLIB1) \
+ )
+ @-echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP1TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP1TARGET).lst
+ $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
+ for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
+ type $(mktmp,$(MISC)\$(APP1TARGET).lst
+ $(APP1LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP1BASEX) \
+ $(APP1STACKN) \
+ -out:$@ \
+ $(STDOBJ) \
+ $(APP1LINKRES) \
+ $(APP1RES) \
+ $(APP1OBJS) \
+ $(APP1LIBS) \
+ $(APP1STDLIBS) \
+ $(APP1STDLIB) $(STDLIB1))
+ $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP1TARGETN:b)_linkobj.lst >> $(MISC)\$(APP1TARGET).lst
+ $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP1TARGET).lst $(THEN) type $(MISC)/$(APP1TARGET).lst >> $(MISC)/$(APP1TARGET).lnk $(FI)
+ $(COMMAND_ECHO)$(SED)$(APP1LINKER) @$(MISC)\$(APP1TARGET).lnk
+.ENDIF # "$(linkinc)" == ""
+.ENDIF # "$(COM)" == "GCC"
+.IF "$(APP1TARGET)" == "loader"
+ $(COMMAND_ECHO)$(PERL) loader.pl $@
+ $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "WNT"
+
+.IF "$(GUI)" == "OS2"
+ @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
+.IF "$(APP1LINKRES)" != ""
+ @+-$(RM) $(MISC)/$(APP1LINKRES:b).rc >& $(NULLDEV)
+.IF "$(APP1ICON)" != ""
+ @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP1ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)/$(APP1LINKRES:b).rc
+.ENDIF # "$(APP1ICON)" != ""
+.IF "$(APP1VERINFO)" != ""
+ @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP1LINKRES:b).rc
+ @-+echo $(EMQ)#include $(EMQ)"$(APP1VERINFO)$(EMQ)" >> $(MISC)/$(APP1LINKRES:b).rc
+.ENDIF # "$(APP1VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(APP1PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP1LINKRES:b).rc
+.ENDIF # "$(APP1LINKRES)" != ""
+
+.IF "$(TARGETTYPE)" == "GUI"
+ @echo NAME $(APP1TARGET) WINDOWAPI > $(MISC)/$(APP1TARGET).def
+.ENDIF
+
+ .IF "$(VERBOSE)" == "TRUE"
+ @+echo $(APP1LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP1BASEX) \
+ $(APP1STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP1LINKRES) \
+ $(APP1RES) \
+ $(APP1DEF) \
+ $(APP1OBJS) \
+ $(APP1LIBS) \
+ $(APP1STDLIBS:^"-l") \
+ $(APP1STDLIB:^"-l") $(STDLIB1:^"-l")
+ .ENDIF
+ $(COMMAND_ECHO)$(APP1LINKER) -v \
+ $(APP1LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP1BASEX) \
+ $(APP1STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP1LINKRES) \
+ $(APP1RES) \
+ $(APP1DEF) \
+ $(APP1OBJS) \
+ $(APP1LIBS) \
+ $(APP1STDLIBS:^"-l") \
+ $(APP1STDLIB:^"-l") $(STDLIB1:^"-l")
+
+
+.IF "$(APP1TARGET)" == "loader"
+ $(COMMAND_ECHO)+$(PERL) loader.pl $@
+ $(COMMAND_ECHO)+$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)+$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(APP1TARGETN)"!=""
+
+
+# Instruction for linking
+# unroll begin
+
+.IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
+APP2DEF = $(MISC)/$(APP2TARGET).def
+.ENDIF
+
+.IF "$(APP2LINKTYPE)" != ""
+#must be either STATIC or SHARED
+APP2LINKTYPEFLAG=$(APPLINK$(APP2LINKTYPE))
+.ENDIF
+
+# decide how to link
+.IF "$(APP2CODETYPE)"=="C"
+APP2LINKER=$(LINKC)
+APP2STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
+APP2LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(APP2CODETYPE)"=="C"
+APP2LINKER=$(LINK)
+APP2STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
+APP2LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(APP2CODETYPE)"=="C"
+
+APP2RPATH*=OOO
+LINKFLAGSRUNPATH_$(APP2RPATH)*=/ERROR:/Bad_APP2RPATH_value
+.IF "$(OS)" != "MACOSX"
+APP2LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP2RPATH))
+.ENDIF
+
+.IF "$(APP2STACK)" != ""
+.IF "$(LINKFLAGSTACK)" != ""
+APP2STACKN=$(LINKFLAGSTACK)$(APP2STACK)
+.ENDIF
+.ELSE
+APP2STACKN=
+.ENDIF
+
+.IF "$(APP2NOSAL)"==""
+.IF "$(TARGETTYPE)" == "GUI"
+APP2OBJS+= $(STDOBJVCL)
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)$(COM)" == "WNTGCC"
+APP2RESO=
+.IF "$(APP2LINKRES)" != "" || "$(APP2RES)" != ""
+APP2RESO=$(MISC)/$(APP2TARGET:b)_res.o
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)" == "UNX"
+APP2DEPN+:=$(APP2DEPNU)
+USE_APP2DEF=
+.ENDIF
+
+.IF "$(APP2TARGETN)"!=""
+
+.IF "$(APP2PRODUCTNAME)"!=""
+APP2PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP2PRODUCTNAME)\"
+.ENDIF # "$(APP2PRODUCTNAME)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(APP2LIBS)"!=""
+$(MISC)/$(APP2TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP2LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF #"$(APP2LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(APP2TARGETN:b)_linkinc.ls
+$(APP2TARGETN) : $(LINKINCTARGETS)
+.ENDIF # "$(linkinc)"!=""
+
+# Allow for target specific LIBSALCPPRT override
+APP2LIBSALCPPRT*=$(LIBSALCPPRT)
+
+.IF "$(GUI)" == "OS2"
+_APP2IMP_ORD = $(APP2STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(APP2STDLIBS:^"$(LB)/")
+APP2IMP_ORD = $(foreach,i,$(_APP2IMP_ORD) $(shell @-ls $i))
+.ELSE
+APP2IMP_ORD =
+.ENDIF
+
+$(APP2TARGETN): $(APP2OBJS) $(APP2LIBS) \
+ $(APP2RES) \
+ $(APP2IMP_ORD) \
+ $(APP2ICON) $(APP2DEPN) $(USE_APP2DEF)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_2.cmd
+ @-$(RM) $(MISC)/$(@:b).strip
+ @echo $(STDSLO) $(APP2OBJS:s/.obj/.o/) \
+ `cat /dev/null $(APP2LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(APP2LINKER) $(APP2LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
+ $(APP2LINKTYPEFLAG) $(APP2STDLIBS) $(APP2STDLIB) $(STDLIB2) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_2.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_2.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_2.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_2.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_2.cmd
+# Need to strip __objcInit symbol to avoid duplicate symbols when loading
+# libraries at runtime
+ @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
+ @strip -i -R $(MISC)/$(@:b).strip -X $@
+ @ls -l $@
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ app $(APP2RPATH) $@
+.IF "$(TARGETTYPE)"=="GUI"
+ @echo "Making: " $(@:f).app
+ @macosx-create-bundle $@
+.ENDIF # "$(TARGETTYPE)"=="GUI"
+.ELSE # "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_2.cmd
+ @echo $(APP2LINKER) $(APP2LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP2OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_2.cmd
+ @cat $(mktmp /dev/null $(APP2LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_2.cmd
+ @echo $(APP2LINKTYPEFLAG) $(APP2LIBSALCPPRT) $(APP2STDLIBS) $(APP2STDLIB) $(STDLIB2) -o $@ >> $(MISC)/$(TARGET).$(@:b)_2.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_2.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_2.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+ .ENDIF
+.ENDIF # "$(OS)"=="MACOSX"
+.ENDIF
+.IF "$(GUI)" == "WNT"
+ @@-$(MKDIR) $(@:d:d)
+.IF "$(APP2LINKRES)" != ""
+ @@-$(RM) $(MISC)/$(APP2LINKRES:b).rc
+.IF "$(APP2ICON)" != ""
+ @-echo 1 ICON $(EMQ)"$(APP2ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP2LINKRES:b).rc
+.ENDIF # "$(APP2ICON)" != ""
+.IF "$(APP2VERINFO)" != ""
+ @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP2LINKRES:b).rc
+ @-echo $(EMQ)#include $(EMQ)"$(APP2VERINFO)$(EMQ)" >> $(MISC)/$(APP2LINKRES:b).rc
+.ENDIF # "$(APP2VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(APP2PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP2LINKRES:b).rc
+.ENDIF # "$(APP2LINKRES)" != ""
+.IF "$(COM)" == "GCC"
+ @echo mingw
+.IF "$(APP2LINKRES)" != "" || "$(APP2RES)" != ""
+ @cat $(APP2LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP2RES)) > $(MISC)/$(@:b)_all.res
+ windres $(MISC)/$(@:b)_all.res $(APP2RESO)
+.ENDIF
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP2BASEX) $(APP2STACKN) -o $@ $(APP2OBJS) \
+ -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP2RESO) \
+ `$(TYPE) /dev/null $(APP2LIBS) | sed s#$(ROUT)#$(OUT)#g` \
+ $(APP_LINKTYPE) $(APP2LIBSALCPPRT) \
+ -Wl,--start-group $(APP2STDLIBS) -Wl,--end-group $(APP2STDLIB) \
+ $(STDLIB2) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_2.cmd
+ # need this empty line, else dmake somehow gets confused by the .IFs and .ENDIFs
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_2.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_2.cmd
+ @ls -l $@
+.ELSE # "$(COM)" == "GCC"
+.IF "$(linkinc)" == ""
+ $(COMMAND_ECHO)$(APP2LINKER) @$(mktmp \
+ $(APP2LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP2BASEX) \
+ $(APP2STACKN) \
+ -out:$@ \
+ -map:$(MISC)/{$(subst,/,_ $(APP2TARGET)).map} \
+ $(STDOBJ) \
+ $(APP2LINKRES) \
+ $(APP2RES) \
+ $(APP2OBJS) \
+ $(APP2LIBS) \
+ $(APP2STDLIBS) \
+ $(APP2STDLIB) $(STDLIB2) \
+ )
+ @-echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP2TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP2TARGET).lst
+ $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
+ for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
+ type $(mktmp,$(MISC)\$(APP2TARGET).lst
+ $(APP2LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP2BASEX) \
+ $(APP2STACKN) \
+ -out:$@ \
+ $(STDOBJ) \
+ $(APP2LINKRES) \
+ $(APP2RES) \
+ $(APP2OBJS) \
+ $(APP2LIBS) \
+ $(APP2STDLIBS) \
+ $(APP2STDLIB) $(STDLIB2))
+ $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP2TARGETN:b)_linkobj.lst >> $(MISC)\$(APP2TARGET).lst
+ $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP2TARGET).lst $(THEN) type $(MISC)/$(APP2TARGET).lst >> $(MISC)/$(APP2TARGET).lnk $(FI)
+ $(COMMAND_ECHO)$(SED)$(APP2LINKER) @$(MISC)\$(APP2TARGET).lnk
+.ENDIF # "$(linkinc)" == ""
+.ENDIF # "$(COM)" == "GCC"
+.IF "$(APP2TARGET)" == "loader"
+ $(COMMAND_ECHO)$(PERL) loader.pl $@
+ $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "WNT"
+
+.IF "$(GUI)" == "OS2"
+ @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
+.IF "$(APP2LINKRES)" != ""
+ @+-$(RM) $(MISC)/$(APP2LINKRES:b).rc >& $(NULLDEV)
+.IF "$(APP2ICON)" != ""
+ @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP2ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)/$(APP2LINKRES:b).rc
+.ENDIF # "$(APP2ICON)" != ""
+.IF "$(APP2VERINFO)" != ""
+ @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP2LINKRES:b).rc
+ @-+echo $(EMQ)#include $(EMQ)"$(APP2VERINFO)$(EMQ)" >> $(MISC)/$(APP2LINKRES:b).rc
+.ENDIF # "$(APP2VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(APP2PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP2LINKRES:b).rc
+.ENDIF # "$(APP2LINKRES)" != ""
+
+.IF "$(TARGETTYPE)" == "GUI"
+ @echo NAME $(APP2TARGET) WINDOWAPI > $(MISC)/$(APP2TARGET).def
+.ENDIF
+
+ .IF "$(VERBOSE)" == "TRUE"
+ @+echo $(APP2LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP2BASEX) \
+ $(APP2STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP2LINKRES) \
+ $(APP2RES) \
+ $(APP2DEF) \
+ $(APP2OBJS) \
+ $(APP2LIBS) \
+ $(APP2STDLIBS:^"-l") \
+ $(APP2STDLIB:^"-l") $(STDLIB2:^"-l")
+ .ENDIF
+ $(COMMAND_ECHO)$(APP2LINKER) -v \
+ $(APP2LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP2BASEX) \
+ $(APP2STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP2LINKRES) \
+ $(APP2RES) \
+ $(APP2DEF) \
+ $(APP2OBJS) \
+ $(APP2LIBS) \
+ $(APP2STDLIBS:^"-l") \
+ $(APP2STDLIB:^"-l") $(STDLIB2:^"-l")
+
+
+.IF "$(APP2TARGET)" == "loader"
+ $(COMMAND_ECHO)+$(PERL) loader.pl $@
+ $(COMMAND_ECHO)+$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)+$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(APP2TARGETN)"!=""
+
+
+# Instruction for linking
+# unroll begin
+
+.IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
+APP3DEF = $(MISC)/$(APP3TARGET).def
+.ENDIF
+
+.IF "$(APP3LINKTYPE)" != ""
+#must be either STATIC or SHARED
+APP3LINKTYPEFLAG=$(APPLINK$(APP3LINKTYPE))
+.ENDIF
+
+# decide how to link
+.IF "$(APP3CODETYPE)"=="C"
+APP3LINKER=$(LINKC)
+APP3STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
+APP3LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(APP3CODETYPE)"=="C"
+APP3LINKER=$(LINK)
+APP3STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
+APP3LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(APP3CODETYPE)"=="C"
+
+APP3RPATH*=OOO
+LINKFLAGSRUNPATH_$(APP3RPATH)*=/ERROR:/Bad_APP3RPATH_value
+.IF "$(OS)" != "MACOSX"
+APP3LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP3RPATH))
+.ENDIF
+
+.IF "$(APP3STACK)" != ""
+.IF "$(LINKFLAGSTACK)" != ""
+APP3STACKN=$(LINKFLAGSTACK)$(APP3STACK)
+.ENDIF
+.ELSE
+APP3STACKN=
+.ENDIF
+
+.IF "$(APP3NOSAL)"==""
+.IF "$(TARGETTYPE)" == "GUI"
+APP3OBJS+= $(STDOBJVCL)
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)$(COM)" == "WNTGCC"
+APP3RESO=
+.IF "$(APP3LINKRES)" != "" || "$(APP3RES)" != ""
+APP3RESO=$(MISC)/$(APP3TARGET:b)_res.o
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)" == "UNX"
+APP3DEPN+:=$(APP3DEPNU)
+USE_APP3DEF=
+.ENDIF
+
+.IF "$(APP3TARGETN)"!=""
+
+.IF "$(APP3PRODUCTNAME)"!=""
+APP3PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP3PRODUCTNAME)\"
+.ENDIF # "$(APP3PRODUCTNAME)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(APP3LIBS)"!=""
+$(MISC)/$(APP3TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP3LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF #"$(APP3LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(APP3TARGETN:b)_linkinc.ls
+$(APP3TARGETN) : $(LINKINCTARGETS)
+.ENDIF # "$(linkinc)"!=""
+
+# Allow for target specific LIBSALCPPRT override
+APP3LIBSALCPPRT*=$(LIBSALCPPRT)
+
+.IF "$(GUI)" == "OS2"
+_APP3IMP_ORD = $(APP3STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(APP3STDLIBS:^"$(LB)/")
+APP3IMP_ORD = $(foreach,i,$(_APP3IMP_ORD) $(shell @-ls $i))
+.ELSE
+APP3IMP_ORD =
+.ENDIF
+
+$(APP3TARGETN): $(APP3OBJS) $(APP3LIBS) \
+ $(APP3RES) \
+ $(APP3IMP_ORD) \
+ $(APP3ICON) $(APP3DEPN) $(USE_APP3DEF)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_3.cmd
+ @-$(RM) $(MISC)/$(@:b).strip
+ @echo $(STDSLO) $(APP3OBJS:s/.obj/.o/) \
+ `cat /dev/null $(APP3LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(APP3LINKER) $(APP3LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
+ $(APP3LINKTYPEFLAG) $(APP3STDLIBS) $(APP3STDLIB) $(STDLIB3) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_3.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_3.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_3.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_3.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_3.cmd
+# Need to strip __objcInit symbol to avoid duplicate symbols when loading
+# libraries at runtime
+ @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
+ @strip -i -R $(MISC)/$(@:b).strip -X $@
+ @ls -l $@
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ app $(APP3RPATH) $@
+.IF "$(TARGETTYPE)"=="GUI"
+ @echo "Making: " $(@:f).app
+ @macosx-create-bundle $@
+.ENDIF # "$(TARGETTYPE)"=="GUI"
+.ELSE # "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_3.cmd
+ @echo $(APP3LINKER) $(APP3LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP3OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_3.cmd
+ @cat $(mktmp /dev/null $(APP3LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_3.cmd
+ @echo $(APP3LINKTYPEFLAG) $(APP3LIBSALCPPRT) $(APP3STDLIBS) $(APP3STDLIB) $(STDLIB3) -o $@ >> $(MISC)/$(TARGET).$(@:b)_3.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_3.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_3.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+ .ENDIF
+.ENDIF # "$(OS)"=="MACOSX"
+.ENDIF
+.IF "$(GUI)" == "WNT"
+ @@-$(MKDIR) $(@:d:d)
+.IF "$(APP3LINKRES)" != ""
+ @@-$(RM) $(MISC)/$(APP3LINKRES:b).rc
+.IF "$(APP3ICON)" != ""
+ @-echo 1 ICON $(EMQ)"$(APP3ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP3LINKRES:b).rc
+.ENDIF # "$(APP3ICON)" != ""
+.IF "$(APP3VERINFO)" != ""
+ @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP3LINKRES:b).rc
+ @-echo $(EMQ)#include $(EMQ)"$(APP3VERINFO)$(EMQ)" >> $(MISC)/$(APP3LINKRES:b).rc
+.ENDIF # "$(APP3VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(APP3PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP3LINKRES:b).rc
+.ENDIF # "$(APP3LINKRES)" != ""
+.IF "$(COM)" == "GCC"
+ @echo mingw
+.IF "$(APP3LINKRES)" != "" || "$(APP3RES)" != ""
+ @cat $(APP3LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP3RES)) > $(MISC)/$(@:b)_all.res
+ windres $(MISC)/$(@:b)_all.res $(APP3RESO)
+.ENDIF
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP3BASEX) $(APP3STACKN) -o $@ $(APP3OBJS) \
+ -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP3RESO) \
+ `$(TYPE) /dev/null $(APP3LIBS) | sed s#$(ROUT)#$(OUT)#g` \
+ $(APP_LINKTYPE) $(APP3LIBSALCPPRT) \
+ -Wl,--start-group $(APP3STDLIBS) -Wl,--end-group $(APP3STDLIB) \
+ $(STDLIB3) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_3.cmd
+ # need this empty line, else dmake somehow gets confused by the .IFs and .ENDIFs
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_3.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_3.cmd
+ @ls -l $@
+.ELSE # "$(COM)" == "GCC"
+.IF "$(linkinc)" == ""
+ $(COMMAND_ECHO)$(APP3LINKER) @$(mktmp \
+ $(APP3LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP3BASEX) \
+ $(APP3STACKN) \
+ -out:$@ \
+ -map:$(MISC)/{$(subst,/,_ $(APP3TARGET)).map} \
+ $(STDOBJ) \
+ $(APP3LINKRES) \
+ $(APP3RES) \
+ $(APP3OBJS) \
+ $(APP3LIBS) \
+ $(APP3STDLIBS) \
+ $(APP3STDLIB) $(STDLIB3) \
+ )
+ @-echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP3TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP3TARGET).lst
+ $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
+ for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
+ type $(mktmp,$(MISC)\$(APP3TARGET).lst
+ $(APP3LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP3BASEX) \
+ $(APP3STACKN) \
+ -out:$@ \
+ $(STDOBJ) \
+ $(APP3LINKRES) \
+ $(APP3RES) \
+ $(APP3OBJS) \
+ $(APP3LIBS) \
+ $(APP3STDLIBS) \
+ $(APP3STDLIB) $(STDLIB3))
+ $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP3TARGETN:b)_linkobj.lst >> $(MISC)\$(APP3TARGET).lst
+ $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP3TARGET).lst $(THEN) type $(MISC)/$(APP3TARGET).lst >> $(MISC)/$(APP3TARGET).lnk $(FI)
+ $(COMMAND_ECHO)$(SED)$(APP3LINKER) @$(MISC)\$(APP3TARGET).lnk
+.ENDIF # "$(linkinc)" == ""
+.ENDIF # "$(COM)" == "GCC"
+.IF "$(APP3TARGET)" == "loader"
+ $(COMMAND_ECHO)$(PERL) loader.pl $@
+ $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "WNT"
+
+.IF "$(GUI)" == "OS2"
+ @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
+.IF "$(APP3LINKRES)" != ""
+ @+-$(RM) $(MISC)/$(APP3LINKRES:b).rc >& $(NULLDEV)
+.IF "$(APP3ICON)" != ""
+ @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP3ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)/$(APP3LINKRES:b).rc
+.ENDIF # "$(APP3ICON)" != ""
+.IF "$(APP3VERINFO)" != ""
+ @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP3LINKRES:b).rc
+ @-+echo $(EMQ)#include $(EMQ)"$(APP3VERINFO)$(EMQ)" >> $(MISC)/$(APP3LINKRES:b).rc
+.ENDIF # "$(APP3VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(APP3PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP3LINKRES:b).rc
+.ENDIF # "$(APP3LINKRES)" != ""
+
+.IF "$(TARGETTYPE)" == "GUI"
+ @echo NAME $(APP3TARGET) WINDOWAPI > $(MISC)/$(APP3TARGET).def
+.ENDIF
+
+ .IF "$(VERBOSE)" == "TRUE"
+ @+echo $(APP3LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP3BASEX) \
+ $(APP3STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP3LINKRES) \
+ $(APP3RES) \
+ $(APP3DEF) \
+ $(APP3OBJS) \
+ $(APP3LIBS) \
+ $(APP3STDLIBS:^"-l") \
+ $(APP3STDLIB:^"-l") $(STDLIB3:^"-l")
+ .ENDIF
+ $(COMMAND_ECHO)$(APP3LINKER) -v \
+ $(APP3LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP3BASEX) \
+ $(APP3STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP3LINKRES) \
+ $(APP3RES) \
+ $(APP3DEF) \
+ $(APP3OBJS) \
+ $(APP3LIBS) \
+ $(APP3STDLIBS:^"-l") \
+ $(APP3STDLIB:^"-l") $(STDLIB3:^"-l")
+
+
+.IF "$(APP3TARGET)" == "loader"
+ $(COMMAND_ECHO)+$(PERL) loader.pl $@
+ $(COMMAND_ECHO)+$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)+$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(APP3TARGETN)"!=""
+
+
+# Instruction for linking
+# unroll begin
+
+.IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
+APP4DEF = $(MISC)/$(APP4TARGET).def
+.ENDIF
+
+.IF "$(APP4LINKTYPE)" != ""
+#must be either STATIC or SHARED
+APP4LINKTYPEFLAG=$(APPLINK$(APP4LINKTYPE))
+.ENDIF
+
+# decide how to link
+.IF "$(APP4CODETYPE)"=="C"
+APP4LINKER=$(LINKC)
+APP4STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
+APP4LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(APP4CODETYPE)"=="C"
+APP4LINKER=$(LINK)
+APP4STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
+APP4LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(APP4CODETYPE)"=="C"
+
+APP4RPATH*=OOO
+LINKFLAGSRUNPATH_$(APP4RPATH)*=/ERROR:/Bad_APP4RPATH_value
+.IF "$(OS)" != "MACOSX"
+APP4LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP4RPATH))
+.ENDIF
+
+.IF "$(APP4STACK)" != ""
+.IF "$(LINKFLAGSTACK)" != ""
+APP4STACKN=$(LINKFLAGSTACK)$(APP4STACK)
+.ENDIF
+.ELSE
+APP4STACKN=
+.ENDIF
+
+.IF "$(APP4NOSAL)"==""
+.IF "$(TARGETTYPE)" == "GUI"
+APP4OBJS+= $(STDOBJVCL)
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)$(COM)" == "WNTGCC"
+APP4RESO=
+.IF "$(APP4LINKRES)" != "" || "$(APP4RES)" != ""
+APP4RESO=$(MISC)/$(APP4TARGET:b)_res.o
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)" == "UNX"
+APP4DEPN+:=$(APP4DEPNU)
+USE_APP4DEF=
+.ENDIF
+
+.IF "$(APP4TARGETN)"!=""
+
+.IF "$(APP4PRODUCTNAME)"!=""
+APP4PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP4PRODUCTNAME)\"
+.ENDIF # "$(APP4PRODUCTNAME)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(APP4LIBS)"!=""
+$(MISC)/$(APP4TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP4LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF #"$(APP4LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(APP4TARGETN:b)_linkinc.ls
+$(APP4TARGETN) : $(LINKINCTARGETS)
+.ENDIF # "$(linkinc)"!=""
+
+# Allow for target specific LIBSALCPPRT override
+APP4LIBSALCPPRT*=$(LIBSALCPPRT)
+
+.IF "$(GUI)" == "OS2"
+_APP4IMP_ORD = $(APP4STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(APP4STDLIBS:^"$(LB)/")
+APP4IMP_ORD = $(foreach,i,$(_APP4IMP_ORD) $(shell @-ls $i))
+.ELSE
+APP4IMP_ORD =
+.ENDIF
+
+$(APP4TARGETN): $(APP4OBJS) $(APP4LIBS) \
+ $(APP4RES) \
+ $(APP4IMP_ORD) \
+ $(APP4ICON) $(APP4DEPN) $(USE_APP4DEF)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_4.cmd
+ @-$(RM) $(MISC)/$(@:b).strip
+ @echo $(STDSLO) $(APP4OBJS:s/.obj/.o/) \
+ `cat /dev/null $(APP4LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(APP4LINKER) $(APP4LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
+ $(APP4LINKTYPEFLAG) $(APP4STDLIBS) $(APP4STDLIB) $(STDLIB4) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_4.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_4.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_4.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_4.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_4.cmd
+# Need to strip __objcInit symbol to avoid duplicate symbols when loading
+# libraries at runtime
+ @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
+ @strip -i -R $(MISC)/$(@:b).strip -X $@
+ @ls -l $@
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ app $(APP4RPATH) $@
+.IF "$(TARGETTYPE)"=="GUI"
+ @echo "Making: " $(@:f).app
+ @macosx-create-bundle $@
+.ENDIF # "$(TARGETTYPE)"=="GUI"
+.ELSE # "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_4.cmd
+ @echo $(APP4LINKER) $(APP4LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP4OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_4.cmd
+ @cat $(mktmp /dev/null $(APP4LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_4.cmd
+ @echo $(APP4LINKTYPEFLAG) $(APP4LIBSALCPPRT) $(APP4STDLIBS) $(APP4STDLIB) $(STDLIB4) -o $@ >> $(MISC)/$(TARGET).$(@:b)_4.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_4.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_4.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+ .ENDIF
+.ENDIF # "$(OS)"=="MACOSX"
+.ENDIF
+.IF "$(GUI)" == "WNT"
+ @@-$(MKDIR) $(@:d:d)
+.IF "$(APP4LINKRES)" != ""
+ @@-$(RM) $(MISC)/$(APP4LINKRES:b).rc
+.IF "$(APP4ICON)" != ""
+ @-echo 1 ICON $(EMQ)"$(APP4ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP4LINKRES:b).rc
+.ENDIF # "$(APP4ICON)" != ""
+.IF "$(APP4VERINFO)" != ""
+ @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP4LINKRES:b).rc
+ @-echo $(EMQ)#include $(EMQ)"$(APP4VERINFO)$(EMQ)" >> $(MISC)/$(APP4LINKRES:b).rc
+.ENDIF # "$(APP4VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(APP4PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP4LINKRES:b).rc
+.ENDIF # "$(APP4LINKRES)" != ""
+.IF "$(COM)" == "GCC"
+ @echo mingw
+.IF "$(APP4LINKRES)" != "" || "$(APP4RES)" != ""
+ @cat $(APP4LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP4RES)) > $(MISC)/$(@:b)_all.res
+ windres $(MISC)/$(@:b)_all.res $(APP4RESO)
+.ENDIF
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP4BASEX) $(APP4STACKN) -o $@ $(APP4OBJS) \
+ -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP4RESO) \
+ `$(TYPE) /dev/null $(APP4LIBS) | sed s#$(ROUT)#$(OUT)#g` \
+ $(APP_LINKTYPE) $(APP4LIBSALCPPRT) \
+ -Wl,--start-group $(APP4STDLIBS) -Wl,--end-group $(APP4STDLIB) \
+ $(STDLIB4) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_4.cmd
+ # need this empty line, else dmake somehow gets confused by the .IFs and .ENDIFs
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_4.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_4.cmd
+ @ls -l $@
+.ELSE # "$(COM)" == "GCC"
+.IF "$(linkinc)" == ""
+ $(COMMAND_ECHO)$(APP4LINKER) @$(mktmp \
+ $(APP4LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP4BASEX) \
+ $(APP4STACKN) \
+ -out:$@ \
+ -map:$(MISC)/{$(subst,/,_ $(APP4TARGET)).map} \
+ $(STDOBJ) \
+ $(APP4LINKRES) \
+ $(APP4RES) \
+ $(APP4OBJS) \
+ $(APP4LIBS) \
+ $(APP4STDLIBS) \
+ $(APP4STDLIB) $(STDLIB4) \
+ )
+ @-echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP4TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP4TARGET).lst
+ $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
+ for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
+ type $(mktmp,$(MISC)\$(APP4TARGET).lst
+ $(APP4LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP4BASEX) \
+ $(APP4STACKN) \
+ -out:$@ \
+ $(STDOBJ) \
+ $(APP4LINKRES) \
+ $(APP4RES) \
+ $(APP4OBJS) \
+ $(APP4LIBS) \
+ $(APP4STDLIBS) \
+ $(APP4STDLIB) $(STDLIB4))
+ $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP4TARGETN:b)_linkobj.lst >> $(MISC)\$(APP4TARGET).lst
+ $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP4TARGET).lst $(THEN) type $(MISC)/$(APP4TARGET).lst >> $(MISC)/$(APP4TARGET).lnk $(FI)
+ $(COMMAND_ECHO)$(SED)$(APP4LINKER) @$(MISC)\$(APP4TARGET).lnk
+.ENDIF # "$(linkinc)" == ""
+.ENDIF # "$(COM)" == "GCC"
+.IF "$(APP4TARGET)" == "loader"
+ $(COMMAND_ECHO)$(PERL) loader.pl $@
+ $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "WNT"
+
+.IF "$(GUI)" == "OS2"
+ @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
+.IF "$(APP4LINKRES)" != ""
+ @+-$(RM) $(MISC)/$(APP4LINKRES:b).rc >& $(NULLDEV)
+.IF "$(APP4ICON)" != ""
+ @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP4ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)/$(APP4LINKRES:b).rc
+.ENDIF # "$(APP4ICON)" != ""
+.IF "$(APP4VERINFO)" != ""
+ @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP4LINKRES:b).rc
+ @-+echo $(EMQ)#include $(EMQ)"$(APP4VERINFO)$(EMQ)" >> $(MISC)/$(APP4LINKRES:b).rc
+.ENDIF # "$(APP4VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(APP4PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP4LINKRES:b).rc
+.ENDIF # "$(APP4LINKRES)" != ""
+
+.IF "$(TARGETTYPE)" == "GUI"
+ @echo NAME $(APP4TARGET) WINDOWAPI > $(MISC)/$(APP4TARGET).def
+.ENDIF
+
+ .IF "$(VERBOSE)" == "TRUE"
+ @+echo $(APP4LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP4BASEX) \
+ $(APP4STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP4LINKRES) \
+ $(APP4RES) \
+ $(APP4DEF) \
+ $(APP4OBJS) \
+ $(APP4LIBS) \
+ $(APP4STDLIBS:^"-l") \
+ $(APP4STDLIB:^"-l") $(STDLIB4:^"-l")
+ .ENDIF
+ $(COMMAND_ECHO)$(APP4LINKER) -v \
+ $(APP4LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP4BASEX) \
+ $(APP4STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP4LINKRES) \
+ $(APP4RES) \
+ $(APP4DEF) \
+ $(APP4OBJS) \
+ $(APP4LIBS) \
+ $(APP4STDLIBS:^"-l") \
+ $(APP4STDLIB:^"-l") $(STDLIB4:^"-l")
+
+
+.IF "$(APP4TARGET)" == "loader"
+ $(COMMAND_ECHO)+$(PERL) loader.pl $@
+ $(COMMAND_ECHO)+$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)+$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(APP4TARGETN)"!=""
+
+
+# Instruction for linking
+# unroll begin
+
+.IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
+APP5DEF = $(MISC)/$(APP5TARGET).def
+.ENDIF
+
+.IF "$(APP5LINKTYPE)" != ""
+#must be either STATIC or SHARED
+APP5LINKTYPEFLAG=$(APPLINK$(APP5LINKTYPE))
+.ENDIF
+
+# decide how to link
+.IF "$(APP5CODETYPE)"=="C"
+APP5LINKER=$(LINKC)
+APP5STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
+APP5LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(APP5CODETYPE)"=="C"
+APP5LINKER=$(LINK)
+APP5STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
+APP5LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(APP5CODETYPE)"=="C"
+
+APP5RPATH*=OOO
+LINKFLAGSRUNPATH_$(APP5RPATH)*=/ERROR:/Bad_APP5RPATH_value
+.IF "$(OS)" != "MACOSX"
+APP5LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP5RPATH))
+.ENDIF
+
+.IF "$(APP5STACK)" != ""
+.IF "$(LINKFLAGSTACK)" != ""
+APP5STACKN=$(LINKFLAGSTACK)$(APP5STACK)
+.ENDIF
+.ELSE
+APP5STACKN=
+.ENDIF
+
+.IF "$(APP5NOSAL)"==""
+.IF "$(TARGETTYPE)" == "GUI"
+APP5OBJS+= $(STDOBJVCL)
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)$(COM)" == "WNTGCC"
+APP5RESO=
+.IF "$(APP5LINKRES)" != "" || "$(APP5RES)" != ""
+APP5RESO=$(MISC)/$(APP5TARGET:b)_res.o
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)" == "UNX"
+APP5DEPN+:=$(APP5DEPNU)
+USE_APP5DEF=
+.ENDIF
+
+.IF "$(APP5TARGETN)"!=""
+
+.IF "$(APP5PRODUCTNAME)"!=""
+APP5PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP5PRODUCTNAME)\"
+.ENDIF # "$(APP5PRODUCTNAME)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(APP5LIBS)"!=""
+$(MISC)/$(APP5TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP5LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF #"$(APP5LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(APP5TARGETN:b)_linkinc.ls
+$(APP5TARGETN) : $(LINKINCTARGETS)
+.ENDIF # "$(linkinc)"!=""
+
+# Allow for target specific LIBSALCPPRT override
+APP5LIBSALCPPRT*=$(LIBSALCPPRT)
+
+.IF "$(GUI)" == "OS2"
+_APP5IMP_ORD = $(APP5STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(APP5STDLIBS:^"$(LB)/")
+APP5IMP_ORD = $(foreach,i,$(_APP5IMP_ORD) $(shell @-ls $i))
+.ELSE
+APP5IMP_ORD =
+.ENDIF
+
+$(APP5TARGETN): $(APP5OBJS) $(APP5LIBS) \
+ $(APP5RES) \
+ $(APP5IMP_ORD) \
+ $(APP5ICON) $(APP5DEPN) $(USE_APP5DEF)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_5.cmd
+ @-$(RM) $(MISC)/$(@:b).strip
+ @echo $(STDSLO) $(APP5OBJS:s/.obj/.o/) \
+ `cat /dev/null $(APP5LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(APP5LINKER) $(APP5LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
+ $(APP5LINKTYPEFLAG) $(APP5STDLIBS) $(APP5STDLIB) $(STDLIB5) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_5.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_5.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_5.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_5.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_5.cmd
+# Need to strip __objcInit symbol to avoid duplicate symbols when loading
+# libraries at runtime
+ @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
+ @strip -i -R $(MISC)/$(@:b).strip -X $@
+ @ls -l $@
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ app $(APP5RPATH) $@
+.IF "$(TARGETTYPE)"=="GUI"
+ @echo "Making: " $(@:f).app
+ @macosx-create-bundle $@
+.ENDIF # "$(TARGETTYPE)"=="GUI"
+.ELSE # "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_5.cmd
+ @echo $(APP5LINKER) $(APP5LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP5OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_5.cmd
+ @cat $(mktmp /dev/null $(APP5LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_5.cmd
+ @echo $(APP5LINKTYPEFLAG) $(APP5LIBSALCPPRT) $(APP5STDLIBS) $(APP5STDLIB) $(STDLIB5) -o $@ >> $(MISC)/$(TARGET).$(@:b)_5.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_5.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_5.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+ .ENDIF
+.ENDIF # "$(OS)"=="MACOSX"
+.ENDIF
+.IF "$(GUI)" == "WNT"
+ @@-$(MKDIR) $(@:d:d)
+.IF "$(APP5LINKRES)" != ""
+ @@-$(RM) $(MISC)/$(APP5LINKRES:b).rc
+.IF "$(APP5ICON)" != ""
+ @-echo 1 ICON $(EMQ)"$(APP5ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP5LINKRES:b).rc
+.ENDIF # "$(APP5ICON)" != ""
+.IF "$(APP5VERINFO)" != ""
+ @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP5LINKRES:b).rc
+ @-echo $(EMQ)#include $(EMQ)"$(APP5VERINFO)$(EMQ)" >> $(MISC)/$(APP5LINKRES:b).rc
+.ENDIF # "$(APP5VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(APP5PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP5LINKRES:b).rc
+.ENDIF # "$(APP5LINKRES)" != ""
+.IF "$(COM)" == "GCC"
+ @echo mingw
+.IF "$(APP5LINKRES)" != "" || "$(APP5RES)" != ""
+ @cat $(APP5LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP5RES)) > $(MISC)/$(@:b)_all.res
+ windres $(MISC)/$(@:b)_all.res $(APP5RESO)
+.ENDIF
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP5BASEX) $(APP5STACKN) -o $@ $(APP5OBJS) \
+ -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP5RESO) \
+ `$(TYPE) /dev/null $(APP5LIBS) | sed s#$(ROUT)#$(OUT)#g` \
+ $(APP_LINKTYPE) $(APP5LIBSALCPPRT) \
+ -Wl,--start-group $(APP5STDLIBS) -Wl,--end-group $(APP5STDLIB) \
+ $(STDLIB5) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_5.cmd
+ # need this empty line, else dmake somehow gets confused by the .IFs and .ENDIFs
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_5.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_5.cmd
+ @ls -l $@
+.ELSE # "$(COM)" == "GCC"
+.IF "$(linkinc)" == ""
+ $(COMMAND_ECHO)$(APP5LINKER) @$(mktmp \
+ $(APP5LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP5BASEX) \
+ $(APP5STACKN) \
+ -out:$@ \
+ -map:$(MISC)/{$(subst,/,_ $(APP5TARGET)).map} \
+ $(STDOBJ) \
+ $(APP5LINKRES) \
+ $(APP5RES) \
+ $(APP5OBJS) \
+ $(APP5LIBS) \
+ $(APP5STDLIBS) \
+ $(APP5STDLIB) $(STDLIB5) \
+ )
+ @-echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP5TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP5TARGET).lst
+ $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
+ for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
+ type $(mktmp,$(MISC)\$(APP5TARGET).lst
+ $(APP5LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP5BASEX) \
+ $(APP5STACKN) \
+ -out:$@ \
+ $(STDOBJ) \
+ $(APP5LINKRES) \
+ $(APP5RES) \
+ $(APP5OBJS) \
+ $(APP5LIBS) \
+ $(APP5STDLIBS) \
+ $(APP5STDLIB) $(STDLIB5))
+ $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP5TARGETN:b)_linkobj.lst >> $(MISC)\$(APP5TARGET).lst
+ $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP5TARGET).lst $(THEN) type $(MISC)/$(APP5TARGET).lst >> $(MISC)/$(APP5TARGET).lnk $(FI)
+ $(COMMAND_ECHO)$(SED)$(APP5LINKER) @$(MISC)\$(APP5TARGET).lnk
+.ENDIF # "$(linkinc)" == ""
+.ENDIF # "$(COM)" == "GCC"
+.IF "$(APP5TARGET)" == "loader"
+ $(COMMAND_ECHO)$(PERL) loader.pl $@
+ $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "WNT"
+
+.IF "$(GUI)" == "OS2"
+ @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
+.IF "$(APP5LINKRES)" != ""
+ @+-$(RM) $(MISC)/$(APP5LINKRES:b).rc >& $(NULLDEV)
+.IF "$(APP5ICON)" != ""
+ @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP5ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)/$(APP5LINKRES:b).rc
+.ENDIF # "$(APP5ICON)" != ""
+.IF "$(APP5VERINFO)" != ""
+ @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP5LINKRES:b).rc
+ @-+echo $(EMQ)#include $(EMQ)"$(APP5VERINFO)$(EMQ)" >> $(MISC)/$(APP5LINKRES:b).rc
+.ENDIF # "$(APP5VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(APP5PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP5LINKRES:b).rc
+.ENDIF # "$(APP5LINKRES)" != ""
+
+.IF "$(TARGETTYPE)" == "GUI"
+ @echo NAME $(APP5TARGET) WINDOWAPI > $(MISC)/$(APP5TARGET).def
+.ENDIF
+
+ .IF "$(VERBOSE)" == "TRUE"
+ @+echo $(APP5LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP5BASEX) \
+ $(APP5STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP5LINKRES) \
+ $(APP5RES) \
+ $(APP5DEF) \
+ $(APP5OBJS) \
+ $(APP5LIBS) \
+ $(APP5STDLIBS:^"-l") \
+ $(APP5STDLIB:^"-l") $(STDLIB5:^"-l")
+ .ENDIF
+ $(COMMAND_ECHO)$(APP5LINKER) -v \
+ $(APP5LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP5BASEX) \
+ $(APP5STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP5LINKRES) \
+ $(APP5RES) \
+ $(APP5DEF) \
+ $(APP5OBJS) \
+ $(APP5LIBS) \
+ $(APP5STDLIBS:^"-l") \
+ $(APP5STDLIB:^"-l") $(STDLIB5:^"-l")
+
+
+.IF "$(APP5TARGET)" == "loader"
+ $(COMMAND_ECHO)+$(PERL) loader.pl $@
+ $(COMMAND_ECHO)+$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)+$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(APP5TARGETN)"!=""
+
+
+# Instruction for linking
+# unroll begin
+
+.IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
+APP6DEF = $(MISC)/$(APP6TARGET).def
+.ENDIF
+
+.IF "$(APP6LINKTYPE)" != ""
+#must be either STATIC or SHARED
+APP6LINKTYPEFLAG=$(APPLINK$(APP6LINKTYPE))
+.ENDIF
+
+# decide how to link
+.IF "$(APP6CODETYPE)"=="C"
+APP6LINKER=$(LINKC)
+APP6STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
+APP6LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(APP6CODETYPE)"=="C"
+APP6LINKER=$(LINK)
+APP6STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
+APP6LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(APP6CODETYPE)"=="C"
+
+APP6RPATH*=OOO
+LINKFLAGSRUNPATH_$(APP6RPATH)*=/ERROR:/Bad_APP6RPATH_value
+.IF "$(OS)" != "MACOSX"
+APP6LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP6RPATH))
+.ENDIF
+
+.IF "$(APP6STACK)" != ""
+.IF "$(LINKFLAGSTACK)" != ""
+APP6STACKN=$(LINKFLAGSTACK)$(APP6STACK)
+.ENDIF
+.ELSE
+APP6STACKN=
+.ENDIF
+
+.IF "$(APP6NOSAL)"==""
+.IF "$(TARGETTYPE)" == "GUI"
+APP6OBJS+= $(STDOBJVCL)
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)$(COM)" == "WNTGCC"
+APP6RESO=
+.IF "$(APP6LINKRES)" != "" || "$(APP6RES)" != ""
+APP6RESO=$(MISC)/$(APP6TARGET:b)_res.o
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)" == "UNX"
+APP6DEPN+:=$(APP6DEPNU)
+USE_APP6DEF=
+.ENDIF
+
+.IF "$(APP6TARGETN)"!=""
+
+.IF "$(APP6PRODUCTNAME)"!=""
+APP6PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP6PRODUCTNAME)\"
+.ENDIF # "$(APP6PRODUCTNAME)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(APP6LIBS)"!=""
+$(MISC)/$(APP6TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP6LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF #"$(APP6LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(APP6TARGETN:b)_linkinc.ls
+$(APP6TARGETN) : $(LINKINCTARGETS)
+.ENDIF # "$(linkinc)"!=""
+
+# Allow for target specific LIBSALCPPRT override
+APP6LIBSALCPPRT*=$(LIBSALCPPRT)
+
+.IF "$(GUI)" == "OS2"
+_APP6IMP_ORD = $(APP6STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(APP6STDLIBS:^"$(LB)/")
+APP6IMP_ORD = $(foreach,i,$(_APP6IMP_ORD) $(shell @-ls $i))
+.ELSE
+APP6IMP_ORD =
+.ENDIF
+
+$(APP6TARGETN): $(APP6OBJS) $(APP6LIBS) \
+ $(APP6RES) \
+ $(APP6IMP_ORD) \
+ $(APP6ICON) $(APP6DEPN) $(USE_APP6DEF)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_6.cmd
+ @-$(RM) $(MISC)/$(@:b).strip
+ @echo $(STDSLO) $(APP6OBJS:s/.obj/.o/) \
+ `cat /dev/null $(APP6LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(APP6LINKER) $(APP6LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
+ $(APP6LINKTYPEFLAG) $(APP6STDLIBS) $(APP6STDLIB) $(STDLIB6) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_6.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_6.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_6.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_6.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_6.cmd
+# Need to strip __objcInit symbol to avoid duplicate symbols when loading
+# libraries at runtime
+ @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
+ @strip -i -R $(MISC)/$(@:b).strip -X $@
+ @ls -l $@
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ app $(APP6RPATH) $@
+.IF "$(TARGETTYPE)"=="GUI"
+ @echo "Making: " $(@:f).app
+ @macosx-create-bundle $@
+.ENDIF # "$(TARGETTYPE)"=="GUI"
+.ELSE # "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_6.cmd
+ @echo $(APP6LINKER) $(APP6LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP6OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_6.cmd
+ @cat $(mktmp /dev/null $(APP6LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_6.cmd
+ @echo $(APP6LINKTYPEFLAG) $(APP6LIBSALCPPRT) $(APP6STDLIBS) $(APP6STDLIB) $(STDLIB6) -o $@ >> $(MISC)/$(TARGET).$(@:b)_6.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_6.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_6.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+ .ENDIF
+.ENDIF # "$(OS)"=="MACOSX"
+.ENDIF
+.IF "$(GUI)" == "WNT"
+ @@-$(MKDIR) $(@:d:d)
+.IF "$(APP6LINKRES)" != ""
+ @@-$(RM) $(MISC)/$(APP6LINKRES:b).rc
+.IF "$(APP6ICON)" != ""
+ @-echo 1 ICON $(EMQ)"$(APP6ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP6LINKRES:b).rc
+.ENDIF # "$(APP6ICON)" != ""
+.IF "$(APP6VERINFO)" != ""
+ @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP6LINKRES:b).rc
+ @-echo $(EMQ)#include $(EMQ)"$(APP6VERINFO)$(EMQ)" >> $(MISC)/$(APP6LINKRES:b).rc
+.ENDIF # "$(APP6VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(APP6PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP6LINKRES:b).rc
+.ENDIF # "$(APP6LINKRES)" != ""
+.IF "$(COM)" == "GCC"
+ @echo mingw
+.IF "$(APP6LINKRES)" != "" || "$(APP6RES)" != ""
+ @cat $(APP6LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP6RES)) > $(MISC)/$(@:b)_all.res
+ windres $(MISC)/$(@:b)_all.res $(APP6RESO)
+.ENDIF
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP6BASEX) $(APP6STACKN) -o $@ $(APP6OBJS) \
+ -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP6RESO) \
+ `$(TYPE) /dev/null $(APP6LIBS) | sed s#$(ROUT)#$(OUT)#g` \
+ $(APP_LINKTYPE) $(APP6LIBSALCPPRT) \
+ -Wl,--start-group $(APP6STDLIBS) -Wl,--end-group $(APP6STDLIB) \
+ $(STDLIB6) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_6.cmd
+ # need this empty line, else dmake somehow gets confused by the .IFs and .ENDIFs
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_6.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_6.cmd
+ @ls -l $@
+.ELSE # "$(COM)" == "GCC"
+.IF "$(linkinc)" == ""
+ $(COMMAND_ECHO)$(APP6LINKER) @$(mktmp \
+ $(APP6LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP6BASEX) \
+ $(APP6STACKN) \
+ -out:$@ \
+ -map:$(MISC)/{$(subst,/,_ $(APP6TARGET)).map} \
+ $(STDOBJ) \
+ $(APP6LINKRES) \
+ $(APP6RES) \
+ $(APP6OBJS) \
+ $(APP6LIBS) \
+ $(APP6STDLIBS) \
+ $(APP6STDLIB) $(STDLIB6) \
+ )
+ @-echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP6TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP6TARGET).lst
+ $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
+ for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
+ type $(mktmp,$(MISC)\$(APP6TARGET).lst
+ $(APP6LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP6BASEX) \
+ $(APP6STACKN) \
+ -out:$@ \
+ $(STDOBJ) \
+ $(APP6LINKRES) \
+ $(APP6RES) \
+ $(APP6OBJS) \
+ $(APP6LIBS) \
+ $(APP6STDLIBS) \
+ $(APP6STDLIB) $(STDLIB6))
+ $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP6TARGETN:b)_linkobj.lst >> $(MISC)\$(APP6TARGET).lst
+ $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP6TARGET).lst $(THEN) type $(MISC)/$(APP6TARGET).lst >> $(MISC)/$(APP6TARGET).lnk $(FI)
+ $(COMMAND_ECHO)$(SED)$(APP6LINKER) @$(MISC)\$(APP6TARGET).lnk
+.ENDIF # "$(linkinc)" == ""
+.ENDIF # "$(COM)" == "GCC"
+.IF "$(APP6TARGET)" == "loader"
+ $(COMMAND_ECHO)$(PERL) loader.pl $@
+ $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "WNT"
+
+.IF "$(GUI)" == "OS2"
+ @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
+.IF "$(APP6LINKRES)" != ""
+ @+-$(RM) $(MISC)/$(APP6LINKRES:b).rc >& $(NULLDEV)
+.IF "$(APP6ICON)" != ""
+ @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP6ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)/$(APP6LINKRES:b).rc
+.ENDIF # "$(APP6ICON)" != ""
+.IF "$(APP6VERINFO)" != ""
+ @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP6LINKRES:b).rc
+ @-+echo $(EMQ)#include $(EMQ)"$(APP6VERINFO)$(EMQ)" >> $(MISC)/$(APP6LINKRES:b).rc
+.ENDIF # "$(APP6VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(APP6PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP6LINKRES:b).rc
+.ENDIF # "$(APP6LINKRES)" != ""
+
+.IF "$(TARGETTYPE)" == "GUI"
+ @echo NAME $(APP6TARGET) WINDOWAPI > $(MISC)/$(APP6TARGET).def
+.ENDIF
+
+ .IF "$(VERBOSE)" == "TRUE"
+ @+echo $(APP6LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP6BASEX) \
+ $(APP6STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP6LINKRES) \
+ $(APP6RES) \
+ $(APP6DEF) \
+ $(APP6OBJS) \
+ $(APP6LIBS) \
+ $(APP6STDLIBS:^"-l") \
+ $(APP6STDLIB:^"-l") $(STDLIB6:^"-l")
+ .ENDIF
+ $(COMMAND_ECHO)$(APP6LINKER) -v \
+ $(APP6LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP6BASEX) \
+ $(APP6STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP6LINKRES) \
+ $(APP6RES) \
+ $(APP6DEF) \
+ $(APP6OBJS) \
+ $(APP6LIBS) \
+ $(APP6STDLIBS:^"-l") \
+ $(APP6STDLIB:^"-l") $(STDLIB6:^"-l")
+
+
+.IF "$(APP6TARGET)" == "loader"
+ $(COMMAND_ECHO)+$(PERL) loader.pl $@
+ $(COMMAND_ECHO)+$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)+$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(APP6TARGETN)"!=""
+
+
+# Instruction for linking
+# unroll begin
+
+.IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
+APP7DEF = $(MISC)/$(APP7TARGET).def
+.ENDIF
+
+.IF "$(APP7LINKTYPE)" != ""
+#must be either STATIC or SHARED
+APP7LINKTYPEFLAG=$(APPLINK$(APP7LINKTYPE))
+.ENDIF
+
+# decide how to link
+.IF "$(APP7CODETYPE)"=="C"
+APP7LINKER=$(LINKC)
+APP7STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
+APP7LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(APP7CODETYPE)"=="C"
+APP7LINKER=$(LINK)
+APP7STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
+APP7LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(APP7CODETYPE)"=="C"
+
+APP7RPATH*=OOO
+LINKFLAGSRUNPATH_$(APP7RPATH)*=/ERROR:/Bad_APP7RPATH_value
+.IF "$(OS)" != "MACOSX"
+APP7LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP7RPATH))
+.ENDIF
+
+.IF "$(APP7STACK)" != ""
+.IF "$(LINKFLAGSTACK)" != ""
+APP7STACKN=$(LINKFLAGSTACK)$(APP7STACK)
+.ENDIF
+.ELSE
+APP7STACKN=
+.ENDIF
+
+.IF "$(APP7NOSAL)"==""
+.IF "$(TARGETTYPE)" == "GUI"
+APP7OBJS+= $(STDOBJVCL)
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)$(COM)" == "WNTGCC"
+APP7RESO=
+.IF "$(APP7LINKRES)" != "" || "$(APP7RES)" != ""
+APP7RESO=$(MISC)/$(APP7TARGET:b)_res.o
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)" == "UNX"
+APP7DEPN+:=$(APP7DEPNU)
+USE_APP7DEF=
+.ENDIF
+
+.IF "$(APP7TARGETN)"!=""
+
+.IF "$(APP7PRODUCTNAME)"!=""
+APP7PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP7PRODUCTNAME)\"
+.ENDIF # "$(APP7PRODUCTNAME)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(APP7LIBS)"!=""
+$(MISC)/$(APP7TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP7LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF #"$(APP7LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(APP7TARGETN:b)_linkinc.ls
+$(APP7TARGETN) : $(LINKINCTARGETS)
+.ENDIF # "$(linkinc)"!=""
+
+# Allow for target specific LIBSALCPPRT override
+APP7LIBSALCPPRT*=$(LIBSALCPPRT)
+
+.IF "$(GUI)" == "OS2"
+_APP7IMP_ORD = $(APP7STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(APP7STDLIBS:^"$(LB)/")
+APP7IMP_ORD = $(foreach,i,$(_APP7IMP_ORD) $(shell @-ls $i))
+.ELSE
+APP7IMP_ORD =
+.ENDIF
+
+$(APP7TARGETN): $(APP7OBJS) $(APP7LIBS) \
+ $(APP7RES) \
+ $(APP7IMP_ORD) \
+ $(APP7ICON) $(APP7DEPN) $(USE_APP7DEF)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_7.cmd
+ @-$(RM) $(MISC)/$(@:b).strip
+ @echo $(STDSLO) $(APP7OBJS:s/.obj/.o/) \
+ `cat /dev/null $(APP7LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(APP7LINKER) $(APP7LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
+ $(APP7LINKTYPEFLAG) $(APP7STDLIBS) $(APP7STDLIB) $(STDLIB7) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_7.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_7.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_7.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_7.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_7.cmd
+# Need to strip __objcInit symbol to avoid duplicate symbols when loading
+# libraries at runtime
+ @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
+ @strip -i -R $(MISC)/$(@:b).strip -X $@
+ @ls -l $@
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ app $(APP7RPATH) $@
+.IF "$(TARGETTYPE)"=="GUI"
+ @echo "Making: " $(@:f).app
+ @macosx-create-bundle $@
+.ENDIF # "$(TARGETTYPE)"=="GUI"
+.ELSE # "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_7.cmd
+ @echo $(APP7LINKER) $(APP7LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP7OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_7.cmd
+ @cat $(mktmp /dev/null $(APP7LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_7.cmd
+ @echo $(APP7LINKTYPEFLAG) $(APP7LIBSALCPPRT) $(APP7STDLIBS) $(APP7STDLIB) $(STDLIB7) -o $@ >> $(MISC)/$(TARGET).$(@:b)_7.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_7.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_7.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+ .ENDIF
+.ENDIF # "$(OS)"=="MACOSX"
+.ENDIF
+.IF "$(GUI)" == "WNT"
+ @@-$(MKDIR) $(@:d:d)
+.IF "$(APP7LINKRES)" != ""
+ @@-$(RM) $(MISC)/$(APP7LINKRES:b).rc
+.IF "$(APP7ICON)" != ""
+ @-echo 1 ICON $(EMQ)"$(APP7ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP7LINKRES:b).rc
+.ENDIF # "$(APP7ICON)" != ""
+.IF "$(APP7VERINFO)" != ""
+ @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP7LINKRES:b).rc
+ @-echo $(EMQ)#include $(EMQ)"$(APP7VERINFO)$(EMQ)" >> $(MISC)/$(APP7LINKRES:b).rc
+.ENDIF # "$(APP7VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(APP7PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP7LINKRES:b).rc
+.ENDIF # "$(APP7LINKRES)" != ""
+.IF "$(COM)" == "GCC"
+ @echo mingw
+.IF "$(APP7LINKRES)" != "" || "$(APP7RES)" != ""
+ @cat $(APP7LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP7RES)) > $(MISC)/$(@:b)_all.res
+ windres $(MISC)/$(@:b)_all.res $(APP7RESO)
+.ENDIF
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP7BASEX) $(APP7STACKN) -o $@ $(APP7OBJS) \
+ -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP7RESO) \
+ `$(TYPE) /dev/null $(APP7LIBS) | sed s#$(ROUT)#$(OUT)#g` \
+ $(APP_LINKTYPE) $(APP7LIBSALCPPRT) \
+ -Wl,--start-group $(APP7STDLIBS) -Wl,--end-group $(APP7STDLIB) \
+ $(STDLIB7) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_7.cmd
+ # need this empty line, else dmake somehow gets confused by the .IFs and .ENDIFs
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_7.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_7.cmd
+ @ls -l $@
+.ELSE # "$(COM)" == "GCC"
+.IF "$(linkinc)" == ""
+ $(COMMAND_ECHO)$(APP7LINKER) @$(mktmp \
+ $(APP7LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP7BASEX) \
+ $(APP7STACKN) \
+ -out:$@ \
+ -map:$(MISC)/{$(subst,/,_ $(APP7TARGET)).map} \
+ $(STDOBJ) \
+ $(APP7LINKRES) \
+ $(APP7RES) \
+ $(APP7OBJS) \
+ $(APP7LIBS) \
+ $(APP7STDLIBS) \
+ $(APP7STDLIB) $(STDLIB7) \
+ )
+ @-echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP7TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP7TARGET).lst
+ $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
+ for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
+ type $(mktmp,$(MISC)\$(APP7TARGET).lst
+ $(APP7LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP7BASEX) \
+ $(APP7STACKN) \
+ -out:$@ \
+ $(STDOBJ) \
+ $(APP7LINKRES) \
+ $(APP7RES) \
+ $(APP7OBJS) \
+ $(APP7LIBS) \
+ $(APP7STDLIBS) \
+ $(APP7STDLIB) $(STDLIB7))
+ $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP7TARGETN:b)_linkobj.lst >> $(MISC)\$(APP7TARGET).lst
+ $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP7TARGET).lst $(THEN) type $(MISC)/$(APP7TARGET).lst >> $(MISC)/$(APP7TARGET).lnk $(FI)
+ $(COMMAND_ECHO)$(SED)$(APP7LINKER) @$(MISC)\$(APP7TARGET).lnk
+.ENDIF # "$(linkinc)" == ""
+.ENDIF # "$(COM)" == "GCC"
+.IF "$(APP7TARGET)" == "loader"
+ $(COMMAND_ECHO)$(PERL) loader.pl $@
+ $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "WNT"
+
+.IF "$(GUI)" == "OS2"
+ @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
+.IF "$(APP7LINKRES)" != ""
+ @+-$(RM) $(MISC)/$(APP7LINKRES:b).rc >& $(NULLDEV)
+.IF "$(APP7ICON)" != ""
+ @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP7ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)/$(APP7LINKRES:b).rc
+.ENDIF # "$(APP7ICON)" != ""
+.IF "$(APP7VERINFO)" != ""
+ @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP7LINKRES:b).rc
+ @-+echo $(EMQ)#include $(EMQ)"$(APP7VERINFO)$(EMQ)" >> $(MISC)/$(APP7LINKRES:b).rc
+.ENDIF # "$(APP7VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(APP7PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP7LINKRES:b).rc
+.ENDIF # "$(APP7LINKRES)" != ""
+
+.IF "$(TARGETTYPE)" == "GUI"
+ @echo NAME $(APP7TARGET) WINDOWAPI > $(MISC)/$(APP7TARGET).def
+.ENDIF
+
+ .IF "$(VERBOSE)" == "TRUE"
+ @+echo $(APP7LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP7BASEX) \
+ $(APP7STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP7LINKRES) \
+ $(APP7RES) \
+ $(APP7DEF) \
+ $(APP7OBJS) \
+ $(APP7LIBS) \
+ $(APP7STDLIBS:^"-l") \
+ $(APP7STDLIB:^"-l") $(STDLIB7:^"-l")
+ .ENDIF
+ $(COMMAND_ECHO)$(APP7LINKER) -v \
+ $(APP7LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP7BASEX) \
+ $(APP7STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP7LINKRES) \
+ $(APP7RES) \
+ $(APP7DEF) \
+ $(APP7OBJS) \
+ $(APP7LIBS) \
+ $(APP7STDLIBS:^"-l") \
+ $(APP7STDLIB:^"-l") $(STDLIB7:^"-l")
+
+
+.IF "$(APP7TARGET)" == "loader"
+ $(COMMAND_ECHO)+$(PERL) loader.pl $@
+ $(COMMAND_ECHO)+$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)+$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(APP7TARGETN)"!=""
+
+
+# Instruction for linking
+# unroll begin
+
+.IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
+APP8DEF = $(MISC)/$(APP8TARGET).def
+.ENDIF
+
+.IF "$(APP8LINKTYPE)" != ""
+#must be either STATIC or SHARED
+APP8LINKTYPEFLAG=$(APPLINK$(APP8LINKTYPE))
+.ENDIF
+
+# decide how to link
+.IF "$(APP8CODETYPE)"=="C"
+APP8LINKER=$(LINKC)
+APP8STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
+APP8LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(APP8CODETYPE)"=="C"
+APP8LINKER=$(LINK)
+APP8STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
+APP8LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(APP8CODETYPE)"=="C"
+
+APP8RPATH*=OOO
+LINKFLAGSRUNPATH_$(APP8RPATH)*=/ERROR:/Bad_APP8RPATH_value
+.IF "$(OS)" != "MACOSX"
+APP8LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP8RPATH))
+.ENDIF
+
+.IF "$(APP8STACK)" != ""
+.IF "$(LINKFLAGSTACK)" != ""
+APP8STACKN=$(LINKFLAGSTACK)$(APP8STACK)
+.ENDIF
+.ELSE
+APP8STACKN=
+.ENDIF
+
+.IF "$(APP8NOSAL)"==""
+.IF "$(TARGETTYPE)" == "GUI"
+APP8OBJS+= $(STDOBJVCL)
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)$(COM)" == "WNTGCC"
+APP8RESO=
+.IF "$(APP8LINKRES)" != "" || "$(APP8RES)" != ""
+APP8RESO=$(MISC)/$(APP8TARGET:b)_res.o
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)" == "UNX"
+APP8DEPN+:=$(APP8DEPNU)
+USE_APP8DEF=
+.ENDIF
+
+.IF "$(APP8TARGETN)"!=""
+
+.IF "$(APP8PRODUCTNAME)"!=""
+APP8PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP8PRODUCTNAME)\"
+.ENDIF # "$(APP8PRODUCTNAME)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(APP8LIBS)"!=""
+$(MISC)/$(APP8TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP8LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF #"$(APP8LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(APP8TARGETN:b)_linkinc.ls
+$(APP8TARGETN) : $(LINKINCTARGETS)
+.ENDIF # "$(linkinc)"!=""
+
+# Allow for target specific LIBSALCPPRT override
+APP8LIBSALCPPRT*=$(LIBSALCPPRT)
+
+.IF "$(GUI)" == "OS2"
+_APP8IMP_ORD = $(APP8STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(APP8STDLIBS:^"$(LB)/")
+APP8IMP_ORD = $(foreach,i,$(_APP8IMP_ORD) $(shell @-ls $i))
+.ELSE
+APP8IMP_ORD =
+.ENDIF
+
+$(APP8TARGETN): $(APP8OBJS) $(APP8LIBS) \
+ $(APP8RES) \
+ $(APP8IMP_ORD) \
+ $(APP8ICON) $(APP8DEPN) $(USE_APP8DEF)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_8.cmd
+ @-$(RM) $(MISC)/$(@:b).strip
+ @echo $(STDSLO) $(APP8OBJS:s/.obj/.o/) \
+ `cat /dev/null $(APP8LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(APP8LINKER) $(APP8LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
+ $(APP8LINKTYPEFLAG) $(APP8STDLIBS) $(APP8STDLIB) $(STDLIB8) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_8.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_8.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_8.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_8.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_8.cmd
+# Need to strip __objcInit symbol to avoid duplicate symbols when loading
+# libraries at runtime
+ @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
+ @strip -i -R $(MISC)/$(@:b).strip -X $@
+ @ls -l $@
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ app $(APP8RPATH) $@
+.IF "$(TARGETTYPE)"=="GUI"
+ @echo "Making: " $(@:f).app
+ @macosx-create-bundle $@
+.ENDIF # "$(TARGETTYPE)"=="GUI"
+.ELSE # "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_8.cmd
+ @echo $(APP8LINKER) $(APP8LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP8OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_8.cmd
+ @cat $(mktmp /dev/null $(APP8LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_8.cmd
+ @echo $(APP8LINKTYPEFLAG) $(APP8LIBSALCPPRT) $(APP8STDLIBS) $(APP8STDLIB) $(STDLIB8) -o $@ >> $(MISC)/$(TARGET).$(@:b)_8.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_8.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_8.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+ .ENDIF
+.ENDIF # "$(OS)"=="MACOSX"
+.ENDIF
+.IF "$(GUI)" == "WNT"
+ @@-$(MKDIR) $(@:d:d)
+.IF "$(APP8LINKRES)" != ""
+ @@-$(RM) $(MISC)/$(APP8LINKRES:b).rc
+.IF "$(APP8ICON)" != ""
+ @-echo 1 ICON $(EMQ)"$(APP8ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP8LINKRES:b).rc
+.ENDIF # "$(APP8ICON)" != ""
+.IF "$(APP8VERINFO)" != ""
+ @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP8LINKRES:b).rc
+ @-echo $(EMQ)#include $(EMQ)"$(APP8VERINFO)$(EMQ)" >> $(MISC)/$(APP8LINKRES:b).rc
+.ENDIF # "$(APP8VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(APP8PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP8LINKRES:b).rc
+.ENDIF # "$(APP8LINKRES)" != ""
+.IF "$(COM)" == "GCC"
+ @echo mingw
+.IF "$(APP8LINKRES)" != "" || "$(APP8RES)" != ""
+ @cat $(APP8LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP8RES)) > $(MISC)/$(@:b)_all.res
+ windres $(MISC)/$(@:b)_all.res $(APP8RESO)
+.ENDIF
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP8BASEX) $(APP8STACKN) -o $@ $(APP8OBJS) \
+ -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP8RESO) \
+ `$(TYPE) /dev/null $(APP8LIBS) | sed s#$(ROUT)#$(OUT)#g` \
+ $(APP_LINKTYPE) $(APP8LIBSALCPPRT) \
+ -Wl,--start-group $(APP8STDLIBS) -Wl,--end-group $(APP8STDLIB) \
+ $(STDLIB8) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_8.cmd
+ # need this empty line, else dmake somehow gets confused by the .IFs and .ENDIFs
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_8.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_8.cmd
+ @ls -l $@
+.ELSE # "$(COM)" == "GCC"
+.IF "$(linkinc)" == ""
+ $(COMMAND_ECHO)$(APP8LINKER) @$(mktmp \
+ $(APP8LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP8BASEX) \
+ $(APP8STACKN) \
+ -out:$@ \
+ -map:$(MISC)/{$(subst,/,_ $(APP8TARGET)).map} \
+ $(STDOBJ) \
+ $(APP8LINKRES) \
+ $(APP8RES) \
+ $(APP8OBJS) \
+ $(APP8LIBS) \
+ $(APP8STDLIBS) \
+ $(APP8STDLIB) $(STDLIB8) \
+ )
+ @-echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP8TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP8TARGET).lst
+ $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
+ for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
+ type $(mktmp,$(MISC)\$(APP8TARGET).lst
+ $(APP8LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP8BASEX) \
+ $(APP8STACKN) \
+ -out:$@ \
+ $(STDOBJ) \
+ $(APP8LINKRES) \
+ $(APP8RES) \
+ $(APP8OBJS) \
+ $(APP8LIBS) \
+ $(APP8STDLIBS) \
+ $(APP8STDLIB) $(STDLIB8))
+ $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP8TARGETN:b)_linkobj.lst >> $(MISC)\$(APP8TARGET).lst
+ $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP8TARGET).lst $(THEN) type $(MISC)/$(APP8TARGET).lst >> $(MISC)/$(APP8TARGET).lnk $(FI)
+ $(COMMAND_ECHO)$(SED)$(APP8LINKER) @$(MISC)\$(APP8TARGET).lnk
+.ENDIF # "$(linkinc)" == ""
+.ENDIF # "$(COM)" == "GCC"
+.IF "$(APP8TARGET)" == "loader"
+ $(COMMAND_ECHO)$(PERL) loader.pl $@
+ $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "WNT"
+
+.IF "$(GUI)" == "OS2"
+ @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
+.IF "$(APP8LINKRES)" != ""
+ @+-$(RM) $(MISC)/$(APP8LINKRES:b).rc >& $(NULLDEV)
+.IF "$(APP8ICON)" != ""
+ @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP8ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)/$(APP8LINKRES:b).rc
+.ENDIF # "$(APP8ICON)" != ""
+.IF "$(APP8VERINFO)" != ""
+ @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP8LINKRES:b).rc
+ @-+echo $(EMQ)#include $(EMQ)"$(APP8VERINFO)$(EMQ)" >> $(MISC)/$(APP8LINKRES:b).rc
+.ENDIF # "$(APP8VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(APP8PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP8LINKRES:b).rc
+.ENDIF # "$(APP8LINKRES)" != ""
+
+.IF "$(TARGETTYPE)" == "GUI"
+ @echo NAME $(APP8TARGET) WINDOWAPI > $(MISC)/$(APP8TARGET).def
+.ENDIF
+
+ .IF "$(VERBOSE)" == "TRUE"
+ @+echo $(APP8LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP8BASEX) \
+ $(APP8STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP8LINKRES) \
+ $(APP8RES) \
+ $(APP8DEF) \
+ $(APP8OBJS) \
+ $(APP8LIBS) \
+ $(APP8STDLIBS:^"-l") \
+ $(APP8STDLIB:^"-l") $(STDLIB8:^"-l")
+ .ENDIF
+ $(COMMAND_ECHO)$(APP8LINKER) -v \
+ $(APP8LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP8BASEX) \
+ $(APP8STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP8LINKRES) \
+ $(APP8RES) \
+ $(APP8DEF) \
+ $(APP8OBJS) \
+ $(APP8LIBS) \
+ $(APP8STDLIBS:^"-l") \
+ $(APP8STDLIB:^"-l") $(STDLIB8:^"-l")
+
+
+.IF "$(APP8TARGET)" == "loader"
+ $(COMMAND_ECHO)+$(PERL) loader.pl $@
+ $(COMMAND_ECHO)+$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)+$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(APP8TARGETN)"!=""
+
+
+# Instruction for linking
+# unroll begin
+
+.IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
+APP9DEF = $(MISC)/$(APP9TARGET).def
+.ENDIF
+
+.IF "$(APP9LINKTYPE)" != ""
+#must be either STATIC or SHARED
+APP9LINKTYPEFLAG=$(APPLINK$(APP9LINKTYPE))
+.ENDIF
+
+# decide how to link
+.IF "$(APP9CODETYPE)"=="C"
+APP9LINKER=$(LINKC)
+APP9STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
+APP9LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(APP9CODETYPE)"=="C"
+APP9LINKER=$(LINK)
+APP9STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
+APP9LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(APP9CODETYPE)"=="C"
+
+APP9RPATH*=OOO
+LINKFLAGSRUNPATH_$(APP9RPATH)*=/ERROR:/Bad_APP9RPATH_value
+.IF "$(OS)" != "MACOSX"
+APP9LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP9RPATH))
+.ENDIF
+
+.IF "$(APP9STACK)" != ""
+.IF "$(LINKFLAGSTACK)" != ""
+APP9STACKN=$(LINKFLAGSTACK)$(APP9STACK)
+.ENDIF
+.ELSE
+APP9STACKN=
+.ENDIF
+
+.IF "$(APP9NOSAL)"==""
+.IF "$(TARGETTYPE)" == "GUI"
+APP9OBJS+= $(STDOBJVCL)
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)$(COM)" == "WNTGCC"
+APP9RESO=
+.IF "$(APP9LINKRES)" != "" || "$(APP9RES)" != ""
+APP9RESO=$(MISC)/$(APP9TARGET:b)_res.o
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)" == "UNX"
+APP9DEPN+:=$(APP9DEPNU)
+USE_APP9DEF=
+.ENDIF
+
+.IF "$(APP9TARGETN)"!=""
+
+.IF "$(APP9PRODUCTNAME)"!=""
+APP9PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP9PRODUCTNAME)\"
+.ENDIF # "$(APP9PRODUCTNAME)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(APP9LIBS)"!=""
+$(MISC)/$(APP9TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP9LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF #"$(APP9LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(APP9TARGETN:b)_linkinc.ls
+$(APP9TARGETN) : $(LINKINCTARGETS)
+.ENDIF # "$(linkinc)"!=""
+
+# Allow for target specific LIBSALCPPRT override
+APP9LIBSALCPPRT*=$(LIBSALCPPRT)
+
+.IF "$(GUI)" == "OS2"
+_APP9IMP_ORD = $(APP9STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(APP9STDLIBS:^"$(LB)/")
+APP9IMP_ORD = $(foreach,i,$(_APP9IMP_ORD) $(shell @-ls $i))
+.ELSE
+APP9IMP_ORD =
+.ENDIF
+
+$(APP9TARGETN): $(APP9OBJS) $(APP9LIBS) \
+ $(APP9RES) \
+ $(APP9IMP_ORD) \
+ $(APP9ICON) $(APP9DEPN) $(USE_APP9DEF)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_9.cmd
+ @-$(RM) $(MISC)/$(@:b).strip
+ @echo $(STDSLO) $(APP9OBJS:s/.obj/.o/) \
+ `cat /dev/null $(APP9LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(APP9LINKER) $(APP9LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
+ $(APP9LINKTYPEFLAG) $(APP9STDLIBS) $(APP9STDLIB) $(STDLIB9) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_9.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_9.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_9.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_9.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_9.cmd
+# Need to strip __objcInit symbol to avoid duplicate symbols when loading
+# libraries at runtime
+ @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
+ @strip -i -R $(MISC)/$(@:b).strip -X $@
+ @ls -l $@
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ app $(APP9RPATH) $@
+.IF "$(TARGETTYPE)"=="GUI"
+ @echo "Making: " $(@:f).app
+ @macosx-create-bundle $@
+.ENDIF # "$(TARGETTYPE)"=="GUI"
+.ELSE # "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_9.cmd
+ @echo $(APP9LINKER) $(APP9LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP9OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_9.cmd
+ @cat $(mktmp /dev/null $(APP9LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_9.cmd
+ @echo $(APP9LINKTYPEFLAG) $(APP9LIBSALCPPRT) $(APP9STDLIBS) $(APP9STDLIB) $(STDLIB9) -o $@ >> $(MISC)/$(TARGET).$(@:b)_9.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_9.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_9.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+ .ENDIF
+.ENDIF # "$(OS)"=="MACOSX"
+.ENDIF
+.IF "$(GUI)" == "WNT"
+ @@-$(MKDIR) $(@:d:d)
+.IF "$(APP9LINKRES)" != ""
+ @@-$(RM) $(MISC)/$(APP9LINKRES:b).rc
+.IF "$(APP9ICON)" != ""
+ @-echo 1 ICON $(EMQ)"$(APP9ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP9LINKRES:b).rc
+.ENDIF # "$(APP9ICON)" != ""
+.IF "$(APP9VERINFO)" != ""
+ @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP9LINKRES:b).rc
+ @-echo $(EMQ)#include $(EMQ)"$(APP9VERINFO)$(EMQ)" >> $(MISC)/$(APP9LINKRES:b).rc
+.ENDIF # "$(APP9VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(APP9PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP9LINKRES:b).rc
+.ENDIF # "$(APP9LINKRES)" != ""
+.IF "$(COM)" == "GCC"
+ @echo mingw
+.IF "$(APP9LINKRES)" != "" || "$(APP9RES)" != ""
+ @cat $(APP9LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP9RES)) > $(MISC)/$(@:b)_all.res
+ windres $(MISC)/$(@:b)_all.res $(APP9RESO)
+.ENDIF
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP9BASEX) $(APP9STACKN) -o $@ $(APP9OBJS) \
+ -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP9RESO) \
+ `$(TYPE) /dev/null $(APP9LIBS) | sed s#$(ROUT)#$(OUT)#g` \
+ $(APP_LINKTYPE) $(APP9LIBSALCPPRT) \
+ -Wl,--start-group $(APP9STDLIBS) -Wl,--end-group $(APP9STDLIB) \
+ $(STDLIB9) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_9.cmd
+ # need this empty line, else dmake somehow gets confused by the .IFs and .ENDIFs
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_9.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_9.cmd
+ @ls -l $@
+.ELSE # "$(COM)" == "GCC"
+.IF "$(linkinc)" == ""
+ $(COMMAND_ECHO)$(APP9LINKER) @$(mktmp \
+ $(APP9LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP9BASEX) \
+ $(APP9STACKN) \
+ -out:$@ \
+ -map:$(MISC)/{$(subst,/,_ $(APP9TARGET)).map} \
+ $(STDOBJ) \
+ $(APP9LINKRES) \
+ $(APP9RES) \
+ $(APP9OBJS) \
+ $(APP9LIBS) \
+ $(APP9STDLIBS) \
+ $(APP9STDLIB) $(STDLIB9) \
+ )
+ @-echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP9TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP9TARGET).lst
+ $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
+ for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
+ type $(mktmp,$(MISC)\$(APP9TARGET).lst
+ $(APP9LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP9BASEX) \
+ $(APP9STACKN) \
+ -out:$@ \
+ $(STDOBJ) \
+ $(APP9LINKRES) \
+ $(APP9RES) \
+ $(APP9OBJS) \
+ $(APP9LIBS) \
+ $(APP9STDLIBS) \
+ $(APP9STDLIB) $(STDLIB9))
+ $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP9TARGETN:b)_linkobj.lst >> $(MISC)\$(APP9TARGET).lst
+ $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP9TARGET).lst $(THEN) type $(MISC)/$(APP9TARGET).lst >> $(MISC)/$(APP9TARGET).lnk $(FI)
+ $(COMMAND_ECHO)$(SED)$(APP9LINKER) @$(MISC)\$(APP9TARGET).lnk
+.ENDIF # "$(linkinc)" == ""
+.ENDIF # "$(COM)" == "GCC"
+.IF "$(APP9TARGET)" == "loader"
+ $(COMMAND_ECHO)$(PERL) loader.pl $@
+ $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "WNT"
+
+.IF "$(GUI)" == "OS2"
+ @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
+.IF "$(APP9LINKRES)" != ""
+ @+-$(RM) $(MISC)/$(APP9LINKRES:b).rc >& $(NULLDEV)
+.IF "$(APP9ICON)" != ""
+ @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP9ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)/$(APP9LINKRES:b).rc
+.ENDIF # "$(APP9ICON)" != ""
+.IF "$(APP9VERINFO)" != ""
+ @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP9LINKRES:b).rc
+ @-+echo $(EMQ)#include $(EMQ)"$(APP9VERINFO)$(EMQ)" >> $(MISC)/$(APP9LINKRES:b).rc
+.ENDIF # "$(APP9VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(APP9PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP9LINKRES:b).rc
+.ENDIF # "$(APP9LINKRES)" != ""
+
+.IF "$(TARGETTYPE)" == "GUI"
+ @echo NAME $(APP9TARGET) WINDOWAPI > $(MISC)/$(APP9TARGET).def
+.ENDIF
+
+ .IF "$(VERBOSE)" == "TRUE"
+ @+echo $(APP9LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP9BASEX) \
+ $(APP9STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP9LINKRES) \
+ $(APP9RES) \
+ $(APP9DEF) \
+ $(APP9OBJS) \
+ $(APP9LIBS) \
+ $(APP9STDLIBS:^"-l") \
+ $(APP9STDLIB:^"-l") $(STDLIB9:^"-l")
+ .ENDIF
+ $(COMMAND_ECHO)$(APP9LINKER) -v \
+ $(APP9LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP9BASEX) \
+ $(APP9STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP9LINKRES) \
+ $(APP9RES) \
+ $(APP9DEF) \
+ $(APP9OBJS) \
+ $(APP9LIBS) \
+ $(APP9STDLIBS:^"-l") \
+ $(APP9STDLIB:^"-l") $(STDLIB9:^"-l")
+
+
+.IF "$(APP9TARGET)" == "loader"
+ $(COMMAND_ECHO)+$(PERL) loader.pl $@
+ $(COMMAND_ECHO)+$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)+$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(APP9TARGETN)"!=""
+
+
+# Instruction for linking
+# unroll begin
+
+.IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
+APP10DEF = $(MISC)/$(APP10TARGET).def
+.ENDIF
+
+.IF "$(APP10LINKTYPE)" != ""
+#must be either STATIC or SHARED
+APP10LINKTYPEFLAG=$(APPLINK$(APP10LINKTYPE))
+.ENDIF
+
+# decide how to link
+.IF "$(APP10CODETYPE)"=="C"
+APP10LINKER=$(LINKC)
+APP10STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
+APP10LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(APP10CODETYPE)"=="C"
+APP10LINKER=$(LINK)
+APP10STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
+APP10LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(APP10CODETYPE)"=="C"
+
+APP10RPATH*=OOO
+LINKFLAGSRUNPATH_$(APP10RPATH)*=/ERROR:/Bad_APP10RPATH_value
+.IF "$(OS)" != "MACOSX"
+APP10LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP10RPATH))
+.ENDIF
+
+.IF "$(APP10STACK)" != ""
+.IF "$(LINKFLAGSTACK)" != ""
+APP10STACKN=$(LINKFLAGSTACK)$(APP10STACK)
+.ENDIF
+.ELSE
+APP10STACKN=
+.ENDIF
+
+.IF "$(APP10NOSAL)"==""
+.IF "$(TARGETTYPE)" == "GUI"
+APP10OBJS+= $(STDOBJVCL)
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)$(COM)" == "WNTGCC"
+APP10RESO=
+.IF "$(APP10LINKRES)" != "" || "$(APP10RES)" != ""
+APP10RESO=$(MISC)/$(APP10TARGET:b)_res.o
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)" == "UNX"
+APP10DEPN+:=$(APP10DEPNU)
+USE_APP10DEF=
+.ENDIF
+
+.IF "$(APP10TARGETN)"!=""
+
+.IF "$(APP10PRODUCTNAME)"!=""
+APP10PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP10PRODUCTNAME)\"
+.ENDIF # "$(APP10PRODUCTNAME)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(APP10LIBS)"!=""
+$(MISC)/$(APP10TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP10LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF #"$(APP10LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(APP10TARGETN:b)_linkinc.ls
+$(APP10TARGETN) : $(LINKINCTARGETS)
+.ENDIF # "$(linkinc)"!=""
+
+# Allow for target specific LIBSALCPPRT override
+APP10LIBSALCPPRT*=$(LIBSALCPPRT)
+
+.IF "$(GUI)" == "OS2"
+_APP10IMP_ORD = $(APP10STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(APP10STDLIBS:^"$(LB)/")
+APP10IMP_ORD = $(foreach,i,$(_APP10IMP_ORD) $(shell @-ls $i))
+.ELSE
+APP10IMP_ORD =
+.ENDIF
+
+$(APP10TARGETN): $(APP10OBJS) $(APP10LIBS) \
+ $(APP10RES) \
+ $(APP10IMP_ORD) \
+ $(APP10ICON) $(APP10DEPN) $(USE_APP10DEF)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_10.cmd
+ @-$(RM) $(MISC)/$(@:b).strip
+ @echo $(STDSLO) $(APP10OBJS:s/.obj/.o/) \
+ `cat /dev/null $(APP10LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(APP10LINKER) $(APP10LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
+ $(APP10LINKTYPEFLAG) $(APP10STDLIBS) $(APP10STDLIB) $(STDLIB10) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_10.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_10.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_10.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_10.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_10.cmd
+# Need to strip __objcInit symbol to avoid duplicate symbols when loading
+# libraries at runtime
+ @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
+ @strip -i -R $(MISC)/$(@:b).strip -X $@
+ @ls -l $@
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ app $(APP10RPATH) $@
+.IF "$(TARGETTYPE)"=="GUI"
+ @echo "Making: " $(@:f).app
+ @macosx-create-bundle $@
+.ENDIF # "$(TARGETTYPE)"=="GUI"
+.ELSE # "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_10.cmd
+ @echo $(APP10LINKER) $(APP10LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP10OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_10.cmd
+ @cat $(mktmp /dev/null $(APP10LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_10.cmd
+ @echo $(APP10LINKTYPEFLAG) $(APP10LIBSALCPPRT) $(APP10STDLIBS) $(APP10STDLIB) $(STDLIB10) -o $@ >> $(MISC)/$(TARGET).$(@:b)_10.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_10.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_10.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+ .ENDIF
+.ENDIF # "$(OS)"=="MACOSX"
+.ENDIF
+.IF "$(GUI)" == "WNT"
+ @@-$(MKDIR) $(@:d:d)
+.IF "$(APP10LINKRES)" != ""
+ @@-$(RM) $(MISC)/$(APP10LINKRES:b).rc
+.IF "$(APP10ICON)" != ""
+ @-echo 1 ICON $(EMQ)"$(APP10ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP10LINKRES:b).rc
+.ENDIF # "$(APP10ICON)" != ""
+.IF "$(APP10VERINFO)" != ""
+ @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP10LINKRES:b).rc
+ @-echo $(EMQ)#include $(EMQ)"$(APP10VERINFO)$(EMQ)" >> $(MISC)/$(APP10LINKRES:b).rc
+.ENDIF # "$(APP10VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(APP10PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP10LINKRES:b).rc
+.ENDIF # "$(APP10LINKRES)" != ""
+.IF "$(COM)" == "GCC"
+ @echo mingw
+.IF "$(APP10LINKRES)" != "" || "$(APP10RES)" != ""
+ @cat $(APP10LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP10RES)) > $(MISC)/$(@:b)_all.res
+ windres $(MISC)/$(@:b)_all.res $(APP10RESO)
+.ENDIF
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP10BASEX) $(APP10STACKN) -o $@ $(APP10OBJS) \
+ -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP10RESO) \
+ `$(TYPE) /dev/null $(APP10LIBS) | sed s#$(ROUT)#$(OUT)#g` \
+ $(APP_LINKTYPE) $(APP10LIBSALCPPRT) \
+ -Wl,--start-group $(APP10STDLIBS) -Wl,--end-group $(APP10STDLIB) \
+ $(STDLIB10) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_10.cmd
+ # need this empty line, else dmake somehow gets confused by the .IFs and .ENDIFs
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_10.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_10.cmd
+ @ls -l $@
+.ELSE # "$(COM)" == "GCC"
+.IF "$(linkinc)" == ""
+ $(COMMAND_ECHO)$(APP10LINKER) @$(mktmp \
+ $(APP10LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP10BASEX) \
+ $(APP10STACKN) \
+ -out:$@ \
+ -map:$(MISC)/{$(subst,/,_ $(APP10TARGET)).map} \
+ $(STDOBJ) \
+ $(APP10LINKRES) \
+ $(APP10RES) \
+ $(APP10OBJS) \
+ $(APP10LIBS) \
+ $(APP10STDLIBS) \
+ $(APP10STDLIB) $(STDLIB10) \
+ )
+ @-echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP10TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP10TARGET).lst
+ $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
+ for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
+ type $(mktmp,$(MISC)\$(APP10TARGET).lst
+ $(APP10LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP10BASEX) \
+ $(APP10STACKN) \
+ -out:$@ \
+ $(STDOBJ) \
+ $(APP10LINKRES) \
+ $(APP10RES) \
+ $(APP10OBJS) \
+ $(APP10LIBS) \
+ $(APP10STDLIBS) \
+ $(APP10STDLIB) $(STDLIB10))
+ $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP10TARGETN:b)_linkobj.lst >> $(MISC)\$(APP10TARGET).lst
+ $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP10TARGET).lst $(THEN) type $(MISC)/$(APP10TARGET).lst >> $(MISC)/$(APP10TARGET).lnk $(FI)
+ $(COMMAND_ECHO)$(SED)$(APP10LINKER) @$(MISC)\$(APP10TARGET).lnk
+.ENDIF # "$(linkinc)" == ""
+.ENDIF # "$(COM)" == "GCC"
+.IF "$(APP10TARGET)" == "loader"
+ $(COMMAND_ECHO)$(PERL) loader.pl $@
+ $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "WNT"
+
+.IF "$(GUI)" == "OS2"
+ @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
+.IF "$(APP10LINKRES)" != ""
+ @+-$(RM) $(MISC)/$(APP10LINKRES:b).rc >& $(NULLDEV)
+.IF "$(APP10ICON)" != ""
+ @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP10ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)/$(APP10LINKRES:b).rc
+.ENDIF # "$(APP10ICON)" != ""
+.IF "$(APP10VERINFO)" != ""
+ @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP10LINKRES:b).rc
+ @-+echo $(EMQ)#include $(EMQ)"$(APP10VERINFO)$(EMQ)" >> $(MISC)/$(APP10LINKRES:b).rc
+.ENDIF # "$(APP10VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(APP10PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP10LINKRES:b).rc
+.ENDIF # "$(APP10LINKRES)" != ""
+
+.IF "$(TARGETTYPE)" == "GUI"
+ @echo NAME $(APP10TARGET) WINDOWAPI > $(MISC)/$(APP10TARGET).def
+.ENDIF
+
+ .IF "$(VERBOSE)" == "TRUE"
+ @+echo $(APP10LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP10BASEX) \
+ $(APP10STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP10LINKRES) \
+ $(APP10RES) \
+ $(APP10DEF) \
+ $(APP10OBJS) \
+ $(APP10LIBS) \
+ $(APP10STDLIBS:^"-l") \
+ $(APP10STDLIB:^"-l") $(STDLIB10:^"-l")
+ .ENDIF
+ $(COMMAND_ECHO)$(APP10LINKER) -v \
+ $(APP10LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP10BASEX) \
+ $(APP10STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP10LINKRES) \
+ $(APP10RES) \
+ $(APP10DEF) \
+ $(APP10OBJS) \
+ $(APP10LIBS) \
+ $(APP10STDLIBS:^"-l") \
+ $(APP10STDLIB:^"-l") $(STDLIB10:^"-l")
+
+
+.IF "$(APP10TARGET)" == "loader"
+ $(COMMAND_ECHO)+$(PERL) loader.pl $@
+ $(COMMAND_ECHO)+$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)+$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(APP10TARGETN)"!=""
+
+
+# Instruction for linking
diff --git a/solenv/inc/_tg_def.mk b/solenv/inc/_tg_def.mk
new file mode 100644
index 000000000000..cf4414ae4e1f
--- /dev/null
+++ b/solenv/inc/_tg_def.mk
@@ -0,0 +1,2810 @@
+# unroll begin
+
+.IF "$(DEF1TARGETN)"!=""
+
+#to make intuitiv naming work
+.IF "$(DEF1LIBNAME)"!=""
+DEFLIB1NAME*=$(DEF1LIBNAME)
+.ENDIF # "$(DEF1LIBNAME)"!=""
+
+.IF "$(DEFLIB1NAME)"!=""
+DEF1DEPN+=$(foreach,i,$(DEFLIB1NAME) $(SLB)/$(i).lib)
+.ENDIF
+
+.IF "$(SHL1VERSIONMAP)"!=""
+.IF "$(DEF1EXPORTFILE)"==""
+.IF "$(GUI)"=="WNT"
+DEF1EXPORTFILE=$(MISC)/$(SHL1VERSIONMAP:b)_$(SHL1TARGET).dxp
+.IF "$(COM)"=="GCC"
+$(DEF1EXPORTFILE) : $(SHL1OBJS) $(SHL1LIBS)
+.ENDIF # .IF "$(COM)"=="GCC"
+
+$(DEF1EXPORTFILE) : $(SHL1VERSIONMAP)
+ $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
+ $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+ $(COMMAND_ECHO)nm -gP $(SHL1OBJS) \
+ `$(TYPE) /dev/null $(foreach,j,$(SHL1LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
+ | $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ $(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
+.ENDIF # .IF "$(COM)"=="GCC"
+
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+DEF1EXPORTFILE=$(MISC)/$(SHL1VERSIONMAP:b)_$(SHL1TARGET).dxp
+$(DEF1EXPORTFILE) : $(SHL1VERSIONMAP)
+ $(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.ENDIF # "$(GUI)"=="OS2"
+
+.ENDIF # "$(DEF1EXPORTFILE)"==""
+.ENDIF # "$(SHL1VERSIONMAP)"!=""
+
+.IF "$(GUI)"=="WNT"
+
+DEF1FILTER=$(SOLARENV)/inc/dummy.flt
+
+RMHACK1:=$(RM)
+
+.IF "$(DEF1CEXP)"!=""
+EXPORT_ALL_SWITCH=-A $(DEF1CEXP)
+.ENDIF
+
+.IF "$(link_always)"==""
+$(DEF1TARGETN) : \
+ $(DEF1DEPN) \
+ $(DEF1EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF1TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(EMQ)"$(SHL1TARGETN:f)$(EMQ)" >$@.tmpfile
+.IF "$(COM)"!="GCC"
+ @echo HEAPSIZE 0 >>$@.tmpfile
+.ENDIF
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo GetVersionInfo >>$@.tmpfile
+.ENDIF
+.IF "$(DEFLIB1NAME)"!=""
+.IF "$(COM)"=="GCC"
+ @-$(RM) $(MISC)/$(SHL1TARGET).exp
+ $(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL1TARGET).exp --export-all-symbols \
+ `$(TYPE) $(foreach,i,$(DEFLIB1NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
+ $(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL1TARGET).exp | sed '/^;/d' >>$@.tmpfile
+ @-$(RM) $(MISC)/$(SHL1TARGET).exp
+.ELSE
+.IF "$(SHL1USE_EXPORTS)"==""
+ @-$(RMHACK1) $(MISC)/$(SHL1TARGET).exp
+ @$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL1TARGET).exp $(SLB)/$(DEFLIB1NAME).lib
+ @$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL1TARGET).flt $(MISC)/$(SHL1TARGET).exp >>$@.tmpfile
+ $(COMMAND_ECHO)$(RMHACK1) $(MISC)/$(SHL1TARGET).exp
+.ELSE # "$(SHL1USE_EXPORTS)"==""
+ @$(DUMPBIN) -DIRECTIVES $(foreach,i,$(DEFLIB1NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL1TARGET).direct
+ @$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF1FILTER) $(MISC)/$(SHL1TARGET).direct >>$@.tmpfile
+.ENDIF # "$(SHL1USE_EXPORTS)"==""
+.ENDIF
+.ENDIF # "$(DEFLIB1NAME)"!=""
+.IF "$(DEF1EXPORT1)"!=""
+ @echo $(DEF1EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT2)"!=""
+ @echo $(DEF1EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT3)"!=""
+ @echo $(DEF1EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT4)"!=""
+ @echo $(DEF1EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT5)"!=""
+ @echo $(DEF1EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT6)"!=""
+ @echo $(DEF1EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT7)"!=""
+ @echo $(DEF1EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT8)"!=""
+ @echo $(DEF1EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT9)"!=""
+ @echo $(DEF1EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT10)"!=""
+ @echo $(DEF1EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT11)"!=""
+ @echo $(DEF1EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT12)"!=""
+ @echo $(DEF1EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT13)"!=""
+ @echo $(DEF1EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT14)"!=""
+ @echo $(DEF1EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT15)"!=""
+ @echo $(DEF1EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT16)"!=""
+ @echo $(DEF1EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT17)"!=""
+ @echo $(DEF1EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT18)"!=""
+ @echo $(DEF1EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT19)"!=""
+ @echo $(DEF1EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT20)"!=""
+ @echo $(DEF1EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORTFILE)"!=""
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(TYPE) $(DEF1EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
+.ELSE
+ $(COMMAND_ECHO)$(TYPE) $(DEF1EXPORTFILE) >> $@.tmpfile
+.ENDIF
+.ENDIF
+ @-$(RM) $@
+ @$(RENAME) $@.tmpfile $@
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL1TARGET8=$(shell @fix_shl $(SHL1TARGETN:f))
+
+DEF1FILTER=$(SOLARENV)/inc/dummy.flt
+DEF1NAMELIST=$(foreach,i,$(DEFLIB1NAME) $(SLB)/$(i).lib)
+
+.IF "$(link_always)"==""
+$(DEF1TARGETN) : \
+ $(DEF1DEPN) \
+ $(DEF1EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF1TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @+-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(SHL1TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile
+ @echo DATA MULTIPLE >>$@.tmpfile
+ @echo DESCRIPTION 'StarView 3.00 $(DEF1DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo _GetVersionInfo >$@.tmp_ord
+.ENDIF
+
+.IF "$(DEFLIB1NAME)"!=""
+ @+echo $(SLB)/$(DEFLIB1NAME).lib
+ @+emxexpr $(DEF1NAMELIST) | fix_exp_file >> $@.tmp_ord
+.ENDIF # "$(DEFLIB1NAME)"!=""
+
+.IF "$(DEF1EXPORT1)"!=""
+ @echo $(DEF1EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT2)"!=""
+ @echo $(DEF1EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT3)"!=""
+ @echo $(DEF1EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT4)"!=""
+ @echo $(DEF1EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT5)"!=""
+ @echo $(DEF1EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT6)"!=""
+ @echo $(DEF1EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT7)"!=""
+ @echo $(DEF1EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT8)"!=""
+ @echo $(DEF1EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT9)"!=""
+ @echo $(DEF1EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT10)"!=""
+ @echo $(DEF1EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT11)"!=""
+ @echo $(DEF1EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT12)"!=""
+ @echo $(DEF1EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT13)"!=""
+ @echo $(DEF1EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT14)"!=""
+ @echo $(DEF1EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT15)"!=""
+ @echo $(DEF1EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT16)"!=""
+ @echo $(DEF1EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT17)"!=""
+ @echo $(DEF1EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT18)"!=""
+ @echo $(DEF1EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT19)"!=""
+ @echo $(DEF1EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORT20)"!=""
+ @echo $(DEF1EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORTFILE)"!=""
+ @fix_def_file < $(DEF1EXPORTFILE) >> $@.tmp_ord
+.ENDIF
+ @sort < $@.tmp_ord | uniq > $@.exptmpfile
+ @fix_def_ord < $@.exptmpfile >> $@.tmpfile
+ @+-$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
+ @+-$(RM) $@.tmp_ord
+ @+-$(RM) $@.exptmpfile
+ $(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(SHL1IMPLIBN:s/.lib/.a/) $@
+ $(COMMAND_ECHO)+emxomf -o $(SHL1IMPLIBN) $(SHL1IMPLIBN:s/.lib/.a/)
+
+.ENDIF # "$(GUI)"=="OS2"
+
+.IF "$(GUI)"=="UNX"
+$(DEF1TARGETN): \
+ $(DEF1DEPN) \
+ $(DEF1EXPORTFILE)
+ @echo just a dummy for UNIX > $@
+.ENDIF
+.ENDIF # "$(DEF1TARGETN)"!=""
+
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(DEF2TARGETN)"!=""
+
+#to make intuitiv naming work
+.IF "$(DEF2LIBNAME)"!=""
+DEFLIB2NAME*=$(DEF2LIBNAME)
+.ENDIF # "$(DEF2LIBNAME)"!=""
+
+.IF "$(DEFLIB2NAME)"!=""
+DEF2DEPN+=$(foreach,i,$(DEFLIB2NAME) $(SLB)/$(i).lib)
+.ENDIF
+
+.IF "$(SHL2VERSIONMAP)"!=""
+.IF "$(DEF2EXPORTFILE)"==""
+.IF "$(GUI)"=="WNT"
+DEF2EXPORTFILE=$(MISC)/$(SHL2VERSIONMAP:b)_$(SHL2TARGET).dxp
+.IF "$(COM)"=="GCC"
+$(DEF2EXPORTFILE) : $(SHL2OBJS) $(SHL2LIBS)
+.ENDIF # .IF "$(COM)"=="GCC"
+
+$(DEF2EXPORTFILE) : $(SHL2VERSIONMAP)
+ $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
+ $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+ $(COMMAND_ECHO)nm -gP $(SHL2OBJS) \
+ `$(TYPE) /dev/null $(foreach,j,$(SHL2LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
+ | $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ $(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
+.ENDIF # .IF "$(COM)"=="GCC"
+
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+DEF2EXPORTFILE=$(MISC)/$(SHL2VERSIONMAP:b)_$(SHL2TARGET).dxp
+$(DEF2EXPORTFILE) : $(SHL2VERSIONMAP)
+ $(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.ENDIF # "$(GUI)"=="OS2"
+
+.ENDIF # "$(DEF2EXPORTFILE)"==""
+.ENDIF # "$(SHL2VERSIONMAP)"!=""
+
+.IF "$(GUI)"=="WNT"
+
+DEF2FILTER=$(SOLARENV)/inc/dummy.flt
+
+RMHACK2:=$(RM)
+
+.IF "$(DEF2CEXP)"!=""
+EXPORT_ALL_SWITCH=-A $(DEF2CEXP)
+.ENDIF
+
+.IF "$(link_always)"==""
+$(DEF2TARGETN) : \
+ $(DEF2DEPN) \
+ $(DEF2EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF2TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(EMQ)"$(SHL2TARGETN:f)$(EMQ)" >$@.tmpfile
+.IF "$(COM)"!="GCC"
+ @echo HEAPSIZE 0 >>$@.tmpfile
+.ENDIF
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo GetVersionInfo >>$@.tmpfile
+.ENDIF
+.IF "$(DEFLIB2NAME)"!=""
+.IF "$(COM)"=="GCC"
+ @-$(RM) $(MISC)/$(SHL2TARGET).exp
+ $(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL2TARGET).exp --export-all-symbols \
+ `$(TYPE) $(foreach,i,$(DEFLIB2NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
+ $(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL2TARGET).exp | sed '/^;/d' >>$@.tmpfile
+ @-$(RM) $(MISC)/$(SHL2TARGET).exp
+.ELSE
+.IF "$(SHL2USE_EXPORTS)"==""
+ @-$(RMHACK2) $(MISC)/$(SHL2TARGET).exp
+ @$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL2TARGET).exp $(SLB)/$(DEFLIB2NAME).lib
+ @$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL2TARGET).flt $(MISC)/$(SHL2TARGET).exp >>$@.tmpfile
+ $(COMMAND_ECHO)$(RMHACK2) $(MISC)/$(SHL2TARGET).exp
+.ELSE # "$(SHL2USE_EXPORTS)"==""
+ @$(DUMPBIN) -DIRECTIVES $(foreach,i,$(DEFLIB2NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL2TARGET).direct
+ @$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF2FILTER) $(MISC)/$(SHL2TARGET).direct >>$@.tmpfile
+.ENDIF # "$(SHL2USE_EXPORTS)"==""
+.ENDIF
+.ENDIF # "$(DEFLIB2NAME)"!=""
+.IF "$(DEF2EXPORT1)"!=""
+ @echo $(DEF2EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT2)"!=""
+ @echo $(DEF2EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT3)"!=""
+ @echo $(DEF2EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT4)"!=""
+ @echo $(DEF2EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT5)"!=""
+ @echo $(DEF2EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT6)"!=""
+ @echo $(DEF2EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT7)"!=""
+ @echo $(DEF2EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT8)"!=""
+ @echo $(DEF2EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT9)"!=""
+ @echo $(DEF2EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT10)"!=""
+ @echo $(DEF2EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT11)"!=""
+ @echo $(DEF2EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT12)"!=""
+ @echo $(DEF2EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT13)"!=""
+ @echo $(DEF2EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT14)"!=""
+ @echo $(DEF2EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT15)"!=""
+ @echo $(DEF2EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT16)"!=""
+ @echo $(DEF2EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT17)"!=""
+ @echo $(DEF2EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT18)"!=""
+ @echo $(DEF2EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT19)"!=""
+ @echo $(DEF2EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT20)"!=""
+ @echo $(DEF2EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORTFILE)"!=""
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(TYPE) $(DEF2EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
+.ELSE
+ $(COMMAND_ECHO)$(TYPE) $(DEF2EXPORTFILE) >> $@.tmpfile
+.ENDIF
+.ENDIF
+ @-$(RM) $@
+ @$(RENAME) $@.tmpfile $@
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL2TARGET8=$(shell @fix_shl $(SHL2TARGETN:f))
+
+DEF2FILTER=$(SOLARENV)/inc/dummy.flt
+DEF2NAMELIST=$(foreach,i,$(DEFLIB2NAME) $(SLB)/$(i).lib)
+
+.IF "$(link_always)"==""
+$(DEF2TARGETN) : \
+ $(DEF2DEPN) \
+ $(DEF2EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF2TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @+-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(SHL2TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile
+ @echo DATA MULTIPLE >>$@.tmpfile
+ @echo DESCRIPTION 'StarView 3.00 $(DEF2DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo _GetVersionInfo >$@.tmp_ord
+.ENDIF
+
+.IF "$(DEFLIB2NAME)"!=""
+ @+echo $(SLB)/$(DEFLIB2NAME).lib
+ @+emxexpr $(DEF2NAMELIST) | fix_exp_file >> $@.tmp_ord
+.ENDIF # "$(DEFLIB2NAME)"!=""
+
+.IF "$(DEF2EXPORT1)"!=""
+ @echo $(DEF2EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT2)"!=""
+ @echo $(DEF2EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT3)"!=""
+ @echo $(DEF2EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT4)"!=""
+ @echo $(DEF2EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT5)"!=""
+ @echo $(DEF2EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT6)"!=""
+ @echo $(DEF2EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT7)"!=""
+ @echo $(DEF2EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT8)"!=""
+ @echo $(DEF2EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT9)"!=""
+ @echo $(DEF2EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT10)"!=""
+ @echo $(DEF2EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT11)"!=""
+ @echo $(DEF2EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT12)"!=""
+ @echo $(DEF2EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT13)"!=""
+ @echo $(DEF2EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT14)"!=""
+ @echo $(DEF2EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT15)"!=""
+ @echo $(DEF2EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT16)"!=""
+ @echo $(DEF2EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT17)"!=""
+ @echo $(DEF2EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT18)"!=""
+ @echo $(DEF2EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT19)"!=""
+ @echo $(DEF2EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORT20)"!=""
+ @echo $(DEF2EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORTFILE)"!=""
+ @fix_def_file < $(DEF2EXPORTFILE) >> $@.tmp_ord
+.ENDIF
+ @sort < $@.tmp_ord | uniq > $@.exptmpfile
+ @fix_def_ord < $@.exptmpfile >> $@.tmpfile
+ @+-$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
+ @+-$(RM) $@.tmp_ord
+ @+-$(RM) $@.exptmpfile
+ $(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(SHL2IMPLIBN:s/.lib/.a/) $@
+ $(COMMAND_ECHO)+emxomf -o $(SHL2IMPLIBN) $(SHL2IMPLIBN:s/.lib/.a/)
+
+.ENDIF # "$(GUI)"=="OS2"
+
+.IF "$(GUI)"=="UNX"
+$(DEF2TARGETN): \
+ $(DEF2DEPN) \
+ $(DEF2EXPORTFILE)
+ @echo just a dummy for UNIX > $@
+.ENDIF
+.ENDIF # "$(DEF2TARGETN)"!=""
+
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(DEF3TARGETN)"!=""
+
+#to make intuitiv naming work
+.IF "$(DEF3LIBNAME)"!=""
+DEFLIB3NAME*=$(DEF3LIBNAME)
+.ENDIF # "$(DEF3LIBNAME)"!=""
+
+.IF "$(DEFLIB3NAME)"!=""
+DEF3DEPN+=$(foreach,i,$(DEFLIB3NAME) $(SLB)/$(i).lib)
+.ENDIF
+
+.IF "$(SHL3VERSIONMAP)"!=""
+.IF "$(DEF3EXPORTFILE)"==""
+.IF "$(GUI)"=="WNT"
+DEF3EXPORTFILE=$(MISC)/$(SHL3VERSIONMAP:b)_$(SHL3TARGET).dxp
+.IF "$(COM)"=="GCC"
+$(DEF3EXPORTFILE) : $(SHL3OBJS) $(SHL3LIBS)
+.ENDIF # .IF "$(COM)"=="GCC"
+
+$(DEF3EXPORTFILE) : $(SHL3VERSIONMAP)
+ $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
+ $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+ $(COMMAND_ECHO)nm -gP $(SHL3OBJS) \
+ `$(TYPE) /dev/null $(foreach,j,$(SHL3LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
+ | $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ $(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
+.ENDIF # .IF "$(COM)"=="GCC"
+
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+DEF3EXPORTFILE=$(MISC)/$(SHL3VERSIONMAP:b)_$(SHL3TARGET).dxp
+$(DEF3EXPORTFILE) : $(SHL3VERSIONMAP)
+ $(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.ENDIF # "$(GUI)"=="OS2"
+
+.ENDIF # "$(DEF3EXPORTFILE)"==""
+.ENDIF # "$(SHL3VERSIONMAP)"!=""
+
+.IF "$(GUI)"=="WNT"
+
+DEF3FILTER=$(SOLARENV)/inc/dummy.flt
+
+RMHACK3:=$(RM)
+
+.IF "$(DEF3CEXP)"!=""
+EXPORT_ALL_SWITCH=-A $(DEF3CEXP)
+.ENDIF
+
+.IF "$(link_always)"==""
+$(DEF3TARGETN) : \
+ $(DEF3DEPN) \
+ $(DEF3EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF3TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(EMQ)"$(SHL3TARGETN:f)$(EMQ)" >$@.tmpfile
+.IF "$(COM)"!="GCC"
+ @echo HEAPSIZE 0 >>$@.tmpfile
+.ENDIF
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo GetVersionInfo >>$@.tmpfile
+.ENDIF
+.IF "$(DEFLIB3NAME)"!=""
+.IF "$(COM)"=="GCC"
+ @-$(RM) $(MISC)/$(SHL3TARGET).exp
+ $(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL3TARGET).exp --export-all-symbols \
+ `$(TYPE) $(foreach,i,$(DEFLIB3NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
+ $(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL3TARGET).exp | sed '/^;/d' >>$@.tmpfile
+ @-$(RM) $(MISC)/$(SHL3TARGET).exp
+.ELSE
+.IF "$(SHL3USE_EXPORTS)"==""
+ @-$(RMHACK3) $(MISC)/$(SHL3TARGET).exp
+ @$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL3TARGET).exp $(SLB)/$(DEFLIB3NAME).lib
+ @$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL3TARGET).flt $(MISC)/$(SHL3TARGET).exp >>$@.tmpfile
+ $(COMMAND_ECHO)$(RMHACK3) $(MISC)/$(SHL3TARGET).exp
+.ELSE # "$(SHL3USE_EXPORTS)"==""
+ @$(DUMPBIN) -DIRECTIVES $(foreach,i,$(DEFLIB3NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL3TARGET).direct
+ @$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF3FILTER) $(MISC)/$(SHL3TARGET).direct >>$@.tmpfile
+.ENDIF # "$(SHL3USE_EXPORTS)"==""
+.ENDIF
+.ENDIF # "$(DEFLIB3NAME)"!=""
+.IF "$(DEF3EXPORT1)"!=""
+ @echo $(DEF3EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT2)"!=""
+ @echo $(DEF3EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT3)"!=""
+ @echo $(DEF3EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT4)"!=""
+ @echo $(DEF3EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT5)"!=""
+ @echo $(DEF3EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT6)"!=""
+ @echo $(DEF3EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT7)"!=""
+ @echo $(DEF3EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT8)"!=""
+ @echo $(DEF3EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT9)"!=""
+ @echo $(DEF3EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT10)"!=""
+ @echo $(DEF3EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT11)"!=""
+ @echo $(DEF3EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT12)"!=""
+ @echo $(DEF3EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT13)"!=""
+ @echo $(DEF3EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT14)"!=""
+ @echo $(DEF3EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT15)"!=""
+ @echo $(DEF3EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT16)"!=""
+ @echo $(DEF3EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT17)"!=""
+ @echo $(DEF3EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT18)"!=""
+ @echo $(DEF3EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT19)"!=""
+ @echo $(DEF3EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT20)"!=""
+ @echo $(DEF3EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORTFILE)"!=""
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(TYPE) $(DEF3EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
+.ELSE
+ $(COMMAND_ECHO)$(TYPE) $(DEF3EXPORTFILE) >> $@.tmpfile
+.ENDIF
+.ENDIF
+ @-$(RM) $@
+ @$(RENAME) $@.tmpfile $@
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL3TARGET8=$(shell @fix_shl $(SHL3TARGETN:f))
+
+DEF3FILTER=$(SOLARENV)/inc/dummy.flt
+DEF3NAMELIST=$(foreach,i,$(DEFLIB3NAME) $(SLB)/$(i).lib)
+
+.IF "$(link_always)"==""
+$(DEF3TARGETN) : \
+ $(DEF3DEPN) \
+ $(DEF3EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF3TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @+-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(SHL3TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile
+ @echo DATA MULTIPLE >>$@.tmpfile
+ @echo DESCRIPTION 'StarView 3.00 $(DEF3DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo _GetVersionInfo >$@.tmp_ord
+.ENDIF
+
+.IF "$(DEFLIB3NAME)"!=""
+ @+echo $(SLB)/$(DEFLIB3NAME).lib
+ @+emxexpr $(DEF3NAMELIST) | fix_exp_file >> $@.tmp_ord
+.ENDIF # "$(DEFLIB3NAME)"!=""
+
+.IF "$(DEF3EXPORT1)"!=""
+ @echo $(DEF3EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT2)"!=""
+ @echo $(DEF3EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT3)"!=""
+ @echo $(DEF3EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT4)"!=""
+ @echo $(DEF3EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT5)"!=""
+ @echo $(DEF3EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT6)"!=""
+ @echo $(DEF3EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT7)"!=""
+ @echo $(DEF3EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT8)"!=""
+ @echo $(DEF3EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT9)"!=""
+ @echo $(DEF3EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT10)"!=""
+ @echo $(DEF3EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT11)"!=""
+ @echo $(DEF3EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT12)"!=""
+ @echo $(DEF3EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT13)"!=""
+ @echo $(DEF3EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT14)"!=""
+ @echo $(DEF3EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT15)"!=""
+ @echo $(DEF3EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT16)"!=""
+ @echo $(DEF3EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT17)"!=""
+ @echo $(DEF3EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT18)"!=""
+ @echo $(DEF3EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT19)"!=""
+ @echo $(DEF3EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORT20)"!=""
+ @echo $(DEF3EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF3EXPORTFILE)"!=""
+ @fix_def_file < $(DEF3EXPORTFILE) >> $@.tmp_ord
+.ENDIF
+ @sort < $@.tmp_ord | uniq > $@.exptmpfile
+ @fix_def_ord < $@.exptmpfile >> $@.tmpfile
+ @+-$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
+ @+-$(RM) $@.tmp_ord
+ @+-$(RM) $@.exptmpfile
+ $(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(SHL3IMPLIBN:s/.lib/.a/) $@
+ $(COMMAND_ECHO)+emxomf -o $(SHL3IMPLIBN) $(SHL3IMPLIBN:s/.lib/.a/)
+
+.ENDIF # "$(GUI)"=="OS2"
+
+.IF "$(GUI)"=="UNX"
+$(DEF3TARGETN): \
+ $(DEF3DEPN) \
+ $(DEF3EXPORTFILE)
+ @echo just a dummy for UNIX > $@
+.ENDIF
+.ENDIF # "$(DEF3TARGETN)"!=""
+
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(DEF4TARGETN)"!=""
+
+#to make intuitiv naming work
+.IF "$(DEF4LIBNAME)"!=""
+DEFLIB4NAME*=$(DEF4LIBNAME)
+.ENDIF # "$(DEF4LIBNAME)"!=""
+
+.IF "$(DEFLIB4NAME)"!=""
+DEF4DEPN+=$(foreach,i,$(DEFLIB4NAME) $(SLB)/$(i).lib)
+.ENDIF
+
+.IF "$(SHL4VERSIONMAP)"!=""
+.IF "$(DEF4EXPORTFILE)"==""
+.IF "$(GUI)"=="WNT"
+DEF4EXPORTFILE=$(MISC)/$(SHL4VERSIONMAP:b)_$(SHL4TARGET).dxp
+.IF "$(COM)"=="GCC"
+$(DEF4EXPORTFILE) : $(SHL4OBJS) $(SHL4LIBS)
+.ENDIF # .IF "$(COM)"=="GCC"
+
+$(DEF4EXPORTFILE) : $(SHL4VERSIONMAP)
+ $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
+ $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+ $(COMMAND_ECHO)nm -gP $(SHL4OBJS) \
+ `$(TYPE) /dev/null $(foreach,j,$(SHL4LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
+ | $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ $(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
+.ENDIF # .IF "$(COM)"=="GCC"
+
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+DEF4EXPORTFILE=$(MISC)/$(SHL4VERSIONMAP:b)_$(SHL4TARGET).dxp
+$(DEF4EXPORTFILE) : $(SHL4VERSIONMAP)
+ $(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.ENDIF # "$(GUI)"=="OS2"
+
+.ENDIF # "$(DEF4EXPORTFILE)"==""
+.ENDIF # "$(SHL4VERSIONMAP)"!=""
+
+.IF "$(GUI)"=="WNT"
+
+DEF4FILTER=$(SOLARENV)/inc/dummy.flt
+
+RMHACK4:=$(RM)
+
+.IF "$(DEF4CEXP)"!=""
+EXPORT_ALL_SWITCH=-A $(DEF4CEXP)
+.ENDIF
+
+.IF "$(link_always)"==""
+$(DEF4TARGETN) : \
+ $(DEF4DEPN) \
+ $(DEF4EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF4TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(EMQ)"$(SHL4TARGETN:f)$(EMQ)" >$@.tmpfile
+.IF "$(COM)"!="GCC"
+ @echo HEAPSIZE 0 >>$@.tmpfile
+.ENDIF
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo GetVersionInfo >>$@.tmpfile
+.ENDIF
+.IF "$(DEFLIB4NAME)"!=""
+.IF "$(COM)"=="GCC"
+ @-$(RM) $(MISC)/$(SHL4TARGET).exp
+ $(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL4TARGET).exp --export-all-symbols \
+ `$(TYPE) $(foreach,i,$(DEFLIB4NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
+ $(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL4TARGET).exp | sed '/^;/d' >>$@.tmpfile
+ @-$(RM) $(MISC)/$(SHL4TARGET).exp
+.ELSE
+.IF "$(SHL4USE_EXPORTS)"==""
+ @-$(RMHACK4) $(MISC)/$(SHL4TARGET).exp
+ @$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL4TARGET).exp $(SLB)/$(DEFLIB4NAME).lib
+ @$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL4TARGET).flt $(MISC)/$(SHL4TARGET).exp >>$@.tmpfile
+ $(COMMAND_ECHO)$(RMHACK4) $(MISC)/$(SHL4TARGET).exp
+.ELSE # "$(SHL4USE_EXPORTS)"==""
+ @$(DUMPBIN) -DIRECTIVES $(foreach,i,$(DEFLIB4NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL4TARGET).direct
+ @$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF4FILTER) $(MISC)/$(SHL4TARGET).direct >>$@.tmpfile
+.ENDIF # "$(SHL4USE_EXPORTS)"==""
+.ENDIF
+.ENDIF # "$(DEFLIB4NAME)"!=""
+.IF "$(DEF4EXPORT1)"!=""
+ @echo $(DEF4EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT2)"!=""
+ @echo $(DEF4EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT3)"!=""
+ @echo $(DEF4EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT4)"!=""
+ @echo $(DEF4EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT5)"!=""
+ @echo $(DEF4EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT6)"!=""
+ @echo $(DEF4EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT7)"!=""
+ @echo $(DEF4EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT8)"!=""
+ @echo $(DEF4EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT9)"!=""
+ @echo $(DEF4EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT10)"!=""
+ @echo $(DEF4EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT11)"!=""
+ @echo $(DEF4EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT12)"!=""
+ @echo $(DEF4EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT13)"!=""
+ @echo $(DEF4EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT14)"!=""
+ @echo $(DEF4EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT15)"!=""
+ @echo $(DEF4EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT16)"!=""
+ @echo $(DEF4EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT17)"!=""
+ @echo $(DEF4EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT18)"!=""
+ @echo $(DEF4EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT19)"!=""
+ @echo $(DEF4EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT20)"!=""
+ @echo $(DEF4EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORTFILE)"!=""
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(TYPE) $(DEF4EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
+.ELSE
+ $(COMMAND_ECHO)$(TYPE) $(DEF4EXPORTFILE) >> $@.tmpfile
+.ENDIF
+.ENDIF
+ @-$(RM) $@
+ @$(RENAME) $@.tmpfile $@
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL4TARGET8=$(shell @fix_shl $(SHL4TARGETN:f))
+
+DEF4FILTER=$(SOLARENV)/inc/dummy.flt
+DEF4NAMELIST=$(foreach,i,$(DEFLIB4NAME) $(SLB)/$(i).lib)
+
+.IF "$(link_always)"==""
+$(DEF4TARGETN) : \
+ $(DEF4DEPN) \
+ $(DEF4EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF4TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @+-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(SHL4TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile
+ @echo DATA MULTIPLE >>$@.tmpfile
+ @echo DESCRIPTION 'StarView 3.00 $(DEF4DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo _GetVersionInfo >$@.tmp_ord
+.ENDIF
+
+.IF "$(DEFLIB4NAME)"!=""
+ @+echo $(SLB)/$(DEFLIB4NAME).lib
+ @+emxexpr $(DEF4NAMELIST) | fix_exp_file >> $@.tmp_ord
+.ENDIF # "$(DEFLIB4NAME)"!=""
+
+.IF "$(DEF4EXPORT1)"!=""
+ @echo $(DEF4EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT2)"!=""
+ @echo $(DEF4EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT3)"!=""
+ @echo $(DEF4EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT4)"!=""
+ @echo $(DEF4EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT5)"!=""
+ @echo $(DEF4EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT6)"!=""
+ @echo $(DEF4EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT7)"!=""
+ @echo $(DEF4EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT8)"!=""
+ @echo $(DEF4EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT9)"!=""
+ @echo $(DEF4EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT10)"!=""
+ @echo $(DEF4EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT11)"!=""
+ @echo $(DEF4EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT12)"!=""
+ @echo $(DEF4EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT13)"!=""
+ @echo $(DEF4EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT14)"!=""
+ @echo $(DEF4EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT15)"!=""
+ @echo $(DEF4EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT16)"!=""
+ @echo $(DEF4EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT17)"!=""
+ @echo $(DEF4EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT18)"!=""
+ @echo $(DEF4EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT19)"!=""
+ @echo $(DEF4EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORT20)"!=""
+ @echo $(DEF4EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF4EXPORTFILE)"!=""
+ @fix_def_file < $(DEF4EXPORTFILE) >> $@.tmp_ord
+.ENDIF
+ @sort < $@.tmp_ord | uniq > $@.exptmpfile
+ @fix_def_ord < $@.exptmpfile >> $@.tmpfile
+ @+-$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
+ @+-$(RM) $@.tmp_ord
+ @+-$(RM) $@.exptmpfile
+ $(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(SHL4IMPLIBN:s/.lib/.a/) $@
+ $(COMMAND_ECHO)+emxomf -o $(SHL4IMPLIBN) $(SHL4IMPLIBN:s/.lib/.a/)
+
+.ENDIF # "$(GUI)"=="OS2"
+
+.IF "$(GUI)"=="UNX"
+$(DEF4TARGETN): \
+ $(DEF4DEPN) \
+ $(DEF4EXPORTFILE)
+ @echo just a dummy for UNIX > $@
+.ENDIF
+.ENDIF # "$(DEF4TARGETN)"!=""
+
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(DEF5TARGETN)"!=""
+
+#to make intuitiv naming work
+.IF "$(DEF5LIBNAME)"!=""
+DEFLIB5NAME*=$(DEF5LIBNAME)
+.ENDIF # "$(DEF5LIBNAME)"!=""
+
+.IF "$(DEFLIB5NAME)"!=""
+DEF5DEPN+=$(foreach,i,$(DEFLIB5NAME) $(SLB)/$(i).lib)
+.ENDIF
+
+.IF "$(SHL5VERSIONMAP)"!=""
+.IF "$(DEF5EXPORTFILE)"==""
+.IF "$(GUI)"=="WNT"
+DEF5EXPORTFILE=$(MISC)/$(SHL5VERSIONMAP:b)_$(SHL5TARGET).dxp
+.IF "$(COM)"=="GCC"
+$(DEF5EXPORTFILE) : $(SHL5OBJS) $(SHL5LIBS)
+.ENDIF # .IF "$(COM)"=="GCC"
+
+$(DEF5EXPORTFILE) : $(SHL5VERSIONMAP)
+ $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
+ $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+ $(COMMAND_ECHO)nm -gP $(SHL5OBJS) \
+ `$(TYPE) /dev/null $(foreach,j,$(SHL5LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
+ | $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ $(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
+.ENDIF # .IF "$(COM)"=="GCC"
+
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+DEF5EXPORTFILE=$(MISC)/$(SHL5VERSIONMAP:b)_$(SHL5TARGET).dxp
+$(DEF5EXPORTFILE) : $(SHL5VERSIONMAP)
+ $(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.ENDIF # "$(GUI)"=="OS2"
+
+.ENDIF # "$(DEF5EXPORTFILE)"==""
+.ENDIF # "$(SHL5VERSIONMAP)"!=""
+
+.IF "$(GUI)"=="WNT"
+
+DEF5FILTER=$(SOLARENV)/inc/dummy.flt
+
+RMHACK5:=$(RM)
+
+.IF "$(DEF5CEXP)"!=""
+EXPORT_ALL_SWITCH=-A $(DEF5CEXP)
+.ENDIF
+
+.IF "$(link_always)"==""
+$(DEF5TARGETN) : \
+ $(DEF5DEPN) \
+ $(DEF5EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF5TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(EMQ)"$(SHL5TARGETN:f)$(EMQ)" >$@.tmpfile
+.IF "$(COM)"!="GCC"
+ @echo HEAPSIZE 0 >>$@.tmpfile
+.ENDIF
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo GetVersionInfo >>$@.tmpfile
+.ENDIF
+.IF "$(DEFLIB5NAME)"!=""
+.IF "$(COM)"=="GCC"
+ @-$(RM) $(MISC)/$(SHL5TARGET).exp
+ $(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL5TARGET).exp --export-all-symbols \
+ `$(TYPE) $(foreach,i,$(DEFLIB5NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
+ $(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL5TARGET).exp | sed '/^;/d' >>$@.tmpfile
+ @-$(RM) $(MISC)/$(SHL5TARGET).exp
+.ELSE
+.IF "$(SHL5USE_EXPORTS)"==""
+ @-$(RMHACK5) $(MISC)/$(SHL5TARGET).exp
+ @$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL5TARGET).exp $(SLB)/$(DEFLIB5NAME).lib
+ @$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL5TARGET).flt $(MISC)/$(SHL5TARGET).exp >>$@.tmpfile
+ $(COMMAND_ECHO)$(RMHACK5) $(MISC)/$(SHL5TARGET).exp
+.ELSE # "$(SHL5USE_EXPORTS)"==""
+ @$(DUMPBIN) -DIRECTIVES $(foreach,i,$(DEFLIB5NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL5TARGET).direct
+ @$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF5FILTER) $(MISC)/$(SHL5TARGET).direct >>$@.tmpfile
+.ENDIF # "$(SHL5USE_EXPORTS)"==""
+.ENDIF
+.ENDIF # "$(DEFLIB5NAME)"!=""
+.IF "$(DEF5EXPORT1)"!=""
+ @echo $(DEF5EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT2)"!=""
+ @echo $(DEF5EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT3)"!=""
+ @echo $(DEF5EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT4)"!=""
+ @echo $(DEF5EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT5)"!=""
+ @echo $(DEF5EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT6)"!=""
+ @echo $(DEF5EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT7)"!=""
+ @echo $(DEF5EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT8)"!=""
+ @echo $(DEF5EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT9)"!=""
+ @echo $(DEF5EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT10)"!=""
+ @echo $(DEF5EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT11)"!=""
+ @echo $(DEF5EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT12)"!=""
+ @echo $(DEF5EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT13)"!=""
+ @echo $(DEF5EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT14)"!=""
+ @echo $(DEF5EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT15)"!=""
+ @echo $(DEF5EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT16)"!=""
+ @echo $(DEF5EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT17)"!=""
+ @echo $(DEF5EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT18)"!=""
+ @echo $(DEF5EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT19)"!=""
+ @echo $(DEF5EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT20)"!=""
+ @echo $(DEF5EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORTFILE)"!=""
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(TYPE) $(DEF5EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
+.ELSE
+ $(COMMAND_ECHO)$(TYPE) $(DEF5EXPORTFILE) >> $@.tmpfile
+.ENDIF
+.ENDIF
+ @-$(RM) $@
+ @$(RENAME) $@.tmpfile $@
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL5TARGET8=$(shell @fix_shl $(SHL5TARGETN:f))
+
+DEF5FILTER=$(SOLARENV)/inc/dummy.flt
+DEF5NAMELIST=$(foreach,i,$(DEFLIB5NAME) $(SLB)/$(i).lib)
+
+.IF "$(link_always)"==""
+$(DEF5TARGETN) : \
+ $(DEF5DEPN) \
+ $(DEF5EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF5TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @+-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(SHL5TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile
+ @echo DATA MULTIPLE >>$@.tmpfile
+ @echo DESCRIPTION 'StarView 3.00 $(DEF5DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo _GetVersionInfo >$@.tmp_ord
+.ENDIF
+
+.IF "$(DEFLIB5NAME)"!=""
+ @+echo $(SLB)/$(DEFLIB5NAME).lib
+ @+emxexpr $(DEF5NAMELIST) | fix_exp_file >> $@.tmp_ord
+.ENDIF # "$(DEFLIB5NAME)"!=""
+
+.IF "$(DEF5EXPORT1)"!=""
+ @echo $(DEF5EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT2)"!=""
+ @echo $(DEF5EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT3)"!=""
+ @echo $(DEF5EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT4)"!=""
+ @echo $(DEF5EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT5)"!=""
+ @echo $(DEF5EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT6)"!=""
+ @echo $(DEF5EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT7)"!=""
+ @echo $(DEF5EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT8)"!=""
+ @echo $(DEF5EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT9)"!=""
+ @echo $(DEF5EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT10)"!=""
+ @echo $(DEF5EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT11)"!=""
+ @echo $(DEF5EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT12)"!=""
+ @echo $(DEF5EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT13)"!=""
+ @echo $(DEF5EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT14)"!=""
+ @echo $(DEF5EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT15)"!=""
+ @echo $(DEF5EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT16)"!=""
+ @echo $(DEF5EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT17)"!=""
+ @echo $(DEF5EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT18)"!=""
+ @echo $(DEF5EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT19)"!=""
+ @echo $(DEF5EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORT20)"!=""
+ @echo $(DEF5EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF5EXPORTFILE)"!=""
+ @fix_def_file < $(DEF5EXPORTFILE) >> $@.tmp_ord
+.ENDIF
+ @sort < $@.tmp_ord | uniq > $@.exptmpfile
+ @fix_def_ord < $@.exptmpfile >> $@.tmpfile
+ @+-$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
+ @+-$(RM) $@.tmp_ord
+ @+-$(RM) $@.exptmpfile
+ $(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(SHL5IMPLIBN:s/.lib/.a/) $@
+ $(COMMAND_ECHO)+emxomf -o $(SHL5IMPLIBN) $(SHL5IMPLIBN:s/.lib/.a/)
+
+.ENDIF # "$(GUI)"=="OS2"
+
+.IF "$(GUI)"=="UNX"
+$(DEF5TARGETN): \
+ $(DEF5DEPN) \
+ $(DEF5EXPORTFILE)
+ @echo just a dummy for UNIX > $@
+.ENDIF
+.ENDIF # "$(DEF5TARGETN)"!=""
+
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(DEF6TARGETN)"!=""
+
+#to make intuitiv naming work
+.IF "$(DEF6LIBNAME)"!=""
+DEFLIB6NAME*=$(DEF6LIBNAME)
+.ENDIF # "$(DEF6LIBNAME)"!=""
+
+.IF "$(DEFLIB6NAME)"!=""
+DEF6DEPN+=$(foreach,i,$(DEFLIB6NAME) $(SLB)/$(i).lib)
+.ENDIF
+
+.IF "$(SHL6VERSIONMAP)"!=""
+.IF "$(DEF6EXPORTFILE)"==""
+.IF "$(GUI)"=="WNT"
+DEF6EXPORTFILE=$(MISC)/$(SHL6VERSIONMAP:b)_$(SHL6TARGET).dxp
+.IF "$(COM)"=="GCC"
+$(DEF6EXPORTFILE) : $(SHL6OBJS) $(SHL6LIBS)
+.ENDIF # .IF "$(COM)"=="GCC"
+
+$(DEF6EXPORTFILE) : $(SHL6VERSIONMAP)
+ $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
+ $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+ $(COMMAND_ECHO)nm -gP $(SHL6OBJS) \
+ `$(TYPE) /dev/null $(foreach,j,$(SHL6LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
+ | $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ $(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
+.ENDIF # .IF "$(COM)"=="GCC"
+
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+DEF6EXPORTFILE=$(MISC)/$(SHL6VERSIONMAP:b)_$(SHL6TARGET).dxp
+$(DEF6EXPORTFILE) : $(SHL6VERSIONMAP)
+ $(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.ENDIF # "$(GUI)"=="OS2"
+
+.ENDIF # "$(DEF6EXPORTFILE)"==""
+.ENDIF # "$(SHL6VERSIONMAP)"!=""
+
+.IF "$(GUI)"=="WNT"
+
+DEF6FILTER=$(SOLARENV)/inc/dummy.flt
+
+RMHACK6:=$(RM)
+
+.IF "$(DEF6CEXP)"!=""
+EXPORT_ALL_SWITCH=-A $(DEF6CEXP)
+.ENDIF
+
+.IF "$(link_always)"==""
+$(DEF6TARGETN) : \
+ $(DEF6DEPN) \
+ $(DEF6EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF6TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(EMQ)"$(SHL6TARGETN:f)$(EMQ)" >$@.tmpfile
+.IF "$(COM)"!="GCC"
+ @echo HEAPSIZE 0 >>$@.tmpfile
+.ENDIF
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo GetVersionInfo >>$@.tmpfile
+.ENDIF
+.IF "$(DEFLIB6NAME)"!=""
+.IF "$(COM)"=="GCC"
+ @-$(RM) $(MISC)/$(SHL6TARGET).exp
+ $(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL6TARGET).exp --export-all-symbols \
+ `$(TYPE) $(foreach,i,$(DEFLIB6NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
+ $(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL6TARGET).exp | sed '/^;/d' >>$@.tmpfile
+ @-$(RM) $(MISC)/$(SHL6TARGET).exp
+.ELSE
+.IF "$(SHL6USE_EXPORTS)"==""
+ @-$(RMHACK6) $(MISC)/$(SHL6TARGET).exp
+ @$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL6TARGET).exp $(SLB)/$(DEFLIB6NAME).lib
+ @$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL6TARGET).flt $(MISC)/$(SHL6TARGET).exp >>$@.tmpfile
+ $(COMMAND_ECHO)$(RMHACK6) $(MISC)/$(SHL6TARGET).exp
+.ELSE # "$(SHL6USE_EXPORTS)"==""
+ @$(DUMPBIN) -DIRECTIVES $(foreach,i,$(DEFLIB6NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL6TARGET).direct
+ @$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF6FILTER) $(MISC)/$(SHL6TARGET).direct >>$@.tmpfile
+.ENDIF # "$(SHL6USE_EXPORTS)"==""
+.ENDIF
+.ENDIF # "$(DEFLIB6NAME)"!=""
+.IF "$(DEF6EXPORT1)"!=""
+ @echo $(DEF6EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT2)"!=""
+ @echo $(DEF6EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT3)"!=""
+ @echo $(DEF6EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT4)"!=""
+ @echo $(DEF6EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT5)"!=""
+ @echo $(DEF6EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT6)"!=""
+ @echo $(DEF6EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT7)"!=""
+ @echo $(DEF6EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT8)"!=""
+ @echo $(DEF6EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT9)"!=""
+ @echo $(DEF6EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT10)"!=""
+ @echo $(DEF6EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT11)"!=""
+ @echo $(DEF6EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT12)"!=""
+ @echo $(DEF6EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT13)"!=""
+ @echo $(DEF6EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT14)"!=""
+ @echo $(DEF6EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT15)"!=""
+ @echo $(DEF6EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT16)"!=""
+ @echo $(DEF6EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT17)"!=""
+ @echo $(DEF6EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT18)"!=""
+ @echo $(DEF6EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT19)"!=""
+ @echo $(DEF6EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT20)"!=""
+ @echo $(DEF6EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORTFILE)"!=""
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(TYPE) $(DEF6EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
+.ELSE
+ $(COMMAND_ECHO)$(TYPE) $(DEF6EXPORTFILE) >> $@.tmpfile
+.ENDIF
+.ENDIF
+ @-$(RM) $@
+ @$(RENAME) $@.tmpfile $@
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL6TARGET8=$(shell @fix_shl $(SHL6TARGETN:f))
+
+DEF6FILTER=$(SOLARENV)/inc/dummy.flt
+DEF6NAMELIST=$(foreach,i,$(DEFLIB6NAME) $(SLB)/$(i).lib)
+
+.IF "$(link_always)"==""
+$(DEF6TARGETN) : \
+ $(DEF6DEPN) \
+ $(DEF6EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF6TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @+-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(SHL6TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile
+ @echo DATA MULTIPLE >>$@.tmpfile
+ @echo DESCRIPTION 'StarView 3.00 $(DEF6DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo _GetVersionInfo >$@.tmp_ord
+.ENDIF
+
+.IF "$(DEFLIB6NAME)"!=""
+ @+echo $(SLB)/$(DEFLIB6NAME).lib
+ @+emxexpr $(DEF6NAMELIST) | fix_exp_file >> $@.tmp_ord
+.ENDIF # "$(DEFLIB6NAME)"!=""
+
+.IF "$(DEF6EXPORT1)"!=""
+ @echo $(DEF6EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT2)"!=""
+ @echo $(DEF6EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT3)"!=""
+ @echo $(DEF6EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT4)"!=""
+ @echo $(DEF6EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT5)"!=""
+ @echo $(DEF6EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT6)"!=""
+ @echo $(DEF6EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT7)"!=""
+ @echo $(DEF6EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT8)"!=""
+ @echo $(DEF6EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT9)"!=""
+ @echo $(DEF6EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT10)"!=""
+ @echo $(DEF6EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT11)"!=""
+ @echo $(DEF6EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT12)"!=""
+ @echo $(DEF6EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT13)"!=""
+ @echo $(DEF6EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT14)"!=""
+ @echo $(DEF6EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT15)"!=""
+ @echo $(DEF6EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT16)"!=""
+ @echo $(DEF6EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT17)"!=""
+ @echo $(DEF6EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT18)"!=""
+ @echo $(DEF6EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT19)"!=""
+ @echo $(DEF6EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORT20)"!=""
+ @echo $(DEF6EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF6EXPORTFILE)"!=""
+ @fix_def_file < $(DEF6EXPORTFILE) >> $@.tmp_ord
+.ENDIF
+ @sort < $@.tmp_ord | uniq > $@.exptmpfile
+ @fix_def_ord < $@.exptmpfile >> $@.tmpfile
+ @+-$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
+ @+-$(RM) $@.tmp_ord
+ @+-$(RM) $@.exptmpfile
+ $(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(SHL6IMPLIBN:s/.lib/.a/) $@
+ $(COMMAND_ECHO)+emxomf -o $(SHL6IMPLIBN) $(SHL6IMPLIBN:s/.lib/.a/)
+
+.ENDIF # "$(GUI)"=="OS2"
+
+.IF "$(GUI)"=="UNX"
+$(DEF6TARGETN): \
+ $(DEF6DEPN) \
+ $(DEF6EXPORTFILE)
+ @echo just a dummy for UNIX > $@
+.ENDIF
+.ENDIF # "$(DEF6TARGETN)"!=""
+
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(DEF7TARGETN)"!=""
+
+#to make intuitiv naming work
+.IF "$(DEF7LIBNAME)"!=""
+DEFLIB7NAME*=$(DEF7LIBNAME)
+.ENDIF # "$(DEF7LIBNAME)"!=""
+
+.IF "$(DEFLIB7NAME)"!=""
+DEF7DEPN+=$(foreach,i,$(DEFLIB7NAME) $(SLB)/$(i).lib)
+.ENDIF
+
+.IF "$(SHL7VERSIONMAP)"!=""
+.IF "$(DEF7EXPORTFILE)"==""
+.IF "$(GUI)"=="WNT"
+DEF7EXPORTFILE=$(MISC)/$(SHL7VERSIONMAP:b)_$(SHL7TARGET).dxp
+.IF "$(COM)"=="GCC"
+$(DEF7EXPORTFILE) : $(SHL7OBJS) $(SHL7LIBS)
+.ENDIF # .IF "$(COM)"=="GCC"
+
+$(DEF7EXPORTFILE) : $(SHL7VERSIONMAP)
+ $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
+ $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+ $(COMMAND_ECHO)nm -gP $(SHL7OBJS) \
+ `$(TYPE) /dev/null $(foreach,j,$(SHL7LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
+ | $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ $(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
+.ENDIF # .IF "$(COM)"=="GCC"
+
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+DEF7EXPORTFILE=$(MISC)/$(SHL7VERSIONMAP:b)_$(SHL7TARGET).dxp
+$(DEF7EXPORTFILE) : $(SHL7VERSIONMAP)
+ $(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.ENDIF # "$(GUI)"=="OS2"
+
+.ENDIF # "$(DEF7EXPORTFILE)"==""
+.ENDIF # "$(SHL7VERSIONMAP)"!=""
+
+.IF "$(GUI)"=="WNT"
+
+DEF7FILTER=$(SOLARENV)/inc/dummy.flt
+
+RMHACK7:=$(RM)
+
+.IF "$(DEF7CEXP)"!=""
+EXPORT_ALL_SWITCH=-A $(DEF7CEXP)
+.ENDIF
+
+.IF "$(link_always)"==""
+$(DEF7TARGETN) : \
+ $(DEF7DEPN) \
+ $(DEF7EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF7TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(EMQ)"$(SHL7TARGETN:f)$(EMQ)" >$@.tmpfile
+.IF "$(COM)"!="GCC"
+ @echo HEAPSIZE 0 >>$@.tmpfile
+.ENDIF
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo GetVersionInfo >>$@.tmpfile
+.ENDIF
+.IF "$(DEFLIB7NAME)"!=""
+.IF "$(COM)"=="GCC"
+ @-$(RM) $(MISC)/$(SHL7TARGET).exp
+ $(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL7TARGET).exp --export-all-symbols \
+ `$(TYPE) $(foreach,i,$(DEFLIB7NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
+ $(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL7TARGET).exp | sed '/^;/d' >>$@.tmpfile
+ @-$(RM) $(MISC)/$(SHL7TARGET).exp
+.ELSE
+.IF "$(SHL7USE_EXPORTS)"==""
+ @-$(RMHACK7) $(MISC)/$(SHL7TARGET).exp
+ @$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL7TARGET).exp $(SLB)/$(DEFLIB7NAME).lib
+ @$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL7TARGET).flt $(MISC)/$(SHL7TARGET).exp >>$@.tmpfile
+ $(COMMAND_ECHO)$(RMHACK7) $(MISC)/$(SHL7TARGET).exp
+.ELSE # "$(SHL7USE_EXPORTS)"==""
+ @$(DUMPBIN) -DIRECTIVES $(foreach,i,$(DEFLIB7NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL7TARGET).direct
+ @$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF7FILTER) $(MISC)/$(SHL7TARGET).direct >>$@.tmpfile
+.ENDIF # "$(SHL7USE_EXPORTS)"==""
+.ENDIF
+.ENDIF # "$(DEFLIB7NAME)"!=""
+.IF "$(DEF7EXPORT1)"!=""
+ @echo $(DEF7EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT2)"!=""
+ @echo $(DEF7EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT3)"!=""
+ @echo $(DEF7EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT4)"!=""
+ @echo $(DEF7EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT5)"!=""
+ @echo $(DEF7EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT6)"!=""
+ @echo $(DEF7EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT7)"!=""
+ @echo $(DEF7EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT8)"!=""
+ @echo $(DEF7EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT9)"!=""
+ @echo $(DEF7EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT10)"!=""
+ @echo $(DEF7EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT11)"!=""
+ @echo $(DEF7EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT12)"!=""
+ @echo $(DEF7EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT13)"!=""
+ @echo $(DEF7EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT14)"!=""
+ @echo $(DEF7EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT15)"!=""
+ @echo $(DEF7EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT16)"!=""
+ @echo $(DEF7EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT17)"!=""
+ @echo $(DEF7EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT18)"!=""
+ @echo $(DEF7EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT19)"!=""
+ @echo $(DEF7EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT20)"!=""
+ @echo $(DEF7EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORTFILE)"!=""
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(TYPE) $(DEF7EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
+.ELSE
+ $(COMMAND_ECHO)$(TYPE) $(DEF7EXPORTFILE) >> $@.tmpfile
+.ENDIF
+.ENDIF
+ @-$(RM) $@
+ @$(RENAME) $@.tmpfile $@
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL7TARGET8=$(shell @fix_shl $(SHL7TARGETN:f))
+
+DEF7FILTER=$(SOLARENV)/inc/dummy.flt
+DEF7NAMELIST=$(foreach,i,$(DEFLIB7NAME) $(SLB)/$(i).lib)
+
+.IF "$(link_always)"==""
+$(DEF7TARGETN) : \
+ $(DEF7DEPN) \
+ $(DEF7EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF7TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @+-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(SHL7TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile
+ @echo DATA MULTIPLE >>$@.tmpfile
+ @echo DESCRIPTION 'StarView 3.00 $(DEF7DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo _GetVersionInfo >$@.tmp_ord
+.ENDIF
+
+.IF "$(DEFLIB7NAME)"!=""
+ @+echo $(SLB)/$(DEFLIB7NAME).lib
+ @+emxexpr $(DEF7NAMELIST) | fix_exp_file >> $@.tmp_ord
+.ENDIF # "$(DEFLIB7NAME)"!=""
+
+.IF "$(DEF7EXPORT1)"!=""
+ @echo $(DEF7EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT2)"!=""
+ @echo $(DEF7EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT3)"!=""
+ @echo $(DEF7EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT4)"!=""
+ @echo $(DEF7EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT5)"!=""
+ @echo $(DEF7EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT6)"!=""
+ @echo $(DEF7EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT7)"!=""
+ @echo $(DEF7EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT8)"!=""
+ @echo $(DEF7EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT9)"!=""
+ @echo $(DEF7EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT10)"!=""
+ @echo $(DEF7EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT11)"!=""
+ @echo $(DEF7EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT12)"!=""
+ @echo $(DEF7EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT13)"!=""
+ @echo $(DEF7EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT14)"!=""
+ @echo $(DEF7EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT15)"!=""
+ @echo $(DEF7EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT16)"!=""
+ @echo $(DEF7EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT17)"!=""
+ @echo $(DEF7EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT18)"!=""
+ @echo $(DEF7EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT19)"!=""
+ @echo $(DEF7EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORT20)"!=""
+ @echo $(DEF7EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF7EXPORTFILE)"!=""
+ @fix_def_file < $(DEF7EXPORTFILE) >> $@.tmp_ord
+.ENDIF
+ @sort < $@.tmp_ord | uniq > $@.exptmpfile
+ @fix_def_ord < $@.exptmpfile >> $@.tmpfile
+ @+-$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
+ @+-$(RM) $@.tmp_ord
+ @+-$(RM) $@.exptmpfile
+ $(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(SHL7IMPLIBN:s/.lib/.a/) $@
+ $(COMMAND_ECHO)+emxomf -o $(SHL7IMPLIBN) $(SHL7IMPLIBN:s/.lib/.a/)
+
+.ENDIF # "$(GUI)"=="OS2"
+
+.IF "$(GUI)"=="UNX"
+$(DEF7TARGETN): \
+ $(DEF7DEPN) \
+ $(DEF7EXPORTFILE)
+ @echo just a dummy for UNIX > $@
+.ENDIF
+.ENDIF # "$(DEF7TARGETN)"!=""
+
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(DEF8TARGETN)"!=""
+
+#to make intuitiv naming work
+.IF "$(DEF8LIBNAME)"!=""
+DEFLIB8NAME*=$(DEF8LIBNAME)
+.ENDIF # "$(DEF8LIBNAME)"!=""
+
+.IF "$(DEFLIB8NAME)"!=""
+DEF8DEPN+=$(foreach,i,$(DEFLIB8NAME) $(SLB)/$(i).lib)
+.ENDIF
+
+.IF "$(SHL8VERSIONMAP)"!=""
+.IF "$(DEF8EXPORTFILE)"==""
+.IF "$(GUI)"=="WNT"
+DEF8EXPORTFILE=$(MISC)/$(SHL8VERSIONMAP:b)_$(SHL8TARGET).dxp
+.IF "$(COM)"=="GCC"
+$(DEF8EXPORTFILE) : $(SHL8OBJS) $(SHL8LIBS)
+.ENDIF # .IF "$(COM)"=="GCC"
+
+$(DEF8EXPORTFILE) : $(SHL8VERSIONMAP)
+ $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
+ $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+ $(COMMAND_ECHO)nm -gP $(SHL8OBJS) \
+ `$(TYPE) /dev/null $(foreach,j,$(SHL8LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
+ | $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ $(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
+.ENDIF # .IF "$(COM)"=="GCC"
+
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+DEF8EXPORTFILE=$(MISC)/$(SHL8VERSIONMAP:b)_$(SHL8TARGET).dxp
+$(DEF8EXPORTFILE) : $(SHL8VERSIONMAP)
+ $(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.ENDIF # "$(GUI)"=="OS2"
+
+.ENDIF # "$(DEF8EXPORTFILE)"==""
+.ENDIF # "$(SHL8VERSIONMAP)"!=""
+
+.IF "$(GUI)"=="WNT"
+
+DEF8FILTER=$(SOLARENV)/inc/dummy.flt
+
+RMHACK8:=$(RM)
+
+.IF "$(DEF8CEXP)"!=""
+EXPORT_ALL_SWITCH=-A $(DEF8CEXP)
+.ENDIF
+
+.IF "$(link_always)"==""
+$(DEF8TARGETN) : \
+ $(DEF8DEPN) \
+ $(DEF8EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF8TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(EMQ)"$(SHL8TARGETN:f)$(EMQ)" >$@.tmpfile
+.IF "$(COM)"!="GCC"
+ @echo HEAPSIZE 0 >>$@.tmpfile
+.ENDIF
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo GetVersionInfo >>$@.tmpfile
+.ENDIF
+.IF "$(DEFLIB8NAME)"!=""
+.IF "$(COM)"=="GCC"
+ @-$(RM) $(MISC)/$(SHL8TARGET).exp
+ $(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL8TARGET).exp --export-all-symbols \
+ `$(TYPE) $(foreach,i,$(DEFLIB8NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
+ $(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL8TARGET).exp | sed '/^;/d' >>$@.tmpfile
+ @-$(RM) $(MISC)/$(SHL8TARGET).exp
+.ELSE
+.IF "$(SHL8USE_EXPORTS)"==""
+ @-$(RMHACK8) $(MISC)/$(SHL8TARGET).exp
+ @$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL8TARGET).exp $(SLB)/$(DEFLIB8NAME).lib
+ @$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL8TARGET).flt $(MISC)/$(SHL8TARGET).exp >>$@.tmpfile
+ $(COMMAND_ECHO)$(RMHACK8) $(MISC)/$(SHL8TARGET).exp
+.ELSE # "$(SHL8USE_EXPORTS)"==""
+ @$(DUMPBIN) -DIRECTIVES $(foreach,i,$(DEFLIB8NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL8TARGET).direct
+ @$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF8FILTER) $(MISC)/$(SHL8TARGET).direct >>$@.tmpfile
+.ENDIF # "$(SHL8USE_EXPORTS)"==""
+.ENDIF
+.ENDIF # "$(DEFLIB8NAME)"!=""
+.IF "$(DEF8EXPORT1)"!=""
+ @echo $(DEF8EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT2)"!=""
+ @echo $(DEF8EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT3)"!=""
+ @echo $(DEF8EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT4)"!=""
+ @echo $(DEF8EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT5)"!=""
+ @echo $(DEF8EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT6)"!=""
+ @echo $(DEF8EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT7)"!=""
+ @echo $(DEF8EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT8)"!=""
+ @echo $(DEF8EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT9)"!=""
+ @echo $(DEF8EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT10)"!=""
+ @echo $(DEF8EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT11)"!=""
+ @echo $(DEF8EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT12)"!=""
+ @echo $(DEF8EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT13)"!=""
+ @echo $(DEF8EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT14)"!=""
+ @echo $(DEF8EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT15)"!=""
+ @echo $(DEF8EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT16)"!=""
+ @echo $(DEF8EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT17)"!=""
+ @echo $(DEF8EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT18)"!=""
+ @echo $(DEF8EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT19)"!=""
+ @echo $(DEF8EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT20)"!=""
+ @echo $(DEF8EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORTFILE)"!=""
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(TYPE) $(DEF8EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
+.ELSE
+ $(COMMAND_ECHO)$(TYPE) $(DEF8EXPORTFILE) >> $@.tmpfile
+.ENDIF
+.ENDIF
+ @-$(RM) $@
+ @$(RENAME) $@.tmpfile $@
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL8TARGET8=$(shell @fix_shl $(SHL8TARGETN:f))
+
+DEF8FILTER=$(SOLARENV)/inc/dummy.flt
+DEF8NAMELIST=$(foreach,i,$(DEFLIB8NAME) $(SLB)/$(i).lib)
+
+.IF "$(link_always)"==""
+$(DEF8TARGETN) : \
+ $(DEF8DEPN) \
+ $(DEF8EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF8TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @+-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(SHL8TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile
+ @echo DATA MULTIPLE >>$@.tmpfile
+ @echo DESCRIPTION 'StarView 3.00 $(DEF8DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo _GetVersionInfo >$@.tmp_ord
+.ENDIF
+
+.IF "$(DEFLIB8NAME)"!=""
+ @+echo $(SLB)/$(DEFLIB8NAME).lib
+ @+emxexpr $(DEF8NAMELIST) | fix_exp_file >> $@.tmp_ord
+.ENDIF # "$(DEFLIB8NAME)"!=""
+
+.IF "$(DEF8EXPORT1)"!=""
+ @echo $(DEF8EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT2)"!=""
+ @echo $(DEF8EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT3)"!=""
+ @echo $(DEF8EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT4)"!=""
+ @echo $(DEF8EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT5)"!=""
+ @echo $(DEF8EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT6)"!=""
+ @echo $(DEF8EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT7)"!=""
+ @echo $(DEF8EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT8)"!=""
+ @echo $(DEF8EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT9)"!=""
+ @echo $(DEF8EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT10)"!=""
+ @echo $(DEF8EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT11)"!=""
+ @echo $(DEF8EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT12)"!=""
+ @echo $(DEF8EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT13)"!=""
+ @echo $(DEF8EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT14)"!=""
+ @echo $(DEF8EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT15)"!=""
+ @echo $(DEF8EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT16)"!=""
+ @echo $(DEF8EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT17)"!=""
+ @echo $(DEF8EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT18)"!=""
+ @echo $(DEF8EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT19)"!=""
+ @echo $(DEF8EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORT20)"!=""
+ @echo $(DEF8EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF8EXPORTFILE)"!=""
+ @fix_def_file < $(DEF8EXPORTFILE) >> $@.tmp_ord
+.ENDIF
+ @sort < $@.tmp_ord | uniq > $@.exptmpfile
+ @fix_def_ord < $@.exptmpfile >> $@.tmpfile
+ @+-$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
+ @+-$(RM) $@.tmp_ord
+ @+-$(RM) $@.exptmpfile
+ $(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(SHL8IMPLIBN:s/.lib/.a/) $@
+ $(COMMAND_ECHO)+emxomf -o $(SHL8IMPLIBN) $(SHL8IMPLIBN:s/.lib/.a/)
+
+.ENDIF # "$(GUI)"=="OS2"
+
+.IF "$(GUI)"=="UNX"
+$(DEF8TARGETN): \
+ $(DEF8DEPN) \
+ $(DEF8EXPORTFILE)
+ @echo just a dummy for UNIX > $@
+.ENDIF
+.ENDIF # "$(DEF8TARGETN)"!=""
+
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(DEF9TARGETN)"!=""
+
+#to make intuitiv naming work
+.IF "$(DEF9LIBNAME)"!=""
+DEFLIB9NAME*=$(DEF9LIBNAME)
+.ENDIF # "$(DEF9LIBNAME)"!=""
+
+.IF "$(DEFLIB9NAME)"!=""
+DEF9DEPN+=$(foreach,i,$(DEFLIB9NAME) $(SLB)/$(i).lib)
+.ENDIF
+
+.IF "$(SHL9VERSIONMAP)"!=""
+.IF "$(DEF9EXPORTFILE)"==""
+.IF "$(GUI)"=="WNT"
+DEF9EXPORTFILE=$(MISC)/$(SHL9VERSIONMAP:b)_$(SHL9TARGET).dxp
+.IF "$(COM)"=="GCC"
+$(DEF9EXPORTFILE) : $(SHL9OBJS) $(SHL9LIBS)
+.ENDIF # .IF "$(COM)"=="GCC"
+
+$(DEF9EXPORTFILE) : $(SHL9VERSIONMAP)
+ $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
+ $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+ $(COMMAND_ECHO)nm -gP $(SHL9OBJS) \
+ `$(TYPE) /dev/null $(foreach,j,$(SHL9LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
+ | $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ $(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
+.ENDIF # .IF "$(COM)"=="GCC"
+
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+DEF9EXPORTFILE=$(MISC)/$(SHL9VERSIONMAP:b)_$(SHL9TARGET).dxp
+$(DEF9EXPORTFILE) : $(SHL9VERSIONMAP)
+ $(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.ENDIF # "$(GUI)"=="OS2"
+
+.ENDIF # "$(DEF9EXPORTFILE)"==""
+.ENDIF # "$(SHL9VERSIONMAP)"!=""
+
+.IF "$(GUI)"=="WNT"
+
+DEF9FILTER=$(SOLARENV)/inc/dummy.flt
+
+RMHACK9:=$(RM)
+
+.IF "$(DEF9CEXP)"!=""
+EXPORT_ALL_SWITCH=-A $(DEF9CEXP)
+.ENDIF
+
+.IF "$(link_always)"==""
+$(DEF9TARGETN) : \
+ $(DEF9DEPN) \
+ $(DEF9EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF9TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(EMQ)"$(SHL9TARGETN:f)$(EMQ)" >$@.tmpfile
+.IF "$(COM)"!="GCC"
+ @echo HEAPSIZE 0 >>$@.tmpfile
+.ENDIF
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo GetVersionInfo >>$@.tmpfile
+.ENDIF
+.IF "$(DEFLIB9NAME)"!=""
+.IF "$(COM)"=="GCC"
+ @-$(RM) $(MISC)/$(SHL9TARGET).exp
+ $(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL9TARGET).exp --export-all-symbols \
+ `$(TYPE) $(foreach,i,$(DEFLIB9NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
+ $(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL9TARGET).exp | sed '/^;/d' >>$@.tmpfile
+ @-$(RM) $(MISC)/$(SHL9TARGET).exp
+.ELSE
+.IF "$(SHL9USE_EXPORTS)"==""
+ @-$(RMHACK9) $(MISC)/$(SHL9TARGET).exp
+ @$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL9TARGET).exp $(SLB)/$(DEFLIB9NAME).lib
+ @$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL9TARGET).flt $(MISC)/$(SHL9TARGET).exp >>$@.tmpfile
+ $(COMMAND_ECHO)$(RMHACK9) $(MISC)/$(SHL9TARGET).exp
+.ELSE # "$(SHL9USE_EXPORTS)"==""
+ @$(DUMPBIN) -DIRECTIVES $(foreach,i,$(DEFLIB9NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL9TARGET).direct
+ @$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF9FILTER) $(MISC)/$(SHL9TARGET).direct >>$@.tmpfile
+.ENDIF # "$(SHL9USE_EXPORTS)"==""
+.ENDIF
+.ENDIF # "$(DEFLIB9NAME)"!=""
+.IF "$(DEF9EXPORT1)"!=""
+ @echo $(DEF9EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT2)"!=""
+ @echo $(DEF9EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT3)"!=""
+ @echo $(DEF9EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT4)"!=""
+ @echo $(DEF9EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT5)"!=""
+ @echo $(DEF9EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT6)"!=""
+ @echo $(DEF9EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT7)"!=""
+ @echo $(DEF9EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT8)"!=""
+ @echo $(DEF9EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT9)"!=""
+ @echo $(DEF9EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT10)"!=""
+ @echo $(DEF9EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT11)"!=""
+ @echo $(DEF9EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT12)"!=""
+ @echo $(DEF9EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT13)"!=""
+ @echo $(DEF9EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT14)"!=""
+ @echo $(DEF9EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT15)"!=""
+ @echo $(DEF9EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT16)"!=""
+ @echo $(DEF9EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT17)"!=""
+ @echo $(DEF9EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT18)"!=""
+ @echo $(DEF9EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT19)"!=""
+ @echo $(DEF9EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT20)"!=""
+ @echo $(DEF9EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORTFILE)"!=""
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(TYPE) $(DEF9EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
+.ELSE
+ $(COMMAND_ECHO)$(TYPE) $(DEF9EXPORTFILE) >> $@.tmpfile
+.ENDIF
+.ENDIF
+ @-$(RM) $@
+ @$(RENAME) $@.tmpfile $@
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL9TARGET8=$(shell @fix_shl $(SHL9TARGETN:f))
+
+DEF9FILTER=$(SOLARENV)/inc/dummy.flt
+DEF9NAMELIST=$(foreach,i,$(DEFLIB9NAME) $(SLB)/$(i).lib)
+
+.IF "$(link_always)"==""
+$(DEF9TARGETN) : \
+ $(DEF9DEPN) \
+ $(DEF9EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF9TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @+-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(SHL9TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile
+ @echo DATA MULTIPLE >>$@.tmpfile
+ @echo DESCRIPTION 'StarView 3.00 $(DEF9DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo _GetVersionInfo >$@.tmp_ord
+.ENDIF
+
+.IF "$(DEFLIB9NAME)"!=""
+ @+echo $(SLB)/$(DEFLIB9NAME).lib
+ @+emxexpr $(DEF9NAMELIST) | fix_exp_file >> $@.tmp_ord
+.ENDIF # "$(DEFLIB9NAME)"!=""
+
+.IF "$(DEF9EXPORT1)"!=""
+ @echo $(DEF9EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT2)"!=""
+ @echo $(DEF9EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT3)"!=""
+ @echo $(DEF9EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT4)"!=""
+ @echo $(DEF9EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT5)"!=""
+ @echo $(DEF9EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT6)"!=""
+ @echo $(DEF9EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT7)"!=""
+ @echo $(DEF9EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT8)"!=""
+ @echo $(DEF9EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT9)"!=""
+ @echo $(DEF9EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT10)"!=""
+ @echo $(DEF9EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT11)"!=""
+ @echo $(DEF9EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT12)"!=""
+ @echo $(DEF9EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT13)"!=""
+ @echo $(DEF9EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT14)"!=""
+ @echo $(DEF9EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT15)"!=""
+ @echo $(DEF9EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT16)"!=""
+ @echo $(DEF9EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT17)"!=""
+ @echo $(DEF9EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT18)"!=""
+ @echo $(DEF9EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT19)"!=""
+ @echo $(DEF9EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORT20)"!=""
+ @echo $(DEF9EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF9EXPORTFILE)"!=""
+ @fix_def_file < $(DEF9EXPORTFILE) >> $@.tmp_ord
+.ENDIF
+ @sort < $@.tmp_ord | uniq > $@.exptmpfile
+ @fix_def_ord < $@.exptmpfile >> $@.tmpfile
+ @+-$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
+ @+-$(RM) $@.tmp_ord
+ @+-$(RM) $@.exptmpfile
+ $(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(SHL9IMPLIBN:s/.lib/.a/) $@
+ $(COMMAND_ECHO)+emxomf -o $(SHL9IMPLIBN) $(SHL9IMPLIBN:s/.lib/.a/)
+
+.ENDIF # "$(GUI)"=="OS2"
+
+.IF "$(GUI)"=="UNX"
+$(DEF9TARGETN): \
+ $(DEF9DEPN) \
+ $(DEF9EXPORTFILE)
+ @echo just a dummy for UNIX > $@
+.ENDIF
+.ENDIF # "$(DEF9TARGETN)"!=""
+
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(DEF10TARGETN)"!=""
+
+#to make intuitiv naming work
+.IF "$(DEF10LIBNAME)"!=""
+DEFLIB10NAME*=$(DEF10LIBNAME)
+.ENDIF # "$(DEF10LIBNAME)"!=""
+
+.IF "$(DEFLIB10NAME)"!=""
+DEF10DEPN+=$(foreach,i,$(DEFLIB10NAME) $(SLB)/$(i).lib)
+.ENDIF
+
+.IF "$(SHL10VERSIONMAP)"!=""
+.IF "$(DEF10EXPORTFILE)"==""
+.IF "$(GUI)"=="WNT"
+DEF10EXPORTFILE=$(MISC)/$(SHL10VERSIONMAP:b)_$(SHL10TARGET).dxp
+.IF "$(COM)"=="GCC"
+$(DEF10EXPORTFILE) : $(SHL10OBJS) $(SHL10LIBS)
+.ENDIF # .IF "$(COM)"=="GCC"
+
+$(DEF10EXPORTFILE) : $(SHL10VERSIONMAP)
+ $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
+ $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+ $(COMMAND_ECHO)nm -gP $(SHL10OBJS) \
+ `$(TYPE) /dev/null $(foreach,j,$(SHL10LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
+ | $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ $(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
+.ENDIF # .IF "$(COM)"=="GCC"
+
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+DEF10EXPORTFILE=$(MISC)/$(SHL10VERSIONMAP:b)_$(SHL10TARGET).dxp
+$(DEF10EXPORTFILE) : $(SHL10VERSIONMAP)
+ $(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.ENDIF # "$(GUI)"=="OS2"
+
+.ENDIF # "$(DEF10EXPORTFILE)"==""
+.ENDIF # "$(SHL10VERSIONMAP)"!=""
+
+.IF "$(GUI)"=="WNT"
+
+DEF10FILTER=$(SOLARENV)/inc/dummy.flt
+
+RMHACK10:=$(RM)
+
+.IF "$(DEF10CEXP)"!=""
+EXPORT_ALL_SWITCH=-A $(DEF10CEXP)
+.ENDIF
+
+.IF "$(link_always)"==""
+$(DEF10TARGETN) : \
+ $(DEF10DEPN) \
+ $(DEF10EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF10TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(EMQ)"$(SHL10TARGETN:f)$(EMQ)" >$@.tmpfile
+.IF "$(COM)"!="GCC"
+ @echo HEAPSIZE 0 >>$@.tmpfile
+.ENDIF
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo GetVersionInfo >>$@.tmpfile
+.ENDIF
+.IF "$(DEFLIB10NAME)"!=""
+.IF "$(COM)"=="GCC"
+ @-$(RM) $(MISC)/$(SHL10TARGET).exp
+ $(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL10TARGET).exp --export-all-symbols \
+ `$(TYPE) $(foreach,i,$(DEFLIB10NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
+ $(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL10TARGET).exp | sed '/^;/d' >>$@.tmpfile
+ @-$(RM) $(MISC)/$(SHL10TARGET).exp
+.ELSE
+.IF "$(SHL10USE_EXPORTS)"==""
+ @-$(RMHACK10) $(MISC)/$(SHL10TARGET).exp
+ @$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL10TARGET).exp $(SLB)/$(DEFLIB10NAME).lib
+ @$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL10TARGET).flt $(MISC)/$(SHL10TARGET).exp >>$@.tmpfile
+ $(COMMAND_ECHO)$(RMHACK10) $(MISC)/$(SHL10TARGET).exp
+.ELSE # "$(SHL10USE_EXPORTS)"==""
+ @$(DUMPBIN) -DIRECTIVES $(foreach,i,$(DEFLIB10NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL10TARGET).direct
+ @$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF10FILTER) $(MISC)/$(SHL10TARGET).direct >>$@.tmpfile
+.ENDIF # "$(SHL10USE_EXPORTS)"==""
+.ENDIF
+.ENDIF # "$(DEFLIB10NAME)"!=""
+.IF "$(DEF10EXPORT1)"!=""
+ @echo $(DEF10EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT2)"!=""
+ @echo $(DEF10EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT3)"!=""
+ @echo $(DEF10EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT4)"!=""
+ @echo $(DEF10EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT5)"!=""
+ @echo $(DEF10EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT6)"!=""
+ @echo $(DEF10EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT7)"!=""
+ @echo $(DEF10EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT8)"!=""
+ @echo $(DEF10EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT9)"!=""
+ @echo $(DEF10EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT10)"!=""
+ @echo $(DEF10EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT11)"!=""
+ @echo $(DEF10EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT12)"!=""
+ @echo $(DEF10EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT13)"!=""
+ @echo $(DEF10EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT14)"!=""
+ @echo $(DEF10EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT15)"!=""
+ @echo $(DEF10EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT16)"!=""
+ @echo $(DEF10EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT17)"!=""
+ @echo $(DEF10EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT18)"!=""
+ @echo $(DEF10EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT19)"!=""
+ @echo $(DEF10EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT20)"!=""
+ @echo $(DEF10EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORTFILE)"!=""
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(TYPE) $(DEF10EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
+.ELSE
+ $(COMMAND_ECHO)$(TYPE) $(DEF10EXPORTFILE) >> $@.tmpfile
+.ENDIF
+.ENDIF
+ @-$(RM) $@
+ @$(RENAME) $@.tmpfile $@
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL10TARGET8=$(shell @fix_shl $(SHL10TARGETN:f))
+
+DEF10FILTER=$(SOLARENV)/inc/dummy.flt
+DEF10NAMELIST=$(foreach,i,$(DEFLIB10NAME) $(SLB)/$(i).lib)
+
+.IF "$(link_always)"==""
+$(DEF10TARGETN) : \
+ $(DEF10DEPN) \
+ $(DEF10EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF10TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @+-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(SHL10TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile
+ @echo DATA MULTIPLE >>$@.tmpfile
+ @echo DESCRIPTION 'StarView 3.00 $(DEF10DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo _GetVersionInfo >$@.tmp_ord
+.ENDIF
+
+.IF "$(DEFLIB10NAME)"!=""
+ @+echo $(SLB)/$(DEFLIB10NAME).lib
+ @+emxexpr $(DEF10NAMELIST) | fix_exp_file >> $@.tmp_ord
+.ENDIF # "$(DEFLIB10NAME)"!=""
+
+.IF "$(DEF10EXPORT1)"!=""
+ @echo $(DEF10EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT2)"!=""
+ @echo $(DEF10EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT3)"!=""
+ @echo $(DEF10EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT4)"!=""
+ @echo $(DEF10EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT5)"!=""
+ @echo $(DEF10EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT6)"!=""
+ @echo $(DEF10EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT7)"!=""
+ @echo $(DEF10EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT8)"!=""
+ @echo $(DEF10EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT9)"!=""
+ @echo $(DEF10EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT10)"!=""
+ @echo $(DEF10EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT11)"!=""
+ @echo $(DEF10EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT12)"!=""
+ @echo $(DEF10EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT13)"!=""
+ @echo $(DEF10EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT14)"!=""
+ @echo $(DEF10EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT15)"!=""
+ @echo $(DEF10EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT16)"!=""
+ @echo $(DEF10EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT17)"!=""
+ @echo $(DEF10EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT18)"!=""
+ @echo $(DEF10EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT19)"!=""
+ @echo $(DEF10EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORT20)"!=""
+ @echo $(DEF10EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF10EXPORTFILE)"!=""
+ @fix_def_file < $(DEF10EXPORTFILE) >> $@.tmp_ord
+.ENDIF
+ @sort < $@.tmp_ord | uniq > $@.exptmpfile
+ @fix_def_ord < $@.exptmpfile >> $@.tmpfile
+ @+-$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
+ @+-$(RM) $@.tmp_ord
+ @+-$(RM) $@.exptmpfile
+ $(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(SHL10IMPLIBN:s/.lib/.a/) $@
+ $(COMMAND_ECHO)+emxomf -o $(SHL10IMPLIBN) $(SHL10IMPLIBN:s/.lib/.a/)
+
+.ENDIF # "$(GUI)"=="OS2"
+
+.IF "$(GUI)"=="UNX"
+$(DEF10TARGETN): \
+ $(DEF10DEPN) \
+ $(DEF10EXPORTFILE)
+ @echo just a dummy for UNIX > $@
+.ENDIF
+.ENDIF # "$(DEF10TARGETN)"!=""
+
+
+# Anweisungen fuer das Linken
diff --git a/solenv/inc/_tg_lib.mk b/solenv/inc/_tg_lib.mk
new file mode 100644
index 000000000000..378c3230420b
--- /dev/null
+++ b/solenv/inc/_tg_lib.mk
@@ -0,0 +1,1020 @@
+# unroll begin
+
+.IF "$(LIB1TARGET)" != ""
+.IF "$(LIB1ARCHIV)" != ""
+
+$(LIB1ARCHIV) : $(LIB1TARGET)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @-$(RM) $(MISC)/$(LIB1ARCHIV:b).cmd
+.IF "$(OS)" =="HPUX_FRAG_HR"
+ @-$(RM) $(MISC)/$(LIB1ARCHIV:b)_closetempl.cmd
+ @echo $(LINK) +inst_close -c `cat $(LIB1TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB1ARCHIV:b)_closetempl.cmd
+ @cat $(MISC)/$(LIB1ARCHIV:b)_closetempl.cmd
+ @+source $(MISC)/$(LIB1ARCHIV:b)_closetempl.cmd
+.ENDIF
+ @echo $(LIBMGR) $(LIB1FLAGS) $(LIBFLAGS) $(LIB1ARCHIV) `cat $(LIB1TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB1ARCHIV:b).cmd
+.IF "$(OS)$(COM)"=="NETBSDGCC"
+ @echo ranlib $(LIB1ARCHIV) >> $(MISC)/$(LIB1ARCHIV:b).cmd
+.ENDIF
+.IF "$(OS)" == "MACOSX"
+ @echo ranlib $(LIB1ARCHIV) >> $(MISC)/$(LIB1ARCHIV:b).cmd
+.ENDIF
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB1ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB1ARCHIV:b).cmd
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)$(COM)"=="WNTGCC"
+ @+-$(RM) $(MISC)/$(LIB1ARCHIV:b).cmd
+ @+echo $(LIBMGR) $(LIB1FLAGS) $(LIBFLAGS) $(LIB1ARCHIV) `cat $(LIB1TARGET) | sed s#'^'$(ROUT)#$(PRJ)/$(ROUT)#g` > $(MISC)/$(LIB1ARCHIV:b).cmd
+ @+echo ranlib $(LIB1ARCHIV) >> $(MISC)/$(LIB1ARCHIV:b).cmd
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB1ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB1ARCHIV:b).cmd
+.ELSE
+ @echo just a dummy > $@
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.ENDIF # "$(GUI)"=="UNX"
+
+.ENDIF # "$(LIB1ARCHIV)" != ""
+
+$(LIB1TARGET) : $(LIB1FILES) \
+ $(LIB1OBJFILES) \
+ $(LIB1DEPN)
+.IF "$(VERBOSE)" == "TRUE"
+ @echo ------------------------------
+ @echo using: $(LIB1FILES)
+ @echo using: $(LIB1TARGET)
+ @echo ------------------------------
+.ENDIF
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @echo $(LIB1OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@
+ @cat /dev/null $(LIB1FILES:s/.obj/.o/) | xargs -n 1 >> $@
+ @$(RM) $(@:d)$(@:b).dump
+.IF "$(OS)"=="MACOSX"
+ @-nm `cat $(LIB1TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ELSE
+ @nm `cat $(LIB1TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ENDIF
+
+.ELIF "$(GUI)"=="OS2"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(LIB1FILES) $(LIB1OBJFILES)
+ @+-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB1OBJFILES)"!=""
+ @+$(TYPE) $(mktmp $(LIB1OBJFILES)) > $(null,$(LIB1OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB1OBJFILES)"!=""
+.IF "$(LIB1FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB1FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB1FILES)"!=""
+ @+$(ECHONL)
+
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+ +$(ECHONL) $(LIB1OBJFILES) | sed "s#$(PRJ:s/././)/$(ROUT)#$(ROUT)#g" | xargs -n1 > $@
+ @+cat /dev/null $(LIB1FILES) | xargs -n1 >> $@
+.ELSE
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(LIB1FILES) $(LIB1OBJFILES))
+ @-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB1OBJFILES)"!=""
+ @$(TYPE) $(mktmp $(LIB1OBJFILES)) > $(null,$(LIB1OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB1OBJFILES)"!=""
+.IF "$(LIB1FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB1FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB1FILES)"!=""
+ @$(ECHONL)
+.ENDIF # "$(LIB1FILES)"!=""
+.ELSE # "$(GUI)"=="WNT"
+ @-$(RM) $@
+ .IF "$(VERBOSE)" == "TRUE"
+ @echo $(LIBMGR) r $@ $(LIB1OBJFILES)
+ .ENDIF
+ $(COMMAND_ECHO)$(LIBMGR) r $@ $(LIB1OBJFILES) $(LIB1FILES) bla.lib
+.ENDIF # "$(GUI)"=="WNT"
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(LIB1TARGET)" != ""
+
+# Anweisungen fuer das LIBTARGETs
+# unroll begin
+
+.IF "$(LIB2TARGET)" != ""
+.IF "$(LIB2ARCHIV)" != ""
+
+$(LIB2ARCHIV) : $(LIB2TARGET)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @-$(RM) $(MISC)/$(LIB2ARCHIV:b).cmd
+.IF "$(OS)" =="HPUX_FRAG_HR"
+ @-$(RM) $(MISC)/$(LIB2ARCHIV:b)_closetempl.cmd
+ @echo $(LINK) +inst_close -c `cat $(LIB2TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB2ARCHIV:b)_closetempl.cmd
+ @cat $(MISC)/$(LIB2ARCHIV:b)_closetempl.cmd
+ @+source $(MISC)/$(LIB2ARCHIV:b)_closetempl.cmd
+.ENDIF
+ @echo $(LIBMGR) $(LIB2FLAGS) $(LIBFLAGS) $(LIB2ARCHIV) `cat $(LIB2TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB2ARCHIV:b).cmd
+.IF "$(OS)$(COM)"=="NETBSDGCC"
+ @echo ranlib $(LIB2ARCHIV) >> $(MISC)/$(LIB2ARCHIV:b).cmd
+.ENDIF
+.IF "$(OS)" == "MACOSX"
+ @echo ranlib $(LIB2ARCHIV) >> $(MISC)/$(LIB2ARCHIV:b).cmd
+.ENDIF
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB2ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB2ARCHIV:b).cmd
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)$(COM)"=="WNTGCC"
+ @+-$(RM) $(MISC)/$(LIB2ARCHIV:b).cmd
+ @+echo $(LIBMGR) $(LIB2FLAGS) $(LIBFLAGS) $(LIB2ARCHIV) `cat $(LIB2TARGET) | sed s#'^'$(ROUT)#$(PRJ)/$(ROUT)#g` > $(MISC)/$(LIB2ARCHIV:b).cmd
+ @+echo ranlib $(LIB2ARCHIV) >> $(MISC)/$(LIB2ARCHIV:b).cmd
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB2ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB2ARCHIV:b).cmd
+.ELSE
+ @echo just a dummy > $@
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.ENDIF # "$(GUI)"=="UNX"
+
+.ENDIF # "$(LIB2ARCHIV)" != ""
+
+$(LIB2TARGET) : $(LIB2FILES) \
+ $(LIB2OBJFILES) \
+ $(LIB2DEPN)
+.IF "$(VERBOSE)" == "TRUE"
+ @echo ------------------------------
+ @echo using: $(LIB2FILES)
+ @echo using: $(LIB2TARGET)
+ @echo ------------------------------
+.ENDIF
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @echo $(LIB2OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@
+ @cat /dev/null $(LIB2FILES:s/.obj/.o/) | xargs -n 1 >> $@
+ @$(RM) $(@:d)$(@:b).dump
+.IF "$(OS)"=="MACOSX"
+ @-nm `cat $(LIB2TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ELSE
+ @nm `cat $(LIB2TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ENDIF
+
+.ELIF "$(GUI)"=="OS2"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(LIB2FILES) $(LIB2OBJFILES)
+ @+-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB2OBJFILES)"!=""
+ @+$(TYPE) $(mktmp $(LIB2OBJFILES)) > $(null,$(LIB2OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB2OBJFILES)"!=""
+.IF "$(LIB2FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB2FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB2FILES)"!=""
+ @+$(ECHONL)
+
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+ +$(ECHONL) $(LIB2OBJFILES) | sed "s#$(PRJ:s/././)/$(ROUT)#$(ROUT)#g" | xargs -n1 > $@
+ @+cat /dev/null $(LIB2FILES) | xargs -n1 >> $@
+.ELSE
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(LIB2FILES) $(LIB2OBJFILES))
+ @-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB2OBJFILES)"!=""
+ @$(TYPE) $(mktmp $(LIB2OBJFILES)) > $(null,$(LIB2OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB2OBJFILES)"!=""
+.IF "$(LIB2FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB2FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB2FILES)"!=""
+ @$(ECHONL)
+.ENDIF # "$(LIB2FILES)"!=""
+.ELSE # "$(GUI)"=="WNT"
+ @-$(RM) $@
+ .IF "$(VERBOSE)" == "TRUE"
+ @echo $(LIBMGR) r $@ $(LIB2OBJFILES)
+ .ENDIF
+ $(COMMAND_ECHO)$(LIBMGR) r $@ $(LIB2OBJFILES) $(LIB2FILES) bla.lib
+.ENDIF # "$(GUI)"=="WNT"
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(LIB2TARGET)" != ""
+
+# Anweisungen fuer das LIBTARGETs
+# unroll begin
+
+.IF "$(LIB3TARGET)" != ""
+.IF "$(LIB3ARCHIV)" != ""
+
+$(LIB3ARCHIV) : $(LIB3TARGET)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @-$(RM) $(MISC)/$(LIB3ARCHIV:b).cmd
+.IF "$(OS)" =="HPUX_FRAG_HR"
+ @-$(RM) $(MISC)/$(LIB3ARCHIV:b)_closetempl.cmd
+ @echo $(LINK) +inst_close -c `cat $(LIB3TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB3ARCHIV:b)_closetempl.cmd
+ @cat $(MISC)/$(LIB3ARCHIV:b)_closetempl.cmd
+ @+source $(MISC)/$(LIB3ARCHIV:b)_closetempl.cmd
+.ENDIF
+ @echo $(LIBMGR) $(LIB3FLAGS) $(LIBFLAGS) $(LIB3ARCHIV) `cat $(LIB3TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB3ARCHIV:b).cmd
+.IF "$(OS)$(COM)"=="NETBSDGCC"
+ @echo ranlib $(LIB3ARCHIV) >> $(MISC)/$(LIB3ARCHIV:b).cmd
+.ENDIF
+.IF "$(OS)" == "MACOSX"
+ @echo ranlib $(LIB3ARCHIV) >> $(MISC)/$(LIB3ARCHIV:b).cmd
+.ENDIF
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB3ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB3ARCHIV:b).cmd
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)$(COM)"=="WNTGCC"
+ @+-$(RM) $(MISC)/$(LIB3ARCHIV:b).cmd
+ @+echo $(LIBMGR) $(LIB3FLAGS) $(LIBFLAGS) $(LIB3ARCHIV) `cat $(LIB3TARGET) | sed s#'^'$(ROUT)#$(PRJ)/$(ROUT)#g` > $(MISC)/$(LIB3ARCHIV:b).cmd
+ @+echo ranlib $(LIB3ARCHIV) >> $(MISC)/$(LIB3ARCHIV:b).cmd
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB3ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB3ARCHIV:b).cmd
+.ELSE
+ @echo just a dummy > $@
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.ENDIF # "$(GUI)"=="UNX"
+
+.ENDIF # "$(LIB3ARCHIV)" != ""
+
+$(LIB3TARGET) : $(LIB3FILES) \
+ $(LIB3OBJFILES) \
+ $(LIB3DEPN)
+.IF "$(VERBOSE)" == "TRUE"
+ @echo ------------------------------
+ @echo using: $(LIB3FILES)
+ @echo using: $(LIB3TARGET)
+ @echo ------------------------------
+.ENDIF
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @echo $(LIB3OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@
+ @cat /dev/null $(LIB3FILES:s/.obj/.o/) | xargs -n 1 >> $@
+ @$(RM) $(@:d)$(@:b).dump
+.IF "$(OS)"=="MACOSX"
+ @-nm `cat $(LIB3TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ELSE
+ @nm `cat $(LIB3TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ENDIF
+
+.ELIF "$(GUI)"=="OS2"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(LIB3FILES) $(LIB3OBJFILES)
+ @+-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB3OBJFILES)"!=""
+ @+$(TYPE) $(mktmp $(LIB3OBJFILES)) > $(null,$(LIB3OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB3OBJFILES)"!=""
+.IF "$(LIB3FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB3FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB3FILES)"!=""
+ @+$(ECHONL)
+
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+ +$(ECHONL) $(LIB3OBJFILES) | sed "s#$(PRJ:s/././)/$(ROUT)#$(ROUT)#g" | xargs -n1 > $@
+ @+cat /dev/null $(LIB3FILES) | xargs -n1 >> $@
+.ELSE
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(LIB3FILES) $(LIB3OBJFILES))
+ @-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB3OBJFILES)"!=""
+ @$(TYPE) $(mktmp $(LIB3OBJFILES)) > $(null,$(LIB3OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB3OBJFILES)"!=""
+.IF "$(LIB3FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB3FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB3FILES)"!=""
+ @$(ECHONL)
+.ENDIF # "$(LIB3FILES)"!=""
+.ELSE # "$(GUI)"=="WNT"
+ @-$(RM) $@
+ .IF "$(VERBOSE)" == "TRUE"
+ @echo $(LIBMGR) r $@ $(LIB3OBJFILES)
+ .ENDIF
+ $(COMMAND_ECHO)$(LIBMGR) r $@ $(LIB3OBJFILES) $(LIB3FILES) bla.lib
+.ENDIF # "$(GUI)"=="WNT"
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(LIB3TARGET)" != ""
+
+# Anweisungen fuer das LIBTARGETs
+# unroll begin
+
+.IF "$(LIB4TARGET)" != ""
+.IF "$(LIB4ARCHIV)" != ""
+
+$(LIB4ARCHIV) : $(LIB4TARGET)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @-$(RM) $(MISC)/$(LIB4ARCHIV:b).cmd
+.IF "$(OS)" =="HPUX_FRAG_HR"
+ @-$(RM) $(MISC)/$(LIB4ARCHIV:b)_closetempl.cmd
+ @echo $(LINK) +inst_close -c `cat $(LIB4TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB4ARCHIV:b)_closetempl.cmd
+ @cat $(MISC)/$(LIB4ARCHIV:b)_closetempl.cmd
+ @+source $(MISC)/$(LIB4ARCHIV:b)_closetempl.cmd
+.ENDIF
+ @echo $(LIBMGR) $(LIB4FLAGS) $(LIBFLAGS) $(LIB4ARCHIV) `cat $(LIB4TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB4ARCHIV:b).cmd
+.IF "$(OS)$(COM)"=="NETBSDGCC"
+ @echo ranlib $(LIB4ARCHIV) >> $(MISC)/$(LIB4ARCHIV:b).cmd
+.ENDIF
+.IF "$(OS)" == "MACOSX"
+ @echo ranlib $(LIB4ARCHIV) >> $(MISC)/$(LIB4ARCHIV:b).cmd
+.ENDIF
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB4ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB4ARCHIV:b).cmd
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)$(COM)"=="WNTGCC"
+ @+-$(RM) $(MISC)/$(LIB4ARCHIV:b).cmd
+ @+echo $(LIBMGR) $(LIB4FLAGS) $(LIBFLAGS) $(LIB4ARCHIV) `cat $(LIB4TARGET) | sed s#'^'$(ROUT)#$(PRJ)/$(ROUT)#g` > $(MISC)/$(LIB4ARCHIV:b).cmd
+ @+echo ranlib $(LIB4ARCHIV) >> $(MISC)/$(LIB4ARCHIV:b).cmd
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB4ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB4ARCHIV:b).cmd
+.ELSE
+ @echo just a dummy > $@
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.ENDIF # "$(GUI)"=="UNX"
+
+.ENDIF # "$(LIB4ARCHIV)" != ""
+
+$(LIB4TARGET) : $(LIB4FILES) \
+ $(LIB4OBJFILES) \
+ $(LIB4DEPN)
+.IF "$(VERBOSE)" == "TRUE"
+ @echo ------------------------------
+ @echo using: $(LIB4FILES)
+ @echo using: $(LIB4TARGET)
+ @echo ------------------------------
+.ENDIF
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @echo $(LIB4OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@
+ @cat /dev/null $(LIB4FILES:s/.obj/.o/) | xargs -n 1 >> $@
+ @$(RM) $(@:d)$(@:b).dump
+.IF "$(OS)"=="MACOSX"
+ @-nm `cat $(LIB4TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ELSE
+ @nm `cat $(LIB4TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ENDIF
+
+.ELIF "$(GUI)"=="OS2"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(LIB4FILES) $(LIB4OBJFILES)
+ @+-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB4OBJFILES)"!=""
+ @+$(TYPE) $(mktmp $(LIB4OBJFILES)) > $(null,$(LIB4OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB4OBJFILES)"!=""
+.IF "$(LIB4FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB4FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB4FILES)"!=""
+ @+$(ECHONL)
+
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+ +$(ECHONL) $(LIB4OBJFILES) | sed "s#$(PRJ:s/././)/$(ROUT)#$(ROUT)#g" | xargs -n1 > $@
+ @+cat /dev/null $(LIB4FILES) | xargs -n1 >> $@
+.ELSE
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(LIB4FILES) $(LIB4OBJFILES))
+ @-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB4OBJFILES)"!=""
+ @$(TYPE) $(mktmp $(LIB4OBJFILES)) > $(null,$(LIB4OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB4OBJFILES)"!=""
+.IF "$(LIB4FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB4FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB4FILES)"!=""
+ @$(ECHONL)
+.ENDIF # "$(LIB4FILES)"!=""
+.ELSE # "$(GUI)"=="WNT"
+ @-$(RM) $@
+ .IF "$(VERBOSE)" == "TRUE"
+ @echo $(LIBMGR) r $@ $(LIB4OBJFILES)
+ .ENDIF
+ $(COMMAND_ECHO)$(LIBMGR) r $@ $(LIB4OBJFILES) $(LIB4FILES) bla.lib
+.ENDIF # "$(GUI)"=="WNT"
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(LIB4TARGET)" != ""
+
+# Anweisungen fuer das LIBTARGETs
+# unroll begin
+
+.IF "$(LIB5TARGET)" != ""
+.IF "$(LIB5ARCHIV)" != ""
+
+$(LIB5ARCHIV) : $(LIB5TARGET)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @-$(RM) $(MISC)/$(LIB5ARCHIV:b).cmd
+.IF "$(OS)" =="HPUX_FRAG_HR"
+ @-$(RM) $(MISC)/$(LIB5ARCHIV:b)_closetempl.cmd
+ @echo $(LINK) +inst_close -c `cat $(LIB5TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB5ARCHIV:b)_closetempl.cmd
+ @cat $(MISC)/$(LIB5ARCHIV:b)_closetempl.cmd
+ @+source $(MISC)/$(LIB5ARCHIV:b)_closetempl.cmd
+.ENDIF
+ @echo $(LIBMGR) $(LIB5FLAGS) $(LIBFLAGS) $(LIB5ARCHIV) `cat $(LIB5TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB5ARCHIV:b).cmd
+.IF "$(OS)$(COM)"=="NETBSDGCC"
+ @echo ranlib $(LIB5ARCHIV) >> $(MISC)/$(LIB5ARCHIV:b).cmd
+.ENDIF
+.IF "$(OS)" == "MACOSX"
+ @echo ranlib $(LIB5ARCHIV) >> $(MISC)/$(LIB5ARCHIV:b).cmd
+.ENDIF
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB5ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB5ARCHIV:b).cmd
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)$(COM)"=="WNTGCC"
+ @+-$(RM) $(MISC)/$(LIB5ARCHIV:b).cmd
+ @+echo $(LIBMGR) $(LIB5FLAGS) $(LIBFLAGS) $(LIB5ARCHIV) `cat $(LIB5TARGET) | sed s#'^'$(ROUT)#$(PRJ)/$(ROUT)#g` > $(MISC)/$(LIB5ARCHIV:b).cmd
+ @+echo ranlib $(LIB5ARCHIV) >> $(MISC)/$(LIB5ARCHIV:b).cmd
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB5ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB5ARCHIV:b).cmd
+.ELSE
+ @echo just a dummy > $@
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.ENDIF # "$(GUI)"=="UNX"
+
+.ENDIF # "$(LIB5ARCHIV)" != ""
+
+$(LIB5TARGET) : $(LIB5FILES) \
+ $(LIB5OBJFILES) \
+ $(LIB5DEPN)
+.IF "$(VERBOSE)" == "TRUE"
+ @echo ------------------------------
+ @echo using: $(LIB5FILES)
+ @echo using: $(LIB5TARGET)
+ @echo ------------------------------
+.ENDIF
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @echo $(LIB5OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@
+ @cat /dev/null $(LIB5FILES:s/.obj/.o/) | xargs -n 1 >> $@
+ @$(RM) $(@:d)$(@:b).dump
+.IF "$(OS)"=="MACOSX"
+ @-nm `cat $(LIB5TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ELSE
+ @nm `cat $(LIB5TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ENDIF
+
+.ELIF "$(GUI)"=="OS2"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(LIB5FILES) $(LIB5OBJFILES)
+ @+-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB5OBJFILES)"!=""
+ @+$(TYPE) $(mktmp $(LIB5OBJFILES)) > $(null,$(LIB5OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB5OBJFILES)"!=""
+.IF "$(LIB5FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB5FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB5FILES)"!=""
+ @+$(ECHONL)
+
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+ +$(ECHONL) $(LIB5OBJFILES) | sed "s#$(PRJ:s/././)/$(ROUT)#$(ROUT)#g" | xargs -n1 > $@
+ @+cat /dev/null $(LIB5FILES) | xargs -n1 >> $@
+.ELSE
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(LIB5FILES) $(LIB5OBJFILES))
+ @-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB5OBJFILES)"!=""
+ @$(TYPE) $(mktmp $(LIB5OBJFILES)) > $(null,$(LIB5OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB5OBJFILES)"!=""
+.IF "$(LIB5FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB5FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB5FILES)"!=""
+ @$(ECHONL)
+.ENDIF # "$(LIB5FILES)"!=""
+.ELSE # "$(GUI)"=="WNT"
+ @-$(RM) $@
+ .IF "$(VERBOSE)" == "TRUE"
+ @echo $(LIBMGR) r $@ $(LIB5OBJFILES)
+ .ENDIF
+ $(COMMAND_ECHO)$(LIBMGR) r $@ $(LIB5OBJFILES) $(LIB5FILES) bla.lib
+.ENDIF # "$(GUI)"=="WNT"
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(LIB5TARGET)" != ""
+
+# Anweisungen fuer das LIBTARGETs
+# unroll begin
+
+.IF "$(LIB6TARGET)" != ""
+.IF "$(LIB6ARCHIV)" != ""
+
+$(LIB6ARCHIV) : $(LIB6TARGET)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @-$(RM) $(MISC)/$(LIB6ARCHIV:b).cmd
+.IF "$(OS)" =="HPUX_FRAG_HR"
+ @-$(RM) $(MISC)/$(LIB6ARCHIV:b)_closetempl.cmd
+ @echo $(LINK) +inst_close -c `cat $(LIB6TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB6ARCHIV:b)_closetempl.cmd
+ @cat $(MISC)/$(LIB6ARCHIV:b)_closetempl.cmd
+ @+source $(MISC)/$(LIB6ARCHIV:b)_closetempl.cmd
+.ENDIF
+ @echo $(LIBMGR) $(LIB6FLAGS) $(LIBFLAGS) $(LIB6ARCHIV) `cat $(LIB6TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB6ARCHIV:b).cmd
+.IF "$(OS)$(COM)"=="NETBSDGCC"
+ @echo ranlib $(LIB6ARCHIV) >> $(MISC)/$(LIB6ARCHIV:b).cmd
+.ENDIF
+.IF "$(OS)" == "MACOSX"
+ @echo ranlib $(LIB6ARCHIV) >> $(MISC)/$(LIB6ARCHIV:b).cmd
+.ENDIF
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB6ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB6ARCHIV:b).cmd
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)$(COM)"=="WNTGCC"
+ @+-$(RM) $(MISC)/$(LIB6ARCHIV:b).cmd
+ @+echo $(LIBMGR) $(LIB6FLAGS) $(LIBFLAGS) $(LIB6ARCHIV) `cat $(LIB6TARGET) | sed s#'^'$(ROUT)#$(PRJ)/$(ROUT)#g` > $(MISC)/$(LIB6ARCHIV:b).cmd
+ @+echo ranlib $(LIB6ARCHIV) >> $(MISC)/$(LIB6ARCHIV:b).cmd
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB6ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB6ARCHIV:b).cmd
+.ELSE
+ @echo just a dummy > $@
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.ENDIF # "$(GUI)"=="UNX"
+
+.ENDIF # "$(LIB6ARCHIV)" != ""
+
+$(LIB6TARGET) : $(LIB6FILES) \
+ $(LIB6OBJFILES) \
+ $(LIB6DEPN)
+.IF "$(VERBOSE)" == "TRUE"
+ @echo ------------------------------
+ @echo using: $(LIB6FILES)
+ @echo using: $(LIB6TARGET)
+ @echo ------------------------------
+.ENDIF
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @echo $(LIB6OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@
+ @cat /dev/null $(LIB6FILES:s/.obj/.o/) | xargs -n 1 >> $@
+ @$(RM) $(@:d)$(@:b).dump
+.IF "$(OS)"=="MACOSX"
+ @-nm `cat $(LIB6TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ELSE
+ @nm `cat $(LIB6TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ENDIF
+
+.ELIF "$(GUI)"=="OS2"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(LIB6FILES) $(LIB6OBJFILES)
+ @+-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB6OBJFILES)"!=""
+ @+$(TYPE) $(mktmp $(LIB6OBJFILES)) > $(null,$(LIB6OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB6OBJFILES)"!=""
+.IF "$(LIB6FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB6FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB6FILES)"!=""
+ @+$(ECHONL)
+
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+ +$(ECHONL) $(LIB6OBJFILES) | sed "s#$(PRJ:s/././)/$(ROUT)#$(ROUT)#g" | xargs -n1 > $@
+ @+cat /dev/null $(LIB6FILES) | xargs -n1 >> $@
+.ELSE
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(LIB6FILES) $(LIB6OBJFILES))
+ @-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB6OBJFILES)"!=""
+ @$(TYPE) $(mktmp $(LIB6OBJFILES)) > $(null,$(LIB6OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB6OBJFILES)"!=""
+.IF "$(LIB6FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB6FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB6FILES)"!=""
+ @$(ECHONL)
+.ENDIF # "$(LIB6FILES)"!=""
+.ELSE # "$(GUI)"=="WNT"
+ @-$(RM) $@
+ .IF "$(VERBOSE)" == "TRUE"
+ @echo $(LIBMGR) r $@ $(LIB6OBJFILES)
+ .ENDIF
+ $(COMMAND_ECHO)$(LIBMGR) r $@ $(LIB6OBJFILES) $(LIB6FILES) bla.lib
+.ENDIF # "$(GUI)"=="WNT"
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(LIB6TARGET)" != ""
+
+# Anweisungen fuer das LIBTARGETs
+# unroll begin
+
+.IF "$(LIB7TARGET)" != ""
+.IF "$(LIB7ARCHIV)" != ""
+
+$(LIB7ARCHIV) : $(LIB7TARGET)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @-$(RM) $(MISC)/$(LIB7ARCHIV:b).cmd
+.IF "$(OS)" =="HPUX_FRAG_HR"
+ @-$(RM) $(MISC)/$(LIB7ARCHIV:b)_closetempl.cmd
+ @echo $(LINK) +inst_close -c `cat $(LIB7TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB7ARCHIV:b)_closetempl.cmd
+ @cat $(MISC)/$(LIB7ARCHIV:b)_closetempl.cmd
+ @+source $(MISC)/$(LIB7ARCHIV:b)_closetempl.cmd
+.ENDIF
+ @echo $(LIBMGR) $(LIB7FLAGS) $(LIBFLAGS) $(LIB7ARCHIV) `cat $(LIB7TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB7ARCHIV:b).cmd
+.IF "$(OS)$(COM)"=="NETBSDGCC"
+ @echo ranlib $(LIB7ARCHIV) >> $(MISC)/$(LIB7ARCHIV:b).cmd
+.ENDIF
+.IF "$(OS)" == "MACOSX"
+ @echo ranlib $(LIB7ARCHIV) >> $(MISC)/$(LIB7ARCHIV:b).cmd
+.ENDIF
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB7ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB7ARCHIV:b).cmd
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)$(COM)"=="WNTGCC"
+ @+-$(RM) $(MISC)/$(LIB7ARCHIV:b).cmd
+ @+echo $(LIBMGR) $(LIB7FLAGS) $(LIBFLAGS) $(LIB7ARCHIV) `cat $(LIB7TARGET) | sed s#'^'$(ROUT)#$(PRJ)/$(ROUT)#g` > $(MISC)/$(LIB7ARCHIV:b).cmd
+ @+echo ranlib $(LIB7ARCHIV) >> $(MISC)/$(LIB7ARCHIV:b).cmd
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB7ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB7ARCHIV:b).cmd
+.ELSE
+ @echo just a dummy > $@
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.ENDIF # "$(GUI)"=="UNX"
+
+.ENDIF # "$(LIB7ARCHIV)" != ""
+
+$(LIB7TARGET) : $(LIB7FILES) \
+ $(LIB7OBJFILES) \
+ $(LIB7DEPN)
+.IF "$(VERBOSE)" == "TRUE"
+ @echo ------------------------------
+ @echo using: $(LIB7FILES)
+ @echo using: $(LIB7TARGET)
+ @echo ------------------------------
+.ENDIF
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @echo $(LIB7OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@
+ @cat /dev/null $(LIB7FILES:s/.obj/.o/) | xargs -n 1 >> $@
+ @$(RM) $(@:d)$(@:b).dump
+.IF "$(OS)"=="MACOSX"
+ @-nm `cat $(LIB7TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ELSE
+ @nm `cat $(LIB7TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ENDIF
+
+.ELIF "$(GUI)"=="OS2"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(LIB7FILES) $(LIB7OBJFILES)
+ @+-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB7OBJFILES)"!=""
+ @+$(TYPE) $(mktmp $(LIB7OBJFILES)) > $(null,$(LIB7OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB7OBJFILES)"!=""
+.IF "$(LIB7FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB7FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB7FILES)"!=""
+ @+$(ECHONL)
+
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+ +$(ECHONL) $(LIB7OBJFILES) | sed "s#$(PRJ:s/././)/$(ROUT)#$(ROUT)#g" | xargs -n1 > $@
+ @+cat /dev/null $(LIB7FILES) | xargs -n1 >> $@
+.ELSE
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(LIB7FILES) $(LIB7OBJFILES))
+ @-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB7OBJFILES)"!=""
+ @$(TYPE) $(mktmp $(LIB7OBJFILES)) > $(null,$(LIB7OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB7OBJFILES)"!=""
+.IF "$(LIB7FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB7FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB7FILES)"!=""
+ @$(ECHONL)
+.ENDIF # "$(LIB7FILES)"!=""
+.ELSE # "$(GUI)"=="WNT"
+ @-$(RM) $@
+ .IF "$(VERBOSE)" == "TRUE"
+ @echo $(LIBMGR) r $@ $(LIB7OBJFILES)
+ .ENDIF
+ $(COMMAND_ECHO)$(LIBMGR) r $@ $(LIB7OBJFILES) $(LIB7FILES) bla.lib
+.ENDIF # "$(GUI)"=="WNT"
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(LIB7TARGET)" != ""
+
+# Anweisungen fuer das LIBTARGETs
+# unroll begin
+
+.IF "$(LIB8TARGET)" != ""
+.IF "$(LIB8ARCHIV)" != ""
+
+$(LIB8ARCHIV) : $(LIB8TARGET)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @-$(RM) $(MISC)/$(LIB8ARCHIV:b).cmd
+.IF "$(OS)" =="HPUX_FRAG_HR"
+ @-$(RM) $(MISC)/$(LIB8ARCHIV:b)_closetempl.cmd
+ @echo $(LINK) +inst_close -c `cat $(LIB8TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB8ARCHIV:b)_closetempl.cmd
+ @cat $(MISC)/$(LIB8ARCHIV:b)_closetempl.cmd
+ @+source $(MISC)/$(LIB8ARCHIV:b)_closetempl.cmd
+.ENDIF
+ @echo $(LIBMGR) $(LIB8FLAGS) $(LIBFLAGS) $(LIB8ARCHIV) `cat $(LIB8TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB8ARCHIV:b).cmd
+.IF "$(OS)$(COM)"=="NETBSDGCC"
+ @echo ranlib $(LIB8ARCHIV) >> $(MISC)/$(LIB8ARCHIV:b).cmd
+.ENDIF
+.IF "$(OS)" == "MACOSX"
+ @echo ranlib $(LIB8ARCHIV) >> $(MISC)/$(LIB8ARCHIV:b).cmd
+.ENDIF
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB8ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB8ARCHIV:b).cmd
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)$(COM)"=="WNTGCC"
+ @+-$(RM) $(MISC)/$(LIB8ARCHIV:b).cmd
+ @+echo $(LIBMGR) $(LIB8FLAGS) $(LIBFLAGS) $(LIB8ARCHIV) `cat $(LIB8TARGET) | sed s#'^'$(ROUT)#$(PRJ)/$(ROUT)#g` > $(MISC)/$(LIB8ARCHIV:b).cmd
+ @+echo ranlib $(LIB8ARCHIV) >> $(MISC)/$(LIB8ARCHIV:b).cmd
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB8ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB8ARCHIV:b).cmd
+.ELSE
+ @echo just a dummy > $@
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.ENDIF # "$(GUI)"=="UNX"
+
+.ENDIF # "$(LIB8ARCHIV)" != ""
+
+$(LIB8TARGET) : $(LIB8FILES) \
+ $(LIB8OBJFILES) \
+ $(LIB8DEPN)
+.IF "$(VERBOSE)" == "TRUE"
+ @echo ------------------------------
+ @echo using: $(LIB8FILES)
+ @echo using: $(LIB8TARGET)
+ @echo ------------------------------
+.ENDIF
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @echo $(LIB8OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@
+ @cat /dev/null $(LIB8FILES:s/.obj/.o/) | xargs -n 1 >> $@
+ @$(RM) $(@:d)$(@:b).dump
+.IF "$(OS)"=="MACOSX"
+ @-nm `cat $(LIB8TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ELSE
+ @nm `cat $(LIB8TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ENDIF
+
+.ELIF "$(GUI)"=="OS2"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(LIB8FILES) $(LIB8OBJFILES)
+ @+-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB8OBJFILES)"!=""
+ @+$(TYPE) $(mktmp $(LIB8OBJFILES)) > $(null,$(LIB8OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB8OBJFILES)"!=""
+.IF "$(LIB8FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB8FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB8FILES)"!=""
+ @+$(ECHONL)
+
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+ +$(ECHONL) $(LIB8OBJFILES) | sed "s#$(PRJ:s/././)/$(ROUT)#$(ROUT)#g" | xargs -n1 > $@
+ @+cat /dev/null $(LIB8FILES) | xargs -n1 >> $@
+.ELSE
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(LIB8FILES) $(LIB8OBJFILES))
+ @-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB8OBJFILES)"!=""
+ @$(TYPE) $(mktmp $(LIB8OBJFILES)) > $(null,$(LIB8OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB8OBJFILES)"!=""
+.IF "$(LIB8FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB8FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB8FILES)"!=""
+ @$(ECHONL)
+.ENDIF # "$(LIB8FILES)"!=""
+.ELSE # "$(GUI)"=="WNT"
+ @-$(RM) $@
+ .IF "$(VERBOSE)" == "TRUE"
+ @echo $(LIBMGR) r $@ $(LIB8OBJFILES)
+ .ENDIF
+ $(COMMAND_ECHO)$(LIBMGR) r $@ $(LIB8OBJFILES) $(LIB8FILES) bla.lib
+.ENDIF # "$(GUI)"=="WNT"
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(LIB8TARGET)" != ""
+
+# Anweisungen fuer das LIBTARGETs
+# unroll begin
+
+.IF "$(LIB9TARGET)" != ""
+.IF "$(LIB9ARCHIV)" != ""
+
+$(LIB9ARCHIV) : $(LIB9TARGET)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @-$(RM) $(MISC)/$(LIB9ARCHIV:b).cmd
+.IF "$(OS)" =="HPUX_FRAG_HR"
+ @-$(RM) $(MISC)/$(LIB9ARCHIV:b)_closetempl.cmd
+ @echo $(LINK) +inst_close -c `cat $(LIB9TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB9ARCHIV:b)_closetempl.cmd
+ @cat $(MISC)/$(LIB9ARCHIV:b)_closetempl.cmd
+ @+source $(MISC)/$(LIB9ARCHIV:b)_closetempl.cmd
+.ENDIF
+ @echo $(LIBMGR) $(LIB9FLAGS) $(LIBFLAGS) $(LIB9ARCHIV) `cat $(LIB9TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB9ARCHIV:b).cmd
+.IF "$(OS)$(COM)"=="NETBSDGCC"
+ @echo ranlib $(LIB9ARCHIV) >> $(MISC)/$(LIB9ARCHIV:b).cmd
+.ENDIF
+.IF "$(OS)" == "MACOSX"
+ @echo ranlib $(LIB9ARCHIV) >> $(MISC)/$(LIB9ARCHIV:b).cmd
+.ENDIF
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB9ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB9ARCHIV:b).cmd
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)$(COM)"=="WNTGCC"
+ @+-$(RM) $(MISC)/$(LIB9ARCHIV:b).cmd
+ @+echo $(LIBMGR) $(LIB9FLAGS) $(LIBFLAGS) $(LIB9ARCHIV) `cat $(LIB9TARGET) | sed s#'^'$(ROUT)#$(PRJ)/$(ROUT)#g` > $(MISC)/$(LIB9ARCHIV:b).cmd
+ @+echo ranlib $(LIB9ARCHIV) >> $(MISC)/$(LIB9ARCHIV:b).cmd
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB9ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB9ARCHIV:b).cmd
+.ELSE
+ @echo just a dummy > $@
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.ENDIF # "$(GUI)"=="UNX"
+
+.ENDIF # "$(LIB9ARCHIV)" != ""
+
+$(LIB9TARGET) : $(LIB9FILES) \
+ $(LIB9OBJFILES) \
+ $(LIB9DEPN)
+.IF "$(VERBOSE)" == "TRUE"
+ @echo ------------------------------
+ @echo using: $(LIB9FILES)
+ @echo using: $(LIB9TARGET)
+ @echo ------------------------------
+.ENDIF
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @echo $(LIB9OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@
+ @cat /dev/null $(LIB9FILES:s/.obj/.o/) | xargs -n 1 >> $@
+ @$(RM) $(@:d)$(@:b).dump
+.IF "$(OS)"=="MACOSX"
+ @-nm `cat $(LIB9TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ELSE
+ @nm `cat $(LIB9TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ENDIF
+
+.ELIF "$(GUI)"=="OS2"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(LIB9FILES) $(LIB9OBJFILES)
+ @+-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB9OBJFILES)"!=""
+ @+$(TYPE) $(mktmp $(LIB9OBJFILES)) > $(null,$(LIB9OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB9OBJFILES)"!=""
+.IF "$(LIB9FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB9FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB9FILES)"!=""
+ @+$(ECHONL)
+
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+ +$(ECHONL) $(LIB9OBJFILES) | sed "s#$(PRJ:s/././)/$(ROUT)#$(ROUT)#g" | xargs -n1 > $@
+ @+cat /dev/null $(LIB9FILES) | xargs -n1 >> $@
+.ELSE
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(LIB9FILES) $(LIB9OBJFILES))
+ @-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB9OBJFILES)"!=""
+ @$(TYPE) $(mktmp $(LIB9OBJFILES)) > $(null,$(LIB9OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB9OBJFILES)"!=""
+.IF "$(LIB9FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB9FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB9FILES)"!=""
+ @$(ECHONL)
+.ENDIF # "$(LIB9FILES)"!=""
+.ELSE # "$(GUI)"=="WNT"
+ @-$(RM) $@
+ .IF "$(VERBOSE)" == "TRUE"
+ @echo $(LIBMGR) r $@ $(LIB9OBJFILES)
+ .ENDIF
+ $(COMMAND_ECHO)$(LIBMGR) r $@ $(LIB9OBJFILES) $(LIB9FILES) bla.lib
+.ENDIF # "$(GUI)"=="WNT"
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(LIB9TARGET)" != ""
+
+# Anweisungen fuer das LIBTARGETs
+# unroll begin
+
+.IF "$(LIB10TARGET)" != ""
+.IF "$(LIB10ARCHIV)" != ""
+
+$(LIB10ARCHIV) : $(LIB10TARGET)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @-$(RM) $(MISC)/$(LIB10ARCHIV:b).cmd
+.IF "$(OS)" =="HPUX_FRAG_HR"
+ @-$(RM) $(MISC)/$(LIB10ARCHIV:b)_closetempl.cmd
+ @echo $(LINK) +inst_close -c `cat $(LIB10TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB10ARCHIV:b)_closetempl.cmd
+ @cat $(MISC)/$(LIB10ARCHIV:b)_closetempl.cmd
+ @+source $(MISC)/$(LIB10ARCHIV:b)_closetempl.cmd
+.ENDIF
+ @echo $(LIBMGR) $(LIB10FLAGS) $(LIBFLAGS) $(LIB10ARCHIV) `cat $(LIB10TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB10ARCHIV:b).cmd
+.IF "$(OS)$(COM)"=="NETBSDGCC"
+ @echo ranlib $(LIB10ARCHIV) >> $(MISC)/$(LIB10ARCHIV:b).cmd
+.ENDIF
+.IF "$(OS)" == "MACOSX"
+ @echo ranlib $(LIB10ARCHIV) >> $(MISC)/$(LIB10ARCHIV:b).cmd
+.ENDIF
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB10ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB10ARCHIV:b).cmd
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)$(COM)"=="WNTGCC"
+ @+-$(RM) $(MISC)/$(LIB10ARCHIV:b).cmd
+ @+echo $(LIBMGR) $(LIB10FLAGS) $(LIBFLAGS) $(LIB10ARCHIV) `cat $(LIB10TARGET) | sed s#'^'$(ROUT)#$(PRJ)/$(ROUT)#g` > $(MISC)/$(LIB10ARCHIV:b).cmd
+ @+echo ranlib $(LIB10ARCHIV) >> $(MISC)/$(LIB10ARCHIV:b).cmd
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB10ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB10ARCHIV:b).cmd
+.ELSE
+ @echo just a dummy > $@
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.ENDIF # "$(GUI)"=="UNX"
+
+.ENDIF # "$(LIB10ARCHIV)" != ""
+
+$(LIB10TARGET) : $(LIB10FILES) \
+ $(LIB10OBJFILES) \
+ $(LIB10DEPN)
+.IF "$(VERBOSE)" == "TRUE"
+ @echo ------------------------------
+ @echo using: $(LIB10FILES)
+ @echo using: $(LIB10TARGET)
+ @echo ------------------------------
+.ENDIF
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @echo $(LIB10OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@
+ @cat /dev/null $(LIB10FILES:s/.obj/.o/) | xargs -n 1 >> $@
+ @$(RM) $(@:d)$(@:b).dump
+.IF "$(OS)"=="MACOSX"
+ @-nm `cat $(LIB10TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ELSE
+ @nm `cat $(LIB10TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ENDIF
+
+.ELIF "$(GUI)"=="OS2"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(LIB10FILES) $(LIB10OBJFILES)
+ @+-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB10OBJFILES)"!=""
+ @+$(TYPE) $(mktmp $(LIB10OBJFILES)) > $(null,$(LIB10OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB10OBJFILES)"!=""
+.IF "$(LIB10FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB10FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB10FILES)"!=""
+ @+$(ECHONL)
+
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+ +$(ECHONL) $(LIB10OBJFILES) | sed "s#$(PRJ:s/././)/$(ROUT)#$(ROUT)#g" | xargs -n1 > $@
+ @+cat /dev/null $(LIB10FILES) | xargs -n1 >> $@
+.ELSE
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(LIB10FILES) $(LIB10OBJFILES))
+ @-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB10OBJFILES)"!=""
+ @$(TYPE) $(mktmp $(LIB10OBJFILES)) > $(null,$(LIB10OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB10OBJFILES)"!=""
+.IF "$(LIB10FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB10FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB10FILES)"!=""
+ @$(ECHONL)
+.ENDIF # "$(LIB10FILES)"!=""
+.ELSE # "$(GUI)"=="WNT"
+ @-$(RM) $@
+ .IF "$(VERBOSE)" == "TRUE"
+ @echo $(LIBMGR) r $@ $(LIB10OBJFILES)
+ .ENDIF
+ $(COMMAND_ECHO)$(LIBMGR) r $@ $(LIB10OBJFILES) $(LIB10FILES) bla.lib
+.ENDIF # "$(GUI)"=="WNT"
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(LIB10TARGET)" != ""
+
+# Anweisungen fuer das LIBTARGETs
diff --git a/solenv/inc/_tg_rslb.mk b/solenv/inc/_tg_rslb.mk
new file mode 100644
index 000000000000..4c67a1d58c97
--- /dev/null
+++ b/solenv/inc/_tg_rslb.mk
@@ -0,0 +1,610 @@
+# unroll begin
+
+.IF "$(RESLIB1TARGETN)"!=""
+
+$(RSC_MULTI1) : \
+ $(RESLIB1SRSFILES) \
+ $(RESLIB1TARGETN) \
+ $(RESLIB1BMPS)
+ @echo Compiling: $(@:f)
+.IF "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB1NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB1IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
+ -ft=$@ \
+ $(RSC1HEADER) $(RESLIB1SRSFILES) \
+ ) > $(NULLDEV)
+.ELSE # "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(BIN)/$(RESLIB1NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB1IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil=$(BIN) \
+ -ft=$@ \
+ $(RSC1HEADER) $(RESLIB1SRSFILES) \
+ ) > $(NULLDEV)
+.ENDIF # "$(common_build_reslib)"!=""
+
+$(RESLIB1TARGETN): \
+ $(RESLIB1SRSFILES) \
+ $(RESLIB1BMPS)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI1)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI1)
+.ENDIF # "$(common_build_reslib)"!=""
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI1)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI1)
+.ENDIF # "$(common_build_reslib)"!=""
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(RESLIB1TARGETN)"!=""
+
+
+# unroll begin
+
+.IF "$(RESLIB2TARGETN)"!=""
+
+$(RSC_MULTI2) : \
+ $(RESLIB2SRSFILES) \
+ $(RESLIB2TARGETN) \
+ $(RESLIB2BMPS)
+ @echo Compiling: $(@:f)
+.IF "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB2NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB2IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
+ -ft=$@ \
+ $(RSC2HEADER) $(RESLIB2SRSFILES) \
+ ) > $(NULLDEV)
+.ELSE # "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(BIN)/$(RESLIB2NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB2IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil=$(BIN) \
+ -ft=$@ \
+ $(RSC2HEADER) $(RESLIB2SRSFILES) \
+ ) > $(NULLDEV)
+.ENDIF # "$(common_build_reslib)"!=""
+
+$(RESLIB2TARGETN): \
+ $(RESLIB2SRSFILES) \
+ $(RESLIB2BMPS)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI2)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI2)
+.ENDIF # "$(common_build_reslib)"!=""
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI2)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI2)
+.ENDIF # "$(common_build_reslib)"!=""
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(RESLIB2TARGETN)"!=""
+
+
+# unroll begin
+
+.IF "$(RESLIB3TARGETN)"!=""
+
+$(RSC_MULTI3) : \
+ $(RESLIB3SRSFILES) \
+ $(RESLIB3TARGETN) \
+ $(RESLIB3BMPS)
+ @echo Compiling: $(@:f)
+.IF "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB3NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB3IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
+ -ft=$@ \
+ $(RSC3HEADER) $(RESLIB3SRSFILES) \
+ ) > $(NULLDEV)
+.ELSE # "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(BIN)/$(RESLIB3NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB3IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil=$(BIN) \
+ -ft=$@ \
+ $(RSC3HEADER) $(RESLIB3SRSFILES) \
+ ) > $(NULLDEV)
+.ENDIF # "$(common_build_reslib)"!=""
+
+$(RESLIB3TARGETN): \
+ $(RESLIB3SRSFILES) \
+ $(RESLIB3BMPS)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI3)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI3)
+.ENDIF # "$(common_build_reslib)"!=""
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI3)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI3)
+.ENDIF # "$(common_build_reslib)"!=""
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(RESLIB3TARGETN)"!=""
+
+
+# unroll begin
+
+.IF "$(RESLIB4TARGETN)"!=""
+
+$(RSC_MULTI4) : \
+ $(RESLIB4SRSFILES) \
+ $(RESLIB4TARGETN) \
+ $(RESLIB4BMPS)
+ @echo Compiling: $(@:f)
+.IF "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB4NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB4IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
+ -ft=$@ \
+ $(RSC4HEADER) $(RESLIB4SRSFILES) \
+ ) > $(NULLDEV)
+.ELSE # "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(BIN)/$(RESLIB4NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB4IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil=$(BIN) \
+ -ft=$@ \
+ $(RSC4HEADER) $(RESLIB4SRSFILES) \
+ ) > $(NULLDEV)
+.ENDIF # "$(common_build_reslib)"!=""
+
+$(RESLIB4TARGETN): \
+ $(RESLIB4SRSFILES) \
+ $(RESLIB4BMPS)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI4)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI4)
+.ENDIF # "$(common_build_reslib)"!=""
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI4)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI4)
+.ENDIF # "$(common_build_reslib)"!=""
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(RESLIB4TARGETN)"!=""
+
+
+# unroll begin
+
+.IF "$(RESLIB5TARGETN)"!=""
+
+$(RSC_MULTI5) : \
+ $(RESLIB5SRSFILES) \
+ $(RESLIB5TARGETN) \
+ $(RESLIB5BMPS)
+ @echo Compiling: $(@:f)
+.IF "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB5NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB5IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
+ -ft=$@ \
+ $(RSC5HEADER) $(RESLIB5SRSFILES) \
+ ) > $(NULLDEV)
+.ELSE # "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(BIN)/$(RESLIB5NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB5IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil=$(BIN) \
+ -ft=$@ \
+ $(RSC5HEADER) $(RESLIB5SRSFILES) \
+ ) > $(NULLDEV)
+.ENDIF # "$(common_build_reslib)"!=""
+
+$(RESLIB5TARGETN): \
+ $(RESLIB5SRSFILES) \
+ $(RESLIB5BMPS)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI5)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI5)
+.ENDIF # "$(common_build_reslib)"!=""
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI5)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI5)
+.ENDIF # "$(common_build_reslib)"!=""
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(RESLIB5TARGETN)"!=""
+
+
+# unroll begin
+
+.IF "$(RESLIB6TARGETN)"!=""
+
+$(RSC_MULTI6) : \
+ $(RESLIB6SRSFILES) \
+ $(RESLIB6TARGETN) \
+ $(RESLIB6BMPS)
+ @echo Compiling: $(@:f)
+.IF "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB6NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB6IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
+ -ft=$@ \
+ $(RSC6HEADER) $(RESLIB6SRSFILES) \
+ ) > $(NULLDEV)
+.ELSE # "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(BIN)/$(RESLIB6NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB6IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil=$(BIN) \
+ -ft=$@ \
+ $(RSC6HEADER) $(RESLIB6SRSFILES) \
+ ) > $(NULLDEV)
+.ENDIF # "$(common_build_reslib)"!=""
+
+$(RESLIB6TARGETN): \
+ $(RESLIB6SRSFILES) \
+ $(RESLIB6BMPS)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI6)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI6)
+.ENDIF # "$(common_build_reslib)"!=""
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI6)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI6)
+.ENDIF # "$(common_build_reslib)"!=""
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(RESLIB6TARGETN)"!=""
+
+
+# unroll begin
+
+.IF "$(RESLIB7TARGETN)"!=""
+
+$(RSC_MULTI7) : \
+ $(RESLIB7SRSFILES) \
+ $(RESLIB7TARGETN) \
+ $(RESLIB7BMPS)
+ @echo Compiling: $(@:f)
+.IF "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB7NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB7IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
+ -ft=$@ \
+ $(RSC7HEADER) $(RESLIB7SRSFILES) \
+ ) > $(NULLDEV)
+.ELSE # "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(BIN)/$(RESLIB7NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB7IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil=$(BIN) \
+ -ft=$@ \
+ $(RSC7HEADER) $(RESLIB7SRSFILES) \
+ ) > $(NULLDEV)
+.ENDIF # "$(common_build_reslib)"!=""
+
+$(RESLIB7TARGETN): \
+ $(RESLIB7SRSFILES) \
+ $(RESLIB7BMPS)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI7)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI7)
+.ENDIF # "$(common_build_reslib)"!=""
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI7)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI7)
+.ENDIF # "$(common_build_reslib)"!=""
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(RESLIB7TARGETN)"!=""
+
+
+# unroll begin
+
+.IF "$(RESLIB8TARGETN)"!=""
+
+$(RSC_MULTI8) : \
+ $(RESLIB8SRSFILES) \
+ $(RESLIB8TARGETN) \
+ $(RESLIB8BMPS)
+ @echo Compiling: $(@:f)
+.IF "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB8NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB8IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
+ -ft=$@ \
+ $(RSC8HEADER) $(RESLIB8SRSFILES) \
+ ) > $(NULLDEV)
+.ELSE # "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(BIN)/$(RESLIB8NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB8IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil=$(BIN) \
+ -ft=$@ \
+ $(RSC8HEADER) $(RESLIB8SRSFILES) \
+ ) > $(NULLDEV)
+.ENDIF # "$(common_build_reslib)"!=""
+
+$(RESLIB8TARGETN): \
+ $(RESLIB8SRSFILES) \
+ $(RESLIB8BMPS)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI8)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI8)
+.ENDIF # "$(common_build_reslib)"!=""
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI8)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI8)
+.ENDIF # "$(common_build_reslib)"!=""
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(RESLIB8TARGETN)"!=""
+
+
+# unroll begin
+
+.IF "$(RESLIB9TARGETN)"!=""
+
+$(RSC_MULTI9) : \
+ $(RESLIB9SRSFILES) \
+ $(RESLIB9TARGETN) \
+ $(RESLIB9BMPS)
+ @echo Compiling: $(@:f)
+.IF "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB9NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB9IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
+ -ft=$@ \
+ $(RSC9HEADER) $(RESLIB9SRSFILES) \
+ ) > $(NULLDEV)
+.ELSE # "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(BIN)/$(RESLIB9NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB9IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil=$(BIN) \
+ -ft=$@ \
+ $(RSC9HEADER) $(RESLIB9SRSFILES) \
+ ) > $(NULLDEV)
+.ENDIF # "$(common_build_reslib)"!=""
+
+$(RESLIB9TARGETN): \
+ $(RESLIB9SRSFILES) \
+ $(RESLIB9BMPS)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI9)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI9)
+.ENDIF # "$(common_build_reslib)"!=""
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI9)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI9)
+.ENDIF # "$(common_build_reslib)"!=""
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(RESLIB9TARGETN)"!=""
+
+
+# unroll begin
+
+.IF "$(RESLIB10TARGETN)"!=""
+
+$(RSC_MULTI10) : \
+ $(RESLIB10SRSFILES) \
+ $(RESLIB10TARGETN) \
+ $(RESLIB10BMPS)
+ @echo Compiling: $(@:f)
+.IF "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB10NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB10IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
+ -ft=$@ \
+ $(RSC10HEADER) $(RESLIB10SRSFILES) \
+ ) > $(NULLDEV)
+.ELSE # "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(BIN)/$(RESLIB10NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB10IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil=$(BIN) \
+ -ft=$@ \
+ $(RSC10HEADER) $(RESLIB10SRSFILES) \
+ ) > $(NULLDEV)
+.ENDIF # "$(common_build_reslib)"!=""
+
+$(RESLIB10TARGETN): \
+ $(RESLIB10SRSFILES) \
+ $(RESLIB10BMPS)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI10)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI10)
+.ENDIF # "$(common_build_reslib)"!=""
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI10)
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI10)
+.ENDIF # "$(common_build_reslib)"!=""
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(RESLIB10TARGETN)"!=""
+
+
diff --git a/solenv/inc/_tg_scp.mk b/solenv/inc/_tg_scp.mk
new file mode 100644
index 000000000000..d13e57990592
--- /dev/null
+++ b/solenv/inc/_tg_scp.mk
@@ -0,0 +1,180 @@
+# unroll begin
+
+.IF "$(SCP1TARGETN)"!=""
+
+# try to get missing parfiles
+$(PAR)/%.par : $(SOLARPARDIR)/%.par
+ @@-$(MKDIRHIER) $(@:d:d)
+ $(COMMAND_ECHO)$(COPY) $< $@
+
+LOCALSCP1FILES+=$(foreach,i,$(SCP1FILES) $(foreach,j,$(SCP1LINK_PRODUCT_TYPE) $(PAR)/$j/$i ))
+
+$(SCP1TARGETN): $(LOCALSCP1FILES)
+ @echo "Making: " $(@:f)
+ @@-$(MKDIRHIER) $(BIN)/$(SCP1LINK_PRODUCT_TYPE)
+ $(COMMAND_ECHO)$(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP1FILES) $(subst,$(@:d:d:d), $(@:d:d))/$(i:+","))) -o $@
+.ENDIF
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(SCP2TARGETN)"!=""
+
+# try to get missing parfiles
+$(PAR)/%.par : $(SOLARPARDIR)/%.par
+ @@-$(MKDIRHIER) $(@:d:d)
+ $(COMMAND_ECHO)$(COPY) $< $@
+
+LOCALSCP2FILES+=$(foreach,i,$(SCP2FILES) $(foreach,j,$(SCP2LINK_PRODUCT_TYPE) $(PAR)/$j/$i ))
+
+$(SCP2TARGETN): $(LOCALSCP2FILES)
+ @echo "Making: " $(@:f)
+ @@-$(MKDIRHIER) $(BIN)/$(SCP2LINK_PRODUCT_TYPE)
+ $(COMMAND_ECHO)$(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP2FILES) $(subst,$(@:d:d:d), $(@:d:d))/$(i:+","))) -o $@
+.ENDIF
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(SCP3TARGETN)"!=""
+
+# try to get missing parfiles
+$(PAR)/%.par : $(SOLARPARDIR)/%.par
+ @@-$(MKDIRHIER) $(@:d:d)
+ $(COMMAND_ECHO)$(COPY) $< $@
+
+LOCALSCP3FILES+=$(foreach,i,$(SCP3FILES) $(foreach,j,$(SCP3LINK_PRODUCT_TYPE) $(PAR)/$j/$i ))
+
+$(SCP3TARGETN): $(LOCALSCP3FILES)
+ @echo "Making: " $(@:f)
+ @@-$(MKDIRHIER) $(BIN)/$(SCP3LINK_PRODUCT_TYPE)
+ $(COMMAND_ECHO)$(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP3FILES) $(subst,$(@:d:d:d), $(@:d:d))/$(i:+","))) -o $@
+.ENDIF
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(SCP4TARGETN)"!=""
+
+# try to get missing parfiles
+$(PAR)/%.par : $(SOLARPARDIR)/%.par
+ @@-$(MKDIRHIER) $(@:d:d)
+ $(COMMAND_ECHO)$(COPY) $< $@
+
+LOCALSCP4FILES+=$(foreach,i,$(SCP4FILES) $(foreach,j,$(SCP4LINK_PRODUCT_TYPE) $(PAR)/$j/$i ))
+
+$(SCP4TARGETN): $(LOCALSCP4FILES)
+ @echo "Making: " $(@:f)
+ @@-$(MKDIRHIER) $(BIN)/$(SCP4LINK_PRODUCT_TYPE)
+ $(COMMAND_ECHO)$(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP4FILES) $(subst,$(@:d:d:d), $(@:d:d))/$(i:+","))) -o $@
+.ENDIF
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(SCP5TARGETN)"!=""
+
+# try to get missing parfiles
+$(PAR)/%.par : $(SOLARPARDIR)/%.par
+ @@-$(MKDIRHIER) $(@:d:d)
+ $(COMMAND_ECHO)$(COPY) $< $@
+
+LOCALSCP5FILES+=$(foreach,i,$(SCP5FILES) $(foreach,j,$(SCP5LINK_PRODUCT_TYPE) $(PAR)/$j/$i ))
+
+$(SCP5TARGETN): $(LOCALSCP5FILES)
+ @echo "Making: " $(@:f)
+ @@-$(MKDIRHIER) $(BIN)/$(SCP5LINK_PRODUCT_TYPE)
+ $(COMMAND_ECHO)$(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP5FILES) $(subst,$(@:d:d:d), $(@:d:d))/$(i:+","))) -o $@
+.ENDIF
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(SCP6TARGETN)"!=""
+
+# try to get missing parfiles
+$(PAR)/%.par : $(SOLARPARDIR)/%.par
+ @@-$(MKDIRHIER) $(@:d:d)
+ $(COMMAND_ECHO)$(COPY) $< $@
+
+LOCALSCP6FILES+=$(foreach,i,$(SCP6FILES) $(foreach,j,$(SCP6LINK_PRODUCT_TYPE) $(PAR)/$j/$i ))
+
+$(SCP6TARGETN): $(LOCALSCP6FILES)
+ @echo "Making: " $(@:f)
+ @@-$(MKDIRHIER) $(BIN)/$(SCP6LINK_PRODUCT_TYPE)
+ $(COMMAND_ECHO)$(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP6FILES) $(subst,$(@:d:d:d), $(@:d:d))/$(i:+","))) -o $@
+.ENDIF
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(SCP7TARGETN)"!=""
+
+# try to get missing parfiles
+$(PAR)/%.par : $(SOLARPARDIR)/%.par
+ @@-$(MKDIRHIER) $(@:d:d)
+ $(COMMAND_ECHO)$(COPY) $< $@
+
+LOCALSCP7FILES+=$(foreach,i,$(SCP7FILES) $(foreach,j,$(SCP7LINK_PRODUCT_TYPE) $(PAR)/$j/$i ))
+
+$(SCP7TARGETN): $(LOCALSCP7FILES)
+ @echo "Making: " $(@:f)
+ @@-$(MKDIRHIER) $(BIN)/$(SCP7LINK_PRODUCT_TYPE)
+ $(COMMAND_ECHO)$(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP7FILES) $(subst,$(@:d:d:d), $(@:d:d))/$(i:+","))) -o $@
+.ENDIF
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(SCP8TARGETN)"!=""
+
+# try to get missing parfiles
+$(PAR)/%.par : $(SOLARPARDIR)/%.par
+ @@-$(MKDIRHIER) $(@:d:d)
+ $(COMMAND_ECHO)$(COPY) $< $@
+
+LOCALSCP8FILES+=$(foreach,i,$(SCP8FILES) $(foreach,j,$(SCP8LINK_PRODUCT_TYPE) $(PAR)/$j/$i ))
+
+$(SCP8TARGETN): $(LOCALSCP8FILES)
+ @echo "Making: " $(@:f)
+ @@-$(MKDIRHIER) $(BIN)/$(SCP8LINK_PRODUCT_TYPE)
+ $(COMMAND_ECHO)$(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP8FILES) $(subst,$(@:d:d:d), $(@:d:d))/$(i:+","))) -o $@
+.ENDIF
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(SCP9TARGETN)"!=""
+
+# try to get missing parfiles
+$(PAR)/%.par : $(SOLARPARDIR)/%.par
+ @@-$(MKDIRHIER) $(@:d:d)
+ $(COMMAND_ECHO)$(COPY) $< $@
+
+LOCALSCP9FILES+=$(foreach,i,$(SCP9FILES) $(foreach,j,$(SCP9LINK_PRODUCT_TYPE) $(PAR)/$j/$i ))
+
+$(SCP9TARGETN): $(LOCALSCP9FILES)
+ @echo "Making: " $(@:f)
+ @@-$(MKDIRHIER) $(BIN)/$(SCP9LINK_PRODUCT_TYPE)
+ $(COMMAND_ECHO)$(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP9FILES) $(subst,$(@:d:d:d), $(@:d:d))/$(i:+","))) -o $@
+.ENDIF
+
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(SCP10TARGETN)"!=""
+
+# try to get missing parfiles
+$(PAR)/%.par : $(SOLARPARDIR)/%.par
+ @@-$(MKDIRHIER) $(@:d:d)
+ $(COMMAND_ECHO)$(COPY) $< $@
+
+LOCALSCP10FILES+=$(foreach,i,$(SCP10FILES) $(foreach,j,$(SCP10LINK_PRODUCT_TYPE) $(PAR)/$j/$i ))
+
+$(SCP10TARGETN): $(LOCALSCP10FILES)
+ @echo "Making: " $(@:f)
+ @@-$(MKDIRHIER) $(BIN)/$(SCP10LINK_PRODUCT_TYPE)
+ $(COMMAND_ECHO)$(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP10FILES) $(subst,$(@:d:d:d), $(@:d:d))/$(i:+","))) -o $@
+.ENDIF
+
+# Anweisungen fuer das Linken
diff --git a/solenv/inc/_tg_sdi.mk b/solenv/inc/_tg_sdi.mk
new file mode 100644
index 000000000000..45ea433b04b2
--- /dev/null
+++ b/solenv/inc/_tg_sdi.mk
@@ -0,0 +1,180 @@
+# unroll begin
+
+.IF "$(SDI1TARGET)"!=""
+$(SDI1TARGET): $(SVSDI1DEPEND) $(SDI1NAME).sdi
+ @echo "Making: " $(@:f)
+ @-$(RM) $@
+ $(COMMAND_ECHO)$(SVIDL) @$(mktmp \
+ $(VERBOSITY) \
+ -fs$(INCCOMX)/$(SDI1NAME).hxx \
+ -fd$(INCCOMX)/$(SDI1NAME).ilb \
+ -fm$(MISC)/$(SDI1NAME).don \
+ -fl$(MISC)/$(SDI1NAME).lst \
+ -fx$(SDI1EXPORT).sdi \
+ -fz$(MISC)/$(SDI1NAME).sid \
+ $(SDI1NAME).sdi -I$(MISC) -I$(SVSDIINC) -I$(INC) $(INCLUDE))
+.ENDIF # "$(SDI1TARGET)"!=""
+
+# Instruction for ???
+# unroll begin
+
+.IF "$(SDI2TARGET)"!=""
+$(SDI2TARGET): $(SVSDI2DEPEND) $(SDI2NAME).sdi
+ @echo "Making: " $(@:f)
+ @-$(RM) $@
+ $(COMMAND_ECHO)$(SVIDL) @$(mktmp \
+ $(VERBOSITY) \
+ -fs$(INCCOMX)/$(SDI2NAME).hxx \
+ -fd$(INCCOMX)/$(SDI2NAME).ilb \
+ -fm$(MISC)/$(SDI2NAME).don \
+ -fl$(MISC)/$(SDI2NAME).lst \
+ -fx$(SDI2EXPORT).sdi \
+ -fz$(MISC)/$(SDI2NAME).sid \
+ $(SDI2NAME).sdi -I$(MISC) -I$(SVSDIINC) -I$(INC) $(INCLUDE))
+.ENDIF # "$(SDI2TARGET)"!=""
+
+# Instruction for ???
+# unroll begin
+
+.IF "$(SDI3TARGET)"!=""
+$(SDI3TARGET): $(SVSDI3DEPEND) $(SDI3NAME).sdi
+ @echo "Making: " $(@:f)
+ @-$(RM) $@
+ $(COMMAND_ECHO)$(SVIDL) @$(mktmp \
+ $(VERBOSITY) \
+ -fs$(INCCOMX)/$(SDI3NAME).hxx \
+ -fd$(INCCOMX)/$(SDI3NAME).ilb \
+ -fm$(MISC)/$(SDI3NAME).don \
+ -fl$(MISC)/$(SDI3NAME).lst \
+ -fx$(SDI3EXPORT).sdi \
+ -fz$(MISC)/$(SDI3NAME).sid \
+ $(SDI3NAME).sdi -I$(MISC) -I$(SVSDIINC) -I$(INC) $(INCLUDE))
+.ENDIF # "$(SDI3TARGET)"!=""
+
+# Instruction for ???
+# unroll begin
+
+.IF "$(SDI4TARGET)"!=""
+$(SDI4TARGET): $(SVSDI4DEPEND) $(SDI4NAME).sdi
+ @echo "Making: " $(@:f)
+ @-$(RM) $@
+ $(COMMAND_ECHO)$(SVIDL) @$(mktmp \
+ $(VERBOSITY) \
+ -fs$(INCCOMX)/$(SDI4NAME).hxx \
+ -fd$(INCCOMX)/$(SDI4NAME).ilb \
+ -fm$(MISC)/$(SDI4NAME).don \
+ -fl$(MISC)/$(SDI4NAME).lst \
+ -fx$(SDI4EXPORT).sdi \
+ -fz$(MISC)/$(SDI4NAME).sid \
+ $(SDI4NAME).sdi -I$(MISC) -I$(SVSDIINC) -I$(INC) $(INCLUDE))
+.ENDIF # "$(SDI4TARGET)"!=""
+
+# Instruction for ???
+# unroll begin
+
+.IF "$(SDI5TARGET)"!=""
+$(SDI5TARGET): $(SVSDI5DEPEND) $(SDI5NAME).sdi
+ @echo "Making: " $(@:f)
+ @-$(RM) $@
+ $(COMMAND_ECHO)$(SVIDL) @$(mktmp \
+ $(VERBOSITY) \
+ -fs$(INCCOMX)/$(SDI5NAME).hxx \
+ -fd$(INCCOMX)/$(SDI5NAME).ilb \
+ -fm$(MISC)/$(SDI5NAME).don \
+ -fl$(MISC)/$(SDI5NAME).lst \
+ -fx$(SDI5EXPORT).sdi \
+ -fz$(MISC)/$(SDI5NAME).sid \
+ $(SDI5NAME).sdi -I$(MISC) -I$(SVSDIINC) -I$(INC) $(INCLUDE))
+.ENDIF # "$(SDI5TARGET)"!=""
+
+# Instruction for ???
+# unroll begin
+
+.IF "$(SDI6TARGET)"!=""
+$(SDI6TARGET): $(SVSDI6DEPEND) $(SDI6NAME).sdi
+ @echo "Making: " $(@:f)
+ @-$(RM) $@
+ $(COMMAND_ECHO)$(SVIDL) @$(mktmp \
+ $(VERBOSITY) \
+ -fs$(INCCOMX)/$(SDI6NAME).hxx \
+ -fd$(INCCOMX)/$(SDI6NAME).ilb \
+ -fm$(MISC)/$(SDI6NAME).don \
+ -fl$(MISC)/$(SDI6NAME).lst \
+ -fx$(SDI6EXPORT).sdi \
+ -fz$(MISC)/$(SDI6NAME).sid \
+ $(SDI6NAME).sdi -I$(MISC) -I$(SVSDIINC) -I$(INC) $(INCLUDE))
+.ENDIF # "$(SDI6TARGET)"!=""
+
+# Instruction for ???
+# unroll begin
+
+.IF "$(SDI7TARGET)"!=""
+$(SDI7TARGET): $(SVSDI7DEPEND) $(SDI7NAME).sdi
+ @echo "Making: " $(@:f)
+ @-$(RM) $@
+ $(COMMAND_ECHO)$(SVIDL) @$(mktmp \
+ $(VERBOSITY) \
+ -fs$(INCCOMX)/$(SDI7NAME).hxx \
+ -fd$(INCCOMX)/$(SDI7NAME).ilb \
+ -fm$(MISC)/$(SDI7NAME).don \
+ -fl$(MISC)/$(SDI7NAME).lst \
+ -fx$(SDI7EXPORT).sdi \
+ -fz$(MISC)/$(SDI7NAME).sid \
+ $(SDI7NAME).sdi -I$(MISC) -I$(SVSDIINC) -I$(INC) $(INCLUDE))
+.ENDIF # "$(SDI7TARGET)"!=""
+
+# Instruction for ???
+# unroll begin
+
+.IF "$(SDI8TARGET)"!=""
+$(SDI8TARGET): $(SVSDI8DEPEND) $(SDI8NAME).sdi
+ @echo "Making: " $(@:f)
+ @-$(RM) $@
+ $(COMMAND_ECHO)$(SVIDL) @$(mktmp \
+ $(VERBOSITY) \
+ -fs$(INCCOMX)/$(SDI8NAME).hxx \
+ -fd$(INCCOMX)/$(SDI8NAME).ilb \
+ -fm$(MISC)/$(SDI8NAME).don \
+ -fl$(MISC)/$(SDI8NAME).lst \
+ -fx$(SDI8EXPORT).sdi \
+ -fz$(MISC)/$(SDI8NAME).sid \
+ $(SDI8NAME).sdi -I$(MISC) -I$(SVSDIINC) -I$(INC) $(INCLUDE))
+.ENDIF # "$(SDI8TARGET)"!=""
+
+# Instruction for ???
+# unroll begin
+
+.IF "$(SDI9TARGET)"!=""
+$(SDI9TARGET): $(SVSDI9DEPEND) $(SDI9NAME).sdi
+ @echo "Making: " $(@:f)
+ @-$(RM) $@
+ $(COMMAND_ECHO)$(SVIDL) @$(mktmp \
+ $(VERBOSITY) \
+ -fs$(INCCOMX)/$(SDI9NAME).hxx \
+ -fd$(INCCOMX)/$(SDI9NAME).ilb \
+ -fm$(MISC)/$(SDI9NAME).don \
+ -fl$(MISC)/$(SDI9NAME).lst \
+ -fx$(SDI9EXPORT).sdi \
+ -fz$(MISC)/$(SDI9NAME).sid \
+ $(SDI9NAME).sdi -I$(MISC) -I$(SVSDIINC) -I$(INC) $(INCLUDE))
+.ENDIF # "$(SDI9TARGET)"!=""
+
+# Instruction for ???
+# unroll begin
+
+.IF "$(SDI10TARGET)"!=""
+$(SDI10TARGET): $(SVSDI10DEPEND) $(SDI10NAME).sdi
+ @echo "Making: " $(@:f)
+ @-$(RM) $@
+ $(COMMAND_ECHO)$(SVIDL) @$(mktmp \
+ $(VERBOSITY) \
+ -fs$(INCCOMX)/$(SDI10NAME).hxx \
+ -fd$(INCCOMX)/$(SDI10NAME).ilb \
+ -fm$(MISC)/$(SDI10NAME).don \
+ -fl$(MISC)/$(SDI10NAME).lst \
+ -fx$(SDI10EXPORT).sdi \
+ -fz$(MISC)/$(SDI10NAME).sid \
+ $(SDI10NAME).sdi -I$(MISC) -I$(SVSDIINC) -I$(INC) $(INCLUDE))
+.ENDIF # "$(SDI10TARGET)"!=""
+
+# Instruction for ???
diff --git a/solenv/inc/_tg_shl.mk b/solenv/inc/_tg_shl.mk
new file mode 100644
index 000000000000..41d48c839949
--- /dev/null
+++ b/solenv/inc/_tg_shl.mk
@@ -0,0 +1,5980 @@
+# unroll begin
+
+.IF "$(SHL1TARGETN)"!=""
+
+.IF "$(OS)"=="AIX"
+SHL1STDLIBS=
+.ENDIF
+
+.IF "$(SHLLINKARCONLY)" != ""
+SHL1STDLIBS=
+STDSHL=
+.ELSE
+SHL1ARCHIVES=
+.ENDIF
+
+# decide how to link
+.IF "$(SHL1CODETYPE)"=="C"
+SHL1LINKER=$(LINKC)
+SHL1STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
+SHL1LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(SHL1CODETYPE)"=="C"
+SHL1LINKER=$(LINK)
+SHL1STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
+SHL1LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(SHL1CODETYPE)"=="C"
+
+SHL1RPATH*=OOO
+LINKFLAGSRUNPATH_$(SHL1RPATH)*=/ERROR:/Bad_SHL1RPATH_value
+SHL1LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL1RPATH))
+
+.IF "$(SHL1USE_EXPORTS)"==""
+SHL1DEF*=$(MISC)/$(SHL1TARGET).def
+.ENDIF # "$(SHL1USE_EXPORTS)"==""
+
+EXTRALIBPATHS1=$(EXTRALIBPATHS)
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL1NOCHECK)"==""
+.IF "$(SOLAR_STLLIBPATH)"!=""
+EXTRALIBPATHS1+=-L$(SOLAR_STLLIBPATH)
+.ENDIF
+.ENDIF # "$(SHL1NOCHECK)"!=""
+.ENDIF
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#+++++++++++ version object ++++++++++++++++++++++++++++++++++++++++
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.IF "$(L10N_framework)"==""
+.IF "$(VERSIONOBJ)"!=""
+SHL1VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL1TARGET))}$(VERSIONOBJ:f)
+USE_VERSIONH:=$(INCCOM)/$(SHL1VERSIONOBJ:b).h
+.IF "$(GUI)" == "UNX"
+SHL1VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL1TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
+.ELSE # "$(GUI)" == "UNX"
+SHL1VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL1TARGET))}$(VERSIONOBJ:f)
+.ENDIF # "$(GUI)" == "UNX"
+$(MISC)/$(SHL1VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL1VERSIONOBJ:b).h
+# $(COPY) $(SOLARENV)/src/version.c $@
+ $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL1VERSIONOBJ:b).h/ > $@
+
+.INIT : $(SHL1VERSIONOBJDEP)
+.ENDIF # "$(VERSIONOBJ)"!=""
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL1IMPLIB)" == ""
+SHL1IMPLIB=i$(TARGET)_t1
+.ENDIF # "$(SHL1IMPLIB)" == ""
+.IF "$(COM)" != "GCC"
+USE_1IMPLIB=-implib:$(LB)/$(SHL1IMPLIB).lib
+.ENDIF # "$(COM)" != "GCC"
+SHL1IMPLIBN=$(LB)/$(SHL1IMPLIB).lib
+ALLTAR : $(SHL1IMPLIBN)
+
+.IF "$(USE_DEFFILE)"==""
+USE_1IMPLIB_DEPS=$(LB)/$(SHL1IMPLIB).lib
+.ENDIF # "$(USE_DEFFILE)"==""
+.ENDIF # "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+USE_SHL1DEF=$(SHL1DEF)
+.ELSE # "$(GUI)" != "UNX"
+USE_SHL1DEF=
+SHL1DEPN+:=$(SHL1DEPNU)
+
+.IF "$(SHL1VERSIONMAP)"==""
+# to activate vmaps remove "#"
+USE_SHL1VERSIONMAP=$(MISC)/$(SHL1TARGET).vmap
+.ENDIF # "$(SHL1VERSIONMAP)"==""
+
+.IF "$(USE_SHL1VERSIONMAP)"!=""
+
+.IF "$(SHL1FILTERFILE)"!=""
+.IF "$(SHL1VERSIONMAP)"!=""
+#eine von beiden ist zuviel
+USE_SHL1VERSIONMAP=$(MISC)/$(SHL1TARGET).vmap
+$(USE_SHL1VERSIONMAP) .PHONY:
+ @echo -----------------------------
+ @echo you should only use versionmap OR exportfile
+ @echo -----------------------------
+# force_dmake_to_error
+
+.ENDIF # "$(SHL1VERSIONMAP)"!=""
+
+SHL1VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL1VERSIONMAP)
+
+$(USE_SHL1VERSIONMAP): \
+ $(SHL1OBJS)\
+ $(SHL1LIBS)\
+ $(SHL1FILTERFILE)
+ @$(RM) $@.dump
+.IF "$(SHL1OBJS)"!=""
+# dump remaining objects on the fly
+.IF "$(OS)"=="MACOSX"
+ @-nm $(SHL1OBJS:s/.obj/.o/) > $@.dump
+.ELSE
+ @nm $(SHL1OBJS:s/.obj/.o/) > $@.dump
+.ENDIF
+.ENDIF # "$(SHL1OBJS)!"=""
+ @$(TYPE) /dev/null $(SHL1LIBS:s/.lib/.dump/) >> $@.dump
+ $(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL1INTERFACE) -f $(SHL1FILTERFILE) -m $@
+
+.ELSE # "$(SHL1FILTERFILE)"!=""
+USE_SHL1VERSIONMAP=$(MISC)/$(SHL1TARGET).vmap
+$(USE_SHL1VERSIONMAP) :
+.IF "$(VERBOSE)" == "TRUE"
+ @echo -----------------------------
+ @echo SHL1FILTERFILE not set!
+ @echo -----------------------------
+ @$(TOUCH) $@
+ @echo dummy file to keep the dependencies for later use.
+.ELSE
+ @$(TOUCH) $@
+.ENDIF
+# force_dmake_to_error
+.ENDIF # "$(SHL1FILTERFILE)"!=""
+.ELSE # "$(USE_SHL1VERSIONMAP)"!=""
+
+#and now for the plain non-generic way...
+.IF "$(SHL1VERSIONMAP)"!=""
+USE_SHL1VERSIONMAP=$(MISC)/$(SHL1VERSIONMAP:b)_$(SHL1TARGET)$(SHL1VERSIONMAP:e)
+SHL1VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL1VERSIONMAP)
+
+.IF "$(OS)"=="MACOSX"
+$(USE_SHL1VERSIONMAP): $(SHL1OBJS) $(SHL1LIBS)
+.ENDIF
+
+# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
+# even if the $(AWK) part fails:
+$(USE_SHL1VERSIONMAP) .ERRREMOVE: $(SHL1VERSIONMAP)
+ @@-$(RM) -f $@
+# The following files will only be generated and needed on Mac OS X as temporary files
+# in order to generate exported symbols list out of Linux/Solaris map files
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) -f $@.symregexp >& $(NULLDEV)
+ @-$(RM) -f $@.expsymlist >& $(NULLDEV)
+.ENDIF
+# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
+# happens if somebody will change it in the future
+.IF "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL1VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
+.ELIF "$(COMNAME)"=="sunpro5"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL1VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
+.ELSE # "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL1VERSIONMAP) > $@
+.ENDIF # "$(COMID)"=="gcc3"
+ @chmod a+w $@
+# Mac OS X post-processing generate an exported symbols list from the generated map file
+# for details on exported symbols list see man ld on Mac OS X
+.IF "$(OS)"=="MACOSX"
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+.IF "$(SHL1OBJS)"!=""
+ -echo $(foreach,i,$(SHL1OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+.IF "$(SHL1LIBS)"!=""
+ $(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL1LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ cp $@.exported-symbols $@
+.ENDIF # .IF "$(OS)"=="MACOSX"
+.ENDIF # "$(SHL1VERSIONMAP)"!=""
+.ENDIF # "$(USE_SHL1VERSIONMAP)"!=""
+.ENDIF # "$(GUI)" != "UNX"
+
+.IF "$(UNIXVERSIONNAMES)"!=""
+.IF "$(OS)"!="MACOSX"
+.IF "$(GUI)"=="UNX"
+SHL1SONAME=\"$(SONAME_SWITCH)$(SHL1TARGETN:f)\"
+.ENDIF # "$(GUI)"!="UNX"
+.ENDIF # "$(OS)"!="MACOSX"
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+
+.IF "$(SHL1RES)"!=""
+SHL1ALLRES+=$(SHL1RES)
+SHL1LINKRES*=$(MISC)/$(SHL1TARGET).res
+SHL1LINKRESO*=$(MISC)/$(SHL1TARGET)_res.o
+.ENDIF # "$(SHL1RES)"!=""
+
+.IF "$(SHL1DEFAULTRES)$(use_shl_versions)"!=""
+SHL1DEFAULTRES*=$(MISC)/$(SHL1TARGET)_def.res
+SHL1ALLRES+=$(SHL1DEFAULTRES)
+SHL1LINKRES*=$(MISC)/$(SHL1TARGET).res
+SHL1LINKRESO*=$(MISC)/$(SHL1TARGET)_res.o
+.ENDIF # "$(SHL1DEFAULTRES)$(use_shl_versions)"!=""
+
+#.IF "$(SHL1TARGETN)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL1LIBS)"!=""
+$(MISC)/$(SHL1TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL1LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL1LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(SHL1TARGETN:b)_linkinc.ls
+$(SHL1TARGETN) : $(LINKINCTARGETS)
+
+.ELSE
+.IF "$(SHL1USE_EXPORTS)"=="name"
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(COM)"!="GCC"
+.IF "$(SHL1LIBS)"!=""
+SHL1LINKLIST=$(MISC)/$(SHL1TARGET)_link.lst
+SHL1LINKLISTPARAM=@$(SHL1LINKLIST)
+$(SHL1LINKLIST) : $(SHL1LIBS)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL1LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL1LIBS)"!=""
+.ENDIF # "$(COM)"!="GCC"
+.ENDIF
+.ENDIF # "$(SHL1USE_EXPORTS)"=="name"
+
+$(MISC)/%linkinc.ls:
+ @echo . > $@
+.ENDIF # "$(linkinc)"!=""
+
+.IF "$(GUI)" == "OS2"
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL1TARGET8=$(shell @fix_shl $(SHL1TARGET))
+.ENDIF
+
+.IF "$(GUI)" == "OS2"
+_SHL1IMP_ORD = $(SHL1STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL1STDLIBS:^"$(LB)/")
+SHL1IMP_ORD = $(foreach,i,$(_SHL1IMP_ORD) $(shell @-ls $i))
+.ELSE
+SHL1IMP_ORD =
+.ENDIF
+
+
+$(SHL1TARGETN) : \
+ $(SHL1OBJS)\
+ $(SHL1LIBS)\
+ $(USE_1IMPLIB_DEPS)\
+ $(USE_SHL1DEF)\
+ $(USE_SHL1VERSIONMAP)\
+ $(SHL1RES)\
+ $(SHL1DEPN) \
+ $(SHL1IMP_ORD) \
+ $(SHL1LINKLIST)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(SHL1DEFAULTRES)"!=""
+ @@-$(RM) $(MISC)/$(SHL1DEFAULTRES:b).rc
+.IF "$(SHL1ICON)" != ""
+ @echo 1 ICON $(SHL1ICON) >> $(MISC)/$(SHL1DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL1ADD_VERINFO)"!=""
+ @echo $(EMQ)#include $(EMQ)"$(SHL1ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL1DEFAULTRES:b).rc
+.ELSE # "$(SHL1ADD_VERINFO)"!=""
+ @echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL1DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL1DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL1DEFAULTRES:b).rc
+.ENDIF # "$(SHL1ADD_VERINFO)"!=""
+ @echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(SHL1DEFAULTRES:b).rc
+ @echo $(EMQ)#define ORG_NAME $(SHL1TARGET)$(DLLPOST) >> $(MISC)/$(SHL1DEFAULTRES:b).rc
+ @echo $(EMQ)#define INTERNAL_NAME $(SHL1TARGET:b) >> $(MISC)/$(SHL1DEFAULTRES:b).rc
+ @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL1DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL1DEFAULTRES:b).rc
+.ENDIF # "$(SHL1DEFAULTRES)"!=""
+.IF "$(SHL1ALLRES)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(SHL1ALLRES) > $(SHL1LINKRES)
+.IF "$(COM)"=="GCC"
+ windres $(SHL1LINKRES) $(SHL1LINKRESO)
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(SHL1ALLRES)"!=""
+.IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def
+ @echo dlltool --dllname $(SHL1TARGET)$(DLLPOST) \
+ --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_1.cmd
+ @noop $(assign ALL1OBJLIST:=$(STDOBJ) $(SHL1OBJS) $(SHL1LINKRESO) $(shell $(TYPE) /dev/null $(SHL1LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+.IF "$(DEFLIB1NAME)"!="" # do not have to include objs
+ @noop $(assign DEF1OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB1NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+ @noop $(foreach,i,$(DEF1OBJLIST) $(assign ALL1OBJLIST:=$(ALL1OBJLIST:s?$i??)))
+.ENDIF # "$(DEFLIB1NAME)"!=""
+ @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_1.cmd
+.IF "$(SHL1DEF)"!=""
+ @echo --input-def $(SHL1DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_1.cmd
+.ELSE
+ @echo $(SHL1VERSIONOBJ) $(SHL1DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_1.cmd
+.ENDIF
+ @echo $(ALL1OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_1.cmd
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
+ $(STDOBJ) $(SHL1VERSIONOBJ) $(SHL1DESCRIPTIONOBJ) $(SHL1OBJS) $(SHL1LINKRESO) \
+ `$(TYPE) /dev/null $(SHL1LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ -Wl,--exclude-libs,ALL,--start-group $(SHL1STDLIBS) -Wl,--end-group \
+ $(SHL1STDSHL) $(STDSHL1) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
+ -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_1.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_1.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_1.cmd
+.ELSE
+.IF "$(linkinc)"==""
+.IF "$(SHL1USE_EXPORTS)"!="name"
+.IF "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL1LINKER) @$(mktmp \
+ $(SHL1LINKFLAGS) \
+ $(LINKFLAGSSHL) \
+ $(SHL1STACK) $(SHL1BASEX) \
+ -out:$@ \
+ -map:$(MISC)/$(@:b).map \
+ -def:$(SHL1DEF) \
+ $(USE_1IMPLIB) \
+ $(STDOBJ) \
+ $(SHL1VERSIONOBJ) $(SHL1OBJS) \
+ $(SHL1LIBS) \
+ $(SHL1STDLIBS) \
+ $(SHL1STDSHL) $(STDSHL1) \
+ $(SHL1LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE # "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL1LINKER) @$(mktmp $(SHL1LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL1BASEX) \
+ $(SHL1STACK) -out:$(SHL1TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(LB)/$(SHL1IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL1OBJS) $(SHL1VERSIONOBJ) \
+ $(SHL1LIBS) \
+ $(SHL1STDLIBS) \
+ $(SHL1STDSHL) $(STDSHL1) \
+ $(SHL1LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(USE_DEFFILE)"!=""
+.ELSE # "$(SHL1USE_EXPORTS)"!="name"
+ $(COMMAND_ECHO)$(SHL1LINKER) @$(mktmp $(SHL1LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL1BASEX) \
+ $(SHL1STACK) -out:$(SHL1TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(USE_1IMPLIB) \
+ $(STDOBJ) \
+ $(SHL1OBJS) $(SHL1VERSIONOBJ)) \
+ $(SHL1LINKLISTPARAM) \
+ @$(mktmp $(SHL1STDLIBS) \
+ $(SHL1STDSHL) $(STDSHL1) \
+ $(SHL1LINKRES) \
+ )
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(SHL1USE_EXPORTS)"!="name"
+.ELSE # "$(linkinc)"==""
+ $(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL1TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL1TARGET).lst
+ $(COMMAND_ECHO)$(TYPE) $(mktmp \
+ $(SHL1LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL1BASEX) \
+ $(SHL1STACK) $(MAPFILE) \
+ -out:$@ \
+ $(LB)/$(SHL1IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL1OBJS) \
+ $(SHL1STDLIBS) \
+ $(SHL1STDSHL) $(STDSHL1) \
+ $(SHL1LINKRES) \
+ ) >> $(MISC)/$(SHL1TARGET).lnk
+ $(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL1TARGETN:b)_linkinc.ls >> $(MISC)/$(SHL1TARGET).lnk
+ $(COMMAND_ECHO)$(SHL1LINKER) @$(MISC)/$(SHL1TARGET).lnk
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(linkinc)"==""
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)" == "WNT"
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_1.cmd
+ @echo $(STDSLO) $(SHL1OBJS:s/.obj/.o/) \
+ $(SHL1VERSIONOBJ) \
+ `cat /dev/null $(SHL1LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(SHL1LINKER) $(SHL1LINKFLAGS) $(SHL1VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
+ $(SHL1STDLIBS) $(SHL1ARCHIVES) $(SHL1STDSHL) $(STDSHL1) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_1.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_1.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_1.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_1.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_1.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ shl $(SHL1RPATH) $@
+.IF "$(SHL1CREATEJNILIB)"!=""
+ @echo "Making: " $(@:f).jnilib
+ @macosx-create-bundle $@
+.ENDIF # "$(SHL1CREATEJNILIB)"!=""
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL1NOCHECK)"==""
+ $(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS1) $(SHL1TARGETN)
+.ENDIF # "$(SHL1NOCHECK)"!=""
+.ENDIF
+.ELSE # "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_1.cmd
+ @echo $(SHL1LINKER) $(SHL1LINKFLAGS) $(SHL1SONAME) $(LINKFLAGSSHL) $(SHL1VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL1OBJS:s/.obj/.o/) \
+ $(SHL1VERSIONOBJ) -o $@ \
+ `cat /dev/null $(SHL1LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ $(SHL1STDLIBS) $(SHL1ARCHIVES) $(SHL1STDSHL) $(STDSHL1) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_1.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_1.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_1.cmd
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL1NOCHECK)"==""
+ $(COMMAND_ECHO)-$(RM) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f)
+ $(COMMAND_ECHO)$(RENAME) $(SHL1TARGETN) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f)
+.IF "$(VERBOSE)"=="TRUE"
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS1) $(SHL1TARGETN:d)check_$(SHL1TARGETN:f)
+.ELSE
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS1) -- -s $(SHL1TARGETN:d)check_$(SHL1TARGETN:f)
+.ENDIF
+.ENDIF # "$(SHL1NOCHECK)"!=""
+.ENDIF # "$(UPDATER)"=="YES"
+.ENDIF # "$(OS)"=="MACOSX"
+.IF "$(UNIXVERSIONNAMES)"!=""
+ $(COMMAND_ECHO)$(RM) $(LB)/$(SHL1TARGETN:b)
+ $(COMMAND_ECHO)cd $(LB) && ln -s $(SHL1TARGETN:f) $(SHL1TARGETN:b)
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+.IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+.ENDIF
+.ENDIF # "$(GUI)" == "UNX"
+
+.IF "$(GUI)" == "OS2"
+
+.IF "$(SHL1DEFAULTRES)"!=""
+ @+-$(RM) $(MISC)/$(SHL1DEFAULTRES:b).rc >& $(NULLDEV)
+.IF "$(SHL1ICON)" != ""
+ @-+echo 1 ICON $(SHL1ICON) >> $(MISC)/$(SHL1DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL1ADD_VERINFO)"!=""
+ @-+echo $(EMQ)#include $(EMQ)"$(SHL1ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL1DEFAULTRES:b).rc
+.ENDIF # "$(SHL1ADD_VERINFO)"!=""
+ @-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL1DEFAULTRES:b).rc
+# @-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL1DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL1DEFAULTRES:b).rc
+.ENDIF # "$(SHL1DEFAULTRES)"!=""
+
+.IF "$(SHL1ALLRES)"!=""
+ $(COMMAND_ECHO)+$(TYPE) $(SHL1ALLRES) > $(SHL1LINKRES)
+.ENDIF # "$(SHL1ALLRES)"!=""
+
+.IF "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL1LINKER) $(SHL1LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
+ $(SHL1DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL1OBJS) $(SHL1VERSIONOBJ) \
+ $(SHL1LIBS) \
+ $(SHL1STDLIBS:^"-l") \
+ $(SHL1LINKRES) \
+ $(SHL1STDSHL:^"-l") $(STDSHL1:^"-l")
+
+.ELSE # "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL1LINKER) -v $(SHL1LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL1BASEX) \
+ $(SHL1STACK) -o $(SHL1TARGETN) \
+ $(SHL1DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL1OBJS) $(SHL1VERSIONOBJ) \
+ $(SHL1LIBS) \
+ $(SHL1STDLIBS:^"-l") \
+ $(SHL1LINKRES) \
+ $(SHL1STDSHL:^"-l") $(STDSHL1:^"-l") \
+ $(LINKOUTPUTFILTER)
+ @$(LS) $@ >& $(NULLDEV)
+
+.ENDIF # "$(USE_DEFFILE)"!=""
+
+.IF "$(SHL1TARGET8)" != "$(SHL1TARGET)"
+ $(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL1TARGET8).dll
+.ENDIF
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(SHL1TARGETN)"!=""
+
+# unroll begin
+
+.IF "$(SHL2TARGETN)"!=""
+
+.IF "$(OS)"=="AIX"
+SHL2STDLIBS=
+.ENDIF
+
+.IF "$(SHLLINKARCONLY)" != ""
+SHL2STDLIBS=
+STDSHL=
+.ELSE
+SHL2ARCHIVES=
+.ENDIF
+
+# decide how to link
+.IF "$(SHL2CODETYPE)"=="C"
+SHL2LINKER=$(LINKC)
+SHL2STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
+SHL2LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(SHL2CODETYPE)"=="C"
+SHL2LINKER=$(LINK)
+SHL2STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
+SHL2LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(SHL2CODETYPE)"=="C"
+
+SHL2RPATH*=OOO
+LINKFLAGSRUNPATH_$(SHL2RPATH)*=/ERROR:/Bad_SHL2RPATH_value
+SHL2LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL2RPATH))
+
+.IF "$(SHL2USE_EXPORTS)"==""
+SHL2DEF*=$(MISC)/$(SHL2TARGET).def
+.ENDIF # "$(SHL2USE_EXPORTS)"==""
+
+EXTRALIBPATHS2=$(EXTRALIBPATHS)
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL2NOCHECK)"==""
+.IF "$(SOLAR_STLLIBPATH)"!=""
+EXTRALIBPATHS2+=-L$(SOLAR_STLLIBPATH)
+.ENDIF
+.ENDIF # "$(SHL2NOCHECK)"!=""
+.ENDIF
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#+++++++++++ version object ++++++++++++++++++++++++++++++++++++++++
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.IF "$(L10N_framework)"==""
+.IF "$(VERSIONOBJ)"!=""
+SHL2VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL2TARGET))}$(VERSIONOBJ:f)
+USE_VERSIONH:=$(INCCOM)/$(SHL2VERSIONOBJ:b).h
+.IF "$(GUI)" == "UNX"
+SHL2VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL2TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
+.ELSE # "$(GUI)" == "UNX"
+SHL2VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL2TARGET))}$(VERSIONOBJ:f)
+.ENDIF # "$(GUI)" == "UNX"
+$(MISC)/$(SHL2VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL2VERSIONOBJ:b).h
+# $(COPY) $(SOLARENV)/src/version.c $@
+ $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL2VERSIONOBJ:b).h/ > $@
+
+.INIT : $(SHL2VERSIONOBJDEP)
+.ENDIF # "$(VERSIONOBJ)"!=""
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL2IMPLIB)" == ""
+SHL2IMPLIB=i$(TARGET)_t2
+.ENDIF # "$(SHL2IMPLIB)" == ""
+.IF "$(COM)" != "GCC"
+USE_2IMPLIB=-implib:$(LB)/$(SHL2IMPLIB).lib
+.ENDIF # "$(COM)" != "GCC"
+SHL2IMPLIBN=$(LB)/$(SHL2IMPLIB).lib
+ALLTAR : $(SHL2IMPLIBN)
+
+.IF "$(USE_DEFFILE)"==""
+USE_2IMPLIB_DEPS=$(LB)/$(SHL2IMPLIB).lib
+.ENDIF # "$(USE_DEFFILE)"==""
+.ENDIF # "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+USE_SHL2DEF=$(SHL2DEF)
+.ELSE # "$(GUI)" != "UNX"
+USE_SHL2DEF=
+SHL2DEPN+:=$(SHL2DEPNU)
+
+.IF "$(SHL2VERSIONMAP)"==""
+# to activate vmaps remove "#"
+USE_SHL2VERSIONMAP=$(MISC)/$(SHL2TARGET).vmap
+.ENDIF # "$(SHL2VERSIONMAP)"==""
+
+.IF "$(USE_SHL2VERSIONMAP)"!=""
+
+.IF "$(SHL2FILTERFILE)"!=""
+.IF "$(SHL2VERSIONMAP)"!=""
+#eine von beiden ist zuviel
+USE_SHL2VERSIONMAP=$(MISC)/$(SHL2TARGET).vmap
+$(USE_SHL2VERSIONMAP) .PHONY:
+ @echo -----------------------------
+ @echo you should only use versionmap OR exportfile
+ @echo -----------------------------
+# force_dmake_to_error
+
+.ENDIF # "$(SHL2VERSIONMAP)"!=""
+
+SHL2VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL2VERSIONMAP)
+
+$(USE_SHL2VERSIONMAP): \
+ $(SHL2OBJS)\
+ $(SHL2LIBS)\
+ $(SHL2FILTERFILE)
+ @$(RM) $@.dump
+.IF "$(SHL2OBJS)"!=""
+# dump remaining objects on the fly
+.IF "$(OS)"=="MACOSX"
+ @-nm $(SHL2OBJS:s/.obj/.o/) > $@.dump
+.ELSE
+ @nm $(SHL2OBJS:s/.obj/.o/) > $@.dump
+.ENDIF
+.ENDIF # "$(SHL2OBJS)!"=""
+ @$(TYPE) /dev/null $(SHL2LIBS:s/.lib/.dump/) >> $@.dump
+ $(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL2INTERFACE) -f $(SHL2FILTERFILE) -m $@
+
+.ELSE # "$(SHL2FILTERFILE)"!=""
+USE_SHL2VERSIONMAP=$(MISC)/$(SHL2TARGET).vmap
+$(USE_SHL2VERSIONMAP) :
+.IF "$(VERBOSE)" == "TRUE"
+ @echo -----------------------------
+ @echo SHL2FILTERFILE not set!
+ @echo -----------------------------
+ @$(TOUCH) $@
+ @echo dummy file to keep the dependencies for later use.
+.ELSE
+ @$(TOUCH) $@
+.ENDIF
+# force_dmake_to_error
+.ENDIF # "$(SHL2FILTERFILE)"!=""
+.ELSE # "$(USE_SHL2VERSIONMAP)"!=""
+
+#and now for the plain non-generic way...
+.IF "$(SHL2VERSIONMAP)"!=""
+USE_SHL2VERSIONMAP=$(MISC)/$(SHL2VERSIONMAP:b)_$(SHL2TARGET)$(SHL2VERSIONMAP:e)
+SHL2VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL2VERSIONMAP)
+
+.IF "$(OS)"=="MACOSX"
+$(USE_SHL2VERSIONMAP): $(SHL2OBJS) $(SHL2LIBS)
+.ENDIF
+
+# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
+# even if the $(AWK) part fails:
+$(USE_SHL2VERSIONMAP) .ERRREMOVE: $(SHL2VERSIONMAP)
+ @@-$(RM) -f $@
+# The following files will only be generated and needed on Mac OS X as temporary files
+# in order to generate exported symbols list out of Linux/Solaris map files
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) -f $@.symregexp >& $(NULLDEV)
+ @-$(RM) -f $@.expsymlist >& $(NULLDEV)
+.ENDIF
+# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
+# happens if somebody will change it in the future
+.IF "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL2VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
+.ELIF "$(COMNAME)"=="sunpro5"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL2VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
+.ELSE # "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL2VERSIONMAP) > $@
+.ENDIF # "$(COMID)"=="gcc3"
+ @chmod a+w $@
+# Mac OS X post-processing generate an exported symbols list from the generated map file
+# for details on exported symbols list see man ld on Mac OS X
+.IF "$(OS)"=="MACOSX"
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+.IF "$(SHL2OBJS)"!=""
+ -echo $(foreach,i,$(SHL2OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+.IF "$(SHL2LIBS)"!=""
+ $(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL2LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ cp $@.exported-symbols $@
+.ENDIF # .IF "$(OS)"=="MACOSX"
+.ENDIF # "$(SHL2VERSIONMAP)"!=""
+.ENDIF # "$(USE_SHL2VERSIONMAP)"!=""
+.ENDIF # "$(GUI)" != "UNX"
+
+.IF "$(UNIXVERSIONNAMES)"!=""
+.IF "$(OS)"!="MACOSX"
+.IF "$(GUI)"=="UNX"
+SHL2SONAME=\"$(SONAME_SWITCH)$(SHL2TARGETN:f)\"
+.ENDIF # "$(GUI)"!="UNX"
+.ENDIF # "$(OS)"!="MACOSX"
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+
+.IF "$(SHL2RES)"!=""
+SHL2ALLRES+=$(SHL2RES)
+SHL2LINKRES*=$(MISC)/$(SHL2TARGET).res
+SHL2LINKRESO*=$(MISC)/$(SHL2TARGET)_res.o
+.ENDIF # "$(SHL2RES)"!=""
+
+.IF "$(SHL2DEFAULTRES)$(use_shl_versions)"!=""
+SHL2DEFAULTRES*=$(MISC)/$(SHL2TARGET)_def.res
+SHL2ALLRES+=$(SHL2DEFAULTRES)
+SHL2LINKRES*=$(MISC)/$(SHL2TARGET).res
+SHL2LINKRESO*=$(MISC)/$(SHL2TARGET)_res.o
+.ENDIF # "$(SHL2DEFAULTRES)$(use_shl_versions)"!=""
+
+#.IF "$(SHL2TARGETN)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL2LIBS)"!=""
+$(MISC)/$(SHL2TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL2LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL2LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(SHL2TARGETN:b)_linkinc.ls
+$(SHL2TARGETN) : $(LINKINCTARGETS)
+
+.ELSE
+.IF "$(SHL2USE_EXPORTS)"=="name"
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(COM)"!="GCC"
+.IF "$(SHL2LIBS)"!=""
+SHL2LINKLIST=$(MISC)/$(SHL2TARGET)_link.lst
+SHL2LINKLISTPARAM=@$(SHL2LINKLIST)
+$(SHL2LINKLIST) : $(SHL2LIBS)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL2LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL2LIBS)"!=""
+.ENDIF # "$(COM)"!="GCC"
+.ENDIF
+.ENDIF # "$(SHL2USE_EXPORTS)"=="name"
+
+$(MISC)/%linkinc.ls:
+ @echo . > $@
+.ENDIF # "$(linkinc)"!=""
+
+.IF "$(GUI)" == "OS2"
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL2TARGET8=$(shell @fix_shl $(SHL2TARGET))
+.ENDIF
+
+.IF "$(GUI)" == "OS2"
+_SHL2IMP_ORD = $(SHL2STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL2STDLIBS:^"$(LB)/")
+SHL2IMP_ORD = $(foreach,i,$(_SHL2IMP_ORD) $(shell @-ls $i))
+.ELSE
+SHL2IMP_ORD =
+.ENDIF
+
+
+$(SHL2TARGETN) : \
+ $(SHL2OBJS)\
+ $(SHL2LIBS)\
+ $(USE_2IMPLIB_DEPS)\
+ $(USE_SHL2DEF)\
+ $(USE_SHL2VERSIONMAP)\
+ $(SHL2RES)\
+ $(SHL2DEPN) \
+ $(SHL2IMP_ORD) \
+ $(SHL2LINKLIST)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(SHL2DEFAULTRES)"!=""
+ @@-$(RM) $(MISC)/$(SHL2DEFAULTRES:b).rc
+.IF "$(SHL2ICON)" != ""
+ @echo 1 ICON $(SHL2ICON) >> $(MISC)/$(SHL2DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL2ADD_VERINFO)"!=""
+ @echo $(EMQ)#include $(EMQ)"$(SHL2ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL2DEFAULTRES:b).rc
+.ELSE # "$(SHL2ADD_VERINFO)"!=""
+ @echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL2DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL2DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL2DEFAULTRES:b).rc
+.ENDIF # "$(SHL2ADD_VERINFO)"!=""
+ @echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(SHL2DEFAULTRES:b).rc
+ @echo $(EMQ)#define ORG_NAME $(SHL2TARGET)$(DLLPOST) >> $(MISC)/$(SHL2DEFAULTRES:b).rc
+ @echo $(EMQ)#define INTERNAL_NAME $(SHL2TARGET:b) >> $(MISC)/$(SHL2DEFAULTRES:b).rc
+ @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL2DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL2DEFAULTRES:b).rc
+.ENDIF # "$(SHL2DEFAULTRES)"!=""
+.IF "$(SHL2ALLRES)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(SHL2ALLRES) > $(SHL2LINKRES)
+.IF "$(COM)"=="GCC"
+ windres $(SHL2LINKRES) $(SHL2LINKRESO)
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(SHL2ALLRES)"!=""
+.IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def
+ @echo dlltool --dllname $(SHL2TARGET)$(DLLPOST) \
+ --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_2.cmd
+ @noop $(assign ALL2OBJLIST:=$(STDOBJ) $(SHL2OBJS) $(SHL2LINKRESO) $(shell $(TYPE) /dev/null $(SHL2LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+.IF "$(DEFLIB2NAME)"!="" # do not have to include objs
+ @noop $(assign DEF2OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB2NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+ @noop $(foreach,i,$(DEF2OBJLIST) $(assign ALL2OBJLIST:=$(ALL2OBJLIST:s?$i??)))
+.ENDIF # "$(DEFLIB2NAME)"!=""
+ @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_2.cmd
+.IF "$(SHL2DEF)"!=""
+ @echo --input-def $(SHL2DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_2.cmd
+.ELSE
+ @echo $(SHL2VERSIONOBJ) $(SHL2DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_2.cmd
+.ENDIF
+ @echo $(ALL2OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_2.cmd
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
+ $(STDOBJ) $(SHL2VERSIONOBJ) $(SHL2DESCRIPTIONOBJ) $(SHL2OBJS) $(SHL2LINKRESO) \
+ `$(TYPE) /dev/null $(SHL2LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ -Wl,--exclude-libs,ALL,--start-group $(SHL2STDLIBS) -Wl,--end-group \
+ $(SHL2STDSHL) $(STDSHL2) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
+ -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_2.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_2.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_2.cmd
+.ELSE
+.IF "$(linkinc)"==""
+.IF "$(SHL2USE_EXPORTS)"!="name"
+.IF "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL2LINKER) @$(mktmp \
+ $(SHL2LINKFLAGS) \
+ $(LINKFLAGSSHL) \
+ $(SHL2STACK) $(SHL2BASEX) \
+ -out:$@ \
+ -map:$(MISC)/$(@:b).map \
+ -def:$(SHL2DEF) \
+ $(USE_2IMPLIB) \
+ $(STDOBJ) \
+ $(SHL2VERSIONOBJ) $(SHL2OBJS) \
+ $(SHL2LIBS) \
+ $(SHL2STDLIBS) \
+ $(SHL2STDSHL) $(STDSHL2) \
+ $(SHL2LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE # "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL2LINKER) @$(mktmp $(SHL2LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL2BASEX) \
+ $(SHL2STACK) -out:$(SHL2TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(LB)/$(SHL2IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL2OBJS) $(SHL2VERSIONOBJ) \
+ $(SHL2LIBS) \
+ $(SHL2STDLIBS) \
+ $(SHL2STDSHL) $(STDSHL2) \
+ $(SHL2LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(USE_DEFFILE)"!=""
+.ELSE # "$(SHL2USE_EXPORTS)"!="name"
+ $(COMMAND_ECHO)$(SHL2LINKER) @$(mktmp $(SHL2LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL2BASEX) \
+ $(SHL2STACK) -out:$(SHL2TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(USE_2IMPLIB) \
+ $(STDOBJ) \
+ $(SHL2OBJS) $(SHL2VERSIONOBJ)) \
+ $(SHL2LINKLISTPARAM) \
+ @$(mktmp $(SHL2STDLIBS) \
+ $(SHL2STDSHL) $(STDSHL2) \
+ $(SHL2LINKRES) \
+ )
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(SHL2USE_EXPORTS)"!="name"
+.ELSE # "$(linkinc)"==""
+ $(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL2TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL2TARGET).lst
+ $(COMMAND_ECHO)$(TYPE) $(mktmp \
+ $(SHL2LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL2BASEX) \
+ $(SHL2STACK) $(MAPFILE) \
+ -out:$@ \
+ $(LB)/$(SHL2IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL2OBJS) \
+ $(SHL2STDLIBS) \
+ $(SHL2STDSHL) $(STDSHL2) \
+ $(SHL2LINKRES) \
+ ) >> $(MISC)/$(SHL2TARGET).lnk
+ $(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL2TARGETN:b)_linkinc.ls >> $(MISC)/$(SHL2TARGET).lnk
+ $(COMMAND_ECHO)$(SHL2LINKER) @$(MISC)/$(SHL2TARGET).lnk
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(linkinc)"==""
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)" == "WNT"
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_2.cmd
+ @echo $(STDSLO) $(SHL2OBJS:s/.obj/.o/) \
+ $(SHL2VERSIONOBJ) \
+ `cat /dev/null $(SHL2LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(SHL2LINKER) $(SHL2LINKFLAGS) $(SHL2VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
+ $(SHL2STDLIBS) $(SHL2ARCHIVES) $(SHL2STDSHL) $(STDSHL2) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_2.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_2.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_2.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_2.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_2.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ shl $(SHL2RPATH) $@
+.IF "$(SHL2CREATEJNILIB)"!=""
+ @echo "Making: " $(@:f).jnilib
+ @macosx-create-bundle $@
+.ENDIF # "$(SHL2CREATEJNILIB)"!=""
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL2NOCHECK)"==""
+ $(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS2) $(SHL2TARGETN)
+.ENDIF # "$(SHL2NOCHECK)"!=""
+.ENDIF
+.ELSE # "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_2.cmd
+ @echo $(SHL2LINKER) $(SHL2LINKFLAGS) $(SHL2SONAME) $(LINKFLAGSSHL) $(SHL2VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL2OBJS:s/.obj/.o/) \
+ $(SHL2VERSIONOBJ) -o $@ \
+ `cat /dev/null $(SHL2LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ $(SHL2STDLIBS) $(SHL2ARCHIVES) $(SHL2STDSHL) $(STDSHL2) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_2.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_2.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_2.cmd
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL2NOCHECK)"==""
+ $(COMMAND_ECHO)-$(RM) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f)
+ $(COMMAND_ECHO)$(RENAME) $(SHL2TARGETN) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f)
+.IF "$(VERBOSE)"=="TRUE"
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS2) $(SHL2TARGETN:d)check_$(SHL2TARGETN:f)
+.ELSE
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS2) -- -s $(SHL2TARGETN:d)check_$(SHL2TARGETN:f)
+.ENDIF
+.ENDIF # "$(SHL2NOCHECK)"!=""
+.ENDIF # "$(UPDATER)"=="YES"
+.ENDIF # "$(OS)"=="MACOSX"
+.IF "$(UNIXVERSIONNAMES)"!=""
+ $(COMMAND_ECHO)$(RM) $(LB)/$(SHL2TARGETN:b)
+ $(COMMAND_ECHO)cd $(LB) && ln -s $(SHL2TARGETN:f) $(SHL2TARGETN:b)
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+.IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+.ENDIF
+.ENDIF # "$(GUI)" == "UNX"
+
+.IF "$(GUI)" == "OS2"
+
+.IF "$(SHL2DEFAULTRES)"!=""
+ @+-$(RM) $(MISC)/$(SHL2DEFAULTRES:b).rc >& $(NULLDEV)
+.IF "$(SHL2ICON)" != ""
+ @-+echo 1 ICON $(SHL2ICON) >> $(MISC)/$(SHL2DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL2ADD_VERINFO)"!=""
+ @-+echo $(EMQ)#include $(EMQ)"$(SHL2ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL2DEFAULTRES:b).rc
+.ENDIF # "$(SHL2ADD_VERINFO)"!=""
+ @-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL2DEFAULTRES:b).rc
+# @-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL2DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL2DEFAULTRES:b).rc
+.ENDIF # "$(SHL2DEFAULTRES)"!=""
+
+.IF "$(SHL2ALLRES)"!=""
+ $(COMMAND_ECHO)+$(TYPE) $(SHL2ALLRES) > $(SHL2LINKRES)
+.ENDIF # "$(SHL2ALLRES)"!=""
+
+.IF "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL2LINKER) $(SHL2LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
+ $(SHL2DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL2OBJS) $(SHL2VERSIONOBJ) \
+ $(SHL2LIBS) \
+ $(SHL2STDLIBS:^"-l") \
+ $(SHL2LINKRES) \
+ $(SHL2STDSHL:^"-l") $(STDSHL2:^"-l")
+
+.ELSE # "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL2LINKER) -v $(SHL2LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL2BASEX) \
+ $(SHL2STACK) -o $(SHL2TARGETN) \
+ $(SHL2DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL2OBJS) $(SHL2VERSIONOBJ) \
+ $(SHL2LIBS) \
+ $(SHL2STDLIBS:^"-l") \
+ $(SHL2LINKRES) \
+ $(SHL2STDSHL:^"-l") $(STDSHL2:^"-l") \
+ $(LINKOUTPUTFILTER)
+ @$(LS) $@ >& $(NULLDEV)
+
+.ENDIF # "$(USE_DEFFILE)"!=""
+
+.IF "$(SHL2TARGET8)" != "$(SHL2TARGET)"
+ $(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL2TARGET8).dll
+.ENDIF
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(SHL2TARGETN)"!=""
+
+# unroll begin
+
+.IF "$(SHL3TARGETN)"!=""
+
+.IF "$(OS)"=="AIX"
+SHL3STDLIBS=
+.ENDIF
+
+.IF "$(SHLLINKARCONLY)" != ""
+SHL3STDLIBS=
+STDSHL=
+.ELSE
+SHL3ARCHIVES=
+.ENDIF
+
+# decide how to link
+.IF "$(SHL3CODETYPE)"=="C"
+SHL3LINKER=$(LINKC)
+SHL3STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
+SHL3LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(SHL3CODETYPE)"=="C"
+SHL3LINKER=$(LINK)
+SHL3STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
+SHL3LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(SHL3CODETYPE)"=="C"
+
+SHL3RPATH*=OOO
+LINKFLAGSRUNPATH_$(SHL3RPATH)*=/ERROR:/Bad_SHL3RPATH_value
+SHL3LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL3RPATH))
+
+.IF "$(SHL3USE_EXPORTS)"==""
+SHL3DEF*=$(MISC)/$(SHL3TARGET).def
+.ENDIF # "$(SHL3USE_EXPORTS)"==""
+
+EXTRALIBPATHS3=$(EXTRALIBPATHS)
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL3NOCHECK)"==""
+.IF "$(SOLAR_STLLIBPATH)"!=""
+EXTRALIBPATHS3+=-L$(SOLAR_STLLIBPATH)
+.ENDIF
+.ENDIF # "$(SHL3NOCHECK)"!=""
+.ENDIF
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#+++++++++++ version object ++++++++++++++++++++++++++++++++++++++++
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.IF "$(L10N_framework)"==""
+.IF "$(VERSIONOBJ)"!=""
+SHL3VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL3TARGET))}$(VERSIONOBJ:f)
+USE_VERSIONH:=$(INCCOM)/$(SHL3VERSIONOBJ:b).h
+.IF "$(GUI)" == "UNX"
+SHL3VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL3TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
+.ELSE # "$(GUI)" == "UNX"
+SHL3VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL3TARGET))}$(VERSIONOBJ:f)
+.ENDIF # "$(GUI)" == "UNX"
+$(MISC)/$(SHL3VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL3VERSIONOBJ:b).h
+# $(COPY) $(SOLARENV)/src/version.c $@
+ $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL3VERSIONOBJ:b).h/ > $@
+
+.INIT : $(SHL3VERSIONOBJDEP)
+.ENDIF # "$(VERSIONOBJ)"!=""
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL3IMPLIB)" == ""
+SHL3IMPLIB=i$(TARGET)_t3
+.ENDIF # "$(SHL3IMPLIB)" == ""
+.IF "$(COM)" != "GCC"
+USE_3IMPLIB=-implib:$(LB)/$(SHL3IMPLIB).lib
+.ENDIF # "$(COM)" != "GCC"
+SHL3IMPLIBN=$(LB)/$(SHL3IMPLIB).lib
+ALLTAR : $(SHL3IMPLIBN)
+
+.IF "$(USE_DEFFILE)"==""
+USE_3IMPLIB_DEPS=$(LB)/$(SHL3IMPLIB).lib
+.ENDIF # "$(USE_DEFFILE)"==""
+.ENDIF # "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+USE_SHL3DEF=$(SHL3DEF)
+.ELSE # "$(GUI)" != "UNX"
+USE_SHL3DEF=
+SHL3DEPN+:=$(SHL3DEPNU)
+
+.IF "$(SHL3VERSIONMAP)"==""
+# to activate vmaps remove "#"
+USE_SHL3VERSIONMAP=$(MISC)/$(SHL3TARGET).vmap
+.ENDIF # "$(SHL3VERSIONMAP)"==""
+
+.IF "$(USE_SHL3VERSIONMAP)"!=""
+
+.IF "$(SHL3FILTERFILE)"!=""
+.IF "$(SHL3VERSIONMAP)"!=""
+#eine von beiden ist zuviel
+USE_SHL3VERSIONMAP=$(MISC)/$(SHL3TARGET).vmap
+$(USE_SHL3VERSIONMAP) .PHONY:
+ @echo -----------------------------
+ @echo you should only use versionmap OR exportfile
+ @echo -----------------------------
+# force_dmake_to_error
+
+.ENDIF # "$(SHL3VERSIONMAP)"!=""
+
+SHL3VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL3VERSIONMAP)
+
+$(USE_SHL3VERSIONMAP): \
+ $(SHL3OBJS)\
+ $(SHL3LIBS)\
+ $(SHL3FILTERFILE)
+ @$(RM) $@.dump
+.IF "$(SHL3OBJS)"!=""
+# dump remaining objects on the fly
+.IF "$(OS)"=="MACOSX"
+ @-nm $(SHL3OBJS:s/.obj/.o/) > $@.dump
+.ELSE
+ @nm $(SHL3OBJS:s/.obj/.o/) > $@.dump
+.ENDIF
+.ENDIF # "$(SHL3OBJS)!"=""
+ @$(TYPE) /dev/null $(SHL3LIBS:s/.lib/.dump/) >> $@.dump
+ $(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL3INTERFACE) -f $(SHL3FILTERFILE) -m $@
+
+.ELSE # "$(SHL3FILTERFILE)"!=""
+USE_SHL3VERSIONMAP=$(MISC)/$(SHL3TARGET).vmap
+$(USE_SHL3VERSIONMAP) :
+.IF "$(VERBOSE)" == "TRUE"
+ @echo -----------------------------
+ @echo SHL3FILTERFILE not set!
+ @echo -----------------------------
+ @$(TOUCH) $@
+ @echo dummy file to keep the dependencies for later use.
+.ELSE
+ @$(TOUCH) $@
+.ENDIF
+# force_dmake_to_error
+.ENDIF # "$(SHL3FILTERFILE)"!=""
+.ELSE # "$(USE_SHL3VERSIONMAP)"!=""
+
+#and now for the plain non-generic way...
+.IF "$(SHL3VERSIONMAP)"!=""
+USE_SHL3VERSIONMAP=$(MISC)/$(SHL3VERSIONMAP:b)_$(SHL3TARGET)$(SHL3VERSIONMAP:e)
+SHL3VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL3VERSIONMAP)
+
+.IF "$(OS)"=="MACOSX"
+$(USE_SHL3VERSIONMAP): $(SHL3OBJS) $(SHL3LIBS)
+.ENDIF
+
+# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
+# even if the $(AWK) part fails:
+$(USE_SHL3VERSIONMAP) .ERRREMOVE: $(SHL3VERSIONMAP)
+ @@-$(RM) -f $@
+# The following files will only be generated and needed on Mac OS X as temporary files
+# in order to generate exported symbols list out of Linux/Solaris map files
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) -f $@.symregexp >& $(NULLDEV)
+ @-$(RM) -f $@.expsymlist >& $(NULLDEV)
+.ENDIF
+# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
+# happens if somebody will change it in the future
+.IF "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL3VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
+.ELIF "$(COMNAME)"=="sunpro5"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL3VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
+.ELSE # "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL3VERSIONMAP) > $@
+.ENDIF # "$(COMID)"=="gcc3"
+ @chmod a+w $@
+# Mac OS X post-processing generate an exported symbols list from the generated map file
+# for details on exported symbols list see man ld on Mac OS X
+.IF "$(OS)"=="MACOSX"
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+.IF "$(SHL3OBJS)"!=""
+ -echo $(foreach,i,$(SHL3OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+.IF "$(SHL3LIBS)"!=""
+ $(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL3LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ cp $@.exported-symbols $@
+.ENDIF # .IF "$(OS)"=="MACOSX"
+.ENDIF # "$(SHL3VERSIONMAP)"!=""
+.ENDIF # "$(USE_SHL3VERSIONMAP)"!=""
+.ENDIF # "$(GUI)" != "UNX"
+
+.IF "$(UNIXVERSIONNAMES)"!=""
+.IF "$(OS)"!="MACOSX"
+.IF "$(GUI)"=="UNX"
+SHL3SONAME=\"$(SONAME_SWITCH)$(SHL3TARGETN:f)\"
+.ENDIF # "$(GUI)"!="UNX"
+.ENDIF # "$(OS)"!="MACOSX"
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+
+.IF "$(SHL3RES)"!=""
+SHL3ALLRES+=$(SHL3RES)
+SHL3LINKRES*=$(MISC)/$(SHL3TARGET).res
+SHL3LINKRESO*=$(MISC)/$(SHL3TARGET)_res.o
+.ENDIF # "$(SHL3RES)"!=""
+
+.IF "$(SHL3DEFAULTRES)$(use_shl_versions)"!=""
+SHL3DEFAULTRES*=$(MISC)/$(SHL3TARGET)_def.res
+SHL3ALLRES+=$(SHL3DEFAULTRES)
+SHL3LINKRES*=$(MISC)/$(SHL3TARGET).res
+SHL3LINKRESO*=$(MISC)/$(SHL3TARGET)_res.o
+.ENDIF # "$(SHL3DEFAULTRES)$(use_shl_versions)"!=""
+
+#.IF "$(SHL3TARGETN)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL3LIBS)"!=""
+$(MISC)/$(SHL3TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL3LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL3LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(SHL3TARGETN:b)_linkinc.ls
+$(SHL3TARGETN) : $(LINKINCTARGETS)
+
+.ELSE
+.IF "$(SHL3USE_EXPORTS)"=="name"
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(COM)"!="GCC"
+.IF "$(SHL3LIBS)"!=""
+SHL3LINKLIST=$(MISC)/$(SHL3TARGET)_link.lst
+SHL3LINKLISTPARAM=@$(SHL3LINKLIST)
+$(SHL3LINKLIST) : $(SHL3LIBS)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL3LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL3LIBS)"!=""
+.ENDIF # "$(COM)"!="GCC"
+.ENDIF
+.ENDIF # "$(SHL3USE_EXPORTS)"=="name"
+
+$(MISC)/%linkinc.ls:
+ @echo . > $@
+.ENDIF # "$(linkinc)"!=""
+
+.IF "$(GUI)" == "OS2"
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL3TARGET8=$(shell @fix_shl $(SHL3TARGET))
+.ENDIF
+
+.IF "$(GUI)" == "OS2"
+_SHL3IMP_ORD = $(SHL3STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL3STDLIBS:^"$(LB)/")
+SHL3IMP_ORD = $(foreach,i,$(_SHL3IMP_ORD) $(shell @-ls $i))
+.ELSE
+SHL3IMP_ORD =
+.ENDIF
+
+
+$(SHL3TARGETN) : \
+ $(SHL3OBJS)\
+ $(SHL3LIBS)\
+ $(USE_3IMPLIB_DEPS)\
+ $(USE_SHL3DEF)\
+ $(USE_SHL3VERSIONMAP)\
+ $(SHL3RES)\
+ $(SHL3DEPN) \
+ $(SHL3IMP_ORD) \
+ $(SHL3LINKLIST)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(SHL3DEFAULTRES)"!=""
+ @@-$(RM) $(MISC)/$(SHL3DEFAULTRES:b).rc
+.IF "$(SHL3ICON)" != ""
+ @echo 1 ICON $(SHL3ICON) >> $(MISC)/$(SHL3DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL3ADD_VERINFO)"!=""
+ @echo $(EMQ)#include $(EMQ)"$(SHL3ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL3DEFAULTRES:b).rc
+.ELSE # "$(SHL3ADD_VERINFO)"!=""
+ @echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL3DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL3DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL3DEFAULTRES:b).rc
+.ENDIF # "$(SHL3ADD_VERINFO)"!=""
+ @echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(SHL3DEFAULTRES:b).rc
+ @echo $(EMQ)#define ORG_NAME $(SHL3TARGET)$(DLLPOST) >> $(MISC)/$(SHL3DEFAULTRES:b).rc
+ @echo $(EMQ)#define INTERNAL_NAME $(SHL3TARGET:b) >> $(MISC)/$(SHL3DEFAULTRES:b).rc
+ @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL3DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL3DEFAULTRES:b).rc
+.ENDIF # "$(SHL3DEFAULTRES)"!=""
+.IF "$(SHL3ALLRES)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(SHL3ALLRES) > $(SHL3LINKRES)
+.IF "$(COM)"=="GCC"
+ windres $(SHL3LINKRES) $(SHL3LINKRESO)
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(SHL3ALLRES)"!=""
+.IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def
+ @echo dlltool --dllname $(SHL3TARGET)$(DLLPOST) \
+ --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_3.cmd
+ @noop $(assign ALL3OBJLIST:=$(STDOBJ) $(SHL3OBJS) $(SHL3LINKRESO) $(shell $(TYPE) /dev/null $(SHL3LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+.IF "$(DEFLIB3NAME)"!="" # do not have to include objs
+ @noop $(assign DEF3OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB3NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+ @noop $(foreach,i,$(DEF3OBJLIST) $(assign ALL3OBJLIST:=$(ALL3OBJLIST:s?$i??)))
+.ENDIF # "$(DEFLIB3NAME)"!=""
+ @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_3.cmd
+.IF "$(SHL3DEF)"!=""
+ @echo --input-def $(SHL3DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_3.cmd
+.ELSE
+ @echo $(SHL3VERSIONOBJ) $(SHL3DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_3.cmd
+.ENDIF
+ @echo $(ALL3OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_3.cmd
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
+ $(STDOBJ) $(SHL3VERSIONOBJ) $(SHL3DESCRIPTIONOBJ) $(SHL3OBJS) $(SHL3LINKRESO) \
+ `$(TYPE) /dev/null $(SHL3LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ -Wl,--exclude-libs,ALL,--start-group $(SHL3STDLIBS) -Wl,--end-group \
+ $(SHL3STDSHL) $(STDSHL3) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
+ -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_3.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_3.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_3.cmd
+.ELSE
+.IF "$(linkinc)"==""
+.IF "$(SHL3USE_EXPORTS)"!="name"
+.IF "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL3LINKER) @$(mktmp \
+ $(SHL3LINKFLAGS) \
+ $(LINKFLAGSSHL) \
+ $(SHL3STACK) $(SHL3BASEX) \
+ -out:$@ \
+ -map:$(MISC)/$(@:b).map \
+ -def:$(SHL3DEF) \
+ $(USE_3IMPLIB) \
+ $(STDOBJ) \
+ $(SHL3VERSIONOBJ) $(SHL3OBJS) \
+ $(SHL3LIBS) \
+ $(SHL3STDLIBS) \
+ $(SHL3STDSHL) $(STDSHL3) \
+ $(SHL3LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE # "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL3LINKER) @$(mktmp $(SHL3LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL3BASEX) \
+ $(SHL3STACK) -out:$(SHL3TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(LB)/$(SHL3IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL3OBJS) $(SHL3VERSIONOBJ) \
+ $(SHL3LIBS) \
+ $(SHL3STDLIBS) \
+ $(SHL3STDSHL) $(STDSHL3) \
+ $(SHL3LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(USE_DEFFILE)"!=""
+.ELSE # "$(SHL3USE_EXPORTS)"!="name"
+ $(COMMAND_ECHO)$(SHL3LINKER) @$(mktmp $(SHL3LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL3BASEX) \
+ $(SHL3STACK) -out:$(SHL3TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(USE_3IMPLIB) \
+ $(STDOBJ) \
+ $(SHL3OBJS) $(SHL3VERSIONOBJ)) \
+ $(SHL3LINKLISTPARAM) \
+ @$(mktmp $(SHL3STDLIBS) \
+ $(SHL3STDSHL) $(STDSHL3) \
+ $(SHL3LINKRES) \
+ )
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(SHL3USE_EXPORTS)"!="name"
+.ELSE # "$(linkinc)"==""
+ $(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL3TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL3TARGET).lst
+ $(COMMAND_ECHO)$(TYPE) $(mktmp \
+ $(SHL3LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL3BASEX) \
+ $(SHL3STACK) $(MAPFILE) \
+ -out:$@ \
+ $(LB)/$(SHL3IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL3OBJS) \
+ $(SHL3STDLIBS) \
+ $(SHL3STDSHL) $(STDSHL3) \
+ $(SHL3LINKRES) \
+ ) >> $(MISC)/$(SHL3TARGET).lnk
+ $(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL3TARGETN:b)_linkinc.ls >> $(MISC)/$(SHL3TARGET).lnk
+ $(COMMAND_ECHO)$(SHL3LINKER) @$(MISC)/$(SHL3TARGET).lnk
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(linkinc)"==""
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)" == "WNT"
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_3.cmd
+ @echo $(STDSLO) $(SHL3OBJS:s/.obj/.o/) \
+ $(SHL3VERSIONOBJ) \
+ `cat /dev/null $(SHL3LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(SHL3LINKER) $(SHL3LINKFLAGS) $(SHL3VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
+ $(SHL3STDLIBS) $(SHL3ARCHIVES) $(SHL3STDSHL) $(STDSHL3) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_3.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_3.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_3.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_3.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_3.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ shl $(SHL3RPATH) $@
+.IF "$(SHL3CREATEJNILIB)"!=""
+ @echo "Making: " $(@:f).jnilib
+ @macosx-create-bundle $@
+.ENDIF # "$(SHL3CREATEJNILIB)"!=""
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL3NOCHECK)"==""
+ $(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS3) $(SHL3TARGETN)
+.ENDIF # "$(SHL3NOCHECK)"!=""
+.ENDIF
+.ELSE # "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_3.cmd
+ @echo $(SHL3LINKER) $(SHL3LINKFLAGS) $(SHL3SONAME) $(LINKFLAGSSHL) $(SHL3VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL3OBJS:s/.obj/.o/) \
+ $(SHL3VERSIONOBJ) -o $@ \
+ `cat /dev/null $(SHL3LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ $(SHL3STDLIBS) $(SHL3ARCHIVES) $(SHL3STDSHL) $(STDSHL3) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_3.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_3.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_3.cmd
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL3NOCHECK)"==""
+ $(COMMAND_ECHO)-$(RM) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f)
+ $(COMMAND_ECHO)$(RENAME) $(SHL3TARGETN) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f)
+.IF "$(VERBOSE)"=="TRUE"
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS3) $(SHL3TARGETN:d)check_$(SHL3TARGETN:f)
+.ELSE
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS3) -- -s $(SHL3TARGETN:d)check_$(SHL3TARGETN:f)
+.ENDIF
+.ENDIF # "$(SHL3NOCHECK)"!=""
+.ENDIF # "$(UPDATER)"=="YES"
+.ENDIF # "$(OS)"=="MACOSX"
+.IF "$(UNIXVERSIONNAMES)"!=""
+ $(COMMAND_ECHO)$(RM) $(LB)/$(SHL3TARGETN:b)
+ $(COMMAND_ECHO)cd $(LB) && ln -s $(SHL3TARGETN:f) $(SHL3TARGETN:b)
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+.IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+.ENDIF
+.ENDIF # "$(GUI)" == "UNX"
+
+.IF "$(GUI)" == "OS2"
+
+.IF "$(SHL3DEFAULTRES)"!=""
+ @+-$(RM) $(MISC)/$(SHL3DEFAULTRES:b).rc >& $(NULLDEV)
+.IF "$(SHL3ICON)" != ""
+ @-+echo 1 ICON $(SHL3ICON) >> $(MISC)/$(SHL3DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL3ADD_VERINFO)"!=""
+ @-+echo $(EMQ)#include $(EMQ)"$(SHL3ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL3DEFAULTRES:b).rc
+.ENDIF # "$(SHL3ADD_VERINFO)"!=""
+ @-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL3DEFAULTRES:b).rc
+# @-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL3DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL3DEFAULTRES:b).rc
+.ENDIF # "$(SHL3DEFAULTRES)"!=""
+
+.IF "$(SHL3ALLRES)"!=""
+ $(COMMAND_ECHO)+$(TYPE) $(SHL3ALLRES) > $(SHL3LINKRES)
+.ENDIF # "$(SHL3ALLRES)"!=""
+
+.IF "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL3LINKER) $(SHL3LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
+ $(SHL3DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL3OBJS) $(SHL3VERSIONOBJ) \
+ $(SHL3LIBS) \
+ $(SHL3STDLIBS:^"-l") \
+ $(SHL3LINKRES) \
+ $(SHL3STDSHL:^"-l") $(STDSHL3:^"-l")
+
+.ELSE # "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL3LINKER) -v $(SHL3LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL3BASEX) \
+ $(SHL3STACK) -o $(SHL3TARGETN) \
+ $(SHL3DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL3OBJS) $(SHL3VERSIONOBJ) \
+ $(SHL3LIBS) \
+ $(SHL3STDLIBS:^"-l") \
+ $(SHL3LINKRES) \
+ $(SHL3STDSHL:^"-l") $(STDSHL3:^"-l") \
+ $(LINKOUTPUTFILTER)
+ @$(LS) $@ >& $(NULLDEV)
+
+.ENDIF # "$(USE_DEFFILE)"!=""
+
+.IF "$(SHL3TARGET8)" != "$(SHL3TARGET)"
+ $(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL3TARGET8).dll
+.ENDIF
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(SHL3TARGETN)"!=""
+
+# unroll begin
+
+.IF "$(SHL4TARGETN)"!=""
+
+.IF "$(OS)"=="AIX"
+SHL4STDLIBS=
+.ENDIF
+
+.IF "$(SHLLINKARCONLY)" != ""
+SHL4STDLIBS=
+STDSHL=
+.ELSE
+SHL4ARCHIVES=
+.ENDIF
+
+# decide how to link
+.IF "$(SHL4CODETYPE)"=="C"
+SHL4LINKER=$(LINKC)
+SHL4STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
+SHL4LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(SHL4CODETYPE)"=="C"
+SHL4LINKER=$(LINK)
+SHL4STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
+SHL4LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(SHL4CODETYPE)"=="C"
+
+SHL4RPATH*=OOO
+LINKFLAGSRUNPATH_$(SHL4RPATH)*=/ERROR:/Bad_SHL4RPATH_value
+SHL4LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL4RPATH))
+
+.IF "$(SHL4USE_EXPORTS)"==""
+SHL4DEF*=$(MISC)/$(SHL4TARGET).def
+.ENDIF # "$(SHL4USE_EXPORTS)"==""
+
+EXTRALIBPATHS4=$(EXTRALIBPATHS)
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL4NOCHECK)"==""
+.IF "$(SOLAR_STLLIBPATH)"!=""
+EXTRALIBPATHS4+=-L$(SOLAR_STLLIBPATH)
+.ENDIF
+.ENDIF # "$(SHL4NOCHECK)"!=""
+.ENDIF
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#+++++++++++ version object ++++++++++++++++++++++++++++++++++++++++
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.IF "$(L10N_framework)"==""
+.IF "$(VERSIONOBJ)"!=""
+SHL4VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL4TARGET))}$(VERSIONOBJ:f)
+USE_VERSIONH:=$(INCCOM)/$(SHL4VERSIONOBJ:b).h
+.IF "$(GUI)" == "UNX"
+SHL4VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL4TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
+.ELSE # "$(GUI)" == "UNX"
+SHL4VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL4TARGET))}$(VERSIONOBJ:f)
+.ENDIF # "$(GUI)" == "UNX"
+$(MISC)/$(SHL4VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL4VERSIONOBJ:b).h
+# $(COPY) $(SOLARENV)/src/version.c $@
+ $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL4VERSIONOBJ:b).h/ > $@
+
+.INIT : $(SHL4VERSIONOBJDEP)
+.ENDIF # "$(VERSIONOBJ)"!=""
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL4IMPLIB)" == ""
+SHL4IMPLIB=i$(TARGET)_t4
+.ENDIF # "$(SHL4IMPLIB)" == ""
+.IF "$(COM)" != "GCC"
+USE_4IMPLIB=-implib:$(LB)/$(SHL4IMPLIB).lib
+.ENDIF # "$(COM)" != "GCC"
+SHL4IMPLIBN=$(LB)/$(SHL4IMPLIB).lib
+ALLTAR : $(SHL4IMPLIBN)
+
+.IF "$(USE_DEFFILE)"==""
+USE_4IMPLIB_DEPS=$(LB)/$(SHL4IMPLIB).lib
+.ENDIF # "$(USE_DEFFILE)"==""
+.ENDIF # "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+USE_SHL4DEF=$(SHL4DEF)
+.ELSE # "$(GUI)" != "UNX"
+USE_SHL4DEF=
+SHL4DEPN+:=$(SHL4DEPNU)
+
+.IF "$(SHL4VERSIONMAP)"==""
+# to activate vmaps remove "#"
+USE_SHL4VERSIONMAP=$(MISC)/$(SHL4TARGET).vmap
+.ENDIF # "$(SHL4VERSIONMAP)"==""
+
+.IF "$(USE_SHL4VERSIONMAP)"!=""
+
+.IF "$(SHL4FILTERFILE)"!=""
+.IF "$(SHL4VERSIONMAP)"!=""
+#eine von beiden ist zuviel
+USE_SHL4VERSIONMAP=$(MISC)/$(SHL4TARGET).vmap
+$(USE_SHL4VERSIONMAP) .PHONY:
+ @echo -----------------------------
+ @echo you should only use versionmap OR exportfile
+ @echo -----------------------------
+# force_dmake_to_error
+
+.ENDIF # "$(SHL4VERSIONMAP)"!=""
+
+SHL4VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL4VERSIONMAP)
+
+$(USE_SHL4VERSIONMAP): \
+ $(SHL4OBJS)\
+ $(SHL4LIBS)\
+ $(SHL4FILTERFILE)
+ @$(RM) $@.dump
+.IF "$(SHL4OBJS)"!=""
+# dump remaining objects on the fly
+.IF "$(OS)"=="MACOSX"
+ @-nm $(SHL4OBJS:s/.obj/.o/) > $@.dump
+.ELSE
+ @nm $(SHL4OBJS:s/.obj/.o/) > $@.dump
+.ENDIF
+.ENDIF # "$(SHL4OBJS)!"=""
+ @$(TYPE) /dev/null $(SHL4LIBS:s/.lib/.dump/) >> $@.dump
+ $(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL4INTERFACE) -f $(SHL4FILTERFILE) -m $@
+
+.ELSE # "$(SHL4FILTERFILE)"!=""
+USE_SHL4VERSIONMAP=$(MISC)/$(SHL4TARGET).vmap
+$(USE_SHL4VERSIONMAP) :
+.IF "$(VERBOSE)" == "TRUE"
+ @echo -----------------------------
+ @echo SHL4FILTERFILE not set!
+ @echo -----------------------------
+ @$(TOUCH) $@
+ @echo dummy file to keep the dependencies for later use.
+.ELSE
+ @$(TOUCH) $@
+.ENDIF
+# force_dmake_to_error
+.ENDIF # "$(SHL4FILTERFILE)"!=""
+.ELSE # "$(USE_SHL4VERSIONMAP)"!=""
+
+#and now for the plain non-generic way...
+.IF "$(SHL4VERSIONMAP)"!=""
+USE_SHL4VERSIONMAP=$(MISC)/$(SHL4VERSIONMAP:b)_$(SHL4TARGET)$(SHL4VERSIONMAP:e)
+SHL4VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL4VERSIONMAP)
+
+.IF "$(OS)"=="MACOSX"
+$(USE_SHL4VERSIONMAP): $(SHL4OBJS) $(SHL4LIBS)
+.ENDIF
+
+# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
+# even if the $(AWK) part fails:
+$(USE_SHL4VERSIONMAP) .ERRREMOVE: $(SHL4VERSIONMAP)
+ @@-$(RM) -f $@
+# The following files will only be generated and needed on Mac OS X as temporary files
+# in order to generate exported symbols list out of Linux/Solaris map files
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) -f $@.symregexp >& $(NULLDEV)
+ @-$(RM) -f $@.expsymlist >& $(NULLDEV)
+.ENDIF
+# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
+# happens if somebody will change it in the future
+.IF "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL4VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
+.ELIF "$(COMNAME)"=="sunpro5"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL4VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
+.ELSE # "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL4VERSIONMAP) > $@
+.ENDIF # "$(COMID)"=="gcc3"
+ @chmod a+w $@
+# Mac OS X post-processing generate an exported symbols list from the generated map file
+# for details on exported symbols list see man ld on Mac OS X
+.IF "$(OS)"=="MACOSX"
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+.IF "$(SHL4OBJS)"!=""
+ -echo $(foreach,i,$(SHL4OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+.IF "$(SHL4LIBS)"!=""
+ $(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL4LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ cp $@.exported-symbols $@
+.ENDIF # .IF "$(OS)"=="MACOSX"
+.ENDIF # "$(SHL4VERSIONMAP)"!=""
+.ENDIF # "$(USE_SHL4VERSIONMAP)"!=""
+.ENDIF # "$(GUI)" != "UNX"
+
+.IF "$(UNIXVERSIONNAMES)"!=""
+.IF "$(OS)"!="MACOSX"
+.IF "$(GUI)"=="UNX"
+SHL4SONAME=\"$(SONAME_SWITCH)$(SHL4TARGETN:f)\"
+.ENDIF # "$(GUI)"!="UNX"
+.ENDIF # "$(OS)"!="MACOSX"
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+
+.IF "$(SHL4RES)"!=""
+SHL4ALLRES+=$(SHL4RES)
+SHL4LINKRES*=$(MISC)/$(SHL4TARGET).res
+SHL4LINKRESO*=$(MISC)/$(SHL4TARGET)_res.o
+.ENDIF # "$(SHL4RES)"!=""
+
+.IF "$(SHL4DEFAULTRES)$(use_shl_versions)"!=""
+SHL4DEFAULTRES*=$(MISC)/$(SHL4TARGET)_def.res
+SHL4ALLRES+=$(SHL4DEFAULTRES)
+SHL4LINKRES*=$(MISC)/$(SHL4TARGET).res
+SHL4LINKRESO*=$(MISC)/$(SHL4TARGET)_res.o
+.ENDIF # "$(SHL4DEFAULTRES)$(use_shl_versions)"!=""
+
+#.IF "$(SHL4TARGETN)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL4LIBS)"!=""
+$(MISC)/$(SHL4TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL4LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL4LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(SHL4TARGETN:b)_linkinc.ls
+$(SHL4TARGETN) : $(LINKINCTARGETS)
+
+.ELSE
+.IF "$(SHL4USE_EXPORTS)"=="name"
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(COM)"!="GCC"
+.IF "$(SHL4LIBS)"!=""
+SHL4LINKLIST=$(MISC)/$(SHL4TARGET)_link.lst
+SHL4LINKLISTPARAM=@$(SHL4LINKLIST)
+$(SHL4LINKLIST) : $(SHL4LIBS)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL4LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL4LIBS)"!=""
+.ENDIF # "$(COM)"!="GCC"
+.ENDIF
+.ENDIF # "$(SHL4USE_EXPORTS)"=="name"
+
+$(MISC)/%linkinc.ls:
+ @echo . > $@
+.ENDIF # "$(linkinc)"!=""
+
+.IF "$(GUI)" == "OS2"
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL4TARGET8=$(shell @fix_shl $(SHL4TARGET))
+.ENDIF
+
+.IF "$(GUI)" == "OS2"
+_SHL4IMP_ORD = $(SHL4STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL4STDLIBS:^"$(LB)/")
+SHL4IMP_ORD = $(foreach,i,$(_SHL4IMP_ORD) $(shell @-ls $i))
+.ELSE
+SHL4IMP_ORD =
+.ENDIF
+
+
+$(SHL4TARGETN) : \
+ $(SHL4OBJS)\
+ $(SHL4LIBS)\
+ $(USE_4IMPLIB_DEPS)\
+ $(USE_SHL4DEF)\
+ $(USE_SHL4VERSIONMAP)\
+ $(SHL4RES)\
+ $(SHL4DEPN) \
+ $(SHL4IMP_ORD) \
+ $(SHL4LINKLIST)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(SHL4DEFAULTRES)"!=""
+ @@-$(RM) $(MISC)/$(SHL4DEFAULTRES:b).rc
+.IF "$(SHL4ICON)" != ""
+ @echo 1 ICON $(SHL4ICON) >> $(MISC)/$(SHL4DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL4ADD_VERINFO)"!=""
+ @echo $(EMQ)#include $(EMQ)"$(SHL4ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL4DEFAULTRES:b).rc
+.ELSE # "$(SHL4ADD_VERINFO)"!=""
+ @echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL4DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL4DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL4DEFAULTRES:b).rc
+.ENDIF # "$(SHL4ADD_VERINFO)"!=""
+ @echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(SHL4DEFAULTRES:b).rc
+ @echo $(EMQ)#define ORG_NAME $(SHL4TARGET)$(DLLPOST) >> $(MISC)/$(SHL4DEFAULTRES:b).rc
+ @echo $(EMQ)#define INTERNAL_NAME $(SHL4TARGET:b) >> $(MISC)/$(SHL4DEFAULTRES:b).rc
+ @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL4DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL4DEFAULTRES:b).rc
+.ENDIF # "$(SHL4DEFAULTRES)"!=""
+.IF "$(SHL4ALLRES)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(SHL4ALLRES) > $(SHL4LINKRES)
+.IF "$(COM)"=="GCC"
+ windres $(SHL4LINKRES) $(SHL4LINKRESO)
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(SHL4ALLRES)"!=""
+.IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def
+ @echo dlltool --dllname $(SHL4TARGET)$(DLLPOST) \
+ --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_4.cmd
+ @noop $(assign ALL4OBJLIST:=$(STDOBJ) $(SHL4OBJS) $(SHL4LINKRESO) $(shell $(TYPE) /dev/null $(SHL4LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+.IF "$(DEFLIB4NAME)"!="" # do not have to include objs
+ @noop $(assign DEF4OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB4NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+ @noop $(foreach,i,$(DEF4OBJLIST) $(assign ALL4OBJLIST:=$(ALL4OBJLIST:s?$i??)))
+.ENDIF # "$(DEFLIB4NAME)"!=""
+ @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_4.cmd
+.IF "$(SHL4DEF)"!=""
+ @echo --input-def $(SHL4DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_4.cmd
+.ELSE
+ @echo $(SHL4VERSIONOBJ) $(SHL4DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_4.cmd
+.ENDIF
+ @echo $(ALL4OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_4.cmd
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
+ $(STDOBJ) $(SHL4VERSIONOBJ) $(SHL4DESCRIPTIONOBJ) $(SHL4OBJS) $(SHL4LINKRESO) \
+ `$(TYPE) /dev/null $(SHL4LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ -Wl,--exclude-libs,ALL,--start-group $(SHL4STDLIBS) -Wl,--end-group \
+ $(SHL4STDSHL) $(STDSHL4) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
+ -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_4.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_4.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_4.cmd
+.ELSE
+.IF "$(linkinc)"==""
+.IF "$(SHL4USE_EXPORTS)"!="name"
+.IF "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL4LINKER) @$(mktmp \
+ $(SHL4LINKFLAGS) \
+ $(LINKFLAGSSHL) \
+ $(SHL4STACK) $(SHL4BASEX) \
+ -out:$@ \
+ -map:$(MISC)/$(@:b).map \
+ -def:$(SHL4DEF) \
+ $(USE_4IMPLIB) \
+ $(STDOBJ) \
+ $(SHL4VERSIONOBJ) $(SHL4OBJS) \
+ $(SHL4LIBS) \
+ $(SHL4STDLIBS) \
+ $(SHL4STDSHL) $(STDSHL4) \
+ $(SHL4LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE # "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL4LINKER) @$(mktmp $(SHL4LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL4BASEX) \
+ $(SHL4STACK) -out:$(SHL4TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(LB)/$(SHL4IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL4OBJS) $(SHL4VERSIONOBJ) \
+ $(SHL4LIBS) \
+ $(SHL4STDLIBS) \
+ $(SHL4STDSHL) $(STDSHL4) \
+ $(SHL4LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(USE_DEFFILE)"!=""
+.ELSE # "$(SHL4USE_EXPORTS)"!="name"
+ $(COMMAND_ECHO)$(SHL4LINKER) @$(mktmp $(SHL4LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL4BASEX) \
+ $(SHL4STACK) -out:$(SHL4TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(USE_4IMPLIB) \
+ $(STDOBJ) \
+ $(SHL4OBJS) $(SHL4VERSIONOBJ)) \
+ $(SHL4LINKLISTPARAM) \
+ @$(mktmp $(SHL4STDLIBS) \
+ $(SHL4STDSHL) $(STDSHL4) \
+ $(SHL4LINKRES) \
+ )
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(SHL4USE_EXPORTS)"!="name"
+.ELSE # "$(linkinc)"==""
+ $(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL4TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL4TARGET).lst
+ $(COMMAND_ECHO)$(TYPE) $(mktmp \
+ $(SHL4LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL4BASEX) \
+ $(SHL4STACK) $(MAPFILE) \
+ -out:$@ \
+ $(LB)/$(SHL4IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL4OBJS) \
+ $(SHL4STDLIBS) \
+ $(SHL4STDSHL) $(STDSHL4) \
+ $(SHL4LINKRES) \
+ ) >> $(MISC)/$(SHL4TARGET).lnk
+ $(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL4TARGETN:b)_linkinc.ls >> $(MISC)/$(SHL4TARGET).lnk
+ $(COMMAND_ECHO)$(SHL4LINKER) @$(MISC)/$(SHL4TARGET).lnk
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(linkinc)"==""
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)" == "WNT"
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_4.cmd
+ @echo $(STDSLO) $(SHL4OBJS:s/.obj/.o/) \
+ $(SHL4VERSIONOBJ) \
+ `cat /dev/null $(SHL4LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(SHL4LINKER) $(SHL4LINKFLAGS) $(SHL4VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
+ $(SHL4STDLIBS) $(SHL4ARCHIVES) $(SHL4STDSHL) $(STDSHL4) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_4.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_4.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_4.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_4.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_4.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ shl $(SHL4RPATH) $@
+.IF "$(SHL4CREATEJNILIB)"!=""
+ @echo "Making: " $(@:f).jnilib
+ @macosx-create-bundle $@
+.ENDIF # "$(SHL4CREATEJNILIB)"!=""
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL4NOCHECK)"==""
+ $(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS4) $(SHL4TARGETN)
+.ENDIF # "$(SHL4NOCHECK)"!=""
+.ENDIF
+.ELSE # "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_4.cmd
+ @echo $(SHL4LINKER) $(SHL4LINKFLAGS) $(SHL4SONAME) $(LINKFLAGSSHL) $(SHL4VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL4OBJS:s/.obj/.o/) \
+ $(SHL4VERSIONOBJ) -o $@ \
+ `cat /dev/null $(SHL4LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ $(SHL4STDLIBS) $(SHL4ARCHIVES) $(SHL4STDSHL) $(STDSHL4) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_4.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_4.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_4.cmd
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL4NOCHECK)"==""
+ $(COMMAND_ECHO)-$(RM) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f)
+ $(COMMAND_ECHO)$(RENAME) $(SHL4TARGETN) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f)
+.IF "$(VERBOSE)"=="TRUE"
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS4) $(SHL4TARGETN:d)check_$(SHL4TARGETN:f)
+.ELSE
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS4) -- -s $(SHL4TARGETN:d)check_$(SHL4TARGETN:f)
+.ENDIF
+.ENDIF # "$(SHL4NOCHECK)"!=""
+.ENDIF # "$(UPDATER)"=="YES"
+.ENDIF # "$(OS)"=="MACOSX"
+.IF "$(UNIXVERSIONNAMES)"!=""
+ $(COMMAND_ECHO)$(RM) $(LB)/$(SHL4TARGETN:b)
+ $(COMMAND_ECHO)cd $(LB) && ln -s $(SHL4TARGETN:f) $(SHL4TARGETN:b)
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+.IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+.ENDIF
+.ENDIF # "$(GUI)" == "UNX"
+
+.IF "$(GUI)" == "OS2"
+
+.IF "$(SHL4DEFAULTRES)"!=""
+ @+-$(RM) $(MISC)/$(SHL4DEFAULTRES:b).rc >& $(NULLDEV)
+.IF "$(SHL4ICON)" != ""
+ @-+echo 1 ICON $(SHL4ICON) >> $(MISC)/$(SHL4DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL4ADD_VERINFO)"!=""
+ @-+echo $(EMQ)#include $(EMQ)"$(SHL4ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL4DEFAULTRES:b).rc
+.ENDIF # "$(SHL4ADD_VERINFO)"!=""
+ @-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL4DEFAULTRES:b).rc
+# @-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL4DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL4DEFAULTRES:b).rc
+.ENDIF # "$(SHL4DEFAULTRES)"!=""
+
+.IF "$(SHL4ALLRES)"!=""
+ $(COMMAND_ECHO)+$(TYPE) $(SHL4ALLRES) > $(SHL4LINKRES)
+.ENDIF # "$(SHL4ALLRES)"!=""
+
+.IF "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL4LINKER) $(SHL4LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
+ $(SHL4DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL4OBJS) $(SHL4VERSIONOBJ) \
+ $(SHL4LIBS) \
+ $(SHL4STDLIBS:^"-l") \
+ $(SHL4LINKRES) \
+ $(SHL4STDSHL:^"-l") $(STDSHL4:^"-l")
+
+.ELSE # "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL4LINKER) -v $(SHL4LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL4BASEX) \
+ $(SHL4STACK) -o $(SHL4TARGETN) \
+ $(SHL4DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL4OBJS) $(SHL4VERSIONOBJ) \
+ $(SHL4LIBS) \
+ $(SHL4STDLIBS:^"-l") \
+ $(SHL4LINKRES) \
+ $(SHL4STDSHL:^"-l") $(STDSHL4:^"-l") \
+ $(LINKOUTPUTFILTER)
+ @$(LS) $@ >& $(NULLDEV)
+
+.ENDIF # "$(USE_DEFFILE)"!=""
+
+.IF "$(SHL4TARGET8)" != "$(SHL4TARGET)"
+ $(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL4TARGET8).dll
+.ENDIF
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(SHL4TARGETN)"!=""
+
+# unroll begin
+
+.IF "$(SHL5TARGETN)"!=""
+
+.IF "$(OS)"=="AIX"
+SHL5STDLIBS=
+.ENDIF
+
+.IF "$(SHLLINKARCONLY)" != ""
+SHL5STDLIBS=
+STDSHL=
+.ELSE
+SHL5ARCHIVES=
+.ENDIF
+
+# decide how to link
+.IF "$(SHL5CODETYPE)"=="C"
+SHL5LINKER=$(LINKC)
+SHL5STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
+SHL5LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(SHL5CODETYPE)"=="C"
+SHL5LINKER=$(LINK)
+SHL5STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
+SHL5LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(SHL5CODETYPE)"=="C"
+
+SHL5RPATH*=OOO
+LINKFLAGSRUNPATH_$(SHL5RPATH)*=/ERROR:/Bad_SHL5RPATH_value
+SHL5LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL5RPATH))
+
+.IF "$(SHL5USE_EXPORTS)"==""
+SHL5DEF*=$(MISC)/$(SHL5TARGET).def
+.ENDIF # "$(SHL5USE_EXPORTS)"==""
+
+EXTRALIBPATHS5=$(EXTRALIBPATHS)
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL5NOCHECK)"==""
+.IF "$(SOLAR_STLLIBPATH)"!=""
+EXTRALIBPATHS5+=-L$(SOLAR_STLLIBPATH)
+.ENDIF
+.ENDIF # "$(SHL5NOCHECK)"!=""
+.ENDIF
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#+++++++++++ version object ++++++++++++++++++++++++++++++++++++++++
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.IF "$(L10N_framework)"==""
+.IF "$(VERSIONOBJ)"!=""
+SHL5VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL5TARGET))}$(VERSIONOBJ:f)
+USE_VERSIONH:=$(INCCOM)/$(SHL5VERSIONOBJ:b).h
+.IF "$(GUI)" == "UNX"
+SHL5VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL5TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
+.ELSE # "$(GUI)" == "UNX"
+SHL5VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL5TARGET))}$(VERSIONOBJ:f)
+.ENDIF # "$(GUI)" == "UNX"
+$(MISC)/$(SHL5VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL5VERSIONOBJ:b).h
+# $(COPY) $(SOLARENV)/src/version.c $@
+ $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL5VERSIONOBJ:b).h/ > $@
+
+.INIT : $(SHL5VERSIONOBJDEP)
+.ENDIF # "$(VERSIONOBJ)"!=""
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL5IMPLIB)" == ""
+SHL5IMPLIB=i$(TARGET)_t5
+.ENDIF # "$(SHL5IMPLIB)" == ""
+.IF "$(COM)" != "GCC"
+USE_5IMPLIB=-implib:$(LB)/$(SHL5IMPLIB).lib
+.ENDIF # "$(COM)" != "GCC"
+SHL5IMPLIBN=$(LB)/$(SHL5IMPLIB).lib
+ALLTAR : $(SHL5IMPLIBN)
+
+.IF "$(USE_DEFFILE)"==""
+USE_5IMPLIB_DEPS=$(LB)/$(SHL5IMPLIB).lib
+.ENDIF # "$(USE_DEFFILE)"==""
+.ENDIF # "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+USE_SHL5DEF=$(SHL5DEF)
+.ELSE # "$(GUI)" != "UNX"
+USE_SHL5DEF=
+SHL5DEPN+:=$(SHL5DEPNU)
+
+.IF "$(SHL5VERSIONMAP)"==""
+# to activate vmaps remove "#"
+USE_SHL5VERSIONMAP=$(MISC)/$(SHL5TARGET).vmap
+.ENDIF # "$(SHL5VERSIONMAP)"==""
+
+.IF "$(USE_SHL5VERSIONMAP)"!=""
+
+.IF "$(SHL5FILTERFILE)"!=""
+.IF "$(SHL5VERSIONMAP)"!=""
+#eine von beiden ist zuviel
+USE_SHL5VERSIONMAP=$(MISC)/$(SHL5TARGET).vmap
+$(USE_SHL5VERSIONMAP) .PHONY:
+ @echo -----------------------------
+ @echo you should only use versionmap OR exportfile
+ @echo -----------------------------
+# force_dmake_to_error
+
+.ENDIF # "$(SHL5VERSIONMAP)"!=""
+
+SHL5VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL5VERSIONMAP)
+
+$(USE_SHL5VERSIONMAP): \
+ $(SHL5OBJS)\
+ $(SHL5LIBS)\
+ $(SHL5FILTERFILE)
+ @$(RM) $@.dump
+.IF "$(SHL5OBJS)"!=""
+# dump remaining objects on the fly
+.IF "$(OS)"=="MACOSX"
+ @-nm $(SHL5OBJS:s/.obj/.o/) > $@.dump
+.ELSE
+ @nm $(SHL5OBJS:s/.obj/.o/) > $@.dump
+.ENDIF
+.ENDIF # "$(SHL5OBJS)!"=""
+ @$(TYPE) /dev/null $(SHL5LIBS:s/.lib/.dump/) >> $@.dump
+ $(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL5INTERFACE) -f $(SHL5FILTERFILE) -m $@
+
+.ELSE # "$(SHL5FILTERFILE)"!=""
+USE_SHL5VERSIONMAP=$(MISC)/$(SHL5TARGET).vmap
+$(USE_SHL5VERSIONMAP) :
+.IF "$(VERBOSE)" == "TRUE"
+ @echo -----------------------------
+ @echo SHL5FILTERFILE not set!
+ @echo -----------------------------
+ @$(TOUCH) $@
+ @echo dummy file to keep the dependencies for later use.
+.ELSE
+ @$(TOUCH) $@
+.ENDIF
+# force_dmake_to_error
+.ENDIF # "$(SHL5FILTERFILE)"!=""
+.ELSE # "$(USE_SHL5VERSIONMAP)"!=""
+
+#and now for the plain non-generic way...
+.IF "$(SHL5VERSIONMAP)"!=""
+USE_SHL5VERSIONMAP=$(MISC)/$(SHL5VERSIONMAP:b)_$(SHL5TARGET)$(SHL5VERSIONMAP:e)
+SHL5VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL5VERSIONMAP)
+
+.IF "$(OS)"=="MACOSX"
+$(USE_SHL5VERSIONMAP): $(SHL5OBJS) $(SHL5LIBS)
+.ENDIF
+
+# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
+# even if the $(AWK) part fails:
+$(USE_SHL5VERSIONMAP) .ERRREMOVE: $(SHL5VERSIONMAP)
+ @@-$(RM) -f $@
+# The following files will only be generated and needed on Mac OS X as temporary files
+# in order to generate exported symbols list out of Linux/Solaris map files
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) -f $@.symregexp >& $(NULLDEV)
+ @-$(RM) -f $@.expsymlist >& $(NULLDEV)
+.ENDIF
+# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
+# happens if somebody will change it in the future
+.IF "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL5VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
+.ELIF "$(COMNAME)"=="sunpro5"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL5VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
+.ELSE # "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL5VERSIONMAP) > $@
+.ENDIF # "$(COMID)"=="gcc3"
+ @chmod a+w $@
+# Mac OS X post-processing generate an exported symbols list from the generated map file
+# for details on exported symbols list see man ld on Mac OS X
+.IF "$(OS)"=="MACOSX"
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+.IF "$(SHL5OBJS)"!=""
+ -echo $(foreach,i,$(SHL5OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+.IF "$(SHL5LIBS)"!=""
+ $(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL5LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ cp $@.exported-symbols $@
+.ENDIF # .IF "$(OS)"=="MACOSX"
+.ENDIF # "$(SHL5VERSIONMAP)"!=""
+.ENDIF # "$(USE_SHL5VERSIONMAP)"!=""
+.ENDIF # "$(GUI)" != "UNX"
+
+.IF "$(UNIXVERSIONNAMES)"!=""
+.IF "$(OS)"!="MACOSX"
+.IF "$(GUI)"=="UNX"
+SHL5SONAME=\"$(SONAME_SWITCH)$(SHL5TARGETN:f)\"
+.ENDIF # "$(GUI)"!="UNX"
+.ENDIF # "$(OS)"!="MACOSX"
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+
+.IF "$(SHL5RES)"!=""
+SHL5ALLRES+=$(SHL5RES)
+SHL5LINKRES*=$(MISC)/$(SHL5TARGET).res
+SHL5LINKRESO*=$(MISC)/$(SHL5TARGET)_res.o
+.ENDIF # "$(SHL5RES)"!=""
+
+.IF "$(SHL5DEFAULTRES)$(use_shl_versions)"!=""
+SHL5DEFAULTRES*=$(MISC)/$(SHL5TARGET)_def.res
+SHL5ALLRES+=$(SHL5DEFAULTRES)
+SHL5LINKRES*=$(MISC)/$(SHL5TARGET).res
+SHL5LINKRESO*=$(MISC)/$(SHL5TARGET)_res.o
+.ENDIF # "$(SHL5DEFAULTRES)$(use_shl_versions)"!=""
+
+#.IF "$(SHL5TARGETN)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL5LIBS)"!=""
+$(MISC)/$(SHL5TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL5LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL5LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(SHL5TARGETN:b)_linkinc.ls
+$(SHL5TARGETN) : $(LINKINCTARGETS)
+
+.ELSE
+.IF "$(SHL5USE_EXPORTS)"=="name"
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(COM)"!="GCC"
+.IF "$(SHL5LIBS)"!=""
+SHL5LINKLIST=$(MISC)/$(SHL5TARGET)_link.lst
+SHL5LINKLISTPARAM=@$(SHL5LINKLIST)
+$(SHL5LINKLIST) : $(SHL5LIBS)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL5LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL5LIBS)"!=""
+.ENDIF # "$(COM)"!="GCC"
+.ENDIF
+.ENDIF # "$(SHL5USE_EXPORTS)"=="name"
+
+$(MISC)/%linkinc.ls:
+ @echo . > $@
+.ENDIF # "$(linkinc)"!=""
+
+.IF "$(GUI)" == "OS2"
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL5TARGET8=$(shell @fix_shl $(SHL5TARGET))
+.ENDIF
+
+.IF "$(GUI)" == "OS2"
+_SHL5IMP_ORD = $(SHL5STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL5STDLIBS:^"$(LB)/")
+SHL5IMP_ORD = $(foreach,i,$(_SHL5IMP_ORD) $(shell @-ls $i))
+.ELSE
+SHL5IMP_ORD =
+.ENDIF
+
+
+$(SHL5TARGETN) : \
+ $(SHL5OBJS)\
+ $(SHL5LIBS)\
+ $(USE_5IMPLIB_DEPS)\
+ $(USE_SHL5DEF)\
+ $(USE_SHL5VERSIONMAP)\
+ $(SHL5RES)\
+ $(SHL5DEPN) \
+ $(SHL5IMP_ORD) \
+ $(SHL5LINKLIST)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(SHL5DEFAULTRES)"!=""
+ @@-$(RM) $(MISC)/$(SHL5DEFAULTRES:b).rc
+.IF "$(SHL5ICON)" != ""
+ @echo 1 ICON $(SHL5ICON) >> $(MISC)/$(SHL5DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL5ADD_VERINFO)"!=""
+ @echo $(EMQ)#include $(EMQ)"$(SHL5ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL5DEFAULTRES:b).rc
+.ELSE # "$(SHL5ADD_VERINFO)"!=""
+ @echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL5DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL5DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL5DEFAULTRES:b).rc
+.ENDIF # "$(SHL5ADD_VERINFO)"!=""
+ @echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(SHL5DEFAULTRES:b).rc
+ @echo $(EMQ)#define ORG_NAME $(SHL5TARGET)$(DLLPOST) >> $(MISC)/$(SHL5DEFAULTRES:b).rc
+ @echo $(EMQ)#define INTERNAL_NAME $(SHL5TARGET:b) >> $(MISC)/$(SHL5DEFAULTRES:b).rc
+ @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL5DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL5DEFAULTRES:b).rc
+.ENDIF # "$(SHL5DEFAULTRES)"!=""
+.IF "$(SHL5ALLRES)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(SHL5ALLRES) > $(SHL5LINKRES)
+.IF "$(COM)"=="GCC"
+ windres $(SHL5LINKRES) $(SHL5LINKRESO)
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(SHL5ALLRES)"!=""
+.IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def
+ @echo dlltool --dllname $(SHL5TARGET)$(DLLPOST) \
+ --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_5.cmd
+ @noop $(assign ALL5OBJLIST:=$(STDOBJ) $(SHL5OBJS) $(SHL5LINKRESO) $(shell $(TYPE) /dev/null $(SHL5LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+.IF "$(DEFLIB5NAME)"!="" # do not have to include objs
+ @noop $(assign DEF5OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB5NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+ @noop $(foreach,i,$(DEF5OBJLIST) $(assign ALL5OBJLIST:=$(ALL5OBJLIST:s?$i??)))
+.ENDIF # "$(DEFLIB5NAME)"!=""
+ @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_5.cmd
+.IF "$(SHL5DEF)"!=""
+ @echo --input-def $(SHL5DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_5.cmd
+.ELSE
+ @echo $(SHL5VERSIONOBJ) $(SHL5DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_5.cmd
+.ENDIF
+ @echo $(ALL5OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_5.cmd
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
+ $(STDOBJ) $(SHL5VERSIONOBJ) $(SHL5DESCRIPTIONOBJ) $(SHL5OBJS) $(SHL5LINKRESO) \
+ `$(TYPE) /dev/null $(SHL5LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ -Wl,--exclude-libs,ALL,--start-group $(SHL5STDLIBS) -Wl,--end-group \
+ $(SHL5STDSHL) $(STDSHL5) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
+ -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_5.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_5.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_5.cmd
+.ELSE
+.IF "$(linkinc)"==""
+.IF "$(SHL5USE_EXPORTS)"!="name"
+.IF "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL5LINKER) @$(mktmp \
+ $(SHL5LINKFLAGS) \
+ $(LINKFLAGSSHL) \
+ $(SHL5STACK) $(SHL5BASEX) \
+ -out:$@ \
+ -map:$(MISC)/$(@:b).map \
+ -def:$(SHL5DEF) \
+ $(USE_5IMPLIB) \
+ $(STDOBJ) \
+ $(SHL5VERSIONOBJ) $(SHL5OBJS) \
+ $(SHL5LIBS) \
+ $(SHL5STDLIBS) \
+ $(SHL5STDSHL) $(STDSHL5) \
+ $(SHL5LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE # "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL5LINKER) @$(mktmp $(SHL5LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL5BASEX) \
+ $(SHL5STACK) -out:$(SHL5TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(LB)/$(SHL5IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL5OBJS) $(SHL5VERSIONOBJ) \
+ $(SHL5LIBS) \
+ $(SHL5STDLIBS) \
+ $(SHL5STDSHL) $(STDSHL5) \
+ $(SHL5LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(USE_DEFFILE)"!=""
+.ELSE # "$(SHL5USE_EXPORTS)"!="name"
+ $(COMMAND_ECHO)$(SHL5LINKER) @$(mktmp $(SHL5LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL5BASEX) \
+ $(SHL5STACK) -out:$(SHL5TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(USE_5IMPLIB) \
+ $(STDOBJ) \
+ $(SHL5OBJS) $(SHL5VERSIONOBJ)) \
+ $(SHL5LINKLISTPARAM) \
+ @$(mktmp $(SHL5STDLIBS) \
+ $(SHL5STDSHL) $(STDSHL5) \
+ $(SHL5LINKRES) \
+ )
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(SHL5USE_EXPORTS)"!="name"
+.ELSE # "$(linkinc)"==""
+ $(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL5TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL5TARGET).lst
+ $(COMMAND_ECHO)$(TYPE) $(mktmp \
+ $(SHL5LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL5BASEX) \
+ $(SHL5STACK) $(MAPFILE) \
+ -out:$@ \
+ $(LB)/$(SHL5IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL5OBJS) \
+ $(SHL5STDLIBS) \
+ $(SHL5STDSHL) $(STDSHL5) \
+ $(SHL5LINKRES) \
+ ) >> $(MISC)/$(SHL5TARGET).lnk
+ $(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL5TARGETN:b)_linkinc.ls >> $(MISC)/$(SHL5TARGET).lnk
+ $(COMMAND_ECHO)$(SHL5LINKER) @$(MISC)/$(SHL5TARGET).lnk
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(linkinc)"==""
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)" == "WNT"
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_5.cmd
+ @echo $(STDSLO) $(SHL5OBJS:s/.obj/.o/) \
+ $(SHL5VERSIONOBJ) \
+ `cat /dev/null $(SHL5LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(SHL5LINKER) $(SHL5LINKFLAGS) $(SHL5VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
+ $(SHL5STDLIBS) $(SHL5ARCHIVES) $(SHL5STDSHL) $(STDSHL5) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_5.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_5.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_5.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_5.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_5.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ shl $(SHL5RPATH) $@
+.IF "$(SHL5CREATEJNILIB)"!=""
+ @echo "Making: " $(@:f).jnilib
+ @macosx-create-bundle $@
+.ENDIF # "$(SHL5CREATEJNILIB)"!=""
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL5NOCHECK)"==""
+ $(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS5) $(SHL5TARGETN)
+.ENDIF # "$(SHL5NOCHECK)"!=""
+.ENDIF
+.ELSE # "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_5.cmd
+ @echo $(SHL5LINKER) $(SHL5LINKFLAGS) $(SHL5SONAME) $(LINKFLAGSSHL) $(SHL5VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL5OBJS:s/.obj/.o/) \
+ $(SHL5VERSIONOBJ) -o $@ \
+ `cat /dev/null $(SHL5LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ $(SHL5STDLIBS) $(SHL5ARCHIVES) $(SHL5STDSHL) $(STDSHL5) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_5.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_5.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_5.cmd
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL5NOCHECK)"==""
+ $(COMMAND_ECHO)-$(RM) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f)
+ $(COMMAND_ECHO)$(RENAME) $(SHL5TARGETN) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f)
+.IF "$(VERBOSE)"=="TRUE"
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS5) $(SHL5TARGETN:d)check_$(SHL5TARGETN:f)
+.ELSE
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS5) -- -s $(SHL5TARGETN:d)check_$(SHL5TARGETN:f)
+.ENDIF
+.ENDIF # "$(SHL5NOCHECK)"!=""
+.ENDIF # "$(UPDATER)"=="YES"
+.ENDIF # "$(OS)"=="MACOSX"
+.IF "$(UNIXVERSIONNAMES)"!=""
+ $(COMMAND_ECHO)$(RM) $(LB)/$(SHL5TARGETN:b)
+ $(COMMAND_ECHO)cd $(LB) && ln -s $(SHL5TARGETN:f) $(SHL5TARGETN:b)
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+.IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+.ENDIF
+.ENDIF # "$(GUI)" == "UNX"
+
+.IF "$(GUI)" == "OS2"
+
+.IF "$(SHL5DEFAULTRES)"!=""
+ @+-$(RM) $(MISC)/$(SHL5DEFAULTRES:b).rc >& $(NULLDEV)
+.IF "$(SHL5ICON)" != ""
+ @-+echo 1 ICON $(SHL5ICON) >> $(MISC)/$(SHL5DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL5ADD_VERINFO)"!=""
+ @-+echo $(EMQ)#include $(EMQ)"$(SHL5ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL5DEFAULTRES:b).rc
+.ENDIF # "$(SHL5ADD_VERINFO)"!=""
+ @-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL5DEFAULTRES:b).rc
+# @-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL5DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL5DEFAULTRES:b).rc
+.ENDIF # "$(SHL5DEFAULTRES)"!=""
+
+.IF "$(SHL5ALLRES)"!=""
+ $(COMMAND_ECHO)+$(TYPE) $(SHL5ALLRES) > $(SHL5LINKRES)
+.ENDIF # "$(SHL5ALLRES)"!=""
+
+.IF "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL5LINKER) $(SHL5LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
+ $(SHL5DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL5OBJS) $(SHL5VERSIONOBJ) \
+ $(SHL5LIBS) \
+ $(SHL5STDLIBS:^"-l") \
+ $(SHL5LINKRES) \
+ $(SHL5STDSHL:^"-l") $(STDSHL5:^"-l")
+
+.ELSE # "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL5LINKER) -v $(SHL5LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL5BASEX) \
+ $(SHL5STACK) -o $(SHL5TARGETN) \
+ $(SHL5DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL5OBJS) $(SHL5VERSIONOBJ) \
+ $(SHL5LIBS) \
+ $(SHL5STDLIBS:^"-l") \
+ $(SHL5LINKRES) \
+ $(SHL5STDSHL:^"-l") $(STDSHL5:^"-l") \
+ $(LINKOUTPUTFILTER)
+ @$(LS) $@ >& $(NULLDEV)
+
+.ENDIF # "$(USE_DEFFILE)"!=""
+
+.IF "$(SHL5TARGET8)" != "$(SHL5TARGET)"
+ $(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL5TARGET8).dll
+.ENDIF
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(SHL5TARGETN)"!=""
+
+# unroll begin
+
+.IF "$(SHL6TARGETN)"!=""
+
+.IF "$(OS)"=="AIX"
+SHL6STDLIBS=
+.ENDIF
+
+.IF "$(SHLLINKARCONLY)" != ""
+SHL6STDLIBS=
+STDSHL=
+.ELSE
+SHL6ARCHIVES=
+.ENDIF
+
+# decide how to link
+.IF "$(SHL6CODETYPE)"=="C"
+SHL6LINKER=$(LINKC)
+SHL6STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
+SHL6LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(SHL6CODETYPE)"=="C"
+SHL6LINKER=$(LINK)
+SHL6STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
+SHL6LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(SHL6CODETYPE)"=="C"
+
+SHL6RPATH*=OOO
+LINKFLAGSRUNPATH_$(SHL6RPATH)*=/ERROR:/Bad_SHL6RPATH_value
+SHL6LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL6RPATH))
+
+.IF "$(SHL6USE_EXPORTS)"==""
+SHL6DEF*=$(MISC)/$(SHL6TARGET).def
+.ENDIF # "$(SHL6USE_EXPORTS)"==""
+
+EXTRALIBPATHS6=$(EXTRALIBPATHS)
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL6NOCHECK)"==""
+.IF "$(SOLAR_STLLIBPATH)"!=""
+EXTRALIBPATHS6+=-L$(SOLAR_STLLIBPATH)
+.ENDIF
+.ENDIF # "$(SHL6NOCHECK)"!=""
+.ENDIF
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#+++++++++++ version object ++++++++++++++++++++++++++++++++++++++++
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.IF "$(L10N_framework)"==""
+.IF "$(VERSIONOBJ)"!=""
+SHL6VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL6TARGET))}$(VERSIONOBJ:f)
+USE_VERSIONH:=$(INCCOM)/$(SHL6VERSIONOBJ:b).h
+.IF "$(GUI)" == "UNX"
+SHL6VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL6TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
+.ELSE # "$(GUI)" == "UNX"
+SHL6VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL6TARGET))}$(VERSIONOBJ:f)
+.ENDIF # "$(GUI)" == "UNX"
+$(MISC)/$(SHL6VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL6VERSIONOBJ:b).h
+# $(COPY) $(SOLARENV)/src/version.c $@
+ $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL6VERSIONOBJ:b).h/ > $@
+
+.INIT : $(SHL6VERSIONOBJDEP)
+.ENDIF # "$(VERSIONOBJ)"!=""
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL6IMPLIB)" == ""
+SHL6IMPLIB=i$(TARGET)_t6
+.ENDIF # "$(SHL6IMPLIB)" == ""
+.IF "$(COM)" != "GCC"
+USE_6IMPLIB=-implib:$(LB)/$(SHL6IMPLIB).lib
+.ENDIF # "$(COM)" != "GCC"
+SHL6IMPLIBN=$(LB)/$(SHL6IMPLIB).lib
+ALLTAR : $(SHL6IMPLIBN)
+
+.IF "$(USE_DEFFILE)"==""
+USE_6IMPLIB_DEPS=$(LB)/$(SHL6IMPLIB).lib
+.ENDIF # "$(USE_DEFFILE)"==""
+.ENDIF # "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+USE_SHL6DEF=$(SHL6DEF)
+.ELSE # "$(GUI)" != "UNX"
+USE_SHL6DEF=
+SHL6DEPN+:=$(SHL6DEPNU)
+
+.IF "$(SHL6VERSIONMAP)"==""
+# to activate vmaps remove "#"
+USE_SHL6VERSIONMAP=$(MISC)/$(SHL6TARGET).vmap
+.ENDIF # "$(SHL6VERSIONMAP)"==""
+
+.IF "$(USE_SHL6VERSIONMAP)"!=""
+
+.IF "$(SHL6FILTERFILE)"!=""
+.IF "$(SHL6VERSIONMAP)"!=""
+#eine von beiden ist zuviel
+USE_SHL6VERSIONMAP=$(MISC)/$(SHL6TARGET).vmap
+$(USE_SHL6VERSIONMAP) .PHONY:
+ @echo -----------------------------
+ @echo you should only use versionmap OR exportfile
+ @echo -----------------------------
+# force_dmake_to_error
+
+.ENDIF # "$(SHL6VERSIONMAP)"!=""
+
+SHL6VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL6VERSIONMAP)
+
+$(USE_SHL6VERSIONMAP): \
+ $(SHL6OBJS)\
+ $(SHL6LIBS)\
+ $(SHL6FILTERFILE)
+ @$(RM) $@.dump
+.IF "$(SHL6OBJS)"!=""
+# dump remaining objects on the fly
+.IF "$(OS)"=="MACOSX"
+ @-nm $(SHL6OBJS:s/.obj/.o/) > $@.dump
+.ELSE
+ @nm $(SHL6OBJS:s/.obj/.o/) > $@.dump
+.ENDIF
+.ENDIF # "$(SHL6OBJS)!"=""
+ @$(TYPE) /dev/null $(SHL6LIBS:s/.lib/.dump/) >> $@.dump
+ $(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL6INTERFACE) -f $(SHL6FILTERFILE) -m $@
+
+.ELSE # "$(SHL6FILTERFILE)"!=""
+USE_SHL6VERSIONMAP=$(MISC)/$(SHL6TARGET).vmap
+$(USE_SHL6VERSIONMAP) :
+.IF "$(VERBOSE)" == "TRUE"
+ @echo -----------------------------
+ @echo SHL6FILTERFILE not set!
+ @echo -----------------------------
+ @$(TOUCH) $@
+ @echo dummy file to keep the dependencies for later use.
+.ELSE
+ @$(TOUCH) $@
+.ENDIF
+# force_dmake_to_error
+.ENDIF # "$(SHL6FILTERFILE)"!=""
+.ELSE # "$(USE_SHL6VERSIONMAP)"!=""
+
+#and now for the plain non-generic way...
+.IF "$(SHL6VERSIONMAP)"!=""
+USE_SHL6VERSIONMAP=$(MISC)/$(SHL6VERSIONMAP:b)_$(SHL6TARGET)$(SHL6VERSIONMAP:e)
+SHL6VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL6VERSIONMAP)
+
+.IF "$(OS)"=="MACOSX"
+$(USE_SHL6VERSIONMAP): $(SHL6OBJS) $(SHL6LIBS)
+.ENDIF
+
+# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
+# even if the $(AWK) part fails:
+$(USE_SHL6VERSIONMAP) .ERRREMOVE: $(SHL6VERSIONMAP)
+ @@-$(RM) -f $@
+# The following files will only be generated and needed on Mac OS X as temporary files
+# in order to generate exported symbols list out of Linux/Solaris map files
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) -f $@.symregexp >& $(NULLDEV)
+ @-$(RM) -f $@.expsymlist >& $(NULLDEV)
+.ENDIF
+# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
+# happens if somebody will change it in the future
+.IF "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL6VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
+.ELIF "$(COMNAME)"=="sunpro5"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL6VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
+.ELSE # "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL6VERSIONMAP) > $@
+.ENDIF # "$(COMID)"=="gcc3"
+ @chmod a+w $@
+# Mac OS X post-processing generate an exported symbols list from the generated map file
+# for details on exported symbols list see man ld on Mac OS X
+.IF "$(OS)"=="MACOSX"
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+.IF "$(SHL6OBJS)"!=""
+ -echo $(foreach,i,$(SHL6OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+.IF "$(SHL6LIBS)"!=""
+ $(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL6LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ cp $@.exported-symbols $@
+.ENDIF # .IF "$(OS)"=="MACOSX"
+.ENDIF # "$(SHL6VERSIONMAP)"!=""
+.ENDIF # "$(USE_SHL6VERSIONMAP)"!=""
+.ENDIF # "$(GUI)" != "UNX"
+
+.IF "$(UNIXVERSIONNAMES)"!=""
+.IF "$(OS)"!="MACOSX"
+.IF "$(GUI)"=="UNX"
+SHL6SONAME=\"$(SONAME_SWITCH)$(SHL6TARGETN:f)\"
+.ENDIF # "$(GUI)"!="UNX"
+.ENDIF # "$(OS)"!="MACOSX"
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+
+.IF "$(SHL6RES)"!=""
+SHL6ALLRES+=$(SHL6RES)
+SHL6LINKRES*=$(MISC)/$(SHL6TARGET).res
+SHL6LINKRESO*=$(MISC)/$(SHL6TARGET)_res.o
+.ENDIF # "$(SHL6RES)"!=""
+
+.IF "$(SHL6DEFAULTRES)$(use_shl_versions)"!=""
+SHL6DEFAULTRES*=$(MISC)/$(SHL6TARGET)_def.res
+SHL6ALLRES+=$(SHL6DEFAULTRES)
+SHL6LINKRES*=$(MISC)/$(SHL6TARGET).res
+SHL6LINKRESO*=$(MISC)/$(SHL6TARGET)_res.o
+.ENDIF # "$(SHL6DEFAULTRES)$(use_shl_versions)"!=""
+
+#.IF "$(SHL6TARGETN)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL6LIBS)"!=""
+$(MISC)/$(SHL6TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL6LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL6LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(SHL6TARGETN:b)_linkinc.ls
+$(SHL6TARGETN) : $(LINKINCTARGETS)
+
+.ELSE
+.IF "$(SHL6USE_EXPORTS)"=="name"
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(COM)"!="GCC"
+.IF "$(SHL6LIBS)"!=""
+SHL6LINKLIST=$(MISC)/$(SHL6TARGET)_link.lst
+SHL6LINKLISTPARAM=@$(SHL6LINKLIST)
+$(SHL6LINKLIST) : $(SHL6LIBS)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL6LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL6LIBS)"!=""
+.ENDIF # "$(COM)"!="GCC"
+.ENDIF
+.ENDIF # "$(SHL6USE_EXPORTS)"=="name"
+
+$(MISC)/%linkinc.ls:
+ @echo . > $@
+.ENDIF # "$(linkinc)"!=""
+
+.IF "$(GUI)" == "OS2"
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL6TARGET8=$(shell @fix_shl $(SHL6TARGET))
+.ENDIF
+
+.IF "$(GUI)" == "OS2"
+_SHL6IMP_ORD = $(SHL6STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL6STDLIBS:^"$(LB)/")
+SHL6IMP_ORD = $(foreach,i,$(_SHL6IMP_ORD) $(shell @-ls $i))
+.ELSE
+SHL6IMP_ORD =
+.ENDIF
+
+
+$(SHL6TARGETN) : \
+ $(SHL6OBJS)\
+ $(SHL6LIBS)\
+ $(USE_6IMPLIB_DEPS)\
+ $(USE_SHL6DEF)\
+ $(USE_SHL6VERSIONMAP)\
+ $(SHL6RES)\
+ $(SHL6DEPN) \
+ $(SHL6IMP_ORD) \
+ $(SHL6LINKLIST)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(SHL6DEFAULTRES)"!=""
+ @@-$(RM) $(MISC)/$(SHL6DEFAULTRES:b).rc
+.IF "$(SHL6ICON)" != ""
+ @echo 1 ICON $(SHL6ICON) >> $(MISC)/$(SHL6DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL6ADD_VERINFO)"!=""
+ @echo $(EMQ)#include $(EMQ)"$(SHL6ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL6DEFAULTRES:b).rc
+.ELSE # "$(SHL6ADD_VERINFO)"!=""
+ @echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL6DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL6DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL6DEFAULTRES:b).rc
+.ENDIF # "$(SHL6ADD_VERINFO)"!=""
+ @echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(SHL6DEFAULTRES:b).rc
+ @echo $(EMQ)#define ORG_NAME $(SHL6TARGET)$(DLLPOST) >> $(MISC)/$(SHL6DEFAULTRES:b).rc
+ @echo $(EMQ)#define INTERNAL_NAME $(SHL6TARGET:b) >> $(MISC)/$(SHL6DEFAULTRES:b).rc
+ @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL6DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL6DEFAULTRES:b).rc
+.ENDIF # "$(SHL6DEFAULTRES)"!=""
+.IF "$(SHL6ALLRES)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(SHL6ALLRES) > $(SHL6LINKRES)
+.IF "$(COM)"=="GCC"
+ windres $(SHL6LINKRES) $(SHL6LINKRESO)
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(SHL6ALLRES)"!=""
+.IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def
+ @echo dlltool --dllname $(SHL6TARGET)$(DLLPOST) \
+ --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_6.cmd
+ @noop $(assign ALL6OBJLIST:=$(STDOBJ) $(SHL6OBJS) $(SHL6LINKRESO) $(shell $(TYPE) /dev/null $(SHL6LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+.IF "$(DEFLIB6NAME)"!="" # do not have to include objs
+ @noop $(assign DEF6OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB6NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+ @noop $(foreach,i,$(DEF6OBJLIST) $(assign ALL6OBJLIST:=$(ALL6OBJLIST:s?$i??)))
+.ENDIF # "$(DEFLIB6NAME)"!=""
+ @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_6.cmd
+.IF "$(SHL6DEF)"!=""
+ @echo --input-def $(SHL6DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_6.cmd
+.ELSE
+ @echo $(SHL6VERSIONOBJ) $(SHL6DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_6.cmd
+.ENDIF
+ @echo $(ALL6OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_6.cmd
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
+ $(STDOBJ) $(SHL6VERSIONOBJ) $(SHL6DESCRIPTIONOBJ) $(SHL6OBJS) $(SHL6LINKRESO) \
+ `$(TYPE) /dev/null $(SHL6LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ -Wl,--exclude-libs,ALL,--start-group $(SHL6STDLIBS) -Wl,--end-group \
+ $(SHL6STDSHL) $(STDSHL6) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
+ -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_6.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_6.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_6.cmd
+.ELSE
+.IF "$(linkinc)"==""
+.IF "$(SHL6USE_EXPORTS)"!="name"
+.IF "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL6LINKER) @$(mktmp \
+ $(SHL6LINKFLAGS) \
+ $(LINKFLAGSSHL) \
+ $(SHL6STACK) $(SHL6BASEX) \
+ -out:$@ \
+ -map:$(MISC)/$(@:b).map \
+ -def:$(SHL6DEF) \
+ $(USE_6IMPLIB) \
+ $(STDOBJ) \
+ $(SHL6VERSIONOBJ) $(SHL6OBJS) \
+ $(SHL6LIBS) \
+ $(SHL6STDLIBS) \
+ $(SHL6STDSHL) $(STDSHL6) \
+ $(SHL6LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE # "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL6LINKER) @$(mktmp $(SHL6LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL6BASEX) \
+ $(SHL6STACK) -out:$(SHL6TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(LB)/$(SHL6IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL6OBJS) $(SHL6VERSIONOBJ) \
+ $(SHL6LIBS) \
+ $(SHL6STDLIBS) \
+ $(SHL6STDSHL) $(STDSHL6) \
+ $(SHL6LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(USE_DEFFILE)"!=""
+.ELSE # "$(SHL6USE_EXPORTS)"!="name"
+ $(COMMAND_ECHO)$(SHL6LINKER) @$(mktmp $(SHL6LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL6BASEX) \
+ $(SHL6STACK) -out:$(SHL6TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(USE_6IMPLIB) \
+ $(STDOBJ) \
+ $(SHL6OBJS) $(SHL6VERSIONOBJ)) \
+ $(SHL6LINKLISTPARAM) \
+ @$(mktmp $(SHL6STDLIBS) \
+ $(SHL6STDSHL) $(STDSHL6) \
+ $(SHL6LINKRES) \
+ )
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(SHL6USE_EXPORTS)"!="name"
+.ELSE # "$(linkinc)"==""
+ $(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL6TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL6TARGET).lst
+ $(COMMAND_ECHO)$(TYPE) $(mktmp \
+ $(SHL6LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL6BASEX) \
+ $(SHL6STACK) $(MAPFILE) \
+ -out:$@ \
+ $(LB)/$(SHL6IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL6OBJS) \
+ $(SHL6STDLIBS) \
+ $(SHL6STDSHL) $(STDSHL6) \
+ $(SHL6LINKRES) \
+ ) >> $(MISC)/$(SHL6TARGET).lnk
+ $(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL6TARGETN:b)_linkinc.ls >> $(MISC)/$(SHL6TARGET).lnk
+ $(COMMAND_ECHO)$(SHL6LINKER) @$(MISC)/$(SHL6TARGET).lnk
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(linkinc)"==""
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)" == "WNT"
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_6.cmd
+ @echo $(STDSLO) $(SHL6OBJS:s/.obj/.o/) \
+ $(SHL6VERSIONOBJ) \
+ `cat /dev/null $(SHL6LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(SHL6LINKER) $(SHL6LINKFLAGS) $(SHL6VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
+ $(SHL6STDLIBS) $(SHL6ARCHIVES) $(SHL6STDSHL) $(STDSHL6) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_6.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_6.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_6.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_6.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_6.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ shl $(SHL6RPATH) $@
+.IF "$(SHL6CREATEJNILIB)"!=""
+ @echo "Making: " $(@:f).jnilib
+ @macosx-create-bundle $@
+.ENDIF # "$(SHL6CREATEJNILIB)"!=""
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL6NOCHECK)"==""
+ $(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS6) $(SHL6TARGETN)
+.ENDIF # "$(SHL6NOCHECK)"!=""
+.ENDIF
+.ELSE # "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_6.cmd
+ @echo $(SHL6LINKER) $(SHL6LINKFLAGS) $(SHL6SONAME) $(LINKFLAGSSHL) $(SHL6VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL6OBJS:s/.obj/.o/) \
+ $(SHL6VERSIONOBJ) -o $@ \
+ `cat /dev/null $(SHL6LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ $(SHL6STDLIBS) $(SHL6ARCHIVES) $(SHL6STDSHL) $(STDSHL6) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_6.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_6.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_6.cmd
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL6NOCHECK)"==""
+ $(COMMAND_ECHO)-$(RM) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f)
+ $(COMMAND_ECHO)$(RENAME) $(SHL6TARGETN) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f)
+.IF "$(VERBOSE)"=="TRUE"
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS6) $(SHL6TARGETN:d)check_$(SHL6TARGETN:f)
+.ELSE
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS6) -- -s $(SHL6TARGETN:d)check_$(SHL6TARGETN:f)
+.ENDIF
+.ENDIF # "$(SHL6NOCHECK)"!=""
+.ENDIF # "$(UPDATER)"=="YES"
+.ENDIF # "$(OS)"=="MACOSX"
+.IF "$(UNIXVERSIONNAMES)"!=""
+ $(COMMAND_ECHO)$(RM) $(LB)/$(SHL6TARGETN:b)
+ $(COMMAND_ECHO)cd $(LB) && ln -s $(SHL6TARGETN:f) $(SHL6TARGETN:b)
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+.IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+.ENDIF
+.ENDIF # "$(GUI)" == "UNX"
+
+.IF "$(GUI)" == "OS2"
+
+.IF "$(SHL6DEFAULTRES)"!=""
+ @+-$(RM) $(MISC)/$(SHL6DEFAULTRES:b).rc >& $(NULLDEV)
+.IF "$(SHL6ICON)" != ""
+ @-+echo 1 ICON $(SHL6ICON) >> $(MISC)/$(SHL6DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL6ADD_VERINFO)"!=""
+ @-+echo $(EMQ)#include $(EMQ)"$(SHL6ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL6DEFAULTRES:b).rc
+.ENDIF # "$(SHL6ADD_VERINFO)"!=""
+ @-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL6DEFAULTRES:b).rc
+# @-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL6DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL6DEFAULTRES:b).rc
+.ENDIF # "$(SHL6DEFAULTRES)"!=""
+
+.IF "$(SHL6ALLRES)"!=""
+ $(COMMAND_ECHO)+$(TYPE) $(SHL6ALLRES) > $(SHL6LINKRES)
+.ENDIF # "$(SHL6ALLRES)"!=""
+
+.IF "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL6LINKER) $(SHL6LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
+ $(SHL6DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL6OBJS) $(SHL6VERSIONOBJ) \
+ $(SHL6LIBS) \
+ $(SHL6STDLIBS:^"-l") \
+ $(SHL6LINKRES) \
+ $(SHL6STDSHL:^"-l") $(STDSHL6:^"-l")
+
+.ELSE # "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL6LINKER) -v $(SHL6LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL6BASEX) \
+ $(SHL6STACK) -o $(SHL6TARGETN) \
+ $(SHL6DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL6OBJS) $(SHL6VERSIONOBJ) \
+ $(SHL6LIBS) \
+ $(SHL6STDLIBS:^"-l") \
+ $(SHL6LINKRES) \
+ $(SHL6STDSHL:^"-l") $(STDSHL6:^"-l") \
+ $(LINKOUTPUTFILTER)
+ @$(LS) $@ >& $(NULLDEV)
+
+.ENDIF # "$(USE_DEFFILE)"!=""
+
+.IF "$(SHL6TARGET8)" != "$(SHL6TARGET)"
+ $(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL6TARGET8).dll
+.ENDIF
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(SHL6TARGETN)"!=""
+
+# unroll begin
+
+.IF "$(SHL7TARGETN)"!=""
+
+.IF "$(OS)"=="AIX"
+SHL7STDLIBS=
+.ENDIF
+
+.IF "$(SHLLINKARCONLY)" != ""
+SHL7STDLIBS=
+STDSHL=
+.ELSE
+SHL7ARCHIVES=
+.ENDIF
+
+# decide how to link
+.IF "$(SHL7CODETYPE)"=="C"
+SHL7LINKER=$(LINKC)
+SHL7STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
+SHL7LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(SHL7CODETYPE)"=="C"
+SHL7LINKER=$(LINK)
+SHL7STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
+SHL7LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(SHL7CODETYPE)"=="C"
+
+SHL7RPATH*=OOO
+LINKFLAGSRUNPATH_$(SHL7RPATH)*=/ERROR:/Bad_SHL7RPATH_value
+SHL7LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL7RPATH))
+
+.IF "$(SHL7USE_EXPORTS)"==""
+SHL7DEF*=$(MISC)/$(SHL7TARGET).def
+.ENDIF # "$(SHL7USE_EXPORTS)"==""
+
+EXTRALIBPATHS7=$(EXTRALIBPATHS)
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL7NOCHECK)"==""
+.IF "$(SOLAR_STLLIBPATH)"!=""
+EXTRALIBPATHS7+=-L$(SOLAR_STLLIBPATH)
+.ENDIF
+.ENDIF # "$(SHL7NOCHECK)"!=""
+.ENDIF
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#+++++++++++ version object ++++++++++++++++++++++++++++++++++++++++
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.IF "$(L10N_framework)"==""
+.IF "$(VERSIONOBJ)"!=""
+SHL7VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL7TARGET))}$(VERSIONOBJ:f)
+USE_VERSIONH:=$(INCCOM)/$(SHL7VERSIONOBJ:b).h
+.IF "$(GUI)" == "UNX"
+SHL7VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL7TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
+.ELSE # "$(GUI)" == "UNX"
+SHL7VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL7TARGET))}$(VERSIONOBJ:f)
+.ENDIF # "$(GUI)" == "UNX"
+$(MISC)/$(SHL7VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL7VERSIONOBJ:b).h
+# $(COPY) $(SOLARENV)/src/version.c $@
+ $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL7VERSIONOBJ:b).h/ > $@
+
+.INIT : $(SHL7VERSIONOBJDEP)
+.ENDIF # "$(VERSIONOBJ)"!=""
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL7IMPLIB)" == ""
+SHL7IMPLIB=i$(TARGET)_t7
+.ENDIF # "$(SHL7IMPLIB)" == ""
+.IF "$(COM)" != "GCC"
+USE_7IMPLIB=-implib:$(LB)/$(SHL7IMPLIB).lib
+.ENDIF # "$(COM)" != "GCC"
+SHL7IMPLIBN=$(LB)/$(SHL7IMPLIB).lib
+ALLTAR : $(SHL7IMPLIBN)
+
+.IF "$(USE_DEFFILE)"==""
+USE_7IMPLIB_DEPS=$(LB)/$(SHL7IMPLIB).lib
+.ENDIF # "$(USE_DEFFILE)"==""
+.ENDIF # "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+USE_SHL7DEF=$(SHL7DEF)
+.ELSE # "$(GUI)" != "UNX"
+USE_SHL7DEF=
+SHL7DEPN+:=$(SHL7DEPNU)
+
+.IF "$(SHL7VERSIONMAP)"==""
+# to activate vmaps remove "#"
+USE_SHL7VERSIONMAP=$(MISC)/$(SHL7TARGET).vmap
+.ENDIF # "$(SHL7VERSIONMAP)"==""
+
+.IF "$(USE_SHL7VERSIONMAP)"!=""
+
+.IF "$(SHL7FILTERFILE)"!=""
+.IF "$(SHL7VERSIONMAP)"!=""
+#eine von beiden ist zuviel
+USE_SHL7VERSIONMAP=$(MISC)/$(SHL7TARGET).vmap
+$(USE_SHL7VERSIONMAP) .PHONY:
+ @echo -----------------------------
+ @echo you should only use versionmap OR exportfile
+ @echo -----------------------------
+# force_dmake_to_error
+
+.ENDIF # "$(SHL7VERSIONMAP)"!=""
+
+SHL7VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL7VERSIONMAP)
+
+$(USE_SHL7VERSIONMAP): \
+ $(SHL7OBJS)\
+ $(SHL7LIBS)\
+ $(SHL7FILTERFILE)
+ @$(RM) $@.dump
+.IF "$(SHL7OBJS)"!=""
+# dump remaining objects on the fly
+.IF "$(OS)"=="MACOSX"
+ @-nm $(SHL7OBJS:s/.obj/.o/) > $@.dump
+.ELSE
+ @nm $(SHL7OBJS:s/.obj/.o/) > $@.dump
+.ENDIF
+.ENDIF # "$(SHL7OBJS)!"=""
+ @$(TYPE) /dev/null $(SHL7LIBS:s/.lib/.dump/) >> $@.dump
+ $(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL7INTERFACE) -f $(SHL7FILTERFILE) -m $@
+
+.ELSE # "$(SHL7FILTERFILE)"!=""
+USE_SHL7VERSIONMAP=$(MISC)/$(SHL7TARGET).vmap
+$(USE_SHL7VERSIONMAP) :
+.IF "$(VERBOSE)" == "TRUE"
+ @echo -----------------------------
+ @echo SHL7FILTERFILE not set!
+ @echo -----------------------------
+ @$(TOUCH) $@
+ @echo dummy file to keep the dependencies for later use.
+.ELSE
+ @$(TOUCH) $@
+.ENDIF
+# force_dmake_to_error
+.ENDIF # "$(SHL7FILTERFILE)"!=""
+.ELSE # "$(USE_SHL7VERSIONMAP)"!=""
+
+#and now for the plain non-generic way...
+.IF "$(SHL7VERSIONMAP)"!=""
+USE_SHL7VERSIONMAP=$(MISC)/$(SHL7VERSIONMAP:b)_$(SHL7TARGET)$(SHL7VERSIONMAP:e)
+SHL7VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL7VERSIONMAP)
+
+.IF "$(OS)"=="MACOSX"
+$(USE_SHL7VERSIONMAP): $(SHL7OBJS) $(SHL7LIBS)
+.ENDIF
+
+# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
+# even if the $(AWK) part fails:
+$(USE_SHL7VERSIONMAP) .ERRREMOVE: $(SHL7VERSIONMAP)
+ @@-$(RM) -f $@
+# The following files will only be generated and needed on Mac OS X as temporary files
+# in order to generate exported symbols list out of Linux/Solaris map files
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) -f $@.symregexp >& $(NULLDEV)
+ @-$(RM) -f $@.expsymlist >& $(NULLDEV)
+.ENDIF
+# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
+# happens if somebody will change it in the future
+.IF "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL7VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
+.ELIF "$(COMNAME)"=="sunpro5"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL7VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
+.ELSE # "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL7VERSIONMAP) > $@
+.ENDIF # "$(COMID)"=="gcc3"
+ @chmod a+w $@
+# Mac OS X post-processing generate an exported symbols list from the generated map file
+# for details on exported symbols list see man ld on Mac OS X
+.IF "$(OS)"=="MACOSX"
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+.IF "$(SHL7OBJS)"!=""
+ -echo $(foreach,i,$(SHL7OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+.IF "$(SHL7LIBS)"!=""
+ $(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL7LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ cp $@.exported-symbols $@
+.ENDIF # .IF "$(OS)"=="MACOSX"
+.ENDIF # "$(SHL7VERSIONMAP)"!=""
+.ENDIF # "$(USE_SHL7VERSIONMAP)"!=""
+.ENDIF # "$(GUI)" != "UNX"
+
+.IF "$(UNIXVERSIONNAMES)"!=""
+.IF "$(OS)"!="MACOSX"
+.IF "$(GUI)"=="UNX"
+SHL7SONAME=\"$(SONAME_SWITCH)$(SHL7TARGETN:f)\"
+.ENDIF # "$(GUI)"!="UNX"
+.ENDIF # "$(OS)"!="MACOSX"
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+
+.IF "$(SHL7RES)"!=""
+SHL7ALLRES+=$(SHL7RES)
+SHL7LINKRES*=$(MISC)/$(SHL7TARGET).res
+SHL7LINKRESO*=$(MISC)/$(SHL7TARGET)_res.o
+.ENDIF # "$(SHL7RES)"!=""
+
+.IF "$(SHL7DEFAULTRES)$(use_shl_versions)"!=""
+SHL7DEFAULTRES*=$(MISC)/$(SHL7TARGET)_def.res
+SHL7ALLRES+=$(SHL7DEFAULTRES)
+SHL7LINKRES*=$(MISC)/$(SHL7TARGET).res
+SHL7LINKRESO*=$(MISC)/$(SHL7TARGET)_res.o
+.ENDIF # "$(SHL7DEFAULTRES)$(use_shl_versions)"!=""
+
+#.IF "$(SHL7TARGETN)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL7LIBS)"!=""
+$(MISC)/$(SHL7TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL7LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL7LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(SHL7TARGETN:b)_linkinc.ls
+$(SHL7TARGETN) : $(LINKINCTARGETS)
+
+.ELSE
+.IF "$(SHL7USE_EXPORTS)"=="name"
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(COM)"!="GCC"
+.IF "$(SHL7LIBS)"!=""
+SHL7LINKLIST=$(MISC)/$(SHL7TARGET)_link.lst
+SHL7LINKLISTPARAM=@$(SHL7LINKLIST)
+$(SHL7LINKLIST) : $(SHL7LIBS)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL7LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL7LIBS)"!=""
+.ENDIF # "$(COM)"!="GCC"
+.ENDIF
+.ENDIF # "$(SHL7USE_EXPORTS)"=="name"
+
+$(MISC)/%linkinc.ls:
+ @echo . > $@
+.ENDIF # "$(linkinc)"!=""
+
+.IF "$(GUI)" == "OS2"
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL7TARGET8=$(shell @fix_shl $(SHL7TARGET))
+.ENDIF
+
+.IF "$(GUI)" == "OS2"
+_SHL7IMP_ORD = $(SHL7STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL7STDLIBS:^"$(LB)/")
+SHL7IMP_ORD = $(foreach,i,$(_SHL7IMP_ORD) $(shell @-ls $i))
+.ELSE
+SHL7IMP_ORD =
+.ENDIF
+
+
+$(SHL7TARGETN) : \
+ $(SHL7OBJS)\
+ $(SHL7LIBS)\
+ $(USE_7IMPLIB_DEPS)\
+ $(USE_SHL7DEF)\
+ $(USE_SHL7VERSIONMAP)\
+ $(SHL7RES)\
+ $(SHL7DEPN) \
+ $(SHL7IMP_ORD) \
+ $(SHL7LINKLIST)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(SHL7DEFAULTRES)"!=""
+ @@-$(RM) $(MISC)/$(SHL7DEFAULTRES:b).rc
+.IF "$(SHL7ICON)" != ""
+ @echo 1 ICON $(SHL7ICON) >> $(MISC)/$(SHL7DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL7ADD_VERINFO)"!=""
+ @echo $(EMQ)#include $(EMQ)"$(SHL7ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL7DEFAULTRES:b).rc
+.ELSE # "$(SHL7ADD_VERINFO)"!=""
+ @echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL7DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL7DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL7DEFAULTRES:b).rc
+.ENDIF # "$(SHL7ADD_VERINFO)"!=""
+ @echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(SHL7DEFAULTRES:b).rc
+ @echo $(EMQ)#define ORG_NAME $(SHL7TARGET)$(DLLPOST) >> $(MISC)/$(SHL7DEFAULTRES:b).rc
+ @echo $(EMQ)#define INTERNAL_NAME $(SHL7TARGET:b) >> $(MISC)/$(SHL7DEFAULTRES:b).rc
+ @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL7DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL7DEFAULTRES:b).rc
+.ENDIF # "$(SHL7DEFAULTRES)"!=""
+.IF "$(SHL7ALLRES)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(SHL7ALLRES) > $(SHL7LINKRES)
+.IF "$(COM)"=="GCC"
+ windres $(SHL7LINKRES) $(SHL7LINKRESO)
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(SHL7ALLRES)"!=""
+.IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def
+ @echo dlltool --dllname $(SHL7TARGET)$(DLLPOST) \
+ --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_7.cmd
+ @noop $(assign ALL7OBJLIST:=$(STDOBJ) $(SHL7OBJS) $(SHL7LINKRESO) $(shell $(TYPE) /dev/null $(SHL7LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+.IF "$(DEFLIB7NAME)"!="" # do not have to include objs
+ @noop $(assign DEF7OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB7NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+ @noop $(foreach,i,$(DEF7OBJLIST) $(assign ALL7OBJLIST:=$(ALL7OBJLIST:s?$i??)))
+.ENDIF # "$(DEFLIB7NAME)"!=""
+ @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_7.cmd
+.IF "$(SHL7DEF)"!=""
+ @echo --input-def $(SHL7DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_7.cmd
+.ELSE
+ @echo $(SHL7VERSIONOBJ) $(SHL7DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_7.cmd
+.ENDIF
+ @echo $(ALL7OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_7.cmd
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
+ $(STDOBJ) $(SHL7VERSIONOBJ) $(SHL7DESCRIPTIONOBJ) $(SHL7OBJS) $(SHL7LINKRESO) \
+ `$(TYPE) /dev/null $(SHL7LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ -Wl,--exclude-libs,ALL,--start-group $(SHL7STDLIBS) -Wl,--end-group \
+ $(SHL7STDSHL) $(STDSHL7) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
+ -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_7.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_7.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_7.cmd
+.ELSE
+.IF "$(linkinc)"==""
+.IF "$(SHL7USE_EXPORTS)"!="name"
+.IF "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL7LINKER) @$(mktmp \
+ $(SHL7LINKFLAGS) \
+ $(LINKFLAGSSHL) \
+ $(SHL7STACK) $(SHL7BASEX) \
+ -out:$@ \
+ -map:$(MISC)/$(@:b).map \
+ -def:$(SHL7DEF) \
+ $(USE_7IMPLIB) \
+ $(STDOBJ) \
+ $(SHL7VERSIONOBJ) $(SHL7OBJS) \
+ $(SHL7LIBS) \
+ $(SHL7STDLIBS) \
+ $(SHL7STDSHL) $(STDSHL7) \
+ $(SHL7LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE # "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL7LINKER) @$(mktmp $(SHL7LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL7BASEX) \
+ $(SHL7STACK) -out:$(SHL7TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(LB)/$(SHL7IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL7OBJS) $(SHL7VERSIONOBJ) \
+ $(SHL7LIBS) \
+ $(SHL7STDLIBS) \
+ $(SHL7STDSHL) $(STDSHL7) \
+ $(SHL7LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(USE_DEFFILE)"!=""
+.ELSE # "$(SHL7USE_EXPORTS)"!="name"
+ $(COMMAND_ECHO)$(SHL7LINKER) @$(mktmp $(SHL7LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL7BASEX) \
+ $(SHL7STACK) -out:$(SHL7TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(USE_7IMPLIB) \
+ $(STDOBJ) \
+ $(SHL7OBJS) $(SHL7VERSIONOBJ)) \
+ $(SHL7LINKLISTPARAM) \
+ @$(mktmp $(SHL7STDLIBS) \
+ $(SHL7STDSHL) $(STDSHL7) \
+ $(SHL7LINKRES) \
+ )
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(SHL7USE_EXPORTS)"!="name"
+.ELSE # "$(linkinc)"==""
+ $(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL7TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL7TARGET).lst
+ $(COMMAND_ECHO)$(TYPE) $(mktmp \
+ $(SHL7LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL7BASEX) \
+ $(SHL7STACK) $(MAPFILE) \
+ -out:$@ \
+ $(LB)/$(SHL7IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL7OBJS) \
+ $(SHL7STDLIBS) \
+ $(SHL7STDSHL) $(STDSHL7) \
+ $(SHL7LINKRES) \
+ ) >> $(MISC)/$(SHL7TARGET).lnk
+ $(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL7TARGETN:b)_linkinc.ls >> $(MISC)/$(SHL7TARGET).lnk
+ $(COMMAND_ECHO)$(SHL7LINKER) @$(MISC)/$(SHL7TARGET).lnk
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(linkinc)"==""
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)" == "WNT"
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_7.cmd
+ @echo $(STDSLO) $(SHL7OBJS:s/.obj/.o/) \
+ $(SHL7VERSIONOBJ) \
+ `cat /dev/null $(SHL7LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(SHL7LINKER) $(SHL7LINKFLAGS) $(SHL7VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
+ $(SHL7STDLIBS) $(SHL7ARCHIVES) $(SHL7STDSHL) $(STDSHL7) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_7.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_7.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_7.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_7.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_7.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ shl $(SHL7RPATH) $@
+.IF "$(SHL7CREATEJNILIB)"!=""
+ @echo "Making: " $(@:f).jnilib
+ @macosx-create-bundle $@
+.ENDIF # "$(SHL7CREATEJNILIB)"!=""
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL7NOCHECK)"==""
+ $(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS7) $(SHL7TARGETN)
+.ENDIF # "$(SHL7NOCHECK)"!=""
+.ENDIF
+.ELSE # "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_7.cmd
+ @echo $(SHL7LINKER) $(SHL7LINKFLAGS) $(SHL7SONAME) $(LINKFLAGSSHL) $(SHL7VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL7OBJS:s/.obj/.o/) \
+ $(SHL7VERSIONOBJ) -o $@ \
+ `cat /dev/null $(SHL7LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ $(SHL7STDLIBS) $(SHL7ARCHIVES) $(SHL7STDSHL) $(STDSHL7) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_7.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_7.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_7.cmd
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL7NOCHECK)"==""
+ $(COMMAND_ECHO)-$(RM) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f)
+ $(COMMAND_ECHO)$(RENAME) $(SHL7TARGETN) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f)
+.IF "$(VERBOSE)"=="TRUE"
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS7) $(SHL7TARGETN:d)check_$(SHL7TARGETN:f)
+.ELSE
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS7) -- -s $(SHL7TARGETN:d)check_$(SHL7TARGETN:f)
+.ENDIF
+.ENDIF # "$(SHL7NOCHECK)"!=""
+.ENDIF # "$(UPDATER)"=="YES"
+.ENDIF # "$(OS)"=="MACOSX"
+.IF "$(UNIXVERSIONNAMES)"!=""
+ $(COMMAND_ECHO)$(RM) $(LB)/$(SHL7TARGETN:b)
+ $(COMMAND_ECHO)cd $(LB) && ln -s $(SHL7TARGETN:f) $(SHL7TARGETN:b)
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+.IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+.ENDIF
+.ENDIF # "$(GUI)" == "UNX"
+
+.IF "$(GUI)" == "OS2"
+
+.IF "$(SHL7DEFAULTRES)"!=""
+ @+-$(RM) $(MISC)/$(SHL7DEFAULTRES:b).rc >& $(NULLDEV)
+.IF "$(SHL7ICON)" != ""
+ @-+echo 1 ICON $(SHL7ICON) >> $(MISC)/$(SHL7DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL7ADD_VERINFO)"!=""
+ @-+echo $(EMQ)#include $(EMQ)"$(SHL7ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL7DEFAULTRES:b).rc
+.ENDIF # "$(SHL7ADD_VERINFO)"!=""
+ @-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL7DEFAULTRES:b).rc
+# @-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL7DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL7DEFAULTRES:b).rc
+.ENDIF # "$(SHL7DEFAULTRES)"!=""
+
+.IF "$(SHL7ALLRES)"!=""
+ $(COMMAND_ECHO)+$(TYPE) $(SHL7ALLRES) > $(SHL7LINKRES)
+.ENDIF # "$(SHL7ALLRES)"!=""
+
+.IF "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL7LINKER) $(SHL7LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
+ $(SHL7DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL7OBJS) $(SHL7VERSIONOBJ) \
+ $(SHL7LIBS) \
+ $(SHL7STDLIBS:^"-l") \
+ $(SHL7LINKRES) \
+ $(SHL7STDSHL:^"-l") $(STDSHL7:^"-l")
+
+.ELSE # "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL7LINKER) -v $(SHL7LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL7BASEX) \
+ $(SHL7STACK) -o $(SHL7TARGETN) \
+ $(SHL7DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL7OBJS) $(SHL7VERSIONOBJ) \
+ $(SHL7LIBS) \
+ $(SHL7STDLIBS:^"-l") \
+ $(SHL7LINKRES) \
+ $(SHL7STDSHL:^"-l") $(STDSHL7:^"-l") \
+ $(LINKOUTPUTFILTER)
+ @$(LS) $@ >& $(NULLDEV)
+
+.ENDIF # "$(USE_DEFFILE)"!=""
+
+.IF "$(SHL7TARGET8)" != "$(SHL7TARGET)"
+ $(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL7TARGET8).dll
+.ENDIF
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(SHL7TARGETN)"!=""
+
+# unroll begin
+
+.IF "$(SHL8TARGETN)"!=""
+
+.IF "$(OS)"=="AIX"
+SHL8STDLIBS=
+.ENDIF
+
+.IF "$(SHLLINKARCONLY)" != ""
+SHL8STDLIBS=
+STDSHL=
+.ELSE
+SHL8ARCHIVES=
+.ENDIF
+
+# decide how to link
+.IF "$(SHL8CODETYPE)"=="C"
+SHL8LINKER=$(LINKC)
+SHL8STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
+SHL8LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(SHL8CODETYPE)"=="C"
+SHL8LINKER=$(LINK)
+SHL8STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
+SHL8LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(SHL8CODETYPE)"=="C"
+
+SHL8RPATH*=OOO
+LINKFLAGSRUNPATH_$(SHL8RPATH)*=/ERROR:/Bad_SHL8RPATH_value
+SHL8LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL8RPATH))
+
+.IF "$(SHL8USE_EXPORTS)"==""
+SHL8DEF*=$(MISC)/$(SHL8TARGET).def
+.ENDIF # "$(SHL8USE_EXPORTS)"==""
+
+EXTRALIBPATHS8=$(EXTRALIBPATHS)
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL8NOCHECK)"==""
+.IF "$(SOLAR_STLLIBPATH)"!=""
+EXTRALIBPATHS8+=-L$(SOLAR_STLLIBPATH)
+.ENDIF
+.ENDIF # "$(SHL8NOCHECK)"!=""
+.ENDIF
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#+++++++++++ version object ++++++++++++++++++++++++++++++++++++++++
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.IF "$(L10N_framework)"==""
+.IF "$(VERSIONOBJ)"!=""
+SHL8VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL8TARGET))}$(VERSIONOBJ:f)
+USE_VERSIONH:=$(INCCOM)/$(SHL8VERSIONOBJ:b).h
+.IF "$(GUI)" == "UNX"
+SHL8VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL8TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
+.ELSE # "$(GUI)" == "UNX"
+SHL8VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL8TARGET))}$(VERSIONOBJ:f)
+.ENDIF # "$(GUI)" == "UNX"
+$(MISC)/$(SHL8VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL8VERSIONOBJ:b).h
+# $(COPY) $(SOLARENV)/src/version.c $@
+ $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL8VERSIONOBJ:b).h/ > $@
+
+.INIT : $(SHL8VERSIONOBJDEP)
+.ENDIF # "$(VERSIONOBJ)"!=""
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL8IMPLIB)" == ""
+SHL8IMPLIB=i$(TARGET)_t8
+.ENDIF # "$(SHL8IMPLIB)" == ""
+.IF "$(COM)" != "GCC"
+USE_8IMPLIB=-implib:$(LB)/$(SHL8IMPLIB).lib
+.ENDIF # "$(COM)" != "GCC"
+SHL8IMPLIBN=$(LB)/$(SHL8IMPLIB).lib
+ALLTAR : $(SHL8IMPLIBN)
+
+.IF "$(USE_DEFFILE)"==""
+USE_8IMPLIB_DEPS=$(LB)/$(SHL8IMPLIB).lib
+.ENDIF # "$(USE_DEFFILE)"==""
+.ENDIF # "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+USE_SHL8DEF=$(SHL8DEF)
+.ELSE # "$(GUI)" != "UNX"
+USE_SHL8DEF=
+SHL8DEPN+:=$(SHL8DEPNU)
+
+.IF "$(SHL8VERSIONMAP)"==""
+# to activate vmaps remove "#"
+USE_SHL8VERSIONMAP=$(MISC)/$(SHL8TARGET).vmap
+.ENDIF # "$(SHL8VERSIONMAP)"==""
+
+.IF "$(USE_SHL8VERSIONMAP)"!=""
+
+.IF "$(SHL8FILTERFILE)"!=""
+.IF "$(SHL8VERSIONMAP)"!=""
+#eine von beiden ist zuviel
+USE_SHL8VERSIONMAP=$(MISC)/$(SHL8TARGET).vmap
+$(USE_SHL8VERSIONMAP) .PHONY:
+ @echo -----------------------------
+ @echo you should only use versionmap OR exportfile
+ @echo -----------------------------
+# force_dmake_to_error
+
+.ENDIF # "$(SHL8VERSIONMAP)"!=""
+
+SHL8VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL8VERSIONMAP)
+
+$(USE_SHL8VERSIONMAP): \
+ $(SHL8OBJS)\
+ $(SHL8LIBS)\
+ $(SHL8FILTERFILE)
+ @$(RM) $@.dump
+.IF "$(SHL8OBJS)"!=""
+# dump remaining objects on the fly
+.IF "$(OS)"=="MACOSX"
+ @-nm $(SHL8OBJS:s/.obj/.o/) > $@.dump
+.ELSE
+ @nm $(SHL8OBJS:s/.obj/.o/) > $@.dump
+.ENDIF
+.ENDIF # "$(SHL8OBJS)!"=""
+ @$(TYPE) /dev/null $(SHL8LIBS:s/.lib/.dump/) >> $@.dump
+ $(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL8INTERFACE) -f $(SHL8FILTERFILE) -m $@
+
+.ELSE # "$(SHL8FILTERFILE)"!=""
+USE_SHL8VERSIONMAP=$(MISC)/$(SHL8TARGET).vmap
+$(USE_SHL8VERSIONMAP) :
+.IF "$(VERBOSE)" == "TRUE"
+ @echo -----------------------------
+ @echo SHL8FILTERFILE not set!
+ @echo -----------------------------
+ @$(TOUCH) $@
+ @echo dummy file to keep the dependencies for later use.
+.ELSE
+ @$(TOUCH) $@
+.ENDIF
+# force_dmake_to_error
+.ENDIF # "$(SHL8FILTERFILE)"!=""
+.ELSE # "$(USE_SHL8VERSIONMAP)"!=""
+
+#and now for the plain non-generic way...
+.IF "$(SHL8VERSIONMAP)"!=""
+USE_SHL8VERSIONMAP=$(MISC)/$(SHL8VERSIONMAP:b)_$(SHL8TARGET)$(SHL8VERSIONMAP:e)
+SHL8VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL8VERSIONMAP)
+
+.IF "$(OS)"=="MACOSX"
+$(USE_SHL8VERSIONMAP): $(SHL8OBJS) $(SHL8LIBS)
+.ENDIF
+
+# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
+# even if the $(AWK) part fails:
+$(USE_SHL8VERSIONMAP) .ERRREMOVE: $(SHL8VERSIONMAP)
+ @@-$(RM) -f $@
+# The following files will only be generated and needed on Mac OS X as temporary files
+# in order to generate exported symbols list out of Linux/Solaris map files
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) -f $@.symregexp >& $(NULLDEV)
+ @-$(RM) -f $@.expsymlist >& $(NULLDEV)
+.ENDIF
+# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
+# happens if somebody will change it in the future
+.IF "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL8VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
+.ELIF "$(COMNAME)"=="sunpro5"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL8VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
+.ELSE # "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL8VERSIONMAP) > $@
+.ENDIF # "$(COMID)"=="gcc3"
+ @chmod a+w $@
+# Mac OS X post-processing generate an exported symbols list from the generated map file
+# for details on exported symbols list see man ld on Mac OS X
+.IF "$(OS)"=="MACOSX"
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+.IF "$(SHL8OBJS)"!=""
+ -echo $(foreach,i,$(SHL8OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+.IF "$(SHL8LIBS)"!=""
+ $(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL8LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ cp $@.exported-symbols $@
+.ENDIF # .IF "$(OS)"=="MACOSX"
+.ENDIF # "$(SHL8VERSIONMAP)"!=""
+.ENDIF # "$(USE_SHL8VERSIONMAP)"!=""
+.ENDIF # "$(GUI)" != "UNX"
+
+.IF "$(UNIXVERSIONNAMES)"!=""
+.IF "$(OS)"!="MACOSX"
+.IF "$(GUI)"=="UNX"
+SHL8SONAME=\"$(SONAME_SWITCH)$(SHL8TARGETN:f)\"
+.ENDIF # "$(GUI)"!="UNX"
+.ENDIF # "$(OS)"!="MACOSX"
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+
+.IF "$(SHL8RES)"!=""
+SHL8ALLRES+=$(SHL8RES)
+SHL8LINKRES*=$(MISC)/$(SHL8TARGET).res
+SHL8LINKRESO*=$(MISC)/$(SHL8TARGET)_res.o
+.ENDIF # "$(SHL8RES)"!=""
+
+.IF "$(SHL8DEFAULTRES)$(use_shl_versions)"!=""
+SHL8DEFAULTRES*=$(MISC)/$(SHL8TARGET)_def.res
+SHL8ALLRES+=$(SHL8DEFAULTRES)
+SHL8LINKRES*=$(MISC)/$(SHL8TARGET).res
+SHL8LINKRESO*=$(MISC)/$(SHL8TARGET)_res.o
+.ENDIF # "$(SHL8DEFAULTRES)$(use_shl_versions)"!=""
+
+#.IF "$(SHL8TARGETN)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL8LIBS)"!=""
+$(MISC)/$(SHL8TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL8LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL8LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(SHL8TARGETN:b)_linkinc.ls
+$(SHL8TARGETN) : $(LINKINCTARGETS)
+
+.ELSE
+.IF "$(SHL8USE_EXPORTS)"=="name"
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(COM)"!="GCC"
+.IF "$(SHL8LIBS)"!=""
+SHL8LINKLIST=$(MISC)/$(SHL8TARGET)_link.lst
+SHL8LINKLISTPARAM=@$(SHL8LINKLIST)
+$(SHL8LINKLIST) : $(SHL8LIBS)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL8LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL8LIBS)"!=""
+.ENDIF # "$(COM)"!="GCC"
+.ENDIF
+.ENDIF # "$(SHL8USE_EXPORTS)"=="name"
+
+$(MISC)/%linkinc.ls:
+ @echo . > $@
+.ENDIF # "$(linkinc)"!=""
+
+.IF "$(GUI)" == "OS2"
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL8TARGET8=$(shell @fix_shl $(SHL8TARGET))
+.ENDIF
+
+.IF "$(GUI)" == "OS2"
+_SHL8IMP_ORD = $(SHL8STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL8STDLIBS:^"$(LB)/")
+SHL8IMP_ORD = $(foreach,i,$(_SHL8IMP_ORD) $(shell @-ls $i))
+.ELSE
+SHL8IMP_ORD =
+.ENDIF
+
+
+$(SHL8TARGETN) : \
+ $(SHL8OBJS)\
+ $(SHL8LIBS)\
+ $(USE_8IMPLIB_DEPS)\
+ $(USE_SHL8DEF)\
+ $(USE_SHL8VERSIONMAP)\
+ $(SHL8RES)\
+ $(SHL8DEPN) \
+ $(SHL8IMP_ORD) \
+ $(SHL8LINKLIST)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(SHL8DEFAULTRES)"!=""
+ @@-$(RM) $(MISC)/$(SHL8DEFAULTRES:b).rc
+.IF "$(SHL8ICON)" != ""
+ @echo 1 ICON $(SHL8ICON) >> $(MISC)/$(SHL8DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL8ADD_VERINFO)"!=""
+ @echo $(EMQ)#include $(EMQ)"$(SHL8ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL8DEFAULTRES:b).rc
+.ELSE # "$(SHL8ADD_VERINFO)"!=""
+ @echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL8DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL8DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL8DEFAULTRES:b).rc
+.ENDIF # "$(SHL8ADD_VERINFO)"!=""
+ @echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(SHL8DEFAULTRES:b).rc
+ @echo $(EMQ)#define ORG_NAME $(SHL8TARGET)$(DLLPOST) >> $(MISC)/$(SHL8DEFAULTRES:b).rc
+ @echo $(EMQ)#define INTERNAL_NAME $(SHL8TARGET:b) >> $(MISC)/$(SHL8DEFAULTRES:b).rc
+ @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL8DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL8DEFAULTRES:b).rc
+.ENDIF # "$(SHL8DEFAULTRES)"!=""
+.IF "$(SHL8ALLRES)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(SHL8ALLRES) > $(SHL8LINKRES)
+.IF "$(COM)"=="GCC"
+ windres $(SHL8LINKRES) $(SHL8LINKRESO)
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(SHL8ALLRES)"!=""
+.IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def
+ @echo dlltool --dllname $(SHL8TARGET)$(DLLPOST) \
+ --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_8.cmd
+ @noop $(assign ALL8OBJLIST:=$(STDOBJ) $(SHL8OBJS) $(SHL8LINKRESO) $(shell $(TYPE) /dev/null $(SHL8LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+.IF "$(DEFLIB8NAME)"!="" # do not have to include objs
+ @noop $(assign DEF8OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB8NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+ @noop $(foreach,i,$(DEF8OBJLIST) $(assign ALL8OBJLIST:=$(ALL8OBJLIST:s?$i??)))
+.ENDIF # "$(DEFLIB8NAME)"!=""
+ @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_8.cmd
+.IF "$(SHL8DEF)"!=""
+ @echo --input-def $(SHL8DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_8.cmd
+.ELSE
+ @echo $(SHL8VERSIONOBJ) $(SHL8DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_8.cmd
+.ENDIF
+ @echo $(ALL8OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_8.cmd
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
+ $(STDOBJ) $(SHL8VERSIONOBJ) $(SHL8DESCRIPTIONOBJ) $(SHL8OBJS) $(SHL8LINKRESO) \
+ `$(TYPE) /dev/null $(SHL8LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ -Wl,--exclude-libs,ALL,--start-group $(SHL8STDLIBS) -Wl,--end-group \
+ $(SHL8STDSHL) $(STDSHL8) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
+ -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_8.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_8.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_8.cmd
+.ELSE
+.IF "$(linkinc)"==""
+.IF "$(SHL8USE_EXPORTS)"!="name"
+.IF "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL8LINKER) @$(mktmp \
+ $(SHL8LINKFLAGS) \
+ $(LINKFLAGSSHL) \
+ $(SHL8STACK) $(SHL8BASEX) \
+ -out:$@ \
+ -map:$(MISC)/$(@:b).map \
+ -def:$(SHL8DEF) \
+ $(USE_8IMPLIB) \
+ $(STDOBJ) \
+ $(SHL8VERSIONOBJ) $(SHL8OBJS) \
+ $(SHL8LIBS) \
+ $(SHL8STDLIBS) \
+ $(SHL8STDSHL) $(STDSHL8) \
+ $(SHL8LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE # "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL8LINKER) @$(mktmp $(SHL8LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL8BASEX) \
+ $(SHL8STACK) -out:$(SHL8TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(LB)/$(SHL8IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL8OBJS) $(SHL8VERSIONOBJ) \
+ $(SHL8LIBS) \
+ $(SHL8STDLIBS) \
+ $(SHL8STDSHL) $(STDSHL8) \
+ $(SHL8LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(USE_DEFFILE)"!=""
+.ELSE # "$(SHL8USE_EXPORTS)"!="name"
+ $(COMMAND_ECHO)$(SHL8LINKER) @$(mktmp $(SHL8LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL8BASEX) \
+ $(SHL8STACK) -out:$(SHL8TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(USE_8IMPLIB) \
+ $(STDOBJ) \
+ $(SHL8OBJS) $(SHL8VERSIONOBJ)) \
+ $(SHL8LINKLISTPARAM) \
+ @$(mktmp $(SHL8STDLIBS) \
+ $(SHL8STDSHL) $(STDSHL8) \
+ $(SHL8LINKRES) \
+ )
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(SHL8USE_EXPORTS)"!="name"
+.ELSE # "$(linkinc)"==""
+ $(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL8TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL8TARGET).lst
+ $(COMMAND_ECHO)$(TYPE) $(mktmp \
+ $(SHL8LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL8BASEX) \
+ $(SHL8STACK) $(MAPFILE) \
+ -out:$@ \
+ $(LB)/$(SHL8IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL8OBJS) \
+ $(SHL8STDLIBS) \
+ $(SHL8STDSHL) $(STDSHL8) \
+ $(SHL8LINKRES) \
+ ) >> $(MISC)/$(SHL8TARGET).lnk
+ $(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL8TARGETN:b)_linkinc.ls >> $(MISC)/$(SHL8TARGET).lnk
+ $(COMMAND_ECHO)$(SHL8LINKER) @$(MISC)/$(SHL8TARGET).lnk
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(linkinc)"==""
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)" == "WNT"
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_8.cmd
+ @echo $(STDSLO) $(SHL8OBJS:s/.obj/.o/) \
+ $(SHL8VERSIONOBJ) \
+ `cat /dev/null $(SHL8LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(SHL8LINKER) $(SHL8LINKFLAGS) $(SHL8VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
+ $(SHL8STDLIBS) $(SHL8ARCHIVES) $(SHL8STDSHL) $(STDSHL8) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_8.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_8.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_8.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_8.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_8.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ shl $(SHL8RPATH) $@
+.IF "$(SHL8CREATEJNILIB)"!=""
+ @echo "Making: " $(@:f).jnilib
+ @macosx-create-bundle $@
+.ENDIF # "$(SHL8CREATEJNILIB)"!=""
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL8NOCHECK)"==""
+ $(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS8) $(SHL8TARGETN)
+.ENDIF # "$(SHL8NOCHECK)"!=""
+.ENDIF
+.ELSE # "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_8.cmd
+ @echo $(SHL8LINKER) $(SHL8LINKFLAGS) $(SHL8SONAME) $(LINKFLAGSSHL) $(SHL8VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL8OBJS:s/.obj/.o/) \
+ $(SHL8VERSIONOBJ) -o $@ \
+ `cat /dev/null $(SHL8LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ $(SHL8STDLIBS) $(SHL8ARCHIVES) $(SHL8STDSHL) $(STDSHL8) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_8.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_8.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_8.cmd
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL8NOCHECK)"==""
+ $(COMMAND_ECHO)-$(RM) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f)
+ $(COMMAND_ECHO)$(RENAME) $(SHL8TARGETN) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f)
+.IF "$(VERBOSE)"=="TRUE"
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS8) $(SHL8TARGETN:d)check_$(SHL8TARGETN:f)
+.ELSE
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS8) -- -s $(SHL8TARGETN:d)check_$(SHL8TARGETN:f)
+.ENDIF
+.ENDIF # "$(SHL8NOCHECK)"!=""
+.ENDIF # "$(UPDATER)"=="YES"
+.ENDIF # "$(OS)"=="MACOSX"
+.IF "$(UNIXVERSIONNAMES)"!=""
+ $(COMMAND_ECHO)$(RM) $(LB)/$(SHL8TARGETN:b)
+ $(COMMAND_ECHO)cd $(LB) && ln -s $(SHL8TARGETN:f) $(SHL8TARGETN:b)
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+.IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+.ENDIF
+.ENDIF # "$(GUI)" == "UNX"
+
+.IF "$(GUI)" == "OS2"
+
+.IF "$(SHL8DEFAULTRES)"!=""
+ @+-$(RM) $(MISC)/$(SHL8DEFAULTRES:b).rc >& $(NULLDEV)
+.IF "$(SHL8ICON)" != ""
+ @-+echo 1 ICON $(SHL8ICON) >> $(MISC)/$(SHL8DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL8ADD_VERINFO)"!=""
+ @-+echo $(EMQ)#include $(EMQ)"$(SHL8ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL8DEFAULTRES:b).rc
+.ENDIF # "$(SHL8ADD_VERINFO)"!=""
+ @-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL8DEFAULTRES:b).rc
+# @-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL8DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL8DEFAULTRES:b).rc
+.ENDIF # "$(SHL8DEFAULTRES)"!=""
+
+.IF "$(SHL8ALLRES)"!=""
+ $(COMMAND_ECHO)+$(TYPE) $(SHL8ALLRES) > $(SHL8LINKRES)
+.ENDIF # "$(SHL8ALLRES)"!=""
+
+.IF "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL8LINKER) $(SHL8LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
+ $(SHL8DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL8OBJS) $(SHL8VERSIONOBJ) \
+ $(SHL8LIBS) \
+ $(SHL8STDLIBS:^"-l") \
+ $(SHL8LINKRES) \
+ $(SHL8STDSHL:^"-l") $(STDSHL8:^"-l")
+
+.ELSE # "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL8LINKER) -v $(SHL8LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL8BASEX) \
+ $(SHL8STACK) -o $(SHL8TARGETN) \
+ $(SHL8DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL8OBJS) $(SHL8VERSIONOBJ) \
+ $(SHL8LIBS) \
+ $(SHL8STDLIBS:^"-l") \
+ $(SHL8LINKRES) \
+ $(SHL8STDSHL:^"-l") $(STDSHL8:^"-l") \
+ $(LINKOUTPUTFILTER)
+ @$(LS) $@ >& $(NULLDEV)
+
+.ENDIF # "$(USE_DEFFILE)"!=""
+
+.IF "$(SHL8TARGET8)" != "$(SHL8TARGET)"
+ $(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL8TARGET8).dll
+.ENDIF
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(SHL8TARGETN)"!=""
+
+# unroll begin
+
+.IF "$(SHL9TARGETN)"!=""
+
+.IF "$(OS)"=="AIX"
+SHL9STDLIBS=
+.ENDIF
+
+.IF "$(SHLLINKARCONLY)" != ""
+SHL9STDLIBS=
+STDSHL=
+.ELSE
+SHL9ARCHIVES=
+.ENDIF
+
+# decide how to link
+.IF "$(SHL9CODETYPE)"=="C"
+SHL9LINKER=$(LINKC)
+SHL9STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
+SHL9LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(SHL9CODETYPE)"=="C"
+SHL9LINKER=$(LINK)
+SHL9STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
+SHL9LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(SHL9CODETYPE)"=="C"
+
+SHL9RPATH*=OOO
+LINKFLAGSRUNPATH_$(SHL9RPATH)*=/ERROR:/Bad_SHL9RPATH_value
+SHL9LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL9RPATH))
+
+.IF "$(SHL9USE_EXPORTS)"==""
+SHL9DEF*=$(MISC)/$(SHL9TARGET).def
+.ENDIF # "$(SHL9USE_EXPORTS)"==""
+
+EXTRALIBPATHS9=$(EXTRALIBPATHS)
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL9NOCHECK)"==""
+.IF "$(SOLAR_STLLIBPATH)"!=""
+EXTRALIBPATHS9+=-L$(SOLAR_STLLIBPATH)
+.ENDIF
+.ENDIF # "$(SHL9NOCHECK)"!=""
+.ENDIF
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#+++++++++++ version object ++++++++++++++++++++++++++++++++++++++++
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.IF "$(L10N_framework)"==""
+.IF "$(VERSIONOBJ)"!=""
+SHL9VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL9TARGET))}$(VERSIONOBJ:f)
+USE_VERSIONH:=$(INCCOM)/$(SHL9VERSIONOBJ:b).h
+.IF "$(GUI)" == "UNX"
+SHL9VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL9TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
+.ELSE # "$(GUI)" == "UNX"
+SHL9VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL9TARGET))}$(VERSIONOBJ:f)
+.ENDIF # "$(GUI)" == "UNX"
+$(MISC)/$(SHL9VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL9VERSIONOBJ:b).h
+# $(COPY) $(SOLARENV)/src/version.c $@
+ $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL9VERSIONOBJ:b).h/ > $@
+
+.INIT : $(SHL9VERSIONOBJDEP)
+.ENDIF # "$(VERSIONOBJ)"!=""
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL9IMPLIB)" == ""
+SHL9IMPLIB=i$(TARGET)_t9
+.ENDIF # "$(SHL9IMPLIB)" == ""
+.IF "$(COM)" != "GCC"
+USE_9IMPLIB=-implib:$(LB)/$(SHL9IMPLIB).lib
+.ENDIF # "$(COM)" != "GCC"
+SHL9IMPLIBN=$(LB)/$(SHL9IMPLIB).lib
+ALLTAR : $(SHL9IMPLIBN)
+
+.IF "$(USE_DEFFILE)"==""
+USE_9IMPLIB_DEPS=$(LB)/$(SHL9IMPLIB).lib
+.ENDIF # "$(USE_DEFFILE)"==""
+.ENDIF # "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+USE_SHL9DEF=$(SHL9DEF)
+.ELSE # "$(GUI)" != "UNX"
+USE_SHL9DEF=
+SHL9DEPN+:=$(SHL9DEPNU)
+
+.IF "$(SHL9VERSIONMAP)"==""
+# to activate vmaps remove "#"
+USE_SHL9VERSIONMAP=$(MISC)/$(SHL9TARGET).vmap
+.ENDIF # "$(SHL9VERSIONMAP)"==""
+
+.IF "$(USE_SHL9VERSIONMAP)"!=""
+
+.IF "$(SHL9FILTERFILE)"!=""
+.IF "$(SHL9VERSIONMAP)"!=""
+#eine von beiden ist zuviel
+USE_SHL9VERSIONMAP=$(MISC)/$(SHL9TARGET).vmap
+$(USE_SHL9VERSIONMAP) .PHONY:
+ @echo -----------------------------
+ @echo you should only use versionmap OR exportfile
+ @echo -----------------------------
+# force_dmake_to_error
+
+.ENDIF # "$(SHL9VERSIONMAP)"!=""
+
+SHL9VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL9VERSIONMAP)
+
+$(USE_SHL9VERSIONMAP): \
+ $(SHL9OBJS)\
+ $(SHL9LIBS)\
+ $(SHL9FILTERFILE)
+ @$(RM) $@.dump
+.IF "$(SHL9OBJS)"!=""
+# dump remaining objects on the fly
+.IF "$(OS)"=="MACOSX"
+ @-nm $(SHL9OBJS:s/.obj/.o/) > $@.dump
+.ELSE
+ @nm $(SHL9OBJS:s/.obj/.o/) > $@.dump
+.ENDIF
+.ENDIF # "$(SHL9OBJS)!"=""
+ @$(TYPE) /dev/null $(SHL9LIBS:s/.lib/.dump/) >> $@.dump
+ $(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL9INTERFACE) -f $(SHL9FILTERFILE) -m $@
+
+.ELSE # "$(SHL9FILTERFILE)"!=""
+USE_SHL9VERSIONMAP=$(MISC)/$(SHL9TARGET).vmap
+$(USE_SHL9VERSIONMAP) :
+.IF "$(VERBOSE)" == "TRUE"
+ @echo -----------------------------
+ @echo SHL9FILTERFILE not set!
+ @echo -----------------------------
+ @$(TOUCH) $@
+ @echo dummy file to keep the dependencies for later use.
+.ELSE
+ @$(TOUCH) $@
+.ENDIF
+# force_dmake_to_error
+.ENDIF # "$(SHL9FILTERFILE)"!=""
+.ELSE # "$(USE_SHL9VERSIONMAP)"!=""
+
+#and now for the plain non-generic way...
+.IF "$(SHL9VERSIONMAP)"!=""
+USE_SHL9VERSIONMAP=$(MISC)/$(SHL9VERSIONMAP:b)_$(SHL9TARGET)$(SHL9VERSIONMAP:e)
+SHL9VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL9VERSIONMAP)
+
+.IF "$(OS)"=="MACOSX"
+$(USE_SHL9VERSIONMAP): $(SHL9OBJS) $(SHL9LIBS)
+.ENDIF
+
+# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
+# even if the $(AWK) part fails:
+$(USE_SHL9VERSIONMAP) .ERRREMOVE: $(SHL9VERSIONMAP)
+ @@-$(RM) -f $@
+# The following files will only be generated and needed on Mac OS X as temporary files
+# in order to generate exported symbols list out of Linux/Solaris map files
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) -f $@.symregexp >& $(NULLDEV)
+ @-$(RM) -f $@.expsymlist >& $(NULLDEV)
+.ENDIF
+# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
+# happens if somebody will change it in the future
+.IF "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL9VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
+.ELIF "$(COMNAME)"=="sunpro5"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL9VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
+.ELSE # "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL9VERSIONMAP) > $@
+.ENDIF # "$(COMID)"=="gcc3"
+ @chmod a+w $@
+# Mac OS X post-processing generate an exported symbols list from the generated map file
+# for details on exported symbols list see man ld on Mac OS X
+.IF "$(OS)"=="MACOSX"
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+.IF "$(SHL9OBJS)"!=""
+ -echo $(foreach,i,$(SHL9OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+.IF "$(SHL9LIBS)"!=""
+ $(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL9LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ cp $@.exported-symbols $@
+.ENDIF # .IF "$(OS)"=="MACOSX"
+.ENDIF # "$(SHL9VERSIONMAP)"!=""
+.ENDIF # "$(USE_SHL9VERSIONMAP)"!=""
+.ENDIF # "$(GUI)" != "UNX"
+
+.IF "$(UNIXVERSIONNAMES)"!=""
+.IF "$(OS)"!="MACOSX"
+.IF "$(GUI)"=="UNX"
+SHL9SONAME=\"$(SONAME_SWITCH)$(SHL9TARGETN:f)\"
+.ENDIF # "$(GUI)"!="UNX"
+.ENDIF # "$(OS)"!="MACOSX"
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+
+.IF "$(SHL9RES)"!=""
+SHL9ALLRES+=$(SHL9RES)
+SHL9LINKRES*=$(MISC)/$(SHL9TARGET).res
+SHL9LINKRESO*=$(MISC)/$(SHL9TARGET)_res.o
+.ENDIF # "$(SHL9RES)"!=""
+
+.IF "$(SHL9DEFAULTRES)$(use_shl_versions)"!=""
+SHL9DEFAULTRES*=$(MISC)/$(SHL9TARGET)_def.res
+SHL9ALLRES+=$(SHL9DEFAULTRES)
+SHL9LINKRES*=$(MISC)/$(SHL9TARGET).res
+SHL9LINKRESO*=$(MISC)/$(SHL9TARGET)_res.o
+.ENDIF # "$(SHL9DEFAULTRES)$(use_shl_versions)"!=""
+
+#.IF "$(SHL9TARGETN)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL9LIBS)"!=""
+$(MISC)/$(SHL9TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL9LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL9LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(SHL9TARGETN:b)_linkinc.ls
+$(SHL9TARGETN) : $(LINKINCTARGETS)
+
+.ELSE
+.IF "$(SHL9USE_EXPORTS)"=="name"
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(COM)"!="GCC"
+.IF "$(SHL9LIBS)"!=""
+SHL9LINKLIST=$(MISC)/$(SHL9TARGET)_link.lst
+SHL9LINKLISTPARAM=@$(SHL9LINKLIST)
+$(SHL9LINKLIST) : $(SHL9LIBS)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL9LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL9LIBS)"!=""
+.ENDIF # "$(COM)"!="GCC"
+.ENDIF
+.ENDIF # "$(SHL9USE_EXPORTS)"=="name"
+
+$(MISC)/%linkinc.ls:
+ @echo . > $@
+.ENDIF # "$(linkinc)"!=""
+
+.IF "$(GUI)" == "OS2"
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL9TARGET8=$(shell @fix_shl $(SHL9TARGET))
+.ENDIF
+
+.IF "$(GUI)" == "OS2"
+_SHL9IMP_ORD = $(SHL9STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL9STDLIBS:^"$(LB)/")
+SHL9IMP_ORD = $(foreach,i,$(_SHL9IMP_ORD) $(shell @-ls $i))
+.ELSE
+SHL9IMP_ORD =
+.ENDIF
+
+
+$(SHL9TARGETN) : \
+ $(SHL9OBJS)\
+ $(SHL9LIBS)\
+ $(USE_9IMPLIB_DEPS)\
+ $(USE_SHL9DEF)\
+ $(USE_SHL9VERSIONMAP)\
+ $(SHL9RES)\
+ $(SHL9DEPN) \
+ $(SHL9IMP_ORD) \
+ $(SHL9LINKLIST)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(SHL9DEFAULTRES)"!=""
+ @@-$(RM) $(MISC)/$(SHL9DEFAULTRES:b).rc
+.IF "$(SHL9ICON)" != ""
+ @echo 1 ICON $(SHL9ICON) >> $(MISC)/$(SHL9DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL9ADD_VERINFO)"!=""
+ @echo $(EMQ)#include $(EMQ)"$(SHL9ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL9DEFAULTRES:b).rc
+.ELSE # "$(SHL9ADD_VERINFO)"!=""
+ @echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL9DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL9DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL9DEFAULTRES:b).rc
+.ENDIF # "$(SHL9ADD_VERINFO)"!=""
+ @echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(SHL9DEFAULTRES:b).rc
+ @echo $(EMQ)#define ORG_NAME $(SHL9TARGET)$(DLLPOST) >> $(MISC)/$(SHL9DEFAULTRES:b).rc
+ @echo $(EMQ)#define INTERNAL_NAME $(SHL9TARGET:b) >> $(MISC)/$(SHL9DEFAULTRES:b).rc
+ @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL9DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL9DEFAULTRES:b).rc
+.ENDIF # "$(SHL9DEFAULTRES)"!=""
+.IF "$(SHL9ALLRES)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(SHL9ALLRES) > $(SHL9LINKRES)
+.IF "$(COM)"=="GCC"
+ windres $(SHL9LINKRES) $(SHL9LINKRESO)
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(SHL9ALLRES)"!=""
+.IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def
+ @echo dlltool --dllname $(SHL9TARGET)$(DLLPOST) \
+ --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_9.cmd
+ @noop $(assign ALL9OBJLIST:=$(STDOBJ) $(SHL9OBJS) $(SHL9LINKRESO) $(shell $(TYPE) /dev/null $(SHL9LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+.IF "$(DEFLIB9NAME)"!="" # do not have to include objs
+ @noop $(assign DEF9OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB9NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+ @noop $(foreach,i,$(DEF9OBJLIST) $(assign ALL9OBJLIST:=$(ALL9OBJLIST:s?$i??)))
+.ENDIF # "$(DEFLIB9NAME)"!=""
+ @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_9.cmd
+.IF "$(SHL9DEF)"!=""
+ @echo --input-def $(SHL9DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_9.cmd
+.ELSE
+ @echo $(SHL9VERSIONOBJ) $(SHL9DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_9.cmd
+.ENDIF
+ @echo $(ALL9OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_9.cmd
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
+ $(STDOBJ) $(SHL9VERSIONOBJ) $(SHL9DESCRIPTIONOBJ) $(SHL9OBJS) $(SHL9LINKRESO) \
+ `$(TYPE) /dev/null $(SHL9LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ -Wl,--exclude-libs,ALL,--start-group $(SHL9STDLIBS) -Wl,--end-group \
+ $(SHL9STDSHL) $(STDSHL9) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
+ -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_9.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_9.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_9.cmd
+.ELSE
+.IF "$(linkinc)"==""
+.IF "$(SHL9USE_EXPORTS)"!="name"
+.IF "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL9LINKER) @$(mktmp \
+ $(SHL9LINKFLAGS) \
+ $(LINKFLAGSSHL) \
+ $(SHL9STACK) $(SHL9BASEX) \
+ -out:$@ \
+ -map:$(MISC)/$(@:b).map \
+ -def:$(SHL9DEF) \
+ $(USE_9IMPLIB) \
+ $(STDOBJ) \
+ $(SHL9VERSIONOBJ) $(SHL9OBJS) \
+ $(SHL9LIBS) \
+ $(SHL9STDLIBS) \
+ $(SHL9STDSHL) $(STDSHL9) \
+ $(SHL9LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE # "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL9LINKER) @$(mktmp $(SHL9LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL9BASEX) \
+ $(SHL9STACK) -out:$(SHL9TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(LB)/$(SHL9IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL9OBJS) $(SHL9VERSIONOBJ) \
+ $(SHL9LIBS) \
+ $(SHL9STDLIBS) \
+ $(SHL9STDSHL) $(STDSHL9) \
+ $(SHL9LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(USE_DEFFILE)"!=""
+.ELSE # "$(SHL9USE_EXPORTS)"!="name"
+ $(COMMAND_ECHO)$(SHL9LINKER) @$(mktmp $(SHL9LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL9BASEX) \
+ $(SHL9STACK) -out:$(SHL9TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(USE_9IMPLIB) \
+ $(STDOBJ) \
+ $(SHL9OBJS) $(SHL9VERSIONOBJ)) \
+ $(SHL9LINKLISTPARAM) \
+ @$(mktmp $(SHL9STDLIBS) \
+ $(SHL9STDSHL) $(STDSHL9) \
+ $(SHL9LINKRES) \
+ )
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(SHL9USE_EXPORTS)"!="name"
+.ELSE # "$(linkinc)"==""
+ $(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL9TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL9TARGET).lst
+ $(COMMAND_ECHO)$(TYPE) $(mktmp \
+ $(SHL9LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL9BASEX) \
+ $(SHL9STACK) $(MAPFILE) \
+ -out:$@ \
+ $(LB)/$(SHL9IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL9OBJS) \
+ $(SHL9STDLIBS) \
+ $(SHL9STDSHL) $(STDSHL9) \
+ $(SHL9LINKRES) \
+ ) >> $(MISC)/$(SHL9TARGET).lnk
+ $(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL9TARGETN:b)_linkinc.ls >> $(MISC)/$(SHL9TARGET).lnk
+ $(COMMAND_ECHO)$(SHL9LINKER) @$(MISC)/$(SHL9TARGET).lnk
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(linkinc)"==""
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)" == "WNT"
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_9.cmd
+ @echo $(STDSLO) $(SHL9OBJS:s/.obj/.o/) \
+ $(SHL9VERSIONOBJ) \
+ `cat /dev/null $(SHL9LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(SHL9LINKER) $(SHL9LINKFLAGS) $(SHL9VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
+ $(SHL9STDLIBS) $(SHL9ARCHIVES) $(SHL9STDSHL) $(STDSHL9) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_9.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_9.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_9.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_9.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_9.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ shl $(SHL9RPATH) $@
+.IF "$(SHL9CREATEJNILIB)"!=""
+ @echo "Making: " $(@:f).jnilib
+ @macosx-create-bundle $@
+.ENDIF # "$(SHL9CREATEJNILIB)"!=""
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL9NOCHECK)"==""
+ $(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS9) $(SHL9TARGETN)
+.ENDIF # "$(SHL9NOCHECK)"!=""
+.ENDIF
+.ELSE # "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_9.cmd
+ @echo $(SHL9LINKER) $(SHL9LINKFLAGS) $(SHL9SONAME) $(LINKFLAGSSHL) $(SHL9VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL9OBJS:s/.obj/.o/) \
+ $(SHL9VERSIONOBJ) -o $@ \
+ `cat /dev/null $(SHL9LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ $(SHL9STDLIBS) $(SHL9ARCHIVES) $(SHL9STDSHL) $(STDSHL9) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_9.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_9.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_9.cmd
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL9NOCHECK)"==""
+ $(COMMAND_ECHO)-$(RM) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f)
+ $(COMMAND_ECHO)$(RENAME) $(SHL9TARGETN) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f)
+.IF "$(VERBOSE)"=="TRUE"
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS9) $(SHL9TARGETN:d)check_$(SHL9TARGETN:f)
+.ELSE
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS9) -- -s $(SHL9TARGETN:d)check_$(SHL9TARGETN:f)
+.ENDIF
+.ENDIF # "$(SHL9NOCHECK)"!=""
+.ENDIF # "$(UPDATER)"=="YES"
+.ENDIF # "$(OS)"=="MACOSX"
+.IF "$(UNIXVERSIONNAMES)"!=""
+ $(COMMAND_ECHO)$(RM) $(LB)/$(SHL9TARGETN:b)
+ $(COMMAND_ECHO)cd $(LB) && ln -s $(SHL9TARGETN:f) $(SHL9TARGETN:b)
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+.IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+.ENDIF
+.ENDIF # "$(GUI)" == "UNX"
+
+.IF "$(GUI)" == "OS2"
+
+.IF "$(SHL9DEFAULTRES)"!=""
+ @+-$(RM) $(MISC)/$(SHL9DEFAULTRES:b).rc >& $(NULLDEV)
+.IF "$(SHL9ICON)" != ""
+ @-+echo 1 ICON $(SHL9ICON) >> $(MISC)/$(SHL9DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL9ADD_VERINFO)"!=""
+ @-+echo $(EMQ)#include $(EMQ)"$(SHL9ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL9DEFAULTRES:b).rc
+.ENDIF # "$(SHL9ADD_VERINFO)"!=""
+ @-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL9DEFAULTRES:b).rc
+# @-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL9DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL9DEFAULTRES:b).rc
+.ENDIF # "$(SHL9DEFAULTRES)"!=""
+
+.IF "$(SHL9ALLRES)"!=""
+ $(COMMAND_ECHO)+$(TYPE) $(SHL9ALLRES) > $(SHL9LINKRES)
+.ENDIF # "$(SHL9ALLRES)"!=""
+
+.IF "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL9LINKER) $(SHL9LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
+ $(SHL9DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL9OBJS) $(SHL9VERSIONOBJ) \
+ $(SHL9LIBS) \
+ $(SHL9STDLIBS:^"-l") \
+ $(SHL9LINKRES) \
+ $(SHL9STDSHL:^"-l") $(STDSHL9:^"-l")
+
+.ELSE # "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL9LINKER) -v $(SHL9LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL9BASEX) \
+ $(SHL9STACK) -o $(SHL9TARGETN) \
+ $(SHL9DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL9OBJS) $(SHL9VERSIONOBJ) \
+ $(SHL9LIBS) \
+ $(SHL9STDLIBS:^"-l") \
+ $(SHL9LINKRES) \
+ $(SHL9STDSHL:^"-l") $(STDSHL9:^"-l") \
+ $(LINKOUTPUTFILTER)
+ @$(LS) $@ >& $(NULLDEV)
+
+.ENDIF # "$(USE_DEFFILE)"!=""
+
+.IF "$(SHL9TARGET8)" != "$(SHL9TARGET)"
+ $(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL9TARGET8).dll
+.ENDIF
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(SHL9TARGETN)"!=""
+
+# unroll begin
+
+.IF "$(SHL10TARGETN)"!=""
+
+.IF "$(OS)"=="AIX"
+SHL10STDLIBS=
+.ENDIF
+
+.IF "$(SHLLINKARCONLY)" != ""
+SHL10STDLIBS=
+STDSHL=
+.ELSE
+SHL10ARCHIVES=
+.ENDIF
+
+# decide how to link
+.IF "$(SHL10CODETYPE)"=="C"
+SHL10LINKER=$(LINKC)
+SHL10STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
+SHL10LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(SHL10CODETYPE)"=="C"
+SHL10LINKER=$(LINK)
+SHL10STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
+SHL10LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(SHL10CODETYPE)"=="C"
+
+SHL10RPATH*=OOO
+LINKFLAGSRUNPATH_$(SHL10RPATH)*=/ERROR:/Bad_SHL10RPATH_value
+SHL10LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL10RPATH))
+
+.IF "$(SHL10USE_EXPORTS)"==""
+SHL10DEF*=$(MISC)/$(SHL10TARGET).def
+.ENDIF # "$(SHL10USE_EXPORTS)"==""
+
+EXTRALIBPATHS10=$(EXTRALIBPATHS)
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL10NOCHECK)"==""
+.IF "$(SOLAR_STLLIBPATH)"!=""
+EXTRALIBPATHS10+=-L$(SOLAR_STLLIBPATH)
+.ENDIF
+.ENDIF # "$(SHL10NOCHECK)"!=""
+.ENDIF
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#+++++++++++ version object ++++++++++++++++++++++++++++++++++++++++
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.IF "$(L10N_framework)"==""
+.IF "$(VERSIONOBJ)"!=""
+SHL10VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL10TARGET))}$(VERSIONOBJ:f)
+USE_VERSIONH:=$(INCCOM)/$(SHL10VERSIONOBJ:b).h
+.IF "$(GUI)" == "UNX"
+SHL10VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL10TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
+.ELSE # "$(GUI)" == "UNX"
+SHL10VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL10TARGET))}$(VERSIONOBJ:f)
+.ENDIF # "$(GUI)" == "UNX"
+$(MISC)/$(SHL10VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL10VERSIONOBJ:b).h
+# $(COPY) $(SOLARENV)/src/version.c $@
+ $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL10VERSIONOBJ:b).h/ > $@
+
+.INIT : $(SHL10VERSIONOBJDEP)
+.ENDIF # "$(VERSIONOBJ)"!=""
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL10IMPLIB)" == ""
+SHL10IMPLIB=i$(TARGET)_t10
+.ENDIF # "$(SHL10IMPLIB)" == ""
+.IF "$(COM)" != "GCC"
+USE_10IMPLIB=-implib:$(LB)/$(SHL10IMPLIB).lib
+.ENDIF # "$(COM)" != "GCC"
+SHL10IMPLIBN=$(LB)/$(SHL10IMPLIB).lib
+ALLTAR : $(SHL10IMPLIBN)
+
+.IF "$(USE_DEFFILE)"==""
+USE_10IMPLIB_DEPS=$(LB)/$(SHL10IMPLIB).lib
+.ENDIF # "$(USE_DEFFILE)"==""
+.ENDIF # "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+USE_SHL10DEF=$(SHL10DEF)
+.ELSE # "$(GUI)" != "UNX"
+USE_SHL10DEF=
+SHL10DEPN+:=$(SHL10DEPNU)
+
+.IF "$(SHL10VERSIONMAP)"==""
+# to activate vmaps remove "#"
+USE_SHL10VERSIONMAP=$(MISC)/$(SHL10TARGET).vmap
+.ENDIF # "$(SHL10VERSIONMAP)"==""
+
+.IF "$(USE_SHL10VERSIONMAP)"!=""
+
+.IF "$(SHL10FILTERFILE)"!=""
+.IF "$(SHL10VERSIONMAP)"!=""
+#eine von beiden ist zuviel
+USE_SHL10VERSIONMAP=$(MISC)/$(SHL10TARGET).vmap
+$(USE_SHL10VERSIONMAP) .PHONY:
+ @echo -----------------------------
+ @echo you should only use versionmap OR exportfile
+ @echo -----------------------------
+# force_dmake_to_error
+
+.ENDIF # "$(SHL10VERSIONMAP)"!=""
+
+SHL10VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL10VERSIONMAP)
+
+$(USE_SHL10VERSIONMAP): \
+ $(SHL10OBJS)\
+ $(SHL10LIBS)\
+ $(SHL10FILTERFILE)
+ @$(RM) $@.dump
+.IF "$(SHL10OBJS)"!=""
+# dump remaining objects on the fly
+.IF "$(OS)"=="MACOSX"
+ @-nm $(SHL10OBJS:s/.obj/.o/) > $@.dump
+.ELSE
+ @nm $(SHL10OBJS:s/.obj/.o/) > $@.dump
+.ENDIF
+.ENDIF # "$(SHL10OBJS)!"=""
+ @$(TYPE) /dev/null $(SHL10LIBS:s/.lib/.dump/) >> $@.dump
+ $(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL10INTERFACE) -f $(SHL10FILTERFILE) -m $@
+
+.ELSE # "$(SHL10FILTERFILE)"!=""
+USE_SHL10VERSIONMAP=$(MISC)/$(SHL10TARGET).vmap
+$(USE_SHL10VERSIONMAP) :
+.IF "$(VERBOSE)" == "TRUE"
+ @echo -----------------------------
+ @echo SHL10FILTERFILE not set!
+ @echo -----------------------------
+ @$(TOUCH) $@
+ @echo dummy file to keep the dependencies for later use.
+.ELSE
+ @$(TOUCH) $@
+.ENDIF
+# force_dmake_to_error
+.ENDIF # "$(SHL10FILTERFILE)"!=""
+.ELSE # "$(USE_SHL10VERSIONMAP)"!=""
+
+#and now for the plain non-generic way...
+.IF "$(SHL10VERSIONMAP)"!=""
+USE_SHL10VERSIONMAP=$(MISC)/$(SHL10VERSIONMAP:b)_$(SHL10TARGET)$(SHL10VERSIONMAP:e)
+SHL10VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL10VERSIONMAP)
+
+.IF "$(OS)"=="MACOSX"
+$(USE_SHL10VERSIONMAP): $(SHL10OBJS) $(SHL10LIBS)
+.ENDIF
+
+# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
+# even if the $(AWK) part fails:
+$(USE_SHL10VERSIONMAP) .ERRREMOVE: $(SHL10VERSIONMAP)
+ @@-$(RM) -f $@
+# The following files will only be generated and needed on Mac OS X as temporary files
+# in order to generate exported symbols list out of Linux/Solaris map files
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) -f $@.symregexp >& $(NULLDEV)
+ @-$(RM) -f $@.expsymlist >& $(NULLDEV)
+.ENDIF
+# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
+# happens if somebody will change it in the future
+.IF "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL10VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
+.ELIF "$(COMNAME)"=="sunpro5"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL10VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
+.ELSE # "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL10VERSIONMAP) > $@
+.ENDIF # "$(COMID)"=="gcc3"
+ @chmod a+w $@
+# Mac OS X post-processing generate an exported symbols list from the generated map file
+# for details on exported symbols list see man ld on Mac OS X
+.IF "$(OS)"=="MACOSX"
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+.IF "$(SHL10OBJS)"!=""
+ -echo $(foreach,i,$(SHL10OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+.IF "$(SHL10LIBS)"!=""
+ $(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL10LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ cp $@.exported-symbols $@
+.ENDIF # .IF "$(OS)"=="MACOSX"
+.ENDIF # "$(SHL10VERSIONMAP)"!=""
+.ENDIF # "$(USE_SHL10VERSIONMAP)"!=""
+.ENDIF # "$(GUI)" != "UNX"
+
+.IF "$(UNIXVERSIONNAMES)"!=""
+.IF "$(OS)"!="MACOSX"
+.IF "$(GUI)"=="UNX"
+SHL10SONAME=\"$(SONAME_SWITCH)$(SHL10TARGETN:f)\"
+.ENDIF # "$(GUI)"!="UNX"
+.ENDIF # "$(OS)"!="MACOSX"
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+
+.IF "$(SHL10RES)"!=""
+SHL10ALLRES+=$(SHL10RES)
+SHL10LINKRES*=$(MISC)/$(SHL10TARGET).res
+SHL10LINKRESO*=$(MISC)/$(SHL10TARGET)_res.o
+.ENDIF # "$(SHL10RES)"!=""
+
+.IF "$(SHL10DEFAULTRES)$(use_shl_versions)"!=""
+SHL10DEFAULTRES*=$(MISC)/$(SHL10TARGET)_def.res
+SHL10ALLRES+=$(SHL10DEFAULTRES)
+SHL10LINKRES*=$(MISC)/$(SHL10TARGET).res
+SHL10LINKRESO*=$(MISC)/$(SHL10TARGET)_res.o
+.ENDIF # "$(SHL10DEFAULTRES)$(use_shl_versions)"!=""
+
+#.IF "$(SHL10TARGETN)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL10LIBS)"!=""
+$(MISC)/$(SHL10TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL10LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL10LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(SHL10TARGETN:b)_linkinc.ls
+$(SHL10TARGETN) : $(LINKINCTARGETS)
+
+.ELSE
+.IF "$(SHL10USE_EXPORTS)"=="name"
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(COM)"!="GCC"
+.IF "$(SHL10LIBS)"!=""
+SHL10LINKLIST=$(MISC)/$(SHL10TARGET)_link.lst
+SHL10LINKLISTPARAM=@$(SHL10LINKLIST)
+$(SHL10LINKLIST) : $(SHL10LIBS)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL10LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL10LIBS)"!=""
+.ENDIF # "$(COM)"!="GCC"
+.ENDIF
+.ENDIF # "$(SHL10USE_EXPORTS)"=="name"
+
+$(MISC)/%linkinc.ls:
+ @echo . > $@
+.ENDIF # "$(linkinc)"!=""
+
+.IF "$(GUI)" == "OS2"
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL10TARGET8=$(shell @fix_shl $(SHL10TARGET))
+.ENDIF
+
+.IF "$(GUI)" == "OS2"
+_SHL10IMP_ORD = $(SHL10STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL10STDLIBS:^"$(LB)/")
+SHL10IMP_ORD = $(foreach,i,$(_SHL10IMP_ORD) $(shell @-ls $i))
+.ELSE
+SHL10IMP_ORD =
+.ENDIF
+
+
+$(SHL10TARGETN) : \
+ $(SHL10OBJS)\
+ $(SHL10LIBS)\
+ $(USE_10IMPLIB_DEPS)\
+ $(USE_SHL10DEF)\
+ $(USE_SHL10VERSIONMAP)\
+ $(SHL10RES)\
+ $(SHL10DEPN) \
+ $(SHL10IMP_ORD) \
+ $(SHL10LINKLIST)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(SHL10DEFAULTRES)"!=""
+ @@-$(RM) $(MISC)/$(SHL10DEFAULTRES:b).rc
+.IF "$(SHL10ICON)" != ""
+ @echo 1 ICON $(SHL10ICON) >> $(MISC)/$(SHL10DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL10ADD_VERINFO)"!=""
+ @echo $(EMQ)#include $(EMQ)"$(SHL10ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL10DEFAULTRES:b).rc
+.ELSE # "$(SHL10ADD_VERINFO)"!=""
+ @echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL10DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL10DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL10DEFAULTRES:b).rc
+.ENDIF # "$(SHL10ADD_VERINFO)"!=""
+ @echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(SHL10DEFAULTRES:b).rc
+ @echo $(EMQ)#define ORG_NAME $(SHL10TARGET)$(DLLPOST) >> $(MISC)/$(SHL10DEFAULTRES:b).rc
+ @echo $(EMQ)#define INTERNAL_NAME $(SHL10TARGET:b) >> $(MISC)/$(SHL10DEFAULTRES:b).rc
+ @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL10DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL10DEFAULTRES:b).rc
+.ENDIF # "$(SHL10DEFAULTRES)"!=""
+.IF "$(SHL10ALLRES)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(SHL10ALLRES) > $(SHL10LINKRES)
+.IF "$(COM)"=="GCC"
+ windres $(SHL10LINKRES) $(SHL10LINKRESO)
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(SHL10ALLRES)"!=""
+.IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def
+ @echo dlltool --dllname $(SHL10TARGET)$(DLLPOST) \
+ --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_10.cmd
+ @noop $(assign ALL10OBJLIST:=$(STDOBJ) $(SHL10OBJS) $(SHL10LINKRESO) $(shell $(TYPE) /dev/null $(SHL10LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+.IF "$(DEFLIB10NAME)"!="" # do not have to include objs
+ @noop $(assign DEF10OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB10NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+ @noop $(foreach,i,$(DEF10OBJLIST) $(assign ALL10OBJLIST:=$(ALL10OBJLIST:s?$i??)))
+.ENDIF # "$(DEFLIB10NAME)"!=""
+ @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_10.cmd
+.IF "$(SHL10DEF)"!=""
+ @echo --input-def $(SHL10DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_10.cmd
+.ELSE
+ @echo $(SHL10VERSIONOBJ) $(SHL10DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_10.cmd
+.ENDIF
+ @echo $(ALL10OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_10.cmd
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
+ $(STDOBJ) $(SHL10VERSIONOBJ) $(SHL10DESCRIPTIONOBJ) $(SHL10OBJS) $(SHL10LINKRESO) \
+ `$(TYPE) /dev/null $(SHL10LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ -Wl,--exclude-libs,ALL,--start-group $(SHL10STDLIBS) -Wl,--end-group \
+ $(SHL10STDSHL) $(STDSHL10) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
+ -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_10.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_10.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_10.cmd
+.ELSE
+.IF "$(linkinc)"==""
+.IF "$(SHL10USE_EXPORTS)"!="name"
+.IF "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL10LINKER) @$(mktmp \
+ $(SHL10LINKFLAGS) \
+ $(LINKFLAGSSHL) \
+ $(SHL10STACK) $(SHL10BASEX) \
+ -out:$@ \
+ -map:$(MISC)/$(@:b).map \
+ -def:$(SHL10DEF) \
+ $(USE_10IMPLIB) \
+ $(STDOBJ) \
+ $(SHL10VERSIONOBJ) $(SHL10OBJS) \
+ $(SHL10LIBS) \
+ $(SHL10STDLIBS) \
+ $(SHL10STDSHL) $(STDSHL10) \
+ $(SHL10LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE # "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL10LINKER) @$(mktmp $(SHL10LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL10BASEX) \
+ $(SHL10STACK) -out:$(SHL10TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(LB)/$(SHL10IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL10OBJS) $(SHL10VERSIONOBJ) \
+ $(SHL10LIBS) \
+ $(SHL10STDLIBS) \
+ $(SHL10STDSHL) $(STDSHL10) \
+ $(SHL10LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(USE_DEFFILE)"!=""
+.ELSE # "$(SHL10USE_EXPORTS)"!="name"
+ $(COMMAND_ECHO)$(SHL10LINKER) @$(mktmp $(SHL10LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL10BASEX) \
+ $(SHL10STACK) -out:$(SHL10TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(USE_10IMPLIB) \
+ $(STDOBJ) \
+ $(SHL10OBJS) $(SHL10VERSIONOBJ)) \
+ $(SHL10LINKLISTPARAM) \
+ @$(mktmp $(SHL10STDLIBS) \
+ $(SHL10STDSHL) $(STDSHL10) \
+ $(SHL10LINKRES) \
+ )
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(SHL10USE_EXPORTS)"!="name"
+.ELSE # "$(linkinc)"==""
+ $(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL10TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL10TARGET).lst
+ $(COMMAND_ECHO)$(TYPE) $(mktmp \
+ $(SHL10LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL10BASEX) \
+ $(SHL10STACK) $(MAPFILE) \
+ -out:$@ \
+ $(LB)/$(SHL10IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL10OBJS) \
+ $(SHL10STDLIBS) \
+ $(SHL10STDSHL) $(STDSHL10) \
+ $(SHL10LINKRES) \
+ ) >> $(MISC)/$(SHL10TARGET).lnk
+ $(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL10TARGETN:b)_linkinc.ls >> $(MISC)/$(SHL10TARGET).lnk
+ $(COMMAND_ECHO)$(SHL10LINKER) @$(MISC)/$(SHL10TARGET).lnk
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(linkinc)"==""
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)" == "WNT"
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_10.cmd
+ @echo $(STDSLO) $(SHL10OBJS:s/.obj/.o/) \
+ $(SHL10VERSIONOBJ) \
+ `cat /dev/null $(SHL10LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(SHL10LINKER) $(SHL10LINKFLAGS) $(SHL10VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
+ $(SHL10STDLIBS) $(SHL10ARCHIVES) $(SHL10STDSHL) $(STDSHL10) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_10.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_10.cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_10.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_10.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_10.cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ shl $(SHL10RPATH) $@
+.IF "$(SHL10CREATEJNILIB)"!=""
+ @echo "Making: " $(@:f).jnilib
+ @macosx-create-bundle $@
+.ENDIF # "$(SHL10CREATEJNILIB)"!=""
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL10NOCHECK)"==""
+ $(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS10) $(SHL10TARGETN)
+.ENDIF # "$(SHL10NOCHECK)"!=""
+.ENDIF
+.ELSE # "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_10.cmd
+ @echo $(SHL10LINKER) $(SHL10LINKFLAGS) $(SHL10SONAME) $(LINKFLAGSSHL) $(SHL10VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL10OBJS:s/.obj/.o/) \
+ $(SHL10VERSIONOBJ) -o $@ \
+ `cat /dev/null $(SHL10LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ $(SHL10STDLIBS) $(SHL10ARCHIVES) $(SHL10STDSHL) $(STDSHL10) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_10.cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_10.cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_10.cmd
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL10NOCHECK)"==""
+ $(COMMAND_ECHO)-$(RM) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f)
+ $(COMMAND_ECHO)$(RENAME) $(SHL10TARGETN) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f)
+.IF "$(VERBOSE)"=="TRUE"
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS10) $(SHL10TARGETN:d)check_$(SHL10TARGETN:f)
+.ELSE
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS10) -- -s $(SHL10TARGETN:d)check_$(SHL10TARGETN:f)
+.ENDIF
+.ENDIF # "$(SHL10NOCHECK)"!=""
+.ENDIF # "$(UPDATER)"=="YES"
+.ENDIF # "$(OS)"=="MACOSX"
+.IF "$(UNIXVERSIONNAMES)"!=""
+ $(COMMAND_ECHO)$(RM) $(LB)/$(SHL10TARGETN:b)
+ $(COMMAND_ECHO)cd $(LB) && ln -s $(SHL10TARGETN:f) $(SHL10TARGETN:b)
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+.IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+.ENDIF
+.ENDIF # "$(GUI)" == "UNX"
+
+.IF "$(GUI)" == "OS2"
+
+.IF "$(SHL10DEFAULTRES)"!=""
+ @+-$(RM) $(MISC)/$(SHL10DEFAULTRES:b).rc >& $(NULLDEV)
+.IF "$(SHL10ICON)" != ""
+ @-+echo 1 ICON $(SHL10ICON) >> $(MISC)/$(SHL10DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL10ADD_VERINFO)"!=""
+ @-+echo $(EMQ)#include $(EMQ)"$(SHL10ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL10DEFAULTRES:b).rc
+.ENDIF # "$(SHL10ADD_VERINFO)"!=""
+ @-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL10DEFAULTRES:b).rc
+# @-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL10DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL10DEFAULTRES:b).rc
+.ENDIF # "$(SHL10DEFAULTRES)"!=""
+
+.IF "$(SHL10ALLRES)"!=""
+ $(COMMAND_ECHO)+$(TYPE) $(SHL10ALLRES) > $(SHL10LINKRES)
+.ENDIF # "$(SHL10ALLRES)"!=""
+
+.IF "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL10LINKER) $(SHL10LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
+ $(SHL10DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL10OBJS) $(SHL10VERSIONOBJ) \
+ $(SHL10LIBS) \
+ $(SHL10STDLIBS:^"-l") \
+ $(SHL10LINKRES) \
+ $(SHL10STDSHL:^"-l") $(STDSHL10:^"-l")
+
+.ELSE # "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL10LINKER) -v $(SHL10LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL10BASEX) \
+ $(SHL10STACK) -o $(SHL10TARGETN) \
+ $(SHL10DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL10OBJS) $(SHL10VERSIONOBJ) \
+ $(SHL10LIBS) \
+ $(SHL10STDLIBS:^"-l") \
+ $(SHL10LINKRES) \
+ $(SHL10STDSHL:^"-l") $(STDSHL10:^"-l") \
+ $(LINKOUTPUTFILTER)
+ @$(LS) $@ >& $(NULLDEV)
+
+.ENDIF # "$(USE_DEFFILE)"!=""
+
+.IF "$(SHL10TARGET8)" != "$(SHL10TARGET)"
+ $(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL10TARGET8).dll
+.ENDIF
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(SHL10TARGETN)"!=""
+
+# unroll begin
+
+.IF "$(SHL1IMPLIBN)" != ""
+
+.IF "$(UPDATER)"=="YES"
+USELIB1DEPN+=$(SHL1LIBS)
+.ELSE
+.ENDIF
+
+.IF "$(USE_DEFFILE)"!=""
+USE_SHL1TARGET=$(SHL1TARGETN)
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+$(SHL1IMPLIBN): \
+ $(SHL1DEF) \
+ $(USE_SHL1TARGET) \
+ $(USELIB1DEPN) \
+ $(USELIBDEPN)
+.ELSE
+$(SHL1IMPLIBN): \
+ $(SHL1LIBS)
+.ENDIF
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(COM)"=="GCC"
+ @echo no ImportLibs on mingw
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ELSE # "$(COM)=="GCC"
+# bei use_deffile implib von linker erstellt
+.IF "$(USE_DEFFILE)"==""
+ $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL1IMPLIBN) \
+ -def:$(SHL1DEF) )
+.ELSE # "$(USE_DEFFILE)==""
+ @echo build of $(SHL1TARGETN) creates $@
+ @$(TOUCH) $@
+.ENDIF # "$(USE_DEFFILE)==""
+.ENDIF # "$(COM)"=="GCC"
+
+.ELIF "$(GUI)" == "OS2"
+
+# touch creates an empty file, but this is not good for emxomfar, so
+# create a dummy lib here
+ $(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL1VERSIONOBJ)
+ +@echo build of $(SHL1TARGETN) creates $@
+
+.ELSE
+ @echo no ImportLibs on Mac and *ix
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ENDIF
+.ENDIF
+
+# unroll begin
+
+.IF "$(SHL2IMPLIBN)" != ""
+
+.IF "$(UPDATER)"=="YES"
+USELIB2DEPN+=$(SHL2LIBS)
+.ELSE
+.ENDIF
+
+.IF "$(USE_DEFFILE)"!=""
+USE_SHL2TARGET=$(SHL2TARGETN)
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+$(SHL2IMPLIBN): \
+ $(SHL2DEF) \
+ $(USE_SHL2TARGET) \
+ $(USELIB2DEPN) \
+ $(USELIBDEPN)
+.ELSE
+$(SHL2IMPLIBN): \
+ $(SHL2LIBS)
+.ENDIF
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(COM)"=="GCC"
+ @echo no ImportLibs on mingw
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ELSE # "$(COM)=="GCC"
+# bei use_deffile implib von linker erstellt
+.IF "$(USE_DEFFILE)"==""
+ $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL2IMPLIBN) \
+ -def:$(SHL2DEF) )
+.ELSE # "$(USE_DEFFILE)==""
+ @echo build of $(SHL2TARGETN) creates $@
+ @$(TOUCH) $@
+.ENDIF # "$(USE_DEFFILE)==""
+.ENDIF # "$(COM)"=="GCC"
+
+.ELIF "$(GUI)" == "OS2"
+
+# touch creates an empty file, but this is not good for emxomfar, so
+# create a dummy lib here
+ $(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL2VERSIONOBJ)
+ +@echo build of $(SHL2TARGETN) creates $@
+
+.ELSE
+ @echo no ImportLibs on Mac and *ix
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ENDIF
+.ENDIF
+
+# unroll begin
+
+.IF "$(SHL3IMPLIBN)" != ""
+
+.IF "$(UPDATER)"=="YES"
+USELIB3DEPN+=$(SHL3LIBS)
+.ELSE
+.ENDIF
+
+.IF "$(USE_DEFFILE)"!=""
+USE_SHL3TARGET=$(SHL3TARGETN)
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+$(SHL3IMPLIBN): \
+ $(SHL3DEF) \
+ $(USE_SHL3TARGET) \
+ $(USELIB3DEPN) \
+ $(USELIBDEPN)
+.ELSE
+$(SHL3IMPLIBN): \
+ $(SHL3LIBS)
+.ENDIF
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(COM)"=="GCC"
+ @echo no ImportLibs on mingw
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ELSE # "$(COM)=="GCC"
+# bei use_deffile implib von linker erstellt
+.IF "$(USE_DEFFILE)"==""
+ $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL3IMPLIBN) \
+ -def:$(SHL3DEF) )
+.ELSE # "$(USE_DEFFILE)==""
+ @echo build of $(SHL3TARGETN) creates $@
+ @$(TOUCH) $@
+.ENDIF # "$(USE_DEFFILE)==""
+.ENDIF # "$(COM)"=="GCC"
+
+.ELIF "$(GUI)" == "OS2"
+
+# touch creates an empty file, but this is not good for emxomfar, so
+# create a dummy lib here
+ $(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL3VERSIONOBJ)
+ +@echo build of $(SHL3TARGETN) creates $@
+
+.ELSE
+ @echo no ImportLibs on Mac and *ix
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ENDIF
+.ENDIF
+
+# unroll begin
+
+.IF "$(SHL4IMPLIBN)" != ""
+
+.IF "$(UPDATER)"=="YES"
+USELIB4DEPN+=$(SHL4LIBS)
+.ELSE
+.ENDIF
+
+.IF "$(USE_DEFFILE)"!=""
+USE_SHL4TARGET=$(SHL4TARGETN)
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+$(SHL4IMPLIBN): \
+ $(SHL4DEF) \
+ $(USE_SHL4TARGET) \
+ $(USELIB4DEPN) \
+ $(USELIBDEPN)
+.ELSE
+$(SHL4IMPLIBN): \
+ $(SHL4LIBS)
+.ENDIF
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(COM)"=="GCC"
+ @echo no ImportLibs on mingw
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ELSE # "$(COM)=="GCC"
+# bei use_deffile implib von linker erstellt
+.IF "$(USE_DEFFILE)"==""
+ $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL4IMPLIBN) \
+ -def:$(SHL4DEF) )
+.ELSE # "$(USE_DEFFILE)==""
+ @echo build of $(SHL4TARGETN) creates $@
+ @$(TOUCH) $@
+.ENDIF # "$(USE_DEFFILE)==""
+.ENDIF # "$(COM)"=="GCC"
+
+.ELIF "$(GUI)" == "OS2"
+
+# touch creates an empty file, but this is not good for emxomfar, so
+# create a dummy lib here
+ $(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL4VERSIONOBJ)
+ +@echo build of $(SHL4TARGETN) creates $@
+
+.ELSE
+ @echo no ImportLibs on Mac and *ix
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ENDIF
+.ENDIF
+
+# unroll begin
+
+.IF "$(SHL5IMPLIBN)" != ""
+
+.IF "$(UPDATER)"=="YES"
+USELIB5DEPN+=$(SHL5LIBS)
+.ELSE
+.ENDIF
+
+.IF "$(USE_DEFFILE)"!=""
+USE_SHL5TARGET=$(SHL5TARGETN)
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+$(SHL5IMPLIBN): \
+ $(SHL5DEF) \
+ $(USE_SHL5TARGET) \
+ $(USELIB5DEPN) \
+ $(USELIBDEPN)
+.ELSE
+$(SHL5IMPLIBN): \
+ $(SHL5LIBS)
+.ENDIF
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(COM)"=="GCC"
+ @echo no ImportLibs on mingw
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ELSE # "$(COM)=="GCC"
+# bei use_deffile implib von linker erstellt
+.IF "$(USE_DEFFILE)"==""
+ $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL5IMPLIBN) \
+ -def:$(SHL5DEF) )
+.ELSE # "$(USE_DEFFILE)==""
+ @echo build of $(SHL5TARGETN) creates $@
+ @$(TOUCH) $@
+.ENDIF # "$(USE_DEFFILE)==""
+.ENDIF # "$(COM)"=="GCC"
+
+.ELIF "$(GUI)" == "OS2"
+
+# touch creates an empty file, but this is not good for emxomfar, so
+# create a dummy lib here
+ $(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL5VERSIONOBJ)
+ +@echo build of $(SHL5TARGETN) creates $@
+
+.ELSE
+ @echo no ImportLibs on Mac and *ix
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ENDIF
+.ENDIF
+
+# unroll begin
+
+.IF "$(SHL6IMPLIBN)" != ""
+
+.IF "$(UPDATER)"=="YES"
+USELIB6DEPN+=$(SHL6LIBS)
+.ELSE
+.ENDIF
+
+.IF "$(USE_DEFFILE)"!=""
+USE_SHL6TARGET=$(SHL6TARGETN)
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+$(SHL6IMPLIBN): \
+ $(SHL6DEF) \
+ $(USE_SHL6TARGET) \
+ $(USELIB6DEPN) \
+ $(USELIBDEPN)
+.ELSE
+$(SHL6IMPLIBN): \
+ $(SHL6LIBS)
+.ENDIF
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(COM)"=="GCC"
+ @echo no ImportLibs on mingw
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ELSE # "$(COM)=="GCC"
+# bei use_deffile implib von linker erstellt
+.IF "$(USE_DEFFILE)"==""
+ $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL6IMPLIBN) \
+ -def:$(SHL6DEF) )
+.ELSE # "$(USE_DEFFILE)==""
+ @echo build of $(SHL6TARGETN) creates $@
+ @$(TOUCH) $@
+.ENDIF # "$(USE_DEFFILE)==""
+.ENDIF # "$(COM)"=="GCC"
+
+.ELIF "$(GUI)" == "OS2"
+
+# touch creates an empty file, but this is not good for emxomfar, so
+# create a dummy lib here
+ $(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL6VERSIONOBJ)
+ +@echo build of $(SHL6TARGETN) creates $@
+
+.ELSE
+ @echo no ImportLibs on Mac and *ix
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ENDIF
+.ENDIF
+
+# unroll begin
+
+.IF "$(SHL7IMPLIBN)" != ""
+
+.IF "$(UPDATER)"=="YES"
+USELIB7DEPN+=$(SHL7LIBS)
+.ELSE
+.ENDIF
+
+.IF "$(USE_DEFFILE)"!=""
+USE_SHL7TARGET=$(SHL7TARGETN)
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+$(SHL7IMPLIBN): \
+ $(SHL7DEF) \
+ $(USE_SHL7TARGET) \
+ $(USELIB7DEPN) \
+ $(USELIBDEPN)
+.ELSE
+$(SHL7IMPLIBN): \
+ $(SHL7LIBS)
+.ENDIF
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(COM)"=="GCC"
+ @echo no ImportLibs on mingw
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ELSE # "$(COM)=="GCC"
+# bei use_deffile implib von linker erstellt
+.IF "$(USE_DEFFILE)"==""
+ $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL7IMPLIBN) \
+ -def:$(SHL7DEF) )
+.ELSE # "$(USE_DEFFILE)==""
+ @echo build of $(SHL7TARGETN) creates $@
+ @$(TOUCH) $@
+.ENDIF # "$(USE_DEFFILE)==""
+.ENDIF # "$(COM)"=="GCC"
+
+.ELIF "$(GUI)" == "OS2"
+
+# touch creates an empty file, but this is not good for emxomfar, so
+# create a dummy lib here
+ $(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL7VERSIONOBJ)
+ +@echo build of $(SHL7TARGETN) creates $@
+
+.ELSE
+ @echo no ImportLibs on Mac and *ix
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ENDIF
+.ENDIF
+
+# unroll begin
+
+.IF "$(SHL8IMPLIBN)" != ""
+
+.IF "$(UPDATER)"=="YES"
+USELIB8DEPN+=$(SHL8LIBS)
+.ELSE
+.ENDIF
+
+.IF "$(USE_DEFFILE)"!=""
+USE_SHL8TARGET=$(SHL8TARGETN)
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+$(SHL8IMPLIBN): \
+ $(SHL8DEF) \
+ $(USE_SHL8TARGET) \
+ $(USELIB8DEPN) \
+ $(USELIBDEPN)
+.ELSE
+$(SHL8IMPLIBN): \
+ $(SHL8LIBS)
+.ENDIF
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(COM)"=="GCC"
+ @echo no ImportLibs on mingw
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ELSE # "$(COM)=="GCC"
+# bei use_deffile implib von linker erstellt
+.IF "$(USE_DEFFILE)"==""
+ $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL8IMPLIBN) \
+ -def:$(SHL8DEF) )
+.ELSE # "$(USE_DEFFILE)==""
+ @echo build of $(SHL8TARGETN) creates $@
+ @$(TOUCH) $@
+.ENDIF # "$(USE_DEFFILE)==""
+.ENDIF # "$(COM)"=="GCC"
+
+.ELIF "$(GUI)" == "OS2"
+
+# touch creates an empty file, but this is not good for emxomfar, so
+# create a dummy lib here
+ $(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL8VERSIONOBJ)
+ +@echo build of $(SHL8TARGETN) creates $@
+
+.ELSE
+ @echo no ImportLibs on Mac and *ix
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ENDIF
+.ENDIF
+
+# unroll begin
+
+.IF "$(SHL9IMPLIBN)" != ""
+
+.IF "$(UPDATER)"=="YES"
+USELIB9DEPN+=$(SHL9LIBS)
+.ELSE
+.ENDIF
+
+.IF "$(USE_DEFFILE)"!=""
+USE_SHL9TARGET=$(SHL9TARGETN)
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+$(SHL9IMPLIBN): \
+ $(SHL9DEF) \
+ $(USE_SHL9TARGET) \
+ $(USELIB9DEPN) \
+ $(USELIBDEPN)
+.ELSE
+$(SHL9IMPLIBN): \
+ $(SHL9LIBS)
+.ENDIF
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(COM)"=="GCC"
+ @echo no ImportLibs on mingw
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ELSE # "$(COM)=="GCC"
+# bei use_deffile implib von linker erstellt
+.IF "$(USE_DEFFILE)"==""
+ $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL9IMPLIBN) \
+ -def:$(SHL9DEF) )
+.ELSE # "$(USE_DEFFILE)==""
+ @echo build of $(SHL9TARGETN) creates $@
+ @$(TOUCH) $@
+.ENDIF # "$(USE_DEFFILE)==""
+.ENDIF # "$(COM)"=="GCC"
+
+.ELIF "$(GUI)" == "OS2"
+
+# touch creates an empty file, but this is not good for emxomfar, so
+# create a dummy lib here
+ $(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL9VERSIONOBJ)
+ +@echo build of $(SHL9TARGETN) creates $@
+
+.ELSE
+ @echo no ImportLibs on Mac and *ix
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ENDIF
+.ENDIF
+
+# unroll begin
+
+.IF "$(SHL10IMPLIBN)" != ""
+
+.IF "$(UPDATER)"=="YES"
+USELIB10DEPN+=$(SHL10LIBS)
+.ELSE
+.ENDIF
+
+.IF "$(USE_DEFFILE)"!=""
+USE_SHL10TARGET=$(SHL10TARGETN)
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+$(SHL10IMPLIBN): \
+ $(SHL10DEF) \
+ $(USE_SHL10TARGET) \
+ $(USELIB10DEPN) \
+ $(USELIBDEPN)
+.ELSE
+$(SHL10IMPLIBN): \
+ $(SHL10LIBS)
+.ENDIF
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(COM)"=="GCC"
+ @echo no ImportLibs on mingw
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ELSE # "$(COM)=="GCC"
+# bei use_deffile implib von linker erstellt
+.IF "$(USE_DEFFILE)"==""
+ $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL10IMPLIBN) \
+ -def:$(SHL10DEF) )
+.ELSE # "$(USE_DEFFILE)==""
+ @echo build of $(SHL10TARGETN) creates $@
+ @$(TOUCH) $@
+.ENDIF # "$(USE_DEFFILE)==""
+.ENDIF # "$(COM)"=="GCC"
+
+.ELIF "$(GUI)" == "OS2"
+
+# touch creates an empty file, but this is not good for emxomfar, so
+# create a dummy lib here
+ $(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL10VERSIONOBJ)
+ +@echo build of $(SHL10TARGETN) creates $@
+
+.ELSE
+ @echo no ImportLibs on Mac and *ix
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ENDIF
+.ENDIF
+
diff --git a/solenv/inc/_tg_srs.mk b/solenv/inc/_tg_srs.mk
new file mode 100644
index 000000000000..375fab35b800
--- /dev/null
+++ b/solenv/inc/_tg_srs.mk
@@ -0,0 +1,410 @@
+# unroll begin
+
+.IF "$(SRS1NAME)"!=""
+
+$(MISC)/$(TARGET).$(SRS1NAME).dprr: $(LOCALIZE_ME_DEST)
+
+$(MISC)/$(TARGET).$(SRS1NAME).dprr: $(SRC1FILES)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $(MISC)/$(TARGET).$(SRS1NAME).dprr
+ $(COMMAND_ECHO)$(RSC) $(VERBOSITY) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)/$(SRS1NAME).srs} -fo=$@ -p=$(TARGET) $(SRC1FILES)
+
+.IF "$(WITH_LANG)"!=""
+
+$(foreach,i,$(SRC1FILES) $(COMMONMISC)/$(TARGET)/$i) : $$(@:f) $(LOCALIZESDF)
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(COMMONMISC)$/$(PRJNAME)
+ $(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+$(SRS)/$(SRS1NAME).srs: $(LOCALIZE_ME_DEST)
+
+$(SRS)/$(SRS1NAME).srs: $(foreach,i,$(SRC1FILES) $(COMMONMISC)/$(TARGET)/$i)
+.ELSE # "$(WITH_LANG)"!=""
+$(SRS)/$(SRS1NAME).srs: $(SRC1FILES)
+.ENDIF # "$(WITH_LANG)"!=""
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \
+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \
+ -fp=$@.$(INPATH) \
+ $< \
+ )
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+.ENDIF # "$(SRS1NAME)"!=""
+
+# unroll begin
+
+.IF "$(SRS2NAME)"!=""
+
+$(MISC)/$(TARGET).$(SRS2NAME).dprr: $(LOCALIZE_ME_DEST)
+
+$(MISC)/$(TARGET).$(SRS2NAME).dprr: $(SRC2FILES)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $(MISC)/$(TARGET).$(SRS2NAME).dprr
+ $(COMMAND_ECHO)$(RSC) $(VERBOSITY) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)/$(SRS2NAME).srs} -fo=$@ -p=$(TARGET) $(SRC2FILES)
+
+.IF "$(WITH_LANG)"!=""
+
+$(foreach,i,$(SRC2FILES) $(COMMONMISC)/$(TARGET)/$i) : $$(@:f) $(LOCALIZESDF)
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(COMMONMISC)$/$(PRJNAME)
+ $(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+$(SRS)/$(SRS2NAME).srs: $(LOCALIZE_ME_DEST)
+
+$(SRS)/$(SRS2NAME).srs: $(foreach,i,$(SRC2FILES) $(COMMONMISC)/$(TARGET)/$i)
+.ELSE # "$(WITH_LANG)"!=""
+$(SRS)/$(SRS2NAME).srs: $(SRC2FILES)
+.ENDIF # "$(WITH_LANG)"!=""
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \
+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \
+ -fp=$@.$(INPATH) \
+ $< \
+ )
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+.ENDIF # "$(SRS2NAME)"!=""
+
+# unroll begin
+
+.IF "$(SRS3NAME)"!=""
+
+$(MISC)/$(TARGET).$(SRS3NAME).dprr: $(LOCALIZE_ME_DEST)
+
+$(MISC)/$(TARGET).$(SRS3NAME).dprr: $(SRC3FILES)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $(MISC)/$(TARGET).$(SRS3NAME).dprr
+ $(COMMAND_ECHO)$(RSC) $(VERBOSITY) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)/$(SRS3NAME).srs} -fo=$@ -p=$(TARGET) $(SRC3FILES)
+
+.IF "$(WITH_LANG)"!=""
+
+$(foreach,i,$(SRC3FILES) $(COMMONMISC)/$(TARGET)/$i) : $$(@:f) $(LOCALIZESDF)
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(COMMONMISC)$/$(PRJNAME)
+ $(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+$(SRS)/$(SRS3NAME).srs: $(LOCALIZE_ME_DEST)
+
+$(SRS)/$(SRS3NAME).srs: $(foreach,i,$(SRC3FILES) $(COMMONMISC)/$(TARGET)/$i)
+.ELSE # "$(WITH_LANG)"!=""
+$(SRS)/$(SRS3NAME).srs: $(SRC3FILES)
+.ENDIF # "$(WITH_LANG)"!=""
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \
+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \
+ -fp=$@.$(INPATH) \
+ $< \
+ )
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+.ENDIF # "$(SRS3NAME)"!=""
+
+# unroll begin
+
+.IF "$(SRS4NAME)"!=""
+
+$(MISC)/$(TARGET).$(SRS4NAME).dprr: $(LOCALIZE_ME_DEST)
+
+$(MISC)/$(TARGET).$(SRS4NAME).dprr: $(SRC4FILES)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $(MISC)/$(TARGET).$(SRS4NAME).dprr
+ $(COMMAND_ECHO)$(RSC) $(VERBOSITY) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)/$(SRS4NAME).srs} -fo=$@ -p=$(TARGET) $(SRC4FILES)
+
+.IF "$(WITH_LANG)"!=""
+
+$(foreach,i,$(SRC4FILES) $(COMMONMISC)/$(TARGET)/$i) : $$(@:f) $(LOCALIZESDF)
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(COMMONMISC)$/$(PRJNAME)
+ $(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+$(SRS)/$(SRS4NAME).srs: $(LOCALIZE_ME_DEST)
+
+$(SRS)/$(SRS4NAME).srs: $(foreach,i,$(SRC4FILES) $(COMMONMISC)/$(TARGET)/$i)
+.ELSE # "$(WITH_LANG)"!=""
+$(SRS)/$(SRS4NAME).srs: $(SRC4FILES)
+.ENDIF # "$(WITH_LANG)"!=""
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \
+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \
+ -fp=$@.$(INPATH) \
+ $< \
+ )
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+.ENDIF # "$(SRS4NAME)"!=""
+
+# unroll begin
+
+.IF "$(SRS5NAME)"!=""
+
+$(MISC)/$(TARGET).$(SRS5NAME).dprr: $(LOCALIZE_ME_DEST)
+
+$(MISC)/$(TARGET).$(SRS5NAME).dprr: $(SRC5FILES)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $(MISC)/$(TARGET).$(SRS5NAME).dprr
+ $(COMMAND_ECHO)$(RSC) $(VERBOSITY) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)/$(SRS5NAME).srs} -fo=$@ -p=$(TARGET) $(SRC5FILES)
+
+.IF "$(WITH_LANG)"!=""
+
+$(foreach,i,$(SRC5FILES) $(COMMONMISC)/$(TARGET)/$i) : $$(@:f) $(LOCALIZESDF)
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(COMMONMISC)$/$(PRJNAME)
+ $(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+$(SRS)/$(SRS5NAME).srs: $(LOCALIZE_ME_DEST)
+
+$(SRS)/$(SRS5NAME).srs: $(foreach,i,$(SRC5FILES) $(COMMONMISC)/$(TARGET)/$i)
+.ELSE # "$(WITH_LANG)"!=""
+$(SRS)/$(SRS5NAME).srs: $(SRC5FILES)
+.ENDIF # "$(WITH_LANG)"!=""
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \
+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \
+ -fp=$@.$(INPATH) \
+ $< \
+ )
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+.ENDIF # "$(SRS5NAME)"!=""
+
+# unroll begin
+
+.IF "$(SRS6NAME)"!=""
+
+$(MISC)/$(TARGET).$(SRS6NAME).dprr: $(LOCALIZE_ME_DEST)
+
+$(MISC)/$(TARGET).$(SRS6NAME).dprr: $(SRC6FILES)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $(MISC)/$(TARGET).$(SRS6NAME).dprr
+ $(COMMAND_ECHO)$(RSC) $(VERBOSITY) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)/$(SRS6NAME).srs} -fo=$@ -p=$(TARGET) $(SRC6FILES)
+
+.IF "$(WITH_LANG)"!=""
+
+$(foreach,i,$(SRC6FILES) $(COMMONMISC)/$(TARGET)/$i) : $$(@:f) $(LOCALIZESDF)
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(COMMONMISC)$/$(PRJNAME)
+ $(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+$(SRS)/$(SRS6NAME).srs: $(LOCALIZE_ME_DEST)
+
+$(SRS)/$(SRS6NAME).srs: $(foreach,i,$(SRC6FILES) $(COMMONMISC)/$(TARGET)/$i)
+.ELSE # "$(WITH_LANG)"!=""
+$(SRS)/$(SRS6NAME).srs: $(SRC6FILES)
+.ENDIF # "$(WITH_LANG)"!=""
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \
+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \
+ -fp=$@.$(INPATH) \
+ $< \
+ )
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+.ENDIF # "$(SRS6NAME)"!=""
+
+# unroll begin
+
+.IF "$(SRS7NAME)"!=""
+
+$(MISC)/$(TARGET).$(SRS7NAME).dprr: $(LOCALIZE_ME_DEST)
+
+$(MISC)/$(TARGET).$(SRS7NAME).dprr: $(SRC7FILES)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $(MISC)/$(TARGET).$(SRS7NAME).dprr
+ $(COMMAND_ECHO)$(RSC) $(VERBOSITY) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)/$(SRS7NAME).srs} -fo=$@ -p=$(TARGET) $(SRC7FILES)
+
+.IF "$(WITH_LANG)"!=""
+
+$(foreach,i,$(SRC7FILES) $(COMMONMISC)/$(TARGET)/$i) : $$(@:f) $(LOCALIZESDF)
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(COMMONMISC)$/$(PRJNAME)
+ $(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+$(SRS)/$(SRS7NAME).srs: $(LOCALIZE_ME_DEST)
+
+$(SRS)/$(SRS7NAME).srs: $(foreach,i,$(SRC7FILES) $(COMMONMISC)/$(TARGET)/$i)
+.ELSE # "$(WITH_LANG)"!=""
+$(SRS)/$(SRS7NAME).srs: $(SRC7FILES)
+.ENDIF # "$(WITH_LANG)"!=""
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \
+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \
+ -fp=$@.$(INPATH) \
+ $< \
+ )
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+.ENDIF # "$(SRS7NAME)"!=""
+
+# unroll begin
+
+.IF "$(SRS8NAME)"!=""
+
+$(MISC)/$(TARGET).$(SRS8NAME).dprr: $(LOCALIZE_ME_DEST)
+
+$(MISC)/$(TARGET).$(SRS8NAME).dprr: $(SRC8FILES)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $(MISC)/$(TARGET).$(SRS8NAME).dprr
+ $(COMMAND_ECHO)$(RSC) $(VERBOSITY) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)/$(SRS8NAME).srs} -fo=$@ -p=$(TARGET) $(SRC8FILES)
+
+.IF "$(WITH_LANG)"!=""
+
+$(foreach,i,$(SRC8FILES) $(COMMONMISC)/$(TARGET)/$i) : $$(@:f) $(LOCALIZESDF)
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(COMMONMISC)$/$(PRJNAME)
+ $(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+$(SRS)/$(SRS8NAME).srs: $(LOCALIZE_ME_DEST)
+
+$(SRS)/$(SRS8NAME).srs: $(foreach,i,$(SRC8FILES) $(COMMONMISC)/$(TARGET)/$i)
+.ELSE # "$(WITH_LANG)"!=""
+$(SRS)/$(SRS8NAME).srs: $(SRC8FILES)
+.ENDIF # "$(WITH_LANG)"!=""
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \
+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \
+ -fp=$@.$(INPATH) \
+ $< \
+ )
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+.ENDIF # "$(SRS8NAME)"!=""
+
+# unroll begin
+
+.IF "$(SRS9NAME)"!=""
+
+$(MISC)/$(TARGET).$(SRS9NAME).dprr: $(LOCALIZE_ME_DEST)
+
+$(MISC)/$(TARGET).$(SRS9NAME).dprr: $(SRC9FILES)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $(MISC)/$(TARGET).$(SRS9NAME).dprr
+ $(COMMAND_ECHO)$(RSC) $(VERBOSITY) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)/$(SRS9NAME).srs} -fo=$@ -p=$(TARGET) $(SRC9FILES)
+
+.IF "$(WITH_LANG)"!=""
+
+$(foreach,i,$(SRC9FILES) $(COMMONMISC)/$(TARGET)/$i) : $$(@:f) $(LOCALIZESDF)
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(COMMONMISC)$/$(PRJNAME)
+ $(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+$(SRS)/$(SRS9NAME).srs: $(LOCALIZE_ME_DEST)
+
+$(SRS)/$(SRS9NAME).srs: $(foreach,i,$(SRC9FILES) $(COMMONMISC)/$(TARGET)/$i)
+.ELSE # "$(WITH_LANG)"!=""
+$(SRS)/$(SRS9NAME).srs: $(SRC9FILES)
+.ENDIF # "$(WITH_LANG)"!=""
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \
+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \
+ -fp=$@.$(INPATH) \
+ $< \
+ )
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+.ENDIF # "$(SRS9NAME)"!=""
+
+# unroll begin
+
+.IF "$(SRS10NAME)"!=""
+
+$(MISC)/$(TARGET).$(SRS10NAME).dprr: $(LOCALIZE_ME_DEST)
+
+$(MISC)/$(TARGET).$(SRS10NAME).dprr: $(SRC10FILES)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $(MISC)/$(TARGET).$(SRS10NAME).dprr
+ $(COMMAND_ECHO)$(RSC) $(VERBOSITY) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)/$(SRS10NAME).srs} -fo=$@ -p=$(TARGET) $(SRC10FILES)
+
+.IF "$(WITH_LANG)"!=""
+
+$(foreach,i,$(SRC10FILES) $(COMMONMISC)/$(TARGET)/$i) : $$(@:f) $(LOCALIZESDF)
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(COMMONMISC)$/$(PRJNAME)
+ $(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+$(SRS)/$(SRS10NAME).srs: $(LOCALIZE_ME_DEST)
+
+$(SRS)/$(SRS10NAME).srs: $(foreach,i,$(SRC10FILES) $(COMMONMISC)/$(TARGET)/$i)
+.ELSE # "$(WITH_LANG)"!=""
+$(SRS)/$(SRS10NAME).srs: $(SRC10FILES)
+.ENDIF # "$(WITH_LANG)"!=""
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \
+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \
+ -fp=$@.$(INPATH) \
+ $< \
+ )
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+.ENDIF # "$(SRS10NAME)"!=""
+
diff --git a/solenv/inc/_tg_zip.mk b/solenv/inc/_tg_zip.mk
new file mode 100644
index 000000000000..608819da6596
--- /dev/null
+++ b/solenv/inc/_tg_zip.mk
@@ -0,0 +1,1230 @@
+# unroll begin
+
+.IF "$(GUI)"=="WNT"
+command_seperator=&&
+#command_seperator=^
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+.ELIF "$(GUI)"=="OS2"
+command_seperator=&&
+.ELSE
+command_seperator=;
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+
+.ENDIF
+
+.IF "$(ZIP1TARGET)"!=""
+
+ZIP1EXT*=.zip
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP1LIST:s/LANGDIR//)" == "$(ZIP1LIST)"
+ZIP1TARGETN=$(COMMONBIN)/$(ZIP1TARGET)$(ZIP1EXT)
+.ELSE
+ZIP1TARGETN=$(foreach,i,$(zip1alllangiso) $(COMMONBIN)/$(ZIP1TARGET)_$i$(ZIP1EXT) )
+.ENDIF
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP1LIST:s/LANGDIR//)" == "$(ZIP1LIST)"
+ZIP1TARGETN=$(BIN)/$(ZIP1TARGET)$(ZIP1EXT)
+.ELSE
+ZIP1TARGETN=$(foreach,i,$(zip1alllangiso) $(BIN)/$(ZIP1TARGET)_$i$(ZIP1EXT) )
+.ENDIF
+.ENDIF # "$(common_build_zip)"!=""
+ZIP1DEPFILE=$(subst,$(COMMON_OUTDIR),$(OUTPATH) $(subst,/bin/,/misc/ $(ZIP1TARGETN:s/$(ZIP1EXT)/.dpzz/)))
+ZIPDEPFILES+=$(ZIP1DEPFILE)
+
+ZIP1DIR*=$(ZIPDIR)
+ZIP1FLAGS*=$(ZIPFLAGS)
+.IF "$(zip1generatedlangs)"!=""
+zip1langdirs*=$(alllangiso)
+.ELSE # "$(zip1generatedlangs)"!=""
+zip1langdirs:=$(shell @-test -d {$(subst,/$(LANGDIR), $(null,$(ZIP1DIR) . $(ZIP1DIR)))}/ && find {$(subst,/$(LANGDIR), $(null,$(ZIP1DIR) . $(ZIP1DIR)))}/ -type d ! -name CVS ! -name ".svn" ! -name "." | sed "s/\.\/\///" | sed "s/\.\///" )
+.ENDIF # "$(zip1generatedlangs)"!=""
+.IF "$(ZIP1FORCEALLLANG)"!=""
+zip1alllangiso:=$(foreach,i,$(completelangiso) $(foreach,j,$(zip1langdirs) $(eq,$i,$j $i $(NULL))))
+.ELSE # "$(ZIP1ALLLANG)" != ""
+zip1alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(zip1langdirs) $(eq,$i,$j $i $(NULL))))
+.ENDIF # "$(ZIP1ALLLANG)" != ""
+.ENDIF # "$(ZIP1TARGET)"!=""
+
+.IF "$(ZIP1TARGETN)"!=""
+
+ZIP1TMP:=$(mktmp iii)
+
+$(MISC)/$(TARGET).$(PWD:f).$(ZIP1TARGET).dpzz : $(ZIP1TARGETN)
+
+.IF "$(common_build_zip)"!=""
+ZIP1HELPVAR=$(COMMONBIN)/$(ZIP1TARGET)
+.ELSE # "$(common_build_zip)"!=""
+ZIP1HELPVAR=$(BIN)/$(ZIP1TARGET)
+.ENDIF # "$(common_build_zip)"!=""
+
+$(ZIP1DEPFILE) :
+ @echo # > $(MISC)/$(@:f)
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP1DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP1DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP1DIR))) $(command_seperator) $(ZIPDEP) $(ZIP1FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP1DIR)))/ $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP1EXT)/))) $(foreach,j,$(ZIP1LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP1TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP1DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP1FLAGS) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP1EXT)/))) $(foreach,j,$(ZIP1LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP1TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP1DIR)" != ""
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP1DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP1DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP1DIR))) $(command_seperator) $(ZIPDEP) $(ZIP1FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP1DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP1EXT)/)) $(foreach,j,$(ZIP1LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP1TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP1DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP1FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP1EXT)/)) $(foreach,j,$(ZIP1LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP1TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP1DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+ @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f)
+
+
+$(ZIP1TARGETN) : delzip $(ZIP1DEPS)
+ @echo "Making: " $(@:f)
+ @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@))
+ @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles
+ @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) )
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP1DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP1TMP).$(ZIP1TARGET){$(subst,$(ZIP1HELPVAR),_ $(@:db))}$(ZIP1EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP1HELPVAR)_, $(@:db))} $(ZIP1DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP1FLAGS) $(ZIP1TMP).$(ZIP1TARGET){$(subst,$(ZIP1HELPVAR),_ $(@:db))}$(ZIP1EXT) $(subst,LANGDIR_away/, $(ZIP1LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP1TMP).$(ZIP1TARGET){$(subst,$(ZIP1HELPVAR),_ $(@:db))}$(ZIP1EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP1TMP).$(ZIP1TARGET){$(subst,$(ZIP1HELPVAR),_ $(@:db))}$(ZIP1EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP1TMP).$(ZIP1TARGET){$(subst,$(ZIP1HELPVAR),_ $(@:db))}$(ZIP1EXT) $@.$(INPATH)
+ $(COMMAND_ECHO)$(RM) $(ZIP1TMP).$(ZIP1TARGET){$(subst,$(ZIP1HELPVAR),_ $(@:db))}$(ZIP1EXT)
+.ELSE # "$(ZIP1DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP1FLAGS) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(foreach,j,$(ZIP1LIST) $(subst,LANGDIR,{$(subst,$(ZIP1HELPVAR)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) \
+ $(FI)
+ @@-$(GNUCOPY) -p $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $@.$(INPATH)
+ @-$(RM) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+.ENDIF # "$(ZIP1DIR)" != ""
+ @@-$(RM) $@
+ @$(IFEXIST) $@.$(INPATH) $(THEN) $(RENAME:s/+//) $@.$(INPATH) $@ $(FI)
+# @$(IFEXIST) $@ $(THEN) $(TOUCH) $@ $(FI) # even if it's not used...
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP1DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP1TMP).$(ZIP1TARGET){$(subst,$(ZIP1HELPVAR),_ $(@:db))}$(ZIP1EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP1HELPVAR)_, $(@:db))} $(ZIP1DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP1FLAGS) $(ZIP1TMP).$(ZIP1TARGET){$(subst,$(ZIP1HELPVAR),_ $(@:db))}$(ZIP1EXT) $(subst,LANGDIR_away/, $(ZIP1LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP1TMP).$(ZIP1TARGET){$(subst,$(ZIP1HELPVAR),_ $(@:db))}$(ZIP1EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP1TMP).$(ZIP1TARGET){$(subst,$(ZIP1HELPVAR),_ $(@:db))}$(ZIP1EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP1TMP).$(ZIP1TARGET){$(subst,$(ZIP1HELPVAR),_ $(@:db))}$(ZIP1EXT) $@
+ $(COMMAND_ECHO)$(RM) $(ZIP1TMP).$(ZIP1TARGET){$(subst,$(ZIP1HELPVAR),_ $(@:db))}$(ZIP1EXT)
+.ELSE # "$(ZIP1DIR)" != ""
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP1FLAGS) $@ $(foreach,j,$(ZIP1LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP1TARGET)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $@ \
+ $(FI)
+.ENDIF # "$(ZIP1DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+.ENDIF
+
+# unroll begin
+
+.IF "$(GUI)"=="WNT"
+command_seperator=&&
+#command_seperator=^
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+.ELIF "$(GUI)"=="OS2"
+command_seperator=&&
+.ELSE
+command_seperator=;
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+
+.ENDIF
+
+.IF "$(ZIP2TARGET)"!=""
+
+ZIP2EXT*=.zip
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP2LIST:s/LANGDIR//)" == "$(ZIP2LIST)"
+ZIP2TARGETN=$(COMMONBIN)/$(ZIP2TARGET)$(ZIP2EXT)
+.ELSE
+ZIP2TARGETN=$(foreach,i,$(zip2alllangiso) $(COMMONBIN)/$(ZIP2TARGET)_$i$(ZIP2EXT) )
+.ENDIF
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP2LIST:s/LANGDIR//)" == "$(ZIP2LIST)"
+ZIP2TARGETN=$(BIN)/$(ZIP2TARGET)$(ZIP2EXT)
+.ELSE
+ZIP2TARGETN=$(foreach,i,$(zip2alllangiso) $(BIN)/$(ZIP2TARGET)_$i$(ZIP2EXT) )
+.ENDIF
+.ENDIF # "$(common_build_zip)"!=""
+ZIP2DEPFILE=$(subst,$(COMMON_OUTDIR),$(OUTPATH) $(subst,/bin/,/misc/ $(ZIP2TARGETN:s/$(ZIP2EXT)/.dpzz/)))
+ZIPDEPFILES+=$(ZIP2DEPFILE)
+
+ZIP2DIR*=$(ZIPDIR)
+ZIP2FLAGS*=$(ZIPFLAGS)
+.IF "$(zip2generatedlangs)"!=""
+zip2langdirs*=$(alllangiso)
+.ELSE # "$(zip2generatedlangs)"!=""
+zip2langdirs:=$(shell @-test -d {$(subst,/$(LANGDIR), $(null,$(ZIP2DIR) . $(ZIP2DIR)))}/ && find {$(subst,/$(LANGDIR), $(null,$(ZIP2DIR) . $(ZIP2DIR)))}/ -type d ! -name CVS ! -name ".svn" ! -name "." | sed "s/\.\/\///" | sed "s/\.\///" )
+.ENDIF # "$(zip2generatedlangs)"!=""
+.IF "$(ZIP2FORCEALLLANG)"!=""
+zip2alllangiso:=$(foreach,i,$(completelangiso) $(foreach,j,$(zip2langdirs) $(eq,$i,$j $i $(NULL))))
+.ELSE # "$(ZIP2ALLLANG)" != ""
+zip2alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(zip2langdirs) $(eq,$i,$j $i $(NULL))))
+.ENDIF # "$(ZIP2ALLLANG)" != ""
+.ENDIF # "$(ZIP2TARGET)"!=""
+
+.IF "$(ZIP2TARGETN)"!=""
+
+ZIP2TMP:=$(mktmp iii)
+
+$(MISC)/$(TARGET).$(PWD:f).$(ZIP2TARGET).dpzz : $(ZIP2TARGETN)
+
+.IF "$(common_build_zip)"!=""
+ZIP2HELPVAR=$(COMMONBIN)/$(ZIP2TARGET)
+.ELSE # "$(common_build_zip)"!=""
+ZIP2HELPVAR=$(BIN)/$(ZIP2TARGET)
+.ENDIF # "$(common_build_zip)"!=""
+
+$(ZIP2DEPFILE) :
+ @echo # > $(MISC)/$(@:f)
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP2DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP2DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP2DIR))) $(command_seperator) $(ZIPDEP) $(ZIP2FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP2DIR)))/ $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP2EXT)/))) $(foreach,j,$(ZIP2LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP2TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP2DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP2FLAGS) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP2EXT)/))) $(foreach,j,$(ZIP2LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP2TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP2DIR)" != ""
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP2DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP2DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP2DIR))) $(command_seperator) $(ZIPDEP) $(ZIP2FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP2DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP2EXT)/)) $(foreach,j,$(ZIP2LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP2TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP2DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP2FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP2EXT)/)) $(foreach,j,$(ZIP2LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP2TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP2DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+ @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f)
+
+
+$(ZIP2TARGETN) : delzip $(ZIP2DEPS)
+ @echo "Making: " $(@:f)
+ @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@))
+ @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles
+ @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) )
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP2DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP2TMP).$(ZIP2TARGET){$(subst,$(ZIP2HELPVAR),_ $(@:db))}$(ZIP2EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP2HELPVAR)_, $(@:db))} $(ZIP2DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP2FLAGS) $(ZIP2TMP).$(ZIP2TARGET){$(subst,$(ZIP2HELPVAR),_ $(@:db))}$(ZIP2EXT) $(subst,LANGDIR_away/, $(ZIP2LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP2TMP).$(ZIP2TARGET){$(subst,$(ZIP2HELPVAR),_ $(@:db))}$(ZIP2EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP2TMP).$(ZIP2TARGET){$(subst,$(ZIP2HELPVAR),_ $(@:db))}$(ZIP2EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP2TMP).$(ZIP2TARGET){$(subst,$(ZIP2HELPVAR),_ $(@:db))}$(ZIP2EXT) $@.$(INPATH)
+ $(COMMAND_ECHO)$(RM) $(ZIP2TMP).$(ZIP2TARGET){$(subst,$(ZIP2HELPVAR),_ $(@:db))}$(ZIP2EXT)
+.ELSE # "$(ZIP2DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP2FLAGS) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(foreach,j,$(ZIP2LIST) $(subst,LANGDIR,{$(subst,$(ZIP2HELPVAR)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) \
+ $(FI)
+ @@-$(GNUCOPY) -p $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $@.$(INPATH)
+ @-$(RM) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+.ENDIF # "$(ZIP2DIR)" != ""
+ @@-$(RM) $@
+ @$(IFEXIST) $@.$(INPATH) $(THEN) $(RENAME:s/+//) $@.$(INPATH) $@ $(FI)
+# @$(IFEXIST) $@ $(THEN) $(TOUCH) $@ $(FI) # even if it's not used...
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP2DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP2TMP).$(ZIP2TARGET){$(subst,$(ZIP2HELPVAR),_ $(@:db))}$(ZIP2EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP2HELPVAR)_, $(@:db))} $(ZIP2DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP2FLAGS) $(ZIP2TMP).$(ZIP2TARGET){$(subst,$(ZIP2HELPVAR),_ $(@:db))}$(ZIP2EXT) $(subst,LANGDIR_away/, $(ZIP2LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP2TMP).$(ZIP2TARGET){$(subst,$(ZIP2HELPVAR),_ $(@:db))}$(ZIP2EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP2TMP).$(ZIP2TARGET){$(subst,$(ZIP2HELPVAR),_ $(@:db))}$(ZIP2EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP2TMP).$(ZIP2TARGET){$(subst,$(ZIP2HELPVAR),_ $(@:db))}$(ZIP2EXT) $@
+ $(COMMAND_ECHO)$(RM) $(ZIP2TMP).$(ZIP2TARGET){$(subst,$(ZIP2HELPVAR),_ $(@:db))}$(ZIP2EXT)
+.ELSE # "$(ZIP2DIR)" != ""
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP2FLAGS) $@ $(foreach,j,$(ZIP2LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP2TARGET)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $@ \
+ $(FI)
+.ENDIF # "$(ZIP2DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+.ENDIF
+
+# unroll begin
+
+.IF "$(GUI)"=="WNT"
+command_seperator=&&
+#command_seperator=^
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+.ELIF "$(GUI)"=="OS2"
+command_seperator=&&
+.ELSE
+command_seperator=;
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+
+.ENDIF
+
+.IF "$(ZIP3TARGET)"!=""
+
+ZIP3EXT*=.zip
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP3LIST:s/LANGDIR//)" == "$(ZIP3LIST)"
+ZIP3TARGETN=$(COMMONBIN)/$(ZIP3TARGET)$(ZIP3EXT)
+.ELSE
+ZIP3TARGETN=$(foreach,i,$(zip3alllangiso) $(COMMONBIN)/$(ZIP3TARGET)_$i$(ZIP3EXT) )
+.ENDIF
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP3LIST:s/LANGDIR//)" == "$(ZIP3LIST)"
+ZIP3TARGETN=$(BIN)/$(ZIP3TARGET)$(ZIP3EXT)
+.ELSE
+ZIP3TARGETN=$(foreach,i,$(zip3alllangiso) $(BIN)/$(ZIP3TARGET)_$i$(ZIP3EXT) )
+.ENDIF
+.ENDIF # "$(common_build_zip)"!=""
+ZIP3DEPFILE=$(subst,$(COMMON_OUTDIR),$(OUTPATH) $(subst,/bin/,/misc/ $(ZIP3TARGETN:s/$(ZIP3EXT)/.dpzz/)))
+ZIPDEPFILES+=$(ZIP3DEPFILE)
+
+ZIP3DIR*=$(ZIPDIR)
+ZIP3FLAGS*=$(ZIPFLAGS)
+.IF "$(zip3generatedlangs)"!=""
+zip3langdirs*=$(alllangiso)
+.ELSE # "$(zip3generatedlangs)"!=""
+zip3langdirs:=$(shell @-test -d {$(subst,/$(LANGDIR), $(null,$(ZIP3DIR) . $(ZIP3DIR)))}/ && find {$(subst,/$(LANGDIR), $(null,$(ZIP3DIR) . $(ZIP3DIR)))}/ -type d ! -name CVS ! -name ".svn" ! -name "." | sed "s/\.\/\///" | sed "s/\.\///" )
+.ENDIF # "$(zip3generatedlangs)"!=""
+.IF "$(ZIP3FORCEALLLANG)"!=""
+zip3alllangiso:=$(foreach,i,$(completelangiso) $(foreach,j,$(zip3langdirs) $(eq,$i,$j $i $(NULL))))
+.ELSE # "$(ZIP3ALLLANG)" != ""
+zip3alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(zip3langdirs) $(eq,$i,$j $i $(NULL))))
+.ENDIF # "$(ZIP3ALLLANG)" != ""
+.ENDIF # "$(ZIP3TARGET)"!=""
+
+.IF "$(ZIP3TARGETN)"!=""
+
+ZIP3TMP:=$(mktmp iii)
+
+$(MISC)/$(TARGET).$(PWD:f).$(ZIP3TARGET).dpzz : $(ZIP3TARGETN)
+
+.IF "$(common_build_zip)"!=""
+ZIP3HELPVAR=$(COMMONBIN)/$(ZIP3TARGET)
+.ELSE # "$(common_build_zip)"!=""
+ZIP3HELPVAR=$(BIN)/$(ZIP3TARGET)
+.ENDIF # "$(common_build_zip)"!=""
+
+$(ZIP3DEPFILE) :
+ @echo # > $(MISC)/$(@:f)
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP3DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP3DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP3DIR))) $(command_seperator) $(ZIPDEP) $(ZIP3FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP3DIR)))/ $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP3EXT)/))) $(foreach,j,$(ZIP3LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP3TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP3DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP3FLAGS) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP3EXT)/))) $(foreach,j,$(ZIP3LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP3TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP3DIR)" != ""
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP3DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP3DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP3DIR))) $(command_seperator) $(ZIPDEP) $(ZIP3FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP3DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP3EXT)/)) $(foreach,j,$(ZIP3LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP3TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP3DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP3FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP3EXT)/)) $(foreach,j,$(ZIP3LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP3TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP3DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+ @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f)
+
+
+$(ZIP3TARGETN) : delzip $(ZIP3DEPS)
+ @echo "Making: " $(@:f)
+ @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@))
+ @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles
+ @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) )
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP3DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP3TMP).$(ZIP3TARGET){$(subst,$(ZIP3HELPVAR),_ $(@:db))}$(ZIP3EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP3HELPVAR)_, $(@:db))} $(ZIP3DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP3FLAGS) $(ZIP3TMP).$(ZIP3TARGET){$(subst,$(ZIP3HELPVAR),_ $(@:db))}$(ZIP3EXT) $(subst,LANGDIR_away/, $(ZIP3LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP3TMP).$(ZIP3TARGET){$(subst,$(ZIP3HELPVAR),_ $(@:db))}$(ZIP3EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP3TMP).$(ZIP3TARGET){$(subst,$(ZIP3HELPVAR),_ $(@:db))}$(ZIP3EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP3TMP).$(ZIP3TARGET){$(subst,$(ZIP3HELPVAR),_ $(@:db))}$(ZIP3EXT) $@.$(INPATH)
+ $(COMMAND_ECHO)$(RM) $(ZIP3TMP).$(ZIP3TARGET){$(subst,$(ZIP3HELPVAR),_ $(@:db))}$(ZIP3EXT)
+.ELSE # "$(ZIP3DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP3FLAGS) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(foreach,j,$(ZIP3LIST) $(subst,LANGDIR,{$(subst,$(ZIP3HELPVAR)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) \
+ $(FI)
+ @@-$(GNUCOPY) -p $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $@.$(INPATH)
+ @-$(RM) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+.ENDIF # "$(ZIP3DIR)" != ""
+ @@-$(RM) $@
+ @$(IFEXIST) $@.$(INPATH) $(THEN) $(RENAME:s/+//) $@.$(INPATH) $@ $(FI)
+# @$(IFEXIST) $@ $(THEN) $(TOUCH) $@ $(FI) # even if it's not used...
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP3DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP3TMP).$(ZIP3TARGET){$(subst,$(ZIP3HELPVAR),_ $(@:db))}$(ZIP3EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP3HELPVAR)_, $(@:db))} $(ZIP3DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP3FLAGS) $(ZIP3TMP).$(ZIP3TARGET){$(subst,$(ZIP3HELPVAR),_ $(@:db))}$(ZIP3EXT) $(subst,LANGDIR_away/, $(ZIP3LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP3TMP).$(ZIP3TARGET){$(subst,$(ZIP3HELPVAR),_ $(@:db))}$(ZIP3EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP3TMP).$(ZIP3TARGET){$(subst,$(ZIP3HELPVAR),_ $(@:db))}$(ZIP3EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP3TMP).$(ZIP3TARGET){$(subst,$(ZIP3HELPVAR),_ $(@:db))}$(ZIP3EXT) $@
+ $(COMMAND_ECHO)$(RM) $(ZIP3TMP).$(ZIP3TARGET){$(subst,$(ZIP3HELPVAR),_ $(@:db))}$(ZIP3EXT)
+.ELSE # "$(ZIP3DIR)" != ""
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP3FLAGS) $@ $(foreach,j,$(ZIP3LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP3TARGET)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $@ \
+ $(FI)
+.ENDIF # "$(ZIP3DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+.ENDIF
+
+# unroll begin
+
+.IF "$(GUI)"=="WNT"
+command_seperator=&&
+#command_seperator=^
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+.ELIF "$(GUI)"=="OS2"
+command_seperator=&&
+.ELSE
+command_seperator=;
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+
+.ENDIF
+
+.IF "$(ZIP4TARGET)"!=""
+
+ZIP4EXT*=.zip
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP4LIST:s/LANGDIR//)" == "$(ZIP4LIST)"
+ZIP4TARGETN=$(COMMONBIN)/$(ZIP4TARGET)$(ZIP4EXT)
+.ELSE
+ZIP4TARGETN=$(foreach,i,$(zip4alllangiso) $(COMMONBIN)/$(ZIP4TARGET)_$i$(ZIP4EXT) )
+.ENDIF
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP4LIST:s/LANGDIR//)" == "$(ZIP4LIST)"
+ZIP4TARGETN=$(BIN)/$(ZIP4TARGET)$(ZIP4EXT)
+.ELSE
+ZIP4TARGETN=$(foreach,i,$(zip4alllangiso) $(BIN)/$(ZIP4TARGET)_$i$(ZIP4EXT) )
+.ENDIF
+.ENDIF # "$(common_build_zip)"!=""
+ZIP4DEPFILE=$(subst,$(COMMON_OUTDIR),$(OUTPATH) $(subst,/bin/,/misc/ $(ZIP4TARGETN:s/$(ZIP4EXT)/.dpzz/)))
+ZIPDEPFILES+=$(ZIP4DEPFILE)
+
+ZIP4DIR*=$(ZIPDIR)
+ZIP4FLAGS*=$(ZIPFLAGS)
+.IF "$(zip4generatedlangs)"!=""
+zip4langdirs*=$(alllangiso)
+.ELSE # "$(zip4generatedlangs)"!=""
+zip4langdirs:=$(shell @-test -d {$(subst,/$(LANGDIR), $(null,$(ZIP4DIR) . $(ZIP4DIR)))}/ && find {$(subst,/$(LANGDIR), $(null,$(ZIP4DIR) . $(ZIP4DIR)))}/ -type d ! -name CVS ! -name ".svn" ! -name "." | sed "s/\.\/\///" | sed "s/\.\///" )
+.ENDIF # "$(zip4generatedlangs)"!=""
+.IF "$(ZIP4FORCEALLLANG)"!=""
+zip4alllangiso:=$(foreach,i,$(completelangiso) $(foreach,j,$(zip4langdirs) $(eq,$i,$j $i $(NULL))))
+.ELSE # "$(ZIP4ALLLANG)" != ""
+zip4alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(zip4langdirs) $(eq,$i,$j $i $(NULL))))
+.ENDIF # "$(ZIP4ALLLANG)" != ""
+.ENDIF # "$(ZIP4TARGET)"!=""
+
+.IF "$(ZIP4TARGETN)"!=""
+
+ZIP4TMP:=$(mktmp iii)
+
+$(MISC)/$(TARGET).$(PWD:f).$(ZIP4TARGET).dpzz : $(ZIP4TARGETN)
+
+.IF "$(common_build_zip)"!=""
+ZIP4HELPVAR=$(COMMONBIN)/$(ZIP4TARGET)
+.ELSE # "$(common_build_zip)"!=""
+ZIP4HELPVAR=$(BIN)/$(ZIP4TARGET)
+.ENDIF # "$(common_build_zip)"!=""
+
+$(ZIP4DEPFILE) :
+ @echo # > $(MISC)/$(@:f)
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP4DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP4DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP4DIR))) $(command_seperator) $(ZIPDEP) $(ZIP4FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP4DIR)))/ $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP4EXT)/))) $(foreach,j,$(ZIP4LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP4TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP4DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP4FLAGS) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP4EXT)/))) $(foreach,j,$(ZIP4LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP4TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP4DIR)" != ""
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP4DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP4DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP4DIR))) $(command_seperator) $(ZIPDEP) $(ZIP4FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP4DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP4EXT)/)) $(foreach,j,$(ZIP4LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP4TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP4DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP4FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP4EXT)/)) $(foreach,j,$(ZIP4LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP4TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP4DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+ @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f)
+
+
+$(ZIP4TARGETN) : delzip $(ZIP4DEPS)
+ @echo "Making: " $(@:f)
+ @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@))
+ @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles
+ @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) )
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP4DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP4TMP).$(ZIP4TARGET){$(subst,$(ZIP4HELPVAR),_ $(@:db))}$(ZIP4EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP4HELPVAR)_, $(@:db))} $(ZIP4DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP4FLAGS) $(ZIP4TMP).$(ZIP4TARGET){$(subst,$(ZIP4HELPVAR),_ $(@:db))}$(ZIP4EXT) $(subst,LANGDIR_away/, $(ZIP4LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP4TMP).$(ZIP4TARGET){$(subst,$(ZIP4HELPVAR),_ $(@:db))}$(ZIP4EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP4TMP).$(ZIP4TARGET){$(subst,$(ZIP4HELPVAR),_ $(@:db))}$(ZIP4EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP4TMP).$(ZIP4TARGET){$(subst,$(ZIP4HELPVAR),_ $(@:db))}$(ZIP4EXT) $@.$(INPATH)
+ $(COMMAND_ECHO)$(RM) $(ZIP4TMP).$(ZIP4TARGET){$(subst,$(ZIP4HELPVAR),_ $(@:db))}$(ZIP4EXT)
+.ELSE # "$(ZIP4DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP4FLAGS) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(foreach,j,$(ZIP4LIST) $(subst,LANGDIR,{$(subst,$(ZIP4HELPVAR)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) \
+ $(FI)
+ @@-$(GNUCOPY) -p $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $@.$(INPATH)
+ @-$(RM) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+.ENDIF # "$(ZIP4DIR)" != ""
+ @@-$(RM) $@
+ @$(IFEXIST) $@.$(INPATH) $(THEN) $(RENAME:s/+//) $@.$(INPATH) $@ $(FI)
+# @$(IFEXIST) $@ $(THEN) $(TOUCH) $@ $(FI) # even if it's not used...
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP4DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP4TMP).$(ZIP4TARGET){$(subst,$(ZIP4HELPVAR),_ $(@:db))}$(ZIP4EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP4HELPVAR)_, $(@:db))} $(ZIP4DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP4FLAGS) $(ZIP4TMP).$(ZIP4TARGET){$(subst,$(ZIP4HELPVAR),_ $(@:db))}$(ZIP4EXT) $(subst,LANGDIR_away/, $(ZIP4LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP4TMP).$(ZIP4TARGET){$(subst,$(ZIP4HELPVAR),_ $(@:db))}$(ZIP4EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP4TMP).$(ZIP4TARGET){$(subst,$(ZIP4HELPVAR),_ $(@:db))}$(ZIP4EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP4TMP).$(ZIP4TARGET){$(subst,$(ZIP4HELPVAR),_ $(@:db))}$(ZIP4EXT) $@
+ $(COMMAND_ECHO)$(RM) $(ZIP4TMP).$(ZIP4TARGET){$(subst,$(ZIP4HELPVAR),_ $(@:db))}$(ZIP4EXT)
+.ELSE # "$(ZIP4DIR)" != ""
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP4FLAGS) $@ $(foreach,j,$(ZIP4LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP4TARGET)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $@ \
+ $(FI)
+.ENDIF # "$(ZIP4DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+.ENDIF
+
+# unroll begin
+
+.IF "$(GUI)"=="WNT"
+command_seperator=&&
+#command_seperator=^
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+.ELIF "$(GUI)"=="OS2"
+command_seperator=&&
+.ELSE
+command_seperator=;
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+
+.ENDIF
+
+.IF "$(ZIP5TARGET)"!=""
+
+ZIP5EXT*=.zip
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP5LIST:s/LANGDIR//)" == "$(ZIP5LIST)"
+ZIP5TARGETN=$(COMMONBIN)/$(ZIP5TARGET)$(ZIP5EXT)
+.ELSE
+ZIP5TARGETN=$(foreach,i,$(zip5alllangiso) $(COMMONBIN)/$(ZIP5TARGET)_$i$(ZIP5EXT) )
+.ENDIF
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP5LIST:s/LANGDIR//)" == "$(ZIP5LIST)"
+ZIP5TARGETN=$(BIN)/$(ZIP5TARGET)$(ZIP5EXT)
+.ELSE
+ZIP5TARGETN=$(foreach,i,$(zip5alllangiso) $(BIN)/$(ZIP5TARGET)_$i$(ZIP5EXT) )
+.ENDIF
+.ENDIF # "$(common_build_zip)"!=""
+ZIP5DEPFILE=$(subst,$(COMMON_OUTDIR),$(OUTPATH) $(subst,/bin/,/misc/ $(ZIP5TARGETN:s/$(ZIP5EXT)/.dpzz/)))
+ZIPDEPFILES+=$(ZIP5DEPFILE)
+
+ZIP5DIR*=$(ZIPDIR)
+ZIP5FLAGS*=$(ZIPFLAGS)
+.IF "$(zip5generatedlangs)"!=""
+zip5langdirs*=$(alllangiso)
+.ELSE # "$(zip5generatedlangs)"!=""
+zip5langdirs:=$(shell @-test -d {$(subst,/$(LANGDIR), $(null,$(ZIP5DIR) . $(ZIP5DIR)))}/ && find {$(subst,/$(LANGDIR), $(null,$(ZIP5DIR) . $(ZIP5DIR)))}/ -type d ! -name CVS ! -name ".svn" ! -name "." | sed "s/\.\/\///" | sed "s/\.\///" )
+.ENDIF # "$(zip5generatedlangs)"!=""
+.IF "$(ZIP5FORCEALLLANG)"!=""
+zip5alllangiso:=$(foreach,i,$(completelangiso) $(foreach,j,$(zip5langdirs) $(eq,$i,$j $i $(NULL))))
+.ELSE # "$(ZIP5ALLLANG)" != ""
+zip5alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(zip5langdirs) $(eq,$i,$j $i $(NULL))))
+.ENDIF # "$(ZIP5ALLLANG)" != ""
+.ENDIF # "$(ZIP5TARGET)"!=""
+
+.IF "$(ZIP5TARGETN)"!=""
+
+ZIP5TMP:=$(mktmp iii)
+
+$(MISC)/$(TARGET).$(PWD:f).$(ZIP5TARGET).dpzz : $(ZIP5TARGETN)
+
+.IF "$(common_build_zip)"!=""
+ZIP5HELPVAR=$(COMMONBIN)/$(ZIP5TARGET)
+.ELSE # "$(common_build_zip)"!=""
+ZIP5HELPVAR=$(BIN)/$(ZIP5TARGET)
+.ENDIF # "$(common_build_zip)"!=""
+
+$(ZIP5DEPFILE) :
+ @echo # > $(MISC)/$(@:f)
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP5DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP5DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP5DIR))) $(command_seperator) $(ZIPDEP) $(ZIP5FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP5DIR)))/ $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP5EXT)/))) $(foreach,j,$(ZIP5LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP5TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP5DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP5FLAGS) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP5EXT)/))) $(foreach,j,$(ZIP5LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP5TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP5DIR)" != ""
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP5DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP5DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP5DIR))) $(command_seperator) $(ZIPDEP) $(ZIP5FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP5DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP5EXT)/)) $(foreach,j,$(ZIP5LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP5TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP5DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP5FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP5EXT)/)) $(foreach,j,$(ZIP5LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP5TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP5DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+ @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f)
+
+
+$(ZIP5TARGETN) : delzip $(ZIP5DEPS)
+ @echo "Making: " $(@:f)
+ @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@))
+ @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles
+ @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) )
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP5DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP5TMP).$(ZIP5TARGET){$(subst,$(ZIP5HELPVAR),_ $(@:db))}$(ZIP5EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP5HELPVAR)_, $(@:db))} $(ZIP5DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP5FLAGS) $(ZIP5TMP).$(ZIP5TARGET){$(subst,$(ZIP5HELPVAR),_ $(@:db))}$(ZIP5EXT) $(subst,LANGDIR_away/, $(ZIP5LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP5TMP).$(ZIP5TARGET){$(subst,$(ZIP5HELPVAR),_ $(@:db))}$(ZIP5EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP5TMP).$(ZIP5TARGET){$(subst,$(ZIP5HELPVAR),_ $(@:db))}$(ZIP5EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP5TMP).$(ZIP5TARGET){$(subst,$(ZIP5HELPVAR),_ $(@:db))}$(ZIP5EXT) $@.$(INPATH)
+ $(COMMAND_ECHO)$(RM) $(ZIP5TMP).$(ZIP5TARGET){$(subst,$(ZIP5HELPVAR),_ $(@:db))}$(ZIP5EXT)
+.ELSE # "$(ZIP5DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP5FLAGS) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(foreach,j,$(ZIP5LIST) $(subst,LANGDIR,{$(subst,$(ZIP5HELPVAR)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) \
+ $(FI)
+ @@-$(GNUCOPY) -p $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $@.$(INPATH)
+ @-$(RM) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+.ENDIF # "$(ZIP5DIR)" != ""
+ @@-$(RM) $@
+ @$(IFEXIST) $@.$(INPATH) $(THEN) $(RENAME:s/+//) $@.$(INPATH) $@ $(FI)
+# @$(IFEXIST) $@ $(THEN) $(TOUCH) $@ $(FI) # even if it's not used...
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP5DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP5TMP).$(ZIP5TARGET){$(subst,$(ZIP5HELPVAR),_ $(@:db))}$(ZIP5EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP5HELPVAR)_, $(@:db))} $(ZIP5DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP5FLAGS) $(ZIP5TMP).$(ZIP5TARGET){$(subst,$(ZIP5HELPVAR),_ $(@:db))}$(ZIP5EXT) $(subst,LANGDIR_away/, $(ZIP5LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP5TMP).$(ZIP5TARGET){$(subst,$(ZIP5HELPVAR),_ $(@:db))}$(ZIP5EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP5TMP).$(ZIP5TARGET){$(subst,$(ZIP5HELPVAR),_ $(@:db))}$(ZIP5EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP5TMP).$(ZIP5TARGET){$(subst,$(ZIP5HELPVAR),_ $(@:db))}$(ZIP5EXT) $@
+ $(COMMAND_ECHO)$(RM) $(ZIP5TMP).$(ZIP5TARGET){$(subst,$(ZIP5HELPVAR),_ $(@:db))}$(ZIP5EXT)
+.ELSE # "$(ZIP5DIR)" != ""
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP5FLAGS) $@ $(foreach,j,$(ZIP5LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP5TARGET)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $@ \
+ $(FI)
+.ENDIF # "$(ZIP5DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+.ENDIF
+
+# unroll begin
+
+.IF "$(GUI)"=="WNT"
+command_seperator=&&
+#command_seperator=^
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+.ELIF "$(GUI)"=="OS2"
+command_seperator=&&
+.ELSE
+command_seperator=;
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+
+.ENDIF
+
+.IF "$(ZIP6TARGET)"!=""
+
+ZIP6EXT*=.zip
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP6LIST:s/LANGDIR//)" == "$(ZIP6LIST)"
+ZIP6TARGETN=$(COMMONBIN)/$(ZIP6TARGET)$(ZIP6EXT)
+.ELSE
+ZIP6TARGETN=$(foreach,i,$(zip6alllangiso) $(COMMONBIN)/$(ZIP6TARGET)_$i$(ZIP6EXT) )
+.ENDIF
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP6LIST:s/LANGDIR//)" == "$(ZIP6LIST)"
+ZIP6TARGETN=$(BIN)/$(ZIP6TARGET)$(ZIP6EXT)
+.ELSE
+ZIP6TARGETN=$(foreach,i,$(zip6alllangiso) $(BIN)/$(ZIP6TARGET)_$i$(ZIP6EXT) )
+.ENDIF
+.ENDIF # "$(common_build_zip)"!=""
+ZIP6DEPFILE=$(subst,$(COMMON_OUTDIR),$(OUTPATH) $(subst,/bin/,/misc/ $(ZIP6TARGETN:s/$(ZIP6EXT)/.dpzz/)))
+ZIPDEPFILES+=$(ZIP6DEPFILE)
+
+ZIP6DIR*=$(ZIPDIR)
+ZIP6FLAGS*=$(ZIPFLAGS)
+.IF "$(zip6generatedlangs)"!=""
+zip6langdirs*=$(alllangiso)
+.ELSE # "$(zip6generatedlangs)"!=""
+zip6langdirs:=$(shell @-test -d {$(subst,/$(LANGDIR), $(null,$(ZIP6DIR) . $(ZIP6DIR)))}/ && find {$(subst,/$(LANGDIR), $(null,$(ZIP6DIR) . $(ZIP6DIR)))}/ -type d ! -name CVS ! -name ".svn" ! -name "." | sed "s/\.\/\///" | sed "s/\.\///" )
+.ENDIF # "$(zip6generatedlangs)"!=""
+.IF "$(ZIP6FORCEALLLANG)"!=""
+zip6alllangiso:=$(foreach,i,$(completelangiso) $(foreach,j,$(zip6langdirs) $(eq,$i,$j $i $(NULL))))
+.ELSE # "$(ZIP6ALLLANG)" != ""
+zip6alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(zip6langdirs) $(eq,$i,$j $i $(NULL))))
+.ENDIF # "$(ZIP6ALLLANG)" != ""
+.ENDIF # "$(ZIP6TARGET)"!=""
+
+.IF "$(ZIP6TARGETN)"!=""
+
+ZIP6TMP:=$(mktmp iii)
+
+$(MISC)/$(TARGET).$(PWD:f).$(ZIP6TARGET).dpzz : $(ZIP6TARGETN)
+
+.IF "$(common_build_zip)"!=""
+ZIP6HELPVAR=$(COMMONBIN)/$(ZIP6TARGET)
+.ELSE # "$(common_build_zip)"!=""
+ZIP6HELPVAR=$(BIN)/$(ZIP6TARGET)
+.ENDIF # "$(common_build_zip)"!=""
+
+$(ZIP6DEPFILE) :
+ @echo # > $(MISC)/$(@:f)
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP6DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP6DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP6DIR))) $(command_seperator) $(ZIPDEP) $(ZIP6FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP6DIR)))/ $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP6EXT)/))) $(foreach,j,$(ZIP6LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP6TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP6DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP6FLAGS) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP6EXT)/))) $(foreach,j,$(ZIP6LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP6TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP6DIR)" != ""
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP6DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP6DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP6DIR))) $(command_seperator) $(ZIPDEP) $(ZIP6FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP6DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP6EXT)/)) $(foreach,j,$(ZIP6LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP6TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP6DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP6FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP6EXT)/)) $(foreach,j,$(ZIP6LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP6TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP6DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+ @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f)
+
+
+$(ZIP6TARGETN) : delzip $(ZIP6DEPS)
+ @echo "Making: " $(@:f)
+ @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@))
+ @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles
+ @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) )
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP6DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP6TMP).$(ZIP6TARGET){$(subst,$(ZIP6HELPVAR),_ $(@:db))}$(ZIP6EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP6HELPVAR)_, $(@:db))} $(ZIP6DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP6FLAGS) $(ZIP6TMP).$(ZIP6TARGET){$(subst,$(ZIP6HELPVAR),_ $(@:db))}$(ZIP6EXT) $(subst,LANGDIR_away/, $(ZIP6LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP6TMP).$(ZIP6TARGET){$(subst,$(ZIP6HELPVAR),_ $(@:db))}$(ZIP6EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP6TMP).$(ZIP6TARGET){$(subst,$(ZIP6HELPVAR),_ $(@:db))}$(ZIP6EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP6TMP).$(ZIP6TARGET){$(subst,$(ZIP6HELPVAR),_ $(@:db))}$(ZIP6EXT) $@.$(INPATH)
+ $(COMMAND_ECHO)$(RM) $(ZIP6TMP).$(ZIP6TARGET){$(subst,$(ZIP6HELPVAR),_ $(@:db))}$(ZIP6EXT)
+.ELSE # "$(ZIP6DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP6FLAGS) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(foreach,j,$(ZIP6LIST) $(subst,LANGDIR,{$(subst,$(ZIP6HELPVAR)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) \
+ $(FI)
+ @@-$(GNUCOPY) -p $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $@.$(INPATH)
+ @-$(RM) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+.ENDIF # "$(ZIP6DIR)" != ""
+ @@-$(RM) $@
+ @$(IFEXIST) $@.$(INPATH) $(THEN) $(RENAME:s/+//) $@.$(INPATH) $@ $(FI)
+# @$(IFEXIST) $@ $(THEN) $(TOUCH) $@ $(FI) # even if it's not used...
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP6DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP6TMP).$(ZIP6TARGET){$(subst,$(ZIP6HELPVAR),_ $(@:db))}$(ZIP6EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP6HELPVAR)_, $(@:db))} $(ZIP6DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP6FLAGS) $(ZIP6TMP).$(ZIP6TARGET){$(subst,$(ZIP6HELPVAR),_ $(@:db))}$(ZIP6EXT) $(subst,LANGDIR_away/, $(ZIP6LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP6TMP).$(ZIP6TARGET){$(subst,$(ZIP6HELPVAR),_ $(@:db))}$(ZIP6EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP6TMP).$(ZIP6TARGET){$(subst,$(ZIP6HELPVAR),_ $(@:db))}$(ZIP6EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP6TMP).$(ZIP6TARGET){$(subst,$(ZIP6HELPVAR),_ $(@:db))}$(ZIP6EXT) $@
+ $(COMMAND_ECHO)$(RM) $(ZIP6TMP).$(ZIP6TARGET){$(subst,$(ZIP6HELPVAR),_ $(@:db))}$(ZIP6EXT)
+.ELSE # "$(ZIP6DIR)" != ""
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP6FLAGS) $@ $(foreach,j,$(ZIP6LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP6TARGET)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $@ \
+ $(FI)
+.ENDIF # "$(ZIP6DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+.ENDIF
+
+# unroll begin
+
+.IF "$(GUI)"=="WNT"
+command_seperator=&&
+#command_seperator=^
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+.ELIF "$(GUI)"=="OS2"
+command_seperator=&&
+.ELSE
+command_seperator=;
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+
+.ENDIF
+
+.IF "$(ZIP7TARGET)"!=""
+
+ZIP7EXT*=.zip
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP7LIST:s/LANGDIR//)" == "$(ZIP7LIST)"
+ZIP7TARGETN=$(COMMONBIN)/$(ZIP7TARGET)$(ZIP7EXT)
+.ELSE
+ZIP7TARGETN=$(foreach,i,$(zip7alllangiso) $(COMMONBIN)/$(ZIP7TARGET)_$i$(ZIP7EXT) )
+.ENDIF
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP7LIST:s/LANGDIR//)" == "$(ZIP7LIST)"
+ZIP7TARGETN=$(BIN)/$(ZIP7TARGET)$(ZIP7EXT)
+.ELSE
+ZIP7TARGETN=$(foreach,i,$(zip7alllangiso) $(BIN)/$(ZIP7TARGET)_$i$(ZIP7EXT) )
+.ENDIF
+.ENDIF # "$(common_build_zip)"!=""
+ZIP7DEPFILE=$(subst,$(COMMON_OUTDIR),$(OUTPATH) $(subst,/bin/,/misc/ $(ZIP7TARGETN:s/$(ZIP7EXT)/.dpzz/)))
+ZIPDEPFILES+=$(ZIP7DEPFILE)
+
+ZIP7DIR*=$(ZIPDIR)
+ZIP7FLAGS*=$(ZIPFLAGS)
+.IF "$(zip7generatedlangs)"!=""
+zip7langdirs*=$(alllangiso)
+.ELSE # "$(zip7generatedlangs)"!=""
+zip7langdirs:=$(shell @-test -d {$(subst,/$(LANGDIR), $(null,$(ZIP7DIR) . $(ZIP7DIR)))}/ && find {$(subst,/$(LANGDIR), $(null,$(ZIP7DIR) . $(ZIP7DIR)))}/ -type d ! -name CVS ! -name ".svn" ! -name "." | sed "s/\.\/\///" | sed "s/\.\///" )
+.ENDIF # "$(zip7generatedlangs)"!=""
+.IF "$(ZIP7FORCEALLLANG)"!=""
+zip7alllangiso:=$(foreach,i,$(completelangiso) $(foreach,j,$(zip7langdirs) $(eq,$i,$j $i $(NULL))))
+.ELSE # "$(ZIP7ALLLANG)" != ""
+zip7alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(zip7langdirs) $(eq,$i,$j $i $(NULL))))
+.ENDIF # "$(ZIP7ALLLANG)" != ""
+.ENDIF # "$(ZIP7TARGET)"!=""
+
+.IF "$(ZIP7TARGETN)"!=""
+
+ZIP7TMP:=$(mktmp iii)
+
+$(MISC)/$(TARGET).$(PWD:f).$(ZIP7TARGET).dpzz : $(ZIP7TARGETN)
+
+.IF "$(common_build_zip)"!=""
+ZIP7HELPVAR=$(COMMONBIN)/$(ZIP7TARGET)
+.ELSE # "$(common_build_zip)"!=""
+ZIP7HELPVAR=$(BIN)/$(ZIP7TARGET)
+.ENDIF # "$(common_build_zip)"!=""
+
+$(ZIP7DEPFILE) :
+ @echo # > $(MISC)/$(@:f)
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP7DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP7DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP7DIR))) $(command_seperator) $(ZIPDEP) $(ZIP7FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP7DIR)))/ $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP7EXT)/))) $(foreach,j,$(ZIP7LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP7TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP7DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP7FLAGS) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP7EXT)/))) $(foreach,j,$(ZIP7LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP7TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP7DIR)" != ""
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP7DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP7DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP7DIR))) $(command_seperator) $(ZIPDEP) $(ZIP7FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP7DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP7EXT)/)) $(foreach,j,$(ZIP7LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP7TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP7DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP7FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP7EXT)/)) $(foreach,j,$(ZIP7LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP7TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP7DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+ @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f)
+
+
+$(ZIP7TARGETN) : delzip $(ZIP7DEPS)
+ @echo "Making: " $(@:f)
+ @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@))
+ @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles
+ @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) )
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP7DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP7TMP).$(ZIP7TARGET){$(subst,$(ZIP7HELPVAR),_ $(@:db))}$(ZIP7EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP7HELPVAR)_, $(@:db))} $(ZIP7DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP7FLAGS) $(ZIP7TMP).$(ZIP7TARGET){$(subst,$(ZIP7HELPVAR),_ $(@:db))}$(ZIP7EXT) $(subst,LANGDIR_away/, $(ZIP7LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP7TMP).$(ZIP7TARGET){$(subst,$(ZIP7HELPVAR),_ $(@:db))}$(ZIP7EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP7TMP).$(ZIP7TARGET){$(subst,$(ZIP7HELPVAR),_ $(@:db))}$(ZIP7EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP7TMP).$(ZIP7TARGET){$(subst,$(ZIP7HELPVAR),_ $(@:db))}$(ZIP7EXT) $@.$(INPATH)
+ $(COMMAND_ECHO)$(RM) $(ZIP7TMP).$(ZIP7TARGET){$(subst,$(ZIP7HELPVAR),_ $(@:db))}$(ZIP7EXT)
+.ELSE # "$(ZIP7DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP7FLAGS) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(foreach,j,$(ZIP7LIST) $(subst,LANGDIR,{$(subst,$(ZIP7HELPVAR)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) \
+ $(FI)
+ @@-$(GNUCOPY) -p $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $@.$(INPATH)
+ @-$(RM) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+.ENDIF # "$(ZIP7DIR)" != ""
+ @@-$(RM) $@
+ @$(IFEXIST) $@.$(INPATH) $(THEN) $(RENAME:s/+//) $@.$(INPATH) $@ $(FI)
+# @$(IFEXIST) $@ $(THEN) $(TOUCH) $@ $(FI) # even if it's not used...
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP7DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP7TMP).$(ZIP7TARGET){$(subst,$(ZIP7HELPVAR),_ $(@:db))}$(ZIP7EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP7HELPVAR)_, $(@:db))} $(ZIP7DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP7FLAGS) $(ZIP7TMP).$(ZIP7TARGET){$(subst,$(ZIP7HELPVAR),_ $(@:db))}$(ZIP7EXT) $(subst,LANGDIR_away/, $(ZIP7LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP7TMP).$(ZIP7TARGET){$(subst,$(ZIP7HELPVAR),_ $(@:db))}$(ZIP7EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP7TMP).$(ZIP7TARGET){$(subst,$(ZIP7HELPVAR),_ $(@:db))}$(ZIP7EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP7TMP).$(ZIP7TARGET){$(subst,$(ZIP7HELPVAR),_ $(@:db))}$(ZIP7EXT) $@
+ $(COMMAND_ECHO)$(RM) $(ZIP7TMP).$(ZIP7TARGET){$(subst,$(ZIP7HELPVAR),_ $(@:db))}$(ZIP7EXT)
+.ELSE # "$(ZIP7DIR)" != ""
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP7FLAGS) $@ $(foreach,j,$(ZIP7LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP7TARGET)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $@ \
+ $(FI)
+.ENDIF # "$(ZIP7DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+.ENDIF
+
+# unroll begin
+
+.IF "$(GUI)"=="WNT"
+command_seperator=&&
+#command_seperator=^
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+.ELIF "$(GUI)"=="OS2"
+command_seperator=&&
+.ELSE
+command_seperator=;
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+
+.ENDIF
+
+.IF "$(ZIP8TARGET)"!=""
+
+ZIP8EXT*=.zip
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP8LIST:s/LANGDIR//)" == "$(ZIP8LIST)"
+ZIP8TARGETN=$(COMMONBIN)/$(ZIP8TARGET)$(ZIP8EXT)
+.ELSE
+ZIP8TARGETN=$(foreach,i,$(zip8alllangiso) $(COMMONBIN)/$(ZIP8TARGET)_$i$(ZIP8EXT) )
+.ENDIF
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP8LIST:s/LANGDIR//)" == "$(ZIP8LIST)"
+ZIP8TARGETN=$(BIN)/$(ZIP8TARGET)$(ZIP8EXT)
+.ELSE
+ZIP8TARGETN=$(foreach,i,$(zip8alllangiso) $(BIN)/$(ZIP8TARGET)_$i$(ZIP8EXT) )
+.ENDIF
+.ENDIF # "$(common_build_zip)"!=""
+ZIP8DEPFILE=$(subst,$(COMMON_OUTDIR),$(OUTPATH) $(subst,/bin/,/misc/ $(ZIP8TARGETN:s/$(ZIP8EXT)/.dpzz/)))
+ZIPDEPFILES+=$(ZIP8DEPFILE)
+
+ZIP8DIR*=$(ZIPDIR)
+ZIP8FLAGS*=$(ZIPFLAGS)
+.IF "$(zip8generatedlangs)"!=""
+zip8langdirs*=$(alllangiso)
+.ELSE # "$(zip8generatedlangs)"!=""
+zip8langdirs:=$(shell @-test -d {$(subst,/$(LANGDIR), $(null,$(ZIP8DIR) . $(ZIP8DIR)))}/ && find {$(subst,/$(LANGDIR), $(null,$(ZIP8DIR) . $(ZIP8DIR)))}/ -type d ! -name CVS ! -name ".svn" ! -name "." | sed "s/\.\/\///" | sed "s/\.\///" )
+.ENDIF # "$(zip8generatedlangs)"!=""
+.IF "$(ZIP8FORCEALLLANG)"!=""
+zip8alllangiso:=$(foreach,i,$(completelangiso) $(foreach,j,$(zip8langdirs) $(eq,$i,$j $i $(NULL))))
+.ELSE # "$(ZIP8ALLLANG)" != ""
+zip8alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(zip8langdirs) $(eq,$i,$j $i $(NULL))))
+.ENDIF # "$(ZIP8ALLLANG)" != ""
+.ENDIF # "$(ZIP8TARGET)"!=""
+
+.IF "$(ZIP8TARGETN)"!=""
+
+ZIP8TMP:=$(mktmp iii)
+
+$(MISC)/$(TARGET).$(PWD:f).$(ZIP8TARGET).dpzz : $(ZIP8TARGETN)
+
+.IF "$(common_build_zip)"!=""
+ZIP8HELPVAR=$(COMMONBIN)/$(ZIP8TARGET)
+.ELSE # "$(common_build_zip)"!=""
+ZIP8HELPVAR=$(BIN)/$(ZIP8TARGET)
+.ENDIF # "$(common_build_zip)"!=""
+
+$(ZIP8DEPFILE) :
+ @echo # > $(MISC)/$(@:f)
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP8DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP8DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP8DIR))) $(command_seperator) $(ZIPDEP) $(ZIP8FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP8DIR)))/ $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP8EXT)/))) $(foreach,j,$(ZIP8LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP8TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP8DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP8FLAGS) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP8EXT)/))) $(foreach,j,$(ZIP8LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP8TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP8DIR)" != ""
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP8DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP8DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP8DIR))) $(command_seperator) $(ZIPDEP) $(ZIP8FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP8DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP8EXT)/)) $(foreach,j,$(ZIP8LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP8TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP8DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP8FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP8EXT)/)) $(foreach,j,$(ZIP8LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP8TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP8DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+ @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f)
+
+
+$(ZIP8TARGETN) : delzip $(ZIP8DEPS)
+ @echo "Making: " $(@:f)
+ @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@))
+ @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles
+ @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) )
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP8DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP8TMP).$(ZIP8TARGET){$(subst,$(ZIP8HELPVAR),_ $(@:db))}$(ZIP8EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP8HELPVAR)_, $(@:db))} $(ZIP8DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP8FLAGS) $(ZIP8TMP).$(ZIP8TARGET){$(subst,$(ZIP8HELPVAR),_ $(@:db))}$(ZIP8EXT) $(subst,LANGDIR_away/, $(ZIP8LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP8TMP).$(ZIP8TARGET){$(subst,$(ZIP8HELPVAR),_ $(@:db))}$(ZIP8EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP8TMP).$(ZIP8TARGET){$(subst,$(ZIP8HELPVAR),_ $(@:db))}$(ZIP8EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP8TMP).$(ZIP8TARGET){$(subst,$(ZIP8HELPVAR),_ $(@:db))}$(ZIP8EXT) $@.$(INPATH)
+ $(COMMAND_ECHO)$(RM) $(ZIP8TMP).$(ZIP8TARGET){$(subst,$(ZIP8HELPVAR),_ $(@:db))}$(ZIP8EXT)
+.ELSE # "$(ZIP8DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP8FLAGS) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(foreach,j,$(ZIP8LIST) $(subst,LANGDIR,{$(subst,$(ZIP8HELPVAR)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) \
+ $(FI)
+ @@-$(GNUCOPY) -p $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $@.$(INPATH)
+ @-$(RM) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+.ENDIF # "$(ZIP8DIR)" != ""
+ @@-$(RM) $@
+ @$(IFEXIST) $@.$(INPATH) $(THEN) $(RENAME:s/+//) $@.$(INPATH) $@ $(FI)
+# @$(IFEXIST) $@ $(THEN) $(TOUCH) $@ $(FI) # even if it's not used...
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP8DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP8TMP).$(ZIP8TARGET){$(subst,$(ZIP8HELPVAR),_ $(@:db))}$(ZIP8EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP8HELPVAR)_, $(@:db))} $(ZIP8DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP8FLAGS) $(ZIP8TMP).$(ZIP8TARGET){$(subst,$(ZIP8HELPVAR),_ $(@:db))}$(ZIP8EXT) $(subst,LANGDIR_away/, $(ZIP8LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP8TMP).$(ZIP8TARGET){$(subst,$(ZIP8HELPVAR),_ $(@:db))}$(ZIP8EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP8TMP).$(ZIP8TARGET){$(subst,$(ZIP8HELPVAR),_ $(@:db))}$(ZIP8EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP8TMP).$(ZIP8TARGET){$(subst,$(ZIP8HELPVAR),_ $(@:db))}$(ZIP8EXT) $@
+ $(COMMAND_ECHO)$(RM) $(ZIP8TMP).$(ZIP8TARGET){$(subst,$(ZIP8HELPVAR),_ $(@:db))}$(ZIP8EXT)
+.ELSE # "$(ZIP8DIR)" != ""
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP8FLAGS) $@ $(foreach,j,$(ZIP8LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP8TARGET)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $@ \
+ $(FI)
+.ENDIF # "$(ZIP8DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+.ENDIF
+
+# unroll begin
+
+.IF "$(GUI)"=="WNT"
+command_seperator=&&
+#command_seperator=^
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+.ELIF "$(GUI)"=="OS2"
+command_seperator=&&
+.ELSE
+command_seperator=;
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+
+.ENDIF
+
+.IF "$(ZIP9TARGET)"!=""
+
+ZIP9EXT*=.zip
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP9LIST:s/LANGDIR//)" == "$(ZIP9LIST)"
+ZIP9TARGETN=$(COMMONBIN)/$(ZIP9TARGET)$(ZIP9EXT)
+.ELSE
+ZIP9TARGETN=$(foreach,i,$(zip9alllangiso) $(COMMONBIN)/$(ZIP9TARGET)_$i$(ZIP9EXT) )
+.ENDIF
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP9LIST:s/LANGDIR//)" == "$(ZIP9LIST)"
+ZIP9TARGETN=$(BIN)/$(ZIP9TARGET)$(ZIP9EXT)
+.ELSE
+ZIP9TARGETN=$(foreach,i,$(zip9alllangiso) $(BIN)/$(ZIP9TARGET)_$i$(ZIP9EXT) )
+.ENDIF
+.ENDIF # "$(common_build_zip)"!=""
+ZIP9DEPFILE=$(subst,$(COMMON_OUTDIR),$(OUTPATH) $(subst,/bin/,/misc/ $(ZIP9TARGETN:s/$(ZIP9EXT)/.dpzz/)))
+ZIPDEPFILES+=$(ZIP9DEPFILE)
+
+ZIP9DIR*=$(ZIPDIR)
+ZIP9FLAGS*=$(ZIPFLAGS)
+.IF "$(zip9generatedlangs)"!=""
+zip9langdirs*=$(alllangiso)
+.ELSE # "$(zip9generatedlangs)"!=""
+zip9langdirs:=$(shell @-test -d {$(subst,/$(LANGDIR), $(null,$(ZIP9DIR) . $(ZIP9DIR)))}/ && find {$(subst,/$(LANGDIR), $(null,$(ZIP9DIR) . $(ZIP9DIR)))}/ -type d ! -name CVS ! -name ".svn" ! -name "." | sed "s/\.\/\///" | sed "s/\.\///" )
+.ENDIF # "$(zip9generatedlangs)"!=""
+.IF "$(ZIP9FORCEALLLANG)"!=""
+zip9alllangiso:=$(foreach,i,$(completelangiso) $(foreach,j,$(zip9langdirs) $(eq,$i,$j $i $(NULL))))
+.ELSE # "$(ZIP9ALLLANG)" != ""
+zip9alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(zip9langdirs) $(eq,$i,$j $i $(NULL))))
+.ENDIF # "$(ZIP9ALLLANG)" != ""
+.ENDIF # "$(ZIP9TARGET)"!=""
+
+.IF "$(ZIP9TARGETN)"!=""
+
+ZIP9TMP:=$(mktmp iii)
+
+$(MISC)/$(TARGET).$(PWD:f).$(ZIP9TARGET).dpzz : $(ZIP9TARGETN)
+
+.IF "$(common_build_zip)"!=""
+ZIP9HELPVAR=$(COMMONBIN)/$(ZIP9TARGET)
+.ELSE # "$(common_build_zip)"!=""
+ZIP9HELPVAR=$(BIN)/$(ZIP9TARGET)
+.ENDIF # "$(common_build_zip)"!=""
+
+$(ZIP9DEPFILE) :
+ @echo # > $(MISC)/$(@:f)
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP9DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP9DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP9DIR))) $(command_seperator) $(ZIPDEP) $(ZIP9FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP9DIR)))/ $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP9EXT)/))) $(foreach,j,$(ZIP9LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP9TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP9DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP9FLAGS) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP9EXT)/))) $(foreach,j,$(ZIP9LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP9TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP9DIR)" != ""
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP9DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP9DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP9DIR))) $(command_seperator) $(ZIPDEP) $(ZIP9FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP9DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP9EXT)/)) $(foreach,j,$(ZIP9LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP9TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP9DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP9FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP9EXT)/)) $(foreach,j,$(ZIP9LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP9TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP9DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+ @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f)
+
+
+$(ZIP9TARGETN) : delzip $(ZIP9DEPS)
+ @echo "Making: " $(@:f)
+ @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@))
+ @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles
+ @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) )
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP9DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP9TMP).$(ZIP9TARGET){$(subst,$(ZIP9HELPVAR),_ $(@:db))}$(ZIP9EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP9HELPVAR)_, $(@:db))} $(ZIP9DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP9FLAGS) $(ZIP9TMP).$(ZIP9TARGET){$(subst,$(ZIP9HELPVAR),_ $(@:db))}$(ZIP9EXT) $(subst,LANGDIR_away/, $(ZIP9LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP9TMP).$(ZIP9TARGET){$(subst,$(ZIP9HELPVAR),_ $(@:db))}$(ZIP9EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP9TMP).$(ZIP9TARGET){$(subst,$(ZIP9HELPVAR),_ $(@:db))}$(ZIP9EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP9TMP).$(ZIP9TARGET){$(subst,$(ZIP9HELPVAR),_ $(@:db))}$(ZIP9EXT) $@.$(INPATH)
+ $(COMMAND_ECHO)$(RM) $(ZIP9TMP).$(ZIP9TARGET){$(subst,$(ZIP9HELPVAR),_ $(@:db))}$(ZIP9EXT)
+.ELSE # "$(ZIP9DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP9FLAGS) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(foreach,j,$(ZIP9LIST) $(subst,LANGDIR,{$(subst,$(ZIP9HELPVAR)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) \
+ $(FI)
+ @@-$(GNUCOPY) -p $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $@.$(INPATH)
+ @-$(RM) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+.ENDIF # "$(ZIP9DIR)" != ""
+ @@-$(RM) $@
+ @$(IFEXIST) $@.$(INPATH) $(THEN) $(RENAME:s/+//) $@.$(INPATH) $@ $(FI)
+# @$(IFEXIST) $@ $(THEN) $(TOUCH) $@ $(FI) # even if it's not used...
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP9DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP9TMP).$(ZIP9TARGET){$(subst,$(ZIP9HELPVAR),_ $(@:db))}$(ZIP9EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP9HELPVAR)_, $(@:db))} $(ZIP9DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP9FLAGS) $(ZIP9TMP).$(ZIP9TARGET){$(subst,$(ZIP9HELPVAR),_ $(@:db))}$(ZIP9EXT) $(subst,LANGDIR_away/, $(ZIP9LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP9TMP).$(ZIP9TARGET){$(subst,$(ZIP9HELPVAR),_ $(@:db))}$(ZIP9EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP9TMP).$(ZIP9TARGET){$(subst,$(ZIP9HELPVAR),_ $(@:db))}$(ZIP9EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP9TMP).$(ZIP9TARGET){$(subst,$(ZIP9HELPVAR),_ $(@:db))}$(ZIP9EXT) $@
+ $(COMMAND_ECHO)$(RM) $(ZIP9TMP).$(ZIP9TARGET){$(subst,$(ZIP9HELPVAR),_ $(@:db))}$(ZIP9EXT)
+.ELSE # "$(ZIP9DIR)" != ""
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP9FLAGS) $@ $(foreach,j,$(ZIP9LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP9TARGET)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $@ \
+ $(FI)
+.ENDIF # "$(ZIP9DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+.ENDIF
+
+# unroll begin
+
+.IF "$(GUI)"=="WNT"
+command_seperator=&&
+#command_seperator=^
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+.ELIF "$(GUI)"=="OS2"
+command_seperator=&&
+.ELSE
+command_seperator=;
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+
+.ENDIF
+
+.IF "$(ZIP10TARGET)"!=""
+
+ZIP10EXT*=.zip
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP10LIST:s/LANGDIR//)" == "$(ZIP10LIST)"
+ZIP10TARGETN=$(COMMONBIN)/$(ZIP10TARGET)$(ZIP10EXT)
+.ELSE
+ZIP10TARGETN=$(foreach,i,$(zip10alllangiso) $(COMMONBIN)/$(ZIP10TARGET)_$i$(ZIP10EXT) )
+.ENDIF
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP10LIST:s/LANGDIR//)" == "$(ZIP10LIST)"
+ZIP10TARGETN=$(BIN)/$(ZIP10TARGET)$(ZIP10EXT)
+.ELSE
+ZIP10TARGETN=$(foreach,i,$(zip10alllangiso) $(BIN)/$(ZIP10TARGET)_$i$(ZIP10EXT) )
+.ENDIF
+.ENDIF # "$(common_build_zip)"!=""
+ZIP10DEPFILE=$(subst,$(COMMON_OUTDIR),$(OUTPATH) $(subst,/bin/,/misc/ $(ZIP10TARGETN:s/$(ZIP10EXT)/.dpzz/)))
+ZIPDEPFILES+=$(ZIP10DEPFILE)
+
+ZIP10DIR*=$(ZIPDIR)
+ZIP10FLAGS*=$(ZIPFLAGS)
+.IF "$(zip10generatedlangs)"!=""
+zip10langdirs*=$(alllangiso)
+.ELSE # "$(zip10generatedlangs)"!=""
+zip10langdirs:=$(shell @-test -d {$(subst,/$(LANGDIR), $(null,$(ZIP10DIR) . $(ZIP10DIR)))}/ && find {$(subst,/$(LANGDIR), $(null,$(ZIP10DIR) . $(ZIP10DIR)))}/ -type d ! -name CVS ! -name ".svn" ! -name "." | sed "s/\.\/\///" | sed "s/\.\///" )
+.ENDIF # "$(zip10generatedlangs)"!=""
+.IF "$(ZIP10FORCEALLLANG)"!=""
+zip10alllangiso:=$(foreach,i,$(completelangiso) $(foreach,j,$(zip10langdirs) $(eq,$i,$j $i $(NULL))))
+.ELSE # "$(ZIP10ALLLANG)" != ""
+zip10alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(zip10langdirs) $(eq,$i,$j $i $(NULL))))
+.ENDIF # "$(ZIP10ALLLANG)" != ""
+.ENDIF # "$(ZIP10TARGET)"!=""
+
+.IF "$(ZIP10TARGETN)"!=""
+
+ZIP10TMP:=$(mktmp iii)
+
+$(MISC)/$(TARGET).$(PWD:f).$(ZIP10TARGET).dpzz : $(ZIP10TARGETN)
+
+.IF "$(common_build_zip)"!=""
+ZIP10HELPVAR=$(COMMONBIN)/$(ZIP10TARGET)
+.ELSE # "$(common_build_zip)"!=""
+ZIP10HELPVAR=$(BIN)/$(ZIP10TARGET)
+.ENDIF # "$(common_build_zip)"!=""
+
+$(ZIP10DEPFILE) :
+ @echo # > $(MISC)/$(@:f)
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP10DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP10DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP10DIR))) $(command_seperator) $(ZIPDEP) $(ZIP10FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP10DIR)))/ $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP10EXT)/))) $(foreach,j,$(ZIP10LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP10TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP10DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP10FLAGS) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP10EXT)/))) $(foreach,j,$(ZIP10LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP10TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP10DIR)" != ""
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP10DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP10DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP10DIR))) $(command_seperator) $(ZIPDEP) $(ZIP10FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP10DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP10EXT)/)) $(foreach,j,$(ZIP10LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP10TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP10DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP10FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP10EXT)/)) $(foreach,j,$(ZIP10LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP10TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP10DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+ @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f)
+
+
+$(ZIP10TARGETN) : delzip $(ZIP10DEPS)
+ @echo "Making: " $(@:f)
+ @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@))
+ @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles
+ @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) )
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP10DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP10TMP).$(ZIP10TARGET){$(subst,$(ZIP10HELPVAR),_ $(@:db))}$(ZIP10EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP10HELPVAR)_, $(@:db))} $(ZIP10DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP10FLAGS) $(ZIP10TMP).$(ZIP10TARGET){$(subst,$(ZIP10HELPVAR),_ $(@:db))}$(ZIP10EXT) $(subst,LANGDIR_away/, $(ZIP10LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP10TMP).$(ZIP10TARGET){$(subst,$(ZIP10HELPVAR),_ $(@:db))}$(ZIP10EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP10TMP).$(ZIP10TARGET){$(subst,$(ZIP10HELPVAR),_ $(@:db))}$(ZIP10EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP10TMP).$(ZIP10TARGET){$(subst,$(ZIP10HELPVAR),_ $(@:db))}$(ZIP10EXT) $@.$(INPATH)
+ $(COMMAND_ECHO)$(RM) $(ZIP10TMP).$(ZIP10TARGET){$(subst,$(ZIP10HELPVAR),_ $(@:db))}$(ZIP10EXT)
+.ELSE # "$(ZIP10DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP10FLAGS) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(foreach,j,$(ZIP10LIST) $(subst,LANGDIR,{$(subst,$(ZIP10HELPVAR)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) \
+ $(FI)
+ @@-$(GNUCOPY) -p $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $@.$(INPATH)
+ @-$(RM) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+.ENDIF # "$(ZIP10DIR)" != ""
+ @@-$(RM) $@
+ @$(IFEXIST) $@.$(INPATH) $(THEN) $(RENAME:s/+//) $@.$(INPATH) $@ $(FI)
+# @$(IFEXIST) $@ $(THEN) $(TOUCH) $@ $(FI) # even if it's not used...
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP10DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP10TMP).$(ZIP10TARGET){$(subst,$(ZIP10HELPVAR),_ $(@:db))}$(ZIP10EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP10HELPVAR)_, $(@:db))} $(ZIP10DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP10FLAGS) $(ZIP10TMP).$(ZIP10TARGET){$(subst,$(ZIP10HELPVAR),_ $(@:db))}$(ZIP10EXT) $(subst,LANGDIR_away/, $(ZIP10LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP10TMP).$(ZIP10TARGET){$(subst,$(ZIP10HELPVAR),_ $(@:db))}$(ZIP10EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP10TMP).$(ZIP10TARGET){$(subst,$(ZIP10HELPVAR),_ $(@:db))}$(ZIP10EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP10TMP).$(ZIP10TARGET){$(subst,$(ZIP10HELPVAR),_ $(@:db))}$(ZIP10EXT) $@
+ $(COMMAND_ECHO)$(RM) $(ZIP10TMP).$(ZIP10TARGET){$(subst,$(ZIP10HELPVAR),_ $(@:db))}$(ZIP10EXT)
+.ELSE # "$(ZIP10DIR)" != ""
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP10FLAGS) $@ $(foreach,j,$(ZIP10LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP10TARGET)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $@ \
+ $(FI)
+.ENDIF # "$(ZIP10DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+.ENDIF
+
diff --git a/solenv/inc/ant.mk b/solenv/inc/ant.mk
new file mode 100644
index 000000000000..2d182a66a437
--- /dev/null
+++ b/solenv/inc/ant.mk
@@ -0,0 +1,100 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# --- Force JDK14 switch ------------------------------------------
+
+.IF "$(USE_JDK_VERSION)" == "140"
+JDK_VERSION=140
+JAVA_HOME=$(JDK14PATH)
+
+PATH!:=$(JDK14PATH)/bin$(PATH_SEPERATOR)$(PATH)
+XCLASSPATH:=$(JDK14PATH)/jre/lib/rt.jar
+CLASSPATH:=$(XCLASSPATH)
+.ENDIF
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+
+# --- ANT build environment ---------------------------------------
+
+.INCLUDE : antsettings.mk
+
+.INCLUDE : target.mk
+
+CLASSPATH!:=$(CLASSPATH)$(PATH_SEPERATOR)$(ANT_CLASSPATH)$(PATH_SEPERATOR)$(JAVA_HOME)/lib/tools.jar
+.EXPORT : CLASSPATH
+.EXPORT : PATH
+
+# --- TARGETS -----------------------------------------------------
+
+$(CLASSDIR)/solar.properties : $(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)/minormkchanged.flg $(SOLARENV)/inc/ant.properties
+ @echo "Making: " $@
+ @echo solar.build=$(BUILD) > $@
+ @echo solar.rscversion=$(USQ)$(RSCVERSION)$(USQ) >> $@
+ @echo solar.rscrevision=$(USQ)$(RSCREVISION)$(USQ) >> $@
+ @echo solar.minor=$(LAST_MINOR) >> $@
+ @echo solar.sourceversion=$(SOURCEVERSION) >> $@
+ @echo solar.udkstamp=$(UDKSTAMP) >> $@
+ @echo solar.extstamp=$(EXTSTAMP) >> $@
+ @cat $(DMAKEROOT)/../ant.properties >> $@
+
+ANTBUILD .PHONY:
+ $(ANT) $(ANT_FLAGS)
+
+clean .PHONY:
+ $(ANT) $(ANT_FLAGS) $@
+
+prepare .PHONY:
+ $(ANT) $(ANT_FLAGS) $@
+
+main: .PHONY:
+ $(ANT) $(ANT_FLAGS) $@
+
+info: .PHONY
+ $(ANT) $(ANT_FLAGS) $@
+
+jar .PHONY:
+ $(ANT) $(ANT_FLAGS) $@
+
+compile .PHONY:
+ $(ANT) $(ANT_FLAGS) $@
+
+depend .PHONY:
+ $(ANT) $(ANT_FLAGS) $@
+
+javadoc .PHONY:
+ $(ANT) $(ANT_FLAGS) $@
+
+config .PHONY:
+ $(ANT) $(ANT_FLAGS) $@
+
+test .PHONY:
+ $(ANT) $(ANT_FLAGS) $@
+
+
diff --git a/solenv/inc/ant.properties b/solenv/inc/ant.properties
new file mode 100644
index 000000000000..b2c0f748ef7a
--- /dev/null
+++ b/solenv/inc/ant.properties
@@ -0,0 +1,12 @@
+# x-no-translate
+build.bin=${build.dir}/bin
+build.class=${build.dir}/class
+build.inc=${build.dir}/inc
+build.lib=${build.dir}/lib
+build.misc=${build.dir}/misc
+build.obj=${build.dir}/obj
+build.res=${build.dir}/res
+build.slb=${build.dir}/slb
+build.slo=${build.dir}/slo
+build.srs=${build.dir}/srs
+
diff --git a/solenv/inc/antsettings.mk b/solenv/inc/antsettings.mk
new file mode 100644
index 000000000000..5a28b242967d
--- /dev/null
+++ b/solenv/inc/antsettings.mk
@@ -0,0 +1,87 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+.IF "$(SOLAR_JAVA)"!=""
+
+ANT_LIB*:=$(ANT_HOME)/lib
+
+ANT_CLASSPATH:=$(ANT_LIB)/xercesImpl.jar$(PATH_SEPERATOR)$(ANT_LIB)/xml-apis.jar$(PATH_SEPERATOR)$(ANT_LIB)/ant.jar
+
+# PATH_SEPERATOR won't work here as it is defined
+# as ; for wondows (all shells)
+#PATH!:=$(ANT_HOME)/bin$(PATH_SEPERATOR)$(PATH)
+PATH!:=$(ANT_HOME)/bin:$(PATH)
+
+ANT*:=$(ANT_HOME)/bin/ant
+ANT_BUILDFILE*=build.xml
+
+.IF "$(ANT_DEBUG)"==""
+.IF "$(debug)"==""
+ANT_DEBUG=off
+.ELSE
+ANT_DEBUG=on
+.ENDIF
+.ENDIF
+
+.IF "$(ANT_OPT)"==""
+.IF "$(optimize)"==""
+ANT_OPT=off
+.ELSE
+ANT_OPT=on
+.ENDIF
+.ENDIF
+
+.IF "$(JDK)"=="gcj"
+JAVA_HOME=
+.EXPORT : JAVA_HOME
+.ENDIF
+
+.IF "$(JAVACISGCJ)" == "yes"
+ANT_FLAGS!:=-Dbuild.compiler=gcj -Dprj=$(PRJ) -Dprjname=$(PRJNAME) -Ddebug=$(ANT_DEBUG) \
+ -Doptimize=$(ANT_OPT) -Dtarget=$(TARGET) -Dsolar.update=on -Dout=$(OUT) -Dinpath=$(INPATH) \
+ -Dproext="$(PROEXT)" -Dsolar.bin=$(SOLARBINDIR) -Dsolar.jar=$(SOLARBINDIR) \
+ -Dsolar.doc=$(SOLARDOCDIR) -Dcommon.jar=$(SOLARCOMMONBINDIR) \
+ -Dcommon.doc=$(SOLARCOMMONDOCDIR) -Dsolar.sourceversion=$(SOURCEVERSION) \
+ -Dsolar.lastminor=$(LAST_MINOR) -Dsolar.build=$(BUILD) -f $(ANT_BUILDFILE) $(ANT_FLAGS) -emacs
+.ELSE
+ANT_FLAGS!:=-Dprj=$(PRJ) -Dprjname=$(PRJNAME) -Ddebug=$(ANT_DEBUG) -Doptimize=$(ANT_OPT) \
+ -Dtarget=$(TARGET) -Dsolar.update=on -Dout=$(OUT) -Dinpath=$(INPATH) -Dproext="$(PROEXT)" \
+ -Dsolar.bin=$(SOLARBINDIR) -Dsolar.jar=$(SOLARBINDIR) -Dsolar.doc=$(SOLARDOCDIR) \
+ -Dcommon.jar=$(SOLARCOMMONBINDIR) -Dcommon.doc=$(SOLARCOMMONDOCDIR) \
+ -Dsolar.sourceversion=$(SOURCEVERSION) -Dsolar.lastminor=$(LAST_MINOR) \
+ -Dsolar.build=$(BUILD) -f $(ANT_BUILDFILE) $(ANT_FLAGS) -emacs
+.ENDIF
+.ELSE # No java
+ANT=
+ANT_FLAGS=
+.ENDIF
+
+.IF "$(WITH_LANG)"!=""
+ANT_FLAGS+=-Dsolar.langs="$(WITH_LANG)" -Dsolar.localized="true"
+.ENDIF # "$(WITH_LANG)"!=""
+
diff --git a/solenv/inc/cppunit.mk b/solenv/inc/cppunit.mk
new file mode 100644
index 000000000000..2173f1a9ff9a
--- /dev/null
+++ b/solenv/inc/cppunit.mk
@@ -0,0 +1,56 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# Helper makefile additional, to support
+# dmake test
+# for cppunittester (cppunit testing)
+# for simple start all generated libraries:
+# dmake test
+#
+# for library 1 & 2:
+# or dmake test1 test2
+
+# This file have to be unroll by
+# cat cppunit.mk | mkunroll >_cppunit.mk
+# all between begin and end will repeat n times (at the moment n=10) to create such iterations
+# $(TNR) is the number
+# $(SHL$(TNR)TARGETN) is the same like $(OUT)/bin/$(SHL1TARGET) for every number, within unix, "bin" is replaced by "lib"
+
+################################################################################
+# unroll begin
+# ---- create the test libraries ------------------------------------
+
+.IF "$(SHL$(TNR)TARGET)"!=""
+ALLTAR : test$(TNR)
+test$(TNR) .PHONY : $(SHL$(TNR)TARGETN)
+ @echo ----------------------------------------------------------
+ @echo - start unit test \#$(TNR) on library $(SHL$(TNR)TARGETN)
+ @echo ----------------------------------------------------------
+ $(CPPUNITTESTER) $(SHL$(TNR)TARGETN)
+.ENDIF
+
+# unroll end
diff --git a/solenv/inc/dummy.flt b/solenv/inc/dummy.flt
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/solenv/inc/dummy.flt
diff --git a/solenv/inc/extension_helplink.mk b/solenv/inc/extension_helplink.mk
new file mode 100644
index 000000000000..e375696bda18
--- /dev/null
+++ b/solenv/inc/extension_helplink.mk
@@ -0,0 +1,80 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+my_cp:=$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)/jaxp.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/juh.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/parser.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/xt.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/unoil.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/ridl.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/jurt.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/xmlsearch.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/LuceneHelpWrapper.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/HelpIndexerTool.jar$
+
+.IF "$(SYSTEM_LUCENE)" == "YES"
+my_cp!:=$(my_cp)$(PATH_SEPERATOR)$(LUCENE_CORE_JAR)$(PATH_SEPERATOR)$(LUCENE_ANALYZERS_JAR)
+.ELSE
+my_cp!:=$(my_cp)$(PATH_SEPERATOR)$(SOLARBINDIR)/lucene-core-2.3.jar$(PATH_SEPERATOR)$(SOLARBINDIR)/lucene-analyzers-2.3.jar
+.ENDIF
+
+.IF "$(SYSTEM_DB)" != "YES"
+JAVA_LIBRARY_PATH= -Djava.library.path=$(SOLARSHAREDBIN)
+.ENDIF
+
+#aux_alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(aux_langdirs) $(eq,$i,$j $i $(NULL))))
+aux_alllangiso*:=$(alllangiso)
+
+#########################################################
+
+
+HELPLINKALLTARGETS=$(foreach,i,$(aux_alllangiso) $(MISC)/$(TARGET)_$(LINKNAME)_$i.done)
+HELPLINKALLADDEDDEPS=$(foreach,i,$(aux_alllangiso) $(subst,LANGUAGE,$i $(LINKADDEDDPES)))
+
+ALLTAR : $(HELPLINKALLTARGETS)
+
+.IF "$(SYSTEM_DB)" != "YES"
+JAVA_LIBRARY_PATH= -Djava.library.path=$(SOLARSHAREDBIN)
+.ENDIF
+
+XSL_DIR*:=$(SOLARBINDIR)
+XHPLINKSRC*:=$(XHPDEST)
+STY_SWITCH:= -sty $(XSL_DIR)/embed.xsl
+
+.IF "$(XHPFILES)"!="" && "$(HELP_OUT)"!=""
+$(foreach,i,$(LINKLINKFILES) $(XHPLINKSRC)/{$(aux_alllangiso)}/$i) : $(HELP_OUT)/$(TARGET).done
+LINKDEPS+=$(HELP_OUT)/xhp_changed.flag
+.ENDIF # "$(XHPFILES)"!="" && "$(HELP_OUT)"!=""
+
+$(HELPLINKALLTARGETS) : $(foreach,i,$(LINKLINKFILES) $(XHPLINKSRC)/$$(@:b:s/_/./:e:s/.//)/$i) $(subst,LANGUAGE,$$(@:b:s/_/./:e:s/.//) $(LINKDEPS))
+ @echo Building help index for $(@:b:s/_/./:e:s/.//)
+ $(COMMAND_ECHO)$(HELPLINKER) -mod $(LINKNAME) -extlangsrc $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} $(STY_SWITCH) -extlangdest $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} -idxcaption $(XSL_DIR)/idxcaption.xsl -idxcontent $(XSL_DIR)/idxcontent.xsl $(LINKLINKFILES)
+ $(COMMAND_ECHO)cd $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} && zip -u -r $(LINKNAME).jar $(PACKAGE)/* $(CHECKZIPRESULT)
+.IF "$(SOLAR_JAVA)" == "TRUE"
+# cleanup index dir
+ -$(RM) $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))}/$(LINKNAME).idxl/*
+.IF "$(CHECK_LUCENCE_INDEXER_OUTPUT)" == ""
+ $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVA_LIBRARY_PATH) -cp "$(my_cp)" com.sun.star.help.HelpIndexerTool -extension -lang $(@:b:s/_/./:e:s/.//) -mod $(LINKNAME) -zipdir $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} && $(TOUCH) $@
+.ELSE
+ $(COMMAND_ECHO)$(JAVAI) $(JAVAIFLAGS) $(JAVA_LIBRARY_PATH) -cp "$(my_cp)" com.sun.star.help.HelpIndexerTool -extension -lang $(@:b:s/_/./:e:s/.//) -mod $(LINKNAME) -zipdir $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} -checkcfsandsegname _0 _3 && $(TOUCH) $@
+.ENDIF
+.ELSE
+ -$(RM) $(XHPLINKSRC)/$(@:b)/content/*.*
+ -$(RM) $(XHPLINKSRC)/$(@:b)/caption/*.*
+.ENDIF
+
diff --git a/solenv/inc/extension_post.mk b/solenv/inc/extension_post.mk
new file mode 100644
index 000000000000..f221ff7ebe4a
--- /dev/null
+++ b/solenv/inc/extension_post.mk
@@ -0,0 +1,176 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+EXTENSION_TARGET:=$(ZIP9TARGETN)
+
+.SOURCE.xcu : $(MISC)/$(EXTNAME)/merge $(MISC)/$(EXTNAME)/registry/data $(MISC)/$(COMPONENT_SHARED_CONFIG)_in/merge $(MISC)/$(COMPONENT_SHARED_CONFIG)_in/registry/data $(COMPONENT_CONFIGDIR) .
+.SOURCE.xcs : $(MISC)/$(EXTNAME)/registry $(MISC)/$(EXTNAME)/registry/schema .
+
+fixme=$(MISC)/$(EXTNAME)/merge/$(MISC)
+fixme2=$(fixme:n)
+
+fixme3=$(MISC)/$(EXTNAME)/$(MISC)
+fixme4=$(fixme:n)
+
+$(EXTENSIONDIR)/$(COMPONENT_CONFIGDEST)/%.xcu : %.xcu
+# ugly hacking to workaround prepended first source path
+ @@-$(MKDIRHIER) $(subst,$(fixme2),$(MISC) $(@:d))
+.IF "$(COMPONENT_XCU_REPLACEMENT)"!=""
+ $(TYPE) $< | sed '$(COMPONENT_XCU_REPLACEMENT)' > $(subst,$(fixme2),$(MISC) $@)
+.ELSE # "$(COMPONENT_REPLACEMENT)"!=""
+ $(GNUCOPY) $< $(subst,$(fixme2),$(MISC) $@)
+.ENDIF # "$(COMPONENT_REPLACEMENT)"!=""
+
+$(EXTENSIONDIR)/$(COMPONENT_CONFIGDESTSCHEMA)/%.xcs : %.xcs
+ @@-$(MKDIRHIER) $(subst,$(fixme4),$(MISC) $(@:d))
+ $(GNUCOPY) $< $(subst,$(fixme4),$(MISC) $@)
+
+$(EXTENSIONDIR)/%.jar : $(SOLARBINDIR)/%.jar
+ @@-$(MKDIRHIER) $(@:d)
+ $(GNUCOPY) $< $@
+
+.IF "$(COMPONENT_FILES)"!=""
+COMPONENT_FILES_SRC*=./
+# ugly hacking to workaround prepended first source path - also hits
+# here in case of "just copied" .xcu files
+$(COMPONENT_FILES) : $$(@:s|$(fixme2)|$(MISC)|:s|$(EXTENSIONDIR)/|$(COMPONENT_FILES_SRC)|)
+ @@-$(MKDIRHIER) $(@:s|$(fixme2)|$(MISC)|:d)
+ $(COMMAND_ECHO)$(COPY) $< $(@:s|$(fixme2)|$(MISC)|)
+.ENDIF # "$(COMPONENT_FILES)"!=""
+
+.IF "$(COMPONENT_JARFILES)"!=""
+$(COMPONENT_JARFILES) : $(CLASSDIR)/$$(@:f)
+ @@-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(COPY) $< $@
+.ENDIF # "$(COMPONENT_JARFILES)"!=""
+
+.IF "$(COMPONENT_LIBRARIES)"!=""
+# TODO(Q3): strip the binary?
+$(COMPONENT_LIBRARIES) : $(DLLDEST)/$$(@:f)
+ @@-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(COPY) $< $@
+.IF "$(OS)$(CPU)"=="WNTI"
+.IF "$(COM)"=="GCC"
+ $(GNUCOPY) $(SOLARBINDIR)/mingwm10.dll $(EXTENSIONDIR)
+ .IF "$(MINGW_GCCDLL)"!=""
+ $(GNUCOPY) $(SOLARBINDIR)/$(MINGW_GCCDLL) $(EXTENSIONDIR)
+ .ENDIF
+ .IF "$(MINGW_GXXDLL)"!=""
+ $(GNUCOPY) $(SOLARBINDIR)/$(MINGW_GXXDLL) $(EXTENSIONDIR)
+ .ENDIF
+.ELSE
+.IF "$(PACKMS)"!=""
+.IF "$(CCNUMVER)" <= "001399999999"
+ $(GNUCOPY) $(PACKMS)/msvcr71.dll $(EXTENSIONDIR)
+ $(GNUCOPY) $(PACKMS)/msvcp71.dll $(EXTENSIONDIR)
+.ELSE # "$(CCNUMVER)" <= "001399999999"
+.IF "$(CCNUMVER)" <= "001499999999"
+ $(GNUCOPY) $(PACKMS)/msvcr80.dll $(EXTENSIONDIR)
+ $(GNUCOPY) $(PACKMS)/msvcp80.dll $(EXTENSIONDIR)
+ $(GNUCOPY) $(PACKMS)/msvcm80.dll $(EXTENSIONDIR)
+ $(GNUCOPY) $(PACKMS)/Microsoft.VC80.CRT.manifest $(EXTENSIONDIR)
+.ELSE # "$(CCNUMVER)" <= "001499999999"
+ $(GNUCOPY) $(PACKMS)/msvcr90.dll $(EXTENSIONDIR)
+ $(GNUCOPY) $(PACKMS)/msvcp90.dll $(EXTENSIONDIR)
+ $(GNUCOPY) $(PACKMS)/msvcm90.dll $(EXTENSIONDIR)
+ $(GNUCOPY) $(PACKMS)/Microsoft.VC90.CRT.manifest $(EXTENSIONDIR)
+.ENDIF # "$(CCNUMVER)" <= "001499999999"
+.ENDIF # "$(CCNUMVER)" <= "001399999999"
+.ELSE # "$(PACKMS)"!=""
+.IF "$(CCNUMVER)" <= "001399999999"
+ $(GNUCOPY) $(SOLARBINDIR)/msvcr71.dll $(EXTENSIONDIR)
+ $(GNUCOPY) $(SOLARBINDIR)/msvcp71.dll $(EXTENSIONDIR)
+.ELSE # "$(CCNUMVER)" <= "001399999999"
+.IF "$(CCNUMVER)" <= "001499999999"
+ $(GNUCOPY) $(SOLARBINDIR)/msvcr80.dll $(EXTENSIONDIR)
+ $(GNUCOPY) $(SOLARBINDIR)/msvcp80.dll $(EXTENSIONDIR)
+ $(GNUCOPY) $(SOLARBINDIR)/msvcm80.dll $(EXTENSIONDIR)
+ $(GNUCOPY) $(SOLARBINDIR)/Microsoft.VC80.CRT.manifest $(EXTENSIONDIR)
+.ELSE # "$(CCNUMVER)" <= "001499999999"
+ $(GNUCOPY) $(SOLARBINDIR)/msvcr90.dll $(EXTENSIONDIR)
+ $(GNUCOPY) $(SOLARBINDIR)/msvcp90.dll $(EXTENSIONDIR)
+ $(GNUCOPY) $(SOLARBINDIR)/msvcm90.dll $(EXTENSIONDIR)
+ $(GNUCOPY) $(SOLARBINDIR)/Microsoft.VC90.CRT.manifest $(EXTENSIONDIR)
+.ENDIF # "$(CCNUMVER)" <= "001499999999"
+.ENDIF # "$(CCNUMVER)" <= "001399999999"
+.ENDIF # "$(PACKMS)"!=""
+.ENDIF #"$(COM)"=="GCC"
+.ENDIF # "$(OS)$(CPU)"=="WNTI"
+.ENDIF # "$(COMPONENT_LIBRARIES)"!=""
+
+IMPLEMENTATION_IDENTIFIER*="com.sun.star.$(EXTENSIONNAME)-$(PLATFORMID)"
+
+.INCLUDE .IGNORE : $(MISC)/$(TARGET)_lang_track.mk
+.IF "$(LAST_WITH_LANG)"!="$(WITH_LANG)"
+PHONYDESC=.PHONY
+.ENDIF # "$(LAST_WITH_LANG)"!="$(WITH_LANG)"
+.IF "$(DESCRIPTION)"!=""
+$(DESCRIPTION) $(PHONYDESC) : $(DESCRIPTION_SRC)
+ @@-$(MKDIRHIER) $(@:d)
+ @echo LAST_WITH_LANG=$(WITH_LANG) > $(MISC)/$(TARGET)_lang_track.mk
+
+ $(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/licinserter.pl $(DESCRIPTION_SRC) $(COMPONENT_LIC_TEMPL) $@.1.$(EXTNAME)
+
+ $(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/transform_description.pl $@.1.$(EXTNAME) $@.2.$(EXTNAME)
+ @@-$(RM) $@.1.$(EXTNAME)
+
+ $(COMMAND_ECHO)$(TYPE) $@.2.$(EXTNAME) | sed s/UPDATED_IDENTIFIER/$(IMPLEMENTATION_IDENTIFIER)/ > $@.3.$(EXTNAME)
+ @@-$(RM) $@.2.$(EXTNAME)
+
+ $(COMMAND_ECHO)$(TYPE) $@.3.$(EXTNAME) | sed s/UPDATED_SUPPORTED_PLATFORM/$(PLATFORMID)/ > $@
+ @@-$(RM) $@.3.$(EXTNAME)
+
+.ENDIF # "$(DESCRIPTION)"!=""
+# default OOo license text!!!
+# may not fit...
+.IF "$(CUSTOM_LICENSE)"==""
+.IF "$(GUI)" == "WNT"
+PACKLICDEPS=$(SOLARBINDIR)/osl/license$$(@:b:s/_/./:e:s/./_/)$$(@:e)
+.ELSE # "$(GUI)" == "WNT"
+PACKLICDEPS=$(SOLARBINDIR)/osl/LICENSE$$(@:b:s/_/./:e:s/./_/)$$(@:e)
+.ENDIF # "$(GUI)" == "WNT"
+.ELSE # "$(CUSTOM_LICENSE)" == ""
+PACKLICDEPS=$(CUSTOM_LICENSE)
+.ENDIF # "$(CUSTOM_LICENSE)" == ""
+.IF "$(PACKLICS)"!=""
+$(PACKLICS) : $(PACKLICDEPS)
+ @@-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(GNUCOPY) $< $@
+.ENDIF # "$(PACKLICS)"!=""
+
+.IF "$(COMPONENT_MANIFEST)"!=""
+#$(COMPONENT_MANIFEST) : $$(@:f)
+$(COMPONENT_MANIFEST) : $(MANIFEST_SRC) $(MANIFEST_DEPS)
+ @@-$(MKDIRHIER) $(@:d)
+.IF "$(COMPONENT_MANIFEST_GENERIC)" == ""
+ $(COMMAND_ECHO)$(TYPE) $(MANIFEST_SRC) | $(SED) "s/SHARED_EXTENSION/$(DLLPOST)/" | $(SED) "s/EXEC_EXTENSION/$(EXECPOST)/" > $@
+.ELSE # "$(COMPONENT_MANIFEST_GENERIC)" != ""
+ $(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/makemani.pl $(PRJ)/util/manifest.xml $(EXTENSIONDIR) $(COMPONENT_MANIFEST_SEARCHDIR) $(@:d:d)
+.ENDIF # "$(COMPONENT_MANIFEST_GENERIC)" != ""
+.ENDIF # "$(COMPONENT_MANIFEST)"!=""
+
+ALLTAR : $(EXTENSION_PACKDEPS)
diff --git a/solenv/inc/extension_pre.mk b/solenv/inc/extension_pre.mk
new file mode 100644
index 000000000000..abef2e7f8b73
--- /dev/null
+++ b/solenv/inc/extension_pre.mk
@@ -0,0 +1,59 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+EXTENSIONDIR*:=$(MISC)/$(EXTENSIONNAME)
+
+COMPONENT_CONFIGDIR*:=.
+COMPONENT_CONFIGDEST*:=registry/data
+COMPONENT_CONFIGDESTSCHEMA*:=registry/schema
+
+.IF "$(COMPONENT_COPYONLY)"==""
+DESCRIPTION:=$(EXTENSIONDIR)/description.xml
+DESCRIPTION_SRC*:=description.xml
+
+COMPONENT_MANIFEST*:=$(EXTENSIONDIR)/META-INF/manifest.xml
+MANIFEST_SRC*:=manifest.xml
+
+.IF "$(GUI)" == "WIN" || "$(GUI)" == "WNT"
+PACKLICS*:=$(foreach,i,$(alllangiso) $(EXTENSIONDIR)/registration/license_$i.txt)
+COMPONENT_LIC_TEMPL*:=registration/license_xxx.txt
+.ELSE
+PACKLICS*:=$(foreach,i,$(alllangiso) $(EXTENSIONDIR)/registration/LICENSE_$i)
+COMPONENT_LIC_TEMPL*:=registration/LICENSE_xxx
+.ENDIF
+
+#TODO: check ZIP9TARGET for previous use!
+common_build_zip=
+MANIFEST_DEPS= $(PACKLICS) $(DESCRIPTION) $(COMPONENT_FILES) $(COMPONENT_LIBRARIES) $(COMPONENT_JARFILES) $(COMPONENT_MERGED_XCU) $(EXTENSION_PACKDEPS)
+ZIP9DEPS= $(PACKLICS) $(DESCRIPTION) $(COMPONENT_XCU) $(COMPONENT_FILES) $(COMPONENT_LIBRARIES) $(COMPONENT_MANIFEST) $(COMPONENT_JARFILES) $(COMPONENT_MERGED_XCU) $(EXTENSION_PACKDEPS)
+ZIP9TARGET= $(EXTENSION_ZIPNAME)
+ZIP9DIR= $(EXTENSIONDIR)
+ZIP9EXT= .oxt
+ZIP9FLAGS=-r
+ZIP9LIST= *
+.ENDIF # "$(COMPONNENT_COPYONLY)"==""
+
diff --git a/solenv/inc/found_no.mk b/solenv/inc/found_no.mk
new file mode 100644
index 000000000000..43c888f8d90d
--- /dev/null
+++ b/solenv/inc/found_no.mk
@@ -0,0 +1,5 @@
+no_traget:
+ @echo -----------------------------------------------
+ @echo Error: No makefile.mk found!
+ @echo -----------------------------------------------
+ force_dmake_to_error
diff --git a/solenv/inc/installationtest.mk b/solenv/inc/installationtest.mk
new file mode 100644
index 000000000000..8540140d1533
--- /dev/null
+++ b/solenv/inc/installationtest.mk
@@ -0,0 +1,125 @@
+#*************************************************************************
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#***********************************************************************/
+
+.IF "$(OS)" == "WNT"
+my_file = file:///
+.ELSE
+my_file = file://
+.END
+
+# The following conditional is an approximation of: UPDATER set to YES and
+# SHIPDRIVE set and CWS_WORK_STAMP not set and either SOL_TMP not set or
+# SOLARENV set to a pathname of which SOL_TMP is not a prefix:
+.IF "$(UPDATER)" == "YES" && "$(SHIPDRIVE)" != "" && \
+ "$(CWS_WORK_STAMP)" == "" && "$(SOLARENV:s/$(SOL_TMP)//" == "$(SOLARENV)"
+my_instsets = $(shell ls -dt \
+ $(SHIPDRIVE)/$(INPATH)/OpenOffice/archive/$(WORK_STAMP)_$(LAST_MINOR)_native_packed-*_$(defaultlangiso).$(BUILD))
+installationtest_instset = $(my_instsets:1)
+.ELSE
+installationtest_instset = \
+ $(SOLARSRC)/instsetoo_native/$(INPATH)/OpenOffice/archive/install/$(defaultlangiso)
+.END
+
+.IF "$(OS)" == "WNT"
+installationtest_instpath = `cat $(MISC)/$(TARGET)/installation.flag`
+.ELSE
+installationtest_instpath = $(SOLARVERSION)/$(INPATH)/installation$(UPDMINOREXT)
+.END
+
+.IF "$(OS)" == "MACOSX"
+my_sofficepath = \
+ $(installationtest_instpath)/opt/OpenOffice.org.app/Contents/MacOS/soffice
+.ELIF "$(OS)" == "WNT"
+my_sofficepath = \
+ $(installationtest_instpath)'/opt/OpenOffice.org 3/program/soffice.exe'
+.ELSE
+my_sofficepath = \
+ $(installationtest_instpath)/opt/openoffice.org3/program/soffice
+.END
+
+.IF "$(OOO_TEST_SOFFICE)" == ""
+my_soffice = path:$(my_sofficepath)
+.ELSE
+my_soffice = '$(OOO_TEST_SOFFICE:s/'/'\''/)'
+.END
+
+.IF "$(OOO_LIBRARY_PATH_VAR)" != ""
+my_cppenv = \
+ -env:arg-env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"
+my_javaenv = \
+ -Dorg.openoffice.test.arg.env=$(OOO_LIBRARY_PATH_VAR)"$${{$(OOO_LIBRARY_PATH_VAR)+=$$$(OOO_LIBRARY_PATH_VAR)}}"
+.END
+
+# Work around Windows problems with long pathnames (see issue 50885) by
+# installing into the temp directory instead of the module output tree (in which
+# case $(TARGET).installation.flag contains the path to the temp installation,
+# which is removed after smoketest); can be removed once issue 50885 is fixed;
+# on other platforms, a single installation to solver is created in
+# smoketestoo_native:
+.IF "$(OS)" == "WNT" && "$(OOO_TEST_SOFFICE)" == ""
+$(MISC)/$(TARGET)/installation.flag : $(shell \
+ ls $(installationtest_instset)/OOo_*_install-arc_$(defaultlangiso).zip)
+ $(MKDIRHIER) $(@:d)
+ my_tmp=$$(cygpath -m $$(mktemp -dt ooosmoke.XXXXXX)) && \
+ unzip $(installationtest_instset)/OOo_*_install-arc_$(defaultlangiso).zip \
+ -d "$$my_tmp" && \
+ mv "$$my_tmp"/OOo_*_install-arc_$(defaultlangiso) "$$my_tmp"/opt && \
+ echo "$$my_tmp" > $@
+.END
+
+cpptest .PHONY :
+ $(RM) -r $(MISC)/$(TARGET)/user
+ $(MKDIRHIER) $(MISC)/$(TARGET)/user
+ $(CPPUNITTESTER) \
+ -env:UNO_SERVICES=$(my_file)$(SOLARXMLDIR)/ure/services.rdb \
+ -env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/types.rdb \
+ -env:arg-soffice=$(my_soffice) -env:arg-user=$(MISC)/$(TARGET)/user \
+ $(my_cppenv) $(TEST_ARGUMENTS:^"-env:arg-testarg.") $(CPPTEST_LIBRARY)
+ $(RM) -r $(MISC)/$(TARGET)/user
+.IF "$(OS)" == "WNT" && "$(OOO_TEST_SOFFICE)" == ""
+ $(RM) -r $(installationtest_instpath) $(MISC)/$(TARGET)/installation.flag
+cpptest : $(MISC)/$(TARGET)/installation.flag
+.END
+
+.IF "$(SOLAR_JAVA)" == "TRUE" && "$(OOO_JUNIT_JAR)" != ""
+javatest .PHONY : $(JAVATARGET)
+ $(RM) -r $(MISC)/$(TARGET)/user
+ $(MKDIRHIER) $(MISC)/$(TARGET)/user
+ $(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \
+ '$(OOO_JUNIT_JAR)$(PATH_SEPERATOR)$(CLASSPATH)' \
+ -Dorg.openoffice.test.arg.soffice=$(my_soffice) \
+ -Dorg.openoffice.test.arg.user=$(my_file)$(PWD)/$(MISC)/$(TARGET)/user \
+ $(my_javaenv) $(TEST_ARGUMENTS:^"-Dorg.openoffice.test.arg.testarg.") \
+ org.junit.runner.JUnitCore \
+ $(foreach,i,$(JAVATESTFILES) $(subst,/,. $(PACKAGE)).$(i:s/.java//))
+ $(RM) -r $(MISC)/$(TARGET)/user
+.IF "$(OS)" == "WNT" && "$(OOO_TEST_SOFFICE)" == ""
+ $(RM) -r $(installationtest_instpath) $(MISC)/$(TARGET)/installation.flag
+javatest : $(MISC)/$(TARGET)/installation.flag
+.END
+.ELSE
+javatest .PHONY :
+ echo 'javatest needs SOLAR_JAVA=TRUE and OOO_JUNIT_JAR'
+.END
diff --git a/solenv/inc/javaunittest.mk b/solenv/inc/javaunittest.mk
new file mode 100644
index 000000000000..e129052a445e
--- /dev/null
+++ b/solenv/inc/javaunittest.mk
@@ -0,0 +1,107 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# Makefile template for directories that contain Java unit tests.
+#
+# Before including this makefile, the following variables should be set:
+# - PRJ, PRJNAME, TARGET
+# - PACKAGE
+# - JAVATESTFILES: the unit test classes;
+# each one of the form <basename>.java;
+# these java files must only define classes within the package corresponding
+# to PACKAGE, the name of each defined (outer) class should end with "_Test"
+# - JAVAFILES: optional java files, corresponding class files are generated
+# that can be used when compiling or running the tests;
+# each one of the form <basename>.java;
+# these java files must only define classes within the package corresponding
+# to PACKAGE, the name of each defined (outer) class should start with
+# "Test"
+# - IDLTESTFILES: optional idl files, corresponding class files are generated
+# that can be used when compiling or running the tests;
+# each one of the form <basename>.idl;
+# these idl files must only define entities within the module corresponding
+# to PACKAGE, the name of each defined entity should start with "Test"
+# - JARFILES: optional jar files that can be used when compiling or running the
+# tests;
+# each one of the form <basename>.jar
+# All generated class files are placed into <platform>/class/test/ instead of
+# <platform>/class/, so that they are not accidentally included in jar files
+# packed from <platform>/class/ subdirectories.
+
+TESTS := $(subst,.java,.test $(JAVATESTFILES))
+JAVAFILES +:= $(JAVATESTFILES)
+JARFILES +:= OOoRunner.jar
+
+.INCLUDE: settings.mk
+
+.IF "$(XCLASSPATH)" == ""
+XCLASSPATH := $(CLASSDIR)
+.ELSE
+XCLASSPATH !:= $(XCLASSPATH)$(PATH_SEPERATOR)$(CLASSDIR)
+.ENDIF
+CLASSDIR !:= $(CLASSDIR)/test
+
+.INCLUDE: target.mk
+
+ALLTAR: $(TESTS)
+
+$(JAVAFILES): $(MISC)/$(TARGET).classdir.flag
+
+$(MISC)/$(TARGET).classdir.flag:
+ - $(MKDIR) $(CLASSDIR)
+ $(TOUCH) $@
+
+.IF "$(TESTS)" != ""
+$(TESTS): $(JAVACLASSFILES)
+.ENDIF
+
+%.test .PHONY: %.java
+ $(JAVAI) $(JAVAIFLAGS) $(JAVACPS) $(CLASSPATH) org.openoffice.Runner \
+ -TestBase java_complex -NoOffice yes \
+ -o $(subst,/,. $(subst,.test, $(PACKAGE).$@))
+
+.IF "$(IDLTESTFILES)" != ""
+
+# The following dependency (to execute javac whenever javamaker has run) does
+# not work reliably, see #i28827#:
+$(JAVAFILES) $(JAVACLASSFILES): $(MISC)/$(TARGET).javamaker.flag
+
+$(MISC)/$(TARGET).javamaker.flag: $(MISC)/$(TARGET).rdb
+ $(JAVAMAKER) -O$(CLASSDIR) -BUCR -nD $< -X$(SOLARBINDIR)/types.rdb
+ $(TOUCH) $@
+
+$(MISC)/$(TARGET).rdb .ERRREMOVE: \
+ $(foreach,i,$(IDLTESTFILES) $(subst,.idl,.urd $(MISC)/$(TARGET)/$i))
+ - rm $@
+ $(REGMERGE) $@ /UCR $<
+
+$(foreach,i,$(IDLTESTFILES) $(subst,.idl,.urd $(MISC)/$(TARGET)/$i)): \
+ $(IDLTESTFILES)
+ - $(MKDIR) $(MISC)/$(TARGET)
+ $(IDLC) -O$(MISC)/$(TARGET) -I$(SOLARIDLDIR) -cid -we $<
+
+.ENDIF
diff --git a/solenv/inc/lang.mk b/solenv/inc/lang.mk
new file mode 100644
index 000000000000..fc5321653fbc
--- /dev/null
+++ b/solenv/inc/lang.mk
@@ -0,0 +1,57 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+#.IF "$(GUI)"=="UNX" || "$(GUIBASE)"=="WIN"
+#LANG_GUI=WIN
+#.ELSE
+LANG_GUI=$(GUI)
+#.ENDIF
+
+###################################################
+#
+# entries for charsets
+
+# variable name equals $(solarlang)$(LANG_GUI)
+#
+###################################################
+
+#deut$(LANG_GUI)*=-CHARSET_microsoft-cp1252
+
+###################################################
+#
+# set defaults
+#
+###################################################
+
+#.IF "$(solarlang)" == ""
+#solarlang=deut
+#.ENDIF
+
+RSC_SRS_CHARSET=-CHARSET_DONTKNOW
+default$(LANG_GUI)*=-CHARSET_UTF8
+
diff --git a/solenv/inc/layout.mk b/solenv/inc/layout.mk
new file mode 100644
index 000000000000..0fb4c39454c9
--- /dev/null
+++ b/solenv/inc/layout.mk
@@ -0,0 +1,32 @@
+TRALAY=$(AUGMENT_LIBRARY_PATH) tralay
+XML_DEST=$(DLLDEST)
+XML_LANGS=$(alllangiso)
+
+ALL_XMLS=$(foreach,i,$(XML_FILES) "$(XML_DEST)/$i") $(foreach,i,$(XML_LANGS) $(foreach,j,$(XML_FILES) "$(XML_DEST)/$i/$j"))
+
+# Must remove the -j (no duplicate base file names) flag
+ZIPUPDATE=-u
+XML_ZIP = $(PRJNAME)-layout
+
+ALLTAR: localize.sdf $(XML_ZIP)
+
+$(XML_ZIP): $(ALL_XMLS)
+
+ZIP1DIR=$(XML_DEST)
+ZIP1TARGET=$(XML_ZIP)
+ZIP1LIST=$(ALL_XMLS:s@$(XML_DEST)/@@)
+
+$(foreach,i,$(XML_LANGS) $(XML_DEST)/$i/%.xml): %.xml
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ @echo $(foreach,i,$(XML_LANGS) $(XML_DEST)/$i/%.xml): %.xml
+ $(TRALAY) -m localize.sdf -o "$(XML_DEST)" -l $(XML_LANGS:f:t" -l ") "$<"
+
+$(XML_DEST)/%.xml: %.xml
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)$(COPY) "$<" "$@"
+
+# Don't want to overwrite filled localize.sdf with empty template
+template.sdf:
+ $(foreach,i,$(XML_FILES) $(TRALAY) -l en-US "$i") > $@
+
+$(ZIP1LIST): localize.sdf
diff --git a/solenv/inc/libs.mk b/solenv/inc/libs.mk
new file mode 100644
index 000000000000..4f7ffbf40851
--- /dev/null
+++ b/solenv/inc/libs.mk
@@ -0,0 +1,541 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+LIBSMKREV!:="$$Revision: 1.134.2.3 $$"
+
+.IF ("$(GUI)"=="UNX" || "$(COM)"=="GCC") && "$(GUI)"!="OS2"
+
+#
+#externe libs in plattform.mk
+#
+.IF "$(GUI)$(COM)"=="WNTGCC"
+AWTLIB*=$(JAVA_HOME)/lib/jawt.lib
+.ELSE # "$(GUI)$(COM)"=="WNTGCC"
+AWTLIB*=-ljawt
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+AVMEDIALIB=-lavmedia$(DLLPOSTFIX)
+.IF "$(GUI)$(COM)"=="WNTGCC"
+.INCLUDE .IGNORE : icuversion.mk
+ICUINLIB=-licuin$(ICU_MAJOR)$(ICU_MINOR)
+ICULELIB=-licule$(ICU_MAJOR)$(ICU_MINOR)
+ICUUCLIB=-licuuc$(ICU_MAJOR)$(ICU_MINOR)
+ICUDATALIB=-licudt$(ICU_MAJOR)$(ICU_MINOR)
+.ELSE # "$(GUI)$(COM)"=="WNTGCC"
+ICUINLIB=-licui18n
+ICULELIB=-licule
+ICUUCLIB=-licuuc
+ICUDATALIB=-licudata
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+I18NUTILLIB=-li18nutil$(COMID)
+.INCLUDE .IGNORE : i18npool/version.mk
+I18NISOLANGLIB=-li18nisolang$(ISOLANG_MAJOR)$(COMID)
+I18NPAPERLIB=-li18npaper$(DLLPOSTFIX)
+.IF "$(GUI)$(COM)"=="WNTGCC"
+SALHELPERLIB=-lsalhelper$(UDK_MAJOR)$(COMID)
+.ELSE # "$(GUI)$(COM)"=="WNTGCC"
+SALHELPERLIB=-luno_salhelper$(COMID)
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+XMLSCRIPTLIB =-lxcr$(DLLPOSTFIX)
+.INCLUDE .IGNORE : comphelper/version.mk
+COMPHELPERLIB=-lcomphelp$(COMPHLP_MAJOR)$(COMID)
+CONNECTIVITYLIB=-lconnectivity
+LDAPBERLIB=-lldapber
+TOOLSLIBST=-latools
+BPICONVLIB=-lbpiconv
+TOOLSLIB=-ltl$(DLLPOSTFIX)
+.IF "$(GUI)$(COM)"=="WNTGCC"
+CPPULIB=-lcppu$(UDK_MAJOR)
+CPPUHELPERLIB=-lcppuhelper$(UDK_MAJOR)$(COMID)
+.ELSE # "$(GUI)$(COM)"=="WNTGCC"
+CPPULIB=-luno_cppu
+CPPUHELPERLIB=-luno_cppuhelper$(COMID)
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.INCLUDE .IGNORE : ucbhelper/version.mk
+UCBHELPERLIB=-lucbhelper$(UCBHELPER_MAJOR)$(COMID)
+.IF "$(SYSTEM_OPENSSL)" == "YES"
+OPENSSLLIB=$(OPENSSL_LIBS)
+OPENSSLLIBST=$(STATIC) $(OPENSSL_LIBS) $(DYNAMIC)
+.ELSE # "$(SYSTEM_OPENSSL)" == "YES
+OPENSSLLIB=-lssl -lcrypto
+.IF "$(GUI)$(COM)"=="WNTGCC"
+OPENSSLLIBST=-lssl_static -lcrypto_static
+.ELSE # "$(GUI)$(COM)"=="WNTGCC"
+OPENSSLLIBST=$(STATIC) -lssl -lcrypto $(DYNAMIC)
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.ENDIF # "$(SYSTEM_OPENSSL)" == "YES"
+.IF "$(GUI)$(COM)"=="WNTGCC"
+REGLIB=-lreg$(UDK_MAJOR)
+.ELSE # "$(GUI)$(COM)"=="WNTGCC"
+REGLIB=-lreg
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.INCLUDE .IGNORE : vos/version.mk
+VOSLIB=-lvos$(VOS_MAJOR)$(COMID)
+XMLOFFLIB=-lxo$(DLLPOSTFIX)
+XMLOFFLLIB=-lxol
+.IF "$(GUI)$(COM)"=="WNTGCC"
+STORELIB=-lstore$(UDK_MAJOR)
+SALLIB=-lsal$(UDK_MAJOR)
+.ELSE # "$(GUI)$(COM)"=="WNTGCC"
+STORELIB=-lstore
+SALLIB=-luno_sal
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.INCLUDE .IGNORE : connectivity/version.mk
+ODBCLIB=-lodbc$(DLLPOSTFIX)
+ODBCBASELIB=-lodbcbase$(DLLPOSTFIX)
+DBFILELIB=-lfile$(DLLPOSTFIX)
+.IF "$(GUI)$(COM)"=="WNTGCC"
+RMCXTLIB=-lrmcxt$(UDK_MAJOR)
+.ELSE # "$(GUI)$(COM)"=="WNTGCC"
+RMCXTLIB=-lrmcxt
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+BTSTRPLIB=-lbtstrp
+BTSTRPDTLIB=-lbootstrpdt$(DLLPOSTFIX)
+SOLDEPLIB=-lsoldep$(DLLPOSTFIX)
+TRANSEXLIB=-ltransex
+OTXLIB=-lotx_ind
+OSXLIB=-losx
+UNOTOOLSLIB=-lutl$(DLLPOSTFIX)
+SOTLIB=-lsot$(DLLPOSTFIX)
+.IF "$(GUI)$(COM)"=="WNTGCC"
+MOZBASELIBST=$(STATIC) -lnspr4_s -lxpcombase_s
+.ELSE # "$(GUI)$(COM)"=="WNTGCC"
+MOZBASELIBST=$(STATIC) -lnspr4 -lxpcombase_s $(DYNAMIC)
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+MOZBASELIB=-lnspr4 -lxpcom
+.IF "$(GUI)$(COM)"=="WNTGCC"
+LDAPSDKLIB=-lnsldap32v50
+.ELSE # "$(GUI)$(COM)"=="WNTGCC"
+.IF "$(WITH_OPENLDAP)" == "YES"
+LDAPSDKLIB=-lldap
+.ELSE
+LDAPSDKLIB=-lldap50
+.ENDIF
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+
+ICOLIB=-lico$(DLLPOSTFIX)
+VCLLIB=-lvcl$(DLLPOSTFIX)
+OOXLIB=-loox$(DLLPOSTFIX)
+BASEGFXLIB=-lbasegfx$(DLLPOSTFIX)
+DRAWINGLAYERLIB=-ldrawinglayer$(DLLPOSTFIX)
+BASEBMPLIB=-lbasebmp$(DLLPOSTFIX)
+CANVASTOOLSLIB=-lcanvastools$(DLLPOSTFIX)
+CPPCANVASLIB=-lcppcanvas$(DLLPOSTFIX)
+FORLIB=-lfor$(DLLPOSTFIX)
+FORUILIB=-lforui$(DLLPOSTFIX)
+
+.IF "$(SYSTEM_AGG)" == "YES"
+AGGLIB=-lagg
+.ELSE
+AGGLIB=-lagg$(DLLPOSTFIX)
+.ENDIF
+FREETYPE_LIBS*=-lfreetype
+FREETYPELIB=$(FREETYPE_LIBS)
+TKLIB=-ltk$(DLLPOSTFIX)
+LAYOUTLIB=-ltklayout$(DLLPOSTFIX)
+SVTOOLLIB=-lsvt$(DLLPOSTFIX)
+XMLSECLIB=-lxmlsec1
+XMLSECLIB-NSS=-lxmlsec1-nss
+.IF "$(SYSTEM_LIBXML)"=="YES"
+LIBXML2LIB=$(LIBXML_LIBS)
+.ELSE
+LIBXML2LIB=-lxml2
+.ENDIF
+NSS3LIB=-lnss3
+NSPR4LIB=-lnspr4
+PLC4LIB=-lplc4
+NSSCRYPTOLIBS=$(XMLSECLIB-NSS) $(XMLSECLIB) $(LIBXML2LIB) $(NSS3LIB) $(NSPR4LIB) $(PLC4LIB)
+.IF "$(GUI)$(COM)"=="WNTGCC"
+XMLSECLIB-MS=-lxmlsec1-mscrypto
+MSCRYPTOLIBS=$(XMLSECLIB) $(XMLSECLIB-MS) $(LIBXML2LIB) $(CRYPT32LIB) $(ADVAPI32LIB)
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+BROOKERLIB=-lbrooker$(DLLPOSTFIX)
+SIMPLECMLIB=-lsimplecm$(DLLPOSTFIX)
+COMMUNILIB=-lcommuni$(DLLPOSTFIX)
+BTCOMMUNILIB=-lbtcommuni$(DLLPOSTFIX)
+AUTOMATIONLIB=-lsts$(DLLPOSTFIX)
+SVLLIB=-lsvl$(DLLPOSTFIX)
+TKTLIB=-ltkt$(DLLPOSTFIX)
+SAXLIB=-lsax$(DLLPOSTFIX)
+MAILLIB=-lmail
+DOCMGRLIB=-ldmg$(DLLPOSTFIX)
+BASICLIB=-lsb$(DLLPOSTFIX)
+.IF "$(ENABLE_VBA)"=="YES"
+VBAHELPERLIB=-lvbahelper$(DLLPOSTFIX)
+.ENDIF
+DBTOOLSLIB=-ldbtools$(DLLPOSTFIX)
+HM2LIBSH=-lhmwrpdll
+HM2LIBST=-lhmwrap
+LINGULIB=$(HM2LIBST)
+LNGLIB=-llng$(DLLPOSTFIX)
+.IF "$(SYSTEM_EXPAT)"=="YES"
+EXPAT3RDLIB=-lexpat
+EXPATASCII3RDLIB=-lexpat
+.ELSE
+EXPAT3RDLIB=-lexpat_xmlparse -lexpat_xmltok
+EXPATASCII3RDLIB=-lascii_expat_xmlparse -lexpat_xmltok
+.ENDIF
+.IF "$(SYSTEM_ZLIB)"=="YES"
+ZLIB3RDLIB=-lz
+.ELSE
+ZLIB3RDLIB=-lzlib
+.ENDIF
+.IF "$(SYSTEM_JPEG)"=="YES"
+.IF "$(SOLAR_JAVA)" != "" && "$(JDK)" != "gcj" && "$(OS)" != "MACOSX"
+#i34482# Blackdown/Sun jdk is in the libsearch patch and has a libjpeg :-(
+.IF "$(OS)" == "FREEBSD"
+JPEG3RDLIB=/usr/local/lib/libjpeg.so
+.ELIF "$(CPUNAME)" == "X86_64" || "$(CPUNAME)" == "S390X" || "$(CPUNAME)" == "POWERPC64"
+JPEG3RDLIB=/usr/lib64/libjpeg.so
+.ELSE
+JPEG3RDLIB=/usr/lib/libjpeg.so
+.ENDIF
+.ELSE
+JPEG3RDLIB=-ljpeg
+.ENDIF
+.ELSE
+JPEG3RDLIB=-ljpeglib
+.ENDIF
+.IF "$(SYSTEM_NEON)" == "YES"
+NEON3RDLIB=-lneon
+.ELIF "$(GUI)$(COM)"=="WNTGCC"
+NEON3RDLIB=-lneon
+.ELIF "$(OS)" == "MACOSX"
+NEON3RDLIB=$(SOLARLIBDIR)/libneon.dylib
+.ELSE
+NEON3RDLIB=-lneon
+.ENDIF
+.IF "$(SYSTEM_DB)" == "YES"
+BERKELEYLIB=-ldb
+.ELSE
+BERKELEYLIB=-ldb-4.7
+.ENDIF
+CURLLIB=-lcurl
+SFX2LIB=-lsfx$(DLLPOSTFIX)
+SFXLIB=-lsfx$(DLLPOSTFIX)
+EGGTRAYLIB=-leggtray$(DLLPOSTFIX)
+SFXDEBUGLIB=
+FWELIB=-lfwe$(DLLPOSTFIX)
+FWILIB=-lfwi$(DLLPOSTFIX)
+SVXCORELIB=-lsvxcore$(DLLPOSTFIX)
+MSFILTERLIB=-lmsfilter$(DLLPOSTFIX)
+SVXLIB=-lsvx$(DLLPOSTFIX)
+EDITENGLIB=-lediteng$(DLLPOSTFIX)
+BASCTLLIB=-lbasctl$(DLLPOSTFIX)
+BASICIDELIB=-lybctl
+SVXLLIB=-lsvxl
+CHAOSLIB=-lcnt$(DLLPOSTFIX)
+UUILIB=-luui$(DLLPOSTFIX)
+DGLIB=
+SCHLIB=-lysch
+SMLIB=-lysm
+OFALIB=-lofa$(DLLPOSTFIX)
+PRXLIB=-llprx2$(DLLPOSTFIX)
+PAPILIB=-lpap$(DLLPOSTFIX)
+SCLIB=-lsclib
+SDLIB=-lsdlib
+SDLLIB=-lsdl
+SWLIB=-lswlib
+ISWLIB=-lsw$(DLLPOSTFIX)
+ISCLIB=-lsc$(DLLPOSTFIX)
+ISDLIB=-lsd$(DLLPOSTFIX)
+PKGCHKLIB=-lpkgchk$(DLLPOSTFIX)
+HELPLINKERLIB=-lhelplinker$(DLLPOSTFIX)
+.IF "$(GUI)$(COM)"=="WNTGCC"
+JVMACCESSLIB = -ljvmaccess$(UDK_MAJOR)$(COMID)
+.ELSE # "$(GUI)$(COM)"=="WNTGCC"
+JVMACCESSLIB = -ljvmaccess$(COMID)
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.IF "$(OS)" == "WNT"
+CPPUNITLIB = -lcygcppunit-1-12-1
+.ELSE
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CPPUNITLIB = $(CPPUNIT_LIBS)
+.ELSE
+CPPUNITLIB = -lcppunit
+.ENDIF
+.ENDIF
+.IF "$(SYSTEM_LIBXSLT)"=="YES"
+XSLTLIB=$(LIBXSLT_LIBS)
+.ELSE
+XSLTLIB=-lxslt $(LIBXML2LIB)
+.ENDIF
+.IF "$(GUI)$(COM)"=="WNTGCC"
+JVMFWKLIB = -ljvmfwk$(UDK_MAJOR)
+.ELSE # "$(GUI)$(COM)"=="WNTGCC"
+JVMFWKLIB = -ljvmfwk
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.IF "$(SYSTEM_REDLAND)"=="YES"
+REDLANDLIB=$(REDLAND_LIBS)
+.ELSE
+REDLANDLIB=-lrdf
+.ENDIF
+
+
+# #110743#
+# For BinFilters, some libs were added.
+#
+
+BFSVXLIB=-lbf_svx$(DLLPOSTFIX)
+BFSCHLIB=-lbf_ysch
+BFSMLIB=-lbf_ysm
+BFSCLIB=-lbf_sclib
+BFSDLIB=-lbf_sdlib
+BFSWLIB=-lbf_swlib
+BFOFALIB=-lbf_ofa$(DLLPOSTFIX)
+LEGACYSMGRLIB=-llegacy_binfilters$(DLLPOSTFIX)
+BFXMLOFFLIB=-lbf_xo$(DLLPOSTFIX)
+BFGOODIESLIB=-lbf_go$(DLLPOSTFIX)
+BFBASICLIB=-lbf_sb$(DLLPOSTFIX)
+BFSO3LIB=-lbf_so$(DLLPOSTFIX)
+BFSVTOOLLIB=-lbf_svt$(DLLPOSTFIX)
+
+#
+# USED_%NAME%_LIBS
+# Variablen, in denen in gueltiger Reihenfolge ALLE Libraries,
+# die unterhalb von %NAME% liegen, zusammengefasst werden
+#
+
+# Libraries
+USED_OSL_LIBS =
+USED_VOS_LIBS = $(OSLLIB)
+USED_UNO_LIBS = $(VOSLIB) $(OSLLIB)
+USED_TOOLS_LIBS =
+USED_SOT_LIBS = $(TOOLSLIB)
+USED_VCL_LIBS = $(SOTLIB) $(TOOLSLIB) $(USED_UNO_LIBS)
+
+# Applikationen
+USED_BOOTSTRP_LIBS= $(TOOLSLIB)
+USED_RCLIENT_LIBS = $(VCLLIB) $(SOTLIB) $(TOOLSLIB) \
+ $(USED_UNO_LIBS)
+
+SABLOT3RDLIB=-lsablot
+APP3RDLIB=-lapp
+SAMPLE3RDLIB=-lsample
+HNJLIB*=-lhyphen
+MYSPELLLIB=-lmyspell
+COSVLIB=-lcosv
+UDMLIB=-ludm
+ULINGULIB=-lulingu
+.IF "$(SYSTEM_HUNSPELL)" == "YES"
+HUNSPELLLIB=$(HUNSPELL_LIBS)
+.ELSE
+HUNSPELLLIB=-lhunspell-1.2
+.ENDIF
+.IF "$(SYSTEM_MYTHES)" == "YES"
+MYTHESLIB=$(MYTHES_LIBS)
+.ELSE
+MYTHESLIB=-lmythes-1.2
+.ENDIF
+PYUNOLIB=-lpyuno
+LPSOLVELIB=-llpsolve55
+SOFFICELIB=-lsofficeapp
+UNOPKGAPPLIB=-lunopkgapp
+TESTLIB=-ltest
+XMLREADERLIB=-lxmlreader
+
+.ELSE # ("$(GUI)"=="UNX" || "$(COM)"=="GCC") && "$(GUI)"!="OS2"
+
+AWTLIB*=jawt.lib
+AVMEDIALIB=iavmedia.lib
+ICUINLIB=icuin.lib
+ICULELIB=icule.lib
+ICUUCLIB=icuuc.lib
+.IF "$(GUI)"=="OS2"
+ICUDATALIB=icudt.lib
+.ELSE
+ICUDATALIB=icudata.lib
+.ENDIF
+I18NUTILLIB=ii18nutil.lib
+I18NISOLANGLIB=ii18nisolang.lib
+I18NPAPERLIB=ii18npaper.lib
+SALHELPERLIB=isalhelper.lib
+XMLSCRIPTLIB=ixcr.lib
+COMPHELPERLIB=icomphelp.lib
+CONNECTIVITYLIB=connectivity.lib
+LDAPBERLIB=ldapber.lib
+CPPULIB=icppu.lib
+CPPUHELPERLIB=icppuhelper.lib
+UCBHELPERLIB=iucbhelper.lib
+.IF "$(GUI)"=="OS2"
+OPENSSLLIB=ssl.lib crypto.lib
+.ELSE
+OPENSSLLIB=ssleay32.lib libeay32.lib
+.ENDIF
+ODBCLIB=iodbc.lib
+ODBCBASELIB=iodbcbase.lib
+DBFILELIB=ifile.lib
+TOOLSLIB=itools.lib
+TOOLSLIBST=atools.lib
+BPICONVLIB=bpiconv.lib
+SALLIB=isal.lib
+VOSLIB=ivos.lib
+UNOTOOLSLIB=iutl.lib
+RMCXTLIB=irmcxt.lib
+XMLOFFLIB=ixo.lib
+XMLOFFLLIB=xol.lib
+STORELIB=istore.lib
+OTXLIB=otx_ind.lib
+OSXLIB=osx.lib
+REGLIB=ireg.lib
+EXTLIB=iext.lib
+SOTLIB=sot.lib
+MOZBASELIBST=nspr4_s.lib xpcombase_s.lib
+MOZBASELIB=nspr4.lib xpcom.lib
+LDAPSDKLIB=nsldap32v50.lib
+PAPILIB=ipap.lib
+SFX2LIB=sfx.lib
+SFXLIB=$(SFX2LIB)
+FWELIB=ifwe.lib
+FWILIB=ifwi.lib
+BTSTRPLIB=btstrp.lib
+BTSTRPDTLIB=bootstrpdt.lib
+SOLDEPLIB=soldep.lib
+TRANSEXLIB=transex.lib
+ICOLIB=icom.lib
+SVTOOLLIB=svtool.lib
+XMLSECLIB=libxmlsec.lib
+XMLSECLIB-MS=libxmlsec-mscrypto.lib
+XMLSECLIB-NSS=libxmlsec-nss.lib
+LIBXML2LIB=libxml2.lib
+NSS3LIB=nss3.lib
+NSPR4LIB=nspr4.lib
+PLC4LIB=plc4.lib
+NSSCRYPTOLIBS=$(XMLSECLIB-NSS) $(XMLSECLIB) $(LIBXML2LIB) $(NSS3LIB) $(NSPR4LIB) $(PLC4LIB)
+MSCRYPTOLIBS=$(XMLSECLIB-MS) $(XMLSECLIB) $(LIBXML2LIB) crypt32.lib advapi32.lib
+BROOKERLIB=ibrooker.lib
+SIMPLECMLIB=isimplecm.lib
+COMMUNILIB=icommuni.lib
+BTCOMMUNILIB=ibtcommuni.lib
+AUTOMATIONLIB=ists.lib
+SVLLIB=isvl.lib
+PLUGAPPLIB=plugapp.lib
+SAXLIB=isax.lib
+MAILLIB=mail.lib
+DOCMGRLIB=docmgr.lib
+BASICLIB=basic.lib
+VBAHELPERLIB=vbahelper.lib
+TKTLIB=tkt.lib
+SJLIB=sj.lib
+SVXCORELIB=isvxcore.lib
+MSFILTERLIB=imsfilter.lib
+SVXLIB=isvx.lib
+EDITENGLIB=iediteng.lib
+BASCTLLIB=basctl.lib
+BASICIDELIB=ybctl.lib
+SVXLLIB=svxl.lib
+DBTOOLSLIB=idbtools.lib
+HM2LIBSH=hmwrpdll.lib
+HM2LIBST=hmwrap.lib
+LINGULIB=$(HM2LIBST)
+LNGLIB=ilng.lib
+EXPAT3RDLIB=expat_xmltok.lib expat_xmlparse.lib
+EXPATASCII3RDLIB=expat_xmltok.lib ascii_expat_xmlparse.lib
+ZLIB3RDLIB=zlib.lib
+JPEG3RDLIB=jpeglib.lib
+NEON3RDLIB=ineon.lib
+BERKELEYLIB=libdb47.lib
+CURLLIB=libcurl.lib
+CHAOSLIB=ichaos.lib
+UUILIB=iuui.lib
+DGLIB=
+SCHLIB=ysch.lib
+SMLIB=ysm.lib
+OFALIB=aofa.lib
+SCLIB=sclib.lib
+SDLIB=sdlib.lib
+SDLLIB=sdl.lib
+SWLIB=swlib.lib
+PRXLIB=ilprx2.lib
+ISWLIB=_sw.lib
+ISCLIB=sci.lib
+ISDLIB=sdi.lib
+VCLLIB=ivcl.lib
+OOXLIB=ioox.lib
+BASEGFXLIB=ibasegfx.lib
+DRAWINGLAYERLIB=idrawinglayer.lib
+BASEBMPLIB=ibasebmp.lib
+CANVASTOOLSLIB=icanvastools.lib
+CPPCANVASLIB=icppcanvas.lib
+FORLIB=ifor.lib
+FORUILIB=iforui.lib
+AGGLIB=iagg.lib
+TKLIB=itk.lib
+LAYOUTLIB=itklayout.lib
+SVXLLIB=svxl.lib
+FREETYPELIB=freetype.lib
+PKGCHKLIB=ipkgchk.lib
+HELPLINKERLIB=ihelplinker.lib
+JVMACCESSLIB = ijvmaccess.lib
+CPPUNITLIB = icppunit_dll.lib
+XSLTLIB = libxslt.lib $(LIBXML2LIB)
+.IF "$(GUI)"=="OS2"
+REDLANDLIB = raptor.a rasqal.a rdf.a $(LIBXML2LIB) $(OPENSSLLIB) pthread.lib
+.ELSE
+REDLANDLIB = librdf.lib
+.ENDIF
+
+JVMFWKLIB = ijvmfwk.lib
+
+# #110743#
+# For BinFilters, some libs were added.
+#
+
+BFSVXLIB=bf_svx.lib
+BFSCHLIB=bf_ysch.lib
+BFSMLIB=bf_ysm.lib
+BFSCLIB=bf_sclib.lib
+BFSDLIB=bf_sdlib.lib
+BFSWLIB=bf_swlib.lib
+BFOFALIB=bf_ofa.lib
+BFXMLOFFLIB=ibf_xo.lib
+BFGOODIESLIB=bf_go.lib
+BFBASICLIB=bf_sb.lib
+BFSO3LIB=bf_so.lib
+LEGACYSMGRLIB=ilegacy_binfilters.lib
+BFSVTOOLLIB=bf_svt.lib
+
+SABLOT3RDLIB= $(LIBPRE) sablot.lib
+APP3RDLIB= $(LIBPRE) app.lib
+SAMPLE3RDLIB= $(LIBPRE) sample.lib
+HNJLIB*=libhnj.lib
+MYSPELLLIB= $(LIBPRE) myspell.lib
+COSVLIB= $(LIBPRE) cosv.lib
+UDMLIB= $(LIBPRE) udm.lib
+ULINGULIB=$(LIBPRE) libulingu.lib
+.IF "$(SYSTEM_HUNSPELL)" == "YES"
+HUNSPELLLIB=$(HUNSPELL_LIBS)
+.ELSE
+HUNSPELLLIB=$(LIBPRE) libhunspell.lib
+.ENDIF
+MYTHESLIB=libmythes.lib
+PYUNOLIB=ipyuno.lib
+LPSOLVELIB=lpsolve55.lib
+SOFFICELIB=isofficeapp.lib
+UNOPKGAPPLIB=iunopkgapp.lib
+TESTLIB=itest.lib
+XMLREADERLIB=ixmlreader.lib
+
+.ENDIF # ("$(GUI)"=="UNX" || "$(COM)"=="GCC") && "$(GUI)"!="OS2"
diff --git a/solenv/inc/mime.types b/solenv/inc/mime.types
new file mode 100644
index 000000000000..43820404c434
--- /dev/null
+++ b/solenv/inc/mime.types
@@ -0,0 +1,201 @@
+# This file controls what Internet media types are sent to the client for
+# given file extension(s). Sending the correct media type to the client
+# is important so they know how to handle the content of the file.
+# For more information about Internet media types, please read
+# RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type
+# registry is at <ftp://ftp.iana.org/assignments/media-types/>.
+# MIME type Extension
+application/EDI-Consent
+application/EDI-X12
+application/EDIFACT
+application/activemessage
+application/andrew-inset ez
+application/applefile
+application/atomicmail
+application/cals-1840
+application/commonground
+application/cybercash
+application/cu-seeme csm cu
+application/dca-rft
+application/dec-dx
+application/eshop
+application/excel xls
+application/ghostview
+application/hyperstudio
+application/iges
+application/mac-binhex40 hqx
+application/mac-compactpro cpt
+application/macwriteii
+application/marc
+application/mathematica
+application/msword doc dot wrd
+application/news-message-id
+application/news-transmission
+application/octet-stream bin dms lha lzh exe class iso
+application/oda oda
+application/pdf pdf
+application/pgp pgp
+application/pgp-encrypted
+application/pgp-keys
+application/pgp-signature pgp
+application/postscript ai eps ps
+application/powerpoint ppt
+application/remote-printing
+application/rtf rtf
+application/slate
+application/wita
+application/wordperfect5.1 wp5
+application/vnd.wap.wbxml wbxml
+application/vnd.wap.wmlc wmlc
+application/vnd.wap.wmlscriptc wmlsc
+application/x-123 wk
+application/x-Wingz wz
+application/x-bcpio bcpio
+application/x-bzip2 bz2
+application/x-cdlink vcd
+application/x-chess-pgn pgn
+application/x-compress z Z
+application/x-cpio cpio
+application/x-csh csh
+application/x-debian-package deb
+application/x-director dcr dir dxr
+application/x-dvi dvi
+application/x-gtar gtar tgz
+application/x-gunzip gz
+application/x-gzip gz
+application/x-hdf hdf
+application/x-httpd-php phtml pht php
+application/x-javascript js
+application/x-java-jnlp-file jnlp
+application/x-kword kwd kwt
+application/x-kspread ksp
+application/x-kpresenter kpr kpt
+application/x-kchart chrt
+application/x-koan skp skd skt skm
+application/x-latex latex
+application/x-maker frm maker frame fm fb book fbdoc
+application/x-mif mif
+application/x-msdos-program com exe bat
+application/x-netcdf nc cdf
+application/x-ns-proxy-autoconfig pac
+application/x-perl pl pm
+application/x-rad rad
+application/x-rpm rpm spm
+application/x-sh sh
+application/x-shar shar
+application/x-shockwave-flash swf
+application/x-stuffit sit
+application/x-sv4cpio sv4cpio
+application/x-sv4crc sv4crc
+application/x-tar tar
+application/x-tcl tcl
+application/x-tex tex
+application/x-texinfo texinfo texi
+application/x-troff t tr roff
+application/x-troff-man man
+application/x-troff-me me
+application/x-troff-ms ms
+application/x-ustar ustar
+application/x-wais-source src
+application/xhtml+xml xhtml xht
+application/zip zip
+audio/basic au snd
+audio/midi mid midi kar
+audio/mpeg mpga mp2 mp3
+audio/x-mpegurl m3u
+audio/x-aiff aif aifc aiff
+audio/x-realaudio ra
+audio/x-wav wav
+chemical/x-pdb pdb
+chemical/x-xyz xyz
+image/bmp bmp
+image/gif gif
+image/ief ief
+image/jpeg jpeg jpg jpe
+image/png png
+image/tiff tiff tif
+image/vnd.djvu djvu djv
+image/vnd.wap.wbmp wbmp
+image/x-cmu-raster ras
+image/x-portable-anymap pnm
+image/x-portable-bitmap pbm
+image/x-portable-graymap pgm
+image/x-portable-pixmap ppm
+image/x-rgb rgb
+image/x-xbitmap xbm
+image/x-xpixmap xpm
+image/x-xwindowdump xwd
+message/external-body
+message/news
+message/partial
+message/rfc822
+model/iges igs iges
+model/mesh msh mesh silo
+model/vrml wrl vrml
+multipart/alternative
+multipart/appledouble
+multipart/digest
+multipart/mixed
+multipart/parallel
+text/css css
+text/html html htm
+text/plain asc txt c cc h hh cpp hpp
+text/richtext rtx
+text/rtf rtf
+text/sgml sgml sgm
+text/tab-separated-values tsv
+text/x-setext etx
+text/x-vCalendar vcs
+text/x-vCard vcf
+text/xml xml dtd xsl
+video/dl dl
+video/fli fli
+video/gl gl
+video/mpeg mp2 mpe mpeg mpg
+video/quicktime qt mov
+video/x-msvideo avi
+video/x-sgi-movie movie
+x-conference/x-cooltalk ice
+x-world/x-vrml wrl vrml
+audio/x-pn-realaudio rmm ram
+audio/vnd.rn-realaudio ra
+application/smil smi smil
+text/vnd.rn-realtext rt
+video/vnd.rn-realvideo rv
+image/vnd.rn-realflash rf swf
+application/x-shockwave-flash2-preview rf swf
+application/sdp sdp
+application/x-sdp sdp
+application/vnd.rn-realmedia rm
+image/vnd.rn-realpix rp
+application/vnd.oasis.opendocument.text odt
+application/vnd.oasis.opendocument.text-template ott
+application/vnd.oasis.opendocument.text-web oth
+application/vnd.oasis.opendocument.text-master odm
+application/vnd.oasis.opendocument.graphics odg
+application/vnd.oasis.opendocument.graphics-template otg
+application/vnd.oasis.opendocument.presentation odp
+application/vnd.oasis.opendocument.presentation-template otp
+application/vnd.oasis.opendocument.spreadsheet ods
+application/vnd.oasis.opendocument.spreadsheet-template ots
+application/vnd.oasis.opendocument.chart odc
+application/vnd.oasis.opendocument.formula odf
+application/vnd.oasis.opendocument.image odi
+application/vnd.sun.xml.writer sxw
+application/vnd.sun.xml.writer.template stw
+application/vnd.sun.xml.writer.global sxg
+application/vnd.stardivision.writer sdw vor
+application/vnd.stardivision.writer-global sgl
+application/vnd.sun.xml.calc sxc
+application/vnd.sun.xml.calc.template stc
+application/vnd.stardivision.calc sdc
+application/vnd.stardivision.chart sds
+application/vnd.sun.xml.impress sxi
+application/vnd.sun.xml.impress.template sti
+application/vnd.stardivision.impress sdd sdp
+application/vnd.sun.xml.draw sxd
+application/vnd.sun.xml.draw.template std
+application/vnd.stardivision.draw sda
+application/vnd.sun.xml.math sxm
+application/vnd.stardivision.math smf
+application/vnd.sun.xml.base odb
diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk
new file mode 100644
index 000000000000..108e841a72f4
--- /dev/null
+++ b/solenv/inc/minor.mk
@@ -0,0 +1,5 @@
+RSCVERSION=300
+RSCREVISION=300m97(Build:9566)
+BUILD=9566
+LAST_MINOR=m97
+SOURCEVERSION=DEV300
diff --git a/solenv/inc/os2.mk b/solenv/inc/os2.mk
new file mode 100644
index 000000000000..981479f184c4
--- /dev/null
+++ b/solenv/inc/os2.mk
@@ -0,0 +1,333 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# --- OS2-Environment ----------------------------------------------
+
+.IF "$(GUI)" == "OS2"
+
+# YD defined in os2env.cmd
+#.IF "$(NOSOLAR_JAVA)"==""
+#SOLAR_JAVA=TRUE
+#.ENDIF
+
+.IF "$(SOLAR_JAVA)"!=""
+JAVADEF=-DSOLAR_JAVA
+.ENDIF
+JAVAFLAGSDEBUG=-g
+
+# --- Borland ---
+.IF "$(COM)" == "BLC"
+
+JAVADEF=-DSOLAR_JAVA
+
+ASM=tasm
+AFLAGS=
+
+CXX=bcc
+CC=bcc
+CFLAGS=-c -3 -a1 -X -d -wbbf -weas -wucp -w-hid -w-par -I. $(MINUS_I)$(INCLUDE)
+CFLAGSCXX=-Pcxx -RT- -x- -V
+CFLAGSOBJGUIST=
+CFLAGSOBJCUIST=
+CFLAGSOBJGUIMT=-sm
+CFLAGSOBJCUIMT=-sm
+CFLAGSSLOGUIMT=-sm -sd
+CFLAGSSLOCUIMT=-sm -sd
+CFLAGSPROF=
+CFLAGSDEBUG=-v
+CFLAGSDBGUTIL=
+CFLAGSOPT=-Os -Ob -k-
+CFLAGSNOOPT=-Od
+CFLAGSOUTOBJ=-o
+
+LINK=tlink
+LINKFLAGS=/m /L$(LIB)
+#LINKFLAGSAPPGUI=/Toe /B:0x10000 /aa
+#Base wg. lxopt raus
+LINKFLAGSAPPGUI=/Toe /aa
+LINKFLAGSSHLGUI=/Tod
+LINKFLAGSAPPCUI=/Toe /B:0x10000 /ap
+LINKFLAGSSHLCUI=/Tod
+LINKFLAGSTACK=/S:
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=/v
+.IF "$(SOLAR_JAVA)"==""
+LINKFLAGSOPT=/Oc
+.ENDIF
+
+STDOBJVCL=$(L)/salmain.obj
+STDOBJGUI=c02.obj
+STDSLOGUI=c02d.obj
+STDOBJCUI=c02.obj
+STDSLOCUI=c02d.obj
+STDLIBGUIST=c2.lib os2.lib
+STDLIBCUIST=c2.lib os2.lib
+STDLIBGUIMT=c2mt.lib os2.lib
+STDLIBCUIMT=c2mt.lib os2.lib
+STDSHLGUIMT=c2mt.lib os2.lib
+STDSHLCUIMT=c2mt.lib os2.lib
+
+LIBMGR=tlib
+LIBFLAGS=/C /P128
+
+IMPLIB=implib
+IMPLIBFLAGS=/c
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=rc
+RCFLAGS=-r $(RCFILES) $@
+RCLINK=rc
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX=bo
+
+.ENDIF
+
+# --- IBM ---
+.IF "$(COM)" == "ICC"
+
+ASM=tasm
+AFLAGS=/ml /oi
+
+CXX=icc
+CC=icc
+.IF "$(COMEX)"=="3"
+CFLAGS=/C+ /Q+ /Gf+ /Sp1 /G4 /Se /Gs+ /Gt+ /Gd+ /J- /W2 /D__EXTENDED__ /Si+ /Xi+ $(MINUS_I)$(INCLUDE) /Wvft-
+.ELSE
+.IF "$(COMEX)"=="I"
+CFLAGS=/C+ /Tl10 /Q+ /Gf+ /Sp4 /G4 /Sc /Gs- /D__EXTENDED__ /Si+ /Su4
+.ELSE
+CFLAGS=/C+ /Tl10 /Q+ /Gf+ /Sp1 /G4 /Sc /Gs+ /D__EXTENDED__ /Si+
+.ENDIF
+.ENDIF
+
+CFLAGSCXX=/Tdp
+
+CFLAGSEXCEPTIONS=-Gx-
+CFLAGS_NO_EXCEPTIONS=-Gx+
+
+CFLAGSOBJGUIST=/Ge+
+CFLAGSOBJCUIST=/Ge+
+.IF "$(COMEX)"=="I"
+CFLAGSOBJGUIMT=/Ge+ /Gm+
+CFLAGSOBJCUIMT=/Ge+ /Gm+
+CFLAGSSLOGUIMT=/Ge- /Gm+
+CFLAGSSLOCUIMT=/Ge- /Gm+
+.ELSE
+CFLAGSOBJGUIMT=/Ge+ /Gm+
+CFLAGSOBJCUIMT=/Ge+ /Gm+
+CFLAGSSLOGUIMT=/Ge- /Gm+
+CFLAGSSLOCUIMT=/Ge- /Gm+
+.ENDIF
+CFLAGSPROF=/Gh+
+CFLAGSDEBUG=/Ti+
+CFLAGSDBGUTIL=
+CFLAGSOPT=/O+ /Oi+ /Oc+
+CFLAGSNOOPT=/O-
+CFLAGSOUTOBJ=/Fo
+
+CDEFS+=-D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE
+
+LINK=ilink
+#LINKFLAGS=/PACKCODE:8192 /ALIGN:16 /NOD /NOE /NOI /MAP /NOFREE
+
+#bei too many segments ist /SEGMENTS:nnnn hilfreich. 3072 ist max!
+.IF "$(CPPRTST)"!=""
+LINKFLAGS=/NOFREE /NOD /NOE /NOI /MAP /OPTFUNC /PACKD:65536 /EXEPACK:2
+.ELSE
+LINKFLAGS=/NOFREE /NOD /NOE /NOI /MAP /OPTFUNC /PACKD:65536
+.ENDIF
+LINKFLAGSAPPGUI=/PM:PM /NOBASE
+LINKFLAGSSHLGUI=
+LINKFLAGSAPPCUI=/PM:VIO /NOBASE
+LINKFLAGSSHLCUI=
+LINKFLAGSTACK=/STACK:
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=/COD
+#LINKFLAGSOPT=/EXEPACK:2 /OPTFUNC
+LINKFLAGSOPT=
+#.IF "$(product)"!="full" && "$(product)"!="demo" && "$(product)"!="compact"
+#LINKFLAGS=$(LINKFLAGS) /COD
+#.ELSE
+#LINKFLAGS=$(LINKFLAGS)
+#.ENDIF
+
+.IF "$(product)"=="full" || "$(product)"=="demo" || "$(product)"=="compact"
+# LINKFLAGS=$(LINKFLAGS)
+.ELSE
+LINKFLAGS+=/COD
+.ENDIF
+
+STDOBJVCL=$(L)/salmain.obj
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+.IF "$(COMEX)"=="3"
+.IF "$(CPPRTST)"!=""
+STDLIBGUIST=cppom30o.lib cpprtst.lib os2386.lib
+STDLIBCUIST=cppom30o.lib cpprtst.lib os2386.lib
+STDLIBGUIMT=cppom30o.lib cpprtst.lib os2386.lib
+STDLIBCUIMT=cppom30o.lib cpprtst.lib os2386.lib
+STDSHLGUIMT=cppom30o.lib cpprtst.lib os2386.lib
+STDSHLCUIMT=cppom30o.lib cpprtst.lib os2386.lib
+.ELSE
+STDLIBGUIST=cppom30o.lib cppom30i.lib os2386.lib
+STDLIBCUIST=cppom30o.lib cppom30i.lib os2386.lib
+STDLIBGUIMT=cppom30o.lib cppom30i.lib os2386.lib
+STDLIBCUIMT=cppom30o.lib cppom30i.lib os2386.lib
+STDSHLGUIMT=cppom30o.lib cppom30i.lib os2386.lib
+STDSHLCUIMT=cppom30o.lib cppom30i.lib os2386.lib
+.ENDIF
+.ELSE
+STDLIBGUIST=dde4sbs.lib os2386.lib
+STDLIBCUIST=dde4sbs.lib os2386.lib
+STDLIBGUIMT=dde4mbs.lib os2386.lib
+STDLIBCUIMT=dde4mbs.lib os2386.lib
+STDSHLGUIMT=dde4mbs.lib os2386.lib
+STDSHLCUIMT=dde4mbs.lib os2386.lib
+.ENDIF
+
+.IF "$(COMEX)"=="3"
+LIBMGR=ilib
+.ELSE
+LIBMGR=lib
+.ENDIF
+LIBFLAGS=/NOI
+
+IMPLIB=implib
+IMPLIBFLAGS=/noi
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=rc
+RCFLAGS=-r $(RCFILES) $@
+RCLINK=rc
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX=co
+
+.ENDIF
+
+# --- GNU ---
+.IF "$(COM)" == "GCC"
+
+.INCLUDE : os2gcci.mk
+
+.ENDIF
+
+# --- Watcom ---
+.IF "$(COM)" == "WTC"
+
+ASM=wasm
+AFLAGS=/ml /4pr
+
+CC=wcl386
+CXX=wcl386
+.IF "$(e2p)" != ""
+CFLAGS=-c -W3 -Zp4 -Zld $(MINUS_I)$(INCLUDE) -bt=os2 -zq -zm -ep -ee
+.ELSE
+CFLAGS=-c -Zp4 -W3 -Zl -Zld $(MINUS_I)$(INCLUDE) -bt=os2 -zq -s
+.ENDIF
+CFLAGSCXX=-cc++ -xst
+CFLAGSOBJGUIST= #-Alfd -GA -GEfs
+CFLAGSOBJCUIST=
+CFLAGSOBJGUIMT=-bm #-Alfw -GA -GEd
+CFLAGSOBJCUIMT=-bm
+CFLAGSSLOGUIMT=-bm -bd #-Alfw -GD -GEfd
+CFLAGSSLOCUIMT=-bm -bd
+CFLAGSPROF=
+CFLAGSDEBUG=/d2
+CFLAGSDBGUTIL=
+.IF "$(e2p)" != ""
+CFLAGSOPT=-otexan -3s
+CFLAGSNOOPT=-od -3s
+.ELSE
+CFLAGSOPT=-otexan -4s
+CFLAGSNOOPT=-od -4s
+.ENDIF
+CFLAGSOUTOBJ=-Fo
+
+LINK=wlink
+LINKFLAGS=op symf op caseexact op statics op MANY
+LINKFLAGSAPPGUI=sys os2v2 pm
+LINKFLAGSSHLGUI=sys os2v2 dll INITINSTANCE TERMINSTANCE
+LINKFLAGSAPPCUI=sys os2v2
+LINKFLAGSSHLCUI=sys os2v2 dll
+LINKFLAGSTACK=op stack=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=debug all op undefsok
+LINKFLAGSOPT=
+
+STDOBJVCL=$(L)/salmain.obj
+STDOBJGUI=libr clib3s.lib libr plib3s.lib libr math387s.lib
+STDSLOGUI=libr clib3s.lib libr os2386.lib libr plib3s.lib libr math387s.lib
+STDOBJCUI=libr clib3s.lib libr plib3s.lib libr math387s.lib
+STDSLOCUI=libr clib3s.lib libr plib3s.lib libr math387s.lib
+STDLIBGUIST=libr os2386.lib libr clib3s.lib libr plib3s.lib
+STDLIBCUIST=libr os2386.lib libr clib3s.lib libr plib3s.lib
+STDLIBGUIMT=libr os2386.lib libr clib3s.lib libr plib3s.lib
+STDLIBCUIMT=libr os2386.lib libr clib3s.lib libr plib3s.lib
+STDSHLGUIMT=libr os2386.lib libr clib3s.lib libr plibmt3s.lib libr math387s.lib libr plib3s.lib libr noemu387.lib
+STDSHLCUIMT=libr os2386.lib libr clib3s.lib libr plibmt3s.lib libr matg387s.lib libr plib3s.lib
+
+LIBMGR=wlib
+LIBFLAGS=/p=128 /c /m
+
+IMPLIB=echo
+IMPLIBFLAGS=
+
+MAPSYM=mapsym
+MAPSYMFLAGS=
+
+RC=rc
+RCFLAGS=-r $(RCFILES) $@
+RCLINK=rc
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX=wo
+
+.ENDIF
+
+# --- OS2 Allgemein ---
+HC=toipf
+HCFLAGS=
+PATH_SEPERATOR*=;
+DLLPRE=
+DLLPOST=.dll
+EXECPOST=.exe
+SCPPOST=.ins
+DLLDEST=$(BIN)
+SOLARSHAREDBIN=$(SOLARBINDIR)
+
+.ENDIF
diff --git a/solenv/inc/os2gcci.mk b/solenv/inc/os2gcci.mk
new file mode 100644
index 000000000000..46dcba24aaa1
--- /dev/null
+++ b/solenv/inc/os2gcci.mk
@@ -0,0 +1,288 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# --- OS2-Environment ----------------------------------------------
+
+#change output dir name using the object binary format.
+#.IF "$(aout)"==""
+#OUTFMT=omf
+#.ELSE
+#OUTFMT=aout
+#.ENDIF
+#OUTPATH+=OUTFMT
+#INPATH+=OUTFMT
+#GVERDIR+=OUTFMT
+
+# mk file for os2gcci
+ASM=as
+AFLAGS=
+
+#//YD SOLAR_JAVA=TRUE
+JAVAFLAGSDEBUG=-g
+
+# filter for supressing verbose messages from linker
+#not needed at the moment
+#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
+
+.IF "$(ttt)"!=""
+CDEFS+=-E
+.ENDIF
+
+# _PTHREADS is needed for the stl
+CDEFS+=-DX86 -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=400
+
+# this is a platform with JAVA support
+.IF "$(SOLAR_JAVA)"!=""
+JAVADEF=-DSOLAR_JAVA
+.IF "$(debug)"==""
+JAVA_RUNTIME=javai.lib
+.ELSE
+JAVA_RUNTIME=javai_g.lib
+.ENDIF
+.ENDIF
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=
+
+# name of C++ Compiler
+CXX*=g++
+# name of C Compiler
+CC*=gcc
+# flags for C and C++ Compiler
+CFLAGS+=-c
+# flags for the C++ Compiler
+CFLAGSCC= $(ARCH_FLAGS)
+
+.IF "$(aout)"==""
+CFLAGS+=-Zomf
+.ENDIF
+
+# Flags for enabling exception handling
+CFLAGSEXCEPTIONS=-fexceptions
+# Flags for disabling exception handling
+CFLAGS_NO_EXCEPTIONS=-fno-exceptions
+
+CFLAGSCXX= -frtti $(ARCH_FLAGS)
+CFLAGSCXX+= -Wno-ctor-dtor-privacy -fmessage-length=0
+PICSWITCH:=
+
+# Compiler flags for compiling static object in single threaded environment with graphical user interface
+CFLAGSOBJGUIST=-Zcrtdll
+# Compiler flags for compiling static object in single threaded environment with character user interface
+CFLAGSOBJCUIST=-Zcrtdll
+# Compiler flags for compiling static object in multi threaded environment with graphical user interface
+CFLAGSOBJGUIMT=-Zcrtdll
+# Compiler flags for compiling static object in multi threaded environment with character user interface
+CFLAGSOBJCUIMT=-Zcrtdll
+# Compiler flags for compiling shared object in multi threaded environment with graphical user interface
+CFLAGSSLOGUIMT=$(PICSWITCH) -Zdll -Zcrtdll
+# Compiler flags for compiling shared object in multi threaded environment with character user interface
+CFLAGSSLOCUIMT=$(PICSWITCH) -Zdll -Zcrtdll
+# Compiler flags for profiling
+CFLAGSPROF=
+# Compiler flags for debugging
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+# Compiler flags for enabling optimazations
+CFLAGSOPT=-s -O1 -march=pentium -mtune=pentium4
+# Compiler flags for disabling optimazations
+CFLAGSNOOPT=-O0
+# Compiler flags for discibing the output path
+CFLAGSOUTOBJ=-o
+
+# Warnings switched off for CXX:
+# - doubunder: we have many identifiers containing double underscores, some of
+# them in the stable UDK API we cannot change
+# - inllargeuse: "function is too large and will not be expanded inline" is
+# merely a hint
+# - inllargeint: "function is too large to generate inline, consider writing
+# it yourself" is merely a hint
+# - notemsource: "could not find source for function" appears to be spurious
+# - reftotemp: warns about calling non-const functions on temporary objects,
+# something legally done by boost::scoped_array<T>::reset, for example
+# (this_type(p).swap(*this))
+# - truncwarn: "conversion of 64 bit type value to smaller type causes
+# truncation" at least with CC 5.8 is reported only at the end of a
+# compilation unit that uses std::hash_map<sal_Int64, sal_Int64> (see
+# sfx2/source/toolbox/imgmgr.cxx:1.27) and thus unfortunately needs to be
+# disabled globally
+CFLAGSWARNCC=
+CFLAGSWARNCXX=+w2 -erroff=doubunder,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn
+CFLAGSWARNCXX=
+CFLAGSWALLCC=$(CFLAGSWARNCC)
+CFLAGSWALLCXX=$(CFLAGSWARNCXX)
+CFLAGSWERRCC=-errwarn=%all
+CFLAGSWERRCXX=-xwe
+
+# Once all modules on this platform compile without warnings, set
+# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
+# settings.mk):
+MODULES_WITH_WARNINGS := \
+ b_server \
+ basctl \
+ basebmp \
+ canvas \
+ chart2 \
+ cppcanvas \
+ desktop \
+ devtools \
+ dxcanvas \
+ extensions \
+ filter \
+ glcanvas \
+ lingu \
+ r_tools \
+ sc \
+ sd \
+ slideshow \
+ starmath \
+ svx \
+ sw \
+ writerperfect \
+ xmlsecurity
+
+
+# switches for dynamic and static linking
+STATIC =
+DYNAMIC =
+
+# this is needed to allow stl headers to include os2.h instead of svpm.h
+# in earlier stages of project build. Once svpm.h is in place, we can
+# compile without this flag.
+.IF "$(STL_OS2_BUILDING)" != ""
+CFLAGS+=-DSTL_OS2_BUILDING
+CFLAGSCXX+=-DSTL_OS2_BUILDING
+.ENDIF
+
+# name of linker
+LINK*=gcc
+# default linker flags
+LINKFLAGS= -Zbin-files -Zmap
+#27/01/06 bin-files confuses transex/rsc work, removed.
+LINKFLAGS= -Zno-fork -Zhigh-mem -Zmap
+.IF "$(OS2_ARGS_WILD)" != ""
+LINKFLAGS+=-Zargs-wild -Zargs-resp
+.ENDIF
+
+.IF "$(aout)"==""
+#LINKFLAGS+= -Zlinker /NOI -Zlinker /PACKD:65536 -Zlinker /EXEPACK:2
+#LINKFLAGS+= -Zlinker /NOExtdictionary
+LINKFLAGS+= -Zomf
+#LINKFLAGS+= -Zlinker "DISABLE 1121"
+.ENDIF
+
+
+# linker flags for linking applications
+.IF "$(aout)"==""
+#LINKFLAGSAPPGUI= -Zlinker /PM:PM -Zstack 0x2000
+#LINKFLAGSAPPCUI= -Zlinker /PM:VIO
+.ELSE
+LINKFLAGSAPPGUI=
+LINKFLAGSAPPCUI=
+.ENDIF
+
+# linker flags for linking shared libraries
+LINKFLAGSSHLGUI= -Zdll #-Zsym
+LINKFLAGSSHLCUI= -Zdll #-Zsym
+
+.IF "$(aout)"==""
+LINKFLAGSTACK=-Zlinker /STACK:
+LINKFLAGSPROF=
+#LINKFLAGSDEBUG=-Zlinker /DEBUG
+LINKFLAGSDEBUG=-g
+LINKFLAGSOPT=-g
+.ELSE
+LINKFLAGSTACK=-Zstack
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=-g
+LINKFLAGSOPT=-s
+.ENDIF
+
+.IF "$(NO_BSYMBOLIC)"==""
+.IF "$(PRJNAME)" != "envtest"
+LINKFLAGSSHLGUI+=
+LINKFLAGSSHLCUI+=
+.ENDIF
+.ENDIF # "$(NO_BSYMBOLIC)"==""
+
+LINKVERSIONMAPFLAG=-Wl,--version-script
+
+SONAME_SWITCH=-Wl,-h
+
+# Sequence of libs does matter !
+
+#STDLIBCPP=stdc++ supc++ gcc_eh
+#STDLIBCPP=stdc++ gcc432
+STDLIBCPP=stdc432 gcc432
+
+# default objectfilenames to link
+STDOBJVCL=$(L)/salmain.obj
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+
+# libraries for linking applications
+STDLIBCUIST=$(STDLIBCPP)
+STDLIBGUIMT=$(STDLIBCPP)
+STDLIBCUIMT=$(STDLIBCPP)
+STDLIBGUIST=$(STDLIBCPP)
+# libraries for linking shared libraries
+STDSHLGUIMT=$(STDLIBCPP)
+STDSHLCUIMT=$(STDLIBCPP)
+
+LIBSTLPORT=$(DYNAMIC) stlp45.lib
+LIBSTLPORTST=$(STATIC) stlp45.lib $(DYNAMIC)
+
+
+# name of library manager
+LIBMGR=ar
+LIBFLAGS=crv
+
+.IF "$(aout)"==""
+LIBMGR=emxomfar -p2048
+.ENDIF
+
+# tool for generating import libraries
+IMPLIB=emximp
+IMPLIBFLAGS=-o
+
+MAPSYM=mapsym
+MAPSYMFLAGS=
+
+RC=wrc -bt=os2 -i$(PATH_EMXPGCC)\include
+RCFLAGS=-r $(RCFILES) -fo=$@
+RCLINK=wrc -bt=os2
+RCLINKFLAGS=
+RCSETVERSION=
+
+# platform specific identifier for shared libs
+DLLPOSTFIX=go
+DLLPRE=lib
+DLLPOST=.dll
+
diff --git a/solenv/inc/pkg_config.mk b/solenv/inc/pkg_config.mk
new file mode 100644
index 000000000000..3654083e76ad
--- /dev/null
+++ b/solenv/inc/pkg_config.mk
@@ -0,0 +1,49 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+.INCLUDE .IGNORE : pkgroot.mk
+
+.IF "$(PKGCONFIG_ROOT)"!=""
+PKG_CONFIG=$(PKGCONFIG_ROOT)/bin/pkg-config
+.IF "$(OS)"=="SOLARIS" && "$(CPUNAME)"=="SPARC" && "$(CPU)"=="U"
+PKG_CONFIG_PATH:=$(PKGCONFIG_ROOT)/lib/64/pkgconfig
+.ELSE
+PKG_CONFIG_PATH:=$(PKGCONFIG_ROOT)/lib/pkgconfig
+.ENDIF
+.EXPORT : PKG_CONFIG_PATH
+PKGCONFIG_PREFIX=--define-variable=prefix=$(PKGCONFIG_ROOT)
+.ELSE
+PKG_CONFIG*=pkg-config
+.IF "$(OS)"=="SOLARIS" && "$(CPUNAME)"=="SPARC" && "$(CPU)"=="U"
+PKG_CONFIG_PATH=/usr/lib/64/pkgconfig
+.EXPORT : PKG_CONFIG_PATH
+.ENDIF
+.ENDIF
+
+PKGCONFIG_CFLAGS:=$(shell @$(PKG_CONFIG) $(PKGCONFIG_PREFIX) --cflags $(PKGCONFIG_MODULES))
+PKGCONFIG_LIBS:=$(shell @$(PKG_CONFIG) $(PKGCONFIG_PREFIX) --libs $(PKGCONFIG_MODULES))
+CFLAGS+=$(PKGCONFIG_CFLAGS)
diff --git a/solenv/inc/postmac.h b/solenv/inc/postmac.h
new file mode 100644
index 000000000000..68f85b6c0f65
--- /dev/null
+++ b/solenv/inc/postmac.h
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#undef Boolean
+#undef BOOL
+#undef Button
+#undef Byte
+#undef Control
+#undef Cursor
+#undef FontInfo
+#undef GetItem
+#undef MemoryBlock
+#undef Palette
+#undef Polygon
+#undef Point
+#undef Ptr
+#undef Region
+#undef Size
+#undef LSize
+#undef ModalDialog
+#undef SetCursor
+//#undef ShowWindow
+#undef StringPtr
+#undef DirInfo
+#undef ULONG
+#undef Line
+#undef TimeValue
+#undef Pattern
diff --git a/solenv/inc/postset.mk b/solenv/inc/postset.mk
new file mode 100644
index 000000000000..888098fde3df
--- /dev/null
+++ b/solenv/inc/postset.mk
@@ -0,0 +1,169 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# Default ISO code used when no languages specified
+# This language will be always included!
+defaultlangiso=en-US
+
+# Complete list of all supported ISO codes
+completelangiso=af \
+ar \
+as \
+as-IN \
+ast \
+be-BY \
+bo \
+bg \
+br \
+brx \
+bn \
+bn-BD \
+bn-IN \
+bs \
+by \
+ca \
+ca-XV \
+cs \
+cy \
+da \
+de \
+dgo \
+dz \
+el \
+en-GB \
+en-US \
+en-ZA \
+eo \
+es \
+et \
+eu \
+fa \
+fi \
+fr \
+ga \
+gd \
+gl \
+gu \
+gu-IN \
+he \
+hi \
+hi-IN \
+hr \
+hu \
+is \
+it \
+ja \
+kid \
+ky \
+ka \
+kab \
+kk \
+km \
+kn \
+ko \
+kok \
+ks \
+ku \
+lo \
+lt \
+lv \
+mai \
+mk \
+mn \
+mni \
+ms \
+ml \
+ml-IN \
+mr \
+mr-IN \
+my \
+ne \
+nb \
+nl \
+nn \
+nr \
+ns \
+nso \
+om \
+oms \
+oc \
+or \
+or-IN \
+pap \
+pa \
+pa-IN \
+pl \
+ps \
+pt \
+pt-BR \
+gug \
+pyg \
+ro \
+ru \
+rw \
+sat \
+sa \
+sa-IN \
+si \
+sc \
+sd \
+sq \
+sk \
+sl \
+sh \
+son \
+sr \
+ss \
+st \
+sv \
+sw \
+sw-TZ \
+te \
+te-IN \
+ti \
+ti-ER \
+ta \
+ta-IN \
+tlh \
+th \
+tn \
+tr \
+ts \
+tg \
+ug \
+ur \
+ur-IN \
+uk \
+uz \
+ve \
+vi \
+xh \
+zh-CN \
+zh-TW \
+zu
+
+alllangiso=$(strip $(defaultlangiso) $(subst,$(defaultlangiso), $(uniq $(subst,ALL,$(completelangiso) $(WITH_LANG)))))
diff --git a/solenv/inc/preinclude.h b/solenv/inc/preinclude.h
new file mode 100644
index 000000000000..dee99bc6d3f4
--- /dev/null
+++ b/solenv/inc/preinclude.h
@@ -0,0 +1,38 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+/* HACK: include certain standard header to enable build on glibc-2.2 systems
+ * and compile vs. glibc-2.1 header
+ *
+ * please add more if necessary
+ */
+#include <stdlib.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <wchar.h>
+#include <features.h>
+#include <assert.h>
diff --git a/solenv/inc/premac.h b/solenv/inc/premac.h
new file mode 100644
index 000000000000..451a33b8ab00
--- /dev/null
+++ b/solenv/inc/premac.h
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+#define Boolean MacOSBoolean
+#define BOOL MacOSBOOL
+#define Button MacOSButton
+#define Byte MacOSByte
+#define Control MacOSControl
+#define Cursor MacOSCursor
+#define FontInfo MacOSFontInfo
+#define MemoryBlock MacOSMemoryBlock
+#define Point MacOSPoint
+#define Size MacOSSize
+#define Region MacOSRegion
+#define Polygon MacOSPolygon
+#define Ptr MacOSPtr
+#define Palette MacOSPalette
+#define LSize MacOSLSize
+#define ModalDialog MacOSModalDialog
+#define SetCursor MacOSSetCursor
+//#define ShowWindow MacOSShowWindow
+#define StringPtr MacOSStringPtr
+#define DirInfo MacOSDirInfo
+#define ULONG MacOSULONG
+#define Line MacOSLine
+#define TimeValue MacOSTimeValue
+#define Pattern MacOSPattern
diff --git a/solenv/inc/pstrules.mk b/solenv/inc/pstrules.mk
new file mode 100644
index 000000000000..a845b9ae86fe
--- /dev/null
+++ b/solenv/inc/pstrules.mk
@@ -0,0 +1,155 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#+++++++++++ second_build rules +++++++++++++++++++++++++++++++++++++
+#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.IF "$(SECOND_BUILD)"!=""
+.IF "$($(SECOND_BUILD)_OBJFILES)"!=""
+
+$(OBJ)/$(SECOND_BUILD)_%.obj : %.cxx
+ @echo "Making: " $@
+.IF "$(GUI)"=="UNX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$(SECOND_BUILD)_$*.o $(CFLAGSINCXX)$(PWD)/$*.cxx
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ELSE
+ @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ >& $(NULLDEV) $(FI)
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSOBJ) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)/$(SECOND_BUILD)_$*.obj $(CFLAGSINCXX)$(PWD)/$*.cxx
+.ENDIF
+
+$(OBJ)/$(SECOND_BUILD)_%.obj : %.c
+ @echo "Making: " $@
+.IF "$(GUI)"=="UNX"
+.IF "$(TEST)"!=""
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$(SECOND_BUILD)_$*.o $*.c
+.ELSE
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$(SECOND_BUILD)_$*.o $*.c
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ENDIF
+.ELSE
+ @$(TYPE) $(mktmp $(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)\$(SECOND_BUILD)_$*.obj $*.c )
+ @echo.
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)\$(SECOND_BUILD)_$*.obj $*.c
+.ELSE
+ $(COMMAND_ECHO)$(CC) @$(mktmp $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)\$(SECOND_BUILD)_$*.obj $*.c )
+.ENDIF
+ $(SEMADEBUG)
+.ENDIF
+
+.ENDIF # "$($(SECOND_BUILD)_OBJFILES)"!=""
+
+.IF "$($(SECOND_BUILD)_SLOFILES)"!=""
+
+$(SLO)/$(SECOND_BUILD)_%.obj : %.cxx
+ @echo "Making: " $@
+.IF "$(GUI)"=="UNX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$(SECOND_BUILD)_$*.o $(CFLAGSINCXX)$(PWD)/$*.cxx
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ELSE
+ @-$(RM) $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSSLO) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$(SECOND_BUILD)_$*.obj $(CFLAGSINCXX)$(PWD)/$*.cxx
+.ELSE
+ $(COMMAND_ECHO)$(CXX) @$(mktmp $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSSLO) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$(SECOND_BUILD)_$*.obj $(CFLAGSINCXX)$(PWD)/$*.cxx )
+.ENDIF
+.ENDIF
+
+$(SLO)/$(SECOND_BUILD)_%.obj : %.c
+ @echo "Making: " $@
+.IF "$(GUI)"=="UNX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$(SECOND_BUILD)_$*.o $*.c
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ELSE
+ @-$(RM) $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$(SECOND_BUILD)_$*.obj $*.c
+.ELSE
+ $(COMMAND_ECHO)$(TYPE) $(mktmp $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$(SECOND_BUILD)_$*.obj $*.c )
+ $(COMMAND_ECHO)$(CC) @$(mktmp $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $($(SECOND_BUILD)CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$(SECOND_BUILD)_$*.obj $*.c )
+.ENDIF
+.ENDIF
+
+.ENDIF # "$($(SECOND_BUILD)_SLOFILES)"!=""
+.ENDIF # "$(SECOND_BUILD)"!=""
+
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#+++++++++++ srcipting rules ++++++++++++++++++++++++++++++++++++++++
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.IF "$(PARFILES)"!=""
+ULFPARFILES=$(foreach,i,$(ULFFILES) $(foreach,j,$(SCP_PRODUCT_TYPE) $(PAR)/$j/$(i:b).par))
+MOREPARFILES=$(foreach,i,$(PARFILES) $(foreach,j,$(SCP_PRODUCT_TYPE) $(PAR)/$j/$i ))
+ALLPARFILES=$(uniq $(ULFPARFILES) $(MOREPARFILES))
+
+SCP_PRODUCT_TYPE*=FAT
+
+.IF "$(GUI)" == "WNT"
+LANGFILEEXT=mlf
+.ELSE
+LANGFILEEXT=jlf
+.ENDIF
+
+$(PAR)/%.par :
+ @echo "Making: " $@
+ @@-$(MKDIR) $(MISC)/{$(subst,$(@:d:d:d), $(@:d:d))}
+.IF "$(GUI)"=="WNT"
+ $(COMMAND_ECHO)$(CPPLCC) -+ -P $(INCLUDE) $(CDEFS) $(SCPDEFS) -DDLLPOSTFIX=$(DLLPOSTFIX) $(*:b).scp > $(MISC)/{$(subst,$(@:d:d:d), $(@:d:d))}/$(*:b).pre
+.ENDIF
+# YD: INCLUDE macro too long, include only few items (scp2 compile)
+.IF "$(GUI)"=="OS2"
+ $(CPPLCC) -+ -P -I..\..\inc -I..\..\os2gcci.pro\inc $(CDEFS) $(SCPDEFS) -DDLLPOSTFIX=$(DLLPOSTFIX) $(*:b).scp > $(MISC)$/{$(subst,$(@:d:d:d), $(@:d:d))}$/$(*:b).pre
+.ENDIF
+.IF "$(GUI)"=="UNX"
+ $(COMMAND_ECHO)$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/cpp.lcc -+ -P $(CDEFS) $(SCPDEFS) -DDLLPOSTFIX=$(DLLPOSTFIX) -I. -I$(INC) -I$(INCLOCAL) -I$(INCGUI) -I$(INCCOM) $(SOLARINC) $(*:b).scp > $(MISC)/{$(subst,$(@:d:d:d), $(@:d:d))}/$(*:b).pre
+.ENDIF
+.IF "$(common_build_srs)"!=""
+ $(COMMAND_ECHO)$(SCPCOMP) -l {$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))/$(TARGET)/$(@:b).$(LANGFILEEXT)} -s $(MISC)/{$(subst,$(@:d:d:d), $(@:d:d))}/$(*:b).pre -o $@
+.ELSE # "$(common_build_srs)"!=""
+ $(COMMAND_ECHO)$(SCPCOMP) -l {$(MISC)/$(TARGET)/$(@:b).$(LANGFILEEXT)} -s $(MISC)/{$(subst,$(@:d:d:d), $(@:d:d))}/$(*:b).pre -o $@
+.ENDIF # "$(common_build_srs)"!=""
+# hacked version
+# $(COMMAND_ECHO)$(SCPCOMP) -l $(@:b).$(LANGFILEEXT) -s $(MISC)/{$(subst,$(@:d:d:d), $(@:d:d))}/$(*:b).pre -o $@
+
+.ENDIF # "$(PARFILES)"!=""
diff --git a/solenv/inc/rules.mk b/solenv/inc/rules.mk
new file mode 100644
index 000000000000..2155ab8842d5
--- /dev/null
+++ b/solenv/inc/rules.mk
@@ -0,0 +1,799 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+MKFILENAME:=RULES.MK
+
+$(OBJ)/%.obj : %.cxx
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE)
+.IF "$(GUI)"=="UNX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(CFLAGSINCXX)$(PWD)/$*.cxx
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+.IF "$(noadjust)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(noadjust)"==""
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ELSE
+ @@-$(RM) $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)/$*.obj $(CFLAGSINCXX)$(PWD)/$*.cxx
+.ELSE
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)/$*.obj $(CFLAGSINCXX)$(PWD)/$*.cxx
+.ENDIF
+.ENDIF
+.IF "$(nodep)"==""
+ $(COMMAND_ECHO)$(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)/o_$(@:f:s/.obj/.dpcc/)
+ @noop $(assign DEPS_MADE+:=o_$(@:f:s/.obj/.dpcc/))
+.ENDIF # "$(nodep)"==""
+
+$(OBJ)/%.obj : %.cpp
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE)
+.IF "$(GUI)"=="UNX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(CFLAGSINCXX)$(PWD)/$*.cpp
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ELSE
+ @@-$(RM) $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)/$*.obj $(CFLAGSINCXX)$(PWD)/$*.cpp
+.ELSE
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)/$*.obj $(CFLAGSINCXX)$(PWD)/$*.cpp
+.ENDIF
+.ENDIF
+.IF "$(nodep)"==""
+ $(COMMAND_ECHO)$(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)/o_$(@:f:s/.obj/.dpcc/)
+ @noop $(assign DEPS_MADE+:=o_$(@:f:s/.obj/.dpcc/))
+.ENDIF # "$(nodep)"==""
+
+$(OBJ)/%.obj : %.cc
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE)
+.IF "$(GUI)"=="UNX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(CFLAGSINCXX)$(PWD)/$*.cc
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @+$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ELSE
+ @@$(RM) $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)/$*.obj $(CFLAGSINCXX)$(PWD)/$*.cc
+.ELSE
+ $(COMMAND_ECHO)$(CXX) @$(mktmp $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)/$*.obj $(CFLAGSINCXX)$(PWD)/$*.cc )
+.ENDIF
+.ENDIF
+
+.IF "$(ENABLE_PCH)"!=""
+# workaround for file locking problems on network volumes
+.IF "$(NETWORK_BUILD)"==""
+PCHOUTDIR=$(SLO)/pch
+PCHEXOUTDIR=$(SLO)/pch_ex
+.ELSE # "$(NETWORK_BUILD)"==""
+PCHOUTDIR=$(TMP)/$(BUILD)$(CWS_WORK_STAMP)$(PRJNAME)$(PROEXT)
+PCHEXOUTDIR=$(TMP)/$(BUILD)$(CWS_WORK_STAMP)$(PRJNAME)_ex$(PROEXT)
+.ENDIF # "$(NETWORK_BUILD)"==""
+$(SLO)/precompiled.% .PHONY:
+ -$(MKDIRHIER) $(SLO)/pch
+.IF "$(COM)"=="MSC"
+.IF "$(NETWORK_BUILD)"!=""
+ -$(MKDIRHIER) $(PCHOUTDIR)
+.IF "$(HAVE_BIG_TMP)"==""
+ $(COMMAND_ECHO)-$(COPY) $(SLO)/pch/precompiled_$(PRJNAME).hxx$(PCHPOST) $(PCHOUTDIR)/precompiled_$(PRJNAME).hxx$(PCHPOST)
+.ENDIF # "$(HAVE_BIG_TMP)"==""
+.ENDIF # "$(NETWORK_BUILD)"!=""
+ $(COMMAND_ECHO)$(CXX) @$(mktmp -Fp$(PCHOUTDIR)/precompiled_$(PRJNAME).hxx$(PCHPOST) $(CFLAGS_CREATE_PCH) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGS_NO_EXCEPTIONS) -DEXCEPTIONS_OFF $(CFLAGSAPPEND) $(INCPCH)/precompiled_$(PRJNAME).cxx)
+.IF "$(NETWORK_BUILD)"!=""
+ $(COMMAND_ECHO)$(COPY) $(PCHOUTDIR)/precompiled_$(PRJNAME).hxx$(PCHPOST) $(SLO)/pch/precompiled_$(PRJNAME).hxx$(PCHPOST)
+.IF "$(HAVE_BIG_TMP)"==""
+ $(COMMAND_ECHO)$(RM) $(PCHOUTDIR)/precompiled_$(PRJNAME).hxx$(PCHPOST)
+ $(COMMAND_ECHO)$(RMDIR) $(PCHOUTDIR)
+.ENDIF # "$(HAVE_BIG_TMP)"==""
+.ENDIF # "$(NETWORK_BUILD)"!=""
+.ELIF "$(COM)"=="GCC" && "$(CCNUMVER)">="000300040000"
+ $(COMMAND_ECHO)$(CXX) -o$(SLO)/pch/precompiled_$(PRJNAME).hxx$(PCHPOST) $(CFLAGS_CREATE_PCH) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGS_NO_EXCEPTIONS) -DEXCEPTIONS_OFF $(CFLAGSAPPEND) $(INCPCH)/precompiled_$(PRJNAME).hxx
+ @echo "#error Tried to use wrong precompiled header" > $(SLO)/pch/precompiled_$(PRJNAME).hxx
+.ELSE # "$(COM)"=="MSC"
+ @$(TOUCH) $(SLO)/pch/precompiled_$(PRJNAME).hxx$(PCHPOST)
+.ENDIF # "$(COM)"=="MSC"
+ @echo USED_PCHFLAGS=$(CFLAGS)$(CFLAGSCXX)$(CFLAGSCXXSLO)$(CFLAGSSLO)$(CDEFS)$(CDEFSSLO)$(CDEFSMT)$(CFLAGS_NO_EXCEPTIONS) -DEXCEPTIONS_OFF$(CFLAGSAPPEND)> $(INCCOM)/pch.mk
+
+$(SLO)/precompiled_ex.% .PHONY:
+ -$(MKDIRHIER) $(SLO)/pch_ex
+.IF "$(COM)"=="MSC"
+.IF "$(NETWORK_BUILD)"!=""
+ -$(MKDIRHIER) $(PCHEXOUTDIR)
+.IF "$(HAVE_BIG_TMP)"==""
+ $(COMMAND_ECHO)-$(COPY) $(SLO)/pch_ex/precompiled_$(PRJNAME).hxx$(PCHPOST) $(PCHEXOUTDIR)/precompiled_$(PRJNAME).hxx$(PCHPOST)
+.ENDIF # "$(HAVE_BIG_TMP)"==""
+.ENDIF # "$(NETWORK_BUILD)"!=""
+ $(COMMAND_ECHO)$(CXX) @$(mktmp -Fp$(PCHEXOUTDIR)/precompiled_$(PRJNAME).hxx$(PCHPOST) $(CFLAGS_CREATE_PCH:s/pchname/pchname_ex/) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSEXCEPTIONS) -DEXCEPTIONS_ON $(CFLAGSAPPEND) $(INCPCH)/precompiled_$(PRJNAME).cxx)
+.IF "$(NETWORK_BUILD)"!=""
+ $(COMMAND_ECHO)$(COPY) $(PCHEXOUTDIR)/precompiled_$(PRJNAME).hxx$(PCHPOST) $(SLO)/pch_ex/precompiled_$(PRJNAME).hxx$(PCHPOST)
+.IF "$(HAVE_BIG_TMP)"==""
+ $(COMMAND_ECHO)$(RM) $(PCHEXOUTDIR)/precompiled_$(PRJNAME).hxx$(PCHPOST)
+ $(COMMAND_ECHO)$(RMDIR) $(PCHEXOUTDIR)
+.ENDIF # "$(HAVE_BIG_TMP)"==""
+.ENDIF # "$(NETWORK_BUILD)"!=""
+.ELIF "$(COM)"=="GCC" && "$(CCNUMVER)">="000300040000"
+ $(COMMAND_ECHO)$(CXX) -o$(SLO)/pch_ex/precompiled_$(PRJNAME).hxx$(PCHPOST) $(CFLAGS_CREATE_PCH) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSEXCEPTIONS) -DEXCEPTIONS_ON $(CFLAGSAPPEND) $(INCPCH)/precompiled_$(PRJNAME).hxx
+ @echo "#error Tried to use wrong precompiled header" > $(SLO)/pch_ex/precompiled_$(PRJNAME).hxx
+.ELSE # "$(COM)"=="MSC"
+ @$(TOUCH) $(SLO)/pch_ex/precompiled_$(PRJNAME).hxx$(PCHPOST)
+.ENDIF # "$(COM)"=="MSC"
+ @echo USED_EXCEPTIONS_PCHFLAGS=$(subst,$(CFLAGSDEBUG), $(CFLAGS))$(CFLAGSCXX)$(CFLAGSCXXSLO)$(CFLAGSSLO)$(CDEFS)$(CDEFSSLO)$(CDEFSMT)$(CFLAGSEXCEPTIONS) -DEXCEPTIONS_ON$(CFLAGSAPPEND)> $(INCCOM)/pch_ex.mk
+
+.INCLUDE .IGNORE : $(INCCOM)/pch.mk
+.INCLUDE .IGNORE : $(INCCOM)/pch_ex.mk
+.ENDIF # "$(ENABLE_PCH)"!=""
+
+$(SLO)/%.obj : %.cxx
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE)
+.IF "$(ENABLE_PCH)"!=""
+# just a helper var
+ @noop $(assign used_exc_switches=$(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)))
+# cleanup first
+ @noop $(assign ACT_PCH_SWITCHES:=$(NULL))
+# eq: first string is a copy of the compile line,
+# second generated by pch creation
+# use pch with exception support
+ @noop $(assign ACT_PCH_SWITCHES+=$(eq,$(strip $(USED_EXCEPTIONS_PCHFLAGS)),$(strip $(subst,$(CFLAGSDEBUG), $(CFLAGS))$(CFLAGSCXX)$(CFLAGSCXXSLO)$(CFLAGSSLO)$(CDEFS:s/\//)$(CDEFSSLO)$(CDEFSMT)$(used_exc_switches)$(CFLAGSAPPEND)) $(CFLAGS_USE_EXCEPTIONS_PCH) $(NULL)))
+# use pch without exception support
+ @noop $(assign ACT_PCH_SWITCHES+=$(eq,$(strip $(USED_PCHFLAGS)),$(strip $(subst,$(CFLAGSDEBUG), $(CFLAGS))$(CFLAGSCXX)$(CFLAGSCXXSLO)$(CFLAGSSLO)$(CDEFS:s/\//)$(CDEFSSLO)$(CDEFSMT)$(used_exc_switches)$(CFLAGSAPPEND)) $(CFLAGS_USE_PCH) $(NULL)))
+.ENDIF # "$(ENABLE_PCH)"!=""
+.IF "$(GUI)"=="UNX"
+.IF "$(TEST)"!=""
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) -E $(CFLAGSINCXX)$(PWD)/$*.cxx
+.ELSE
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CAPTURE_COMMAND) $(CXX) $(ACT_PCH_SWITCHES) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(CFLAGSINCXX)$(PWD)/$*.cxx $(CAPTURE_OUTPUT)
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"=="" && "$(CAPTURE_COMMAND)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ENDIF
+.ELSE # "$(GUI)"=="UNX"
+ @@-$(RM) $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(CAPTURE_COMMAND) $(CXX) $(ACT_PCH_SWITCHES) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$*.obj $(CFLAGSINCXX)$(PWD)/$*.cxx $(CAPTURE_OUTPUT)
+.ELSE
+ $(COMMAND_ECHO)$(CAPTURE_COMMAND) $(CXX) $(ACT_PCH_SWITCHES) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$*.obj $(CFLAGSINCXX)$(PWD)/$*.cxx $(CAPTURE_OUTPUT)
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)"=="UNX"
+.IF "$(nodep)"==""
+# fixme: write to file
+ $(COMMAND_ECHO)$(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)/s_$(@:f:s/.obj/.dpcc/)
+ @noop $(assign DEPS_MADE+:=s_$(@:f:s/.obj/.dpcc/))
+.ENDIF # "$(nodep)"==""
+
+$(SLO)/%.obj : %.cpp
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE)
+.IF "$(GUI)"=="UNX"
+.IF "$(TEST)"!=""
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(PWD)/$*.cpp
+.ELSE
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(CFLAGSINCXX)$(PWD)/$*.cpp
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ENDIF
+.ELSE
+ @@-$(RM) $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$*.obj $(CFLAGSINCXX)$(PWD)/$*.cpp
+.ELSE
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$*.obj $(CFLAGSINCXX)$(PWD)/$*.cpp
+.ENDIF
+.ENDIF
+.IF "$(nodep)"==""
+ $(COMMAND_ECHO)$(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)/s_$(@:f:s/.obj/.dpcc/)
+ @noop $(assign DEPS_MADE+:=s_$(@:f:s/.obj/.dpcc/))
+.ENDIF # "$(nodep)"==""
+
+$(SLO)/%.obj : $(MISC)/%.cxx
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(INPATH)/misc/$(COMPILE_ECHO_FILE)
+.IF "$(GUI)"=="UNX"
+.IF "$(TEST)"!=""
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cxx
+.ELSE
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(CFLAGSINCXX)$(MISC)/$*.cxx
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ENDIF
+.ELSE
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$*.obj $(CFLAGSINCXX)$(MISC)/$*.cxx
+.ELSE
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$*.obj $(CFLAGSINCXX)$(MISC)/$*.cxx
+.ENDIF
+.ENDIF
+.IF "$(nodep)"==""
+ $(COMMAND_ECHO)$(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $@ ) > $(MISC)/s_$(@:f:s/.obj/.dpcc/)
+ @noop $(assign DEPS_MADE+:=s_$(@:f:s/.obj/.dpcc/))
+.ENDIF # "$(nodep)"==""
+
+$(SLO)/%.obj : $(MISC)/%.cc
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(INPATH)/misc/$(COMPILE_ECHO_FILE)
+.IF "$(GUI)"=="UNX"
+.IF "$(TEST)"!=""
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cc
+.ELSE
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(CFLAGSINCXX)$(MISC)/$*.cc
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @+$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ENDIF
+.ELSE
+ $(COMMAND_ECHO)$(CXX) @$(mktmp $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$*.obj $(CFLAGSINCXX)$(MISC)/$*.cc )
+.ENDIF
+
+$(OBJ)/%.obj : $(MISC)/%.cxx
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(INPATH)/misc/$(COMPILE_ECHO_FILE)
+.IF "$(GUI)"=="UNX"
+.IF "$(TEST)"!=""
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cxx
+.ELSE
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(CFLAGSINCXX)$(MISC)/$*.cxx
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ENDIF
+.ELSE
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)/$*.obj $(CFLAGSINCXX)$(MISC)/$*.cxx
+.ELSE
+ $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)/$*.obj $(CFLAGSINCXX)$(MISC)/$*.cxx
+.ENDIF
+.ENDIF
+.IF "$(nodep)"==""
+ $(COMMAND_ECHO)$(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)/o_$(@:f:s/.obj/.dpcc/)
+ @noop $(assign DEPS_MADE+:=o_$(@:f:s/.obj/.dpcc/))
+.ENDIF # "$(nodep)"==""
+
+$(OBJ)/%.obj : %.c
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE)
+.IF "$(GUI)"=="UNX"
+.IF "$(TEST)"!=""
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.c
+.ELSE
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.c
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+.IF "$(noadjust)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(noadjust)"==""
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ENDIF
+.ELSE
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)/$*.obj $*.c
+.ELSE
+ .IF "$(VERBOSE)" == "TRUE"
+ -@echo Cflags: $(CFLAGS) $(INCLUDE)
+ .ENDIF
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)/$*.obj $*.c
+.ENDIF
+.ENDIF
+.IF "$(nodep)"==""
+ $(COMMAND_ECHO)$(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)/o_$(@:f:s/.obj/.dpcc/)
+ @noop $(assign DEPS_MADE+:=o_$(@:f:s/.obj/.dpcc/))
+.ENDIF # "$(nodep)"==""
+
+$(OBJ)/%.obj : $(MISC)/%.c
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(INPATH)/misc/$(COMPILE_ECHO_FILE)
+.IF "$(GUI)"=="UNX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.c
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ELSE
+ @@-$(RM) $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)/$*.obj $(MISC)/$*.c
+.ELSE
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(OBJ)/$*.obj $(MISC)/$*.c
+.ENDIF
+.ENDIF
+.IF "$(nodep)"==""
+ $(COMMAND_ECHO)$(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)/o_$(@:f:s/.obj/.dpcc/)
+ @noop $(assign DEPS_MADE+:=o_$(@:f:s/.obj/.dpcc/))
+.ENDIF # "$(nodep)"==""
+
+$(SLO)/%.obj : $(MISC)/%.c
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(INPATH)/misc/$(COMPILE_ECHO_FILE)
+.IF "$(GUI)"=="UNX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.c
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ELSE
+ @@-$(RM) $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$*.obj $(MISC)/$*.c
+.ELSE
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$*.obj $(MISC)/$*.c
+.ENDIF
+.ENDIF
+.IF "$(nodep)"==""
+ $(COMMAND_ECHO)$(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)/s_$(@:f:s/.obj/.dpcc/)
+# avoid _version objects (see tg_shl.mk) - quite hacky...
+ @noop $(!eq,$@,$(@:s/_version.obj/.obj/) $(NULL) $(assign DEPS_MADE+:=s_$(@:f:s/.obj/.dpcc/)))
+.ENDIF # "$(nodep)"==""
+
+$(SLO)/%.obj : %.c
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE)
+.IF "$(GUI)"=="UNX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $*.c
+.IF "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ $(COMMAND_ECHO)$(ADJUSTVISIBILITY) -p $(@:s/.obj/.o/)
+.ENDIF # "$(OS)"=="SOLARIS" && "$(product)"=="full" && "$(debug)"==""
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ELSE
+ @@-$(RM) $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$*.obj $*.c
+.ELSE
+ $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO)/$*.obj $*.c
+.ENDIF
+.ENDIF
+.IF "$(nodep)"==""
+ $(COMMAND_ECHO)$(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)/s_$(@:f:s/.obj/.dpcc/)
+ @noop $(assign DEPS_MADE+:=s_$(@:f:s/.obj/.dpcc/))
+.ENDIF # "$(nodep)"==""
+
+# Objective-C files
+$(OBJ)/%.obj : %.m
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE)
+.IF "$(OS)"=="MACOSX"
+.IF "$(TEST)"!=""
+ $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.m
+.ELSE
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.m
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ENDIF
+.ELSE # "$(OS)"=="MACOSX"
+ @echo "No recipe for compiling Objective-C files is available for this platform"
+.ENDIF "$(OS)"=="MACOSX"
+
+# Objective-C files
+$(OBJ)/%.obj : $(MISC)/%.m
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(INPATH)/misc/$(COMPILE_ECHO_FILE)
+.IF "$(OS)"=="MACOSX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.m
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ELSE # "$(OS)"=="MACOSX"
+ @echo "No recipe for compiling Objective-C files is available for this platform"
+.ENDIF "$(OS)"=="MACOSX"
+
+# Objective-C files
+$(SLO)/%.obj : $(MISC)/%.m
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(INPATH)/misc/$(COMPILE_ECHO_FILE)
+.IF "$(OS)"=="MACOSX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.m
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ELSE # "$(OS)"=="MACOSX"
+ @echo "No recipe for compiling Objective-C files is available for this platform"
+.ENDIF "$(OS)"=="MACOSX"
+
+# Objective-C files
+$(SLO)/%.obj : %.m
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE)
+.IF "$(OS)"=="MACOSX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $*.m
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ELSE # "$(OS)"=="MACOSX"
+ @echo "No recipe for compiling Objective-C files is available for this platform"
+.ENDIF "$(OS)"=="MACOSX"
+
+# dependencies c / c++
+
+not_existing/s_%.dpcc : %.c;@noop $(assign all_local_slo+:=$<)
+not_existing/o_%.dpcc : %.c;@noop $(assign all_local_obj+:=$<)
+
+# Objective-C++ files
+$(OBJ)/%.obj : %.mm
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE)
+.IF "$(OS)"=="MACOSX"
+.IF "$(TEST)"!=""
+ $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCC) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.mm
+.ELSE
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCC) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.mm
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.ENDIF
+.IF "$(nodep)"==""
+ $(COMMAND_ECHO)$(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)/o_$(@:f:s/.obj/.dpcc/)
+ @noop $(assign DEPS_MADE+:=o_$(@:f:s/.obj/.dpcc/))
+.ENDIF # "$(nodep)"==""
+.ELSE # "$(OS)"=="MACOSX"
+ @echo "No recipe for compiling Objective-C++ files is available for this platform"
+.ENDIF # "$(OS)"=="MACOSX"
+
+# Objective-C++ files
+$(OBJ)/%.obj : $(MISC)/%.mm
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(INPATH)/misc/$(COMPILE_ECHO_FILE)
+.IF "$(OS)"=="MACOSX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.mm
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.IF "$(nodep)"==""
+ $(COMMAND_ECHO)$(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< ) > $(MISC)/o_$(@:f:s/.obj/.dpcc/)
+ @noop $(assign DEPS_MADE+:=o_$(@:f:s/.obj/.dpcc/))
+.ENDIF # "$(nodep)"==""
+.ELSE # "$(OS)"=="MACOSX"
+ @echo "No recipe for compiling Objective-C++ files is available for this platform"
+.ENDIF # "$(OS)"=="MACOSX"
+
+# Objective-C++ files
+$(SLO)/%.obj : $(MISC)/%.mm
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(INPATH)/misc/$(COMPILE_ECHO_FILE)
+.IF "$(OS)"=="MACOSX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.mm
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.IF "$(nodep)"==""
+ $(COMMAND_ECHO)$(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)/s_$(@:f:s/.obj/.dpcc/)
+ @noop $(assign DEPS_MADE+:=s_$(@:f:s/.obj/.dpcc/))
+.ENDIF # "$(nodep)"==""
+.ELSE # "$(OS)"=="MACOSX"
+ @echo "No recipe for compiling Objective-C++ files is available for this platform"
+.ENDIF # "$(OS)"=="MACOSX"
+
+# Objective-C++ files
+$(SLO)/%.obj : %.mm
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE)
+.IF "$(OS)"=="MACOSX"
+ @$(RM) $@ $(@:s/.obj/.o/)
+ $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $*.mm
+ @$(IFEXIST) $(@:s/.obj/.o/) $(THEN) $(TOUCH) $@ $(FI)
+.IF "$(nodep)"==""
+ $(COMMAND_ECHO)$(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< ) > $(MISC)/s_$(@:f:s/.obj/.dpcc/)
+ @noop $(assign DEPS_MADE+:=s_$(@:f:s/.obj/.dpcc/))
+.ENDIF # "$(nodep)"==""
+.ELSE # "$(OS)"=="MACOSX"
+ @echo "No recipe for compiling Objective-C++ files is available for this platform"
+.ENDIF # "$(OS)"=="MACOSX"
+
+$(MISC)/%.dpslo :
+ @echo "Making: " $(@:f)
+ @@$(RM) $@
+ @@-$(CDD) $(MISC) && $(!null,$(all_local_slo) $(TYPE:s/+//) echo #) $(foreach,i,$(all_local_slo:b:+".dpcc") s_$(i)) > $(@:f)
+ @@-$(CDD) $(MISC) && $(!null,$(all_misc_slo) $(TYPE:s/+//) echo #) $(foreach,i,$(all_misc_slo:b:+".dpcc") s_$(i)) >> $(@:f)
+ @$(TYPE) $(mktmp $(foreach,i,$(all_local_slo:b:+".dpcc") $(@:s#\#/#:^"\n") : $(MISC:s#\#/#)/s_$i) $(foreach,i,$(all_misc_slo:b:+".dpcc") $(@:s#\#/#:^"\n") : $(MISC:s#\#/#)/s_$i)) >> $@
+ @$(TYPE) $(mktmp $(TARGET)_known_dpcc+=$(all_local_slo:b:+".dpcc":^"s_") $(all_misc_slo:b:+".dpcc":^"s_")) >> $@
+
+$(MISC)/%.dpobj :
+ @echo "Making: " $(@:f)
+ @@$(RM) $@
+ @@-$(CDD) $(MISC) && $(!null,$(all_local_obj) $(TYPE:s/+//) echo #) $(foreach,i,$(all_local_obj:b:+".dpcc") o_$(i)) > $(@:f)
+ @@-$(CDD) $(MISC) && $(!null,$(all_misc_obj) $(TYPE:s/+//) echo #) $(foreach,i,$(all_misc_obj:b:+".dpcc") o_$(i)) >> $(@:f)
+ @$(TYPE) $(mktmp $(foreach,i,$(all_local_obj:b:+".dpcc") $(@:s#\#/#:^"\n") : $(MISC:s#\#/#)/o_$i) $(foreach,i,$(all_misc_obj:b:+".dpcc") $(@:s#\#/#:^"\n") : $(MISC:s#\#/#)/o_$i)) >> $@
+ @$(TYPE) $(mktmp $(TARGET)_known_dpcc+=$(all_local_obj:b:+".dpcc":^"s_") $(all_misc_obj:b:+".dpcc":^"s_")) >> $@
+
+# see also %.dpslo
+not_existing/s_%.dpcc : %.cxx;@noop $(assign all_local_slo+:=$<)
+not_existing/o_%.dpcc : %.cxx;@noop $(assign all_local_obj+:=$<)
+
+not_existing/s_%.dpcc : %.cpp;@noop $(assign all_local_slo+:=$<)
+not_existing/o_%.dpcc : %.cpp;@noop $(assign all_local_obj+:=$<)
+
+not_existing/s_%.dpcc : $(MISC)/%.c;@noop $(assign all_misc_slo+:=$<)
+not_existing/o_%.dpcc : $(MISC)/%.c;@noop $(assign all_misc_obj+:=$<)
+
+not_existing/s_%.dpcc : $(MISC)/%.cxx;@noop $(assign all_misc_slo+:=$<)
+not_existing/o_%.dpcc : $(MISC)/%.cxx;@noop $(assign all_misc_obj+:=$<)
+
+not_existing/s_%.dpcc : %.mm;@noop $(assign all_local_slo+:=$<)
+not_existing/o_%.dpcc : %.mm;@noop $(assign all_local_obj+:=$<)
+
+not_existing/s_%.dpcc : $(MISC)/%.mm;@noop $(assign all_misc_slo+:=$<)
+not_existing/o_%.dpcc : $(MISC)/%.mm;@noop $(assign all_misc_obj+:=$<)
+
+# dependencies objective-c
+
+$(MISC)/s_%.dpcc : %.m
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(MAKEDEPEND) -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< > $@
+ @echo $@ : $(SLO)/$(<:b).obj >> $@
+
+$(MISC)/o_%.dpcc : %.m
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(MAKEDEPEND) -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< > $@
+ @echo $@ : $(OBJ)/$(<:b).obj >> $@
+
+$(MISC)/s_%.dpcc : $(MISC)/%.m
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ $(COMMAND_ECHO)$(MAKEDEPEND) -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< | sed s\#$(MISC)/\#\# > $@
+.ELSE # "$(GUI)"=="UNX"
+ $(COMMAND_ECHO)$(MAKEDEPEND) -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< | $(SED) s/$(MISC:s/\/\\/)\\// > $@
+.ENDIF # "$(GUI)"=="UNX"
+ @echo $@ : $(SLO)/$(<:b).obj >> $@
+
+$(MISC)/o_%.dpcc : $(MISC)/%.m
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ $(COMMAND_ECHO)$(MAKEDEPEND) -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< | sed s\#$(MISC)/\#\# > $@
+.ELSE # "$(GUI)"=="UNX"
+ $(COMMAND_ECHO)$(MAKEDEPEND) -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $< | $(SED) s/$(MISC:s/\/\\/)\\// > $@
+.ENDIF # "$(GUI)"=="UNX"
+ @echo $@ : $(OBJ)/$(<:b).obj >> $@
+
+# dependency dummy for *.s files
+
+$(MISC)/s_%.dpcc : %.s
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(MAKEDEPEND) -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $< > $@
+ @echo $@ : $(SLO)/$(<:b).obj >> $@
+
+$(MISC)/s_%.dpcc : $(SLO)/%.obj
+ @noop $(assign DEPS_MISSING+:=$(@:f))
+
+$(MISC)/o_%.dpcc : $(OBJ)/%.obj
+ @noop $(assign DEPS_MISSING+:=$(@:f))
+
+# dependencies script files
+
+$(MISC)/%.dpsc :
+ @@-$(RM) $@
+ @@-$(MKDIR) $(MISC)/{$(subst,$(@:d:d:d), $(@:d:d))}
+ $(COMMAND_ECHO)$(MAKEDEPEND) -f - -p$(PAR)/{$(subst,$(@:d:d:d), $(@:d:d))} -o.par -D{$(subst,$(@:d:d:d:u), $(@:d:d:u))}_PRODUCT $(CDEFS) -DDLLPOSTFIX=$(DLLPOSTFIX) -I. -I$(INC) -I$(INCLOCAL) -I$(INCGUI) -I$(INCCOM) $(*:b).scp > $@
+ @echo $@ : $(PAR)/{$(subst,$(@:d:d:d), $(@:d:d))}/$(*:b).par >> $@
+ @echo $(PAR)/{$(subst,$(@:d:d:d), $(@:d:d))}/$(*:b).par : $(*:b).scp >> $@
+
+# dependencies rc files (native resources for windows)
+
+$(MISC)/%.dprc :
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(MAKEDEPEND) -f - -p$(RES) -o.res $(RCLANGFLAGS_{$(subst,$(@:d:d:d:u), $(@:d:d:u))}:u:s/ //) $(CDEFS) -DDLLPOSTFIX=$(DLLPOSTFIX) -I. -I$(INC) -I$(INCLOCAL) -I$(INCGUI) -I$(INCCOM) -I$(SOLARENV)/inc $(*:b).rc >> $@
+# @echo $@ : $(RES)/{$(subst,$(@:d:d:d), $(@:d:d))}/$(*:b).res >> $@
+ @echo $@ : $(RES)/$(*:b).res >> $@
+
+$(MISC)/%.dpr :
+ @@noop
+.IF "$(nodep)"==""
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)dmake $(MFLAGS) $(MAKEFILE) $(CALLMACROS) make_srs_deps=true $(DEPSRSFILES)
+ $(COMMAND_ECHO)-$(TYPE) $(MISC)/$(TARGET).*.dprr >> $@
+.ENDIF # "$(nodep)"==""
+
+$(MISC)/%.dpz :
+ @@noop
+.IF "$(nodep)"==""
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)dmake $(MFLAGS) $(MAKEFILE) $(CALLMACROS) make_zip_deps=true $(ZIPDEPFILES)
+ $(COMMAND_ECHO)$(TYPE) $(ZIPDEPFILES) $(mktmp $(NULL)) | grep -v "CVS" | grep -v "\.svn" >> $@
+ @echo zipdep_langs=$(alllangiso) >> $@
+ @@-$(RM) $(ZIPDEPFILES)
+.ENDIF # "$(nodep)"==""
+
+# Dependencies fuer java - Files
+
+$(MISC)/%.dpj :
+ @echo "Making: " $(@:f)
+.IF "$(nodep)"!=""
+.IF "$(GUI)"=="UNX"
+ @echo > $@
+.ELSE
+ @$(ECHONL) > $@
+.ENDIF
+.ELSE # "$(ndep)"==""
+.IF "$(GUI)"=="UNX"
+ @echo $(shell @$(STARDEP) @$(mktmp -o $@ -i $(CLASSDIR) $(foreach,i,$(JAVADEPINCLUDES:s/:/ /) -i $i) $(JAVACLASSFILES)))
+.ELSE
+ @echo javadeps
+ @echo $(shell @$(STARDEP) @$(mktmp -o $@ -i $(CLASSDIR) $(foreach,i,$(JAVADEPINCLUDES:s/;/ /) -i $i) $(JAVACLASSFILES)))
+.ENDIF
+.ENDIF # "$(nodep)"==""
+
+$(SLO)/%.obj : %.asm
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE)
+.IF "$(COM)"=="GCC"
+.IF "$(ASM)"=="ml"
+ $(COMMAND_ECHO)$(ASM) $(AFLAGS) -D$(COM) /Fo$(SLO)/$*.obj $*.asm
+ @@-$(RM) $*.err
+.ELSE # "$(ASM)"=="ml"
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(ASM) $(AFLAGS) $*.asm,$(SLO)/$*.obj;
+.ENDIF # "$(ASM)"=="ml"
+.ELSE
+.IF "$(COM)"=="WTC"
+ $(COMMAND_ECHO)$(ASM) $(AFLAGS) -D$(COM) $*.asm -fo=$(SLO)/$*.obj
+ @-$(IFEXIST) $*.err $(THEN) $(RM:s/+//) $*.err $(FI)
+.ELSE
+.IF "$(COM)"=="MSC"
+.IF "$(ASM)"=="ml"
+ $(COMMAND_ECHO)$(ASM) $(AFLAGS) -D$(COM) /Fo$(SLO)/$*.obj $*.asm
+ @-$(IFEXIST) $*.err $(THEN) $(RM:s/+//) $*.err $(FI)
+.ELSE # "$(ASM)"=="ml"
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(ASM) $(AFLAGS) $*.asm,$(SLO)/$*.obj;
+.ENDIF # "$(ASM)"=="ml"
+.ENDIF "$(COM)"=="MSC"
+.ENDIF
+.ENDIF
+
+$(OBJ)/%.obj : %.asm
+ @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE)
+.IF "$(COM)"=="GCC"
+.IF "$(ASM)"=="ml"
+ $(COMMAND_ECHO)$(ASM) $(AFLAGS) -D$(COM) /Fo$(OBJ)/$*.obj $*.asm
+ @@-$(RM) $*.err
+.ELSE # "$(ASM)"=="ml"
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(ASM) $(AFLAGS) $*.asm,$(OBJ)/$*.obj;
+.ENDIF # "$(ASM)"=="ml"
+.ELSE
+.IF "$(COM)"=="MSC"
+.IF "$(ASM)"=="ml"
+ $(COMMAND_ECHO)$(ASM) $(AFLAGS) -D$(COM) /Fo$(SLO)/$*.obj $*.asm
+ @-$(IFEXIST) $*.err $(THEN) $(RM:s/+//) $*.err $(FI)
+.ELSE # "$(ASM)"=="ml"
+ @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ >& $(NULLDEV) $(FI)
+ $(COMMAND_ECHO)$(ASM) $(AFLAGS) $*.asm,$(OBJ)/$*.obj;
+.ENDIF # "$(ASM)"=="ml"
+.ENDIF "$(COM)"=="MSC"
+.ENDIF
+
+$(OUT)/ucr/$(IDLPACKAGE)/%.urd : %.idl
+ @noop $(assign all_outdated_idl+:=$<)
+
+$(OUT)/ucrdoc/$(IDLPACKAGE)/%.urd : %.idl
+ @noop $(assign all_outdated_doc_idl+:=$<)
+
+# make *.xml descriptions available in $(MISC)
+$(MISC)/%$($(WINVERSIONNAMES)_MAJOR).xml : %.xml
+ $(COMMAND_ECHO)$(COPY) $< $@
+
+# dummy rule to make sure xml file is in place when used in settings.mk
+$(MISC)/%.mk : $(MISC)/%$($(WINVERSIONNAMES)_MAJOR).xml
+ @$(TOUCH) $@
+ @echo XML2MK_FILES += $(@:b) >> $@
+
+#generate descriptions from xml
+$(MISC)/%$($(WINVERSIONNAMES)_MAJOR)_description.cxx : $(MISC)/%$($(WINVERSIONNAMES)_MAJOR).xml
+ xml2cmp -func $(MISC)/$*$($(WINVERSIONNAMES)_MAJOR)_description.cxx $<
+
+#generate private rdb
+$(BIN)/%.rdb: $(MISC)/%$($(WINVERSIONNAMES)_MAJOR).xml
+ $(COMMAND_ECHO)$(RDBMAKER) -BUCR -O$(BIN)/$*.rdb @$(mktmp $(foreach,i,$($(@:b)_XML2CMPTYPES) -T$i ) $(COMPRDB))
+
+#strip dos lineends
+$(MISC)/%.sh : %.sh
+ @@-$(RM) -f $@
+ @tr -d "\015" < $< > $@
+
+# merge targets
+.IF "$(WITH_LANG)"!=""
+$(COMMONMISC)/$(TARGET)/%.ulf : %.ulf
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(ULFEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+$(COMMONMISC)/$(TARGET)/%.xrb : %.xrb
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(XMLEX) -t xrb -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+$(COMMONMISC)/$(MYPATH)/%.xrm : %.xrm
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ @echo trysdf = $(TRYSDF)
+ $(COMMAND_ECHO)$(XRMEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+#$(COMMONMISC)/$(TARGET)/%.xrm : %.xrm
+# -$(MKDIRHIER) $(@:d)
+# -$(RM) $@
+# $(XRMEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+# $(RENAME) $@.$(INPATH) $@
+# -$(RM) $@.$(INPATH)
+#
+#$(COMMONMISC)/%.xrm : %.xrm
+# -$(MKDIR) $(@:d)
+# -$(RM) $@
+# $(XRMEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+# $(RENAME) $@.$(INPATH) $@
+# -$(RM) $@.$(INPATH)
+.ENDIF # "$(WITH_LANG)"!=""
+
+.IF "$(WITH_LANG)"!=""
+$(COMMONMISC)/$(TARGET)/%.jlf : $$(@:db).ulf
+.ELSE # "$(WITH_LANG)"!=""
+$(COMMONMISC)/$(TARGET)/%.jlf : $$(@:b).ulf
+.ENDIF # "$(WITH_LANG)"!=""
+ @-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(ULFCONV) -o $@.$(INPATH) $<
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+.IF "$(WITH_LANG)"!=""
+$(COMMONMISC)/$(TARGET)/%.mlf : $$(@:db).ulf
+.ELSE # "$(WITH_LANG)"!=""
+$(COMMONMISC)/$(TARGET)/%.mlf : $$(@:b).ulf
+.ENDIF # "$(WITH_LANG)"!=""
+ @-$(MKDIRHIER) $(@:d)
+ @-$(RM) $@
+ @$(ULFCONV) -o $@.$(INPATH) -t $(SOLARBINDIR)/msi-encodinglist.txt $<
+ @$(RENAME) $@.$(INPATH) $@
+ @-$(RM) $@.$(INPATH)
+
+.IF "$(WITH_LANG)"!=""
+$(COMMONMISC)/$(TARGET)/%.uulf : $$(@:db).ulf
+.ELSE # "$(WITH_LANG)"!=""
+$(COMMONMISC)/$(TARGET)/%.uulf : $$(@:b).ulf
+.ENDIF # "$(WITH_LANG)"!=""
+ @-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ @$(COPY) $< $@.$(INPATH)
+ @$(RENAME) $@.$(INPATH) $@
+ @-$(RM) $@.$(INPATH)
+
+# This is still needed?????
+$(COMMONMISC)/$(TARGET)/%.xrm : %.xrm
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(XRMEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+# dirty hack
+# if local *.sdf file is missing
+#%.sdf:
+# echo > $@
+
diff --git a/solenv/inc/sc.mk b/solenv/inc/sc.mk
new file mode 100644
index 000000000000..ad2102a92b4f
--- /dev/null
+++ b/solenv/inc/sc.mk
@@ -0,0 +1,28 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# TODO: remove usage and file...
diff --git a/solenv/inc/scpre.mk b/solenv/inc/scpre.mk
new file mode 100644
index 000000000000..1b9b7a7dacac
--- /dev/null
+++ b/solenv/inc/scpre.mk
@@ -0,0 +1,50 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+
+#======================================================================
+# standardmaessig mit Optimierung, muss explizit mit nopt=t ausgeschaltet
+# werden, wenn nicht gewuenscht
+#----------------------------------------------------------------------
+
+#.IF defined(nopt) || defined(NOPT)
+#nopt=true
+#NOPT=TRUE
+#!undef optimize
+#!undef OPTIMIZE
+#.ELSE
+#.IF !(defined(debug) || defined(DEBUG))
+#optimize=true
+#OPTIMIZE=TRUE
+#.ENDIF
+#.ENDIF
+
+# falls dependencies auf s:\solver\... erstellt werden sollen
+# MKDEPENDSOLVER=YES
+
+
diff --git a/solenv/inc/set_ext.mk b/solenv/inc/set_ext.mk
new file mode 100644
index 000000000000..8d6d4db5a627
--- /dev/null
+++ b/solenv/inc/set_ext.mk
@@ -0,0 +1,37 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#defaults
+TARFILE_ROOTDIR*=$(TARFILE_NAME)
+UNTAR_FLAG_FILE*=so_unpacked_$(TARGET)
+ADD_FILES_FLAG_FILE*=so_addfiles_$(TARGET)
+PATCH_FLAG_FILE*=so_patched_$(TARGET)
+CONFIGURE_FLAG_FILE*=so_configured_$(TARGET)
+BUILD_FLAG_FILE*=so_built_$(TARGET)
+INSTALL_FLAG_FILE*=so_installed_$(TARGET)
+PREDELIVER_FLAG_FILE*=so_predeliver_$(TARGET)
+
diff --git a/solenv/inc/set_wntx64.mk b/solenv/inc/set_wntx64.mk
new file mode 100755
index 000000000000..412fb3bd2821
--- /dev/null
+++ b/solenv/inc/set_wntx64.mk
@@ -0,0 +1,215 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+###############################################
+# Windows 64 bit special
+# only used for 64 bit shell extension
+# ( Windows Vista )
+# ---------------------------------------------
+# THIS FILE WILL BE DELETED when a fully ported
+# Windows 64 bit version is available
+###############################################
+
+.IF "$(BUILD_X64)"!=""
+# ----------------- settings for x64 --------------------
+CC_X64*:=$(WRAPCMD) $(CXX_X64_BINARY)
+CXX_X64*:=$(WRAPCMD) $(CXX_X64_BINARY)
+LINK_X64*:=$(WRAPCMD) $(LINK_X64_BINARY) $(NOLOGO) -MACHINE:X64
+LIBMGR_X64=$(WRAPCMD) $(LIBMGR_X64_BINARY) $(NOLOGO)
+IMPLIB_X64=$(WRAPCMD) $(LIBMGR_X64_BINARY)
+
+USE_CFLAGS_X64=-c -nologo -Gs $(NOLOGO) -Zm500 -Zc:forScope,wchar_t- -GR
+
+# Stack buffer overrun detection.
+CFLAGS+=-GS
+
+USE_CDEFS_X64+= -DWIN32 -D_AMD64_=1 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NON_CONFORMING_SWPRINTFS
+.IF "$(debug)"!=""
+USE_CFLAGS_X64+=-Zi -Fd$(MISC_X64)/$(@:b).pdb
+USE_CDEFS_X64+=-DDEBUG
+.ENDIF # "$(debug)"!=""
+USE_CFLAGS_X64+=$(CFLAGS_X64)
+USE_CDEFS_X64+=$(CDEFS_X64)
+INCLUDE_X64=$(subst,/stl$(SPACECHAR),dont_use_stl$(SPACECHAR) $(INCLUDE))
+
+.IF "$(product)" != ""
+USE_CFLAGS_X64+=-Gy
+.ENDIF # "$(product)" != ""
+
+# inline expansion
+USE_CFLAGS_X64+=-Ob1
+
+.IF "$(DYNAMIC_CRT)"!=""
+CDEFSSLOMT_X64+=-D_MT -D_DLL
+CDEFSSLOMT_X64+=-D_MT -D_DLL
+.IF "$(NO_DYNAMIC_OBJ)"==""
+CDEFSOBJMT_X64+=-D_MT -D_DLL
+CDEFSOBJMT_X64+=-D_MT -D_DLL
+.ELSE
+CDEFSOBJMT_X64+=-D_MT
+CDEFSOBJMT_X64+=-D_MT
+.ENDIF # "$(NO_DYNAMIC_OBJ)"==""
+.ELSE
+CDEFSSLOMT_X64+=-D_MT
+CDEFSOBJMT_X64+=-D_MT
+.ENDIF # "$(DYNAMIC_CRT)"!=""
+
+.IF "$(PRODUCT)"!="full"
+.ELSE
+LINKFLAGS_X64=/MAP /OPT:NOREF
+.ENDIF
+
+# excetion handling protection
+LINKFLAGS+=-safeseh
+
+# enable DEP
+LINKFLAGS+=-nxcompat
+
+# enable ASLR
+LINKFLAGS+=-dynamicbase
+
+.IF "$(PRODUCT)"!="full"
+LINKFLAGS_X64+= -NODEFAULTLIB -DEBUG
+.ELSE # "$(PRODUCT)"!="full"
+LINKFLAGS_X64+= -NODEFAULTLIB -RELEASE -DEBUG -INCREMENTAL:NO
+.ENDIF # "$(PRODUCT)"!="full"
+MAPFILE=-out:$$@
+
+.IF "$(debug)" != ""
+LINKFLAGS_X64+= $(LINKFLAGSDEBUG)
+.ENDIF
+
+LINKFLAGSSHLCUI_X64=/SUBSYSTEM:CONSOLE /DLL
+LINKFLAGSSHL_X64=$(LINKFLAGSSHLCUI_X64)
+CDEFSSLO_X64+=$(CDEFSMT_X64) $(CDEFSOBJMT_X64)
+CFLAGSSLO_X64+=-MT
+
+STDOBJGUI_X64=
+STDSLOGUI_X64=
+STDOBJCUI_X64=
+STDSLOCUI_X64=
+
+IMPLIBFLAGS_X64=-machine:X64
+
+LIBPATH_X64=$(PSDK)/lib/x64
+LIBPATH_VC_X64=$(COMPATH)/lib/amd64
+
+ADVAPI32LIB_X64=$(LIBPATH_X64)/advapi32.lib
+SHELL32LIB_X64=$(LIBPATH_X64)/shell32.lib
+GDI32LIB_X64=$(LIBPATH_X64)/gdi32.lib
+OLE32LIB_X64=$(LIBPATH_X64)/ole32.lib
+OLEAUT32LIB_X64=$(LIBPATH_X64)/oleaut32.lib
+UUIDLIB_X64=$(LIBPATH_X64)/uuid.lib
+WINSPOOLLIB_X64=$(LIBPATH_X64)/winspool.lib
+IMM32LIB_X64=$(LIBPATH_X64)/imm32.lib
+VERSIONLIB_X64=$(LIBPATH_X64)/version.lib
+WINMMLIB_X64=$(LIBPATH_X64)/winmm.lib
+WSOCK32LIB_X64=$(LIBPATH_X64)/wsock32.lib
+MPRLIB_X64=$(LIBPATH_X64)/mpr.lib
+WS2_32LIB_X64=$(LIBPATH_X64)/ws2_32.lib
+KERNEL32LIB_X64=$(LIBPATH_X64)/kernel32.lib
+USER32LIB_X64=$(LIBPATH_X64)/user32.lib
+COMDLG32LIB_X64=$(LIBPATH_X64)/comdlg32.lib
+COMCTL32LIB_X64=$(LIBPATH_X64)/comctl32.lib
+CRYPT32LIB_X64=$(LIBPATH_X64)/crypt32.lib
+GDIPLUSLIB_X64=$(LIBPATH_X64)/gdiplus.lib
+DBGHELPLIB_X64=$(LIBPATH_X64)/dbghelp.lib
+PROPSYSLIB_X64=$(LIBPATH_X64)/propsys.lib
+MSILIB_X64=$(LIBPATH_X64)/msi.lib
+DDRAWLIB_X64=$(LIBPATH_X64)/ddraw.lib
+SHLWAPILIB_X64=$(LIBPATH_X64)/shlwapi.lib
+URLMONLIB_X64=$(LIBPATH_X64)/urlmon.lib
+UNICOWSLIB_X64=$(LIBPATH_X64)/unicows.lib
+WININETLIB_X64=$(LIBPATH_X64)/wininet.lib
+OLDNAMESLIB_X64=$(LIBPATH_VC_X64)/oldnames.lib
+MSIMG32LIB_X64=$(LIBPATH_X64)/msimg32.lib
+MSVCPRT_X64=$(LIBPATH_VC_X64)/msvcprt.lib
+MSVCRT_X64=$(LIBPATH_VC_X64)/msvcrt.lib
+
+MISC_X64=$(MISC)/x64
+OBJ_X64=$(OBJ)/x64
+SLO_X64=$(SLO)/x64
+LB_X64=$(LB)/x64
+SLB_X64=$(SLB)/x64
+L_X64=$(SOLARLIBDIR_X64)
+VERSIONOBJ_X64=$(SLO_X64)/_version.obj
+BIN_X64=$(BIN)/x64
+RES_X64=$(RES)/x64
+SOLARLIBDIR_X64=$(SOLARVERSION)/$(INPATH)/lib$(UPDMINOREXT)/x64
+LIB_X64:=$(LB_X64);$(SLB_X64);$(ILIB_X64)
+
+.IF "$(LIBTARGET)"==""
+.IF "$(OBJFILES_X64)$(IDLOBJFILES_X64)"!=""
+OBJTARGET_X64=$(LB_X64)/$(TARGET).lib
+.ENDIF # "$(OBJFILES_X64)$(IDLOBJFILES_X64)"!=""
+.IF "$(SLOFILES_X64)$(IDLSLOFILES_x64)"!=""
+SLOTARGET_X64=$(SLB_X64)/$(TARGET).lib
+.ENDIF # "$(SLOFILES_X64)$(IDLSLOFILES_x64)"!=""
+.ENDIF # "$(LIBTARGET)"==""
+
+.IF "$(OBJFILES_X64)"!=""
+.IF "$(LIBTARGET)" != ""
+NOLIBOBJTARGET_X64=$(OBJFILES_X64)
+.ENDIF
+.ENDIF
+
+.IF "$(SLOFILES_X64)"!=""
+.IF "$(LIBTARGET)" != ""
+NOLIBSLOTARGET_X64=$(SLOFILES_X64)
+.ENDIF
+.ENDIF
+
+.IF "$(SHL1TARGET_X64)"!=""
+SHL1TARGETN_X64=$(BIN_X64)/$(DLLPRE)$(SHL1TARGET_X64)$(DLLPOST)
+.ENDIF
+.IF "$(SHL2TARGET_X64)"!=""
+SHL2TARGETN_X64=$(BIN_X64)/$(DLLPRE)$(SHL2TARGET_X64)$(DLLPOST)
+.ENDIF
+.IF "$(LIB1TARGET_X64)" != ""
+LIB1TARGETN_X64=$(LIB1TARGET_X64)
+.ENDIF
+.IF "$(LIB2TARGET_X64)" != ""
+LIB2TARGETN_X64=$(LIB2TARGET_X64)
+.ENDIF
+.IF "$(DEF1NAME_X64)"!=""
+DEF1TARGETN_X64=$(MISC_X64)/$(DEF1NAME_X64).def
+.ENDIF
+.IF "$(DEF2NAME_X64)"!=""
+DEF2TARGETN_X64=$(MISC_X64)/$(DEF2NAME_X64).def
+.ENDIF
+
+$(SLO_X64)/%.obj : $(MISC_X64)/%.c
+ @echo ------------------------------
+ @echo Making: $@
+ -$(MKDIR) $(@:d)
+ @-$(MKDIR) $(MISC_X64)
+ @@-$(RM) $@
+ @$(TYPE) $(mktmp $(CC_X64) $(USE_CFLAGS_X64) $(INCLUDE_C) $(CFLAGSCC_X64) $(CFLAGSSLO_X64) $(USE_CDEFS_X64) $(CDEFSSLO_X64) $(CFLAGSAPPEND_X64) $(CFLAGSOUTOBJ)$(SLO_X64)/$*.obj $(MISC_X64)/$*.c )
+ @$(ECHONL)
+ $(CC_X64) @$(mktmp $(USE_CFLAGS_X64) $(INCLUDE_C) $(CFLAGSCC_X64) $(CFLAGSSLO_X64) $(USE_CDEFS_X64) $(CDEFSSLO_X64) $(CFLAGSAPPEND_X64) $(CFLAGSOUTOBJ)$(SLO_X64)/$*.obj $(MISC_X64)/$*.c )
+
+.ENDIF # "$(BUILD_X64)"!=""
+
diff --git a/solenv/inc/settings.mk b/solenv/inc/settings.mk
new file mode 100644
index 000000000000..a4b02a9ed164
--- /dev/null
+++ b/solenv/inc/settings.mk
@@ -0,0 +1,1377 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+MKFILENAME:=SETTINGS.MK
+
+# smaller/greater arithmetic's like ".IF 400<=200" are an OOo extention to
+# the initial dmake 4.1PL0 (unfortunately called 4.10) version and are
+# tested implicitly by the construction below.
+.IF $(MAKEVERSION:s/-cvs//:s/.//)<=410
+.ERROR : ; @echo Forced error: dmake version 4.11 or newer is needed!
+force_dmake_to_error
+.ENDIF
+
+.INCLUDE .IGNORE : ooo_vendor.mk
+
+# --- common tool makros --------------------------------------
+
+.IF "$(USE_PCH)"!=""
+ENABLE_PCH=TRUE
+.ENDIF # "$(USE_PCH)"!=""
+
+.IF "$(ENABLE_PCH)"!="" && "$(BUILD_SPECIAL)"!=""
+.IF "$(SOLARSRC)"=="$(SRC_ROOT)"
+NETWORK_BUILD:=TRUE
+.ENDIF # "$(SOLARSRC)"=="$(SRC_ROOT)"
+.ENDIF # "$(ENABLE_PCH)"!="" && "$(BUILD_SPECIAL)"!=""
+
+.INCLUDE : unitools.mk
+
+.INCLUDE : minor.mk
+
+.INCLUDE .IGNORE : rtlbootstrap.mk
+
+PLATFORMID = $(RTL_OS:l)_$(RTL_ARCH:l)
+EXTNAME*=$(EXTENSIONNAME)_in
+
+.IF "$(UPDATER)"!="" || "$(CWS_WORK_STAMP)"!=""
+
+.IF "$(SOURCEVERSION)"!="$(WORK_STAMP)"
+.ERROR : ; @echo Forced error: minor.mk in solenv/inc does not match your version!
+WRONG_SOURCEVERSION
+.ENDIF
+
+# Create $(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)/$(UPD)minor.mk if needed
+%minor.mk : $(SOLARENV)/inc/minor.mk
+ @@-$(MKDIRHIER) $(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)
+ @@$(COPY) $(SOLARENV)/inc/minor.mk $(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)/$(UPD)minor.mk
+ @@$(TOUCH) $(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)/minormkchanged.flg
+.ENDIF # "$(UPDATER)"!="" || "$(CWS_WORK_STAMP)"!=""
+
+# Force creation of $(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)/
+# $(UPD)minor.mk could be empty as it's contents were already included from minor.mk
+.INCLUDE : $(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)/$(UPD)minor.mk
+
+.IF "$(BSCLIENT)"=="TRUE"
+.IF "$(UPDATER)"!="YES"
+incorrect_settings:
+ @echo "#"
+ @echo "#" ERROR: setsolar option -bsclient used but UPDATER=YES not set!
+ @echo "#"
+ force_dmake_to_error
+.ENDIF
+.ENDIF
+
+.INCLUDE : udkversion.mk
+
+# --- reset defined Environments --------------------
+ASM=
+AFLAGS=
+
+
+#START JAVA
+
+#interpreter location
+.IF "$(JAVAINTERPRETER)" == ""
+.IF "$(JDK)" == "J++"
+JAVAINTERPRETER=jview.exe
+.ELSE
+.IF "$(JDK)" == "SCAFE"
+.IF "$(JDK_VERSION)" != ""
+JAVAINTERPRETER=$(DEVROOT)/vcafe11/java/bin/java.exe
+.ELSE
+JAVAINTERPRETER=$(DEVROOT)/cafepro/java/bin/java.exe
+.ENDIF
+.ELSE
+.IF "$(JAVACISGCJ)" == "yes"
+JAVAINTERPRETER=gij
+.ELSE
+JAVAINTERPRETER=java
+.ENDIF
+.ENDIF
+.ENDIF
+.ENDIF
+
+#compiler location
+.IF "$(JAVACOMPILER)" == ""
+.IF "$(JDK)" == "J++"
+JAVACOMPILER=jvc.exe
+.ELSE
+.IF "$(JDK)" == "SCAFE"
+.IF "$(JDK_VERSION)" != ""
+JAVACOMPILER=$(DEVROOT)/vcafe11/bin/sj.exe
+.ELSE
+JAVACOMPILER=$(DEVROOT)/cafepro/bin/sj.exe
+.ENDIF
+.ELSE
+.IF "$(JAVACISGCJ)" == "yes"
+JAVACOMPILER=gcj
+.ELSE
+JAVACOMPILER=javac
+.ENDIF
+.ENDIF
+.ENDIF
+.ENDIF
+
+#if javadoc is not already set
+.IF "$(JAVADOC)"==""
+JAVADOC=javadoc -J-Xmx120m
+.ENDIF
+
+#required arguments
+JAVAC=$(JAVACOMPILER)
+JAVAI:=$(JAVAINTERPRETER)
+.IF "$(JAVACISGCJ)" == "yes"
+JAVAC+=--encoding=UTF-8 -O2 -fno-assert -Wno-deprecated -C
+.ENDIF
+
+#classpath and response
+.IF "$(JDK)" == "J++"
+JAVACPS=/cp
+.ELSE
+.IF "$(JDK)" == "SCAFE"
+JAVACPS=-classpath
+JAVARESPONSE=TRUE
+.ELSE
+JAVACPS=-classpath
+JAVARESPONSE=
+.ENDIF
+.ENDIF
+
+JAVAFLAGS+=$(JAVA_TARGET_FLAG)
+
+#END JAVA
+
+CDEFS=
+CXXDEFS=
+CDEFSCXX=
+CDEFSOBJ=
+CDEFSSLO=
+CDEFSGUI=
+CDEFSCUI=
+CDEFSMT=
+CDEFSPROF=
+CDEFSDEBUG=
+CDEFSDBGUTIL=
+CDEFSOPT=
+
+CFLAGS=
+CFLAGSCALL=
+CFLAGSCXX=
+CFLAGSCC=
+CFLAGSOBJ=
+CFLAGSSLO=
+CFLAGSOBJGUIMT=
+CFLAGSOBJCUIMT=
+CFLAGSSLOGUIMT=
+CFLAGSSLOCUIMT=
+CFLAGSPROF=
+CFLAGSDEBUG=
+CFLAGSDBGUTIL=
+CFLAGSOPT=
+CFLAGSNOOPT=
+CFLAGSOUTOBJ=
+
+CFLAGSINCXX=
+
+LINKFLAGS=
+LINKFLAGSAPPGUI=
+LINKFLAGSSHLGUI=
+LINKFLAGSAPPCUI=
+LINKFLAGSSHLCUI=
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=
+LINKFLAGSOPT=
+LINKFLAGSAPP=
+LINKFLAGSSHL=
+LINKEXTENDLINE=
+
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+STDLIBGUIMT=
+STDLIBCUIMT=
+STDSHLGUIMT=
+STDSHLCUIMT=
+STDOBJ=
+STDSLO=
+STDLIB=
+STDSHL=
+
+LIBFLAGS=
+
+IMPLIBMGR=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RSC=
+RSCFLAGS=
+RSCDEFS=
+RSCLANG=
+
+RC=
+RCFLAGS=
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX=
+
+HC=
+HCFLAGS=
+
+MKDEP=
+
+AS=
+BC=
+COBOL=
+CPP=
+FOR=
+PASCAL=
+
+BFLAGS=
+COBFLAGS=
+CPPFLAGS=
+CXXFLAGS=
+FFLAGS=
+PFLAGS=
+RFLAGS=
+
+LNT=
+LNTFLAGS=
+LNTFLAGSGUI=
+LNTFLAGSCOM=
+
+# doesn't make sense
+#IDLSTATICOBJS=
+
+E2P=
+CAP=
+cap=
+
+# not to reset because possibly taken from environment
+#CC=
+#CXX=
+#LINK=
+#LIBMGR=
+
+
+# avoid confusion with CUE PROFILE variable...
+PROFILE=
+
+# can be set on the command line. we shouldn't delete them!
+#profile=
+
+# reset as setting those manually is no lonjger supported
+DBGUTIL=
+dbgutil=
+
+# ===========================================================================
+# unter NT werden Variablennamen an untergeordnete makefiles UPPERCASE
+# weitergereicht, aber case significant ausgewertet!
+# ---------------------------------------------------------------------------
+
+DMAKE_WORK_DIR*:=$(subst,/,/ $(PWD))
+.IF "$(GUI)"=="WNT"
+posix_PWD:=/cygdrive/$(PWD:s/://)
+.ELSE #GUI)"=="WNT"
+posix_PWD:=$(PWD)
+.ENDIF #GUI)"=="WNT"
+
+
+.IF "$(TMP)"!=""
+tmp*=$(TMP)
+.ENDIF
+
+.IF "$(tmp)"!=""
+TMP*=$(tmp)
+.ENDIF
+
+.IF "$(TEMP)"!=""
+temp*=$(TEMP)
+.ENDIF
+
+.IF "$(temp)"!=""
+TEMP*=$(temp)
+.ENDIF
+
+.IF "$(DEPEND)"!=""
+depend=$(DEPEND)
+.ENDIF
+
+.IF "$(OPTIMIZE)"!=""
+optimize=$(OPTIMIZE)
+.ENDIF
+
+.IF "$(NOPT)"!=""
+nopt*=$(NOPT)
+.ENDIF
+
+.IF "$(GROUP)"!=""
+group*=$(GROUP)
+.ENDIF
+
+.IF "$(group)"!=""
+GROUP*=$(group)
+.ENDIF
+
+# override dbglevel if set manually
+.IF "$(dbglevel)"!=""
+DBG_LEVEL=$(dbglevel)
+.ENDIF
+
+.IF "$(NODEBUG)"!=""
+nodebug=$(NODEBUG)
+.ENDIF
+
+.IF "$(hbtoolkit)"!=""
+HBTOOLKIT=$(hbtoolkit)
+.ENDIF
+
+.IF "$(PRODUCT)"!=""
+product*=$(PRODUCT)
+.ENDIF
+
+.IF "$(product)"!=""
+PRODUCT*=$(product)
+.ENDIF
+
+.IF "$(VERBOSE)"!=""
+verbose*=$(VERBOSE)
+.ENDIF
+
+.IF "$(verbose)"!=""
+# normalize: "false" (any upper/lower case) and "0" mean FALSE, everything else means TRUE
+VERBOSE_IS_FALSE:=$(or $(eq,"$(verbose:u)","FALSE" "false" ) $(eq,"$(verbose)","0" "false" ))
+VERBOSE!:=$(eq,"$(VERBOSE_IS_FALSE)","t" FALSE TRUE)
+.ENDIF
+
+.IF "$(SOLARLANG)" != ""
+solarlang*=$(SOLARLANG)
+.ENDIF
+
+.IF "$(solarlang)" != ""
+SOLARLANG:=$(solarlang)
+.ENDIF
+
+.IF "$(wall)"!=""
+COMPILER_WARN_ALL=TRUE
+.ENDIF # "$(wall)"!=""
+
+.IF "$(werror)"!=""
+COMPILER_WARN_ERRORS=TRUE
+.ENDIF
+
+.IF "$(RSC_ONCE)"!=""
+rsc_once*=$(RSC_ONCE)
+.ENDIF
+
+#.IF "$(COMMON_BUILD)"!=""
+#common_build*=$(COMMON_BUILD)
+#.ENDIF
+common_build:=
+COMMON_BUILD:=
+
+.IF "$(USE_SHL_VERSIONS)"!=""
+use_shl_versions*=$(USE_SHL_VERSIONS)
+.ENDIF
+
+.IF "$(noremove)"!=""
+NOREMOVE*=$(noremove)
+.ENDIF
+
+# --- env flags not case sensitive --------------------------------
+
+#.IF "$(envcflags)"!=""
+ENVCFLAGS*=$(envcflags)
+#.ENDIF
+
+#.IF "$(envcflagscxx)"!=""
+ENVCFLAGSCXX*=$(envcflagscxx)
+#.ENDIF
+
+
+.IF "$(envcdefs)"!=""
+ENVCDEFS*=$(envcdefs)
+.ENDIF
+
+.IF "$(envlibflags)"!=""
+ENVLIBFLAGS*=$(envlibflags)
+.ENDIF
+
+.IF "$(envcflagsincxx)"!=""
+ENVCFLAGSINCXX*=$(envcflagsincxx)
+.ENDIF
+
+.IF "$(envlinkflags)"!=""
+ENVLINKFLAGS*=$(envlinkflags)
+.ENDIF
+
+.IF "$(envrscflags)"!=""
+ENVRSCFLAGS*=$(envrscflags)
+.ENDIF
+
+.IF "$(envrscdefs)"!=""
+ENVRSCDEFS*=$(envrscdefs)
+.ENDIF
+
+.IF "$(envrsclinkflags)"!=""
+# ENVRSCLINKFLAGS*=$(envrsclinkflags)
+.ENDIF
+
+.IF "$(envrcflags)"!=""
+ENVRCFLAGS*=$(envrcflags)
+.ENDIF
+
+.IF "$(envrclinkflags)"!=""
+ENVRCLINKFLAGS*=$(envrclinkflags)
+.ENDIF
+
+# --- set both L10N variables to keep things working ---------------
+
+L10N-framework=$(L10N_framework)
+
+# --- Parameter Einstellungen ueberpruefen und umsetzen ------------
+
+# profile immer mit product
+.IF "$(profile)"!=""
+.IF "$(product)"==""
+product=full
+.ENDIF
+.ENDIF
+
+.IF "$(debug)"!=""
+DBG_LEVEL*=2
+.ENDIF
+
+# Produkt auf einen Wert setzen (alles klein)
+.IF "$(product)" != ""
+optimize=true
+.IF "$(product)" == "full" || "$(product)" == "Full" || "$(product)" == "FULL"
+product!=full
+.ENDIF
+.IF "$(product)" == "demo" || "$(product)" == "Demo" || "$(product)" == "DEMO"
+product!=demo
+.ENDIF
+.IF "$(product)" == "compact" || "$(product)" == "Compact" || "$(product)" == "COMPACT"
+product!=compact
+.ENDIF
+DBG_LEVEL*=0
+.ELSE
+optimize!=true
+dbgutil!=true
+DBG_LEVEL*=1
+USE_STLP_DEBUG*=TRUE
+.ENDIF
+
+.IF "$(debug)"!=""
+.IF "$(debug)"!="D_FORCE_OPT"
+optimize=
+OPTIMIZE=
+.ENDIF
+.ENDIF
+
+.IF "$(nopt)"!=""
+optimize=
+OPTIMIZE=
+.ENDIF
+
+# Optimierung bei FinalCheck funktioniert nicht!
+.IF "$(bndchk)" != ""
+optimize=
+OPTIMIZE=
+.ENDIF
+
+######################################################
+#
+# sprachabh. einstellungen
+#
+######################################################
+
+.INCLUDE : lang.mk
+
+.INCLUDE : postset.mk
+
+RSC_LANG_ISO+:=$(completelangiso)
+.EXPORT : RSC_LANG_ISO
+
+######################################################
+
+.IF "$(TARGETTYPE)"==""
+TARGETTYPE=CUI
+.ENDIF
+
+# --- Pfade setzen -------------------------------------------------
+
+# Output-Pfad
+# profile has to be first for not getting the .pro extension
+.IF "$(profile)"!=""
+OUT=$(PRJ)/$(OUTPATH).cap
+ROUT=$(OUTPATH).cap
+.ELSE
+
+.IF "$(product)"!=""
+OUT=$(PRJ)/$(OUTPATH).pro
+ROUT=$(OUTPATH).pro
+
+.ELSE
+.IF "$(profile)"!=""
+OUT=$(PRJ)/$(OUTPATH).cap
+ROUT=$(OUTPATH).cap
+.ENDIF
+.IF "$(dbcs)"!=""
+OUT=$(PRJ)/$(OUTPATH).w
+ROUT=$(OUTPATH).w
+.ENDIF
+# could already be set by makefile.mk
+.IF "$(OUT)" == ""
+OUT*=$(PRJ)/$(OUTPATH)
+ROUT*=$(OUTPATH)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(bndchk)" != ""
+OUT:=$(PRJ)/$(OUTPATH).bnd
+ROUT=$(OUTPATH).bnd
+.ENDIF
+.IF "$(truetime)" != ""
+OUT=$(PRJ)/$(OUTPATH).tt
+ROUT=$(OUTPATH).tt
+.ENDIF
+.IF "$(hbtoolkit)"!=""
+OUT=$(PRJ)/$(OUTPATH).tlk
+ROUT=$(OUTPATH).tlk
+.ENDIF
+
+.IF "$(PRJ)"!="."
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+PATH_IN_MODULE:=\
+ $(subst,$(normpath $(shell @+cd $(PRJ) && pwd $(PWDFLAGS)))/, $(PWD))
+.ELSE # "$(GUI)"=="WNT"
+PATH_IN_MODULE:=$(subst,$(shell @+cd $(PRJ) && pwd $(PWDFLAGS))/, $(PWD))
+.ENDIF # "$(GUI)"=="WNT"
+.ELSE # "$(PRJ)"!="."
+PATH_IN_MODULE:=
+.ENDIF # "$(PRJ)"!="."
+
+## common output tree
+#.IF "$(common_build)"!=""
+#COMMON_OUTDIR*=common
+#.IF "$(no_common_build_reslib)"==""
+#common_build_reslib=true
+#.ENDIF # "$(no_common_build_reslib)"==""
+#.IF "$(no_common_build_zip)"==""
+#common_build_zip=true
+#.ENDIF # "$(no_common_build_zip)"==""
+#.IF "$(no_common_build_sign_jar)"==""
+#common_build_sign_jar=true
+#.ENDIF # "$(no_common_build_sign_jar)"==""
+#.IF "$(no_common_build_srs)"==""
+#common_build_srs=true
+#.ENDIF # "$(no_common_build_srs)"==""
+#.ELSE # "$(common_build)"!=""
+COMMON_OUTDIR:=$(OUTPATH)
+#.ENDIF # "$(common_build)"!=""
+
+LOCAL_OUT:=$(OUT)
+LOCAL_COMMON_OUT:=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(OUT))
+.EXPORT : LOCAL_OUT LOCAL_COMMON_OUT
+
+# --- generate output tree -----------------------------------------
+
+# As this is not part of the initial startup makefile we define an infered
+# target instead of using $(OUT)/inc/myworld.mk as target name.
+# (See iz62795)
+$(posix_PWD)/$(OUT)/inc/%world.mk :
+ @$(MKOUT) $(ROUT)
+ @echo $(EMQ)# > $@
+
+.INCLUDE : $(posix_PWD)/$(OUT)/inc/myworld.mk
+
+.IF "$(common_build)"!=""
+$(posix_PWD)/$(LOCAL_COMMON_OUT)/inc/%world.mk :
+ @$(MKOUT) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(ROUT))
+ @echo $(EMQ)# > $@
+
+.INCLUDE : $(posix_PWD)/$(LOCAL_COMMON_OUT)/inc/myworld.mk
+.ENDIF # "$(common_build)"!=""
+
+.INCLUDE .IGNORE : office.mk
+
+# Misc-Pfad
+.IF "$(UNR)"!=""
+MISCX=$(OUT)/umisc
+MISC=$(OUT)/umisc
+.ELSE
+MISC=$(OUT)/misc
+# pointing to misc in common output tree if exists
+COMMONMISC={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))}
+.ENDIF
+
+OUTCXX=$(OUT)/cxx
+
+.IF "$(PACKAGE)"!=""
+IDLPACKAGE:=$(PACKAGE)
+IDLPACKAGENAME:=$(IDLPACKAGE:sX\X/X)
+.ELSE
+IDLPACKAGE=$(PRJNAME)
+IDLPACKAGENAME=$(PRJNAME)
+.ENDIF
+
+# Objekt-Pfad
+OBJ=$(OUT)/obj
+SLO=$(OUT)/slo
+ROBJ=$(ROUT)/obj
+RSLO=$(ROUT)/slo
+
+# Particle Path
+PAR=$(OUT)/par
+
+# Library-Pfad
+LB=$(OUT)/lib
+SLB=$(OUT)/slb
+
+# wir haben ein ucr verzeichnis
+UCR=$(OUT)/ucr
+
+# $(L) nur noch pfad ins solver\upd\...\lib
+#L:={$(LB);$(SLB);$(ILIB)}
+L=$(SOLARLIBDIR)
+
+#.EXPORT : SLB LB L LIB
+ENVPRJ:=$(PRJ)
+#todo: check PRJ is still expected to exist in environment
+.EXPORT : PRJ ENVPRJ
+
+# Class-Path for java-classes
+# obwohl der generierte Bytecode plattformunabhg. sein sollte
+# generieren wir ihn ersteinmal ins abhaengige Verzeichnis
+CLASSDIR=$(OUT)/class
+CLASSPATH!:=.$(PATH_SEPERATOR)$(CLASSDIR)$(PATH_SEPERATOR)$(CLASSPATH)
+STARJAR=java -classpath $(CLASSPATH)$(PATH_SEPERATOR)$(SOLARENV)/bin/jtools.jar com.sun.star.tool.starjar.StarJar
+
+STARDEP=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/javadep
+.IF "$(PRJNAME)"=="sj2"
+CLASSPATH!:=$(CLASSPATH:s/sj2/no/)
+.ENDIF
+.IF "$(PRJNAME)"=="uno"
+CLASSPATH!:=$(CLASSPATH:s/uno/no/)
+.ENDIF
+.IF "$(PRJNAME)"=="tkt"
+CLASSPATH!:=$(CLASSPATH:s/tkt/no/)
+.ENDIF
+
+# default output directory when processing
+# configuration files
+PROCESSOUT*:=$(MISC)
+
+# Makros fuer die Librarynamen des Solar
+.INCLUDE : libs.mk
+
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+VERSIONOBJ=$(SLO)/_version.obj
+.ENDIF
+
+.IF "$(GUI)"=="UNX"
+VERSIONOBJ=$(SLO)/_version.o
+.ENDIF
+
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+WINVERSIONNAMES=$(UNIXVERSIONNAMES)
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(COM)"=="GCC"
+SHELLLIB=-lgdi32 -lshell32 -ladvapi32 -lcomdlg32
+.ELSE
+SHELLLIB=gdi32.lib shell32.lib advapi32.lib comdlg32.lib
+.ENDIF
+.ENDIF
+
+# BIN-Pfad
+.IF "$(UNR)"!=""
+BIN=$(OUT)/ubin
+.ELSE
+BIN=$(OUT)/bin
+.ENDIF
+# pointing to misc in common output tree if exists
+COMMONBIN=$(LOCAL_COMMON_OUT)/bin
+
+# Include-Pfad
+# still without -I here s.a. target.mk INCLUDE
+INC=$(PRJ)/inc
+INCPCH=$(PRJ)/inc/pch
+INCLOCAL=../inc
+INCGUI=$(PRJ)/$(GUIBASE)/inc
+INCCOM=$(OUT)/inc
+INCCOMX=$(OUT)/inc
+INCUNOIDL=$(INCCOM)/$(PRJNAME)
+INCDEPN=. $(INCGUI) $(INCLOCAL) $(INC) $(INC)/$(PRJNAME)
+.IF "$(PRJINC)"!=""
+INCLOCPRJ=$(foreach,i,$(PRJINC) $i/inc)
+INCDEPN+=$(INCLOCPRJ)
+.ENDIF
+.IF "$(INCPRE)"!=""
+INCDEPN+=$(INCPRE)
+.ENDIF
+
+# Resource-Pfad fuer .SRS
+
+.IF "$(common_build_srs)"!=""
+SRS=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(OUT))/srs
+SRSX=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(OUT))/srs
+.ELSE # "$(common_build_srs)"!=""
+SRS=$(OUT)/srs
+SRSX=$(OUT)/srs
+.ENDIF # "$(common_build_srs)"!=""
+
+# Resource-Pfad fuer .RC und .RES
+RES=$(OUT)/res
+
+# das normale MISC wird nicht an LDMISC angepasst, stattdessen MISCX
+
+.IF "$(make_xl)"!=""
+BIN=$(PRJ)/$(OUTPATH).xl/bin
+.ENDIF
+
+# damit gezielt Abhaengigkeiten auf s: angegeben werden koennen
+
+.IF "$(common_build)"!=""
+SOLARIDLDIR=$(SOLARVERSION)/common$(PROEXT)/idl$(UPDMINOREXT)
+.ELSE
+SOLARIDLDIR=$(SOLARVERSION)/$(INPATH)/idl$(UPDMINOREXT)
+.ENDIF
+
+#.IF "$(UPDMINOR)" != ""
+#UPDMINOREXT=.$(UPDMINOR)
+#.ELSE
+#UPDMINOREXT=
+#.ENDIF
+SOLARRESDIR=$(SOLARVERSION)/$(INPATH)/res$(UPDMINOREXT)
+SOLARRESXDIR=$(SOLARVERSION)/$(INPATH)/res$(UPDMINOREXT)
+SOLARLIBDIR=$(SOLARVERSION)/$(INPATH)/lib$(UPDMINOREXT)
+SOLARJAVADIR=$(SOLARVERSION)/$(INPATH)/java$(UPDMINOREXT)
+SOLARINCDIR=$(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)
+SOLARINCXDIR=$(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)
+.IF "$(SOLARLANG)"!="deut"
+.IF "$(SOLARLANG)" != ""
+SOLARINCXDIR=$(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)/$(SOLARLANG)
+SOLARRESXDIR=$(SOLARVERSION)/$(INPATH)/res$(UPDMINOREXT)/$(SOLARLANG)
+.ENDIF
+.ENDIF
+SOLARBINDIR:=$(SOLARVERSION)/$(INPATH)/bin$(UPDMINOREXT)
+SOLARUCRDIR=$(SOLARVERSION)/$(INPATH)/ucr$(UPDMINOREXT)
+SOLARPARDIR=$(SOLARVERSION)/$(INPATH)/par$(UPDMINOREXT)
+SOLARXMLDIR=$(SOLARVERSION)/$(INPATH)/xml$(UPDMINOREXT)
+SOLARDOCDIR=$(SOLARVERSION)/$(INPATH)/doc$(UPDMINOREXT)
+SOLARPCKDIR=$(SOLARVERSION)/$(INPATH)/pck$(UPDMINOREXT)
+SOLARSDFDIR=$(SOLARVERSION)/$(INPATH)/sdf$(UPDMINOREXT)
+SOLARCOMMONBINDIR=$(SOLARVERSION)/common$(PROEXT)/bin$(UPDMINOREXT)
+SOLARCOMMONRESDIR=$(SOLARVERSION)/common$(PROEXT)/res$(UPDMINOREXT)
+SOLARCOMMONPCKDIR=$(SOLARVERSION)/common$(PROEXT)/pck$(UPDMINOREXT)
+SOLARCOMMONSDFDIR=$(SOLARVERSION)/common$(PROEXT)/sdf$(UPDMINOREXT)
+.IF "$(common_build)"==""
+SOLARCOMMONBINDIR=$(SOLARBINDIR)
+SOLARCOMMONRESDIR=$(SOLARRESDIR)
+SOLARCOMMONPCKDIR=$(SOLARPCKDIR)
+SOLARCOMMONSDFDIR=$(SOLARSDFDIR)
+.ENDIF
+
+.EXPORT : SOLARBINDIR
+
+L10N_MODULE*=$(SOLARSRC)$/l10n
+ALT_L10N_MODULE*=$(SOLARSRC)$/l10n_so
+
+.IF "$(WITH_LANG)"!=""
+.INCLUDE .IGNORE: $(L10N_MODULE)/$(COMMON_OUTDIR)$(PROEXT)/inc/localization_present.mk
+.INCLUDE .IGNORE: $(ALT_L10N_MODULE)/$(COMMON_OUTDIR)$(PROEXT)/inc/localization_present.mk
+
+# check for localizations not hosted in l10n module. if a file exists there
+# it won't in l10n
+.IF "$(ALT_LOCALIZATION_FOUND)"!=""
+TRYALTSDF:=$(ALT_L10N_MODULE)$/$(COMMON_OUTDIR)$(PROEXT)$/misc/sdf$/$(PRJNAME)$/$(PATH_IN_MODULE)$/localize.sdf
+LOCALIZESDF:=$(strip $(shell @+$(IFEXIST) $(TRYALTSDF) $(THEN) echo $(TRYALTSDF) $(FI)))
+.ENDIF # "$(ALT_LOCALIZATION_FOUND)"!=""
+# if the l10n module exists, use split localize.sdf directly from there
+.IF "$(LOCALIZATION_FOUND)"!="" && "$(LOCALIZESDF)"==""
+# still check for existence as there may be no localization yet
+TRYSDF:=$(L10N_MODULE)$/$(COMMON_OUTDIR)$(PROEXT)$/misc/sdf$/$(PRJNAME)$/$(PATH_IN_MODULE)$/localize.sdf
+LOCALIZESDF:=$(strip $(shell @+$(IFEXIST) $(TRYSDF) $(THEN) echo $(TRYSDF) $(FI)))
+.ENDIF # "$(LOCALIZATION_FOUND)"!="" && "$(LOCALIZESDF)"==""
+# else use localize.sdf from local output tree if localization .zip exists
+.IF "$(LOCALIZESDF)"==""
+LOCALSDFFILE:=$(COMMONMISC)$/$(PRJNAME)$/$(PATH_IN_MODULE)$/localize.sdf
+LOCALIZESDF:=$(strip $(shell @+$(IFEXIST) $(SOLARCOMMONSDFDIR)$/$(PRJNAME).zip $(THEN) echo $(LOCALSDFFILE) $(FI)))
+.IF "$(LOCALIZESDF)"==""
+LOCALSDFFILE!:=
+.ENDIF # "$(LOCALIZESDF)"==""
+.ENDIF # "$(LOCALIZESDF)"==""
+# dummy target to keep the build happy.
+.IF "$(LOCALIZESDF)"==""
+LOCALIZESDF:=$(COMMONMISC)$/$(PRJNAME)$/dummy$/localize.sdf
+.ENDIF # "$(LOCALIZESDF)"==""
+.ENDIF # "$(WITH_LANG)"!=""
+
+JARDIR=$(OUT)/class
+
+# needs to be expanded!!!
+
+# extend library path for MS Compiler
+.IF "$(COM)"=="MSC"
+LIB:=$(LB);$(SLB);$(ILIB)
+.ENDIF
+
+# extend library path for MinGW Compiler
+.IF "$(GUI)$(COM)"=="WNTGCC"
+LIB:=$(LB);$(BIN);$(ILIB)
+.ENDIF
+
+# --- Environment-Allgemein ----------------------------------------
+
+.IF "$(CPUNAME)" == ""
+CPUNAME=CPUNAME_HAS_TO_BE_SET_IN_ENVIRONMENT
+.ENDIF
+
+.IF "$(USE_STLP_DEBUG)" != ""
+SCPCDEFS+=-D_STLP_DEBUG
+.ENDIF
+
+.IF "$(UDK_MAJOR)"!=""
+SCPDEFS+=-DUDK_MAJOR=$(UDK_MAJOR)
+.ENDIF # "$(UDK_MAJOR)"!=""
+
+SCPDEFS+=-U$(COMID) -DCOMID=$(COMID) -DCOMNAME=$(COMNAME) -D_$(COMID)
+SCPDEFS+=-DCCNUMVER=$(CCNUMVER)
+.IF "$(COM)"=="GCC"
+SCPDEFS+=-DSHORTSTDCPP3=$(SHORTSTDCPP3) -DSHORTSTDC3=$(SHORTSTDC3)
+.ENDIF # "$(SHORTSTDCPP3)"!=""
+# extend library path for OS/2 gcc/wlink
+.IF "$(GUI)"=="OS2"
+LIB:=$(LB);$(SLB);$(ILIB)
+.ENDIF
+
+
+UNOIDLDEFS+=-DSUPD=$(UPD) -DUPD=$(UPD)
+
+UNOIDLDEPFLAGS=-Mdepend=$(SOLARVER)
+
+UNOIDLINC+=-I. -I.. -I$(PRJ) -I$(PRJ)/inc -I$(PRJ)/$(INPATH)/idl -I$(OUT)/inc -I$(SOLARIDLDIR) -I$(SOLARINCDIR)
+
+CDEFS= -D$(OS) -D$(GUI) -D$(GVER) -D$(COM) -D$(CVER) -D$(CPUNAME)
+
+.IF "$(USE_STLP_DEBUG)" != "" && "$(GUI)"!="OS2"
+CDEFS+=-D_STLP_DEBUG
+.ENDIF
+
+.IF "$(CDEFS_PRESET)" != ""
+CDEFS+=$(CDEFS_PRESET)
+.ENDIF
+
+.IF "$(TIMELOG)" != ""
+CDEFS+=-DTIMELOG
+.ENDIF
+
+CDEFSCXX=
+CDEFSOBJ=
+CDEFSSLO=-DSHAREDLIB -D_DLL_
+CDEFSGUI=-DGUI
+CDEFSCUI=-DCUI
+#CDEFSMT=-DMULTITHREAD
+CDEFSPROF=-DPROFILE
+.IF "$(dbg_build_only)" == ""
+CDEFSDEBUG=-DDEBUG
+.ENDIF
+CDEFSDBGUTIL=-DDBG_UTIL
+CDEFSOPT=-DOPTIMIZE
+
+MKDEPFLAGS+=-I$(INCDEPN:s/ / -I/:s/-I-I/-I/)
+MKDEPALLINC=$(SOLARINC:s/-I/ -I/)
+MKDEPPREINC=-I$(PREPATH)/$(INPATH)/inc$(UPDMINOREXT)
+MKDEPSOLENV=-I$(SOLARENV)/inc -I$(SOLARENV)/$(GUI)$(CVER)$(COMEX)/inc
+MKDEPSOLVER=-I$(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT) -I$(SOLARVERSION)/$(INPATH)/inc
+MKDEPLOCAL=-I$(INCCOM)
+
+.IF "$(MKDEPENDALL)"!=""
+MKDEPFLAGS+=$(MKDEPALLINC)
+.ENDIF
+
+.IF "$(MKDEPENDSOLENV)"!=""
+MKDEPFLAGS+=$(MKDEPSOLENV)
+.ENDIF
+
+.IF "$(MKDEPENDPREPATH)"!=""
+MKDEPFLAGS+=$(MKDEPPREINC)
+.ENDIF
+
+.IF "$(MKDEPENDSOLVER)"!=""
+MKDEPFLAGS+=$(MKDEPSOLVER)
+.ENDIF
+# unused - nodep should do the same now
+#.IF "$(MKDEPENDLOCAL)"!="NO"
+MKDEPFLAGS+=$(MKDEPLOCAL)
+#.ENDIF
+
+BISON*=bison
+YACCFLAGS*=-d
+
+SVIDL=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/svidl
+
+LDUMP2*=$(SOLARBINDIR)/ldump4
+
+ZIPUPDATE=-u -j
+ZIPFLAGS=$(ZIPUPDATE)
+#hack for dynamic language subdirs
+LANGDIR=LANGDIR
+
+#scplinker flags
+SCPLINKFLAGS=-i $(PAR),$(SOLARPARDIR)
+.IF "$(SCPLINKVERSION)"!=""
+SCPLINKFLAGS+=-v $(SCPLINKVERSION)
+.ENDIF # "$(SCPLINKVERSION)"!=""
+
+.IF "$(make_srs_deps)"!=""
+RSC=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/rscdep
+.ELSE # "$(make_srs_deps)"!=""
+RSC=$(AUGMENT_LIBRARY_PATH) $(FLIPCMD) $(SOLARBINDIR)/rsc
+.ENDIF # "$(make_srs_deps)"!=""
+
+.IF "$(VERBOSE)" == "TRUE"
+ VERBOSITY=-verbose
+.ELSE
+ COMMAND_ECHO=@
+ .IF "$(VERBOSE)" == "FALSE"
+ VERBOSITY=-quiet
+ ZIP_VERBOSITY=-q
+ .ENDIF
+.ENDIF # "$(VERBOSE)" == "TRUE"
+COMPILE_ECHO_SWITCH=
+COMPILE_ECHO_FILE=$(<:f)
+
+#new
+RSCUPDVER=$(RSCREVISION)
+RSCUPDVERDEF=-DUPDVER="$(RSCUPDVER)"
+
+RSCFLAGS=-s
+RSCDEFS=-D$(GUI) -D$(GVER) -D$(COM) -D$(CVER) $(JAVADEF)
+
+.IF "$(BUILD_SPECIAL)"!=""
+RSCDEFS+=-DBUILD_SPECIAL=$(BUILD_SPECIAL)
+.ENDIF
+
+RSCDEFIMG*=default_images
+
+RSCEXTINC=.
+
+.IF "$(DEBUG)" != ""
+RSCDEFS+= -DDEBUG
+.ENDIF
+
+# settings for mozilla idl compiler
+XPIDL=xpidl
+XPIDL_LINK=xpt_link
+
+# alle bisher verwendeten Linker benutzen + um LIBs auf der naechsten Zeile
+# weiter zu schreiben, wenn es da eine Ausnahme geben sollte, muss
+# LINKEXTENDLINE compilerabhaengig definiert werden
+LINKEXTENDLINE=+
+
+LNT=$(DEVROOT)/lint/lint
+#LNTFLAGS=+v -i$(DEVROOT)/lint\ -mL options.lnt -u
+LNTFLAGS=+v -i$(DEVROOT)/lint/ -mL options.lnt -u
+LNTFLAGSOUTOBJ=-os
+
+.IF "$(GUI)"=="WNT"
+.INCLUDE : wnt.mk
+.ENDIF
+
+.IF "$(GUI)" == "UNX"
+.INCLUDE : unx.mk
+.ENDIF
+
+.IF "$(GUI)" == "OS2"
+.INCLUDE : os2.mk
+.ENDIF
+
+.IF "$(OOO_LIBRARY_PATH_VAR)" != ""
+# Add SOLARLIBDIR at the begin of a (potentially previously undefined) library
+# path (LD_LIBRARY_PATH, PATH, etc.; prepending avoids fetching libraries from
+# an existing office/URE installation; the ": &&" enables this to work at the
+# start of a recipe line that is not prefixed by "+" as well as in the middle of
+# an existing && chain:
+AUGMENT_LIBRARY_PATH = : && \
+ $(OOO_LIBRARY_PATH_VAR)=$(normpath, $(SOLARSHAREDBIN))$${{$(OOO_LIBRARY_PATH_VAR):+:$${{$(OOO_LIBRARY_PATH_VAR)}}}}
+AUGMENT_LIBRARY_PATH_LOCAL = : && \
+ $(OOO_LIBRARY_PATH_VAR)=$(normpath, $(PWD)/$(DLLDEST)):$(normpath, $(SOLARSHAREDBIN))$${{$(OOO_LIBRARY_PATH_VAR):+:$${{$(OOO_LIBRARY_PATH_VAR)}}}}
+.END
+
+# remove if .Net 2003 support has expired
+.IF "$(debug)"!=""
+.IF "$(OS)$(COM)$(CPU)" == "WNTMSCI"
+.IF "$(COMEX)" == "10"
+.IF "$(SLOFILES)$(OBJFILES)$(DEPOBJFILES)"!=""
+MAXPROCESS!:=1
+.EXPORT : MAXPROCESS
+.ENDIF # "$(SLOFILES)$(OBJFILES)$(DEPOBJFILES)"!=""
+.ENDIF # "$(COMEX)" == "10"
+.ENDIF # "$(OS)$(COM)$(CPU)" == "WNTMSCI"
+.ENDIF # "$(debug)"!=""
+
+# for multiprocess building in external modules
+# allow seperate handling
+EXTMAXPROCESS*=$(MAXPROCESS)
+
+IDLC*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/idlc
+REGMERGE*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/regmerge
+REGCOMPARE*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/regcompare
+REGCOMP*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/regcomp
+CPPUMAKER*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/cppumaker
+JAVAMAKER*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/javamaker
+RDBMAKER*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/rdbmaker
+CLIMAKER*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/climaker
+
+CPPUNITTESTER=$(AUGMENT_LIBRARY_PATH_LOCAL) $(SOLARBINDIR)/cppunittester
+HELPEX=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/helpex
+LNGCONVEX=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/lngconvex
+HELPLINKER=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/HelpLinker
+
+.IF "$(JAVAINTERPRETER)" == ""
+JAVA*:=java
+.ELSE
+JAVA*:=$(JAVAINTERPRETER)
+.ENDIF
+.EXPORT : JAVA JAVAI
+
+# Define SCPCOMP without wrapper because pre2par.pl chokes on DOS style
+# pathes. (See iz57443)
+SCPCOMP=$(PERL) $(SOLARENV)/bin/pre2par.pl
+SCPLINK=$(PERL) $(SOLARENV)/bin/par2script.pl
+LZIP*=lzip
+CPPLCC*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/cpplcc
+
+.IF "$(DISABLE_ENHANCED_COMID)"==""
+.INCLUDE : tg_compv.mk
+.ELSE # "$(DISABLE_ENHANCED_COMID)"==""
+COMID=$(COM)
+.ENDIF # "$(DISABLE_ENHANCED_COMID)"==""
+.IF "$(SOLAR_JAVA)"=="TRUE"
+.IF "$(USE_JAVAVER)"!=""
+.INCLUDE : tg_javav.mk
+.ENDIF "$(USE_JAVAVER)"!=""
+.ENDIF # "$(SOLAR_JAVA)"=="TRUE"
+
+.IF "$(COM)"=="GCC"
+GXX_INCLUDE_PATH*:=$(COMPATH)/include/c++/$(CCVER)
+.EXPORT : GXX_INCLUDE_PATH
+CDEFS+= -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH)
+.ENDIF
+
+# --- extend new environment ----------------------------------
+CDEFS+= -DSUPD=$(UPD)
+
+# flags to enable build with symbols; required for crashdump feature
+.IF ("$(ENABLE_CRASHDUMP)"!="" && "$(ENABLE_CRASHDUMP)"!="DUMMY") || "$(ENABLE_SYMBOLS)"!=""
+CFLAGSENABLESYMBOLS_CC_ONLY*=$(CFLAGSENABLESYMBOLS)
+CFLAGSCXX+=$(CFLAGSENABLESYMBOLS)
+CFLAGSCC+=$(CFLAGSENABLESYMBOLS_CC_ONLY)
+.ENDIF # ("$(ENABLE_CRASHDUMP)"!="" && "$(ENABLE_CRASHDUMP)"!="DUMMY") || "$(ENABLE_SYMBOLS)"!=""
+
+.IF "$(profile)"!=""
+CDEFS+= $(CDEFSPROF)
+CFLAGS+= $(CFLAGSPROF)
+.IF "$(WST)"!=""
+LINKFLAGS=$(LINKFLAGSWST)
+LINKCFLAGS=$(LINKFLAGSWST)
+.ELSE
+LINKFLAGSADD+=$(LINKFLAGSPROF)
+.ENDIF
+.ENDIF
+
+.IF "$(debug)"!=""
+JAVAFLAGS+=$(JAVAFLAGSDEBUG)
+CDEFS+= $(CDEFSDEBUG)
+CFLAGS+= $(CFLAGSDEBUG)
+LINKFLAGSADD+= $(LINKFLAGSDEBUG)
+.ENDIF
+
+.IF "$(dbgutil)"!=""
+CDEFS+=$(CDEFSDBGUTIL)
+CFLAGS+=$(CFLAGSDBGUTIL)
+RSCDEFS+=-DDBG_UTIL
+.ENDIF
+
+.IF "$(product)"!=""
+CDEFS+= -DPRODUCT -DNDEBUG
+RSCDEFS+= -DPRODUCT
+RSCDEFS+= -DNDEBUG
+.ENDIF
+
+.IF "$(DBG_LEVEL)"!=""
+CDEFS+=-DOSL_DEBUG_LEVEL=$(DBG_LEVEL)
+RSCDEFS+=-DOSL_DEBUG_LEVEL=$(DBG_LEVEL)
+.ENDIF
+
+.IF "$(optimize)"!=""
+CDEFS+=$(CDEFSOPT)
+CFLAGS+=$(CFLAGSOPT)
+LINKFLAGSADD+=$(LINKFLAGSOPT)
+.ELSE
+CFLAGS+=$(CFLAGSNOOPT)
+.ENDIF
+
+.IF "$(ENABLE_EXCEPTIONS)"!=""
+GLOBAL_EXCEPTIONS_FLAGS+=$(CFLAGSEXCEPTIONS)
+GLOBAL_EXCEPTIONS_FLAGS+=-DEXCEPTIONS_ON
+.ELSE
+GLOBAL_EXCEPTIONS_FLAGS+=$(CFLAGS_NO_EXCEPTIONS)
+GLOBAL_EXCEPTIONS_FLAGS+=-DEXCEPTIONS_OFF
+.ENDIF
+# used if an object appears in the EXCEPTIONSFILES list
+# see also rules.mk
+LOCAL_EXCEPTIONS_FLAGS+=$(CFLAGSEXCEPTIONS)
+LOCAL_EXCEPTIONS_FLAGS+=-DEXCEPTIONS_ON
+
+.IF "$(ENABLE_LAYOUT)" == "TRUE"
+CDEFS+=-DENABLE_LAYOUT=1
+.ELSE # ENABLE_LAYOUT != TRUE
+CFLAGS+=-DENABLE_LAYOUT=0
+.ENDIF # ENABLE_LAYOUT != TRUE
+
+.IF "$(ENABLE_LAYOUT_EXPERIMENTAL)" == "TRUE"
+CDEFS+=-DENABLE_LAYOUT_EXPERIMENTAL=1
+.ELSE # ENABLE_LAYOUT_EXPERIMENTAL != TRUE
+CFLAGS+=-DENABLE_LAYOUT_EXPERIMENTAL=0
+.ENDIF # ENABLE_LAYOUT_EXPERIMENTAL != TRUE
+
+# compose flags and defines for GUI
+.IF "$(TARGETTYPE)"=="GUI"
+CDEFS+= $(CDEFSGUI)
+CFLAGSSLO+=$(CFLAGSSLOGUIMT)
+CDEFSSLO+=$(CDEFSSLOMT)
+LINKFLAGSAPP=$(LINKFLAGSAPPGUI)
+LINKFLAGSSHL=$(LINKFLAGSSHLGUI)
+STDOBJ=$(STDOBJGUI)
+STDSLO=$(STDSLOGUI)
+
+CDEFSOBJ+= $(CDEFSMT) $(CDEFSOBJMT)
+CFLAGSOBJ+=$(CFLAGSOBJGUIMT)
+STDLIB=$(STDLIBGUIMT)
+STDSHL=$(STDSHLGUIMT)
+
+.ENDIF
+
+# compose flags and defines for CUI
+.IF "$(TARGETTYPE)" == "CUI" || "$(TARGETTYPE)"=="cui"
+CDEFS+= $(CDEFSCUI)
+CFLAGSSLO+=$(CFLAGSSLOCUIMT)
+CDEFSSLO+=$(CDEFSSLOMT)
+LINKFLAGSAPP=$(LINKFLAGSAPPCUI)
+LINKFLAGSSHL=$(LINKFLAGSSHLCUI)
+STDOBJ=$(STDOBJCUI)
+STDSLO=$(STDSLOCUI)
+
+CDEFSOBJ+=$(CDEFSMT) $(CDEFSOBJMT)
+CFLAGSOBJ+=$(CFLAGSOBJCUIMT)
+STDLIB=$(STDLIBCUIMT)
+STDSHL=$(STDSHLCUIMT)
+
+.ENDIF
+
+.EXPORT : PICSWITCH
+
+.IF "$(USE_SYSTEM_STL)"=="YES"
+LIBSTLPORT=""
+.ENDIF
+
+.IF "$(NO_DEFAULT_STL)"==""
+STDLIB+=$(LIBSTLPORT)
+STDSHL+=$(LIBSTLPORT)
+.ENDIF # "$(NO_DEFAULT_STL)"==""
+
+# fill up unresolved symbols not found else where
+.IF "$(FILLUPARC)"!=""
+STDLIB+=$(FILLUPARC)
+STDSHL+=$(FILLUPARC)
+.ENDIF # "$(FILUPARC)"!=""
+
+.IF "$(SOLAR_JAVA)"!=""
+CDEFS+=$(JAVADEF)
+.ENDIF # "$(SOLAR_JAVA)"!=""
+
+.INCLUDE .IGNORE: $(UPD)$(LAST_MINOR).mk
+
+# Once all modules on a given platform compile without warnings, the specific
+# .mk file for that platform should set COMPILER_WARN_ERRORS=TRUE and no longer
+# set MODULES_WITH_WARNINGS, and once no platform sets MODULES_WITH_WARNINGS any
+# longer, this code can go away:
+.IF "$(MODULES_WITH_WARNINGS)" != ""
+MODULES_WITH_WARNINGS_1 := $(foreach,i,$(MODULES_WITH_WARNINGS) .$(i).)
+MODULES_WITH_WARNINGS_2 := $(subst,.$(PRJNAME)., $(MODULES_WITH_WARNINGS_1))
+.IF "$(MODULES_WITH_WARNINGS_1)" == "$(MODULES_WITH_WARNINGS_2)"
+COMPILER_WARN_ERRORS = TRUE
+.ENDIF
+.ENDIF
+
+CFLAGSWARNCXX *= $(CFLAGSWARNCC)
+CFLAGSWALLCXX *= $(CFLAGSWALLCC)
+CFLAGSWERRCXX *= $(CFLAGSWERRCC)
+
+.IF "$(ENVWARNFLAGS)"==""
+.IF "$(COMPILER_WARN_ALL)"==""
+CFLAGSCC+=$(CFLAGSWARNCC)
+CFLAGSCXX+=$(CFLAGSWARNCXX)
+.ELSE
+CFLAGSCC+=$(CFLAGSWALLCC)
+CFLAGSCXX+=$(CFLAGSWALLCXX)
+.ENDIF
+.IF "$(COMPILER_WARN_ERRORS)"!="" && "$(EXTERNAL_WARNINGS_NOT_ERRORS)"==""
+CFLAGSCC+=$(CFLAGSWERRCC)
+CFLAGSCXX+=$(CFLAGSWERRCXX)
+.ENDIF
+.ELSE # "$(ENVWARNFLAGS)"==""
+CFLAGSAPPEND+=$(ENVWARNFLAGS)
+.ENDIF # "$(ENVWARNFLAGS)"==""
+
+CDEFS+= $(ADDCDEFS)
+CDEFS+= $(ENVCDEFS)
+CFLAGS+= $(CFLAGSCALL) $(ENVCFLAGS)
+CFLAGSCXX+= $(ENVCFLAGSCXX)
+# andersrum wg. -TPxxxx
+CFLAGSINCXX+:=$(ENVCFLAGSINCXX)
+LIBFLAGS+= $(ENVLIBFLAGS)
+LINKFLAGSADD+= $(ENVLINKFLAGS)
+RSCFLAGS+= $(ENVRSCFLAGS)
+RSCDEFS+= $(ENVRSCDEFS)
+# RSCLINKFLAGS+= $(ENVRSCLINKFLAGS)
+RCFLAGS+= $(ENVRCFLAGS)
+RCLINKFLAGS+= $(ENVRCLINKFLAGS)
+
+LINKFLAGSRUNPATH_URELIB*=
+LINKFLAGSRUNPATH_UREBIN*=
+LINKFLAGSRUNPATH_OOO*=
+LINKFLAGSRUNPATH_SDK*=
+LINKFLAGSRUNPATH_BRAND*=
+LINKFLAGSRUNPATH_OXT*=
+LINKFLAGSRUNPATH_BOXT*=
+LINKFLAGSRUNPATH_NONE*=
+
+# make sure both linker variables are set
+LINKC*=$(LINK)
+LINKCFLAGS*=$(LINKFLAGS)
+LINKFLAGS+=$(LINKFLAGSADD)
+LINKCFLAGS+=$(LINKFLAGSADD)
+
+#defaults for UCR HEADER
+UNOUCRBASE*=UCR
+UNOUCROUT*=$(OUT)/inc/$(TARGET)
+INCPRE+=-I$(UNOUCROUT)
+UNOUCRRDB*=$(SOLARBINDIR)/types.rdb
+
+# location of trustedinfo.manifest for Windows Vista
+.IF "$(COM)"=="MSC"
+TRUSTED_MANIFEST_LOCATION*=$(SOLARENV)/inc
+.ENDIF # "$(COM)"=="MSC"
+
+# --- Compiler -----------------------------------------------------
+.INCLUDE : rules.mk
+
+# --- include typelists --------------------------------------------
+
+.IF "$(COMP1TYPELIST)"!=""
+.INCLUDE .IGNORE : $(MISC)/$(COMP1TYPELIST).mk
+$(COMP1TYPELIST)_XML2CMPTYPES:=$(shell @$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xml2cmp -types stdout $(MISC)/$(COMP1TYPELIST)$($(WINVERSIONNAMES)_MAJOR).xml)
+.ENDIF
+
+.IF "$(COMP2TYPELIST)"!=""
+.INCLUDE .IGNORE : $(MISC)/$(COMP2TYPELIST).mk
+$(COMP2TYPELIST)_XML2CMPTYPES:=$(shell @$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xml2cmp -types stdout $(MISC)/$(COMP2TYPELIST)$($(WINVERSIONNAMES)_MAJOR).xml)
+.ENDIF
+
+.IF "$(COMP3TYPELIST)"!=""
+.INCLUDE .IGNORE : $(MISC)/$(COMP3TYPELIST).mk
+$(COMP3TYPELIST)_XML2CMPTYPES:=$(shell @$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xml2cmp -types stdout $(MISC)/$(COMP3TYPELIST)$($(WINVERSIONNAMES)_MAJOR).xml)
+.ENDIF
+
+.IF "$(COMP4TYPELIST)"!=""
+.INCLUDE .IGNORE : $(MISC)/$(COMP4TYPELIST).mk
+$(COMP4TYPELIST)_XML2CMPTYPES:=$(shell @$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xml2cmp -types stdout $(MISC)/$(COMP4TYPELIST)$($(WINVERSIONNAMES)_MAJOR).xml)
+.ENDIF
+
+.IF "$(COMP5TYPELIST)"!=""
+.INCLUDE .IGNORE : $(MISC)/$(COMP5TYPELIST).mk
+$(COMP5TYPELIST)_XML2CMPTYPES:=$(shell @$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xml2cmp -types stdout $(MISC)/$(COMP5TYPELIST)$($(WINVERSIONNAMES)_MAJOR).xml)
+.ENDIF
+
+.IF "$(COMP6TYPELIST)"!=""
+.INCLUDE .IGNORE : $(MISC)/$(COMP6TYPELIST).mk
+$(COMP6TYPELIST)_XML2CMPTYPES:=$(shell @$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xml2cmp -types stdout $(MISC)/$(COMP6TYPELIST)$($(WINVERSIONNAMES)_MAJOR).xml)
+.ENDIF
+
+.IF "$(COMP7TYPELIST)"!=""
+.INCLUDE .IGNORE : $(MISC)/$(COMP7TYPELIST).mk
+$(COMP7TYPELIST)_XML2CMPTYPES:=$(shell @$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xml2cmp -types stdout $(MISC)/$(COMP7TYPELIST)$($(WINVERSIONNAMES)_MAJOR).xml)
+.ENDIF
+
+.IF "$(COMP8TYPELIST)"!=""
+.INCLUDE .IGNORE : $(MISC)/$(COMP8TYPELIST).mk
+$(COMP8TYPELIST)_XML2CMPTYPES:=$(shell @$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xml2cmp -types stdout $(MISC)/$(COMP8TYPELIST)$($(WINVERSIONNAMES)_MAJOR).xml)
+.ENDIF
+
+.IF "$(COMP9TYPELIST)"!=""
+.INCLUDE .IGNORE : $(MISC)/$(COMP9TYPELIST).mk
+$(COMP9TYPELIST)_XML2CMPTYPES:=$(shell @$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xml2cmp -types stdout $(MISC)/$(COMP9TYPELIST)$($(WINVERSIONNAMES)_MAJOR).xml)
+.ENDIF
+
+# some place to define these jars for SO environment
+XML_APIS_JAR*=$(SOLARBINDIR)/xml-apis.jar
+XERCES_JAR*=$(SOLARBINDIR)/xercesImpl.jar
+
+.IF "$(SYSTEM_CPPUNIT)" != "YES"
+CPPUNIT_CFLAGS =
+.END
+
+COMPONENTPREFIX_URE_NATIVE = vnd.sun.star.expand:$$URE_INTERNAL_LIB_DIR/
+COMPONENTPREFIX_URE_JAVA = vnd.sun.star.expand:$$URE_INTERNAL_JAVA_DIR/
+.IF "$(OS)" == "WNT"
+COMPONENTPREFIX_BASIS_NATIVE = vnd.sun.star.expand:$$BRAND_BASE_DIR/program/
+.ELSE
+COMPONENTPREFIX_BASIS_NATIVE = vnd.sun.star.expand:$$OOO_BASE_DIR/program/
+.END
+COMPONENTPREFIX_BASIS_JAVA = vnd.sun.star.expand:$$OOO_BASE_DIR/program/classes/
+COMPONENTPREFIX_BASIS_PYTHON = vnd.openoffice.pymodule:
+COMPONENTPREFIX_INBUILD_NATIVE = \
+ vnd.sun.star.expand:$$OOO_INBUILD_SHAREDLIB_DIR/
+COMPONENTPREFIX_INBUILD_JAVA = vnd.sun.star.expand:$$OOO_INBUILD_JAR_DIR/
+COMPONENTPREFIX_EXTENSION = ./
+
+# workaround for strange dmake bug:
+# if the previous block was a rule or a target, "\#" isn't recognized
+# as an escaped "#". if it was an assignment, escaping works...
+some_unique_variable_name:=1
diff --git a/solenv/inc/shlinfo.rc b/solenv/inc/shlinfo.rc
new file mode 100644
index 000000000000..3e090272408d
--- /dev/null
+++ b/solenv/inc/shlinfo.rc
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#if !defined(ENGLISH)
+#define LG_D // generate always german version
+#endif
+
+#define VER_FIRSTYEAR 2010
+
+
+#if defined(OS2)
+
+#define OS2_VERSION "hello world"
+
+#else
+
+#include <windows.h>
+#include "version.hrc"
+
+// -----------------------------------------------------------------------
+// version information
+// -----------------------------------------------------------------------
+
+VS_VERSION_INFO versioninfo
+#ifndef SUBVERSION
+ fileversion VERSION, 0, VERVARIANT, VER_COUNT
+ productversion VERSION, 0, VERVARIANT, VER_COUNT
+#else
+ fileversion VERSION, SUBVERSION, VERVARIANT, VER_COUNT
+ productversion VERSION, SUBVERSION, VERVARIANT, VER_COUNT
+#endif
+ fileflagsmask 0x3F
+ fileflags
+#if defined(DEBUG)
+ VS_FF_DEBUG |
+#endif
+#ifdef VER_PREL
+ VS_FF_PRERELEASE |
+#endif
+ 0
+#ifndef WIN32
+ fileos VOS_DOS_WINDOWS16
+#else
+ fileos VOS_NT_WINDOWS32
+#endif
+ filetype VFT_APP
+ {
+ block "StringFileInfo"
+ {
+#ifdef LG_D
+ block "040704E4"
+ {
+ // German StringTable
+ value "CompanyName", "OpenOffice.org\0"
+ value "FileVersion", PPS(VER_LEVEL) "\0"
+ value "OriginalFilename", PPS(ORG_NAME) "\0"
+ value "InternalName", PPS(INTERNAL_NAME) "\0"
+ value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0"
+ ADDITIONAL_VERINFO1
+ ADDITIONAL_VERINFO2
+ ADDITIONAL_VERINFO3
+ }
+#else
+ block "040904E4"
+ {
+ // International StringTable
+ value "CompanyName", "OpenOffice.org\0"
+ value "FileVersion", PPS(VER_LEVEL) "\0"
+ value "OriginalFilename", PPS(ORG_NAME) "\0"
+ value "InternalName", PPS(INTERNAL_NAME) "\0"
+ value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0"
+ ADDITIONAL_VERINFO1
+ ADDITIONAL_VERINFO2
+ ADDITIONAL_VERINFO3
+ }
+#endif
+ }
+
+ block "VarFileInfo"
+ {
+#ifdef LG_D
+ value "Translation", 0x0407, 1252
+#else
+ value "Translation", 0x0409, 1252
+#endif
+ }
+ }
+
+#endif // OS2
diff --git a/solenv/inc/startup/OS2/macros.mk b/solenv/inc/startup/OS2/macros.mk
new file mode 100644
index 000000000000..2f1447e6e714
--- /dev/null
+++ b/solenv/inc/startup/OS2/macros.mk
@@ -0,0 +1,30 @@
+# Define additional OS/2 specific macros.
+#
+
+# Process release-specific refinements, if any.
+# YD .INCLUDE .NOINFER .IGNORE : $(INCFILENAME:d)$(OSRELEASE)$/macros.mk
+
+# Directory entries are case incensitive
+.DIRCACHERESPCASE *:= no
+
+# tmp is already imported - use it!
+TMPDIR *= $(TMP)
+
+# Applicable suffix definitions
+A *:= .lib # Libraries
+E *:= .exe # Executables
+F *:= .for # Fortran
+O *:= .obj # Objects
+P *:= .pas # Pascal
+S *:= .asm # Assembler sources
+V *:= # RCS suffix
+
+.MKSARGS *:= yes
+RM *= $(ROOTDIR)$/bin$/rm
+MV *= $(ROOTDIR)$/bin$/mv
+DIVFILE *= $(TMPFILE:s,/,${__.DIVSEP-sh-${USESHELL}})
+__.DIVSEP-sh-yes !:= \\\
+__.DIVSEP-sh-no !:= \\
+
+NAMEMAX = 256
+
diff --git a/solenv/inc/startup/Readme b/solenv/inc/startup/Readme
new file mode 100644
index 000000000000..63a023d10d3e
--- /dev/null
+++ b/solenv/inc/startup/Readme
@@ -0,0 +1,6 @@
+
+here are some hints about our use of the startup directory.
+
+the .INCLUDEDIRS line in startup.mk gives you the oportunity of switching
+to your own set of central makefiles.
+
diff --git a/solenv/inc/startup/startup.mk b/solenv/inc/startup/startup.mk
new file mode 100644
index 000000000000..b4aa9a74353a
--- /dev/null
+++ b/solenv/inc/startup/startup.mk
@@ -0,0 +1,109 @@
+# This is the root DMAKE startup file.
+#
+# Definitions common to all environments are given at the root.
+# Definitions parameterized at the root have their parameters specified
+# in sub-makefiles which are included based on the values of the three
+# make variables:
+#
+# OS - core operating system flavour
+#
+# See the file 'summary', found in this directory for a list of
+# environments supported by this release.
+
+# Disable warnings for macros given on the command line but redefined here.
+__.silent !:= $(.SILENT) # Preserve user's .SILENT flag
+.SILENT !:= yes
+.NOTABS !:= yes
+.ERROR :
+ @echo '---* $(MKFILENAME) *---'
+
+# Define the directory separator string.
+/ *= $(DIRSEPSTR)
+
+.IMPORT .IGNORE : .EVERYTHING
+
+.IF "$(TNR)" == ""
+
+CALLMACROS:=$(MAKEMACROS)
+.EXPORT : CALLMACROS
+
+CALLTARGETS=$(MAKETARGETS)
+.ENDIF # "$(TNR)" == ""
+
+.INCLUDEDIRS : $(DMAKE_INC) $(SOLARVERSION)$/$(INPATH)$/inc$(UPDMINOREXT) $(SOLARENV)$/inc
+
+# Grab key definitions from the environment
+# .IMPORT .IGNORE : OS TMPDIR UPD INPATH OUTPATH GUI COM EX CLASSPATH PRODUCT GUIBASE SOLARENV SOLARVER GUIENV CPU CPUNAME CVER GVER COMPATH LIB INCLUDE TR SORT UNIQ ROOTDIR SED AWK TOUCH IENV ILIB PRODUCT_ENV COMEX UPD BUILD DEVROOT VCL SO3 ENVCFLAGS
+
+.IF "$(OS)" == "" || "$(OS)" == "Windows_NT"
+.ERROR : ; @echo Forced error: Environment variable OS has to be set for OOo build!
+OS_variable_needed
+.ENDIF
+
+# Customize macro definitions based on seting of OS.
+# This must come before the default macro definitions which follow.
+.IF "$(OS)" == "OS2"
+.INCLUDE: $(INCFILENAME:d)OS2/macros.mk
+.ELIF "$(OS)" == "WNT"
+.INCLUDE: $(INCFILENAME:d)wnt/macros.mk
+.END
+
+# ----------------- Default Control Macro definitions -----------------------
+# Select appropriate defaults for basic macros
+MAKE *= $(MAKECMD) $(MFLAGS)
+TMPDIR *:= $/tmp
+DIVFILE *= $(TMPFILE)
+
+MAXLINELENGTH = 65530
+
+# Recipe execution configuration
+SHELL := $(OOO_SHELL)
+SHELLFLAGS := -c
+SHELLMETAS := !"\#$$%&'()*;<=>?[\]`{{|}}~
+ # the colon (":") utility is typically only available as a shell built-in,
+ # so it should be included in SHELLMETAS; however, this would result in very
+ # many false positives on Windows where ":" is used in drive letter notation
+GROUPSHELL := $(SHELL)
+GROUPFLAGS :=
+GROUPSUFFIX :=
+
+# Intermediate target removal configuration
+RM *:= rm
+RMFLAGS *= -f
+RMTARGET *= $<
+
+# Default recipe that is used to remove intermediate targets.
+.REMOVE :; #echo dummy remove #$(RM) $(RMFLAGS) $(RMTARGET)
+#.REMOVE :; echo $(RM) $(RMFLAGS) $(RMTARGET)
+
+# Directory caching configuration.
+.DIRCACHE *:= yes
+.DIRCACHERESPCASE *:= yes
+
+# Define the special NULL Prerequisite
+NULLPRQ *:= __.NULLPRQ
+
+# Primary suffixes in common use
+E *:= # Executables
+
+# Other Compilers, Tools and their flags
+MV *:= mv # File rename command
+
+
+# Finally, define the default construction strategy
+.ROOT .PHONY .NOSTATE .SEQUENTIAL :- .INIT .TARGETS .DONE;
+.INIT .DONE .PHONY: $(NULLPRQ);
+
+# Define the NULL Prerequisite as having no recipe.
+$(NULLPRQ) .PHONY :;
+
+# Reset warnings back to previous setting.
+.SILENT !:= $(__.silent)
+
+# Check for a Local project file, gets parsed before user makefile.
+.INCLUDE .IGNORE .NOINFER: "project.mk"
+
+.MAKEFILES :- makefile.mk MAKEFILE.MK $(CONFIG_PROJECT)$/makefile.rc $(SOLARENV)$/inc$/found_no.mk
+
+LANG=C
+.EXPORT : LANG
diff --git a/solenv/inc/startup/summary b/solenv/inc/startup/summary
new file mode 100644
index 000000000000..4ae18860da41
--- /dev/null
+++ b/solenv/inc/startup/summary
@@ -0,0 +1,3 @@
+The following is a summary of the supported dmake environments. When you
+issue the build command 'dmake tag' where tag is the target environment it
+will build one of these by default.
diff --git a/solenv/inc/startup/wnt/macros.mk b/solenv/inc/startup/wnt/macros.mk
new file mode 100644
index 000000000000..2d8181439e81
--- /dev/null
+++ b/solenv/inc/startup/wnt/macros.mk
@@ -0,0 +1,32 @@
+# Define additional MSDOS specific settings.
+#
+
+# --- Set Wrapper command ---
+# Provide a macro that can be used to access the wrapper and to avoid
+# hardcoding the program name everywhere
+GUWCMD*=guw.exe
+
+# This is a no-op for native W32 dmake
+.WINPATH !:= yes
+
+# Directory cache configuration.
+.DIRCACHE *:= no
+
+# Applicable suffix definitions
+E *:= .exe # Executables
+
+# This is hopefully not used. Only in: dmake/msdos/spawn.c
+# .MKSARGS *:= yes
+ DIVFILE *= $(TMPFILE:s,/,${__.DIVSEP-sh-${USESHELL}})
+ RM *= $/bin$/rm
+ MV *= $/bin$/mv
+ __.DIVSEP-sh-yes *:= \\\
+ __.DIVSEP-sh-no *:= \\
+ DIRSEPSTR :=/
+
+.EXPORT : GUWCMD
+
+# Does not respect case of filenames.
+.DIRCACHERESPCASE := no
+NAMEMAX = 256
+
diff --git a/solenv/inc/starview.hid b/solenv/inc/starview.hid
new file mode 100644
index 000000000000..54474c566b99
--- /dev/null
+++ b/solenv/inc/starview.hid
@@ -0,0 +1,304 @@
+#include <stdio.h>
+
+#define leer 0
+
+#define application 1
+#define Application 1
+#define APPLICATION 1
+#define resource 2
+#define Resource 2
+#define RESOURCE 2
+#define string 3
+#define String 3
+#define STRING 3
+#define icon 4
+#define Icon 4
+#define ICON 4
+#define bitmap 5
+#define Bitmap 5
+#define BITMAP 5
+#define pointer 6
+#define Pointer 6
+#define POINTER 6
+#define brush 7
+#define Brush 7
+#define BRUSH 7
+#define color 8
+#define Color 8
+#define COLOR 8
+#define font 9
+#define Font 9
+#define FONT 9
+#define pen 10
+#define Pen 10
+#define PEN 10
+#define mapmode 11
+#define MapMode 11
+#define MAPMODE 11
+#define accel 12
+#define Accel 12
+#define ACCEL 12
+#define accelitem 13
+#define AccelItem 13
+#define ACCELITEM 13
+#define menu 14
+#define Menu 14
+#define MENU 14
+#define menuitem 15
+#define MenuItem 15
+#define MENUITEM 15
+#define outputdevice 16
+#define OutputDevice 16
+#define OUTPUTDEVICE 16
+#define keycode 17
+#define KeyCode 17
+#define KEYCODE 17
+#define time 18
+#define Time 18
+#define TIME 18
+#define date 19
+#define Date 19
+#define DATE 19
+#define international 20
+#define International 20
+#define INTERNATIONAL 20
+#define image 21
+#define Image 21
+#define IMAGE 21
+#define imagelist 22
+#define ImageList 22
+#define IMAGELIST 22
+#define messbox 23
+#define MessBox 23
+#define MESSBOX 23
+#define infobox 24
+#define InfoBox 24
+#define INFOBOX 24
+#define warningbox 25
+#define WarningBox 25
+#define WARNINGBOX 25
+#define errorbox 26
+#define ErrorBox 26
+#define ERRORBOX 26
+#define querybox 27
+#define QueryBox 27
+#define QUERYBOX 27
+#define window 28
+#define Window 28
+#define WINDOW 28
+#define syswindow 29
+#define SysWindow 29
+#define SYSWINDOW 29
+#define workwin 30
+#define WorkWin 30
+#define WORKWIN 30
+#define mdiwindow 31
+#define MdiWindow 31
+#define MDIWINDOW 31
+#define floatingwindow 32
+#define FloatingWindow 32
+#define FLOATINGWINDOW 32
+#define dialog 33
+#define Dialog 33
+#define DIALOG 33
+#define modelessdialog 34
+#define ModelessDialog 34
+#define MODELESSDIALOG 34
+#define modaldialog 35
+#define ModalDialog 35
+#define MODALDIALOG 35
+#define systemdialog 36
+#define SystemDialog 36
+#define SYSTEMDIALOG 36
+#define pathdialog 37
+#define PathDialog 37
+#define PATHDIALOG 37
+#define filedialog 38
+#define FileDialog 38
+#define FILEDIALOG 38
+#define printersetupdialog 39
+#define PrinterSetupDialog 39
+#define PRINTERSETUPDIALOG 39
+#define printdialog 40
+#define PrintDialog 40
+#define PRINTDIALOG 40
+#define colordialog 41
+#define ColorDialog 41
+#define COLORDIALOG 41
+#define fontdialog 42
+#define FontDialog 42
+#define FONTDIALOG 42
+#define control 43
+#define Control 43
+#define CONTROL 43
+#define button 44
+#define Button 44
+#define BUTTON 44
+#define pushbutton 45
+#define PushButton 45
+#define PUSHBUTTON 45
+#define okbutton 46
+#define OkButton 46
+#define OKButton 46
+#define OKBUTTON 46
+#define cancelbutton 47
+#define CancelButton 47
+#define CANCELBUTTON 47
+#define helpbutton 48
+#define HelpButton 48
+#define HELPBUTTON 48
+#define imagebutton 49
+#define ImageButton 49
+#define IMAGEBUTTON 49
+#define menubutton 50
+#define MenuButton 50
+#define MENUBUTTON 50
+#define morebutton 51
+#define MoreButton 51
+#define MOREBUTTON 51
+#define spinbutton 52
+#define SpinButton 52
+#define SPINBUTTON 52
+#define radiobutton 53
+#define RadioButton 53
+#define RADIOBUTTON 53
+#define checkbox 54
+#define CheckBox 54
+#define CHECKBOX 54
+#define tristatebox 55
+#define TriStateBox 55
+#define TRISTATEBOX 55
+#define edit 56
+#define Edit 56
+#define EDIT 56
+#define multilineedit 57
+#define MultiLineEdit 57
+#define MULTILINEEDIT 57
+#define combobox 58
+#define ComboBox 58
+#define COMBOBOX 58
+#define listbox 59
+#define ListBox 59
+#define LISTBOX 59
+#define multilistbox 60
+#define MultiListBox 60
+#define MULTILISTBOX 60
+#define text 61
+#define Text 61
+#define TEXT 61
+#define fixedline 62
+#define FixedLine 62
+#define FIXEDLINE 62
+#define fixedbitmap 63
+#define FixedBitmap 63
+#define FIXEDBITMAP 63
+#define fixedimage 64
+#define FixedImage 64
+#define FIXEDIMAGE 64
+#define fixedicon 65
+#define FixedIcon 65
+#define FIXEDICON 65
+#define groupBox 66
+#define GroupBox 66
+#define GROUPBOX 66
+#define scrollbar 67
+#define ScrollBar 67
+#define SCROLLBAR 67
+#define scrollbarbox 68
+#define ScrollBarBox 68
+#define SCROLLBARBOX 68
+#define splitter 69
+#define Splitter 69
+#define SPLITTER 69
+#define splitwindow 70
+#define SplitWindow 70
+#define SPLITWINDOW 70
+#define spinfield 71
+#define SpinField 71
+#define SPINFIELD 71
+#define patternfield 72
+#define PatternField 72
+#define PATTERNFIELD 72
+#define numericfield 73
+#define NumericField 73
+#define NUMERICFIELD 73
+#define metricfield 74
+#define MetricField 74
+#define METRICFIELD 74
+#define currencyfield 75
+#define CurrencyField 75
+#define CURRENCYFIELD 75
+#define datefield 76
+#define DateField 76
+#define DATEFIELD 76
+#define timefield 77
+#define TimeField 77
+#define TIMEFIELD 77
+#define patternbox 78
+#define PatternBox 78
+#define PATTERNBOX 78
+#define numericbox 79
+#define NumericBox 79
+#define NUMERICBOX 79
+#define metricbox 80
+#define MetricBox 80
+#define METRICBOX 80
+#define currencybox 81
+#define CurrencyBox 81
+#define CURRENCYBOX 81
+#define datebox 82
+#define DateBox 82
+#define DATEBOX 82
+#define timebox 83
+#define TimeBox 83
+#define TIMEBOX 83
+#define toolboxitem 84
+#define ToolBoxItem 84
+#define TOOLBOXITEM 84
+#define toolbox 85
+#define ToolBox 85
+#define TOOLBOX 85
+#define dockingwindow 86
+#define DockingWindow 86
+#define DOCKINGWINDOW 86
+#define statusbar 87
+#define StatusBar 87
+#define STATUSBAR 87
+#define tabpage 88
+#define TabPage 88
+#define TABPAGE 88
+#define tabcontrol 89
+#define TabControl 89
+#define TABCONTROL 89
+#define tabdialog 90
+#define TabDialog 90
+#define TABDIALOG 90
+#define tabcontrolitem 91
+#define TabControlItem 91
+#define TABCONTROLITEM 91
+#define treelistbox 92
+#define TreeListBox 92
+#define TREELISTBOX 92
+#define stringarray 93
+#define StringArray 93
+#define STRINGARRAY 93
+/* MH and OG */
+#define fixedtext 94
+#define FixedText 94
+#define FIXEDTEXT 94
+#define pageitem 95
+#define PageItem 95
+#define PAGEITEM 95
+#define accelerator 96
+#define Accelerator 96
+#define ACCELERATOR 96
+#define acceleratoritem 97
+#define AcceleratorItem 97
+#define ACCELERATORITEM 97
+
+#define SfxStyleFamilies 98
+#define SfxStyleFamilyItem 99
+#define SfxSlotInfo 100
+
+#define define 127
+
diff --git a/solenv/inc/target.mk b/solenv/inc/target.mk
new file mode 100644
index 000000000000..6e8007425454
--- /dev/null
+++ b/solenv/inc/target.mk
@@ -0,0 +1,2085 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+MKFILENAME:=TARGET.MK
+
+# ------------------------------------------------------------------
+# INCLUDE-Path
+# ------------------------------------------------------------------
+
+.IF "$(STL_OS2_BUILDING)" != ""
+CDEFS+=-DSTL_OS2_BUILDING
+.ENDIF
+.IF "$(VISIBILITY_HIDDEN)" != ""
+.IF "$(COMNAME)" == "gcc3" && "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+CFLAGS += -fvisibility=hidden
+.ELIF "$(COMNAME)" == "sunpro5" && "$(CCNUMVER)" >= "00050005"
+CFLAGS += -xldscope=hidden
+.ENDIF
+.ENDIF
+
+.IF "$(TARGET)"==""
+target_empty=warn_target_empty
+.ENDIF
+
+# all use solarinc
+# no standalone -I flags!!
+INCEXT*=.
+INCPRE*=.
+INCPOST*=.
+.IF "$(BOOTSTRAP_SERVICE)"!="TRUE" && "$(NO_OFFUH)"==""
+UNOINCLUDES=$(SOLARINCDIR)/offuh
+.ENDIF # "$(BOOTSTRAP_SERVICE)"!="TRUE" && "$(NO_OFFUH)"==""
+SOLARINC+=$(JDKINCS)
+# make sure INCLUDE isn't set
+INCLUDE:=
+.EXPORT : INCLUDE
+.IF "$(PRJINC)"!=""
+INCLUDE!:=-I. $(INCPRE:^"-I":s/-I-I/-I/) -I$(INCLOCAL) $(INCLOCPRJ:^"-I":s/-I-I/-I/) -I$(INCPCH) -I$(INC) -I$(INCGUI) -I$(INCCOM) $(SOLARINC) $(null,$(UNOINCLUDES) $(NULL) -I$(UNOINCLUDES)) -I$(INCEXT) -I$(PRJ)/res -I$(INCPOST)
+.ELSE # "$(PRJINC)"!=""
+INCLUDE!:=-I. $(INCPRE:^"-I":s/-I-I/-I/) -I$(INCLOCAL) -I$(INCPCH) -I$(INC) -I$(INCGUI) -I$(INCCOM) $(SOLARINC) $(null,$(UNOINCLUDES) $(NULL) -I$(UNOINCLUDES)) -I$(INCEXT) -I$(PRJ)/res -I$(INCPOST)
+.ENDIF # "$(PRJINC)"!=""
+INCLUDE_C=$(subst,/stl$(SPACECHAR),dont_use_stl$(SPACECHAR) $(INCLUDE))
+.EXPORT : LIB
+# --- Compiler -----------------------------------------------------
+
+.IF "$(RC_SUBDIRS)"!=""
+SUBDIRS:=$(RC_SUBDIRS)
+SUBDIRSDEPS=$(RC_SUBDIRSDEPS)
+.ENDIF
+
+.INCLUDE : pstrules.mk
+
+.IF "$(YACCTARGET)"!=""
+.INCLUDE : tg_yxx.mk
+.ENDIF # "$(YACCTARGET)"!=""
+
+.IF "$(nodep)"==""
+
+.IF "$(L10N_framework)"==""
+.IF "$(DEPOBJFILES)"!=""
+DEPCOLLECT_SLO+:=$(foreach,i,$(DEPOBJFILES) $(eq,$i,$(subst,$(SLO),ttt $i) $(NULL) $(subst,$(SLO)/,not_existing/s_ $(i:s/.obj/.dpcc/))))
+DEPCOLLECT_OBJ+:=$(foreach,i,$(DEPOBJFILES) $(eq,$i,$(subst,$(OBJ),ttt $i) $(NULL) $(subst,$(OBJ)/,not_existing/o_ $(i:s/.obj/.dpcc/))))
+.ENDIF # "$(DEPOBJFILES)"!=""
+# point to not existing directory as there is no creation intended anyway and
+# stat call looks faster
+DEPCOLLECT_SLO+:=$(subst,$(SLO)/,not_existing/s_ $(SLOFILES:s/.obj/.dpcc/))
+DEPCOLLECT_OBJ+:=$(subst,$(OBJ)/,not_existing/o_ $(OBJFILES:s/.obj/.dpcc/))
+.ENDIF # "$(L10N_framework)"==""
+DEPFILESx+:=$(subst,$(PAR),$(MISC) $(ALLPARFILES:s/.par/.dpsc/))
+.IF "$(L10N_framework)"==""
+.IF "$(RCFILES)"!=""
+.IF "$(RESNAME)"!=""
+DEPFILESx+:=$(MISC)/$(RESNAME).dpcc
+.ELSE # "$(RESNAME)"!=""
+DEPFILESx+:=$(MISC)/$(TARGET).dprc
+.ENDIF # "$(RESNAME)"!=""
+.ENDIF # "$(RCFILES)"!=""
+.ENDIF # "$(L10N_framework)"==""
+DEPFILES:=$(uniq $(DEPFILESx))
+DEPCOLLECT_SLO!:=$(strip $(uniq $(DEPCOLLECT_SLO)))
+.IF "$(DEPCOLLECT_SLO)"!=""
+DEPFILE_SLO+:=$(MISC)/all_$(TARGET).dpslo
+.ENDIF # "$(DEPCOLLECT_SLO)"!=""
+DEPCOLLECT_OBJ!:=$(strip $(uniq $(DEPCOLLECT_OBJ)))
+.IF "$(DEPCOLLECT_OBJ)"!=""
+DEPFILE_OBJ+:=$(MISC)/all_$(TARGET).dpobj
+.ENDIF # "$(DEPCOLLECT_OBJ)"!=""
+.ENDIF # "$(nodep)"==""
+
+.IF "$(depend)" == ""
+
+# -------
+# - ALL -
+# -------
+
+# with VCL no resources are appended to the application
+APP1RES=
+APP2RES=
+APP3RES=
+APP4RES=
+APP5RES=
+APP6RES=
+APP7RES=
+APP8RES=
+APP9RES=
+# unfortunatly there are some applications which don't VCL resources but have
+# resources of their own
+.IF "$(APP1NOSVRES)" != ""
+APP1RES=$(APP1NOSVRES)
+.ENDIF
+.IF "$(APP2NOSVRES)" != ""
+APP2RES=$(APP2NOSVRES)
+.ENDIF
+.IF "$(APP3NOSVRES)" != ""
+APP3RES=$(APP3NOSVRES)
+.ENDIF
+
+.IF "$(NO_APP)"!=""
+APP1TARGET=
+APP2TARGET=
+APP3TARGET=
+APP4TARGET=
+APP5TARGET=
+APP6TARGET=
+APP7TARGET=
+APP8TARGET=
+APP9TARGET=
+.ENDIF
+
+.IF "$(IDLFILES)"!=""
+
+URDFILES+=$(foreach,i,$(IDLFILES:s/.idl/.urd/:f) $(OUT)/ucr/$(IDLPACKAGE)/$i)
+UNOIDLTARGETS+=$(URDFILES)
+
+.IF "$(URDFILES)"!=""
+LOCALDBTARGET=$(OUT)/ucr/$(TARGET).db
+.ENDIF
+
+.IF "$(URDDOC)" != ""
+URDDOCFILES+=$(foreach,i,$(IDLFILES:s/.idl/.urd/:f) $(OUT)/ucrdoc/$(IDLPACKAGE)/$i)
+UNOIDLTARGETS+=$(URDDOCFILES)
+
+.IF "$(URDDOCFILES)"!=""
+LOCALDOCDBTARGET=$(OUT)/ucrdoc/$(TARGET).db
+.ENDIF
+
+.ENDIF # "$(URDDOC)" != ""
+
+.ENDIF # "$(IDLFILES)"!=""
+
+.IF "$(UNOIDLDBFILES)"!=""
+UNOIDLDBTARGET=$(OUT)/ucr/$(PRJNAME).db
+.IF "$(URDDOC)" != ""
+UNOIDLDBDOCFILES:=$(subst,/ucr/,/ucrdoc/ $(UNOIDLDBFILES))
+UNOIDLDBDOCTARGET=$(OUT)/ucrdoc/$(PRJNAME)_doc.db
+.IF "$(UNOIDLDBREGS)"!=""
+UNOIDLDBDOCREGS=$(foreach,i,$(UNOIDLDBREGS) $(i:d)$(i:b)_doc$(i:e))
+.ENDIF # "$(UNOIDLDBREGS)"!=""
+.ENDIF # "$(URDDOC)" != ""
+.ENDIF # "$(UNOIDLDBFILES)"!=""
+
+.IF "$(IDLFILES)"!=""
+.IF "$(PACKAGE)"!=""
+IDLDIRS=$(SOLARIDLDIR)/$(PACKAGE)
+.ELSE # "$(PACKAGE)"!=""
+IDLDIRS=$(SOLARIDLDIR)
+.ENDIF # "$(PACKAGE)"!=""
+
+.IF "$(LOCALIDLFILES)$(EXTERNIDLFILES)"!=""
+.IF "$(EXTERNIDLFILES)"!=""
+DEPIDLFILES:=$(foreach,i,$(IDLFILES) $(IDLDIRS)/$i)
+.ELSE # "$(EXTERNIDLFILES)"!=""
+DEPIDLFILES:=$(IDLFILES)
+.ENDIF # "$(EXTERNIDLFILES)"!=""
+.ELSE # "$(LOCALIDLFILES)$(EXTERNIDLFILES)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+DEPIDLFILES:=$(foreach,i,$(IDLFILES) $(!null,$(shell @$(FIND) . -name $i) $i $(shell @($(FIND) $(IDLDIRS) -name $(i:f)) | $(SED) s/\//\\/g )))
+.ELSE # "$(GUI)"=="WNT"
+DEPIDLFILES:=$(foreach,i,$(IDLFILES) $(!null,$(shell @$(FIND) . -name $i -print) $i $(shell @$(FIND) $(IDLDIRS) -name $(i:f) -print ) ))
+.ENDIF # "$(GUI)"=="WNT"
+.ENDIF # "$(LOCALIDLFILES)$(EXTERNIDLFILES)"!=""
+.ENDIF # "$(IDLFILES)"!=""
+
+.IF "$(L10N_framework)"==""
+.IF "$(JARFILES)"!=""
+LOCALJARS:=$(foreach,i,$(shell @@-cd $(JARDIR) && ls -1 $(JARFILES) ) $(JARDIR)/$i)
+NEWCLASS:=$(LOCALJARS)
+NEWCLASS+:=$(foreach,i,$(JARFILES) $(eq,$(LOCALJARS),$(subst,$i, $(LOCALJARS)) $(SOLARBINDIR)/$i $(NULL)))
+.ENDIF # "$(JARFILES)"!=""
+NEWCLASS+=$(EXTRAJARFILES)
+.IF "$(GENJAVACLASSFILES)"!=""
+NEWCLASS+=$(CLASSGENDIR)
+.ENDIF # "$(GENJAVACLASSFILES)"!=""
+.IF "$(NEWCLASS)"!=""
+# See iz36027 for the reason for the strange $(subst ..) construct
+CLASSPATH:=.$(PATH_SEPERATOR)$(CLASSDIR)$(PATH_SEPERATOR)$(XCLASSPATH)$(PATH_SEPERATOR){$(subst,%Z*Z%,$(PATH_SEPERATOR) $(NEWCLASS:s/ /%Z*Z%/))}$(PATH_SEPERATOR)$(SOLARLIBDIR)
+.ENDIF # "$(NEWCLASS)"!=""
+.ENDIF # "$(L10N_framework)"==""
+
+.IF "$(NOOPTFILES)" != ""
+NOOPTTARGET=do_it_noopt
+.ENDIF
+
+.IF "$(EXCEPTIONSNOOPTFILES)" != ""
+EXCEPTIONSNOOPTTARGET=do_it_exceptions_noopt
+.ENDIF
+
+.IF "$(LIBTARGET)"==""
+.IF "$(OBJFILES)$(IDLOBJFILES)"!=""
+OBJTARGET=$(LB)/$(TARGET).lib
+.ENDIF
+
+.IF "$(SLOFILES)$(IDLSLOFILES)"!=""
+SLOTARGET=$(SLB)/$(TARGET).lib
+.ENDIF
+.ENDIF # "$(LIBTARGET)"==""
+
+.IF "$(SECOND_BUILD)"!=""
+.IF "$($(SECOND_BUILD)_SLOFILES)"!=""
+.IF "$(LIBTARGET)"==""
+$(SECOND_BUILD)SLOTARGET=$(SLB)/$(SECOND_BUILD)_$(TARGET).lib
+.ENDIF # "$(LIBTARGET)"==""
+REAL_$(SECOND_BUILD)_SLOFILES=$(foreach,i,$($(SECOND_BUILD)_SLOFILES) $(i:d)$(SECOND_BUILD)_$(i:f))
+.ENDIF
+
+.IF "$($(SECOND_BUILD)_OBJFILES)"!=""
+.IF "$(LIBTARGET)"==""
+$(SECOND_BUILD)OBJTARGET=$(LB)/$(SECOND_BUILD)_$(TARGET).lib
+.ENDIF # "$(LIBTARGET)"==""
+REAL_$(SECOND_BUILD)_OBJFILES=$(foreach,i,$($(SECOND_BUILD)_OBJFILES) $(i:d)$(SECOND_BUILD)_$(i:f))
+.ENDIF
+.ENDIF # "$(SECOND_BUILD)"!=""
+
+.IF "$(NOLIBOBJTARGET)$(NOLIBSLOTARGET)"!=""
+dont_set_NOLIBOBJTARGET:
+ @echo --------------------------------------------------
+ @echo setting NOLIBOBJTARGET or NOLIBSLOTARGET in your makefile
+ @echo will cause serious problems!
+ @echo use DEPOBJFILES instead.
+ @echo --------------------------------------------------
+ force_dmake_to_error
+.ENDIF # "$(NOLIBTARGET)"!=""
+.IF "$(OBJFILES)"!=""
+.IF "$(LIBTARGET)" != ""
+NOLIBOBJTARGET=$(OBJFILES)
+.ENDIF
+.ENDIF
+
+.IF "$(SLOFILES)"!=""
+.IF "$(LIBTARGET)" != ""
+NOLIBSLOTARGET=$(SLOFILES)
+.ENDIF
+.ENDIF
+
+.IF "$(SRC1FILES)"!=""
+SRC1TARGET=$(SRS)/$(SRS1NAME).srs
+DEPSRS1FILE+=$(MISC)/$(TARGET).$(SRS1NAME).dprr
+DEPSRSFILES+=$(DEPSRS1FILE)
+.ENDIF
+
+.IF "$(SRC2FILES)"!=""
+SRC2TARGET=$(SRS)/$(SRS2NAME).srs
+DEPSRS2FILE+=$(MISC)/$(TARGET).$(SRS2NAME).dprr
+DEPSRSFILES+=$(DEPSRS2FILE)
+.ENDIF
+
+.IF "$(SRC3FILES)"!=""
+SRC3TARGET=$(SRS)/$(SRS3NAME).srs
+DEPSRS3FILE+=$(MISC)/$(TARGET).$(SRS3NAME).dprr
+DEPSRSFILES+=$(DEPSRS3FILE)
+.ENDIF
+
+.IF "$(SRC4FILES)"!=""
+SRC4TARGET=$(SRS)/$(SRS4NAME).srs
+DEPSRS4FILE+=$(MISC)/$(TARGET).$(SRS4NAME).dprr
+DEPSRSFILES+=$(DEPSRS4FILE)
+.ENDIF
+
+.IF "$(SRC5FILES)"!=""
+SRC5TARGET=$(SRS)/$(SRS5NAME).srs
+DEPSRS5FILE+=$(MISC)/$(TARGET).$(SRS5NAME).dprr
+DEPSRSFILES+=$(DEPSRS5FILE)
+.ENDIF
+
+.IF "$(SRC6FILES)"!=""
+SRC6TARGET=$(SRS)/$(SRS6NAME).srs
+DEPSRS6FILE+=$(MISC)/$(TARGET).$(SRS6NAME).dprr
+DEPSRSFILES+=$(DEPSRS6FILE)
+.ENDIF
+
+.IF "$(SRC7FILES)"!=""
+SRC7TARGET=$(SRS)/$(SRS7NAME).srs
+DEPSRS7FILE+=$(MISC)/$(TARGET).$(SRS7NAME).dprr
+DEPSRSFILES+=$(DEPSRS7FILE)
+.ENDIF
+
+.IF "$(SRC8FILES)"!=""
+SRC8TARGET=$(SRS)/$(SRS8NAME).srs
+DEPSRS8FILE+=$(MISC)/$(TARGET).$(SRS8NAME).dprr
+DEPSRSFILES+=$(DEPSRS8FILE)
+.ENDIF
+
+.IF "$(SRC9FILES)"!=""
+SRC9TARGET=$(SRS)/$(SRS9NAME).srs
+DEPSRS9FILE+=$(MISC)/$(TARGET).$(SRS9NAME).dprr
+DEPSRSFILES+=$(DEPSRS9FILE)
+.ENDIF
+
+.IF "$(SOLAR_JAVA)"!=""
+.IF "$(JAVAFILES)$(JAVACLASSFILES)$(GENJAVAFILES)"!=""
+.IF "$(JAVAFILES)$(JAVACLASSFILES)"=="$(JAVAFILES)"
+JAVACLASSFILES= $(foreach,i,$(JAVAFILES) $(CLASSDIR)/$(PACKAGE)/$(i:s/.java//).class)
+.ELSE # "$(JAVAFILES)$(JAVACLASSFILES)"=="$(JAVAFILES)"
+.IF "$(JAVAFILES)$(JAVACLASSFILES)"=="$(JAVACLASSFILES)"
+JAVAFILES= $(foreach,i,$(JAVACLASSFILES) $(subst,$(CLASSDIR)/$(PACKAGE)/, $(i:s/.class//).java))
+.ENDIF # "$(JAVAFILES)$(JAVACLASSFILES)"=="$(JAVACLASSFILES)"
+.ENDIF # "$(JAVAFILES)$(JAVACLASSFILES)"=="$(JAVAFILES)"
+JAVATARGET:=$(MISC)/$(TARGET)_dummy.java
+.ENDIF # "$(JAVAFILES)$(JAVACLASSFILES)$(GENJAVAFILES)"!=""
+
+.IF "$(JARTARGET)"!=""
+JARCLASSDIRS*=.
+.IF "$(NEW_JAR_PACK)"!=""
+JARMANIFEST*=$(CLASSDIR)/$(TARGET)/META-INF/MANIFEST.MF
+.ENDIF # "$(NEW_JAR_PACK)"!=""
+JARTARGETN=$(CLASSDIR)/$(JARTARGET)
+.IF "$(NOJARDEP)$(NEW_JAR_PACK)"==""
+JARTARGETDEP=$(JARTARGET).dep
+JARTARGETDEPN=$(MISC)/$(JARTARGET).dep
+.ENDIF # "$(NOJARDEP)$(NEW_JAR_PACK)"==""
+.ENDIF # "$(JARTARGET)"!=""
+.ELSE # "$(SOLAR_JAVA)"!=""
+JAVACLASSFILES:=
+JAVAFILES:=
+javauno:=
+.ENDIF # "$(SOLAR_JAVA)"!=""
+
+.IF "$(L10N_framework)"==""
+.IF "$(RCFILES)"!=""
+RESNAME*=$(TARGET)
+.IF "$(RCFILES)" != "verinfo.rc"
+RCTARGET=$(RES)/$(RESNAME).res
+.ELSE # "$(RCFILES)" != "verinfo.rc"
+RCFILES=
+.ENDIF # "$(RCFILES)" != "verinfo.rc"
+.ENDIF # "$(RCFILES)"!=""
+.ENDIF # "$(L10N_framework)"==""
+
+LOCALIZE_ME_DEST:=$(foreach,i,$(LOCALIZE_ME) $(INCCOM)/$(i:f:s/_tmpl//))
+
+.IF "$(SCP1TARGET)"!=""
+SCP1TARGETN:=$(foreach,i,$(SCP1LINK_PRODUCT_TYPE) $(BIN)/$i/$(SCP1TARGET)$(SCPPOST))
+.ENDIF
+
+.IF "$(SCP2TARGET)"!=""
+SCP2TARGETN:=$(foreach,i,$(SCP2LINK_PRODUCT_TYPE) $(BIN)/$i/$(SCP2TARGET)$(SCPPOST))
+.ENDIF
+
+.IF "$(SCP3TARGET)"!=""
+SCP3TARGETN:=$(foreach,i,$(SCP3LINK_PRODUCT_TYPE) $(BIN)/$i/$(SCP3TARGET)$(SCPPOST))
+.ENDIF
+
+.IF "$(SCP4TARGET)"!=""
+SCP4TARGETN:=$(foreach,i,$(SCP4LINK_PRODUCT_TYPE) $(BIN)/$i/$(SCP4TARGET)$(SCPPOST))
+.ENDIF
+
+.IF "$(SCP5TARGET)"!=""
+SCP5TARGETN:=$(foreach,i,$(SCP5LINK_PRODUCT_TYPE) $(BIN)/$i/$(SCP5TARGET)$(SCPPOST))
+.ENDIF
+
+.IF "$(SCP6TARGET)"!=""
+SCP6TARGETN:=$(foreach,i,$(SCP6LINK_PRODUCT_TYPE) $(BIN)/$i/$(SCP6TARGET)$(SCPPOST))
+.ENDIF
+
+.IF "$(SCP7TARGET)"!=""
+SCP7TARGETN:=$(foreach,i,$(SCP7LINK_PRODUCT_TYPE) $(BIN)/$i/$(SCP7TARGET)$(SCPPOST))
+.ENDIF
+
+.IF "$(SCP8TARGET)"!=""
+SCP8TARGETN:=$(foreach,i,$(SCP8LINK_PRODUCT_TYPE) $(BIN)/$i/$(SCP8TARGET)$(SCPPOST))
+.ENDIF
+
+.IF "$(SCP9TARGET)"!=""
+SCP9TARGETN:=$(foreach,i,$(SCP9LINK_PRODUCT_TYPE) $(BIN)/$i/$(SCP9TARGET)$(SCPPOST))
+.ENDIF
+
+.IF "$(ZIP1TARGET)$(ZIP2TARGET)$(ZIP3TARGET)$(ZIP4TARGET)$(ZIP5TARGET)$(ZIP6TARGET)$(ZIP7TARGET)$(ZIP8TARGET)$(ZIP9TARGET)"!="$(ZIP1LIST:s/LANGDIR//)$(ZIP2LIST:s/LANGDIR//)$(ZIP3LIST:s/LANGDIR//)$(ZIP4LIST:s/LANGDIR//)$(ZIP5LIST:s/LANGDIR//)$(ZIP6LIST:s/LANGDIR//)$(ZIP7LIST:s/LANGDIR//)$(ZIP8LIST:s/LANGDIR//)$(ZIP9LIST:s/LANGDIR//)"
+
+ZIPALL=ZIPALLTARGET
+
+.ENDIF #
+
+.IF "$(APP1TARGET)"!=""
+APP1TARGETN=$(BIN)/$(APP1TARGET)$(EXECPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT"
+.IF "$(APP1BASE)"==""
+APP1BASE=$(BASE)
+.ENDIF
+APP1BASEX=/BASE:$(APP1BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(APP2TARGET)"!=""
+APP2TARGETN=$(BIN)/$(APP2TARGET)$(EXECPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT"
+.IF "$(APP2BASE)"==""
+APP2BASE=$(BASE)
+.ENDIF
+APP2BASEX=/BASE:$(APP2BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(APP3TARGET)"!=""
+APP3TARGETN=$(BIN)/$(APP3TARGET)$(EXECPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(APP3BASE)"==""
+APP3BASE=$(BASE)
+.ENDIF
+APP3BASEX=/BASE:$(APP3BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(APP4TARGET)"!=""
+APP4TARGETN=$(BIN)/$(APP4TARGET)$(EXECPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT"
+.IF "$(APP4BASE)"==""
+APP4BASE=$(BASE)
+.ENDIF
+APP4BASEX=/BASE:$(APP4BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(APP5TARGET)"!=""
+APP5TARGETN=$(BIN)/$(APP5TARGET)$(EXECPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT"
+.IF "$(APP5BASE)"==""
+APP5BASE=$(BASE)
+.ENDIF
+APP5BASEX=/BASE:$(APP5BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(APP6TARGET)"!=""
+APP6TARGETN=$(BIN)/$(APP6TARGET)$(EXECPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT"
+.IF "$(APP6BASE)"==""
+APP6BASE=$(BASE)
+.ENDIF
+APP6BASEX=/BASE:$(APP6BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(APP7TARGET)"!=""
+APP7TARGETN=$(BIN)/$(APP7TARGET)$(EXECPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT"
+.IF "$(APP7BASE)"==""
+APP7BASE=$(BASE)
+.ENDIF
+APP7BASEX=/BASE:$(APP7BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(APP8TARGET)"!=""
+APP8TARGETN=$(BIN)/$(APP8TARGET)$(EXECPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(APP8BASE)"==""
+APP8BASE=$(BASE)
+.ENDIF
+APP8BASEX=/BASE:$(APP8BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(APP9TARGET)"!=""
+APP9TARGETN=$(BIN)/$(APP9TARGET)$(EXECPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(APP9BASE)"==""
+APP9BASE=$(BASE)
+.ENDIF
+APP9BASEX=/BASE:$(APP9BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(SHL1TARGET)"!=""
+.IF "$(WINVERSIONNAMES)"!=""
+SHL1TARGET!:=$(SHL1TARGET)$($(WINVERSIONNAMES)_MAJOR)
+.ENDIF # "$(WINVERSIONNAMES)"!=""
+SHL1DLLPRE*=$(DLLPRE)
+SHL1TARGETN=$(DLLDEST)/$(SHL1DLLPRE)$(SHL1TARGET)$(DLLPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(SHL1BASE)"==""
+SHL1BASE=$(BASE)
+.ENDIF
+SHL1BASEX=/BASE:$(SHL1BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(SHL2TARGET)"!=""
+.IF "$(WINVERSIONNAMES)"!=""
+SHL2TARGET!:=$(SHL2TARGET)$($(WINVERSIONNAMES)_MAJOR)
+.ENDIF # "$(WINVERSIONNAMES)"!=""
+SHL2DLLPRE*=$(DLLPRE)
+SHL2TARGETN=$(DLLDEST)/$(SHL2DLLPRE)$(SHL2TARGET)$(DLLPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(SHL2BASE)"==""
+SHL2BASE=$(BASE)
+.ENDIF
+SHL2BASEX=/BASE:$(SHL2BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(SHL3TARGET)"!=""
+.IF "$(WINVERSIONNAMES)"!=""
+SHL3TARGET!:=$(SHL3TARGET)$($(WINVERSIONNAMES)_MAJOR)
+.ENDIF # "$(WINVERSIONNAMES)"!=""
+SHL3DLLPRE*=$(DLLPRE)
+SHL3TARGETN=$(DLLDEST)/$(SHL3DLLPRE)$(SHL3TARGET)$(DLLPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(SHL3BASE)"==""
+SHL3BASE=$(BASE)
+.ENDIF
+SHL3BASEX=/BASE:$(SHL3BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(SHL4TARGET)"!=""
+.IF "$(WINVERSIONNAMES)"!=""
+SHL4TARGET!:=$(SHL4TARGET)$($(WINVERSIONNAMES)_MAJOR)
+.ENDIF # "$(WINVERSIONNAMES)"!=""
+SHL4DLLPRE*=$(DLLPRE)
+SHL4TARGETN=$(DLLDEST)/$(SHL4DLLPRE)$(SHL4TARGET)$(DLLPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(SHL4BASE)"==""
+SHL4BASE=$(BASE)
+.ENDIF
+SHL4BASEX=/BASE:$(SHL4BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(SHL5TARGET)"!=""
+.IF "$(WINVERSIONNAMES)"!=""
+SHL5TARGET!:=$(SHL5TARGET)$($(WINVERSIONNAMES)_MAJOR)
+.ENDIF # "$(WINVERSIONNAMES)"!=""
+SHL5DLLPRE*=$(DLLPRE)
+SHL5TARGETN=$(DLLDEST)/$(SHL5DLLPRE)$(SHL5TARGET)$(DLLPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(SHL5BASE)"==""
+SHL5BASE=$(BASE)
+.ENDIF
+SHL5BASEX=/BASE:$(SHL5BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(SHL6TARGET)"!=""
+.IF "$(WINVERSIONNAMES)"!=""
+SHL6TARGET!:=$(SHL6TARGET)$($(WINVERSIONNAMES)_MAJOR)
+.ENDIF # "$(WINVERSIONNAMES)"!=""
+SHL6DLLPRE*=$(DLLPRE)
+SHL6TARGETN=$(DLLDEST)/$(SHL6DLLPRE)$(SHL6TARGET)$(DLLPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(SHL6BASE)"==""
+SHL6BASE=$(BASE)
+.ENDIF
+SHL6BASEX=/BASE:$(SHL6BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(SHL7TARGET)"!=""
+.IF "$(WINVERSIONNAMES)"!=""
+SHL7TARGET!:=$(SHL7TARGET)$($(WINVERSIONNAMES)_MAJOR)
+.ENDIF # "$(WINVERSIONNAMES)"!=""
+SHL7DLLPRE*=$(DLLPRE)
+SHL7TARGETN=$(DLLDEST)/$(SHL7DLLPRE)$(SHL7TARGET)$(DLLPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(SHL7BASE)"==""
+SHL7BASE=$(BASE)
+.ENDIF
+SHL7BASEX=/BASE:$(SHL7BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(SHL8TARGET)"!=""
+.IF "$(WINVERSIONNAMES)"!=""
+SHL8TARGET!:=$(SHL8TARGET)$($(WINVERSIONNAMES)_MAJOR)
+.ENDIF # "$(WINVERSIONNAMES)"!=""
+SHL8DLLPRE*=$(DLLPRE)
+SHL8TARGETN=$(DLLDEST)/$(SHL8DLLPRE)$(SHL8TARGET)$(DLLPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(SHL8BASE)"==""
+SHL8BASE=$(BASE)
+.ENDIF
+SHL8BASEX=/BASE:$(SHL8BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(SHL9TARGET)"!=""
+.IF "$(WINVERSIONNAMES)"!=""
+SHL9TARGET!:=$(SHL9TARGET)$($(WINVERSIONNAMES)_MAJOR)
+.ENDIF # "$(WINVERSIONNAMES)"!=""
+SHL9DLLPRE*=$(DLLPRE)
+SHL9TARGETN=$(DLLDEST)/$(SHL9DLLPRE)$(SHL9TARGET)$(DLLPOST)
+.IF "$(BASE)" != ""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(SHL9BASE)"==""
+SHL9BASE=$(BASE)
+.ENDIF
+SHL9BASEX=/BASE:$(SHL9BASE)
+.ENDIF
+.ENDIF
+.ENDIF
+
+.IF "$(COMP1TYPELIST)$(COMP2TYPELIST)$(COMP3TYPELIST)$(COMP4TYPELIST)$(COMP5TYPELIST)$(COMP6TYPELIST)$(COMP7TYPELIST)$(COMP8TYPELIST)$(COMP9TYPELIST)"!=""
+.IF "$(UNOUCRRDB)"!=""
+COMPRDB*:=$(UNOUCRRDB)
+.ELSE # "$(UNOUCRRDB)"!=""
+COMPRDB*:=$(SOLARBINDIR)/types.rdb
+.ENDIF # "$(UNOUCRRDB)"!=""
+.ENDIF # "$(COMP1TYPELIST)$(COMP2TYPELIST)$(COMP3TYPELIST)$(COMP4TYPELIST)$(COMP5TYPELIST)$(COMP6TYPELIST)$(COMP7TYPELIST)$(COMP8TYPELIST)$(COMP9TYPELIST)"!=""
+.IF "$(COMP1TYPELIST)"!=""
+UNOTYPES+=$($(COMP1TYPELIST)_XML2CMPTYPES)
+COMP1RDBTARGETN:=$(BIN)/$(COMP1TYPELIST).rdb
+#COMP1TYPELISTN:=$(MISC)/$(COMP1TYPELIST).xml
+.ENDIF
+
+.IF "$(COMP2TYPELIST)"!=""
+UNOTYPES+=$($(COMP2TYPELIST)_XML2CMPTYPES)
+COMP2RDBTARGETN:=$(BIN)/$(COMP2TYPELIST).rdb
+#COMP2TYPELISTN:=$(MISC)/$(COMP2TYPELIST).xml
+.ENDIF
+
+.IF "$(COMP3TYPELIST)"!=""
+UNOTYPES+=$($(COMP3TYPELIST)_XML2CMPTYPES)
+COMP3RDBTARGETN:=$(BIN)/$(COMP3TYPELIST).rdb
+#COMP3TYPELISTN:=$(MISC)/$(COMP3TYPELIST).xml
+.ENDIF
+
+.IF "$(COMP4TYPELIST)"!=""
+UNOTYPES+=$($(COMP4TYPELIST)_XML2CMPTYPES)
+COMP4RDBTARGETN:=$(BIN)/$(COMP4TYPELIST).rdb
+#COMP4TYPELISTN:=$(MISC)/$(COMP4TYPELIST).xml
+.ENDIF
+
+.IF "$(COMP5TYPELIST)"!=""
+UNOTYPES+=$($(COMP5TYPELIST)_XML2CMPTYPES)
+COMP5RDBTARGETN:=$(BIN)/$(COMP5TYPELIST).rdb
+#COMP5TYPELISTN:=$(MISC)/$(COMP5TYPELIST).xml
+.ENDIF
+
+.IF "$(COMP6TYPELIST)"!=""
+UNOTYPES+=$($(COMP6TYPELIST)_XML2CMPTYPES)
+COMP6RDBTARGETN:=$(BIN)/$(COMP6TYPELIST).rdb
+#COMP6TYPELISTN:=$(MISC)/$(COMP6TYPELIST).xml
+.ENDIF
+
+.IF "$(COMP7TYPELIST)"!=""
+UNOTYPES+=$($(COMP7TYPELIST)_XML2CMPTYPES)
+COMP7RDBTARGETN:=$(BIN)/$(COMP7TYPELIST).rdb
+#COMP7TYPELISTN:=$(MISC)/$(COMP7TYPELIST).xml
+.ENDIF
+
+.IF "$(COMP8TYPELIST)"!=""
+UNOTYPES+=$($(COMP8TYPELIST)_XML2CMPTYPES)
+COMP8RDBTARGETN:=$(BIN)/$(COMP8TYPELIST).rdb
+#COMP8TYPELISTN:=$(MISC)/$(COMP8TYPELIST).xml
+.ENDIF
+
+.IF "$(COMP9TYPELIST)"!=""
+UNOTYPES+=$($(COMP9TYPELIST)_XML2CMPTYPES)
+COMP9RDBTARGETN:=$(BIN)/$(COMP9TYPELIST).rdb
+#COMP9TYPELISTN:=$(MISC)/$(COMP9TYPELIST).xml
+.ENDIF
+
+UNOTYPES!:=$(strip $(UNOTYPES))
+
+#moved here to get UNOTYPES from COMPxTYPELIST
+.IF "$(UNOTYPES)" != ""
+UNOUCRHEADER=$(foreach,j,$(subst,.,/ $(UNOTYPES)) $(UNOUCROUT)/$(j:+".hpp"))
+UNOUCRTARGET:=$(INCCOM)/$(TARGET)_headergen.done
+.ENDIF # "$(UNOTYPES)" != ""
+
+.IF "$(HELPIDFILES)"!=""
+MAKE_HELPIDS=$(MISC)/helpids.don
+.ENDIF
+
+.IF "$(HXXCOPYFILES)" != ""
+HXXCOPYTARGET= copy_hxxcopyfiles
+.ENDIF
+
+.IF "$(LIB1TARGET)" != ""
+LIB1TARGETN=$(LIB1TARGET)
+.ENDIF
+
+.IF "$(LIB2TARGET)" != ""
+LIB2TARGETN=$(LIB2TARGET)
+.ENDIF
+
+.IF "$(LIB3TARGET)" != ""
+LIB3TARGETN=$(LIB3TARGET)
+.ENDIF
+
+.IF "$(LIB4TARGET)" != ""
+LIB4TARGETN=$(LIB4TARGET)
+.ENDIF
+
+.IF "$(LIB5TARGET)" != ""
+LIB5TARGETN=$(LIB5TARGET)
+.ENDIF
+
+.IF "$(LIB6TARGET)" != ""
+LIB6TARGETN=$(LIB6TARGET)
+.ENDIF
+
+.IF "$(LIB7TARGET)" != ""
+LIB7TARGETN=$(LIB7TARGET)
+.ENDIF
+
+.IF "$(LIB8TARGET)" != ""
+LIB8TARGETN=$(LIB8TARGET)
+.ENDIF
+
+.IF "$(LIB9TARGET)" != ""
+LIB9TARGETN=$(LIB9TARGET)
+.ENDIF
+
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(COM)"!="GCC"
+LIB1ARCHIV=
+LIB2ARCHIV=
+LIB3ARCHIV=
+LIB4ARCHIV=
+LIB5ARCHIV=
+LIB6ARCHIV=
+LIB7ARCHIV=
+LIB8ARCHIV=
+LIB9ARCHIV=
+.ENDIF
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(RESLIB1NAME)" != ""
+.IF "$(RESLIB1NOVERSION)"==""
+.ENDIF # "$(RESLIB1NOVERSION)"==""
+.IF "$(common_build_reslib)"!=""
+RESLIB1TARGETN=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB1NAME)LANGEXT.res
+RSC_MULTI1=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))/rsc_$(RESLIB1NAME)
+.ELSE # "$(common_build_reslib)"!=""
+RESLIB1TARGETN=$(BIN)/$(RESLIB1NAME)LANGEXT.res
+RSC_MULTI1=$(MISC)/rsc_$(RESLIB1NAME)
+.ENDIF # "$(common_build_reslib)"!=""
+# change to iso if resmgr is changed
+RESLIB1TARGETN!:=$(foreach,i,$(alllangiso) $(subst,LANGEXT,$i $(RESLIB1TARGETN)))
+.ENDIF
+
+.IF "$(RESLIB2NAME)" != ""
+.IF "$(RESLIB2NOVERSION)"==""
+.ENDIF # "$(RESLIB2NOVERSION)"==""
+.IF "$(common_build_reslib)"!=""
+RESLIB2TARGETN=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB2NAME)LANGEXT.res
+RSC_MULTI2=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))/rsc_$(RESLIB2NAME)
+.ELSE # "$(common_build_reslib)"!=""
+RESLIB2TARGETN=$(BIN)/$(RESLIB2NAME)LANGEXT.res
+RSC_MULTI2=$(MISC)/rsc_$(RESLIB2NAME)
+.ENDIF # "$(common_build_reslib)"!=""
+RESLIB2TARGETN!:=$(foreach,i,$(alllangiso) $(subst,LANGEXT,$i $(RESLIB2TARGETN)))
+.ENDIF
+
+.IF "$(RESLIB3NAME)" != ""
+.IF "$(RESLIB3NOVERSION)"==""
+.ENDIF # "$(RESLIB3NOVERSION)"==""
+.IF "$(common_build_reslib)"!=""
+RESLIB3TARGETN=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB3NAME)LANGEXT.res
+RSC_MULTI3=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))/rsc_$(RESLIB3NAME)
+.ELSE # "$(common_build_reslib)"!=""
+RESLIB3TARGETN=$(BIN)/$(RESLIB3NAME)LANGEXT.res
+RSC_MULTI3=$(MISC)/rsc_$(RESLIB3NAME)
+.ENDIF # "$(common_build_reslib)"!=""
+RESLIB3TARGETN!:=$(foreach,i,$(alllangiso) $(subst,LANGEXT,$i $(RESLIB3TARGETN)))
+.ENDIF
+
+.IF "$(RESLIB4NAME)" != ""
+.IF "$(RESLIB4NOVERSION)"==""
+.ENDIF # "$(RESLIB4NOVERSION)"==""
+.IF "$(common_build_reslib)"!=""
+RESLIB4TARGETN=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB4NAME)LANGEXT.res
+RSC_MULTI4=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))/rsc_$(RESLIB4NAME)
+.ELSE # "$(common_build_reslib)"!=""
+RESLIB4TARGETN=$(BIN)/$(RESLIB4NAME)LANGEXT.res
+RSC_MULTI4=$(MISC)/rsc_$(RESLIB4NAME)
+.ENDIF # "$(common_build_reslib)"!=""
+RESLIB4TARGETN!:=$(foreach,i,$(alllangiso) $(subst,LANGEXT,$i $(RESLIB4TARGETN)))
+.ENDIF
+
+.IF "$(RESLIB5NAME)" != ""
+.IF "$(RESLIB5NOVERSION)"==""
+.ENDIF # "$(RESLIB5NOVERSION)"==""
+.IF "$(common_build_reslib)"!=""
+RESLIB5TARGETN=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB5NAME)LANGEXT.res
+RSC_MULTI5=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))/rsc_$(RESLIB5NAME)
+.ELSE # "$(common_build_reslib)"!=""
+RESLIB5TARGETN=$(BIN)/$(RESLIB5NAME)LANGEXT.res
+RSC_MULTI5=$(MISC)/rsc_$(RESLIB5NAME)
+.ENDIF # "$(common_build_reslib)"!=""
+RESLIB5TARGETN!:=$(foreach,i,$(alllangiso) $(subst,LANGEXT,$i $(RESLIB5TARGETN)))
+.ENDIF
+
+.IF "$(RESLIB6NAME)" != ""
+.IF "$(RESLIB6NOVERSION)"==""
+.ENDIF # "$(RESLIB6NOVERSION)"==""
+.IF "$(common_build_reslib)"!=""
+RESLIB6TARGETN=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB6NAME)LANGEXT.res
+RSC_MULTI6=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))/rsc_$(RESLIB6NAME)
+.ELSE # "$(common_build_reslib)"!=""
+RESLIB6TARGETN=$(BIN)/$(RESLIB6NAME)LANGEXT.res
+RSC_MULTI6=$(MISC)/rsc_$(RESLIB6NAME)
+.ENDIF # "$(common_build_reslib)"!=""
+RESLIB6TARGETN!:=$(foreach,i,$(alllangiso) $(subst,LANGEXT,$i $(RESLIB6TARGETN)))
+.ENDIF
+
+.IF "$(RESLIB7NAME)" != ""
+.IF "$(RESLIB7NOVERSION)"==""
+.ENDIF # "$(RESLIB7NOVERSION)"==""
+.IF "$(common_build_reslib)"!=""
+RESLIB7TARGETN=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB7NAME)LANGEXT.res
+RSC_MULTI7=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))/rsc_$(RESLIB7NAME)
+.ELSE # "$(common_build_reslib)"!=""
+RESLIB7TARGETN=$(BIN)/$(RESLIB7NAME)LANGEXT.res
+RSC_MULTI7=$(MISC)/rsc_$(RESLIB7NAME)
+.ENDIF # "$(common_build_reslib)"!=""
+RESLIB7TARGETN!:=$(foreach,i,$(alllangiso) $(subst,LANGEXT,$i $(RESLIB7TARGETN)))
+.ENDIF
+
+.IF "$(RESLIB8NAME)" != ""
+.IF "$(RESLIB8NOVERSION)"==""
+.ENDIF # "$(RESLIB8NOVERSION)"==""
+.IF "$(common_build_reslib)"!=""
+RESLIB8TARGETN=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB8NAME)LANGEXT.res
+RSC_MULTI8=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))/rsc_$(RESLIB8NAME)
+.ELSE # "$(common_build_reslib)"!=""
+RESLIB8TARGETN=$(BIN)/$(RESLIB8NAME)LANGEXT.res
+RSC_MULTI8=$(MISC)/rsc_$(RESLIB8NAME)
+.ENDIF # "$(common_build_reslib)"!=""
+RESLIB8TARGETN!:=$(foreach,i,$(alllangiso) $(subst,LANGEXT,$i $(RESLIB8TARGETN)))
+.ENDIF
+
+.IF "$(RESLIB9NAME)" != ""
+.IF "$(RESLIB9NOVERSION)"==""
+.ENDIF # "$(RESLIB9NOVERSION)"==""
+.IF "$(common_build_reslib)"!=""
+RESLIB9TARGETN=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB9NAME)LANGEXT.res
+RSC_MULTI9=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(MISC))/rsc_$(RESLIB9NAME)
+.ELSE # "$(common_build_reslib)"!=""
+RESLIB9TARGETN=$(BIN)/$(RESLIB9NAME)LANGEXT.res
+RSC_MULTI9=$(MISC)/rsc_$(RESLIB9NAME)
+.ENDIF # "$(common_build_reslib)"!=""
+RESLIB9TARGETN!:=$(foreach,i,$(alllangiso) $(subst,LANGEXT,$i $(RESLIB9TARGETN)))
+.ENDIF
+
+.IF "$(INDPRESLIB1NAME)"!=""
+INDPRESLIB1TARGETN=$(BIN)/$(INDPRESLIB1NAME).dll
+.ENDIF
+
+.IF "$(DEF1NAME)"!=""
+DEF1TARGETN=$(MISC)/$(DEF1NAME).def
+.ENDIF
+
+.IF "$(DEF2NAME)"!=""
+DEF2TARGETN=$(MISC)/$(DEF2NAME).def
+.ENDIF
+
+.IF "$(DEF3NAME)"!=""
+DEF3TARGETN=$(MISC)/$(DEF3NAME).def
+.ENDIF
+
+.IF "$(DEF4NAME)"!=""
+DEF4TARGETN=$(MISC)/$(DEF4NAME).def
+.ENDIF
+
+.IF "$(DEF5NAME)"!=""
+DEF5TARGETN=$(MISC)/$(DEF5NAME).def
+.ENDIF
+
+.IF "$(DEF6NAME)"!=""
+DEF6TARGETN=$(MISC)/$(DEF6NAME).def
+.ENDIF
+
+.IF "$(DEF7NAME)"!=""
+DEF7TARGETN=$(MISC)/$(DEF7NAME).def
+.ENDIF
+
+.IF "$(DEF8NAME)"!=""
+DEF8TARGETN=$(MISC)/$(DEF8NAME).def
+.ENDIF
+
+.IF "$(DEF9NAME)"!=""
+DEF9TARGETN=$(MISC)/$(DEF9NAME).def
+.ENDIF
+
+# IZ65415 - catch obsolete macro. Can be removed later.
+.IF "$(SDINAME)"!=""
+.ERROR : ; @echo Forced error: SDINAME was used! Change your project to use SDIxNAME instead!
+NO_SDINAME_allowed
+.ENDIF
+
+.IF "$(SDI1NAME)"!=""
+.DIRCACHE=no
+SDI1TARGET=$(MISC)/$(SDI1NAME).don
+.ENDIF
+
+.IF "$(SDI2NAME)"!=""
+.DIRCACHE=no
+SDI2TARGET=$(MISC)/$(SDI2NAME).don
+.ENDIF
+
+.IF "$(SDI3NAME)"!=""
+.DIRCACHE=no
+SDI3TARGET=$(MISC)/$(SDI3NAME).don
+.ENDIF
+
+.IF "$(SDI4NAME)"!=""
+.DIRCACHE=no
+SDI4TARGET=$(MISC)/$(SDI4NAME).don
+.ENDIF
+
+.IF "$(SDI5NAME)"!=""
+.DIRCACHE=no
+SDI5TARGET=$(MISC)/$(SDI5NAME).don
+.ENDIF
+
+.IF "$(XMLPROPERTIES)"!=""
+XMLPROPERTIESN:=$(foreach,i,$(XMLPROPERTIES) $(MISC)/$(TARGET)_$(i:s/.xrb/.done/))
+.ENDIF # "$(XMLPROPERTIES)"!=""
+
+.IF "$(UNIXTEXT)"!=""
+.IF "$(GUI)"=="UNX"
+CONVERTUNIXTEXT:=$(UNIXTEXT)
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(UNIXTEXT)"!=""
+
+.IF "$(EXTUPDATEINFO_NAME)"!=""
+EXTUPDATEINFO_DEST:=$(MISC)/$(EXTUPDATEINFO_NAME)
+EXTUPDATEINFO_SOURCE*=description.xml
+.ENDIF # "$(EXTUPDATEINFO_NAME)"!=""
+
+.IF "$(JAVACLASSFILES:s/DEFINED//)"!="" || "$(javauno)"!=""
+.IF "$(L10N_framework)"==""
+TARGETDPJ=$(MISC)/$(TARGET).dpj
+.ENDIF # "$(L10N_framework)"==""
+.ENDIF
+
+.IF "$(make_srs_deps)"==""
+.IF "$(SRCFILES)" != "" || "$(SRC1FILES)" != "" || "$(SRC2FILES)" != ""
+DPRTARGET= $(MISC)/$(TARGET).dpr
+.ENDIF
+.ENDIF
+
+.IF "$(make_zip_deps)"==""
+.IF "$(ZIP1TARGET)" != "" || "$(ZIP2TARGET)" != "" || "$(ZIP3TARGET)" != ""
+DPZTARGET= $(MISC)/$(TARGET).dpz
+.ENDIF # "$(ZIP1TARGET)" != "" || "$(ZIP2TARGET)" != "" || "$(ZIP3TARGET)" != ""
+.ENDIF # "$(make_zip_deps)"==""
+
+.IF "$(SOLAR_JAVA)"!=""
+ALL_JAVA_TARGETS= \
+ $(GENJAVAFILES) \
+ $(JAVACLASSFILES) $(JAVA1CLASSFILES) \
+ $(JAVA2CLASSFILES) $(JAVA3CLASSFILES) $(JAVA4CLASSFILES)\
+ $(JAVA5CLASSFILES) $(JAVA6CLASSFILES) $(JAVA7CLASSFILES)\
+ $(JAVA8CLASSFILES) $(JAVA9CLASSFILES) $(JAVA10CLASSFILES)\
+ $(JAVA11CLASSFILES) \
+ $(JAVATARGET) \
+ $(TARGETDPJ)
+.ENDIF # "$(SOLAR_JAVA)"!=""
+# -------
+# - DEF -
+# -------
+
+# bei MAKE...DIR die gleiche Reihenfolge wie in settings.mak einhalten!
+
+.IF "$(lintit)"==""
+.IF "$(L10N_framework)"!=""
+ALLTAR: \
+ "$(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)/$(UPD)minor.mk" \
+ $(SUBDIRS) \
+ $(DPRTARGET) \
+ $(DPZTARGET) \
+ $(ZIPALL) \
+ $(SDITARGET) $(SDI1TARGET) $(SDI2TARGET) \
+ $(SDI3TARGET) $(SDI4TARGET) $(SDI5TARGET) \
+ $(XMLPROPERTIESN) \
+ $(RCTARGET) \
+ $(SCP_PRODUCT_TYPE) \
+ $(ALLPARFILES) \
+ $(SCP1TARGETN) \
+ $(SCP2TARGETN) \
+ $(SCP3TARGETN) \
+ $(SCP4TARGETN) \
+ $(SCP5TARGETN) \
+ $(SCP6TARGETN) \
+ $(SCP7TARGETN) \
+ $(SCP8TARGETN) \
+ $(SCP9TARGETN) \
+ $(SRC1TARGET) \
+ $(SRC2TARGET) \
+ $(SRC3TARGET) \
+ $(SRC4TARGET) $(SRC5TARGET) $(SRC6TARGET) \
+ $(SRC7TARGET) $(SRC8TARGET) $(SRC9TARGET) \
+ $(SRC10TARGET) $(SRC11TARGET) $(SRC12TARGET) \
+ $(SRC13TARGET) $(SRC14TARGET) $(SRC15TARGET) \
+ $(SRC16TARGET) \
+ $(RSC_MULTI1) \
+ $(RSC_MULTI2) \
+ $(RSC_MULTI3) \
+ $(RSC_MULTI4) \
+ $(RSC_MULTI5) \
+ $(RSC_MULTI6) \
+ $(RSC_MULTI7) \
+ $(RSC_MULTI8) \
+ $(RSC_MULTI9) \
+ $(INDPRESLIB1TARGETN) \
+ $(RESLIB1TARGETN) $(RESLIB2TARGETN) \
+ $(RESLIB3TARGETN) $(RESLIB4TARGETN) \
+ $(RESLIB5TARGETN) $(RESLIB6TARGETN) \
+ $(RESLIB7TARGETN) $(RESLIB8TARGETN) \
+ $(LOCALIZE_ME_DEST)\
+ last_target
+
+.ELSE # "$(L10N_framework)"!=""
+
+ALLTAR: \
+ "$(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)/$(UPD)minor.mk" \
+ $(MAKEDEMODIR) $(MAKECOMPDIR) $(MAKEXLDIR) \
+ $(COMPVERMK) \
+ $(JAVAVERMK) \
+ $(target_empty) \
+ $(SUBDIRS) \
+ $(ALLMOZ) \
+ $(DELDEFS) \
+ $(YACCTARGET) \
+ $(UNOUCRTARGET) \
+ $(UNOIDLDEPTARGETS) \
+ $(DEPFILES) \
+ $(DPRTARGET) \
+ $(DPZTARGET) \
+ $(ZIPALL) \
+ $(SDITARGET) \
+ $(LOCALDBTARGET) \
+ $(LOCALDOCDBTARGET) \
+ $(UNOIDLDBTARGET) \
+ $(UNOIDLDBDOCTARGET) \
+ $(COMP1RDBTARGETN) \
+ $(COMP2RDBTARGETN) \
+ $(COMP3RDBTARGETN) \
+ $(COMP4RDBTARGETN) \
+ $(COMP5RDBTARGETN) \
+ $(COMP6RDBTARGETN) \
+ $(COMP7RDBTARGETN) \
+ $(COMP8RDBTARGETN) \
+ $(COMP9RDBTARGETN) \
+ $(IDL1TARGET) $(IDL2TARGET) $(IDL3TARGET) \
+ $(IDL4TARGET) $(IDL5TARGET) \
+ $(SDI1TARGET) $(SDI2TARGET) $(SDI3TARGET) \
+ $(SDI4TARGET) $(SDI5TARGET) \
+ $(HXXCOPYTARGET) \
+ $(NOLIBOBJTARGET) \
+ $(NOLIBSLOTARGET) \
+ $(OTHERTARRGET) \
+ $(XMLPROPERTIESN) \
+ $(ALL_JAVA_TARGETS) \
+ $(OBJTARGET) $(SLOTARGET) $(SMRSLOTARGET) \
+ $($(SECOND_BUILD)SLOTARGET) \
+ $($(SECOND_BUILD)OBJTARGET) \
+ $(LIB1TARGET) $(LIB2TARGET) $(LIB3TARGET) \
+ $(LIB4TARGET) $(LIB5TARGET) $(LIB6TARGET) \
+ $(LIB7TARGET) $(LIB8TARGET) $(LIB9TARGET) \
+ $(LIB1ARCHIV) $(LIB2ARCHIV) $(LIB3ARCHIV) \
+ $(LIB4ARCHIV) $(LIB5ARCHIV) $(LIB6ARCHIV) \
+ $(LIB7ARCHIV) $(LIB8ARCHIV) $(LIB9ARCHIV) \
+ $(DEF1TARGETN) $(DEF2TARGETN) $(DEF3TARGETN) \
+ $(DEF4TARGETN) $(DEF5TARGETN) $(DEF6TARGETN) \
+ $(RCTARGET) \
+ $(SHL1TARGETN) \
+ $(SHL2TARGETN) \
+ $(SHL3TARGETN) \
+ $(SHL4TARGETN) \
+ $(SHL5TARGETN) \
+ $(SHL6TARGETN) \
+ $(SHL7TARGETN) \
+ $(SHL8TARGETN) \
+ $(SHL9TARGETN) \
+ $(SCP_PRODUCT_TYPE) \
+ $(ALLPARFILES) \
+ $(SCP1TARGETN) \
+ $(SCP2TARGETN) \
+ $(SCP3TARGETN) \
+ $(SCP4TARGETN) \
+ $(SCP5TARGETN) \
+ $(SCP6TARGETN) \
+ $(SCP7TARGETN) \
+ $(SCP8TARGETN) \
+ $(SCP9TARGETN) \
+ $(APP1TARGETN) $(APP2TARGETN) $(APP3TARGETN) \
+ $(APP4TARGETN) $(APP5TARGETN) $(APP6TARGETN) \
+ $(APP7TARGETN) $(APP8TARGETN) $(APP9TARGETN) \
+ $(JARTARGETN) \
+ $(JARTARGETDEPN) \
+ $(SRC1TARGET) \
+ $(SRC2TARGET) \
+ $(SRC3TARGET) \
+ $(SRC4TARGET) $(SRC5TARGET) $(SRC6TARGET) \
+ $(SRC7TARGET) $(SRC8TARGET) $(SRC9TARGET) \
+ $(SRC10TARGET) $(SRC11TARGET) $(SRC12TARGET) \
+ $(SRC13TARGET) $(SRC14TARGET) $(SRC15TARGET) \
+ $(SRC16TARGET) \
+ $(RSC_MULTI1) \
+ $(RSC_MULTI2) \
+ $(RSC_MULTI3) \
+ $(RSC_MULTI4) \
+ $(RSC_MULTI5) \
+ $(RSC_MULTI6) \
+ $(RSC_MULTI7) \
+ $(RSC_MULTI8) \
+ $(RSC_MULTI9) \
+ $(INDPRESLIB1TARGETN) \
+ $(RESLIB1TARGETN) $(RESLIB2TARGETN) \
+ $(RESLIB3TARGETN) $(RESLIB4TARGETN) \
+ $(RESLIB5TARGETN) $(RESLIB6TARGETN) \
+ $(RESLIB7TARGETN) $(RESLIB8TARGETN) \
+ $(RESLIB9TARGETN) \
+ $(SIGNFORNETSCAPE) \
+ $(SIGNFOREXPLORER) \
+ $(SIGNFORJARSIGNER) \
+ $(CONVERTUNIXTEXT) \
+ $(LOCALIZE_ME_DEST)\
+ $(EXTUPDATEINFO_DEST) \
+ last_target
+
+.IF "$(BUILD_X64)"!=""
+ALLTAR : \
+ $(NOLIBOBJTARGET_X64) \
+ $(NOLIBSLOTARGET_X64) \
+ $(OBJTARGET_X64) $(SLOTARGET_X64) \
+ $(LIB1TARGET_X64) $(LIB2TARGET_X64) \
+ $(DEF1TARGETN_X64) $(DEF2TARGETN_X64) \
+ $(SHL1TARGETN_X64) $(SHL2TARGETN_X64)
+.ENDIF # "$(BUILD_X64)"!=""
+
+ALLTAR : "$(SOLARINCDIR)/$(UPD)minor.mk"
+
+.IF "$(EXCEPTIONSNOOPT_FLAG)"==""
+TARGETDEPS+=$(EXCEPTIONSNOOPTTARGET)
+.ENDIF
+
+.IF "$(NOOPT_FLAG)"==""
+TARGETDEPS+=$(NOOPTTARGET)
+.ENDIF
+
+#don't override .TARGETS when called with targets
+.IF "$(MAKETARGETS)$(TNR)$(EXCEPTIONSNOOPT_FLAG)$(EXCEPTIONS_FLAG)$(NOOPT_FLAG)"==""
+.IF "$(TARGETDEPS)"!=""
+#.TARGETS .SEQUENTIAL :- $(TARGETDEPS) ALLTAR
+.INIT .SEQUENTIAL : $(TARGETDEPS) $(NULLPRQ)
+.ENDIF
+.ENDIF
+
+# -Gc breaks the dependency chain and causes indefinite nummbers of $(CPPUMAKER)
+.IF "$(BOOTSTRAP_SERVICE)"!="TRUE"
+CPPUMAKERFLAGS*=-L
+.ENDIF # "$(BOOTSTRAP_SERVICE)"!="TRUE"
+
+.IF "$(UNOTYPES)" != ""
+# makeing all in one
+.DIRCACHE=no
+.IF "$(OBJFILES)"!=""
+$(OBJFILES) : $(UNOUCRTARGET)
+.ENDIF # "$(OBJFILES)"!=""
+.IF "$(SLOFILES)"!=""
+$(SLOFILES) : $(UNOUCRTARGET)
+.ENDIF # "$(SLOFILES)"!=""
+.IF "$(DEPOBJFILES)"!=""
+$(DEPOBJFILES) : $(UNOUCRTARGET)
+.ENDIF # "$(SLOFILES)"!=""
+.IF "$(NOOPTTARGET)"!=""
+$(NOOPTTARGET) : $(UNOUCRTARGET)
+.ENDIF # "$(SLOFILES)"!=""
+.IF "$(NOOPTFILES)"!=""
+$(NOOPTFILES) : $(UNOUCRTARGET)
+.ENDIF # "$(SLOFILES)"!=""
+.IF "$(EXCEPTIONSFILES)"!=""
+$(EXCEPTIONSFILES) : $(UNOUCRTARGET)
+.ENDIF # "$(SLOFILES)"!=""
+.IF "$(EXCEPTIONSNOOPTTARGET)"!=""
+$(EXCEPTIONSNOOPTTARGET) : $(UNOUCRTARGET)
+.ENDIF # "$(SLOFILES)"!=""
+.IF "$(EXCEPTIONSNOOPTFILES)"!=""
+$(EXCEPTIONSNOOPTFILES) : $(UNOUCRTARGET)
+.ENDIF # "$(SLOFILES)"!=""
+
+$(UNOUCRTARGET) : $(UNOUCRHEADER)
+
+# keep that one to rebuild single misses
+$(UNOUCRHEADER):
+ @noop
+
+$(UNOUCRTARGET) : $(UNOUCRDEP)
+.IF "$(XML2MK_FILES)"!=""
+ @@-$(RM) $(foreach,i,$(XML2MK_FILES) $(MISC)/$(i).mk)
+.ENDIF # "$(XML2MK_FILES)"!=""
+ @@-$(MKDIRHIER) $(UNOUCROUT)
+ $(COMMAND_ECHO)$(CPPUMAKER) @$(mktmp $(CPPUMAKERFLAGS) -B$(UNOUCRBASE) -O$(UNOUCROUT) $(UNOTYPES:^"-T") $(UNOUCRRDB)) && $(TOUCH) $@
+.ENDIF # "$(UNOTYPES)" != ""
+
+.IF "$(COMP1RDBTARGETN)"!=""
+$(COMP1RDBTARGETN) : $(COMPRDB)
+.ENDIF # "$(COMP1RDBTARGETN)"!=""
+
+.IF "$(COMP2RDBTARGETN)"!=""
+$(COMP2RDBTARGETN) : $(COMPRDB)
+.ENDIF # "$(COMP2RDBTARGETN)"!=""
+
+.IF "$(COMP3RDBTARGETN)"!=""
+$(COMP3RDBTARGETN) : $(COMPRDB)
+.ENDIF # "$(COMP3RDBTARGETN)"!=""
+
+.IF "$(COMP4RDBTARGETN)"!=""
+$(COMP4RDBTARGETN) : $(COMPRDB)
+.ENDIF # "$(COMP4RDBTARGETN)"!=""
+
+.IF "$(COMP5RDBTARGETN)"!=""
+$(COMP5RDBTARGETN) : $(COMPRDB)
+.ENDIF # "$(COMP5RDBTARGETN)"!=""
+
+.IF "$(COMP6RDBTARGETN)"!=""
+$(COMP6RDBTARGETN) : $(COMPRDB)
+.ENDIF # "$(COMP6RDBTARGETN)"!=""
+
+.IF "$(COMP7RDBTARGETN)"!=""
+$(COMP7RDBTARGETN) : $(COMPRDB)
+.ENDIF # "$(COMP7RDBTARGETN)"!=""
+
+.IF "$(COMP8RDBTARGETN)"!=""
+$(COMP8RDBTARGETN) : $(COMPRDB)
+.ENDIF # "$(COMP8RDBTARGETN)"!=""
+
+.IF "$(COMP9RDBTARGETN)"!=""
+$(COMP9RDBTARGETN) : $(COMPRDB)
+.ENDIF # "$(COMP9RDBTARGETN)"!=""
+
+.ENDIF # "$(L10N_framework)"!=""
+.ELSE # "$(lintit)"==""
+
+ALLTAR: $(OBJFILES) $(SLOFILES)
+
+.ENDIF # "$(lintit)"==""
+
+.IF "$(SDINAME)"!=""
+$(OBJ)/$(CINTERNAME).obj : $(SDITARGET)
+.ENDIF
+
+.IF "$(SDI1NAME)"!=""
+$(OBJ)/$(CINTER1NAME).obj : $(SDI1TARGET)
+.ENDIF
+
+.IF "$(SDI2NAME)"!=""
+$(OBJ)/$(CINTER2NAME).obj : $(SDI2TARGET)
+.ENDIF
+
+.IF "$(SDI3NAME)"!=""
+$(OBJ)/$(CINTER3NAME).obj : $(SDI3TARGET)
+.ENDIF
+
+.IF "$(SDI4NAME)"!=""
+$(OBJ)/$(CINTER4NAME).obj : $(SDI4TARGET)
+.ENDIF
+
+.IF "$(SDI5NAME)"!=""
+$(OBJ)/$(CINTER5NAME).obj : $(SDI5TARGET)
+.ENDIF
+
+.IF "$(SOLAR_JAVA)"!=""
+.IF "$(GENJAVAFILES)"!=""
+$(GENJAVAFILES) : $(RDB)
+$(JAVATARGET) : $(GENJAVAFILES)
+.ENDIF # "$(GENJAVAFILES)"!=""
+.ENDIF # "$(SOLAR_JAVA)"!=""
+
+.IF "$(HXXCOPYFILES)" != ""
+$(HXXCOPYTARGET): $(HXXCOPYFILES)
+ $(COMMAND_ECHO)$(COPY) $(COPYUPDATE) $(HXXCOPYFILES) $(INCCOM) $(CHECKCOPYURESULT)
+.ENDIF
+
+.IF "$(UNIXTEXT)"!=""
+$(UNIXTEXT) : $(UNIXTEXT:f)
+ @echo "Making: " $@
+ @@-$(RM) -f $@
+ @tr -d "\015" < $(@:f) > $@
+
+.ENDIF # "$(UNIXTEXT)"!=""
+
+.IF "$(WITH_LANG)"!=""
+.IF "$(LOCALIZESDF)"!=""
+
+# dummy target to keep the build happy if not even the .zip exists. localization tools deal with not existing
+# localize.sdf themself
+"$(LOCALIZESDF)%":
+ @echo $(LOCALIZESDF)
+ @@-$(MKDIRHIER) $(@:d)
+ $(TOUCH) $@
+
+.IF "$(LOCALIZATION_FOUND)"==""
+.IF "$(LOCALSDFFILE)"!=""
+"$(LOCALIZESDF)" : $(SOLARCOMMONSDFDIR)/$(PRJNAME).zip
+ @@-$(MKDIRHIER) $(@:d)
+ @@-$(MKDIRHIER) $(COMMONMISC)/$(PRJNAME)_$(TARGET)
+ @-unzip -o -d $(COMMONMISC)/$(PRJNAME) $(SOLARCOMMONSDFDIR)/$(PRJNAME).zip $(subst,$(COMMONMISC)/$(PRJNAME)/, $@)
+ @@$(TOUCH) $@
+.ENDIF # "$(LOCALSDFFILE)"!=""
+.ENDIF # "$(LOCALIZATION_FOUND)"==""
+.ENDIF # "$(LOCALIZESDF)"!=""
+.ENDIF # "$(WITH_LANG)"!=""
+
+.IF "$(EXTUPDATEINFO_NAME)"!=""
+$(EXTUPDATEINFO_DEST) : $(EXTUPDATEINFO_SOURCE)
+ $(PERL) $(SOLARENV)/bin/make_ext_update_info.pl --out $(EXTUPDATEINFO_DEST) $(foreach,i,$(EXTUPDATEINFO_URLS) --update-url "$i") $(EXTUPDATEINFO_SOURCE)
+.ENDIF # "$(EXTUPDATEINFO_NAME)"!=""
+
+makedoc:
+ @@-mkdir $(OUT)/ucrdoc
+ $(COMMAND_ECHO)$(IDLC) $(VERBOSITY) @$(mktmp $(IDLCFLAGS) $(UNOIDLDEFS) $(UNOIDLINCEXTRA) $(UNOIDLINC) -C -O$(OUT)/ucrdoc/$(IDLPACKAGE) $(DEPIDLFILES:+"\n"))
+
+.IF "$(LOCALDBTARGET)"!=""
+$(LOCALDBTARGET) : $(URDFILES) $(DEPIDLFILES)
+ $(COMMAND_ECHO)$(IDLC) $(VERBOSITY) @$(mktmp $(IDLCFLAGS) $(UNOIDLDEFS) $(UNOIDLINCEXTRA) $(UNOIDLINC) -O$(OUT)/ucr/$(IDLPACKAGE) $(all_outdated_idl))
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(REGMERGE) $@ UCR @$(mktmp $(URDFILES))
+.ENDIF
+
+.IF "$(LOCALDOCDBTARGET)"!=""
+$(LOCALDOCDBTARGET) : $(URDDOCFILES) $(DEPIDLFILES)
+ $(COMMAND_ECHO)$(IDLC) $(VERBOSITY) @$(mktmp $(IDLCFLAGS) $(UNOIDLDEFS) $(UNOIDLINCEXTRA) $(UNOIDLINC) -C -O$(OUT)/ucrdoc/$(IDLPACKAGE) $(all_outdated_idl))
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(REGMERGE) $@ UCR @$(mktmp $(URDDOCFILES))
+.ENDIF
+
+.IF "$(UNOIDLDBTARGET)"!=""
+$(UNOIDLDBTARGET) : $(UNOIDLDBFILES) $(UNOIDLDBREGS)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(REGMERGE) $@ / @$(mktmp $(UNOIDLDBFILES) $(UNOIDLDBREGS))
+.IF "$(LOCALREGDB)"!=""
+ $(COMMAND_ECHO)$(REGMERGE) $(LOCALREGDB) / $@
+.ENDIF
+.ENDIF # "$(UNOIDLDBTARGET)"!=""
+
+.IF "$(UNOIDLDBDOCTARGET)"!=""
+$(UNOIDLDBDOCTARGET) : $(UNOIDLDBDOCFILES) $(UNOIDLDBDOCREGS)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(REGMERGE) $@ / @$(mktmp $(UNOIDLDBDOCFILES) $(UNOIDLDBDOCREGS))
+.IF "$(LOCALREGDB)"!=""
+ $(COMMAND_ECHO)$(REGMERGE) $(LOCALREGDB) / $@
+.ENDIF
+.ENDIF # "$(UNOIDLDBDOCTARGET)"!=""
+
+.IF "$(SCP_PRODUCT_TYPE)"!=""
+$(SCP_PRODUCT_TYPE):
+ @@-$(MKDIRHIER) $(PAR)/$@
+ @@-$(MKDIRHIER) $(BIN)/$@
+
+.ENDIF # "$(PARFILES)"!=""
+
+"$(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)/minormkchanged.flg" :
+ $(TOUCH) $@
+
+.IF "$(COMPVERMK)"!=""
+.IF "$(UPDATER)"!="" || "$(CWS_WORK_STAMP)"!=""
+.IF "$(COMPATH:s!\!/!)"!="$(COMPATH_STORED)"
+COMPVERMK_PHONY:=.PHONY
+.ENDIF # "$(COMPATH:s!\!/!)"!="$(COMPATH_STORED)"
+COMPVTMP:=$(mktmp iii)
+"$(COMPVERMK)" $(COMPVERMK_PHONY): $(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)/minormkchanged.flg
+.IF "$(CCNUMVER)"!=""
+ @echo COMNAME:=$(COMNAME) > $(COMPVTMP)
+ @echo COMID:=$(COMID) >> $(COMPVTMP)
+.IF "$(COM)"=="GCC"
+ @echo SHORTSTDCPP3:=$(SHORTSTDCPP3) >> $(COMPVTMP)
+ @echo SHORTSTDC3:=$(SHORTSTDC3) >> $(COMPVTMP)
+.ENDIF
+ @echo CCNUMVER:=$(CCNUMVER) >> $(COMPVTMP)
+ @echo CCVER:=$(CCVER:s/-/ /:1) >> $(COMPVTMP)
+ @echo CDEFS+=-DCPPU_ENV=$(COMNAME) >> $(COMPVTMP)
+ @echo COMPATH_STORED:=$(COMPATH:s!\!/!) >> $(COMPVTMP)
+ @@-$(RM) $(@)_$(COMPVTMP:b)
+ @$(TYPE) $(COMPVTMP) | tr -d "\015" > $(@)_$(COMPVTMP:b)
+ @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ >& $(NULLDEV) $(FI)
+ @-$(RENAME) $(@)_$(COMPVTMP:b) $@
+ @@-$(RM) $(@)_$(COMPVTMP:b)
+.ELSE # "$(CCNUMVER)"!=""
+ @@-$(RM) $@
+.ENDIF # "$(CCNUMVER)"!=""
+
+.ENDIF # "$(COMPVERMK)"!=""
+.ENDIF # "$(UPDATER)"!="" || "$(CWS_WORK_STAMP)"!=""
+
+.IF "$(JAVAVERMK)"!=""
+.IF "$(JAVALOCATION)"!="$(JAVA_HOME)"
+"$(JAVAVERMK)" .PHONY :
+.ELSE # "$(JAVALOCATION)"!="$(JAVA_HOME)"
+"$(JAVAVERMK)" : $(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)/minormkchanged.flg
+.ENDIF # "$(JAVALOCATION)"!="$(JAVA_HOME)"
+ @-$(RM) $@
+ @echo JAVAVER:=$(JAVAVER) > $@
+ @echo JAVANUMVER:=$(JAVANUMVER) >> $@
+ @echo JAVALOCATION:=$(JAVA_HOME) >> $@
+
+.ENDIF # "$(JAVAVERMK)"!=""
+
+# on recursive call there seems to be one blank in TARGETDEP
+# which makes it not empty :-(
+.IF "$(TARGETDEPS:s/ //)"!=""
+$(TARGETDEPS) : $(LOCALIZE_ME_DEST)
+.ENDIF # "$(TARGETDEPS)"!=""
+
+.IF "$(LOCALIZE_ME_DEST)"!=""
+
+.IF "$(WITH_LANG)"==""
+$(LOCALIZE_ME_DEST) : $(LOCALIZE_ME)
+ $(COMMAND_ECHO)-$(RM) $(INCCOM)/$(TARGET)_lastrun.mk
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(COPY) $(@:b:+"_tmpl")$(@:e) $@
+
+.ELSE # "$(WITH_LANG)"==""
+# LASTRUN_MERGED
+.INCLUDE .IGNORE : $(INCCOM)/$(TARGET)_lastrun.mk
+.IF "$(LASTRUN_MERGED)"=="TRUE"
+$(LOCALIZE_ME_DEST) : $(LOCALIZE_ME) $(LOCALIZESDF)
+.ELSE # "$(LASTRUN_MERGED)"=="TRUE"
+$(LOCALIZE_ME_DEST) .PHONY : $(LOCALIZE_ME) $(LOCALIZESDF)
+ echo LASTRUN_MERGED:=TRUE > $(INCCOM)/$(TARGET)_lastrun.mk
+.ENDIF # "$(LASTRUN_MERGED)"=="TRUE"
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(TRANSEX) -p $(PRJNAME) -i $(@:b:+"_tmpl")$(@:e) -o $(@:d)/$(@:b:+"_tmpl")$(@:e).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $(@:d)$(@:b:+"_tmpl")$(@:e).$(INPATH) $@
+
+.ENDIF # "$(WITH_LANG)"==""
+.ENDIF # "$(LOCALIZE_ME_DEST)"!=""
+
+.IF "$(XMLPROPERTIES)"!=""
+.IF "$(L10N_framework)"!=""
+XML_ISO_CODE*=-ISO99 $(L10N_framework)
+.ENDIF
+.IF "$(WITH_LANG)"!=""
+$(MISC)/$(TARGET)_%.done : $(COMMONMISC)/$(TARGET)/%.xrb
+.ELSE # "$(WITH_LANG)"!=""
+$(MISC)/$(TARGET)_%.done : %.xrb
+.ENDIF # "$(WITH_LANG)"!=""
+ @@-$(RM) $(MISC)/$(<:b).interm$(TARGET)
+ native2ascii -encoding UTF8 $< $(MISC)/$(<:b).interm$(TARGET) && $(XMLEX) -i $(MISC)/$(<:b).interm$(TARGET) -o $(CLASSDIR) $(XML_ISO_CODE) -g -d $@
+ @@$(RM) $(MISC)/$(<:b).interm$(TARGET)
+.ENDIF # "$(XMLPROPERTIES)"!=""
+
+.IF "$(SDI1TARGET)$(SDI2TARGET)$(SDI3TARGET)$(SDI4TARGET)$(SDI5TARGET)$(SDI6TARGET)$(SDI7TARGET)$(SDI8TARGET)$(SDI9TARGET)"!=""
+.INCLUDE : _tg_sdi.mk
+.ENDIF # "$(SDI1TARGET)$(SDI2TARGET)$(SDI3TARGET)$(SDI4TARGET)$(SDI5TARGET)$(SDI6TARGET)$(SDI7TARGET)$(SDI8TARGET)$(SDI9TARGET)"!=""
+
+.IF "$(DEF1NAME)$(DEF2NAME)$(DEF3NAME)$(DEF4NAME)$(DEF5NAME)$(DEF6NAME)$(DEF7NAME)$(DEF8NAME)$(DEF9NAME)"!=""
+.INCLUDE : _tg_def.mk
+.ENDIF
+
+# -------
+# - LIB -
+# -------
+
+.IF "$(OBJTARGET)$($(SECOND_BUILD)OBJTARGET)"!=""
+.INCLUDE : tg_obj.mk
+.ENDIF # "$(OBJTARGET)$($(SECOND_BUILD)OBJTARGET)"!=""
+
+# -------
+# - SLB -
+# -------
+
+.IF "$(SLOTARGET)$($(SECOND_BUILD)SLOTARGET)"!=""
+.INCLUDE : tg_slo.mk
+.ENDIF # "$(SLOTARGET)$($(SECOND_BUILD)SLOTARGET)"!=""
+
+# --------
+# - LIBS -
+# --------
+
+.IF "$(LIB1TARGET)$(LIB2TARGET)$(LIB3TARGET)$(LIB4TARGET)$(LIB5TARGET)$(LIB6TARGET)$(LIB7TARGET)$(LIB8TARGET)$(LIB9TARGET)" != ""
+.INCLUDE : _tg_lib.mk
+.ENDIF # "$(LIB1TARGET)$(LIB2TARGET)$(LIB3TARGET)$(LIB4TARGET)$(LIB5TARGET)$(LIB6TARGET)$(LIB7TARGET)$(LIB8TARGET)$(LIB9TARGET)" != ""
+
+# -------
+# - SRS -
+# -------
+
+.IF "$(SRS1NAME)$(SRS2NAME)$(SRS3NAME)$(SRS4NAME)$(SRS5NAME)$(SRS6NAME)$(SRS7NAME)$(SRS8NAME)$(SRS9NAME)"!=""
+.INCLUDE : _tg_srs.mk
+.ENDIF # "$(SRS1NAME)$(SRS2NAME)$(SRS3NAME)$(SRS4NAME)$(SRS5NAME)$(SRS6NAME)$(SRS7NAME)$(SRS8NAME)$(SRS9NAME)"!=""
+
+# -------
+# - RES -
+# -------
+
+.IF "$(RCTARGET)"!=""
+.INCLUDE : tg_res.mk
+.ENDIF # "$(RCTARGET)"!=""
+
+# -------
+# - SHL -
+# -------
+
+.IF "$(SHL1TARGETN)$(SHL2TARGETN)$(SHL3TARGETN)$(SHL4TARGETN)$(SHL5TARGETN)$(SHL6TARGETN)$(SHL7TARGETN)$(SHL8TARGETN)$(SHL9TARGETN)"!=""
+.INCLUDE : _tg_shl.mk
+.ENDIF # "$(SHL1TARGETN)$(SHL2TARGETN)$(SHL3TARGETN)$(SHL4TARGETN)$(SHL5TARGETN)$(SHL6TARGETN)$(SHL7TARGETN)$(SHL8TARGETN)$(SHL9TARGETN)"!=""
+
+.IF "$(USE_VERSIONH)"!=""
+.INIT .SEQUENTIAL : $(USE_VERSIONH) $(NULLPRQ)
+.ENDIF # "$(USE_VERSIONH)"!=""
+
+# -------
+# - APP -
+# -------
+
+.IF "$(APP1TARGETN)$(APP2TARGETN)$(APP3TARGETN)$(APP4TARGETN)$(APP5TARGETN)$(APP6TARGETN)$(APP7TARGETN)$(APP8TARGETN)$(APP9TARGETN)"!=""
+.INCLUDE : _tg_app.mk
+.ENDIF
+
+# -------
+# - SCP -
+# -------
+
+.IF "$(SCP1TARGETN)$(SCP2TARGETN)$(SCP3TARGETN)$(SCP4TARGETN)$(SCP5TARGETN)$(SCP6TARGETN)$(SCP7TARGETN)$(SCP8TARGETN)$(SCP9TARGETN)"!=""
+.INCLUDE : _tg_scp.mk
+.ENDIF
+
+# -------
+# - ZIP -
+# -------
+
+.IF "$(ZIP1TARGET)$(ZIP2TARGET)$(ZIP3TARGET)$(ZIP4TARGET)$(ZIP5TARGET)$(ZIP6TARGET)$(ZIP7TARGET)$(ZIP8TARGET)$(ZIP9TARGET)"!=""
+.INCLUDE : _tg_zip.mk
+.ENDIF
+
+# -------
+# - RESLIBTARGET -
+# -------
+
+.IF "$(RESLIB1TARGETN)$(RESLIB2TARGETN)$(RESLIB3TARGETN)$(RESLIB4TARGETN)$(RESLIB5TARGETN)$(RESLIB6TARGETN)$(RESLIB7TARGETN)$(RESLIB8TARGETN)$(RESLIB9TARGETN)"!=""
+.INCLUDE : _tg_rslb.mk
+.ENDIF
+
+# -------
+# - processing config -
+# -------
+
+.IF "$(XCSFILES)$(XCUFILES)"!=""
+.INCLUDE : tg_config.mk
+.ENDIF # "$(XCSFILES)$(XCUFILES)"!=""
+
+
+# ------------------
+# - INCLUDE DEPEND -
+# ------------------
+
+# same block as in depend build
+.IF "$(MAKEFILERC)"==""
+.IF "$(RCFILES)$(SLOFILES)$(OBJFILES)$(DEPOBJFILES)$(PARFILES)" != ""
+.IF "$(DEPFILES)" != ""
+.INCLUDE : $(DEPFILES)
+.ENDIF # "$(DEPFILES)" != ""
+.IF "$(nodep)"==""
+.IF "$(DEPCOLLECT_SLO)" != ""
+.PHONY : $(DEPCOLLECT_SLO)
+.INCLUDE .IGNORE : $(DEPCOLLECT_SLO)
+.INCLUDE : $(DEPFILE_SLO)
+.ENDIF # "$(DEPCOLLECT_SLO)" != ""
+.IF "$(DEPCOLLECT_OBJ)" != ""
+.PHONY : $(DEPCOLLECT_OBJ)
+.INCLUDE .IGNORE : $(DEPCOLLECT_OBJ)
+.INCLUDE : $(DEPFILE_OBJ)
+.ENDIF # "$(DEPCOLLECT_OBJ)" != ""
+.ENDIF # "$(nodep)"==""
+.ENDIF # "$(RCFILES)$(SLOFILES)$(OBJFILES)$(DEPOBJFILES)$(PARFILES)" != ""
+.ELSE # MAKEFILERC
+.ENDIF # MAKEFILERC
+
+.IF "$(make_srs_deps)"==""
+.IF "$(SRCFILES)" != "" || "$(SRC1FILES)" != "" || "$(SRC2FILES)" != ""
+.IF "$(nodep)"==""
+.INCLUDE : $(MISC)/$(TARGET).dpr
+.ENDIF # "$(nodep)"==""
+.ENDIF
+.ENDIF
+
+.IF "$(make_zip_deps)"==""
+.IF "$(ZIP1TARGET)" != "" || "$(ZIP2TARGET)" != "" || "$(ZIP3TARGET)" != ""
+.IF "$(nodep)"==""
+.INCLUDE : $(MISC)/$(TARGET).dpz
+# introduce separation char
+missing_zipdep_langs=$(alllangiso:^"+":+"+")
+some_dummy_var:=$(foreach,i,$(zipdep_langs) $(assign missing_zipdep_langs:=$(strip $(subst,+$(i)+, $(missing_zipdep_langs)))))
+.IF "$(missing_zipdep_langs)"!=""
+ZIPDEPPHONY=.PHONY
+.ENDIF # "$(missing_zipdep_langs)"!=""
+.ENDIF # "$(nodep)"==""
+.ENDIF
+.ENDIF
+
+last_target:
+ $(NULL)
+
+$(MISC)/$(TARGET)genjava.mk: $(IDLFILES)
+
+.IF "$(JAVACLASSFILES:s/DEFINED//)"!=""
+.IF "$(L10N_framework)"==""
+.INCLUDE .IGNORE : $(MISC)/$(TARGET).dpj
+$(TARGETDPJ) : $(JAVAFILES) $(JAVATARGET)
+.ENDIF # "$(L10N_framework)"==""
+.ENDIF
+
+.IF "$(JARTARGETN)"!=""
+.INCLUDE : tg_jar.mk
+.ENDIF # "$(JARTARGETN)"!=""
+
+# ----------------------------------
+# - NOOPT - files ohne optimierung -
+# ----------------------------------
+
+.IF "$(NOOPTTARGET)" != ""
+.IF "$(NOOPT_FLAG)" == ""
+
+$(NOOPTTARGET):
+.IF "$(VERBOSE)" == "TRUE"
+ @echo --- NOOPTFILES ---
+.ENDIF
+ @dmake $(MFLAGS) $(MAKEFILE) nopt=true $(NOOPTFILES) NOOPT_FLAG=TRUE $(CALLMACROS)
+.IF "$(VERBOSE)" == "TRUE"
+ @echo --- NOOPTFILES OVER ---
+.ENDIF
+
+$(NOOPTFILES):
+.IF "$(VERBOSE)" == "TRUE"
+ @echo --- NOOPT ---
+.ENDIF
+ @dmake $(MFLAGS) $(MAKEFILE) nopt=true NOOPT_FLAG=TRUE $(CALLMACROS) $@
+.IF "$(VERBOSE)" == "TRUE"
+ @echo --- NOOPT OVER ---
+.ENDIF
+.ENDIF
+.ENDIF
+
+
+# ----------------------------------
+# - EXCEPTIONSNOOPT - files with exceptions, without optimization -
+# ----------------------------------
+
+.IF "$(EXCEPTIONSNOOPTTARGET)" != ""
+.IF "$(EXCEPTIONSNOOPT_FLAG)" == ""
+
+$(EXCEPTIONSNOOPTTARGET):
+.IF "$(VERBOSE)" == "TRUE"
+ @echo --- EXCEPTIONSNOOPTFILES ---
+.ENDIF
+ @dmake $(MFLAGS) $(MAKEFILE) ENABLE_EXCEPTIONS=true $(EXCEPTIONSNOOPTFILES) EXCEPTIONSNOOPT_FLAG=TRUE nopt=true $(CALLMACROS)
+.IF "$(VERBOSE)" == "TRUE"
+ @echo --- EXCEPTIONSNOOPTFILES OVER ---
+.ENDIF
+
+$(EXCEPTIONSNOOPTFILES):
+.IF "$(VERBOSE)" == "TRUE"
+ @echo --- EXCEPTIONSNOOPT ---
+.ENDIF
+ @dmake $(MFLAGS) $(MAKEFILE) ENABLE_EXCEPTIONS=true EXCEPTIONSNOOPT_FLAG=TRUE nopt=true $(CALLMACROS) $@
+.IF "$(VERBOSE)" == "TRUE"
+ @echo --- EXCEPTIONSNOOPT OVER ---
+.ENDIF
+
+
+.ENDIF
+.ENDIF
+
+.IF "$(nodep)"==""
+# recreate dependency files that were removed manually or vanished otherwise...
+forcedeps: $(DEPFILE_SLO) $(DEPFILE_OBJ)
+ @$(null,$(DEPS_MISSING) noop $(eq,$(sort $(DEPS_MISSING)),$(sort $(DEPS_MADE)) noop dmake depend=t $(MFLAGS) $(MAKEMACROS) ALLDEP))
+ @noop $(foreach,i,$($(TARGET)_known_dpcc) $(assign DEPS_MADE:=$(subst,$i, $(DEPS_MADE))))
+ @$(null,$(DEPS_MADE) noop $(null,$(DEPFILE_SLO) noop $(RM) $(DEPFILE_SLO)))
+ @$(null,$(DEPS_MADE) noop $(null,$(DEPFILE_OBJ) noop $(RM) $(DEPFILE_OBJ)))
+
+ALLTAR : forcedeps
+
+.ENDIF # "$(nodep)"==""
+
+# -------------------------
+# - several kill targets -
+# -------------------------
+
+"$(TMP)/makedt.don":
+ @$(TOUCH) $(TMP)/makedt.don
+
+killbin:
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+ @$(IFEXIST) $(BIN)/$(SHL1TARGET).dll $(THEN) $(RM:s/+//) $(BIN)/$(SHL1TARGET).dll $(FI)
+ @$(IFEXIST) $(BIN)/$(SHL2TARGET).dll $(THEN) $(RM:s/+//) $(BIN)/$(SHL2TARGET).dll $(FI)
+ @$(IFEXIST) $(BIN)/$(SHL3TARGET).dll $(THEN) $(RM:s/+//) $(BIN)/$(SHL3TARGET).dll $(FI)
+ @$(IFEXIST) $(BIN)/$(SHL4TARGET).dll $(THEN) $(RM:s/+//) $(BIN)/$(SHL4TARGET).dll $(FI)
+ @$(IFEXIST) $(BIN)/$(SHL5TARGET).dll $(THEN) $(RM:s/+//) $(BIN)/$(SHL5TARGET).dll $(FI)
+ @$(IFEXIST) $(BIN)/$(SHL6TARGET).dll $(THEN) $(RM:s/+//) $(BIN)/$(SHL6TARGET).dll $(FI)
+ @$(IFEXIST) $(BIN)/$(SHL7TARGET).dll $(THEN) $(RM:s/+//) $(BIN)/$(SHL7TARGET).dll $(FI)
+ @$(IFEXIST) $(BIN)/$(SHL8TARGET).dll $(THEN) $(RM:s/+//) $(BIN)/$(SHL8TARGET).dll $(FI)
+ @$(IFEXIST) $(BIN)/$(SHL9TARGET).dll $(THEN) $(RM:s/+//) $(BIN)/$(SHL9TARGET).dll $(FI)
+ @$(IFEXIST) $(BIN)/$(APP1TARGET)$(EXECPOST) $(THEN) $(RM:s/+//) $(BIN)/$(APP1TARGET)$(EXECPOST) $(FI)
+ @$(IFEXIST) $(BIN)/$(APP2TARGET)$(EXECPOST) $(THEN) $(RM:s/+//) $(BIN)/$(APP2TARGET)$(EXECPOST) $(FI)
+ @$(IFEXIST) $(BIN)/$(APP3TARGET)$(EXECPOST) $(THEN) $(RM:s/+//) $(BIN)/$(APP3TARGET)$(EXECPOST) $(FI)
+ @$(IFEXIST) $(BIN)/$(APP4TARGET)$(EXECPOST) $(THEN) $(RM:s/+//) $(BIN)/$(APP4TARGET)$(EXECPOST) $(FI)
+ @$(IFEXIST) $(BIN)/$(APP5TARGET)$(EXECPOST) $(THEN) $(RM:s/+//) $(BIN)/$(APP5TARGET)$(EXECPOST) $(FI)
+ @$(IFEXIST) $(BIN)/$(APP6TARGET)$(EXECPOST) $(THEN) $(RM:s/+//) $(BIN)/$(APP6TARGET)$(EXECPOST) $(FI)
+ @$(IFEXIST) $(BIN)/$(APP7TARGET)$(EXECPOST) $(THEN) $(RM:s/+//) $(BIN)/$(APP7TARGET)$(EXECPOST) $(FI)
+ @$(IFEXIST) $(BIN)/$(APP8TARGET)$(EXECPOST) $(THEN) $(RM:s/+//) $(BIN)/$(APP8TARGET)$(EXECPOST) $(FI)
+ @$(IFEXIST) $(BIN)/$(APP9TARGET)$(EXECPOST) $(THEN) $(RM:s/+//) $(BIN)/$(APP9TARGET)$(EXECPOST) $(FI)
+
+.ELSE # "$(GUI)"=="WNT"
+.IF "$(SHL1TARGET)"!=""
+ @-$(RM) $(LB)/$(SHL1DLLPRE)$(SHL1TARGET)$(DLLPOST)
+.ENDIF
+.IF "$(SHL2TARGET)"!=""
+ @-$(RM) $(LB)/$(SHL2DLLPRE)$(SHL2TARGET)$(DLLPOST)
+.ENDIF
+.IF "$(SHL3TARGET)"!=""
+ @-$(RM) $(LB)/$(SHL3DLLPRE)$(SHL3TARGET)$(DLLPOST)
+.ENDIF
+.IF "$(SHL4TARGET)"!=""
+ @-$(RM) $(LB)/$(SHL4DLLPRE)$(SHL4TARGET)$(DLLPOST)
+.ENDIF
+.IF "$(SHL5TARGET)"!=""
+ @-$(RM) $(LB)/$(SHL5DLLPRE)$(SHL5TARGET)$(DLLPOST)
+.ENDIF
+.IF "$(SHL6TARGET)"!=""
+ @-$(RM) $(LB)/$(SHL6DLLPRE)$(SHL6TARGET)$(DLLPOST)
+.ENDIF
+.IF "$(SHL7TARGET)"!=""
+ @-$(RM) $(LB)/$(SHL7DLLPRE)$(SHL7TARGET)$(DLLPOST)
+.ENDIF
+.IF "$(SHL8TARGET)"!=""
+ @-$(RM) $(LB)/$(SHL8DLLPRE)$(SHL8TARGET)$(DLLPOST)
+.ENDIF
+.IF "$(SHL9TARGET)"!=""
+ @-$(RM) $(LB)/$(SHL9DLLPRE)$(SHL9TARGET)$(DLLPOST)
+.ENDIF
+.IF "$(APP1TARGET)"!=""
+ @-$(RM) $(BIN)/$(APP1TARGET)$(EXECPOST)
+.ENDIF
+.IF "$(APP2TARGET)"!=""
+ @-$(RM) $(BIN)/$(APP2TARGET)$(EXECPOST)
+.ENDIF
+.IF "$(APP3TARGET)"!=""
+ @-$(RM) $(BIN)/$(APP3TARGET)$(EXECPOST)
+.ENDIF
+.IF "$(APP4TARGET)"!=""
+ @-$(RM) $(BIN)/$(APP4TARGET)$(EXECPOST)
+.ENDIF
+.IF "$(APP5TARGET)"!=""
+ @-$(RM) $(BIN)/$(APP5TARGET)$(EXECPOST)
+.ENDIF
+.IF "$(APP6TARGET)"!=""
+ @-$(RM) $(BIN)/$(APP6TARGET)$(EXECPOST)
+.ENDIF
+.IF "$(APP7TARGET)"!=""
+ @-$(RM) $(BIN)/$(APP7TARGET)$(EXECPOST)
+.ENDIF
+.IF "$(APP8TARGET)"!=""
+ @-$(RM) $(BIN)/$(APP8TARGET)$(EXECPOST)
+.ENDIF
+.IF "$(APP9TARGET)"!=""
+ @-$(RM) $(BIN)/$(APP9TARGET)$(EXECPOST)
+.ENDIF
+.ENDIF # "$(GUI)"=="WNT"
+
+killobj:
+.IF "$(SLOFILES)" != ""
+ -cd $(SLO) && $(TYPE:s/+//) $(mktmp $(SLOFILES:f)) | xargs -n 20 rm
+ -cd $(SLO) && $(TYPE:s/+//) $(mktmp $(SLOFILES:s/.obj/.o/:f)) | xargs -n 20 rm
+.ENDIF
+.IF "$(OBJFILES)" != ""
+ -cd $(OBJ) && $(TYPE:s/+//) $(mktmp $(OBJFILES:f)) | xargs -n 20 rm
+ -cd $(OBJ) && $(TYPE:s/+//) $(mktmp $(OBJFILES:s/.obj/.o/:f)) | xargs -n 20 rm
+.ENDIF
+
+.IF "$(REAL_$(SECOND_BUILD)_SLOFILES)" != ""
+ -cd $(REAL_$(SECOND_BUILD)_SLO) && $(TYPE:s/+//) $(mktmp $(REAL_$(SECOND_BUILD)_SLOFILES:f)) | xargs -n 20 rm
+ -cd $(REAL_$(SECOND_BUILD)_SLO) && $(TYPE:s/+//) $(mktmp $(REAL_$(SECOND_BUILD)_SLOFILES:s/.obj/.o/:f)) | xargs -n 20 rm
+.ENDIF
+.IF "$(REAL_$(SECOND_BUILD)_OBJFILES)" != ""
+ -cd $(REAL_$(SECOND_BUILD)_OBJ) && $(TYPE:s/+//) $(mktmp $(REAL_$(SECOND_BUILD)_OBJFILES:f)) | xargs -n 20 rm
+ -cd $(REAL_$(SECOND_BUILD)_OBJ) && $(TYPE:s/+//) $(mktmp $(REAL_$(SECOND_BUILD)_OBJFILES:s/.obj/.o/:f)) | xargs -n 20 rm
+.ENDIF
+.IF "$(DEPOBJFILES)" != ""
+ -cd $(SLO) && $(TYPE:s/+//) $(mktmp $(DEPOBJFILES:f)) | xargs -n 20 rm
+ -cd $(SLO) && $(TYPE:s/+//) $(mktmp $(DEPOBJFILES:s/.obj/.o/:f)) | xargs -n 20 rm
+ -cd $(OBJ) && $(TYPE:s/+//) $(mktmp $(DEPOBJFILES:f)) | xargs -n 20 rm
+ -cd $(OBJ) && $(TYPE:s/+//) $(mktmp $(DEPOBJFILES:s/.obj/.o/:f)) | xargs -n 20 rm
+.ENDIF
+ @echo objects weg!
+
+killsrs:
+# doesn't work - fix me!
+.IF "$(SRSFILES)" != ""
+ $(RM) $(SRSFILES)
+.ENDIF
+ @echo srsfiles weg!
+
+killres:
+.IF "$(RESLIB1TARGETN)$(RESLIB2TARGETN)$(RESLIB3TARGETN)$(RESLIB4TARGETN)$(RESLIB5TARGETN)$(RESLIB6TARGETN)$(RESLIB7TARGETN)$(RESLIB8TARGETN)$(RESLIB9TARGETN)"!=""
+ @(COMMAND_ECHO)$(RM) $(RESLIB1TARGETN) $(RESLIB2TARGETN) $(RESLIB3TARGETN) $(RESLIB4TARGETN) $(RESLIB5TARGETN) $(RESLIB6TARGETN) $(RESLIB7TARGETN) $(RESLIB8TARGETN) $(RESLIB9TARGETN)
+ @echo resource files removed!
+.ELSE # "$(RESLIB1TARGETN)$(RESLIB2TARGETN)$(RESLIB3TARGETN)$(RESLIB4TARGETN)$(RESLIB5TARGETN)$(RESLIB6TARGETN)$(RESLIB7TARGETN)$(RESLIB8TARGETN)$(RESLIB9TARGETN)"!=""
+ @echo no resource files defined!
+.ENDIF # "$(RESLIB1TARGETN)$(RESLIB2TARGETN)$(RESLIB3TARGETN)$(RESLIB4TARGETN)$(RESLIB5TARGETN)$(RESLIB6TARGETN)$(RESLIB7TARGETN)$(RESLIB8TARGETN)$(RESLIB9TARGETN)"!=""
+
+killdef:
+.IF "$(DEFTARGETN)" != ""
+ @(COMMAND_ECHO)$(RM) $(DEFTARGETN)
+.ENDIF
+ @echo deffiles weg!
+
+killlib:
+.IF "$(LIB1TARGETN)$(LIB2TARGETN)$(LIB3TARGETN)$(LIB4TARGETN)$(LIB5TARGETN)$(LIB6TARGETN)$(LIB7TARGETN)$(LIB8TARGETN)$(LIB9TARGETN)"!=""
+ @(COMMAND_ECHO)$(RM) $(LIB1TARGETN) $(LIB2TARGETN) $(LIB3TARGETN) $(LIB4TARGETN) $(LIB5TARGETN) $(LIB6TARGETN) $(LIB7TARGETN) $(LIB8TARGETN) $(LIB9TARGETN)
+.IF "$(LIB1ARCHIV)$(LIB2ARCHIV)$(LIB3ARCHIV)$(LIB4ARCHIV)$(LIB5ARCHIV)$(LIB6ARCHIV)$(LIB7ARCHIV)$(LIB8ARCHIV)$(LIB9ARCHIV)"!=""
+ @(COMMAND_ECHO)$(RM) $(LIB1ARCHIV) $(LIB2ARCHIV) $(LIB3ARCHIV) $(LIB4ARCHIV) $(LIB5ARCHIV) $(LIB6ARCHIV) $(LIB7ARCHIV) $(LIB8ARCHIV) $(LIB9ARCHIV)
+.ENDIF # "$(LIB1ARCHIV)$(LIB2ARCHIV)$(LIB3ARCHIV)$(LIB4ARCHIV)$(LIB5ARCHIV)$(LIB6ARCHIV)$(LIB7ARCHIV)$(LIB8ARCHIV)$(LIB9ARCHIV)"!=""
+ @echo lib/archive files removed!
+.ENDIF # "$(LIB1TARGETN)$(LIB2TARGETN)$(LIB3TARGETN)$(LIB4TARGETN)$(LIB5TARGETN)$(LIB6TARGETN)$(LIB7TARGETN)$(LIB8TARGETN)$(LIB9TARGETN)"!=""
+.IF "$(SLOTARGET)$(OBJTARGET)"!=""
+ @(COMMAND_ECHO)$(RM) $(SLOTARGET) $(OBJTARGET)
+ @echo default lib files removed!
+.ENDIF # "$(SLOTARGET)$(OBJTARGET)"!=""
+ @echo done!
+
+clean_misc :
+.IF "$(MISC)"!=""
+ rm -rf $(MISC)/*
+ @echo misc is gone!
+.ELSE # "$(MISC)"!=""
+ @echo can\'t be done! $$(MISC) not defined.
+.ENDIF # "$(MISC)"!=""
+
+clean_all :
+.IF "$(OUT)"!=""
+ test -f $(PRJ)/prj/build.lst && rm -rf $(OUT)
+ @echo local output tree is gone!
+.ELSE # "$(OUT)"!=""
+ @echo can\'t be done! $$(OUT) not defined.
+.ENDIF # "$(OUT)"!=""
+
+
+SRCALLTARGET: \
+ $(SDITARGET) $(SDI1TARGET) $(SDI2TARGET) \
+ $(SDI3TARGET) $(SDI4TARGET) $(SDI5TARGET) \
+ $(SRC1TARGET) \
+ $(SRC2TARGET) \
+ $(SRC3TARGET) $(RCTARGET) \
+ $(SRC4TARGET) $(SRC5TARGET) $(SRC6TARGET) \
+ $(SRC7TARGET) $(SRC8TARGET) $(SRC9TARGET) \
+ $(SRC10TARGET) $(SRC11TARGET) $(SRC12TARGET) \
+ $(SRC13TARGET) $(SRC14TARGET) $(SRC15TARGET) \
+ $(SRC16TARGET)
+
+.IF "$(ZIP1TARGETN)$(ZIP2TARGETN)$(ZIP3TARGETN)$(ZIP4TARGETN)$(ZIP5TARGETN)$(ZIP6TARGETN)$(ZIP7TARGETN)$(ZIP8TARGETN)$(ZIP9TARGETN)"!=""
+ZIPALLTARGET: \
+ $(ZIP1TARGETN) \
+ $(ZIP2TARGETN) \
+ $(ZIP3TARGETN) \
+ $(ZIP4TARGETN) \
+ $(ZIP5TARGETN) \
+ $(ZIP6TARGETN) \
+ $(ZIP7TARGETN) \
+ $(ZIP8TARGETN) \
+ $(ZIP9TARGETN)
+.ELSE
+ZIPALLTARGET:
+.IF "$(VERBOSE)" != "FALSE"
+ @echo ---------------------------------------
+.ENDIF
+ @echo nothing to zip for activated languages!
+.IF "$(VERBOSE)" != "FALSE"
+ @echo ---------------------------------------
+.ENDIF
+.ENDIF
+
+
+#temporary workaround for non-existing delzip in extras
+delzip:
+ @echo
+ @echo ERROR: ZIPnTARGETS need a file named "delzip" to exist beside their makefile.mk
+ @echo ERROR: Create an empty file named delzip and commit it
+ @echo ERROR: for details see #i78434#
+ force_dmake_to_error
+
+.IF "$(make_srs_deps)"==""
+$(MISC)/$(TARGET).dpr : $(SRCFILES) $(SRC1FILES) $(SRC2FILES) $(SRC3FILES)
+.ENDIF
+
+.IF "$(make_zip_deps)"==""
+$(MISC)/$(TARGET).dpz $(ZIPDEPPHONY) : $(ZIP1TARGETN) $(ZIP2TARGETN) $(ZIP3TARGETN) $(ZIP4TARGETN) $(ZIP5TARGETN) $(ZIP6TARGETN) $(ZIP7TARGETN) $(ZIP8TARGETN) $(ZIP9TARGETN)
+.ENDIF
+
+VERSIONTMP:=$(mktmp iii)
+$(INCCOM)/%_version.h : $(SOLARVERSION)/$(INPATH)/inc$(UPDMINOREXT)/minormkchanged.flg
+ @echo $(EMQ)#define _BUILD $(EMQ)"$(BUILD)$(EMQ)" > $(VERSIONTMP)
+ @echo $(EMQ)#define _UPD $(EMQ)"$(UPD)$(EMQ)" >> $(VERSIONTMP)
+ @echo $(EMQ)#define _LAST_MINOR $(EMQ)"$(LAST_MINOR)$(EMQ)" >> $(VERSIONTMP)
+ @echo $(EMQ)#define _RSCREVISION $(EMQ)"$(USQ)$(RSCREVISION)$(USQ)$(EMQ)" >> $(VERSIONTMP)
+ @echo $(EMQ)#define _INPATH $(EMQ)"$(INPATH)$(EMQ)" >> $(VERSIONTMP)
+ @@-$(RM) $(@)_$(VERSIONTMP:b)
+ @$(TYPE) $(VERSIONTMP) > $(@)_$(VERSIONTMP:b)
+ @@-$(RM) $@
+ @-$(RENAME) $(@)_$(VERSIONTMP:b) $@
+
+.IF "$(MAKEFILERC)"==""
+warn_target_empty:
+ @echo '*'
+ @echo '* error $$(TARGET) is empty - this will cause problems'
+ @echo '*'
+ force_dmake_to_error
+.ELSE
+warn_target_empty:
+ @echo generated makefile.rc detected
+.ENDIF
+
+.IF "$(UNOTYPES)" != ""
+UNOUCRDEPxxx : $(UNOUCRDEP);
+.ENDIF # "$(UNOTYPES)" != ""
+
+
+##new hid.lst trigger with GEN_HID2=TRUE
+#$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/hid.lst .PHONY :
+# @echo "Making: " $@
+# @echo $(WORK_STAMP).$(LAST_MINOR) 010101010101010 > $@.$(ROUT).tmp
+# $(COMMAND_ECHO)$(TYPE) $(SOLARCOMMONBINDIR)/hid/*.hid | tr -d "\015" | $(SORT) -u >> $@.$(ROUT).tmp
+# @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $@ $(FI)
+# @-$(RENAME) $@.$(ROUT).tmp $@
+# @-mkdir $(@:d)hid
+# $(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/gen_userfeedback_VCL_names.pl $@ $(SOLARCOMMONBINDIR)/win $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/hid/userfeedback_VCL_names.csv.$(ROUT).tmp
+# @$(IFEXIST) $@ $(THEN) $(RM:s/+//) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/hid/userfeedback_VCL_names.csv $(FI)
+# @-$(RENAME) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/hid/userfeedback_VCL_names.csv.$(ROUT).tmp $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/hid/userfeedback_VCL_names.csv
+
+
+.IF "$(SOLAR_JAVA)"!=""
+.IF "$(JAVACLASSFILES:s/DEFINED//)$(javauno)"!=""
+.INCLUDE : tg_java.mk
+.ENDIF # "$(JAVACLASSFILES:s/DEFINED//)$(javauno)"!=""
+.ENDIF # "$(SOLAR_JAVA)"!=""
+
+.INCLUDE : tg_merge.mk
+.INCLUDE : tg_propmerge.mk
+.INCLUDE : tg_xmerge.mk
+
+wordcount:
+ wc *.* >> $(TMP)/wc.lst
+
+testt:
+ @echo test
+
+.ELSE # "$(depend)" == ""
+
+# ----------
+# - DEPEND -
+# ----------
+
+ALLTAR : ALLDEP \
+ $(SUBDIRS)
+
+# same block as in regular build
+.IF "$(MAKEFILERC)"==""
+.IF "$(RCFILES)$(SLOFILES)$(OBJFILES)$(DEPOBJFILES)$(PARFILES)" != ""
+.IF "$(DEPFILES)" != ""
+.INCLUDE : $(DEPFILES)
+.ENDIF # "$(DEPFILES)" != ""
+.IF "$(nodep)"==""
+.IF "$(DEPCOLLECT_SLO)" != ""
+.PHONY : $(DEPCOLLECT_SLO)
+.INCLUDE .IGNORE : $(DEPCOLLECT_SLO)
+.INCLUDE : $(DEPFILE_SLO)
+.ENDIF # "$(DEPCOLLECT_SLO)" != ""
+.IF "$(DEPCOLLECT_OBJ)" != ""
+.PHONY : $(DEPCOLLECT_OBJ)
+.INCLUDE .IGNORE : $(DEPCOLLECT_OBJ)
+.INCLUDE : $(DEPFILE_OBJ)
+.ENDIF # "$(DEPCOLLECT_OBJ)" != ""
+.ENDIF # "$(nodep)"==""
+.ENDIF # "$(RCFILES)$(SLOFILES)$(OBJFILES)$(DEPOBJFILES)$(PARFILES)" != ""
+.ELSE # MAKEFILERC
+.ENDIF # MAKEFILERC
+
+.INCLUDE : tg_dep.mk
+
+.ENDIF # "$(depend)" == ""
+
+.IF "$(SUBDIRS)"!=""
+
+$(SUBDIRS) : $(SUBDIRSDEPS)
+
+.IF "$(mk_tmp)$(BSCLIENT)"!=""
+$(SUBDIRS) .PHONY :
+ @echo ignoring SUBDIRS
+
+.ELSE # "$(mk_tmp)$(BSCLIENT)"!=""
+#.IF "$(PRJNAME)"!="sw"
+.IF "$(GUI)"!="UNX"
+$(SUBDIRS) .PHONY :
+ @[
+ cd $@
+ cd
+ @$(MAKECMD) subdmake=true $(MFLAGS) $(CALLMACROS)
+ ]
+.ELSE # "$(GUI)"!="UNX"
+$(SUBDIRS) .PHONY :
+ cd $@; $(MAKECMD) subdmake=true $(MFLAGS) $(CALLMACROS)
+.ENDIF # "$(GUI)"!="UNX"
+#.ENDIF
+.ENDIF # "$(mk_tmp)$(BSCLIENT)"!=""
+.ENDIF # "$(SUBDIRS)"!=""
+
+# workaround for strange dmake bug:
+# if the previous block was a rule or a target, "\#" isn't recognized
+# as an escaped "#". if it was an assignment, escaping works...
+some_unique_variable_name:=1
diff --git a/solenv/inc/templates/extension_tmpl.mk b/solenv/inc/templates/extension_tmpl.mk
new file mode 100644
index 000000000000..b9ea7db7ee76
--- /dev/null
+++ b/solenv/inc/templates/extension_tmpl.mk
@@ -0,0 +1,153 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+############################################
+#
+# sample makefile for extension packing
+#
+# NOTE: not all of this is required or useful
+# for every specific case
+#
+############################################
+
+PRJ=..$/..
+
+PRJNAME=my_project
+TARGET=some_unique_target
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE: settings.mk
+# it might be useful to have an extension wide include to set things
+# like the EXTNAME variable (used for configuration processing)
+# .INCLUDE : $(PRJ)$/source$/<extension name>$/<extension_name>.pmk
+
+# --- Files --------------------------------------------------------
+
+# name for uniq directory
+EXTENSIONNAME:=MyExtension
+EXTENSION_ZIPNAME:=MyExtension
+
+.IF "$(ENABLE_MYEXTENSION)" != "YES"
+@all:
+ @echo "$(EXTENSIONNAME) - extension disabled."
+.ENDIF
+.IF "$(SOLAR_JAVA)"==""
+@all:
+ @echo "$(EXTENSIONNAME) - extension requires java."
+.ENDIF
+
+
+# some other targets to be done
+
+
+
+# --- Extension packaging ------------------------------------------
+
+# these variables are optional and defaulted to the current directory
+
+DESCRIPTION_SRC:=config$/description.xml
+MANIFEST_SRC:=config$/manifest.xml
+COMPONENT_CONFIGDIR:=config
+
+# ------------------------------------------------------------------
+
+# optional: generated list of .xcu files contained in the extension
+COMPONENT_MANIFEST_GENERIC:=TRUE
+COMPONENT_MANIFEST_SEARCHDIR:=registry
+
+
+# variables to trigger predifined targets
+# just copy:
+COMPONENT_FILES= \
+ $(EXTENSIONDIR)$/xMyExtension$(EXECPOST) \
+ $(EXTENSIONDIR)$/some_local.html
+
+# localized configuration files
+COMPONENT_MERGED_XCU= \
+ $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/Addons.xcu \
+ $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/extension$/MyExtension.xcu
+
+# other configuration files
+COMPONENT_XCU= \
+ $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/Data.xcu
+
+# location of configurationfiles inside extension,
+# "." for flat .xcu files
+#COMPONENT_CONFIGDEST=.
+
+# native libraries
+COMPONENT_LIBRARIES= \
+ $(EXTENSIONDIR)$/$(SHL1TARGET)$(DLLPOST)
+
+# jar files
+COMPONENT_JARFILES = \
+ $(EXTENSIONDIR)$/MyExtension.jar
+
+# disable fetching default OOo license text
+#CUSTOM_LICENSE=my_license.txt
+# override default license destination
+#PACKLICS= $(EXTENSIONDIR)$/registration$/$(CUSTOM_LICENSE)
+
+# -------------------------------
+# variables for own targets specific to this extension; no common
+# target available...
+#
+CONVERTER_FILE= \
+ $(EXTENSIONDIR)$/xMyExtension$(EXECPOST) \
+
+COMPONENT_DIALOGS= \
+ $(EXTENSIONDIR)$/basic$/Module1.xba \
+ $(EXTENSIONDIR)$/basic$/TargetChooser.xdl \
+ $(EXTENSIONDIR)$/basic$/dialog.xlb \
+ $(EXTENSIONDIR)$/basic$/impress.png \
+ $(EXTENSIONDIR)$/basic$/script.xlb \
+ $(EXTENSIONDIR)$/basic$/writer.png
+
+# add own targets to packing dependencies (need to be done before
+# packing the xtension
+EXTENSION_PACKDEPS=$(CONVERTER_FILE) $(COMPONENT_DIALOGS) makefile.mk $(CUSTOM_LICENSE)
+
+# global settings for extension packing
+.INCLUDE : extension_pre.mk
+.INCLUDE : target.mk
+# global targets for extension packing
+.INCLUDE : extension_post.mk
+
+# own targets
+$(CONVERTER_FILE) : $(SOLARBINDIR)$/$$(@:f)
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
+$(COMPONENT_DIALOGS) : dialogs$/$$(@:f)
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
+$(CUSTOM_LICENSE) : my_license.txt
+ @@-$(MKDIRHIER) $(@:d)
+ $(COPY) $< $@
+
diff --git a/solenv/inc/tg_app.mk b/solenv/inc/tg_app.mk
new file mode 100644
index 000000000000..cefdf14db033
--- /dev/null
+++ b/solenv/inc/tg_app.mk
@@ -0,0 +1,316 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#######################################################
+# instructions for linking
+# unroll begin
+
+.IF "$(GUI)" == "OS2" && "$(TARGETTYPE)" == "GUI"
+APP$(TNR)DEF = $(MISC)/$(APP$(TNR)TARGET).def
+.ENDIF
+
+.IF "$(APP$(TNR)LINKTYPE)" != ""
+#must be either STATIC or SHARED
+APP$(TNR)LINKTYPEFLAG=$(APPLINK$(APP$(TNR)LINKTYPE))
+.ENDIF
+
+# decide how to link
+.IF "$(APP$(TNR)CODETYPE)"=="C"
+APP$(TNR)LINKER=$(LINKC)
+APP$(TNR)STDLIB=$(subst,CPPRUNTIME, $(STDLIB))
+APP$(TNR)LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(APP$(TNR)CODETYPE)"=="C"
+APP$(TNR)LINKER=$(LINK)
+APP$(TNR)STDLIB=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDLIB))
+APP$(TNR)LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(APP$(TNR)CODETYPE)"=="C"
+
+APP$(TNR)RPATH*=OOO
+LINKFLAGSRUNPATH_$(APP$(TNR)RPATH)*=/ERROR:/Bad_APP$(TNR)RPATH_value
+.IF "$(OS)" != "MACOSX"
+APP$(TNR)LINKFLAGS+=$(LINKFLAGSRUNPATH_$(APP$(TNR)RPATH))
+.ENDIF
+
+.IF "$(APP$(TNR)STACK)" != ""
+.IF "$(LINKFLAGSTACK)" != ""
+APP$(TNR)STACKN=$(LINKFLAGSTACK)$(APP$(TNR)STACK)
+.ENDIF
+.ELSE
+APP$(TNR)STACKN=
+.ENDIF
+
+.IF "$(APP$(TNR)NOSAL)"==""
+.IF "$(TARGETTYPE)" == "GUI"
+APP$(TNR)OBJS+= $(STDOBJVCL)
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)$(COM)" == "WNTGCC"
+APP$(TNR)RESO=
+.IF "$(APP$(TNR)LINKRES)" != "" || "$(APP$(TNR)RES)" != ""
+APP$(TNR)RESO=$(MISC)/$(APP$(TNR)TARGET:b)_res.o
+.ENDIF
+.ENDIF
+
+.IF "$(GUI)" == "UNX"
+APP$(TNR)DEPN+:=$(APP$(TNR)DEPNU)
+USE_APP$(TNR)DEF=
+.ENDIF
+
+.IF "$(APP$(TNR)TARGETN)"!=""
+
+.IF "$(APP$(TNR)PRODUCTNAME)"!=""
+APP$(TNR)PRODUCTDEF+:=-DPRODUCT_NAME=\"$(APP$(TNR)PRODUCTNAME)\"
+.ENDIF # "$(APP$(TNR)PRODUCTNAME)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
+.IF "$(APP$(TNR)LIBS)"!=""
+$(MISC)/$(APP$(TNR)TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ sed -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(APP$(TNR)LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF #"$(APP$(TNR)LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(APP$(TNR)TARGETN:b)_linkinc.ls
+$(APP$(TNR)TARGETN) : $(LINKINCTARGETS)
+.ENDIF # "$(linkinc)"!=""
+
+# Allow for target specific LIBSALCPPRT override
+APP$(TNR)LIBSALCPPRT*=$(LIBSALCPPRT)
+
+.IF "$(GUI)" == "OS2"
+_APP$(TNR)IMP_ORD = $(APP$(TNR)STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(APP$(TNR)STDLIBS:^"$(LB)/")
+APP$(TNR)IMP_ORD = $(foreach,i,$(_APP$(TNR)IMP_ORD) $(shell @-ls $i))
+.ELSE
+APP$(TNR)IMP_ORD =
+.ENDIF
+
+$(APP$(TNR)TARGETN): $(APP$(TNR)OBJS) $(APP$(TNR)LIBS) \
+ $(APP$(TNR)RES) \
+ $(APP$(TNR)IMP_ORD) \
+ $(APP$(TNR)ICON) $(APP$(TNR)DEPN) $(USE_APP$(TNR)DEF)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ @-$(RM) $(MISC)/$(@:b).strip
+ @echo $(STDSLO) $(APP$(TNR)OBJS:s/.obj/.o/) \
+ `cat /dev/null $(APP$(TNR)LIBS) | sed s\#$(ROUT)\#$(OUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(APP$(TNR)LINKER) $(APP$(TNR)LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) -o $@ \
+ $(APP$(TNR)LINKTYPEFLAG) $(APP$(TNR)STDLIBS) $(APP$(TNR)STDLIB) $(STDLIB$(TNR)) -filelist $(MISC)/$(@:b).list > $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+# Need to strip __objcInit symbol to avoid duplicate symbols when loading
+# libraries at runtime
+ @-nm $@ | grep -v ' U ' | $(AWK) '{ print $$NF }' | grep -F -x '__objcInit' > $(MISC)/$(@:b).strip
+ @strip -i -R $(MISC)/$(@:b).strip -X $@
+ @ls -l $@
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ app $(APP$(TNR)RPATH) $@
+.IF "$(TARGETTYPE)"=="GUI"
+ @echo "Making: " $(@:f).app
+ @macosx-create-bundle $@
+.ENDIF # "$(TARGETTYPE)"=="GUI"
+.ELSE # "$(OS)"=="MACOSX"
+ @echo unx
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ @echo $(APP$(TNR)LINKER) $(APP$(TNR)LINKFLAGS) $(LINKFLAGSAPP) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP$(TNR)OBJS:s/.obj/.o/) '\' > $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ @cat $(mktmp /dev/null $(APP$(TNR)LIBS)) | xargs -n 1 cat | sed s\#$(ROUT)\#$(OUT)\#g | sed 's#$$# \\#' >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ @echo $(APP$(TNR)LINKTYPEFLAG) $(APP$(TNR)LIBSALCPPRT) $(APP$(TNR)STDLIBS) $(APP$(TNR)STDLIB) $(STDLIB$(TNR)) -o $@ >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+ .ENDIF
+.ENDIF # "$(OS)"=="MACOSX"
+.ENDIF
+.IF "$(GUI)" == "WNT"
+ @@-$(MKDIR) $(@:d:d)
+.IF "$(APP$(TNR)LINKRES)" != ""
+ @@-$(RM) $(MISC)/$(APP$(TNR)LINKRES:b).rc
+.IF "$(APP$(TNR)ICON)" != ""
+ @-echo 1 ICON $(EMQ)"$(APP$(TNR)ICON:s/\/\\/)$(EMQ)" >> $(MISC)/$(APP$(TNR)LINKRES:b).rc
+.ENDIF # "$(APP$(TNR)ICON)" != ""
+.IF "$(APP$(TNR)VERINFO)" != ""
+ @-echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP$(TNR)LINKRES:b).rc
+ @-echo $(EMQ)#include $(EMQ)"$(APP$(TNR)VERINFO)$(EMQ)" >> $(MISC)/$(APP$(TNR)LINKRES:b).rc
+.ENDIF # "$(APP$(TNR)VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(APP$(TNR)PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP$(TNR)LINKRES:b).rc
+.ENDIF # "$(APP$(TNR)LINKRES)" != ""
+.IF "$(COM)" == "GCC"
+ @echo mingw
+.IF "$(APP$(TNR)LINKRES)" != "" || "$(APP$(TNR)RES)" != ""
+ @cat $(APP$(TNR)LINKRES) $(subst,/res/,/res{$(subst,$(BIN), $(@:d))} $(APP$(TNR)RES)) > $(MISC)/$(@:b)_all.res
+ windres $(MISC)/$(@:b)_all.res $(APP$(TNR)RESO)
+.ENDIF
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSAPP) $(MINGWSSTDOBJ) -L$(PRJ)/$(INPATH)/lib $(SOLARLIB) $(STDSLO) \
+ $(APP$(TNR)BASEX) $(APP$(TNR)STACKN) -o $@ $(APP$(TNR)OBJS) \
+ -Wl,-Map,$(MISC)/$(@:b).map $(STDOBJ) $(APP$(TNR)RESO) \
+ `$(TYPE) /dev/null $(APP$(TNR)LIBS) | sed s#$(ROUT)#$(OUT)#g` \
+ $(APP_LINKTYPE) $(APP$(TNR)LIBSALCPPRT) \
+ -Wl,--start-group $(APP$(TNR)STDLIBS) -Wl,--end-group $(APP$(TNR)STDLIB) \
+ $(STDLIB$(TNR)) $(MINGWSSTDENDOBJ) > $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ # need this empty line, else dmake somehow gets confused by the .IFs and .ENDIFs
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ @ls -l $@
+.ELSE # "$(COM)" == "GCC"
+.IF "$(linkinc)" == ""
+ $(COMMAND_ECHO)$(APP$(TNR)LINKER) @$(mktmp \
+ $(APP$(TNR)LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP$(TNR)BASEX) \
+ $(APP$(TNR)STACKN) \
+ -out:$@ \
+ -map:$(MISC)/{$(subst,/,_ $(APP$(TNR)TARGET)).map} \
+ $(STDOBJ) \
+ $(APP$(TNR)LINKRES) \
+ $(APP$(TNR)RES) \
+ $(APP$(TNR)OBJS) \
+ $(APP$(TNR)LIBS) \
+ $(APP$(TNR)STDLIBS) \
+ $(APP$(TNR)STDLIB) $(STDLIB$(TNR)) \
+ )
+ @-echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);1 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);1 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP$(TNR)TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)\$(APP$(TNR)TARGET).lst
+ $(COMMAND_ECHO)-$(RM) $(MISC)\linkobj.lst
+ for %_i in ($(MISC)\*.obj) do type %_i >> $(MISC)\linkobj.lst
+ type $(mktmp,$(MISC)\$(APP$(TNR)TARGET).lst
+ $(APP$(TNR)LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP$(TNR)BASEX) \
+ $(APP$(TNR)STACKN) \
+ -out:$@ \
+ $(STDOBJ) \
+ $(APP$(TNR)LINKRES) \
+ $(APP$(TNR)RES) \
+ $(APP$(TNR)OBJS) \
+ $(APP$(TNR)LIBS) \
+ $(APP$(TNR)STDLIBS) \
+ $(APP$(TNR)STDLIB) $(STDLIB$(TNR)))
+ $(COMMAND_ECHO)$(SED)$(SED) -e 's/\(\.\.\\\)\{2,4\}/..\\/g' $(MISC)\$(APP$(TNR)TARGETN:b)_linkobj.lst >> $(MISC)\$(APP$(TNR)TARGET).lst
+ $(COMMAND_ECHO)$(SED)$(IFEXIST) $(MISC)/$(APP$(TNR)TARGET).lst $(THEN) type $(MISC)/$(APP$(TNR)TARGET).lst >> $(MISC)/$(APP$(TNR)TARGET).lnk $(FI)
+ $(COMMAND_ECHO)$(SED)$(APP$(TNR)LINKER) @$(MISC)\$(APP$(TNR)TARGET).lnk
+.ENDIF # "$(linkinc)" == ""
+.ENDIF # "$(COM)" == "GCC"
+.IF "$(APP$(TNR)TARGET)" == "loader"
+ $(COMMAND_ECHO)$(PERL) loader.pl $@
+ $(COMMAND_ECHO)$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "WNT"
+
+.IF "$(GUI)" == "OS2"
+ @+-$(MKDIR) $(@:d:d) >& $(NULLDEV)
+.IF "$(APP$(TNR)LINKRES)" != ""
+ @+-$(RM) $(MISC)/$(APP$(TNR)LINKRES:b).rc >& $(NULLDEV)
+.IF "$(APP$(TNR)ICON)" != ""
+ @-+$(WRAPCMD) echo 1 ICON $(EMQ)"$(APP$(TNR)ICON)$(EMQ)" | $(SED) 'sX\\X\\\\Xg' >> $(MISC)/$(APP$(TNR)LINKRES:b).rc
+.ENDIF # "$(APP$(TNR)ICON)" != ""
+.IF "$(APP$(TNR)VERINFO)" != ""
+ @-+echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(APP$(TNR)LINKRES:b).rc
+ @-+echo $(EMQ)#include $(EMQ)"$(APP$(TNR)VERINFO)$(EMQ)" >> $(MISC)/$(APP$(TNR)LINKRES:b).rc
+.ENDIF # "$(APP$(TNR)VERINFO)" != ""
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(APP$(TNR)PRODUCTDEF) -I$(SOLARRESDIR) $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(APP$(TNR)LINKRES:b).rc
+.ENDIF # "$(APP$(TNR)LINKRES)" != ""
+
+.IF "$(TARGETTYPE)" == "GUI"
+ @echo NAME $(APP$(TNR)TARGET) WINDOWAPI > $(MISC)/$(APP$(TNR)TARGET).def
+.ENDIF
+
+ .IF "$(VERBOSE)" == "TRUE"
+ @+echo $(APP$(TNR)LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP$(TNR)BASEX) \
+ $(APP$(TNR)STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP$(TNR)LINKRES) \
+ $(APP$(TNR)RES) \
+ $(APP$(TNR)DEF) \
+ $(APP$(TNR)OBJS) \
+ $(APP$(TNR)LIBS) \
+ $(APP$(TNR)STDLIBS:^"-l") \
+ $(APP$(TNR)STDLIB:^"-l") $(STDLIB$(TNR):^"-l")
+ .ENDIF
+ $(COMMAND_ECHO)$(APP$(TNR)LINKER) -v \
+ $(APP$(TNR)LINKFLAGS) \
+ $(LINKFLAGSAPP) $(APP$(TNR)BASEX) \
+ $(APP$(TNR)STACKN) \
+ -o $@ \
+ -Zmap -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(STDOBJ) \
+ $(APP$(TNR)LINKRES) \
+ $(APP$(TNR)RES) \
+ $(APP$(TNR)DEF) \
+ $(APP$(TNR)OBJS) \
+ $(APP$(TNR)LIBS) \
+ $(APP$(TNR)STDLIBS:^"-l") \
+ $(APP$(TNR)STDLIB:^"-l") $(STDLIB$(TNR):^"-l")
+
+
+.IF "$(APP$(TNR)TARGET)" == "loader"
+ $(COMMAND_ECHO)+$(PERL) loader.pl $@
+ $(COMMAND_ECHO)+$(TYPE) $(@) $(@:d)unloader.exe > $(@:d)_new.exe
+ $(COMMAND_ECHO)+$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $(@:d)_new.exe $(@:d)loader.exe
+.ENDIF # "$(TARGET)" == "setup"
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(APP$(TNR)TARGETN)"!=""
+
+
+# Instruction for linking
+# unroll end
+#######################################################
+
diff --git a/solenv/inc/tg_compv.mk b/solenv/inc/tg_compv.mk
new file mode 100644
index 000000000000..c68ae5af430e
--- /dev/null
+++ b/solenv/inc/tg_compv.mk
@@ -0,0 +1,158 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+COMPVERMK:=$(SOLARINCDIR)/comp_ver.mk
+
+.INCLUDE .IGNORE : $(COMPVERMK)
+
+.IF "$(COMNAME)"=="" || "$(COMPATH:s!\!/!)"!="$(COMPATH_STORED)"
+.IF "$(L10N_framework)"==""
+
+COMNAME:=
+
+.IF "$(COM)"=="GCC"
+CFLAGSVERSION=-dumpversion
+CFLAGSVERSION_CMD=-dumpversion
+CFLAGSNUMVERSION_CMD=-dumpversion $(PIPEERROR) $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
+#CFLAGSNUMVERSION_CMD=-dumpversion | 2>&1 $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
+.ENDIF
+
+.IF "$(COM)"=="MSC"
+CFLAGSVERSION=
+CFLAGSVERSION_CMD= $(PIPEERROR) $(AWK) -f $(SOLARENV)/bin/getcompver.awk
+CFLAGSNUMVERSION_CMD= $(PIPEERROR) $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
+.ENDIF
+
+.IF "$(COM)"=="C55" || "$(COM)"=="C54" || "$(COM)"=="C52" || "$(COM)"=="C40" || "$(COM)"=="sunpro"
+CFLAGSVERSION= -V
+CFLAGSVERSION_CMD= -V $(PIPEERROR) $(AWK) -f $(SOLARENV)/bin/getcompver.awk
+CFLAGSNUMVERSION_CMD= -V $(PIPEERROR) $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
+.ENDIF
+
+.IF "$(COM)"=="C730"
+CFLAGSVERSION= -version
+CFLAGSVERSION_CMD= -version |& cut -d" " -f4-
+CFLAGSNUMVERSION_CMD= -version |& cut -d" " -f4-
+.ENDIF
+
+# that's the version known by the specific
+# compiler
+CCVER:=$(shell @-$(CXX) $(CFLAGSVERSION_CMD))
+
+# and a computed integer for comparing
+# each point seperated token blown up to 4 digits
+CCNUMVER:=$(shell @-$(CXX) $(CFLAGSNUMVERSION_CMD))
+
+.IF "$(COM)"=="MSC"
+.IF "$(CCNUMVER)">="001200000000"
+COMID=MSC
+COMNAME=msci
+.ENDIF
+.ENDIF
+
+.IF "$(COM)"=="GCC"
+
+SHORTSTDCPP3:=
+SHORTSTDC3:="1"
+
+.IF "$(CCNUMVER)">="000200910000"
+COMID=GCC
+COMNAME=gcc2
+.ENDIF
+
+.IF "$(CCNUMVER)">="000300000001"
+
+COMID=gcc3
+COMNAME=gcc3
+
+.IF "$(CCNUMVER)">="000300000001"
+SHORTSTDCPP3="3"
+.ENDIF
+
+.IF "$(CCNUMVER)">="000300010000"
+SHORTSTDCPP3="4"
+.ENDIF
+
+.IF "$(CCNUMVER)">="000300020000"
+SHORTSTDCPP3="5"
+.ENDIF
+
+.IF "$(CCNUMVER)">="000300040000"
+.IF "$(OS)$(CPU)" == "LINUX6" || "$(OS)$(CPU)" == "LINUXH"
+#for gcc >= 3.4.0 on m68k-linux this is libgcc_s.so.2.
+#for gcc >= 3.4.0 < 4.2.0 on hppa-linux this is libgcc_s.so.2.
+SHORTSTDC3:="2"
+.ENDIF
+SHORTSTDCPP3="6"
+.ENDIF
+
+.IF "$(CCNUMVER)">="000400020000"
+.IF "$(OS)$(CPU)" == "LINUXH"
+#for gcc >= 4.2.0 on hppa-linux this is libgcc_s.so.4.
+SHORTSTDC3:="4"
+.ENDIF
+SHORTSTDCPP3="6"
+.ENDIF
+
+.ENDIF
+.ENDIF
+
+.IF "$(COM)"=="C55" || "$(COM)" == "C54" || "$(COM)"=="C52" || "$(COM)"=="C40" || "$(COM)"=="sunpro"
+.IF "$(CCNUMVER)">="00050002"
+COMID=C52
+COMNAME=sunpro5
+.ENDIF
+.ENDIF
+
+.IF "$(COM)"=="C730"
+COMID=C730
+COMNAME=MipsPro
+.ENDIF
+
+.IF "$(COMNAME)"==""
+
+# "EXCEPTIONSFILES" get compiled before this, but shouldn't
+# appear in the first n modules.
+
+compiler_version_error:
+ @echo ++++++++++++++++++++++++++++++++++++
+ @echo ERROR!
+ @echo Could not detect compiler version!
+ @echo Please extend tg_compv.mk in
+ @echo "solenv/inc".
+ @echo ++++++++++++++++++++++++++++++++++++
+ @echo "$(CXX) $(CFLAGSVERSION)" returns
+ @$(CXX) $(CFLAGSVERSION)
+ @echo ++++++++++++++++++++++++++++++++++++
+ force_dmake_to_error
+
+.ENDIF # "$(COMNAME)"==""
+
+CDEFS+=-DCPPU_ENV=$(COMNAME)
+
+.ENDIF # "$(L10N_framework)"==""
+.ENDIF # "$(COMNAME)"==""
diff --git a/solenv/inc/tg_config.mk b/solenv/inc/tg_config.mk
new file mode 100644
index 000000000000..cfe2fe147ebe
--- /dev/null
+++ b/solenv/inc/tg_config.mk
@@ -0,0 +1,203 @@
+#************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PACKAGEDIR*:=$(subst,.,/ $(PACKAGE))
+XSLTPACKAGEDIR*:=$(subst,.,/ $(PACKAGE))
+XCSROOTURL!:=$(ABSXCSROOT)
+.IF $(GUI)==WNT
+XCSROOTURL!:=file:///$(subst,\,/ $(XCSROOTURL))
+.ENDIF
+SYSXSLDIR*:=$(XSLDIR)/
+.IF $(GUI)==OS2
+XCSROOTURL!:=$(subst,\,/ $(XCSROOTURL))
+SYSXSLDIR!:=$(subst,\,/ $(SYSXSLDIR))/
+.ENDIF
+
+#
+# --- XCS ---
+#
+
+.IF "$(XCSFILES)"!=""
+# remove unnecessary info from the component schemas
+XCS_TRIM=$(PROCESSOUT)/registry/schema/$(PACKAGEDIR)/{$(XCSFILES)}
+
+# transform xcs format to properties format
+# XCS_RESOURCES=$(foreach,i,$(XCSFILES) $(MISC)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/$(i:b).properties)
+
+ALLTAR: \
+ $(XCS_TRIM)
+.ENDIF # "$(XCSFILES)"!=""
+
+.IF "$(XCS_TRIM)" != ""
+$(XCS_TRIM) : $(DTDDIR)/registry/component-schema.dtd \
+ $(XSLDIR)/schema_val.xsl \
+ $(XSLDIR)/sanity.xsl \
+ $(XSLDIR)/schema_trim.xsl
+.ENDIF
+
+$(PROCESSOUT)/registry/schema/$(PACKAGEDIR)/%.xcs : %.xcs
+ @echo "Making: " $(@:f)
+.IF "$(VERBOSE)" != "FALSE"
+ @echo --- validating and stripping schema files
+.ENDIF
+ @-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $(@:d))$*.val) \
+ --stringparam componentName $(PACKAGE).$* \
+ $(SYSXSLDIR)schema_val.xsl $<
+ $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $(@:d))$*.san) \
+ $(SYSXSLDIR)sanity.xsl $<
+ $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
+ $(SYSXSLDIR)schema_trim.xsl $<
+ @+-$(RM) $(@:d)$*.val > $(NULLDEV)
+ @+-$(RM) $(@:d)$*.san > $(NULLDEV)
+
+$(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcs : %.xcs
+# just a copy for now - insert "cfgex" commandline when required
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(COPY) $< $@
+
+# Create properties files for localized <info> contents (Currently not built)
+.IF "$(XCS_RESOURCES)" != ""
+$(XCS_RESOURCES) : $(XSLDIR)/resource.xsl
+.ENDIF
+
+$(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/%.properties :| $(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcs
+ @echo "Making: " $(@:f)
+.IF "$(VERBOSE)" != "FALSE"
+ @echo --- creating locale dependent resource bundles
+.ENDIF
+ @-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
+ --stringparam locale {$(subst,/$(PACKAGEDIR)/$(@:f), $(subst,$(PROCESSOUT)/registry/res/, $@))} \
+ $(SYSXSLDIR)resource.xsl $<
+
+#
+# --- XCU ---
+#
+
+.IF "$(XCUFILES)"!=""
+XCU_DEFAULT =$(PROCESSOUT)/registry/data/$(PACKAGEDIR)/{$(XCUFILES)}
+XCU_MODULES =$(foreach,i,$(MODULEFILES) $(PROCESSOUT)/registry/spool/$(PACKAGEDIR)/$(i))
+XCU_LANG =$(foreach,i,$(LOCALIZEDFILES) $(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/$(i))
+.ENDIF # "$(XCUFILES)"!=""
+
+.IF "$(XCU_DEFAULT)" != ""
+$(XCU_DEFAULT) : $(DTDDIR)/registry/component-update.dtd \
+ $(XSLDIR)/data_val.xsl \
+ $(XSLDIR)/alllang.xsl
+.ENDIF
+
+$(PROCESSOUT)/registry/data/$(PACKAGEDIR)/%.xcu : %.xcu
+ @echo "Making: " $(@:f)
+.IF "$(VERBOSE)" != "FALSE"
+ @echo --- validating and creating a locale independent file
+.ENDIF
+ @-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $(@:d))$*.val) \
+ --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$*.xcs \
+ --stringparam schemaRoot $(XCSROOTURL)/registry/schema \
+ --path $(DTDDIR)/registry \
+ $(SYSXSLDIR)data_val.xsl $<
+ $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
+ --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$*.xcs \
+ --stringparam schemaRoot $(XCSROOTURL)/registry/schema \
+ --path $(DTDDIR)/registry \
+ $(SYSXSLDIR)alllang.xsl $<
+ @+-$(RM) $(@:d)$*.val > $(NULLDEV)
+
+# --- localizations ---
+.IF "$(WITH_LANG)"!=""
+.IF "$(XCU_LANG)"!=""
+$(XCU_LANG) : $(LOCALIZESDF)
+.ENDIF # "$(XCU_LANG)"!=""
+
+$(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcu : %.xcu
+ @-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(CFGEX) -p $(PRJNAME) -i $(@:f) -o $@ -m $(LOCALIZESDF) -l all
+
+.IF "$(XCU_LANG)" != ""
+$(XCU_LANG) : $(XSLDIR)/alllang.xsl
+.ENDIF
+
+$(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/%.xcu :| $(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcu
+.ELSE # "$(WITH_LANG)"!=""
+$(PROCESSOUT)/registry/res/{$(alllangiso)}/$(PACKAGEDIR)/%.xcu :| %.xcu
+.ENDIF # "$(WITH_LANG)"!=""
+ @echo "Making: " $(@:f)
+.IF "$(VERBOSE)" != "FALSE"
+ @echo --- creating locale dependent entries
+.ENDIF
+ @-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
+ --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$*.xcs \
+ --stringparam schemaRoot $(XCSROOTURL)/registry/schema \
+ --stringparam locale {$(subst,/$(PACKAGEDIR)/$(@:f), $(subst,$(PROCESSOUT)/registry/res/, $@))} \
+ --path $(DTDDIR)/registry \
+ $(SYSXSLDIR)alllang.xsl $<
+
+# --- languagepack tag modules ---
+.IF "$(LANGUAGEPACKS)" != ""
+$(LANGUAGEPACKS) : $(XSLDIR)/delcomment.sed
+.ENDIF
+
+
+$(PROCESSOUT)/registry/spool/Langpack-%.xcu : Langpack.xcu.tmpl
+.IF "$(VERBOSE)" != "FALSE"
+ @echo --- creating a Langpack module for locale $*
+.ENDIF
+ -$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(SED) -e "s/__LANGUAGE__/$*/" -f $(XSLDIR)/delcomment.sed $< > $@
+
+
+# --- modules ---
+.IF "$(XCU_MODULES)" != ""
+$(XCU_MODULES) : $(XSLDIR)/alllang.xsl
+.ENDIF
+
+
+$(PROCESSOUT)/registry/spool/$(PACKAGEDIR)/%.xcu :| $$(@:b:s/-/./:b).xcu
+ @echo "Making: " $(@:f)
+.IF "$(VERBOSE)" != "FALSE"
+ @echo --- creating a module file
+.ENDIF
+ @-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)$(XSLTPROC) --nonet -o $(normpath $(subst,$(PATH_IN_MODULE), $(PWD))/$(subst,$(PRJ), $@)) \
+ --stringparam xcs $(XCSROOTURL)/registry/schema/$(XSLTPACKAGEDIR)/$(<:b).xcs \
+ --stringparam schemaRoot $(XCSROOTURL)/registry/schema \
+ --stringparam module $(subst,$(<:b)-, $(*)) \
+ $(SYSXSLDIR)alllang.xsl $<
+
+.IF "$(XCUFILES)"!=""
+ALLTAR: \
+ $(XCU_DEFAULT) \
+ $(XCU_MODULES) \
+ $(XCU_LANG)
+
+$(XCU_DEFAULT) : $$(@:d:s!$(PROCESSOUT)/registry/data/!$(ABSXCSROOT)/registry/schema/!)$$(@:f:s/.xcu/.xcs/)
+
+.ENDIF # "$(XCUFILES)"!=""
+
diff --git a/solenv/inc/tg_def.mk b/solenv/inc/tg_def.mk
new file mode 100644
index 000000000000..0bbd1f6b1ab1
--- /dev/null
+++ b/solenv/inc/tg_def.mk
@@ -0,0 +1,313 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#######################################################
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(DEF$(TNR)TARGETN)"!=""
+
+#to make intuitiv naming work
+.IF "$(DEF$(TNR)LIBNAME)"!=""
+DEFLIB$(TNR)NAME*=$(DEF$(TNR)LIBNAME)
+.ENDIF # "$(DEF$(TNR)LIBNAME)"!=""
+
+.IF "$(DEFLIB$(TNR)NAME)"!=""
+DEF$(TNR)DEPN+=$(foreach,i,$(DEFLIB$(TNR)NAME) $(SLB)/$(i).lib)
+.ENDIF
+
+.IF "$(SHL$(TNR)VERSIONMAP)"!=""
+.IF "$(DEF$(TNR)EXPORTFILE)"==""
+.IF "$(GUI)"=="WNT"
+DEF$(TNR)EXPORTFILE=$(MISC)/$(SHL$(TNR)VERSIONMAP:b)_$(SHL$(TNR)TARGET).dxp
+.IF "$(COM)"=="GCC"
+$(DEF$(TNR)EXPORTFILE) : $(SHL$(TNR)OBJS) $(SHL$(TNR)LIBS)
+.ENDIF # .IF "$(COM)"=="GCC"
+
+$(DEF$(TNR)EXPORTFILE) : $(SHL$(TNR)VERSIONMAP)
+ $(COMMAND_ECHO)$(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)-$(GREP) -v "\*\|?" $@ | $(SED) -e 's@#.*@@' > $@.exported-symbols
+ $(COMMAND_ECHO)-$(GREP) "\*\|?" $@ > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+ $(COMMAND_ECHO)nm -gP $(SHL$(TNR)OBJS) \
+ `$(TYPE) /dev/null $(foreach,j,$(SHL$(TNR)LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)$/$(ROUT)\#g` \
+ | $(SOLARENV)/bin/addsym-mingw.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ $(COMMAND_ECHO)$(RENAME) $@.exported-symbols $@
+.ENDIF # .IF "$(COM)"=="GCC"
+
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+DEF$(TNR)EXPORTFILE=$(MISC)/$(SHL$(TNR)VERSIONMAP:b)_$(SHL$(TNR)TARGET).dxp
+$(DEF$(TNR)EXPORTFILE) : $(SHL$(TNR)VERSIONMAP)
+ $(TYPE) $< | $(AWK) -f $(SOLARENV)/bin/getcsym.awk > $@
+.ENDIF # "$(GUI)"=="OS2"
+
+.ENDIF # "$(DEF$(TNR)EXPORTFILE)"==""
+.ENDIF # "$(SHL$(TNR)VERSIONMAP)"!=""
+
+.IF "$(GUI)"=="WNT"
+
+DEF$(TNR)FILTER=$(SOLARENV)/inc/dummy.flt
+
+RMHACK$(TNR):=$(RM)
+
+.IF "$(DEF$(TNR)CEXP)"!=""
+EXPORT_ALL_SWITCH=-A $(DEF$(TNR)CEXP)
+.ENDIF
+
+.IF "$(link_always)"==""
+$(DEF$(TNR)TARGETN) : \
+ $(DEF$(TNR)DEPN) \
+ $(DEF$(TNR)EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF$(TNR)TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(EMQ)"$(SHL$(TNR)TARGETN:f)$(EMQ)" >$@.tmpfile
+.IF "$(COM)"!="GCC"
+ @echo HEAPSIZE 0 >>$@.tmpfile
+.ENDIF
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo GetVersionInfo >>$@.tmpfile
+.ENDIF
+.IF "$(DEFLIB$(TNR)NAME)"!=""
+.IF "$(COM)"=="GCC"
+ @-$(RM) $(MISC)/$(SHL$(TNR)TARGET).exp
+ $(COMMAND_ECHO)dlltool --output-def $(MISC)/$(SHL$(TNR)TARGET).exp --export-all-symbols \
+ `$(TYPE) $(foreach,i,$(DEFLIB$(TNR)NAME) $(SLB)/$(i).lib) | sed s#$(ROUT)#$(PRJ)/$(ROUT)#g`
+ $(COMMAND_ECHO)tail --lines +3 $(MISC)/$(SHL$(TNR)TARGET).exp | sed '/^;/d' >>$@.tmpfile
+ @-$(RM) $(MISC)/$(SHL$(TNR)TARGET).exp
+.ELSE
+.IF "$(SHL$(TNR)USE_EXPORTS)"==""
+ @-$(RMHACK$(TNR)) $(MISC)/$(SHL$(TNR)TARGET).exp
+ @$(LIBMGR) -EXTRACT:/ /OUT:$(MISC)/$(SHL$(TNR)TARGET).exp $(SLB)/$(DEFLIB$(TNR)NAME).lib
+ @$(LDUMP2) -N $(EXPORT_ALL_SWITCH) -F $(MISC)/$(SHL$(TNR)TARGET).flt $(MISC)/$(SHL$(TNR)TARGET).exp >>$@.tmpfile
+ $(COMMAND_ECHO)$(RMHACK$(TNR)) $(MISC)/$(SHL$(TNR)TARGET).exp
+.ELSE # "$(SHL$(TNR)USE_EXPORTS)"==""
+ @$(DUMPBIN) -DIRECTIVES $(foreach,i,$(DEFLIB$(TNR)NAME) $(SLB)/$(i).lib) | $(GREP) EXPORT: > $(MISC)/$(SHL$(TNR)TARGET).direct
+ @$(LDUMP2) -N -D $(EXPORT_ALL_SWITCH) -F $(DEF$(TNR)FILTER) $(MISC)/$(SHL$(TNR)TARGET).direct >>$@.tmpfile
+.ENDIF # "$(SHL$(TNR)USE_EXPORTS)"==""
+.ENDIF
+.ENDIF # "$(DEFLIB$(TNR)NAME)"!=""
+.IF "$(DEF$(TNR)EXPORT1)"!=""
+ @echo $(DEF$(TNR)EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT2)"!=""
+ @echo $(DEF$(TNR)EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT3)"!=""
+ @echo $(DEF$(TNR)EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT4)"!=""
+ @echo $(DEF$(TNR)EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT5)"!=""
+ @echo $(DEF$(TNR)EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT6)"!=""
+ @echo $(DEF$(TNR)EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT7)"!=""
+ @echo $(DEF$(TNR)EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT8)"!=""
+ @echo $(DEF$(TNR)EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT9)"!=""
+ @echo $(DEF$(TNR)EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT10)"!=""
+ @echo $(DEF$(TNR)EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT11)"!=""
+ @echo $(DEF$(TNR)EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT12)"!=""
+ @echo $(DEF$(TNR)EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT13)"!=""
+ @echo $(DEF$(TNR)EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT14)"!=""
+ @echo $(DEF$(TNR)EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT15)"!=""
+ @echo $(DEF$(TNR)EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT16)"!=""
+ @echo $(DEF$(TNR)EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT17)"!=""
+ @echo $(DEF$(TNR)EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT18)"!=""
+ @echo $(DEF$(TNR)EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT19)"!=""
+ @echo $(DEF$(TNR)EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT20)"!=""
+ @echo $(DEF$(TNR)EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORTFILE)"!=""
+.IF "$(COM)"=="GCC"
+ $(COMMAND_ECHO)$(TYPE) $(DEF$(TNR)EXPORTFILE) | sed -e s:PRIVATE:: >> $@.tmpfile
+.ELSE
+ $(COMMAND_ECHO)$(TYPE) $(DEF$(TNR)EXPORTFILE) >> $@.tmpfile
+.ENDIF
+.ENDIF
+ @-$(RM) $@
+ @$(RENAME) $@.tmpfile $@
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL$(TNR)TARGET8=$(shell @fix_shl $(SHL$(TNR)TARGETN:f))
+
+DEF$(TNR)FILTER=$(SOLARENV)/inc/dummy.flt
+DEF$(TNR)NAMELIST=$(foreach,i,$(DEFLIB$(TNR)NAME) $(SLB)/$(i).lib)
+
+.IF "$(link_always)"==""
+$(DEF$(TNR)TARGETN) : \
+ $(DEF$(TNR)DEPN) \
+ $(DEF$(TNR)EXPORTFILE)
+.ELSE # "$(link_always)"==""
+$(DEF$(TNR)TARGETN) .PHONY :
+.ENDIF # "$(link_always)"==""
+ @+-$(RM) $@.tmpfile
+ @echo "Making: module definition file" $(@:f)
+ @echo LIBRARY $(SHL$(TNR)TARGET8) INITINSTANCE TERMINSTANCE >$@.tmpfile
+ @echo DATA MULTIPLE >>$@.tmpfile
+ @echo DESCRIPTION 'StarView 3.00 $(DEF$(TNR)DES) $(UPD) $(UPDMINOR)' >>$@.tmpfile
+ @echo EXPORTS >>$@.tmpfile
+.IF "$(VERSIONOBJ)"!=""
+# getversioninfo fuer alle!!
+ @echo _GetVersionInfo >$@.tmp_ord
+.ENDIF
+
+.IF "$(DEFLIB$(TNR)NAME)"!=""
+ @+echo $(SLB)/$(DEFLIB$(TNR)NAME).lib
+ @+emxexpr $(DEF$(TNR)NAMELIST) | fix_exp_file >> $@.tmp_ord
+.ENDIF # "$(DEFLIB$(TNR)NAME)"!=""
+
+.IF "$(DEF$(TNR)EXPORT1)"!=""
+ @echo $(DEF$(TNR)EXPORT1) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT2)"!=""
+ @echo $(DEF$(TNR)EXPORT2) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT3)"!=""
+ @echo $(DEF$(TNR)EXPORT3) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT4)"!=""
+ @echo $(DEF$(TNR)EXPORT4) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT5)"!=""
+ @echo $(DEF$(TNR)EXPORT5) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT6)"!=""
+ @echo $(DEF$(TNR)EXPORT6) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT7)"!=""
+ @echo $(DEF$(TNR)EXPORT7) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT8)"!=""
+ @echo $(DEF$(TNR)EXPORT8) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT9)"!=""
+ @echo $(DEF$(TNR)EXPORT9) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT10)"!=""
+ @echo $(DEF$(TNR)EXPORT10) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT11)"!=""
+ @echo $(DEF$(TNR)EXPORT11) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT12)"!=""
+ @echo $(DEF$(TNR)EXPORT12) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT13)"!=""
+ @echo $(DEF$(TNR)EXPORT13) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT14)"!=""
+ @echo $(DEF$(TNR)EXPORT14) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT15)"!=""
+ @echo $(DEF$(TNR)EXPORT15) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT16)"!=""
+ @echo $(DEF$(TNR)EXPORT16) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT17)"!=""
+ @echo $(DEF$(TNR)EXPORT17) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT18)"!=""
+ @echo $(DEF$(TNR)EXPORT18) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT19)"!=""
+ @echo $(DEF$(TNR)EXPORT19) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORT20)"!=""
+ @echo $(DEF$(TNR)EXPORT20) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF$(TNR)EXPORTFILE)"!=""
+ @fix_def_file < $(DEF$(TNR)EXPORTFILE) >> $@.tmp_ord
+.ENDIF
+ @sort < $@.tmp_ord | uniq > $@.exptmpfile
+ @fix_def_ord < $@.exptmpfile >> $@.tmpfile
+ @+-$(RM) $@
+ $(COMMAND_ECHO)+$(RENAME) $@.tmpfile $@
+ @+-$(RM) $@.tmp_ord
+ @+-$(RM) $@.exptmpfile
+ $(COMMAND_ECHO)+$(IMPLIB) $(IMPLIBFLAGS) $(SHL$(TNR)IMPLIBN:s/.lib/.a/) $@
+ $(COMMAND_ECHO)+emxomf -o $(SHL$(TNR)IMPLIBN) $(SHL$(TNR)IMPLIBN:s/.lib/.a/)
+
+.ENDIF # "$(GUI)"=="OS2"
+
+.IF "$(GUI)"=="UNX"
+$(DEF$(TNR)TARGETN): \
+ $(DEF$(TNR)DEPN) \
+ $(DEF$(TNR)EXPORTFILE)
+ @echo just a dummy for UNIX > $@
+.ENDIF
+.ENDIF # "$(DEF$(TNR)TARGETN)"!=""
+
+
+# Anweisungen fuer das Linken
+# unroll end
+#######################################################
+
diff --git a/solenv/inc/tg_dep.mk b/solenv/inc/tg_dep.mk
new file mode 100644
index 000000000000..37517e2f14b8
--- /dev/null
+++ b/solenv/inc/tg_dep.mk
@@ -0,0 +1,96 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+.IF "$(SLOFILES)$(OBJFILES)$(DEPOBJFILES)$(SRCFILES)$(SRC1FILES)$(SRC2FILES)$(SRC3FILES)$(RCFILES)$(HDBDEPNTARGET)$(IDLFILES)$(PARFILES)$(ZIP1TARGET)$(ZIP2TARGET)$(ZIP3TARGET)$(ZIP4TARGET)$(ZIP5TARGET)$(ZIP6TARGET)$(ZIP7TARGET)$(ZIP8TARGET)$(ZIP9TARGET)$(COMP1TYPELIST)$(COMP2TYPELIST)$(COMP3TYPELIST)$(COMP4TYPELIST)$(COMP5TYPELIST)$(COMP6TYPELIST)$(COMP7TYPELIST)$(COMP8TYPELIST)$(COMP9TYPELIST)"!=""
+ALLDEP .PHONY:
+ @-$(IFEXIST) $(SRS)/$(TARGET).*.dpr $(THEN) $(RM:s/+//) $(SRS)/$(TARGET).*.dpr >& $(NULLDEV) $(FI)
+ @@-$(RM) $(MISC)/$(TARGET).dpr
+ @@-$(RM) $(MISC)/$(TARGET).*.dprr
+ @@-$(RM) $(MISC)/$(TARGET).dpj
+ @@-$(RM) $(MISC)/$(TARGET).dpz
+ @@-$(RM) $(MISC)/$(COMP1TYPELIST).mk $(MISC)/$(COMP2TYPELIST).mk $(MISC)/$(COMP3TYPELIST).mk $(MISC)/$(COMP4TYPELIST).mk $(MISC)/$(COMP5TYPELIST).mk $(MISC)/$(COMP6TYPELIST).mk $(MISC)/$(COMP7TYPELIST).mk $(MISC)/$(COMP8TYPELIST).mk $(MISC)/$(COMP9TYPELIST).mk
+.IF "$(nodep)"==""
+.IF "$(DEPFILE_SLO)"!=""
+ @@-$(RM) $(DEPFILE_SLO)
+ $(foreach,i,$(all_local_slo) $(shell @$(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $i ) > $(MISC)/s_$(i:b).dpcc ))
+ $(foreach,i,$(all_misc_slo) $(shell @$(MAKEDEPEND) @$(mktmp -f - -p$(SLO) $(MKDEPFLAGS) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $i ) > $(MISC)/s_$(i:b).dpcc ))
+.ENDIF # "$(DEPFILE_SLO)"!=""
+.IF "$(DEPFILE_OBJ)"!=""
+ @@-$(RM) $(DEPFILE_OBJ)
+ $(foreach,i,$(all_local_obj) $(shell @$(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $i ) > $(MISC)/o_$(i:b).dpcc ))
+ $(foreach,i,$(all_misc_obj) $(shell @$(MAKEDEPEND) @$(mktmp -f - -p$(OBJ) $(MKDEPFLAGS) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $i ) > $(MISC)/o_$(i:b).dpcc ))
+.ENDIF # "$(DEPFILE_OBJ)"!=""
+.ENDIF # "$(nodep)"==""
+.IF "$(DEPFILES)" != ""
+ echo xxx$(DEPFILES)xxx
+ @@-$(RM) $(DEPFILES)
+.ENDIF # "$(DEPFILES)" != ""
+
+
+ALLDPC: \
+ $(DEPFILES) \
+ $(RCFILES) \
+ $(IDLFILES) \
+ $(HDBDEPNTARGET)
+.IF "$(nodep)"!=""
+ @echo NOT-Making: Depend-Lists
+ @echo ttt: ppp > $(MISC)/$(TARGET).dpc
+.ELSE
+ @echo Making : Dependencies
+.IF "$(CFILES)$(CXXFILES)"!=""
+.IF "$(SLOFILES)$(OBJFILES)$(DEPOBJFILES)"==""
+ @echo ++++++++++++++++++++++++++++++++++++++++++++++++
+ @echo something is wrong!!
+ @echo source files but no obj
+ @echo ++++++++++++++++++++++++++++++++++++++++++++++++
+ force_dmake_to_error
+.ENDIF
+.ENDIF
+.IF "$(HDBDEPNTARGET)$(OBJFILES)$(SLOFILES)$(DEPOBJFILES)$(RCFILES)$(PARFILES)"!=""
+ @$(IFEXIST) $(MISC)/$(TARGET).dpj $(THEN) $(RM:s/+//) $(MISC)/$(TARGET).dpj >& $(NULLDEV) $(FI)
+ @$(IFEXIST) $(MISC)/genjava.mk $(THEN) $(RM:s/+//) $(MISC)/genjava.mk >& $(NULLDEV) $(FI)
+ $(TOUCH) $(MISC)/$(TARGET).dpc
+.IF "$($(SECOND_BUILD)_SLOFILES)"!=""
+ @$(TYPE) $(mktmp $(foreach,i,$($(SECOND_BUILD)_SLOFILES) $(i:d:^"\n")$(SECOND_BUILD)_$(i:f) : $i )) >> $(MISC)/$(TARGET).dpc
+.ENDIF
+.IF "$($(SECOND_BUILD)_OBJFILES)"!=""
+ @$(TYPE) $(mktmp $(foreach,i,$($(SECOND_BUILD)_OBJFILES) $(i:d:^"\n")$(SECOND_BUILD)_$(i:f) : $(i:d:s/obj/slo/)$(i:b).obj )) >> $(MISC)/$(TARGET).dpc
+.ENDIF
+.ELSE # "$(HDBDEPNTARGET)$(OBJFILES)$(SLOFILES)$(DEPOBJFILES)$(RCFILES)"!=""
+ @echo ttt: ppp > $(MISC)/$(TARGET).dpc
+.ENDIF # "$(HDBDEPNTARGET)$(OBJFILES)$(SLOFILES)$(DEPOBJFILES)$(RCFILES)"!=""
+.ENDIF # "$(nodep)"!=""
+.ELSE # anything requiring dependencies
+
+ALLDPC:
+ @echo $(EMQ)# > $(MISC)/$(TARGET).dpc
+
+ALLDEP:
+ @echo nothing to do here...
+
+.ENDIF
+
diff --git a/solenv/inc/tg_ext.mk b/solenv/inc/tg_ext.mk
new file mode 100644
index 000000000000..e19c7124d4a7
--- /dev/null
+++ b/solenv/inc/tg_ext.mk
@@ -0,0 +1,362 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+.EXPORT : CC CXX
+
+# setup INCLUDE variable for use by VC++
+.IF "$(GUI)$(COM)"=="WNTMSC"
+.IF "$(EXT_USE_STLPORT)"==""
+INCLUDE!:=. $(subst,/stl, $(SOLARINC))
+.ELSE # "$(EXT_USE_STLPORT)"==""
+INCLUDE!:=. $(SOLARINC)
+.ENDIF # "$(EXT_USE_STLPORT)"==""
+INCLUDE!:=$(INCLUDE:s/ -I/;/)
+.EXPORT : INCLUDE
+.ENDIF # "$(GUI)$(COM)"=="WNTMSC"
+
+.IF "$(OS)"=="MACOSX"
+LDFLAGS!:=$(EXTRA_LINKFLAGS) $(LDFLAGS)
+.EXPORT : LDFLAGS
+.ENDIF
+
+.IF "$(GUI)"=="WNT"
+PATH!:=.:$(SOLARBINDIR:^"/cygdrive/":s/://):$(PATH)
+.ELSE # "$(GUI)"=="WNT"
+PATH!:=.$(PATH_SEPERATOR)$(SOLARBINDIR)$(PATH_SEPERATOR)$(PATH)
+.ENDIF # "$(GUI)"=="WNT"
+.EXPORT : PATH
+
+#override
+PACKAGE_DIR=$(MISC)/build
+ABS_PACKAGE_DIR:=$(MAKEDIR)/$(MISC)/build
+
+#MUST match with PACKAGE_DIR
+BACK_PATH=../../../
+#MUST match with reference (currently MISC)
+MBACK_PATH=../../
+.IF "$(TARFILE_IS_FLAT)" != ""
+fake_root_dir=/$(TARFILE_NAME)
+#MUST match fake_root_dir in directory levels
+fake_back=../
+.ENDIF "$(TARFILE_IS_FLAT)" != ""
+
+TARFILE_LOCATION*=$(BACK_PATH)$(fake_back)download
+TARFILE_LOCATION2=$(eq,$(BACK_PATH)$(fake_back)download,$(TARFILE_LOCATION) $(PRJ)/download $(TARFILE_LOCATION))
+
+P_CONFIGURE_DIR=$(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$(CONFIGURE_DIR)
+P_BUILD_DIR=$(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$(BUILD_DIR)
+P_INSTALL_DIR=$(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$(BUILD_DIR)
+P_INSTALL_TARGET_DIR=$(MISC)/install
+
+.IF "$(PATCH_FILES)"=="none" || "$(PATCH_FILES)"==""
+NEW_PATCH_FILE_NAME:=$(TARFILE_NAME)
+.ELSE # "$(PATCH_FILES)"=="none" || "$(PATCH_FILES)"==""
+NEW_PATCH_FILE_NAME:=$(TARFILE_NAME)-newpatch-rename_me.patch
+PATCH_FILE_DEP:=$(PRJ)/$(PATH_IN_MODULE)/{$(PATCH_FILES)}
+.ENDIF # "$(PATCH_FILES)"=="none" || "$(PATCH_FILES)"==""
+
+unzip_quiet_switch:=-qq
+.IF "$(VERBOSE)"=="TRUE"
+tar_verbose_switch=v
+unzip_quiet_switch:=
+.ENDIF # "$(VERBOSE)"=="TRUE"
+
+.IF "$(ADDITIONAL_FILES)"!=""
+P_ADDITIONAL_FILES=$(foreach,i,$(ADDITIONAL_FILES) $(MISC)/$(TARFILE_ROOTDIR)/$i)
+T_ADDITIONAL_FILES=$(foreach,i,$(ADDITIONAL_FILES) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i)
+.ENDIF # "$(ADDITIONAL_FILES)"!=""
+
+EXTRPATH*=OOO
+
+.IF "$(L10N_framework)"==""
+
+ALLTAR : \
+ $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE) \
+ $(PACKAGE_DIR)/$(BUILD_FLAG_FILE) \
+ $(PACKAGE_DIR)/$(INSTALL_FLAG_FILE) \
+ $(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE) \
+ $(PACKAGE_DIR)/$(ADD_FILES_FLAG_FILE) \
+ $(PACKAGE_DIR)/$(PATCH_FLAG_FILE) \
+ $(PACKAGE_DIR)/$(PREDELIVER_FLAG_FILE)
+
+clean:
+ $(COMMAND_ECHO)cd $(P_BUILD_DIR) && $(BUILD_ACTION) $(BUILD_FLAGS) clean
+ $(COMMAND_ECHO)$(RM) $(PACKAGE_DIR)/$(BUILD_FLAG_FILE)
+
+$(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tar.bz2
+ @-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @noop $(assign UNPACKCMD := sh -c "bzip2 -cd $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.bz2 $(TARFILE_FILTER) | $(GNUTAR) -x$(tar_verbose_switch)f - ")
+.ELSE # "$(GUI)"=="UNX"
+ @noop $(assign UNPACKCMD := bzip2 -cd $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.bz2 $(TARFILE_FILTER) | $(GNUTAR) -x$(tar_verbose_switch)f - )
+.ENDIF # "$(GUI)"=="UNX"
+ @$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
+ @$(RENAME) $@.$(INPATH) $@
+
+$(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tar.Z
+ @-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @noop $(assign UNPACKCMD := sh -c "uncompress -c $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.Z | $(GNUTAR) -x$(tar_verbose_switch)f - ")
+.ELSE # "$(GUI)"=="UNX"
+ @noop $(assign UNPACKCMD := uncompress -c $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.Z | $(GNUTAR) -x$(tar_verbose_switch)f - )
+.ENDIF # "$(GUI)"=="UNX"
+ @$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
+ @$(RENAME) $@.$(INPATH) $@
+
+$(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tar.gz
+ @-$(RM) $@
+ @noop $(assign UNPACKCMD := gzip -d -c $(subst,\,/ $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.gz) $(TARFILE_FILTER) | $(GNUTAR) -x$(tar_verbose_switch)f - )
+ @$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
+ @$(RENAME) $@.$(INPATH) $@
+
+$(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tgz
+ @-$(RM) $@
+ @noop $(assign UNPACKCMD := gzip -d -c $(subst,\,/ $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tgz) $(TARFILE_FILTER) | $(GNUTAR) -x$(tar_verbose_switch)f - )
+ @$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
+ @$(RENAME) $@.$(INPATH) $@
+
+$(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tar
+ @-$(RM) $@
+ @noop $(assign UNPACKCMD := $(GNUTAR) -x$(tar_verbose_switch)f $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar)
+ @$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
+ @$(RENAME) $@.$(INPATH) $@
+
+$(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.zip
+ @-$(RM) $@
+ @noop $(assign UNPACKCMD := unzip $(unzip_quiet_switch) -o $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).zip)
+ @$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
+ @$(RENAME) $@.$(INPATH) $@
+
+$(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.jar
+ @-$(RM) $@
+.IF "$(OS)"=="SOLARIS"
+ @noop $(assign UNPACKCMD := jar xf $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).jar)
+.ELSE # "$(OS)"=="SOLARIS"
+ @noop $(assign UNPACKCMD := unzip $(unzip_quiet_switch) -o $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).jar)
+.ENDIF # "$(OS)"=="SOLARIS"
+ @$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
+ @$(RENAME) $@.$(INPATH) $@
+
+#do unpack
+$(PACKAGE_DIR)/$(UNTAR_FLAG_FILE) : $(PRJ)/$(ROUT)/misc/$(TARFILE_MD5)-$(TARFILE_NAME).unpack $(PATCH_FILE_DEP)
+ $(IFEXIST) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR) $(THEN) $(RENAME:s/+//) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)_removeme $(FI)
+ $(COMMAND_ECHO)-rm -rf $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)_removeme
+ @-$(MKDIRHIER) $(PACKAGE_DIR)$(fake_root_dir)
+ $(COMMAND_ECHO)cd $(PACKAGE_DIR)$(fake_root_dir) && ( $(shell @$(TYPE) $(PRJ)/$(ROUT)/misc/$(TARFILE_MD5)-$(TARFILE_NAME).unpack)) && $(TOUCH) $(UNTAR_FLAG_FILE)
+ @echo make writeable...
+ @cd $(PACKAGE_DIR) && chmod -R +rw $(TARFILE_ROOTDIR) && $(TOUCH) $(UNTAR_FLAG_FILE)
+ @cd $(PACKAGE_DIR) && find $(TARFILE_ROOTDIR) -type d -exec chmod a+x {{}} \;
+
+#add new files to patch
+$(PACKAGE_DIR)/$(ADD_FILES_FLAG_FILE) : $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE) $(T_ADDITIONAL_FILES:+".dummy")
+.IF "$(GUI)"=="WNT"
+ @$(TOUCH) $@
+.ELSE # "$(GUI)"=="WNT"
+ @$(TOUCH) $@
+.ENDIF # "$(GUI)"=="WNT"
+
+#patch
+$(PACKAGE_DIR)/$(PATCH_FLAG_FILE) : $(PACKAGE_DIR)/$(ADD_FILES_FLAG_FILE)
+.IF "$(PATCH_FILES)"=="none" || "$(PATCH_FILES)"==""
+ @echo no patch needed...
+ $(COMMAND_ECHO)$(TOUCH) $@
+.ELSE # "$(PATCH_FILES)"=="none" || "$(PATCH_FILES)"==""
+.IF "$(GUI)"=="WNT"
+# hack to make 4nt version 4,01 work and still get propper
+# errorcodes for versions < 3,00
+#.IF "$(my4ver:s/.//:s/,//)" >= "300"
+# $(COMMAND_ECHO)cd $(PACKAGE_DIR) && ( $(TYPE:s/+//) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | tr -d "\015" | patch $(PATCHFLAGS) -p2 ) && $(TOUCH) $(PATCH_FLAG_FILE)
+#.ELSE # "$(my4ver:s/.//:s/,//)" >= "300"
+ $(COMMAND_ECHO)cd $(PACKAGE_DIR) && $(TYPE:s/+//) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | tr -d "\015" | patch $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FILE)
+#.ENDIF # "$(my4ver:s/.//:s/,//)" >= "300"
+.ELSE # "$(GUI)"=="WNT"
+.IF "$(BSCLIENT)"=="TRUE"
+ $(COMMAND_ECHO)cd $(PACKAGE_DIR) && $(TYPE) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) -f $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FILE)
+.ELSE # "$(BSCLIENT)"!=""
+ $(COMMAND_ECHO)cd $(PACKAGE_DIR) && $(TYPE) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FILE)
+.ENDIF # "$(BSCLIENT)"!=""
+.ENDIF # "$(GUI)"=="WNT"
+.ENDIF # "$(PATCH_FILES)"=="none" || "$(PATCH_FILES)"==""
+.IF "$(T_ADDITIONAL_FILES)"!=""
+.IF "$(GUI)"=="WNT"
+# Native W32 tools generate only filedates with even seconds, cygwin also with odd seconds
+ $(DELAY) 2
+.ENDIF # "$(GUI)"=="WNT"
+ $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
+.ENDIF # "$(T_ADDITIONAL_FILES)"!=""
+
+.IF "$(CONVERTFILES)"!=""
+$(MISC)/$(TARGET)_convert_unx_flag : $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE)
+ $(COMMAND_ECHO)$(CONVERT) unix $(foreach,i,$(CONVERTFILES) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) && $(TOUCH) $(MISC)/$(TARGET)_convert_unx_flag
+
+$(PACKAGE_DIR)/$(PATCH_FLAG_FILE) : $(MISC)/$(TARGET)_convert_unx_flag
+
+$(MISC)/$(TARGET)_convert_dos_flag : $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
+ $(COMMAND_ECHO)$(CONVERT) dos $(foreach,i,$(CONVERTFILES) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) && $(TOUCH) $(MISC)/$(TARGET)_convert_dos_flag
+
+$(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE) : $(MISC)/$(TARGET)_convert_dos_flag
+
+patch : $(MISC)/$(TARGET)_convert_dos_flag
+
+.ENDIF # "$(CONVERTFILES)"!=""
+
+$(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE) : $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
+ @@-$(RM) $@
+.IF "$(CONFIGURE_ACTION)" == "none" || "$(CONFIGURE_ACTION)"==""
+ $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE)
+.ELSE # "$(CONFIGURE_ACTION)"=="none" || "$(CONFIGURE_ACTION)"==""
+ $(COMMAND_ECHO)-$(MKDIR) $(P_CONFIGURE_DIR)
+.IF "$(OS)"=="OS2"
+ $(COMMAND_ECHO)cd $(P_CONFIGURE_DIR) && sh -c "$(CONFIGURE_ACTION:s!\!/!) $(CONFIGURE_FLAGS:s!\!/!)" && $(TOUCH) $(CONFIGURE_FLAG_FILE)
+.ELSE
+ $(COMMAND_ECHO)cd $(P_CONFIGURE_DIR) && $(CONFIGURE_ACTION) $(CONFIGURE_FLAGS) && $(TOUCH) $(CONFIGURE_FLAG_FILE)
+.ENDIF
+ $(COMMAND_ECHO)mv $(P_CONFIGURE_DIR)/$(CONFIGURE_FLAG_FILE) $(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE)
+.ENDIF # "$(CONFIGURE_ACTION)"=="none" || "$(CONFIGURE_ACTION)"==""
+
+
+$(PACKAGE_DIR)/$(BUILD_FLAG_FILE) : $(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE)
+ @@-$(RM) $@
+.IF "$(eq,x$(BUILD_ACTION:s/none//)x,xx true false)"=="true"
+ $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(BUILD_FLAG_FILE)
+.ELSE # "$(eq,x$(BUILD_ACTION:s/none//)x,xx true false)"=="true"
+ $(COMMAND_ECHO)-$(MKDIR) $(P_BUILD_DIR)
+ $(COMMAND_ECHO)cd $(P_BUILD_DIR) && $(BUILD_ACTION) $(BUILD_FLAGS) && $(TOUCH) $(ABS_PACKAGE_DIR)/$(BUILD_FLAG_FILE)
+.ENDIF # "$(eq,x$(BUILD_ACTION:s/none//)x,xx true false)"=="true"
+
+$(PACKAGE_DIR)/$(INSTALL_FLAG_FILE) : $(PACKAGE_DIR)/$(BUILD_FLAG_FILE)
+ @@-$(RM) $@
+.IF "$(INSTALL_ACTION)"=="none" || "$(INSTALL_ACTION)"==""
+ $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(INSTALL_FLAG_FILE)
+.ELSE # "$(INSTALL_ACTION)"=="none" || "$(INSTALL_ACTION)"==""
+ $(COMMAND_ECHO)-$(MKDIR) $(P_INSTALL_DIR)
+ $(COMMAND_ECHO)-$(MKDIR) $(P_INSTALL_TARGET_DIR)
+ $(COMMAND_ECHO)cd $(P_INSTALL_DIR) && $(INSTALL_ACTION) $(INSTALL_FLAGS) && $(TOUCH) $(INSTALL_FLAG_FILE)
+ $(COMMAND_ECHO)mv $(P_INSTALL_DIR)/$(INSTALL_FLAG_FILE) $(PACKAGE_DIR)/$(INSTALL_FLAG_FILE)
+.ENDIF # "$(INSTALL_ACTION)"=="none" || "$(INSTALL_ACTION)"==""
+
+$(PACKAGE_DIR)/$(PREDELIVER_FLAG_FILE) : $(PACKAGE_DIR)/$(INSTALL_FLAG_FILE)
+.IF "$(OUT2LIB)"!=""
+ $(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2LIB) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(LB)
+.IF "$(OS)"=="MACOSX"
+ $(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl extshl \
+ $(EXTRPATH) \
+ $(shell ls $(foreach,j,$(OUT2LIB) $(LB)/$(j:f)) | \
+ (grep -v '\.a$$' || test $$? = 1))
+.ENDIF
+.ENDIF # "$(OUT2LIB)"!=""
+.IF "$(OUT2INC)"!=""
+.IF "$(OUT2INC_SUBDIR)"!=""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(INCCOM)/$(OUT2INC_SUBDIR)
+ $(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2INC) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(INCCOM)/$(OUT2INC_SUBDIR)
+.ELSE # "$(OUT2INC_SUBDIR)"!=""
+ $(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2INC) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(INCCOM)
+.ENDIF # "$(OUT2INC_SUBDIR)"!=""
+.ENDIF # "$(OUT2INC)"!=""
+.IF "$(OUTDIR2INC)"!=""
+ $(COMMAND_ECHO)$(COPY) $(DEREFERENCE) $(COPYRECURSE) $(foreach,i,$(OUTDIR2INC) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(INCCOM)
+.ENDIF # "$(OUTDIR2INC)"!=""
+.IF "$(OUT2BIN)"!=""
+ $(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2BIN) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(BIN)
+.IF "$(GUI)$(COM)$(COMEX)"=="WNTMSC12"
+ @noop $(foreach,j,$(foreach,k,$(OUT2BIN) \
+ $(shell -ls -1 $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$k | $(GREP) .dll)) \
+ $(shell @$(IFEXIST) $(j).manifest $(THEN) mt.exe \
+ -manifest $(j).manifest -outputresource:$(BIN)/$(j:f)$(EMQ);2 $(FI)))
+.ENDIF # "$(GUI)$(COM)$(COMEX)"=="WNTMSC12"
+.ENDIF # "$(OUT2BIN)"!=""
+.IF "$(OUT2CLASS)"!=""
+ $(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2CLASS) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(CLASSDIR)
+.ENDIF # "$(OUT2BIN)"!=""
+ $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(PREDELIVER_FLAG_FILE)
+
+$(MISC)/$(TARFILE_ROOTDIR).done : $(MISC)/$(TARFILE_MD5)-$(TARFILE_NAME).unpack $(PATCH_FILES)
+ @-mv $(MISC)/$(TARFILE_ROOTDIR) $(MISC)/$(TARFILE_ROOTDIR).old
+ @-rm -rf $(MISC)/$(TARFILE_ROOTDIR).old
+ @-$(MKDIRHIER) $(MISC)$(fake_root_dir)
+ $(COMMAND_ECHO)cd $(MISC)$(fake_root_dir) && $(subst,$(BACK_PATH),$(MBACK_PATH) $(shell @$(TYPE) $(PRJ)/$(ROUT)/misc/$(TARFILE_MD5)-$(TARFILE_NAME).unpack))
+.IF "$(P_ADDITIONAL_FILES)"!=""
+ noop $(foreach,i,$(P_ADDITIONAL_FILES) $(shell echo dummy > $i))
+.ENDIF "$(P_ADDITIONAL_FILES)"!=""
+.IF "$(PATCH_FILES)"!="none" && "$(PATCH_FILES)"!=""
+.IF "$(CONVERTFILES)"!=""
+ $(CONVERT) unix $(foreach,i,$(CONVERTFILES) $(MISC)/$(TARFILE_ROOTDIR)/$i)
+.ENDIF # "$(CONVERTFILES)"!=""
+.IF "$(GUI)"=="WNT"
+# hack to make 4nt version 4,01 work and still get propper
+# errorcodes for versions < 3,00
+#.IF "$(my4ver:s/.//:s/,//)" >= "300"
+# $(COMMAND_ECHO)cd $(MISC) && ( $(TYPE:s/+//) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | tr -d "\015" | patch $(PATCHFLAGS) -p2 )
+#.ELSE # "$(my4ver:s/.//:s/,//)" >= "300"
+ $(COMMAND_ECHO)cd $(MISC) && $(TYPE:s/+//) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | tr -d "\015" | patch $(PATCHFLAGS) -p2
+#.ENDIF # "$(my4ver:s/.//:s/,//)" >= "300"
+.ELSE # "$(GUI)"=="WNT"
+.IF "$(BSCLIENT)"=="TRUE"
+ $(COMMAND_ECHO)cd $(MISC) && $(TYPE) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) -f $(PATCHFLAGS) -p2
+.ELSE # "$(BSCLIENT)"!=""
+ $(COMMAND_ECHO)cd $(MISC) && $(TYPE) $(MBACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) $(PATCHFLAGS) -p2
+.ENDIF # "$(BSCLIENT)"!=""
+.ENDIF # "$(GUI)"=="WNT"
+.IF "$(CONVERTFILES)"!=""
+ $(COMMAND_ECHO)$(CONVERT) dos $(foreach,i,$(CONVERTFILES) $(MISC)/$(TARFILE_ROOTDIR)/$i)
+.ENDIF # "$(CONVERTFILES)"!=""
+.ENDIF # "$(PATCH_FILES)"!="none" && "$(PATCH_FILES)"!="
+.IF "$(GUI)"=="UNX"
+ $(COMMAND_ECHO)$(TOUCH) $@
+.ENDIF # "$(GUI)"=="UNX"
+
+.IF "$(T_ADDITIONAL_FILES)"!=""
+$(T_ADDITIONAL_FILES:+".dummy") : $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE)
+ @-$(MKDIRHIER) $(@:d)
+ $(COMMAND_ECHO)-echo dummy > $@
+ $(COMMAND_ECHO)-$(TOUCH) $@
+ $(COMMAND_ECHO)-echo dummy > $(@:d)$(@:b)
+ $(COMMAND_ECHO)-$(TOUCH) $(@:d)$(@:b)
+.ENDIF "$(T_ADDITIONAL_FILES)"!=""
+
+create_patch : $(MISC)/$(TARFILE_ROOTDIR).done $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
+ @@-$(MKDIRHIER) $(PRJ)/$(NEW_PATCH_FILE_NAME:d)
+ @@-$(RM) $(MISC)/$(NEW_PATCH_FILE_NAME:f).tmp
+ @@-$(RM) $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME).bak
+#ignore returncode of 1 (indicates differences...)
+# hard coded again to get the same directory level as before. quite ugly...
+ $(COMMAND_ECHO)-cd $(PRJ)/$(ROUT) && diff -ru misc/$(TARFILE_ROOTDIR) misc/build/$(TARFILE_ROOTDIR) | $(PERL) $(SOLARENV)/bin/cleandiff.pl | tr -d "\015" > misc/$(NEW_PATCH_FILE_NAME:f).tmp
+ $(COMMAND_ECHO)-mv $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME) $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME).bak
+ $(COMMAND_ECHO)-$(TOUCH) $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME).bak
+ $(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/patch_sanitizer.pl $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME).bak $(MISC)/$(NEW_PATCH_FILE_NAME:f).tmp $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME)
+ @@-$(RM) $(MISC)/$(NEW_PATCH_FILE_NAME:f).tmp $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME).bak
+ $(COMMAND_ECHO)$(MAKECMD) $(MAKEMACROS) patch
+ @echo still some problems with win32 generated patches...
+ @echo $(USQ)find your new changes in $(NEW_PATCH_FILE_NAME). don't forget to move/rename that patch and insert it in your makefiles PATCH_FILES to activate.$(USQ)
+
+create_clean : $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE)
+ @echo done
+
+patch : $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
+ @echo done
+
+.ENDIF # "$(L10N_framework)"==""
diff --git a/solenv/inc/tg_help.mk b/solenv/inc/tg_help.mk
new file mode 100644
index 000000000000..cce5b9ee62b2
--- /dev/null
+++ b/solenv/inc/tg_help.mk
@@ -0,0 +1,90 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# to make it usable with special lang selection of
+# helpcontent2
+
+aux_alllangiso*:=$(alllangiso)
+
+SHELL_PACKAGE:=$(subst,/,$/ $(PACKAGE))
+
+.IF "$(XHPDEST)"==""
+XHPDEST*:=$(COMMONMISC)
+HELP_OUT:=$(COMMONMISC)
+.ELSE # "$(XHPDEST)"==""
+HELP_OUT:=$(MISC)
+.ENDIF # "$(XHPDEST)"==""
+
+HLANGXHPFILES*:=$(foreach,i,$(XHPFILES) $(foreach,j,$(aux_alllangiso) $(XHPDEST)$/$j$/$(SHELL_PACKAGE)$/$(i:f)))
+
+ALLTAR : $(HELP_OUT)$/$(TARGET).done $(HELP_OUT)$/xhp_changed.flag optix
+
+$(HLANGXHPFILES) : $$(@:d)thisdir.created
+
+$(XHPDEST)$/{$(aux_alllangiso)}$/$(SHELL_PACKAGE)$/%.xhp :| %.xhp
+ @$(TOUCH) $@
+# internal dependencies not sufficient to trigger merge?
+# @$(NULL)
+
+
+$(HELP_OUT)$/$(TARGET).done : $(HLANGXHPFILES)
+.IF "$(WITH_LANG)"!=""
+ $(AUGMENT_LIBRARY_PATH) $(HELPEX) -p $(PRJNAME) -r $(PRJ) -i @$(mktmp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES))))) -x $(XHPDEST) -y $(SHELL_PACKAGE) -l all -lf $(aux_alllangiso:t",") -m $(LOCALIZESDF) && $(TOUCH) $@
+.ELSE # "$(WITH_LANG)"!=""
+ cp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES)))) $(XHPDEST)$/en-US$/$(SHELL_PACKAGE) && $(TOUCH) $@
+.ENDIF # "$(WITH_LANG)"!=""
+.IF "$(OS)"=="SOLARIS"
+ @$(ECHONL) " "
+.ELSE # "$(OS)"=="SOLARIS"
+ @$(ECHONL)
+.ENDIF # "$(OS)"=="SOLARIS"
+
+$(HELP_OUT)$/xhp_changed.flag : $(HLANGXHPFILES)
+ @$(TOUCH) $@
+
+# urks - dmake mixes up operators and strings :-(
+.IF "$(HLANGXHPFILES:s/defined/xxx/)"!=""
+
+.IF "$(HELPTRANSPHONY)"!=""
+$(HELP_OUT)$/$(TARGET).done .PHONY :
+.ELSE # "$(HELPTRANSPHONY)"!=""
+
+$(HELP_OUT)$/$(TARGET).done : makefile.mk
+.IF "$(WITH_LANG)"!=""
+$(HELP_OUT)$/$(TARGET).done : $(LOCALIZESDF)
+.ENDIF # "$(WITH_LANG)"!=""
+.ENDIF # "$(HELPTRANSPHONY)"!=""
+.ENDIF # "$(HLANGXHPFILES)"!=""
+
+optix: $(HELP_OUT)$/$(TARGET).done
+ @echo done
+
+%.created :
+ @@-$(MKDIRHIER) $(@:d)
+ @$(TOUCH) $@
+
+
diff --git a/solenv/inc/tg_jar.mk b/solenv/inc/tg_jar.mk
new file mode 100644
index 000000000000..d1109ec4e8f1
--- /dev/null
+++ b/solenv/inc/tg_jar.mk
@@ -0,0 +1,89 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+.IF "$(VERBOSE)"=="FALSE"
+ZIP_VERBOSITY=-q
+.ENDIF
+
+.IF "$(JARTARGETN)"!=""
+
+.IF "$(JARCOMPRESS)"==""
+JARCOMPRESS_FLAG=0
+.ENDIF
+
+.IF "$(NEW_JAR_PACK)"!=""
+$(JARTARGETN) : $(JARMANIFEST) $(JAVACLASSFILES) $(JAVATARGET)
+.ENDIF # "$(NEW_JAR_PACK)"!=""
+
+.IF "$(NEW_JAR_PACK)"!=""
+.IF "$(JARMANIFEST)"!=""
+
+.IF "$(CUSTOMMANIFESTFILE)"!=""
+
+CUSTOMMANIFESTFILEDEP:=$(MISC)/$(TARGET)_$(CUSTOMMANIFESTFILE:f)
+
+$(MISC)/$(TARGET)_$(CUSTOMMANIFESTFILE:f) : $(subst,/,/ $(DMAKE_WORK_DIR))/$(CUSTOMMANIFESTFILE)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(COPY) $< $@
+.ENDIF # "$(CUSTOMMANIFESTFILE)"!=""
+
+$(JARMANIFEST) .PHONY : $(CUSTOMMANIFESTFILEDEP)
+ @@-$(MKDIRHIER) $(@:d)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)echo Manifest-Version: 1.0 > $@
+.IF "$(JARCLASSPATH)" != ""
+ echo $(USQ)Class-Path: $(JARCLASSPATH)$(USQ) >> $@
+.ENDIF
+# $(RSCREVISION) contains chars that must be quoted (for *NIX shells)
+ $(COMMAND_ECHO)echo $(USQ)Solar-Version: $(RSCREVISION)$(USQ) >> $@
+.IF "$(CUSTOMMANIFESTFILE)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(MISC)/$(TARGET)_$(CUSTOMMANIFESTFILE:f) >> $@
+.ENDIF # "$(CUSTOMMANIFESTFILE)"!=""
+.ENDIF # "$(JARMANIFEST)"!=""
+.ENDIF # "$(NEW_JAR_PACK)"!=""
+
+#
+# build jar
+#
+.IF "$(NOJARDEP)"!="" || "$(NEW_JAR_PACK)"!=""
+$(JARTARGETN) .PHONY :
+# $(JARMANIFEST)
+.ELSE # "$(NOJARDEP)"!="" || "$(NEW_JAR_PACK)"!=""
+.DIRCACHE = no
+$(JARTARGETN) :
+#$(JARTARGETN) .SETDIR=$(CLASSDIR) .SEQUENTIAL : $(JARTARGETDEP) $(shell @-cat -s $(MISC)/$(JARTARGETN).dep )
+.ENDIF # "$(NOJARDEP)"!="" || "$(NEW_JAR_PACK)"!=""
+.IF "$(OS)$(CPU)"=="SOLARISS"
+ @-find . -type d -user $(USER) ! -perm -5 -print | xargs test "$$1" != "" && chmod +r $$1
+.ENDIF
+.IF "$(JARMANIFEST)"!=""
+ $(COMMAND_ECHO)cd $(CLASSDIR)/$(TARGET) && zip $(ZIP_VERBOSITY) -u -rX ../$(@:f) $(subst,$(CLASSDIR)/$(TARGET)/, $(JARMANIFEST)) $(CHECKZIPRESULT)
+.ENDIF # "$(JARMANIFEST)"!=""
+ $(COMMAND_ECHO)cd $(CLASSDIR) && zip $(ZIP_VERBOSITY) -u -rX $(@:f) $(subst,\,/ $(JARCLASSDIRS)) $(CHECKZIPRESULT)
+.ENDIF
+
diff --git a/solenv/inc/tg_java.mk b/solenv/inc/tg_java.mk
new file mode 100644
index 000000000000..5c00f2bbf7f5
--- /dev/null
+++ b/solenv/inc/tg_java.mk
@@ -0,0 +1,84 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+
+$(CLASSDIR)/com/sun/star/upd/$(VERSIONINFOFILE)_updversion.class .PHONY: $(MISC)/java/com/sun/star/upd/$(VERSIONINFOFILE)_updversion.java
+
+$(MISC)/java/com/sun/star/upd/$(VERSIONINFOFILE)_updversion.java .PHONY:
+ @echo "Making: " $(@:f)
+ @-$(MKDIRHIER) $(MISC)/java/com/sun/star/upd
+.IF "$(GUI)"=="UNX"
+ @echo package com.sun.star.upd\; > $@
+ @echo 'public class $(VERSIONINFOFILE)_updversion { public static String Version = "$(RSCREVISION)";}' >> $@
+.ELSE # "$(GUI)"=="UNX"
+ @echo package com.sun.star.upd; > $@
+ @echo public class $(VERSIONINFOFILE)_updversion { public static String Version = "$(RSCREVISION)";} >> $@
+.ENDIF # "$(GUI)"=="UNX"
+
+.IF "$(JAVATARGET)"!=""
+.IF "$(PACKAGE)"!=""
+$(CLASSDIR)/$(IDLPACKAGE)/%.class .NOINFER .IGNORE : %.java
+# echo $@
+ @@-$(RM) $(JAVATARGET)
+.ELSE # "$(PACKAGE)"!=""
+$(CLASSDIR)/%.class .NOINFER .IGNORE : %.java
+# echo $@
+ @@-$(RM) $(JAVATARGET)
+.ENDIF # "$(PACKAGE)"!=""
+
+$(JAVATARGET) : $(JAVAFILES) $(JAVACLASSFILES)
+.IF "$(JAVARESPONSE)"!=""
+ $(JAVAC) @<<
+ $(JAVACPS) $(CLASSPATH) -d $(CLASSDIR) $(JAVAFLAGS) $(JAVAFILES)
+ <<keep
+.ELSE # "$(JAVARESPONSE)"!=""
+.IF "$(use_jdep)"!=""
+ $(JAVAC) -depend $(JAVACPS) $(CLASSPATH) -d $(CLASSDIR) $(JAVAFLAGS) $(JAVAFILES)
+.ELSE # "$(use_jdep)"!=""
+.IF "$(javauno)"!=""
+.IF "$(JAVAFILES:d)"==""
+ $(JAVAC) $(JAVACPS) $(CLASSPATH) -d $(CLASSDIR) $(JAVAFLAGS) $(JAVAFILES)
+.ELSE # "$(JAVAFILES:d)"==""
+ @@$(TOUCH) $(INPATH)_$(VCSID)_a_dummy.java
+ $(JAVAC) $(JAVACPS) $(CLASSPATH) -d $(CLASSDIR) $(JAVAFLAGS) ./*.java $(uniq $(JAVAFILES:d:+"*.java"))
+ @@-$(RM) $(INPATH)_$(VCSID)_a_dummy.java
+.ENDIF # "$(JAVAFILES:d)"==""
+.ELSE # "$(javauno)"!=""
+ $(JAVAC) $(JAVACPS) "$(CLASSPATH)" -d $(CLASSDIR) $(JAVAFLAGS) @$(mktmp $(strip $(JAVAFILES)))
+.ENDIF # "$(javauno)"!=""
+.ENDIF # "$(use_jdep)"!=""
+.ENDIF # "$(JAVARESPONSE)"!=""
+.IF "$(UPDATER)"!=""
+.IF "$(OS)$(CPU)"=="SOLARISS"
+ @@-find $(CLASSDIR) -type d -user $(USER) \! -perm -5 -print | xargs chmod a+r $$1
+.ENDIF
+.ENDIF
+ @echo > $@
+
+.ENDIF # "$(JAVATARGET)"!=""
+
diff --git a/solenv/inc/tg_javav.mk b/solenv/inc/tg_javav.mk
new file mode 100644
index 000000000000..fe5f7fe17e81
--- /dev/null
+++ b/solenv/inc/tg_javav.mk
@@ -0,0 +1,53 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+JAVAVERMK:=$(INCCOM)/java_ver.mk
+
+.INCLUDE .IGNORE : $(JAVAVERMK)
+
+.IF "$(JAVAVER)"=="" || "$(JAVALOCATION)"!="$(JAVA_HOME)"
+.IF "$(L10N_framework)"==""
+
+.IF "$(SOLAR_JAVA)"!=""
+JFLAGSVERSION=-version
+JFLAGSVERSION_CMD=-version $(PIPEERROR) $(AWK) -f $(SOLARENV)/bin/getcompver.awk
+JFLAGSNUMVERSION_CMD=-version $(PIPEERROR) $(AWK) -v num=true -f $(SOLARENV)/bin/getcompver.awk
+
+# that's the version known by the specific
+# java version
+JAVAVER:=$(shell @-$(JAVA_HOME)/bin/java $(JFLAGSVERSION_CMD))
+
+# and a computed integer for comparing
+# each point seperated token blown up to 4 digits
+JAVANUMVER:=$(shell @-$(JAVA_HOME)/bin/java $(JFLAGSNUMVERSION_CMD))
+
+.ELSE # "$(SOLAR_JAVA)"!=""
+JAVAVER=0.0.0
+JAVANUMVER=000000000000
+.ENDIF # "$(SOLAR_JAVA)"!=""
+.ENDIF # "$(L10N_framework)"==""
+.ENDIF # "$(JAVAVER)"=="" || "$(JAVALOCATION)"!="$(JAVA_HOME)"
diff --git a/solenv/inc/tg_lib.mk b/solenv/inc/tg_lib.mk
new file mode 100644
index 000000000000..08909156b729
--- /dev/null
+++ b/solenv/inc/tg_lib.mk
@@ -0,0 +1,134 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#######################################################
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(LIB$(TNR)TARGET)" != ""
+.IF "$(LIB$(TNR)ARCHIV)" != ""
+
+$(LIB$(TNR)ARCHIV) : $(LIB$(TNR)TARGET)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @-$(RM) $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
+.IF "$(OS)" =="HPUX_FRAG_HR"
+ @-$(RM) $(MISC)/$(LIB$(TNR)ARCHIV:b)_closetempl.cmd
+ @echo $(LINK) +inst_close -c `cat $(LIB$(TNR)TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB$(TNR)ARCHIV:b)_closetempl.cmd
+ @cat $(MISC)/$(LIB$(TNR)ARCHIV:b)_closetempl.cmd
+ @+source $(MISC)/$(LIB$(TNR)ARCHIV:b)_closetempl.cmd
+.ENDIF
+ @echo $(LIBMGR) $(LIB$(TNR)FLAGS) $(LIBFLAGS) $(LIB$(TNR)ARCHIV) `cat $(LIB$(TNR)TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
+.IF "$(OS)$(COM)"=="NETBSDGCC"
+ @echo ranlib $(LIB$(TNR)ARCHIV) >> $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
+.ENDIF
+.IF "$(OS)" == "MACOSX"
+ @echo ranlib $(LIB$(TNR)ARCHIV) >> $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
+.ENDIF
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)$(COM)"=="WNTGCC"
+ @+-$(RM) $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
+ @+echo $(LIBMGR) $(LIB$(TNR)FLAGS) $(LIBFLAGS) $(LIB$(TNR)ARCHIV) `cat $(LIB$(TNR)TARGET) | sed s#'^'$(ROUT)#$(PRJ)/$(ROUT)#g` > $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
+ @+echo ranlib $(LIB$(TNR)ARCHIV) >> $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
+.IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
+.ENDIF
+ @+source $(MISC)/$(LIB$(TNR)ARCHIV:b).cmd
+.ELSE
+ @echo just a dummy > $@
+.ENDIF # "$(GUI)$(COM)"=="WNTGCC"
+.ENDIF # "$(GUI)"=="UNX"
+
+.ENDIF # "$(LIB$(TNR)ARCHIV)" != ""
+
+$(LIB$(TNR)TARGET) : $(LIB$(TNR)FILES) \
+ $(LIB$(TNR)OBJFILES) \
+ $(LIB$(TNR)DEPN)
+.IF "$(VERBOSE)" == "TRUE"
+ @echo ------------------------------
+ @echo using: $(LIB$(TNR)FILES)
+ @echo using: $(LIB$(TNR)TARGET)
+ @echo ------------------------------
+.ENDIF
+ @echo "Making: " $(@:f)
+ @@-$(RM) $@
+.IF "$(GUI)"=="UNX"
+ @echo $(LIB$(TNR)OBJFILES:s/.obj/.o/) | sed "s#$(PRJ:s/./\./)/$(ROUT)#$(ROUT)#g" | xargs -n 1 > $@
+ @cat /dev/null $(LIB$(TNR)FILES:s/.obj/.o/) | xargs -n 1 >> $@
+ @$(RM) $(@:d)$(@:b).dump
+.IF "$(OS)"=="MACOSX"
+ @-nm `cat $(LIB$(TNR)TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ELSE
+ @nm `cat $(LIB$(TNR)TARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ENDIF
+
+.ELIF "$(GUI)"=="OS2"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(LIB$(TNR)FILES) $(LIB$(TNR)OBJFILES)
+ @+-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB$(TNR)OBJFILES)"!=""
+ @+$(TYPE) $(mktmp $(LIB$(TNR)OBJFILES)) > $(null,$(LIB$(TNR)OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB$(TNR)OBJFILES)"!=""
+.IF "$(LIB$(TNR)FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB$(TNR)FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB$(TNR)FILES)"!=""
+ @+$(ECHONL)
+
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+ +$(ECHONL) $(LIB$(TNR)OBJFILES) | sed "s#$(PRJ:s/././)/$(ROUT)#$(ROUT)#g" | xargs -n1 > $@
+ @+cat /dev/null $(LIB$(TNR)FILES) | xargs -n1 >> $@
+.ELSE
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(LIB$(TNR)FILES) $(LIB$(TNR)OBJFILES))
+ @-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB$(TNR)OBJFILES)"!=""
+ @$(TYPE) $(mktmp $(LIB$(TNR)OBJFILES)) > $(null,$(LIB$(TNR)OBJFILES) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB$(TNR)OBJFILES)"!=""
+.IF "$(LIB$(TNR)FILES)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB$(TNR)FILES) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB$(TNR)FILES)"!=""
+ @$(ECHONL)
+.ENDIF # "$(LIB$(TNR)FILES)"!=""
+.ELSE # "$(GUI)"=="WNT"
+ @-$(RM) $@
+ .IF "$(VERBOSE)" == "TRUE"
+ @echo $(LIBMGR) r $@ $(LIB$(TNR)OBJFILES)
+ .ENDIF
+ $(COMMAND_ECHO)$(LIBMGR) r $@ $(LIB$(TNR)OBJFILES) $(LIB$(TNR)FILES) bla.lib
+.ENDIF # "$(GUI)"=="WNT"
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(LIB$(TNR)TARGET)" != ""
+
+# Anweisungen fuer das LIBTARGETs
+# unroll end
+#######################################################
+
diff --git a/solenv/inc/tg_merge.mk b/solenv/inc/tg_merge.mk
new file mode 100644
index 000000000000..a40d48a81c66
--- /dev/null
+++ b/solenv/inc/tg_merge.mk
@@ -0,0 +1,66 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+MKFILENAME:=tg_merge.mk
+
+# look for the according rules in "rules.mk"
+
+.IF "$(WITH_LANG)"!=""
+.IF "$(ULFFILES)"!=""
+$(foreach,i,$(ULFFILES) $(COMMONMISC)/$(TARGET)/$i) : $$(@:f) $(LOCALIZESDF)
+.ENDIF # "$(ULFFILES)"!=""
+
+# *.xrb merge
+.IF "$(XMLPROPERTIES)"!=""
+$(foreach,i,$(XMLPROPERTIES) $(COMMONMISC)/$(TARGET)/$i) : $$(@:f) $(LOCALIZESDF)
+.ENDIF # "$(ULFFILES)"!=""
+
+# *.xrm merge
+.IF "$(READMEFILES)"!=""
+$(foreach,i,$(READMEFILES) $(COMMONMISC)/$(TARGET)/$(i:b).xrm) : $$(@:f) $(LOCALIZESDF)
+.ENDIF # "$(ULFFILES)"!=""
+
+# *.xrm merge
+#.IF "$(APOCHELPFILES)"!=""
+#$(foreach,i,$(APOCHELPFILES) $(COMMONMISC)/$(MYPATH)/$(i:b).xrm) : $$(@:f) $(LOCALIZESDF)
+#.ENDIF # "$(ULFFILES)"!=""
+# *.xcu merge
+.IF "$(LOCALIZEDFILES)"!=""
+$(foreach,i,$(LOCALIZEDFILES) $(PROCESSOUT)/merge/{$(subst,.,/ $(PACKAGE))}/$(i:b).xcu) : $$(@:f) $(LOCALIZESDF)
+.ENDIF # "$(ULFFILES)"!=""
+.ENDIF # "$(WITH_LANG)"!=""
+
+# dependencies from *.ulf to par-files
+.IF "$(ULFPARFILES)"!=""
+$(ULFPARFILES) : $(COMMONMISC)/$(TARGET)/$$(@:b).$(LANGFILEEXT)
+.ENDIF # "$(ULFPARFILES)"!=""
+
+# *.xrm merge
+#.IF "$(READMEFILES)"!=""
+#$(uniq $(foreach,i,$(READMEFILES) $(COMMONMISC)/$(TARGET)/$(i:b).xrm)) : $$(@:f) $(LOCALIZESDF)
+#.ENDIF # "$(ULFFILES)"!=""
+
diff --git a/solenv/inc/tg_moz.mk b/solenv/inc/tg_moz.mk
new file mode 100644
index 000000000000..8c1c0dfa39d4
--- /dev/null
+++ b/solenv/inc/tg_moz.mk
@@ -0,0 +1,89 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+.IF "$(EXPORTS)"!=""
+EXPORT_HEADER=export_mozilla_header
+.ENDIF
+
+.IF "$(XPIDLSRCS)"!=""
+XPIDL_TYPELIB_MODULE=$(MISC)/$(XPIDL_MODULE).xpt
+XPIDLHDR:=$(XPIDLSRCS:s/.idl/.h/)
+XPIDLXPT:=$(XPIDLSRCS:s/.idl/.xpt/)
+EXTRA_MOZ_TARGET+= $(foreach,i,$(XPIDLHDR) $(INCCOM)/$i)
+EXTRA_MOZ_TARGET+= $(foreach,i,$(XPIDLXPT) $(MISC)/$i)
+
+EXTRA_MOZ_TARGET+= $(XPIDL_TYPELIB_MODULE)
+.ENDIF
+
+ALLMOZ:=$(EXTRA_MOZ_TARGET) $(DO_XPIDL) $(GEN_PRCPUCFG) $(EXPORT_HEADER)
+
+$(INCCOM)/%.h : %.idl
+ $(COMMAND_ECHO)$(COPY) $< $(INCCOM)
+ $(COMMAND_ECHO)$(XPIDL) -m header -w -I $(SOLARIDLDIR)/mozilla -I$(INCCOM) -I . -o $(INCCOM)/$* $<
+
+$(MISC)/%.xpt : %.idl
+ $(COMMAND_ECHO)$(XPIDL) -m typelib -w -I $(SOLARIDLDIR)/mozilla -I$(INCCOM) -I . -o $(MISC)/$* $<
+
+.INCLUDE : target.mk
+
+.IF "$(GUI)"=="WNT"
+CPUCFG=_winnt.cfg
+.ENDIF
+
+.IF "$(OS)"=="SOLARIS"
+CPUCFG=_solaris32.cfg
+.ENDIF
+
+.IF "$(OS)"=="LINUX"
+CPUCFG=_linux.cfg
+.ENDIF
+
+.IF "$(OS)"=="FREEBSD"
+CPUCFG=_freebsd.cfg
+.ENDIF
+
+.IF "$(OS)"=="NETBSD"
+CPUCFG=_netbsd.cfg
+.ENDIF
+
+.IF "$(GEN_PRCPUCFG)"!=""
+$(GEN_PRCPUCFG): $(PRJ)/pr/include/md/$(CPUCFG)
+ @$(COPY) $(PRJ)/pr/include/md/$(CPUCFG) $@
+.ENDIF
+
+.IF "$(EXPORTS)"!=""
+$(EXPORT_HEADER):
+ @$(COPY) $(EXPORTS) $(INCCOM)
+.ENDIF
+
+.IF "$(XPIDLSRCS)"!=""
+$(XPIDL_TYPELIB_MODULE): $(foreach,i,$(XPIDLXPT) $(MISC)/$i)
+ $(COMMAND_ECHO)$(XPIDL_LINK) $(MISC)/$(XPIDL_MODULE).xpt $^
+ @-mkdir $(BIN)/components
+ @$(COPY) $@ $(BIN)/components
+.ENDIF
diff --git a/solenv/inc/tg_obj.mk b/solenv/inc/tg_obj.mk
new file mode 100644
index 000000000000..3a597c2409b3
--- /dev/null
+++ b/solenv/inc/tg_obj.mk
@@ -0,0 +1,94 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+MKFILENAME:=TG_OBJ.MK
+
+.IF "$(OBJTARGET)"!=""
+$(OBJTARGET): $(OBJFILES) $(IDLOBJFILES)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="OS2"
+.IF "$(LIBTARGET)"!="NO"
+ @-$(TYPE) $(mktmp $(&:+"\n")) > $(@:s/.lib/.lin/)
+.ENDIF # "$(LIBTARGET)"!="NO"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(&)
+.ENDIF # "$(GUI)"=="OS2"
+
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+ $(ECHONL) $(foreach,i,$(OBJFILES:f) $(ROBJ)/$(i)) > $@
+.ELSE # "$(COM)"=="GCC"
+.IF "$(LIBTARGET)"!="NO"
+ @-$(TYPE) $(mktmp $(&:+"\n")) > $(@:s/.lib/.lin/)
+.ENDIF # "$(LIBTARGET)"!="NO"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(&:+"\n"))
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)"=="WNT"
+.IF "$(GUI)"=="UNX"
+ @echo $(foreach,i,$(OBJFILES:f) $(ROBJ)/$(i:s/.obj/.o/)) | xargs -n1 > $@
+.IF "$(OS)"=="MACOSX"
+ @-nm `cat $(OBJTARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ELSE
+ @nm `cat $(OBJTARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ENDIF
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(OBJTARGET)"!=""
+
+
+.IF "$(SECOND_BUILD)"!=""
+.IF "$($(SECOND_BUILD)OBJTARGET)"!=""
+$($(SECOND_BUILD)OBJTARGET): $(REAL_$(SECOND_BUILD)_OBJFILES)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="OS2"
+.IF "$(LIBTARGET)"!="NO"
+ @-$(TYPE) $(mktmp $(&:+"\n")) > $(@:s/.lib/.lin/)
+.ENDIF # "$(LIBTARGET)"!="NO"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(&)
+.ENDIF # "$(GUI)"=="OS2"
+
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+# $(LIBMGR) $(LIBFLAGS) $@ $(OBJFILES)
+ $(ECHONL) $(foreach,i,$(REAL_$(SECOND_BUILD)_OBJFILES:f) $(ROBJ)/$(i)) > $@
+.ELSE
+.IF "$(LIBTARGET)"!="NO"
+ @-$(TYPE) $(mktmp $(&:+"\n")) > $(@:s/.lib/.lin/)
+.ENDIF # "$(LIBTARGET)"!="NO"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(&:+"\n"))
+.ENDIF
+.ENDIF # "$(GUI)"=="WNT"
+.IF "$(GUI)"=="UNX"
+ @echo $(foreach,i,$(REAL_$(SECOND_BUILD)_OBJFILES:f) $(ROBJ)/$(i:s/.obj/.o/)) | xargs -n1 >> $@
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$($(SECOND_BUILD)OBJTARGET)"!=""
+.ENDIF # "$(SECOND_BUILD)"!=""
+
+.IF "$(GUI)"=="OS2"
+.IF "$(LIBTARGET)"!="NO"
+ @-$(TYPE) $(mktmp $(&:+"\n")) > $(@:s/.lib/.lin/)
+.ENDIF # "$(LIBTARGET)"!="NO"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(&)
+.ENDIF # "$(GUI)"=="OS2"
diff --git a/solenv/inc/tg_propmerge.mk b/solenv/inc/tg_propmerge.mk
new file mode 100755
index 000000000000..796bca982815
--- /dev/null
+++ b/solenv/inc/tg_propmerge.mk
@@ -0,0 +1,66 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+.IF "$(L10NPROPERTYFILES)"!=""
+ALLTAR : $(MISC)/$(TARGET).pmerge.mk $(L10NPROPERTYFILES)
+
+$(MISC)/$(TARGET).pmerge.mk : $(L10NPROPERTYFILES)
+
+$(L10NPROPERTYFILES) : $(LOCALIZESDF)
+
+.INCLUDE .IGNORE : $(MISC)/$(TARGET).pmerge.mk
+
+.IF "$(alllangiso)"!="$(last_merge)"
+MERGEPHONY:=.PHONY
+.ENDIF # "$(alllangiso)" != "$(last_merge)"
+
+$(CLASSDIR)/$(PACKAGE)/%.properties $(MERGEPHONY) : %.properties
+ @@-$(MKDIRHIER) $(@:d)
+.IF "$(WITH_LANG)"==""
+ $(COMMAND_ECHO)$(COPY) $< $@
+.ELSE # "$(WITH_LANG)"==""
+ @@-$(RM) $@
+ $(COMMAND_ECHO)@noop $(assign PMERGELIST+:=$(<:f))
+ $(COMMAND_ECHO)@noop $(assign PDESTDIR:=$(@:d))
+.ENDIF # "$(WITH_LANG)"==""
+
+$(MISC)/$(TARGET).pmerge.mk : $(PMERGELIST)
+.IF "$(WITH_LANG)"!=""
+# jpropex command file requirements:
+# - one file per line
+# - no spaces
+# - no empty lines
+# $(uniq ...) to workaround $assign adding the value twice...
+ @noop $(assign PMERGEFILELIST:=$(uniq $(PMERGELIST)))
+ $(COMMAND_ECHO)$(SOLARBINDIR)/jpropex -p $(PRJNAME) -r $(PRJ) -o $(PDESTDIR) -i @$(mktmp $(PMERGEFILELIST:t"\n":s/ //)) -l all -lf $(alllangiso:s/ /,/) -m $(LOCALIZESDF)
+.ENDIF # "$(WITH_LANG)"!=""
+ @-$(RM) $@
+ $(COMMAND_ECHO)echo last_merge=$(alllangiso) > $@
+
+.ENDIF # "$(L10NPROPERTYFILES)"!=""
+
+
diff --git a/solenv/inc/tg_res.mk b/solenv/inc/tg_res.mk
new file mode 100644
index 000000000000..cad40533e7b8
--- /dev/null
+++ b/solenv/inc/tg_res.mk
@@ -0,0 +1,43 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+.IF "$(RCTARGET)"!=""
+$(RCTARGET): $(RCFILES) \
+ $(RCDEPN)
+ @echo "Making: " $(@:f)
+.IF "$(CCNUMVER)" > "001300000000"
+.IF "$(MFC_INCLUDE)"!=""
+ $(COMMAND_ECHO)$(RC) $(INCLUDE) -I$(SOLARRESDIR) $(foreach,i,$(ATL_INCLUDE) -I$(i)) -I$(MFC_INCLUDE) $(RCLANGFLAGS_$(@:d:d:b)) $(RCFLAGS)
+.ELSE
+ $(COMMAND_ECHO)$(RC) $(INCLUDE) -I$(SOLARRESDIR) $(foreach,i,$(ATL_INCLUDE) -I$(i)) $(RCLANGFLAGS_$(@:d:d:b)) $(RCFLAGS)
+.ENDIF
+.ELSE
+ $(COMMAND_ECHO)$(RC) $(INCLUDE) -I$(SOLARRESDIR) $(RCLANGFLAGS_$(@:d:d:b)) $(RCFLAGS)
+.ENDIF
+.ENDIF
+
diff --git a/solenv/inc/tg_rslb.mk b/solenv/inc/tg_rslb.mk
new file mode 100644
index 000000000000..69721a7e2204
--- /dev/null
+++ b/solenv/inc/tg_rslb.mk
@@ -0,0 +1,92 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#######################################################
+# unroll begin
+
+.IF "$(RESLIB$(TNR)TARGETN)"!=""
+
+$(RSC_MULTI$(TNR)) : \
+ $(RESLIB$(TNR)SRSFILES) \
+ $(RESLIB$(TNR)TARGETN) \
+ $(RESLIB$(TNR)BMPS)
+ @echo Compiling: $(@:f)
+.IF "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))/$(RESLIB$(TNR)NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB$(TNR)IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil={$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(BIN))} \
+ -ft=$@ \
+ $(RSC$(TNR)HEADER) $(RESLIB$(TNR)SRSFILES) \
+ ) > $(NULLDEV)
+.ELSE # "$(common_build_reslib)"!=""
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ -r -p \
+ $(foreach,i,$(alllangiso) -lg$i \
+ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \
+ -fs={$(BIN)/$(RESLIB$(TNR)NAME)$i.res} \
+ $(foreach,j,$(subst,$(PRJ),$(SOLARSRC)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB$(TNR)IMAGES)) -lip={$j}/$i \
+ -lip={$j} ) \
+ -lip=$(SOLARSRC)/$(RSCDEFIMG)/res/$i -lip=$(SOLARSRC)/$(RSCDEFIMG)/res ) \
+ -subMODULE=$(SOLARSRC)/$(RSCDEFIMG) \
+ -subGLOBALRES=$(SOLARSRC)/$(RSCDEFIMG)/res \
+ -oil=$(BIN) \
+ -ft=$@ \
+ $(RSC$(TNR)HEADER) $(RESLIB$(TNR)SRSFILES) \
+ ) > $(NULLDEV)
+.ENDIF # "$(common_build_reslib)"!=""
+
+$(RESLIB$(TNR)TARGETN): \
+ $(RESLIB$(TNR)SRSFILES) \
+ $(RESLIB$(TNR)BMPS)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI$(TNR))
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI$(TNR))
+.ENDIF # "$(common_build_reslib)"!=""
+.ELSE # "$(GUI)"=="UNX"
+.IF "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI$(TNR))
+.ELSE # "$(common_build_reslib)"!=""
+ @@-$(RM) $(RSC_MULTI$(TNR))
+.ENDIF # "$(common_build_reslib)"!=""
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(RESLIB$(TNR)TARGETN)"!=""
+
+
+# unroll end
+#######################################################
+
diff --git a/solenv/inc/tg_scp.mk b/solenv/inc/tg_scp.mk
new file mode 100644
index 000000000000..0033dd9a76be
--- /dev/null
+++ b/solenv/inc/tg_scp.mk
@@ -0,0 +1,50 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#######################################################
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(SCP$(TNR)TARGETN)"!=""
+
+# try to get missing parfiles
+$(PAR)/%.par : $(SOLARPARDIR)/%.par
+ @@-$(MKDIRHIER) $(@:d:d)
+ $(COMMAND_ECHO)$(COPY) $< $@
+
+LOCALSCP$(TNR)FILES+=$(foreach,i,$(SCP$(TNR)FILES) $(foreach,j,$(SCP$(TNR)LINK_PRODUCT_TYPE) $(PAR)/$j/$i ))
+
+$(SCP$(TNR)TARGETN): $(LOCALSCP$(TNR)FILES)
+ @echo "Making: " $(@:f)
+ @@-$(MKDIRHIER) $(BIN)/$(SCP$(TNR)LINK_PRODUCT_TYPE)
+ $(COMMAND_ECHO)$(SCPLINK) $(SCPLINKFLAGS) @@$(mktmp $(foreach,i,$(SCP$(TNR)FILES) $(subst,$(@:d:d:d), $(@:d:d))/$(i:+","))) -o $@
+.ENDIF
+
+# Anweisungen fuer das Linken
+# unroll end
+#######################################################
+
diff --git a/solenv/inc/tg_sdi.mk b/solenv/inc/tg_sdi.mk
new file mode 100644
index 000000000000..66b8c89850b8
--- /dev/null
+++ b/solenv/inc/tg_sdi.mk
@@ -0,0 +1,50 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#######################################################
+# instructions for ???
+# unroll begin
+
+.IF "$(SDI$(TNR)TARGET)"!=""
+$(SDI$(TNR)TARGET): $(SVSDI$(TNR)DEPEND) $(SDI$(TNR)NAME).sdi
+ @echo "Making: " $(@:f)
+ @-$(RM) $@
+ $(COMMAND_ECHO)$(SVIDL) @$(mktmp \
+ $(VERBOSITY) \
+ -fs$(INCCOMX)/$(SDI$(TNR)NAME).hxx \
+ -fd$(INCCOMX)/$(SDI$(TNR)NAME).ilb \
+ -fm$(MISC)/$(SDI$(TNR)NAME).don \
+ -fl$(MISC)/$(SDI$(TNR)NAME).lst \
+ -fx$(SDI$(TNR)EXPORT).sdi \
+ -fz$(MISC)/$(SDI$(TNR)NAME).sid \
+ $(SDI$(TNR)NAME).sdi -I$(MISC) -I$(SVSDIINC) -I$(INC) $(INCLUDE))
+.ENDIF # "$(SDI$(TNR)TARGET)"!=""
+
+# Instruction for ???
+# unroll end
+#######################################################
+
diff --git a/solenv/inc/tg_shl.mk b/solenv/inc/tg_shl.mk
new file mode 100644
index 000000000000..ab95b1a75c4f
--- /dev/null
+++ b/solenv/inc/tg_shl.mk
@@ -0,0 +1,637 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#######################################################
+# targets for linking
+# unroll begin
+
+.IF "$(SHL$(TNR)TARGETN)"!=""
+
+.IF "$(OS)"=="AIX"
+SHL$(TNR)STDLIBS=
+.ENDIF
+
+.IF "$(SHLLINKARCONLY)" != ""
+SHL$(TNR)STDLIBS=
+STDSHL=
+.ELSE
+SHL$(TNR)ARCHIVES=
+.ENDIF
+
+# decide how to link
+.IF "$(SHL$(TNR)CODETYPE)"=="C"
+SHL$(TNR)LINKER=$(LINKC)
+SHL$(TNR)STDSHL=$(subst,CPPRUNTIME, $(STDSHL))
+SHL$(TNR)LINKFLAGS+=$(LINKCFLAGS)
+.ELSE # "$(SHL$(TNR)CODETYPE)"=="C"
+SHL$(TNR)LINKER=$(LINK)
+SHL$(TNR)STDSHL=$(subst,CPPRUNTIME,$(STDLIBCPP) $(STDSHL))
+SHL$(TNR)LINKFLAGS+=$(LINKFLAGS)
+.ENDIF # "$(SHL$(TNR)CODETYPE)"=="C"
+
+SHL$(TNR)RPATH*=OOO
+LINKFLAGSRUNPATH_$(SHL$(TNR)RPATH)*=/ERROR:/Bad_SHL$(TNR)RPATH_value
+SHL$(TNR)LINKFLAGS+=$(LINKFLAGSRUNPATH_$(SHL$(TNR)RPATH))
+
+.IF "$(SHL$(TNR)USE_EXPORTS)"==""
+SHL$(TNR)DEF*=$(MISC)/$(SHL$(TNR)TARGET).def
+.ENDIF # "$(SHL$(TNR)USE_EXPORTS)"==""
+
+EXTRALIBPATHS$(TNR)=$(EXTRALIBPATHS)
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL$(TNR)NOCHECK)"==""
+.IF "$(SOLAR_STLLIBPATH)"!=""
+EXTRALIBPATHS$(TNR)+=-L$(SOLAR_STLLIBPATH)
+.ENDIF
+.ENDIF # "$(SHL$(TNR)NOCHECK)"!=""
+.ENDIF
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+#+++++++++++ version object ++++++++++++++++++++++++++++++++++++++++
+#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.IF "$(L10N_framework)"==""
+.IF "$(VERSIONOBJ)"!=""
+SHL$(TNR)VERSIONOBJ:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL$(TNR)TARGET))}$(VERSIONOBJ:f)
+USE_VERSIONH:=$(INCCOM)/$(SHL$(TNR)VERSIONOBJ:b).h
+.IF "$(GUI)" == "UNX"
+SHL$(TNR)VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL$(TNR)TARGET))}$(VERSIONOBJ:f:s/.o/.obj/)
+.ELSE # "$(GUI)" == "UNX"
+SHL$(TNR)VERSIONOBJDEP:=$(VERSIONOBJ:d){$(subst,$(DLLPOSTFIX),_dflt $(SHL$(TNR)TARGET))}$(VERSIONOBJ:f)
+.ENDIF # "$(GUI)" == "UNX"
+$(MISC)/$(SHL$(TNR)VERSIONOBJ:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL$(TNR)VERSIONOBJ:b).h
+# $(COPY) $(SOLARENV)/src/version.c $@
+ $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL$(TNR)VERSIONOBJ:b).h/ > $@
+
+.INIT : $(SHL$(TNR)VERSIONOBJDEP)
+.ENDIF # "$(VERSIONOBJ)"!=""
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL$(TNR)IMPLIB)" == ""
+SHL$(TNR)IMPLIB=i$(TARGET)_t$(TNR)
+.ENDIF # "$(SHL$(TNR)IMPLIB)" == ""
+.IF "$(COM)" != "GCC"
+USE_$(TNR)IMPLIB=-implib:$(LB)/$(SHL$(TNR)IMPLIB).lib
+.ENDIF # "$(COM)" != "GCC"
+SHL$(TNR)IMPLIBN=$(LB)/$(SHL$(TNR)IMPLIB).lib
+ALLTAR : $(SHL$(TNR)IMPLIBN)
+
+.IF "$(USE_DEFFILE)"==""
+USE_$(TNR)IMPLIB_DEPS=$(LB)/$(SHL$(TNR)IMPLIB).lib
+.ENDIF # "$(USE_DEFFILE)"==""
+.ENDIF # "$(GUI)" == "WNT" || "$(GUI)" == "OS2"
+USE_SHL$(TNR)DEF=$(SHL$(TNR)DEF)
+.ELSE # "$(GUI)" != "UNX"
+USE_SHL$(TNR)DEF=
+SHL$(TNR)DEPN+:=$(SHL$(TNR)DEPNU)
+
+.IF "$(SHL$(TNR)VERSIONMAP)"==""
+# to activate vmaps remove "#"
+USE_SHL$(TNR)VERSIONMAP=$(MISC)/$(SHL$(TNR)TARGET).vmap
+.ENDIF # "$(SHL$(TNR)VERSIONMAP)"==""
+
+.IF "$(USE_SHL$(TNR)VERSIONMAP)"!=""
+
+.IF "$(SHL$(TNR)FILTERFILE)"!=""
+.IF "$(SHL$(TNR)VERSIONMAP)"!=""
+#eine von beiden ist zuviel
+USE_SHL$(TNR)VERSIONMAP=$(MISC)/$(SHL$(TNR)TARGET).vmap
+$(USE_SHL$(TNR)VERSIONMAP) .PHONY:
+ @echo -----------------------------
+ @echo you should only use versionmap OR exportfile
+ @echo -----------------------------
+# force_dmake_to_error
+
+.ENDIF # "$(SHL$(TNR)VERSIONMAP)"!=""
+
+SHL$(TNR)VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL$(TNR)VERSIONMAP)
+
+$(USE_SHL$(TNR)VERSIONMAP): \
+ $(SHL$(TNR)OBJS)\
+ $(SHL$(TNR)LIBS)\
+ $(SHL$(TNR)FILTERFILE)
+ @$(RM) $@.dump
+.IF "$(SHL$(TNR)OBJS)"!=""
+# dump remaining objects on the fly
+.IF "$(OS)"=="MACOSX"
+ @-nm $(SHL$(TNR)OBJS:s/.obj/.o/) > $@.dump
+.ELSE
+ @nm $(SHL$(TNR)OBJS:s/.obj/.o/) > $@.dump
+.ENDIF
+.ENDIF # "$(SHL$(TNR)OBJS)!"=""
+ @$(TYPE) /dev/null $(SHL$(TNR)LIBS:s/.lib/.dump/) >> $@.dump
+ $(COMMAND_ECHO) $(PERL) $(SOLARENV)/bin/mapgen.pl -d $@.dump -s $(SHL$(TNR)INTERFACE) -f $(SHL$(TNR)FILTERFILE) -m $@
+
+.ELSE # "$(SHL$(TNR)FILTERFILE)"!=""
+USE_SHL$(TNR)VERSIONMAP=$(MISC)/$(SHL$(TNR)TARGET).vmap
+$(USE_SHL$(TNR)VERSIONMAP) :
+.IF "$(VERBOSE)" == "TRUE"
+ @echo -----------------------------
+ @echo SHL$(TNR)FILTERFILE not set!
+ @echo -----------------------------
+ @$(TOUCH) $@
+ @echo dummy file to keep the dependencies for later use.
+.ELSE
+ @$(TOUCH) $@
+.ENDIF
+# force_dmake_to_error
+.ENDIF # "$(SHL$(TNR)FILTERFILE)"!=""
+.ELSE # "$(USE_SHL$(TNR)VERSIONMAP)"!=""
+
+#and now for the plain non-generic way...
+.IF "$(SHL$(TNR)VERSIONMAP)"!=""
+USE_SHL$(TNR)VERSIONMAP=$(MISC)/$(SHL$(TNR)VERSIONMAP:b)_$(SHL$(TNR)TARGET)$(SHL$(TNR)VERSIONMAP:e)
+SHL$(TNR)VERSIONMAPPARA=$(LINKVERSIONMAPFLAG) $(USE_SHL$(TNR)VERSIONMAP)
+
+.IF "$(OS)"=="MACOSX"
+$(USE_SHL$(TNR)VERSIONMAP): $(SHL$(TNR)OBJS) $(SHL$(TNR)LIBS)
+.ENDIF
+
+# .ERRREMOVE is needed as a recipe line like "$(AWK) ... > $@" would create $@
+# even if the $(AWK) part fails:
+$(USE_SHL$(TNR)VERSIONMAP) .ERRREMOVE: $(SHL$(TNR)VERSIONMAP)
+ @@-$(RM) -f $@
+# The following files will only be generated and needed on Mac OS X as temporary files
+# in order to generate exported symbols list out of Linux/Solaris map files
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) -f $@.symregexp >& $(NULLDEV)
+ @-$(RM) -f $@.expsymlist >& $(NULLDEV)
+.ENDIF
+# Its questionable if the following condition '.IF "$(COMID)"=="gcc3"' makes sense and what
+# happens if somebody will change it in the future
+.IF "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL$(TNR)VERSIONMAP) | $(AWK) -f $(SOLARENV)/bin/addsym.awk > $@
+.ELIF "$(COMNAME)"=="sunpro5"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL$(TNR)VERSIONMAP) | $(GREP) -v $(IGNORE_SYMBOLS) > $@
+.ELSE # "$(COMID)"=="gcc3"
+ $(COMMAND_ECHO) tr -d "\015" < $(SHL$(TNR)VERSIONMAP) > $@
+.ENDIF # "$(COMID)"=="gcc3"
+ @chmod a+w $@
+# Mac OS X post-processing generate an exported symbols list from the generated map file
+# for details on exported symbols list see man ld on Mac OS X
+.IF "$(OS)"=="MACOSX"
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep -v "\*\|?" > $@.exported-symbols
+ @-cat $@ | $(AWK) -f $(SOLARENV)/bin/unxmap-to-macosx-explist.awk | grep "\*\|?" > $@.symbols-regexp
+# Shared libraries will be build out of the *.obj files specified in SHL?OBJS and SHL?LIBS
+# Extract RTTI symbols from all the objects that will be used to build a shared library
+.IF "$(SHL$(TNR)OBJS)"!=""
+ -echo $(foreach,i,$(SHL$(TNR)OBJS:s/.obj/.o/) $i) | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+.IF "$(SHL$(TNR)LIBS)"!=""
+ $(COMMAND_ECHO)-$(TYPE) $(foreach,j,$(SHL$(TNR)LIBS) $j) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g | xargs -n1 nm -gx | $(SOLARENV)/bin/addsym-macosx.sh $@.symbols-regexp $@.symbols-regexp.tmp >> $@.exported-symbols
+.ENDIF
+# overwrite the map file generate into the local output tree with the generated
+# exported symbols list
+ cp $@.exported-symbols $@
+.ENDIF # .IF "$(OS)"=="MACOSX"
+.ENDIF # "$(SHL$(TNR)VERSIONMAP)"!=""
+.ENDIF # "$(USE_SHL$(TNR)VERSIONMAP)"!=""
+.ENDIF # "$(GUI)" != "UNX"
+
+.IF "$(UNIXVERSIONNAMES)"!=""
+.IF "$(OS)"!="MACOSX"
+.IF "$(GUI)"=="UNX"
+SHL$(TNR)SONAME=\"$(SONAME_SWITCH)$(SHL$(TNR)TARGETN:f)\"
+.ENDIF # "$(GUI)"!="UNX"
+.ENDIF # "$(OS)"!="MACOSX"
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+
+.IF "$(SHL$(TNR)RES)"!=""
+SHL$(TNR)ALLRES+=$(SHL$(TNR)RES)
+SHL$(TNR)LINKRES*=$(MISC)/$(SHL$(TNR)TARGET).res
+SHL$(TNR)LINKRESO*=$(MISC)/$(SHL$(TNR)TARGET)_res.o
+.ENDIF # "$(SHL$(TNR)RES)"!=""
+
+.IF "$(SHL$(TNR)DEFAULTRES)$(use_shl_versions)"!=""
+SHL$(TNR)DEFAULTRES*=$(MISC)/$(SHL$(TNR)TARGET)_def.res
+SHL$(TNR)ALLRES+=$(SHL$(TNR)DEFAULTRES)
+SHL$(TNR)LINKRES*=$(MISC)/$(SHL$(TNR)TARGET).res
+SHL$(TNR)LINKRESO*=$(MISC)/$(SHL$(TNR)TARGET)_res.o
+.ENDIF # "$(SHL$(TNR)DEFAULTRES)$(use_shl_versions)"!=""
+
+#.IF "$(SHL$(TNR)TARGETN)"!=""
+
+.IF "$(linkinc)"!=""
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(SHL$(TNR)LIBS)"!=""
+$(MISC)/$(SHL$(TNR)TARGET)_linkinc.ls .PHONY:
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL$(TNR)LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL$(TNR)LIBS)"!=""
+.ENDIF
+
+LINKINCTARGETS+=$(MISC)/$(SHL$(TNR)TARGETN:b)_linkinc.ls
+$(SHL$(TNR)TARGETN) : $(LINKINCTARGETS)
+
+.ELSE
+.IF "$(SHL$(TNR)USE_EXPORTS)"=="name"
+.IF "$(GUI)"=="WNT" || "$(GUI)" == "OS2"
+.IF "$(COM)"!="GCC"
+.IF "$(SHL$(TNR)LIBS)"!=""
+SHL$(TNR)LINKLIST=$(MISC)/$(SHL$(TNR)TARGET)_link.lst
+SHL$(TNR)LINKLISTPARAM=@$(SHL$(TNR)LINKLIST)
+$(SHL$(TNR)LINKLIST) : $(SHL$(TNR)LIBS)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(SED) -f $(SOLARENV)/bin/chrel.sed $(foreach,i,$(SHL$(TNR)LIBS) $(i:s/.lib/.lin/)) >> $@
+.ENDIF # "$(SHL$(TNR)LIBS)"!=""
+.ENDIF # "$(COM)"!="GCC"
+.ENDIF
+.ENDIF # "$(SHL$(TNR)USE_EXPORTS)"=="name"
+
+$(MISC)/%linkinc.ls:
+ @echo . > $@
+.ENDIF # "$(linkinc)"!=""
+
+.IF "$(GUI)" == "OS2"
+#21/02/2006 YD dll names must be 8.3, invoke fix script
+#check osl/os2/module.c/osl_loadModule()
+SHL$(TNR)TARGET8=$(shell @fix_shl $(SHL$(TNR)TARGET))
+.ENDIF
+
+.IF "$(GUI)" == "OS2"
+_SHL$(TNR)IMP_ORD = $(SHL$(TNR)STDLIBS:^"$(SOLARVERSION)/$(INPATH)/lib/") $(SHL$(TNR)STDLIBS:^"$(LB)/")
+SHL$(TNR)IMP_ORD = $(foreach,i,$(_SHL$(TNR)IMP_ORD) $(shell @-ls $i))
+.ELSE
+SHL$(TNR)IMP_ORD =
+.ENDIF
+
+
+$(SHL$(TNR)TARGETN) : \
+ $(SHL$(TNR)OBJS)\
+ $(SHL$(TNR)LIBS)\
+ $(USE_$(TNR)IMPLIB_DEPS)\
+ $(USE_SHL$(TNR)DEF)\
+ $(USE_SHL$(TNR)VERSIONMAP)\
+ $(SHL$(TNR)RES)\
+ $(SHL$(TNR)DEPN) \
+ $(SHL$(TNR)IMP_ORD) \
+ $(SHL$(TNR)LINKLIST)
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(SHL$(TNR)DEFAULTRES)"!=""
+ @@-$(RM) $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+.IF "$(SHL$(TNR)ICON)" != ""
+ @echo 1 ICON $(SHL$(TNR)ICON) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL$(TNR)ADD_VERINFO)"!=""
+ @echo $(EMQ)#include $(EMQ)"$(SHL$(TNR)ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+.ELSE # "$(SHL$(TNR)ADD_VERINFO)"!=""
+ @echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+.ENDIF # "$(SHL$(TNR)ADD_VERINFO)"!=""
+ @echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+ @echo $(EMQ)#define ORG_NAME $(SHL$(TNR)TARGET)$(DLLPOST) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+ @echo $(EMQ)#define INTERNAL_NAME $(SHL$(TNR)TARGET:b) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+ @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+.ENDIF # "$(SHL$(TNR)DEFAULTRES)"!=""
+.IF "$(SHL$(TNR)ALLRES)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(SHL$(TNR)ALLRES) > $(SHL$(TNR)LINKRES)
+.IF "$(COM)"=="GCC"
+ windres $(SHL$(TNR)LINKRES) $(SHL$(TNR)LINKRESO)
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(SHL$(TNR)ALLRES)"!=""
+.IF "$(COM)"=="GCC" # always have to call dlltool explicitly as ld cannot handle # comment in .def
+ @echo dlltool --dllname $(SHL$(TNR)TARGET)$(DLLPOST) \
+ --kill-at \\ > $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ @noop $(assign ALL$(TNR)OBJLIST:=$(STDOBJ) $(SHL$(TNR)OBJS) $(SHL$(TNR)LINKRESO) $(shell $(TYPE) /dev/null $(SHL$(TNR)LIBS) | $(SED) s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+.IF "$(DEFLIB$(TNR)NAME)"!="" # do not have to include objs
+ @noop $(assign DEF$(TNR)OBJLIST:=$(shell $(TYPE) $(foreach,i,$(DEFLIB$(TNR)NAME) $(SLB)/$(i).lib) | sed s?$(ROUT)?$(PRJ)/$(ROUT)?g))
+ @noop $(foreach,i,$(DEF$(TNR)OBJLIST) $(assign ALL$(TNR)OBJLIST:=$(ALL$(TNR)OBJLIST:s?$i??)))
+.ENDIF # "$(DEFLIB$(TNR)NAME)"!=""
+ @echo --output-exp $(MISC)/$(@:b)_exp.o \\ >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+.IF "$(SHL$(TNR)DEF)"!=""
+ @echo --input-def $(SHL$(TNR)DEF) \\ >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+.ELSE
+ @echo $(SHL$(TNR)VERSIONOBJ) $(SHL$(TNR)DESCRIPTIONOBJ) \\ >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+.ENDIF
+ @echo $(ALL$(TNR)OBJLIST) >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ @echo $(LINK) $(LINKFLAGS) $(LINKFLAGSSHL) $(MINGWSSTDOBJ) -o $@ \
+ $(STDOBJ) $(SHL$(TNR)VERSIONOBJ) $(SHL$(TNR)DESCRIPTIONOBJ) $(SHL$(TNR)OBJS) $(SHL$(TNR)LINKRESO) \
+ `$(TYPE) /dev/null $(SHL$(TNR)LIBS) | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ -Wl,--exclude-libs,ALL,--start-group $(SHL$(TNR)STDLIBS) -Wl,--end-group \
+ $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) $(MISC)/$(@:b)_exp.o $(MINGWSSTDENDOBJ) \
+ -Wl,-Map,$(MISC)/$(@:b).map >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @$(TYPE) $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+.ELSE
+.IF "$(linkinc)"==""
+.IF "$(SHL$(TNR)USE_EXPORTS)"!="name"
+.IF "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL$(TNR)LINKER) @$(mktmp \
+ $(SHL$(TNR)LINKFLAGS) \
+ $(LINKFLAGSSHL) \
+ $(SHL$(TNR)STACK) $(SHL$(TNR)BASEX) \
+ -out:$@ \
+ -map:$(MISC)/$(@:b).map \
+ -def:$(SHL$(TNR)DEF) \
+ $(USE_$(TNR)IMPLIB) \
+ $(STDOBJ) \
+ $(SHL$(TNR)VERSIONOBJ) $(SHL$(TNR)OBJS) \
+ $(SHL$(TNR)LIBS) \
+ $(SHL$(TNR)STDLIBS) \
+ $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) \
+ $(SHL$(TNR)LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE # "$(USE_DEFFILE)"!=""
+ $(COMMAND_ECHO)$(SHL$(TNR)LINKER) @$(mktmp $(SHL$(TNR)LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL$(TNR)BASEX) \
+ $(SHL$(TNR)STACK) -out:$(SHL$(TNR)TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(LB)/$(SHL$(TNR)IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL$(TNR)OBJS) $(SHL$(TNR)VERSIONOBJ) \
+ $(SHL$(TNR)LIBS) \
+ $(SHL$(TNR)STDLIBS) \
+ $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) \
+ $(SHL$(TNR)LINKRES) \
+ ) $(LINKOUTPUTFILTER)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(USE_DEFFILE)"!=""
+.ELSE # "$(SHL$(TNR)USE_EXPORTS)"!="name"
+ $(COMMAND_ECHO)$(SHL$(TNR)LINKER) @$(mktmp $(SHL$(TNR)LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL$(TNR)BASEX) \
+ $(SHL$(TNR)STACK) -out:$(SHL$(TNR)TARGETN) \
+ -map:$(MISC)/$(@:B).map \
+ $(USE_$(TNR)IMPLIB) \
+ $(STDOBJ) \
+ $(SHL$(TNR)OBJS) $(SHL$(TNR)VERSIONOBJ)) \
+ $(SHL$(TNR)LINKLISTPARAM) \
+ @$(mktmp $(SHL$(TNR)STDLIBS) \
+ $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) \
+ $(SHL$(TNR)LINKRES) \
+ )
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(SHL$(TNR)USE_EXPORTS)"!="name"
+.ELSE # "$(linkinc)"==""
+ $(COMMAND_ECHO)-$(RM) del $(MISC)/$(SHL$(TNR)TARGET).lnk
+ $(COMMAND_ECHO)-$(RM) $(MISC)/$(SHL$(TNR)TARGET).lst
+ $(COMMAND_ECHO)$(TYPE) $(mktmp \
+ $(SHL$(TNR)LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL$(TNR)BASEX) \
+ $(SHL$(TNR)STACK) $(MAPFILE) \
+ -out:$@ \
+ $(LB)/$(SHL$(TNR)IMPLIB).exp \
+ $(STDOBJ) \
+ $(SHL$(TNR)OBJS) \
+ $(SHL$(TNR)STDLIBS) \
+ $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) \
+ $(SHL$(TNR)LINKRES) \
+ ) >> $(MISC)/$(SHL$(TNR)TARGET).lnk
+ $(COMMAND_ECHO)$(TYPE) $(MISC)/$(SHL$(TNR)TARGETN:b)_linkinc.ls >> $(MISC)/$(SHL$(TNR)TARGET).lnk
+ $(COMMAND_ECHO)$(SHL$(TNR)LINKER) @$(MISC)/$(SHL$(TNR)TARGET).lnk
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(linkinc)"==""
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)" == "WNT"
+.IF "$(GUI)"=="UNX"
+.IF "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(@:b).list
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ @echo $(STDSLO) $(SHL$(TNR)OBJS:s/.obj/.o/) \
+ $(SHL$(TNR)VERSIONOBJ) \
+ `cat /dev/null $(SHL$(TNR)LIBS) | sed s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` | tr -s " " "\n" > $(MISC)/$(@:b).list
+ @echo -n $(SHL$(TNR)LINKER) $(SHL$(TNR)LINKFLAGS) $(SHL$(TNR)VERSIONMAPPARA) $(LINKFLAGSSHL) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) -o $@ \
+ $(SHL$(TNR)STDLIBS) $(SHL$(TNR)ARCHIVES) $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) -filelist $(MISC)/$(@:b).list $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-dylib-link-list.pl \
+ `cat $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd` \
+ >> $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ @$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl \
+ shl $(SHL$(TNR)RPATH) $@
+.IF "$(SHL$(TNR)CREATEJNILIB)"!=""
+ @echo "Making: " $(@:f).jnilib
+ @macosx-create-bundle $@
+.ENDIF # "$(SHL$(TNR)CREATEJNILIB)"!=""
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL$(TNR)NOCHECK)"==""
+ $(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS$(TNR)) $(SHL$(TNR)TARGETN)
+.ENDIF # "$(SHL$(TNR)NOCHECK)"!=""
+.ENDIF
+.ELSE # "$(OS)"=="MACOSX"
+ @-$(RM) $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ @echo $(SHL$(TNR)LINKER) $(SHL$(TNR)LINKFLAGS) $(SHL$(TNR)SONAME) $(LINKFLAGSSHL) $(SHL$(TNR)VERSIONMAPPARA) -L$(PRJ)/$(ROUT)/lib $(SOLARLIB) $(STDSLO) $(SHL$(TNR)OBJS:s/.obj/.o/) \
+ $(SHL$(TNR)VERSIONOBJ) -o $@ \
+ `cat /dev/null $(SHL$(TNR)LIBS) | tr -s " " "\n" | $(SED) s\#$(ROUT)\#$(PRJ)/$(ROUT)\#g` \
+ $(SHL$(TNR)STDLIBS) $(SHL$(TNR)ARCHIVES) $(SHL$(TNR)STDSHL) $(STDSHL$(TNR)) $(LINKOUTPUT_FILTER) > $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ .IF "$(VERBOSE)" == "TRUE"
+ @cat $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+ .ENDIF
+ @+source $(MISC)/$(TARGET).$(@:b)_$(TNR).cmd
+.IF "$(UPDATER)"=="YES"
+.IF "$(SHL$(TNR)NOCHECK)"==""
+ $(COMMAND_ECHO)-$(RM) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f)
+ $(COMMAND_ECHO)$(RENAME) $(SHL$(TNR)TARGETN) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f)
+.IF "$(VERBOSE)"=="TRUE"
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS$(TNR)) $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f)
+.ELSE
+ $(COMMAND_ECHO)$(SOLARENV)/bin/checkdll.sh -L$(LB) -L$(SOLARLIBDIR) $(EXTRALIBPATHS$(TNR)) -- -s $(SHL$(TNR)TARGETN:d)check_$(SHL$(TNR)TARGETN:f)
+.ENDIF
+.ENDIF # "$(SHL$(TNR)NOCHECK)"!=""
+.ENDIF # "$(UPDATER)"=="YES"
+.ENDIF # "$(OS)"=="MACOSX"
+.IF "$(UNIXVERSIONNAMES)"!=""
+ $(COMMAND_ECHO)$(RM) $(LB)/$(SHL$(TNR)TARGETN:b)
+ $(COMMAND_ECHO)cd $(LB) && ln -s $(SHL$(TNR)TARGETN:f) $(SHL$(TNR)TARGETN:b)
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+.IF "$(VERBOSE)" == "TRUE"
+ @ls -l $@
+.ENDIF
+.ENDIF # "$(GUI)" == "UNX"
+
+.IF "$(GUI)" == "OS2"
+
+.IF "$(SHL$(TNR)DEFAULTRES)"!=""
+ @+-$(RM) $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc >& $(NULLDEV)
+.IF "$(SHL$(TNR)ICON)" != ""
+ @-+echo 1 ICON $(SHL$(TNR)ICON) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+.ENDIF
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL$(TNR)ADD_VERINFO)"!=""
+ @-+echo $(EMQ)#include $(EMQ)"$(SHL$(TNR)ADD_VERINFO)$(EMQ)" >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+.ENDIF # "$(SHL$(TNR)ADD_VERINFO)"!=""
+ @-+echo MENU 1 BEGIN END >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+# @-+echo $(EMQ)RCDATA 1 { "Build string here" }$(EMQ) >> $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+# YD 04/07/06 seems null, confuses rc cli: -i $(SOLARTESDIR)
+ $(COMMAND_ECHO)$(RC) -r -DOS2 $(INCLUDE) $(RCLINKFLAGS) $(MISC)/$(SHL$(TNR)DEFAULTRES:b).rc
+.ENDIF # "$(SHL$(TNR)DEFAULTRES)"!=""
+
+.IF "$(SHL$(TNR)ALLRES)"!=""
+ $(COMMAND_ECHO)+$(TYPE) $(SHL$(TNR)ALLRES) > $(SHL$(TNR)LINKRES)
+.ENDIF # "$(SHL$(TNR)ALLRES)"!=""
+
+.IF "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL$(TNR)LINKER) $(SHL$(TNR)LINKFLAGS) $(LINKFLAGSSHL) -o $@ \
+ $(SHL$(TNR)DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL$(TNR)OBJS) $(SHL$(TNR)VERSIONOBJ) \
+ $(SHL$(TNR)LIBS) \
+ $(SHL$(TNR)STDLIBS:^"-l") \
+ $(SHL$(TNR)LINKRES) \
+ $(SHL$(TNR)STDSHL:^"-l") $(STDSHL$(TNR):^"-l")
+
+.ELSE # "$(USE_DEFFILE)"!=""
+
+ $(COMMAND_ECHO)$(SHL$(TNR)LINKER) -v $(SHL$(TNR)LINKFLAGS) \
+ $(LINKFLAGSSHL) $(SHL$(TNR)BASEX) \
+ $(SHL$(TNR)STACK) -o $(SHL$(TNR)TARGETN) \
+ $(SHL$(TNR)DEF) \
+ $(STDOBJ) \
+ -L$(LB) \
+ -L$(SOLARVERSION)/$(INPATH)/lib \
+ $(SHL$(TNR)OBJS) $(SHL$(TNR)VERSIONOBJ) \
+ $(SHL$(TNR)LIBS) \
+ $(SHL$(TNR)STDLIBS:^"-l") \
+ $(SHL$(TNR)LINKRES) \
+ $(SHL$(TNR)STDSHL:^"-l") $(STDSHL$(TNR):^"-l") \
+ $(LINKOUTPUTFILTER)
+ @$(LS) $@ >& $(NULLDEV)
+
+.ENDIF # "$(USE_DEFFILE)"!=""
+
+.IF "$(SHL$(TNR)TARGET8)" != "$(SHL$(TNR)TARGET)"
+ $(COMMAND_ECHO)+$(COPY) $@ $(@:d)$(SHL$(TNR)TARGET8).dll
+.ENDIF
+
+.ENDIF # "$(GUI)" == "OS2"
+
+.ENDIF # "$(SHL$(TNR)TARGETN)"!=""
+
+# unroll end
+#######################################################
+
+#-------------------------------------------------------------------------
+
+#######################################################
+# Anweisungen fuer das Linken
+# unroll begin
+
+.IF "$(SHL$(TNR)IMPLIBN)" != ""
+
+.IF "$(UPDATER)"=="YES"
+USELIB$(TNR)DEPN+=$(SHL$(TNR)LIBS)
+.ELSE
+.ENDIF
+
+.IF "$(USE_DEFFILE)"!=""
+USE_SHL$(TNR)TARGET=$(SHL$(TNR)TARGETN)
+.ENDIF
+
+.IF "$(GUI)" != "UNX"
+$(SHL$(TNR)IMPLIBN): \
+ $(SHL$(TNR)DEF) \
+ $(USE_SHL$(TNR)TARGET) \
+ $(USELIB$(TNR)DEPN) \
+ $(USELIBDEPN)
+.ELSE
+$(SHL$(TNR)IMPLIBN): \
+ $(SHL$(TNR)LIBS)
+.ENDIF
+ @echo "Making: " $(@:f)
+.IF "$(GUI)" == "WNT"
+.IF "$(COM)"=="GCC"
+ @echo no ImportLibs on mingw
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ELSE # "$(COM)=="GCC"
+# bei use_deffile implib von linker erstellt
+.IF "$(USE_DEFFILE)"==""
+ $(IMPLIB) $(IMPLIBFLAGS) @$(mktmp -out:$(SHL$(TNR)IMPLIBN) \
+ -def:$(SHL$(TNR)DEF) )
+.ELSE # "$(USE_DEFFILE)==""
+ @echo build of $(SHL$(TNR)TARGETN) creates $@
+ @$(TOUCH) $@
+.ENDIF # "$(USE_DEFFILE)==""
+.ENDIF # "$(COM)"=="GCC"
+
+.ELIF "$(GUI)" == "OS2"
+
+# touch creates an empty file, but this is not good for emxomfar, so
+# create a dummy lib here
+ $(COMMAND_ECHO)-$(LIBMGR) $(LIBFLAGS) $@ $(SHL$(TNR)VERSIONOBJ)
+ +@echo build of $(SHL$(TNR)TARGETN) creates $@
+
+.ELSE
+ @echo no ImportLibs on Mac and *ix
+ @-$(RM) $@
+ @$(TOUCH) $@
+.ENDIF
+.ENDIF
+
+# unroll end
+#######################################################
+
diff --git a/solenv/inc/tg_slo.mk b/solenv/inc/tg_slo.mk
new file mode 100644
index 000000000000..0a0ae789a8c7
--- /dev/null
+++ b/solenv/inc/tg_slo.mk
@@ -0,0 +1,98 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+MKFILENAME:=TG_SLO.MK
+
+.IF "$(SLOTARGET)"!=""
+$(SLOTARGET): $(SLOFILES) $(IDLSLOFILES)
+.IF "$(MDB)" != ""
+ @echo $(SLOTARGET)
+ @echo $(&:+"\n")
+.ENDIF
+ @echo "Making: " $(@:f)
+# @$(RM) $@
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+ +$(ECHONL) $(foreach,i,$(SLOFILES:f) $(RSLO)/$(i)) | xargs -n1 > $@
+.ELSE
+.IF "$(LIBTARGET)"!="NO"
+ @-$(TYPE) $(mktmp $(&:+"\n")) > $(@:s/.lib/.lin/)
+.ENDIF # "$(LIBTARGET)"!="NO"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(&:+"\n"))
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="OS2"
+.IF "$(LIBTARGET)"!="NO"
+ @-$(TYPE) $(mktmp $(&:+"\n")) > $(@:s/.lib/.lin/)
+.ENDIF # "$(LIBTARGET)"!="NO"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(&)
+.ENDIF # "$(GUI)"=="OS2"
+
+.IF "$(GUI)"=="UNX"
+ @echo $(foreach,i,$(SLOFILES:f) $(RSLO)/$(i:s/.obj/.o/)) | xargs -n1 > $@
+.IF "$(OS)"=="MACOSX"
+ @-nm `cat $(SLOTARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ELSE
+ @nm `cat $(SLOTARGET) | sed s\#'^'$(ROUT)\#$(PRJ)/$(ROUT)\#g` > $(@:d)$(@:b).dump
+.ENDIF
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$(SLOTARGET)"!=""
+
+.IF "$(SECOND_BUILD)"!=""
+.IF "$($(SECOND_BUILD)SLOTARGET)"!=""
+$($(SECOND_BUILD)SLOTARGET): $(REAL_$(SECOND_BUILD)_SLOFILES)
+.IF "$(MDB)" != ""
+ @echo $(REAL_$(SECOND_BUILD)SLOTARGET)
+ @echo $(&:+"\n")
+.ENDIF
+ @echo "Making: " $(@:f)
+.IF "$(GUI)"=="WNT"
+.IF "$(COM)"=="GCC"
+ +$(ECHONL) $(foreach,i,$(REAL_$(SECOND_BUILD)_SLOFILES:f) $(RSLO)/$(i)) | xargs -n1 > $@
+.ELSE
+.IF "$(LIBTARGET)"!="NO"
+ @-$(TYPE) $(mktmp $(&:+"\n")) > $(@:s/.lib/.lin/)
+.ENDIF # "$(LIBTARGET)"!="NO"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) /OUT:$@ @$(mktmp $(&:+"\n"))
+
+.IF "$(GUI)"=="OS2"
+.IF "$(LIBTARGET)"!="NO"
+ @-$(TYPE) $(mktmp $(&:+"\n")) > $(@:s/.lib/.lin/)
+.ENDIF # "$(LIBTARGET)"!="NO"
+ $(COMMAND_ECHO)$(LIBMGR) $(LIBFLAGS) $@ $(&)
+.ENDIF # "$(GUI)"=="OS2"
+
+.ENDIF # "$(COM)"=="GCC"
+.ENDIF # "$(GUI)"=="WNT"
+
+.IF "$(GUI)"=="UNX"
+ @echo $(foreach,i,$(REAL_$(SECOND_BUILD)_SLOFILES:f) $(RSLO)/$(i:s/.obj/.o/)) | xargs -n1 > $@
+.ENDIF # "$(GUI)"=="UNX"
+.ENDIF # "$($(SECOND_BUILD)SLOTARGET)"!=""
+.ENDIF # "$(SECOND_BUILD)"!=""
diff --git a/solenv/inc/tg_srs.mk b/solenv/inc/tg_srs.mk
new file mode 100644
index 000000000000..a919069cd3cd
--- /dev/null
+++ b/solenv/inc/tg_srs.mk
@@ -0,0 +1,73 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#######################################################
+# unroll begin
+
+.IF "$(SRS$(TNR)NAME)"!=""
+
+$(MISC)/$(TARGET).$(SRS$(TNR)NAME).dprr: $(LOCALIZE_ME_DEST)
+
+$(MISC)/$(TARGET).$(SRS$(TNR)NAME).dprr: $(SRC$(TNR)FILES)
+ @echo "Making: " $(@:f)
+ @@-$(RM) $(MISC)/$(TARGET).$(SRS$(TNR)NAME).dprr
+ $(COMMAND_ECHO)$(RSC) $(VERBOSITY) $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) -I$(INCLOCPRJ) -I$(INCLOCAL) -I$(INC) -I$(INCCOM) $(RSCDEFS) $(RSCUPDVERDEF) -fp={$(SRS)/$(SRS$(TNR)NAME).srs} -fo=$@ -p=$(TARGET) $(SRC$(TNR)FILES)
+
+.IF "$(WITH_LANG)"!=""
+
+$(foreach,i,$(SRC$(TNR)FILES) $(COMMONMISC)/$(TARGET)/$i) : $$(@:f) $(LOCALIZESDF)
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(COMMONMISC)$/$(PRJNAME)
+ $(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+$(SRS)/$(SRS$(TNR)NAME).srs: $(LOCALIZE_ME_DEST)
+
+$(SRS)/$(SRS$(TNR)NAME).srs: $(foreach,i,$(SRC$(TNR)FILES) $(COMMONMISC)/$(TARGET)/$i)
+.ELSE # "$(WITH_LANG)"!=""
+$(SRS)/$(SRS$(TNR)NAME).srs: $(SRC$(TNR)FILES)
+.ENDIF # "$(WITH_LANG)"!=""
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)$(RSC) -presponse $(VERBOSITY) @$(mktmp \
+ $(SRSDEFAULT) $(RSC_SRS_CHARSET) $(RSCFLAGS) -I$(RSCEXTINC) \
+ $(INCLUDE) $(RSCDEFS) $(RSCUPDVERDEF) \
+ -fp=$@.$(INPATH) \
+ $< \
+ )
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
+ $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
+
+.ENDIF # "$(SRS$(TNR)NAME)"!=""
+
+# unroll end
+#######################################################
+
+
diff --git a/solenv/inc/tg_wntx64.mk b/solenv/inc/tg_wntx64.mk
new file mode 100644
index 000000000000..12e049763a84
--- /dev/null
+++ b/solenv/inc/tg_wntx64.mk
@@ -0,0 +1,514 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+###############################################
+# Windows 64 bit special
+# only used for 64 bit shell extension
+# ( Windows Vista )
+# ---------------------------------------------
+# THIS FILE WILL BE DELETED when a fully ported
+# Windows 64 bit version is available
+###############################################
+
+.IF "$(BUILD_X64)"!=""
+
+.IF "$(SLOTARGET_X64)"!=""
+$(SLOTARGET_X64): $(SLOFILES_X64) $(IDLSLOFILES_X64)
+.IF "$(MDB)" != ""
+ @echo $(SLOTARGET_X64)
+ @echo $(&:+"\n")
+.ENDIF
+ @echo ------------------------------
+ @echo Making: $@
+ @-$(MKDIR) $(SLB_X64)
+.IF "$(LIBTARGET)"!="NO"
+ @-$(TYPE) $(mktmp $(&:+"\n")) > $(@:s/.lib/.lin/)
+.ENDIF # "$(LIBTARGET)"!="NO"
+ $(LIBMGR_X64) $(LIBFLAGS_X64) /OUT:$@ @$(mktmp $(&:+"\n"))
+.ENDIF # "$(SLOTARGET_X64)"!=""
+
+
+# decide how to link
+.IF "$(SHL1CODETYPE)"=="C"
+SHL1LINKFLAGS_X64+=$(LINKCFLAGS_X64)
+.ELSE # "$(SHL1CODETYPE)"=="C"
+SHL1LINKFLAGS_X64+=$(LINKFLAGS_X64)
+.ENDIF # "$(SHL1CODETYPE)"=="C"
+
+.IF "$(SHL2CODETYPE)"=="C"
+SHL2LINKFLAGS_X64+=$(LINKCFLAGS_X64)
+.ELSE # "$(SHL2CODETYPE)"=="C"
+SHL2LINKFLAGS_X64+=$(LINKFLAGS_X64)
+.ENDIF # "$(SHL2CODETYPE)"=="C"
+
+.IF "$(SHL1IMPLIB_X64)" == ""
+SHL1IMPLIB_X64=i$(TARGET)_t1
+.ENDIF # "$(SHL1IMPLIB_X64)" == ""
+USE_1IMPLIB_X64=-implib:$(LB_X64)/$(SHL1IMPLIB_X64).lib
+.IF "$(SHL1TARGET_X64)"!=""
+SHL1IMPLIBN_X64=$(LB_X64)/$(SHL1IMPLIB_X64).lib
+.ENDIF # "$(SLOFILES_X64)$(OBJFILES_X64)"!=""
+
+make_x64_dirs :
+ -$(MKDIR) $(BIN_X64)
+ -$(MKDIR) $(MISC_X64)
+ -$(MKDIR) $(LB_X64)
+ -$(MKDIR) $(SLB_X64)
+
+
+.IF "$(LIBTARGET)" == ""
+ALLTAR : $(SHL1IMPLIBN_X64)
+.ENDIF "$(LIBTARGET)" == ""
+
+# ----------------------------- lib ------------------------------------------
+.IF "$(LIB1TARGET_X64)" != ""
+$(LIB1TARGET_X64) : $(LIB1FILES_X64) \
+ $(LIB1OBJFILES_X64) \
+ $(LIB1DEPN_X64)
+ @echo using: $(LIB1FILES_X64)
+ @echo using: $(LIB1TARGET_X64)
+ @echo ------------------------------
+ @echo Making: $@
+ -$(MKDIR) $(SLB_X64)
+ @@-$(RM) $@
+ $(LIBMGR_X64) $(LIBFLAGS_X64) /OUT:$@ @$(mktmp $(LIB1FILES_X64) $(LIB1OBJFILES_X64))
+ @-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB1OBJFILES_X64)"!=""
+ @$(TYPE) $(mktmp $(LIB1OBJFILES_X64)) > $(null,$(LIB1OBJFILES_X64) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB1OBJFILES_X64)"!=""
+.IF "$(LIB1FILES_X64)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB1FILES_X64) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB1FILES_X64)"!=""
+ @$(ECHONL)
+.ENDIF # "$(LIB1TARGET_X64)" != ""
+
+.IF "$(LIB2TARGET_X64)" != ""
+$(LIB2TARGET_X64) : $(LIB2FILES_X64) \
+ $(LIB2OBJFILES_X64) \
+ $(LIB2DEPN_X64)
+ @echo using: $(LIB2FILES_X64)
+ @echo using: $(LIB2TARGET_X64)
+ @echo ------------------------------
+ @echo Making: $@
+ -$(MKDIR) $(SLB_X64)
+ @@-$(RM) $@
+ $(LIBMGR_X64) $(LIBFLAGS_X64) /OUT:$@ @$(mktmp $(LIB2FILES_X64) $(LIB2OBJFILES_X64))
+ @-$(RM) $(@:s/.lib/.lin/)
+.IF "$(LIB2OBJFILES_X64)"!=""
+ @$(TYPE) $(mktmp $(LIB2OBJFILES_X64)) > $(null,$(LIB2OBJFILES_X64) $(NULLDEV) $(@:s/.lib/.lin/))
+.ENDIF # "$(LIB2OBJFILES_X64)"!=""
+.IF "$(LIB2FILES_X64)"!=""
+ @-$(TYPE) $(foreach,i,$(LIB2FILES_X64) $(i:s/.lib/.lin/)) >> $(@:s/.lib/.lin/)
+.ENDIF # "$(LIB2FILES_X64)"!=""
+ @$(ECHONL)
+.ENDIF # "$(LIB2TARGET_X64)" != ""
+
+# -------------- def ----------------------
+.IF "$(DEF1TARGETN_X64)"!=""
+$(DEF1TARGETN_X64) : \
+ $(DEF1DEPN_X64) \
+ $(DEF1EXPORTFILE_X64)
+ @-$(MKDIR) $(MISC_X64)
+ @-$(RM) $@.tmpfile
+ @echo ------------------------------
+ @echo Making Module-Definitionfile : $@
+ @echo LIBRARY $(EMQ)"$(SHL1TARGETN:f)$(EMQ)" >$@.tmpfile
+ @echo HEAPSIZE 0 >>$@.tmpfile
+ @echo EXPORTS >>$@.tmpfile
+# getversioninfo fuer alle!!
+ @echo GetVersionInfo >>$@.tmpfile
+.IF "$(DEFLIB1NAME_X64)"!=""
+.IF "$(SHL1USE_EXPORTS_X64)"==""
+ @-$(EXPORT1_PROTECT) $(RMHACK1) $(MISC_X64)/$(SHL1TARGET_X64).exp
+ @$(EXPORT1_PROTECT) $(LIBMGR_X64) -EXTRACT:/ /OUT:$(MISC_X64)/$(SHL1TARGET_X64).exp $(SLB_X64)/$(DEFLIB1NAME_X64).lib
+ @$(EXPORT1_PROTECT) $(LDUMP2) -E 20 -F $(MISC_X64)/$(SHL1TARGET_X64).flt $(MISC_X64)/$(SHL1TARGET_X64).exp >>$@.tmpfile
+ $(EXPORT1_PROTECT) $(RMHACK1) $(MISC_X64)/$(SHL1TARGET_X64).exp
+.ELSE # "$(SHL1USE_EXPORTS_X64)"==""
+ @$(EXPORT1_PROTECT) $(DUMPBIN) -DIRECTIVES $(foreach,i,$(DEFLIB1NAME_X64) $(SLB_X64)/$(i).lib) | $(GREP) EXPORT: > $(MISC_X64)/$(SHL1TARGET_X64).direct
+.IF "$(SHL1USE_EXPORTS_X64)"!="name"
+ @$(EXPORT1_PROTECT) $(LDUMP2) -D -E 20 -F $(DEF1FILTER_X64) $(MISC_X64)/$(SHL1TARGET_X64).direct >>$@.tmpfile
+.ELSE # "$(SHL1USE_EXPORTS_X64)"!="name"
+ @$(EXPORT1_PROTECT) $(LDUMP2) -N -D -E 20 -F $(DEF1FILTER_X64) $(MISC_X64)/$(SHL1TARGET_X64).direct >>$@.tmpfile
+.ENDIF # "$(SHL1USE_EXPORTS_X64)"!="name"
+.ENDIF # "$(SHL1USE_EXPORTS)"==""
+.ENDIF # "$(DEFLIB1NAME)"!=""
+.IF "$(DEF1EXPORT1_X64)"!=""
+ @echo $(DEF1EXPORT1_X64) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF1EXPORTFILE_X64)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(DEF1EXPORTFILE_X64) >> $@.tmpfile
+.ENDIF
+ @-$(RM) $@
+ @$(RENAME) $@.tmpfile $@
+.ENDIF # "$(DEF1TARGETN_X64)"!=""
+
+.IF "$(DEF2TARGETN_X64)"!=""
+$(DEF2TARGETN_X64) : \
+ $(DEF2DEPN_X64) \
+ $(DEF2EXPORTFILE_X64)
+ @-$(MKDIR) $(MISC_X64)
+ @-$(RM) $@.tmpfile
+ @echo Making Module-Definitionfile : $@
+ @echo LIBRARY $(EMQ)"$(SHL2TARGETN:f)$(EMQ)" >$@.tmpfile
+ @echo HEAPSIZE 0 >>$@.tmpfile
+ @echo EXPORTS >>$@.tmpfile
+# getversioninfo fuer alle!!
+ @echo GetVersionInfo >>$@.tmpfile
+.IF "$(DEFLIB2NAME_X64)"!=""
+.IF "$(SHL2USE_EXPORTS_X64)"==""
+ @-$(EXPORT2_PROTECT) $(RMHACK1) $(MISC_X64)/$(SHL2TARGET_X64).exp
+ @$(EXPORT2_PROTECT) $(LIBMGR_X64) -EXTRACT:/ /OUT:$(MISC_X64)/$(SHL2TARGET_X64).exp $(SLB_X64)/$(DEFLIB2NAME_X64).lib
+ @$(EXPORT2_PROTECT) $(LDUMP2) -E 20 -F $(MISC_X64)/$(SHL2TARGET_X64).flt $(MISC_X64)/$(SHL2TARGET_X64).exp >>$@.tmpfile
+ $(EXPORT2_PROTECT) $(RMHACK1) $(MISC_X64)/$(SHL2TARGET_X64).exp
+.ELSE # "$(SHL2USE_EXPORTS_X64)"==""
+ @$(EXPORT2_PROTECT) $(DUMPBIN) -DIRECTIVES $(foreach,i,$(DEFLIB2NAME_X64) $(SLB_X64)/$(i).lib) | $(GREP) EXPORT: > $(MISC_X64)/$(SHL2TARGET_X64).direct
+.IF "$(SHL2USE_EXPORTS_X64)"!="name"
+ @$(EXPORT2_PROTECT) $(LDUMP2) -D -E 20 -F $(DEF2FILTER_X64) $(MISC_X64)/$(SHL2TARGET_X64).direct >>$@.tmpfile
+.ELSE # "$(SHL2USE_EXPORTS_X64)"!="name"
+ @$(EXPORT2_PROTECT) $(LDUMP2) -N -D -E 20 -F $(DEF2FILTER_X64) $(MISC_X64)/$(SHL2TARGET_X64).direct >>$@.tmpfile
+.ENDIF # "$(SHL2USE_EXPORTS_X64)"!="name"
+.ENDIF # "$(SHL2USE_EXPORTS)"==""
+.ENDIF # "$(DEFLIB1NAME)"!=""
+.IF "$(DEF2EXPORT2_X64)"!=""
+ @echo $(DEF2EXPORT2_X64) >>$@.tmpfile
+.ENDIF
+.IF "$(DEF2EXPORTFILE_X64)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(DEF2EXPORTFILE_X64) >> $@.tmpfile
+.ENDIF
+ @-$(RM) $@
+ @$(RENAME) $@.tmpfile $@
+.ENDIF # "$(DEF2TARGETN_X64)"!=""
+#-----------------------------------------------------------------------------
+
+# -------------------------------- shl -----------------------------------------
+
+.IF "$(SHL1TARGET_X64)"!=""
+.IF "$(VERSIONOBJ_X64)"!=""
+SHL1VERSIONOBJ_X64:=$(VERSIONOBJ_X64:d){$(subst,$(UPD)$(DLLPOSTFIX),_dflt $(SHL1TARGET_X64))}$(VERSIONOBJ_X64:f)
+USE_VERSIONH_X64:=$(INCCOM)/$(SHL1VERSIONOBJ_X64:b).h
+SHL1VERSIONOBJDEP_X64:=$(VERSIONOBJ_X64:d){$(subst,$(UPD)$(DLLPOSTFIX),_dflt $(SHL1TARGET_X64))}$(VERSIONOBJ_X64:f)
+$(MISC_X64)/$(SHL1VERSIONOBJ_X64:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL1VERSIONOBJ_X64:b).h
+ $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL1VERSIONOBJ_X64:b).h/ > $@
+.INIT : $(SHL1VERSIONOBJDEP_X64)
+.ENDIF
+
+.IF "$(USE_DEFFILE_X64)"==""
+USE_1IMPLIB_DEPS_X64=$(LB_X64)/$(SHL1IMPLIB_X64).lib
+.ENDIF # "$(USE_DEFFILE_X64)"==""
+
+.IF "$(SHL1RES_X64)"!=""
+SHL1ALLRES_X64+=$(SHL1RES_X64)
+SHL1LINKRES_X64*=$(MISC_X64)/$(SHL1TARGET_X64).res
+SHL1LINKRESO_X64*=$(MISC_X64)/$(SHL1TARGET_X64)_res.o
+.ENDIF # "$(SHL1RES_X64)"!=""
+
+.IF "$(SHL1DEFAULTRES_X64)$(use_shl_versions)"!=""
+SHL1DEFAULTRES_X64*=$(MISC_X64)/$(SHL1TARGET_X64)_def.res
+SHL1ALLRES_X64+=$(SHL1DEFAULTRES_X64)
+SHL1LINKRES_X64*=$(MISC_X64)/$(SHL1TARGET_X64).res
+SHL1LINKRESO_X64*=$(MISC_X64)/$(SHL1TARGET_X64)_res.o
+.ENDIF # "$(SHL1DEFAULTRES)$(use_shl_versions)"!=""
+.ENDIF # "$(SHL1TARGET_X64)"=!""
+
+.IF "$(SHL1TARGETN_X64)"!=""
+$(SHL1TARGETN_X64) : \
+ make_x64_dirs \
+ $(SHL1OBJS_X64)\
+ $(SHL1LIBS_X64)\
+ $(USE_1IMPLIB_DEPS_X64)\
+ $(USE_SHL1DEF_X64)\
+ $(USE_SHL1VERSIONMAP_X64)\
+ $(SHL1RES)\
+ $(SHL1DEPN_X64) \
+ $(SHL1LINKLIST_X64)
+ @echo Making: $(SHL1TARGETN_X64)
+.IF "$(SHL1DEFAULTRES_X64)"!=""
+ @@-$(RM) $(MISC_X64)/$(SHL1DEFAULTRES_X64:b).rc
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL1ADD_VERINFO_X64)"!=""
+ @echo $(EMQ)#include $(EMQ)"$(SHL1ADD_VERINFO)$(EMQ)" >> $(MISC_X64)/$(SHL1DEFAULTRES_X64:b).rc
+.ELSE # "$(SHL1ADD_VERINFO_X64)"!=""
+ @echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC_X64)/$(SHL1DEFAULTRES_X64:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC_X64)/$(SHL1DEFAULTRES_X64:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC_X64)/$(SHL1DEFAULTRES_X64:b).rc
+.ENDIF # "$(SHL1ADD_VERINFO_X64)"!=""
+ @echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC_X64)/$(SHL1DEFAULTRES_X64:b).rc
+ @echo $(EMQ)#define ORG_NAME $(SHL1TARGET_X64)$(DLLPOST) >> $(MISC_X64)/$(SHL1DEFAULTRES_X64:b).rc
+ @echo $(EMQ)#define INTERNAL_NAME $(SHL1TARGET_X64:b) >> $(MISC_X64)/$(SHL1DEFAULTRES_X64:b).rc
+ @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC_X64)/$(SHL1DEFAULTRES_X64:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS_X64) $(MISC_X64)/$(SHL1DEFAULTRES_X64:b).rc
+.ENDIF # "$(SHL1DEFAULTRES_X64)"!=""
+.IF "$(SHL1ALLRES_X64)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(SHL1ALLRES_X64) > $(SHL1LINKRES_X64)
+.ENDIF # "$(SHL1ALLRES)"!=""
+.IF "$(USE_DEFFILE_X64)"!=""
+ $(LINK_X64) @$(mktmp \
+ $(SHL1LINKFLAGS_X64) \
+ $(LINKFLAGSSHL_X64) \
+ $(SHL1STACK_X64) $(SHL1BASEX_X64) \
+ -out:$@ \
+ -map:$(MISC_X64)/$(@:b).map \
+ -def:$(SHL1DEF_X64) \
+ $(USE_1IMPLIB_X64) \
+ $(STDOBJ_X64) \
+ $(SHL1VERSIONOBJ_X64) $(SHL1OBJS_X64) \
+ $(SHL1LIBS_X64) \
+ $(SHL1STDLIBS_X64) \
+ $(SHL1STDSHL_X64) $(STDSHL1_X64) \
+ $(SHL1LINKRES_X64) \
+ ) $(LINKOUTPUTFILTER_X64)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE # "$(USE_DEFFILE)"!=""
+ $(LINK_X64) @$(mktmp $(SHL1LINKFLAGS_X64) \
+ $(LINKFLAGSSHL_X64) $(SHL1BASEX_X64) \
+ $(SHL1STACK_X64) -out:$(SHL1TARGETN_X64) \
+ -map:$(MISC_X64)/$(@:B).map \
+ $(LB_X64)/$(SHL1IMPLIB_X64).exp \
+ $(STDOBJ_X64) \
+ $(SHL1OBJS_X64) $(SHL1VERSIONOBJ_X64) \
+ $(SHL1LIBS_X64) \
+ $(SHL1STDLIBS_X64) \
+ $(SHL1STDSHL_X64) $(STDSHL1_X64) \
+ $(SHL1LINKRES_X64) \
+ ) $(LINKOUTPUTFILTER_X64)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(USE_DEFFILE)"!=""
+# ------------------------------------------------------------------------------
+$(SHL1IMPLIBN_X64): \
+ $(SHL1DEF_X64) \
+ $(USE_SHL1TARGET_X64) \
+ $(USELIB1DEPN_X64) \
+ $(USELIBDEPN_X64)
+ @echo Making: $(SHL1IMPLIBN_X64)
+# bei use_deffile implib von linker erstellt
+ @-mkdir $(LB_X64)
+.IF "$(USE_DEFFILE_X64)"==""
+ $(IMPLIB_X64) $(IMPLIBFLAGS_X64) @$(mktmp -out:$(SHL1IMPLIBN_X64) \
+ -def:$(SHL1DEF_X64) )
+.ELSE # "$(USE_DEFFILE_X64)==""
+ @echo build of $(SHL1TARGETN_X64) creates $@
+.ENDIF # "$(USE_DEFFILE_X64)==""
+
+.ENDIF # "$(SHL1TARGETN_X64)"!=""
+
+.IF "$(SHL2IMPLIB_X64)" == ""
+SHL2IMPLIB_X64=i$(TARGET)_t2
+.ENDIF # "$(SHL2IMPLIB_X64)" == ""
+.IF "$(COM)" != "GCC"
+USE_2IMPLIB_X64=-implib:$(LB_X64)/$(SHL2IMPLIB_X64).lib
+.ENDIF # "$(COM)" != "GCC"
+.IF "$(SHL2TARGET_X64)"!=""
+SHL2IMPLIBN_X64=$(LB_X64)/$(SHL2IMPLIB_X64).lib
+.ENDIF # "$(SLOFILES_X64)$(OBJFILES_X64)"!=""
+
+.IF "$(LIBTARGET)" == ""
+ALLTAR : $(SHL2IMPLIBN_X64)
+.ENDIF # "$(LIBTARGET)" == ""
+
+.IF "$(SHL2TARGET_X64)"!=""
+.IF "$(VERSIONOBJ_X64)"!=""
+SHL2VERSIONOBJ_X64:=$(VERSIONOBJ_X64:d){$(subst,$(UPD)$(DLLPOSTFIX),_dflt $(SHL2TARGET_X64))}$(VERSIONOBJ_X64:f)
+USE_VERSIONH_X64:=$(INCCOM)/$(SHL2VERSIONOBJ_X64:b).h
+SHL2VERSIONOBJDEP_X64:=$(VERSIONOBJ_X64:d){$(subst,$(UPD)$(DLLPOSTFIX),_dflt $(SHL2TARGET_X64))}$(VERSIONOBJ_X64:f)
+$(MISC_X64)/$(SHL2VERSIONOBJ_X64:b).c : $(SOLARENV)/src/version.c $(INCCOM)/$(SHL2VERSIONOBJ_X64:b).h
+ $(COMMAND_ECHO)$(TYPE) $(SOLARENV)/src/version.c | $(SED) s/_version.h/$(SHL2VERSIONOBJ_X64:b).h/ > $@
+.INIT : $(SHL2VERSIONOBJDEP_X64)
+.ENDIF
+
+.IF "$(USE_DEFFILE_X64)"==""
+USE_2IMPLIB_DEPS_X64=$(LB_X64)/$(SHL2IMPLIB_X64).lib
+.ENDIF # "$(USE_DEFFILE_X64)"==""
+
+.IF "$(SHL2RES_X64)"!=""
+SHL2ALLRES_X64+=$(SHL2RES_X64)
+SHL2LINKRES_X64*=$(MISC_X64)/$(SHL2TARGET_X64).res
+SHL2LINKRESO_X64*=$(MISC_X64)/$(SHL2TARGET_X64)_res.o
+.ENDIF # "$(SHL2RES_X64)"!=""
+
+.IF "$(SHL2DEFAULTRES_X64)$(use_shl_versions)"!=""
+SHL2DEFAULTRES_X64*=$(MISC_X64)/$(SHL2TARGET_X64)_def.res
+SHL2ALLRES_X64+=$(SHL2DEFAULTRES_X64)
+SHL2LINKRES_X64*=$(MISC_X64)/$(SHL2TARGET_X64).res
+SHL2LINKRESO_X64*=$(MISC_X64)/$(SHL2TARGET_X64)_res.o
+.ENDIF # "$(SHL2DEFAULTRES)$(use_shl_versions)"!=""
+.ENDIF # "$(SHL2TARGET_X64)"=!""
+
+.IF "$(SHL2TARGETN_X64)"!=""
+$(SHL2TARGETN_X64) : \
+ make_x64_dirs \
+ $(SHL2OBJS_X64)\
+ $(SHL2LIBS_X64)\
+ $(USE_2IMPLIB_DEPS_X64)\
+ $(USE_SHL2DEF_X64)\
+ $(USE_SHL2VERSIONMAP_X64)\
+ $(SHL2RES)\
+ $(SHL2DEPN_X64) \
+ $(SHL2LINKLIST_X64)
+ @echo Making: $(SHL2TARGETN_X64)
+.IF "$(SHL2DEFAULTRES_X64)"!=""
+ @@-$(RM) $(MISC_X64)/$(SHL2DEFAULTRES_X64:b).rc
+.IF "$(use_shl_versions)" != ""
+.IF "$(SHL2ADD_VERINFO_X64)"!=""
+ @echo $(EMQ)#include $(EMQ)"$(SHL2ADD_VERINFO)$(EMQ)" >> $(MISC_X64)/$(SHL2DEFAULTRES_X64:b).rc
+.ELSE # "$(SHL2ADD_VERINFO_X64)"!=""
+ @echo $(EMQ)#define ADDITIONAL_VERINFO1 >> $(MISC_X64)/$(SHL2DEFAULTRES_X64:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO2 >> $(MISC_X64)/$(SHL2DEFAULTRES_X64:b).rc
+ @echo $(EMQ)#define ADDITIONAL_VERINFO3 >> $(MISC_X64)/$(SHL2DEFAULTRES_X64:b).rc
+.ENDIF # "$(SHL1ADD_VERINFO_X64)"!=""
+ @echo $(EMQ)#define VERVARIANT $(BUILD) >> $(MISC_X64)/$(SHL2DEFAULTRES_X64:b).rc
+ @echo $(EMQ)#define ORG_NAME $(SHL2TARGET_X64)$(DLLPOST) >> $(MISC_X64)/$(SHL2DEFAULTRES_X64:b).rc
+ @echo $(EMQ)#define INTERNAL_NAME $(SHL1TARGET_X64:b) >> $(MISC_X64)/$(SHL2DEFAULTRES_X64:b).rc
+ @echo $(EMQ)#include $(EMQ)"shlinfo.rc$(EMQ)" >> $(MISC_X64)/$(SHL2DEFAULTRES_X64:b).rc
+.ENDIF # "$(use_shl_versions)" != ""
+ $(COMMAND_ECHO)$(RC) -DWIN32 $(INCLUDE) $(RCLINKFLAGS_X64) $(MISC_X64)/$(SHL2DEFAULTRES_X64:b).rc
+.ENDIF # "$(SHL2DEFAULTRES_X64)"!=""
+.IF "$(SHL2ALLRES_X64)"!=""
+ $(COMMAND_ECHO)$(TYPE) $(SHL2ALLRES_X64) > $(SHL2LINKRES_X64)
+.ENDIF # "$(SHL2ALLRES)"!=""
+.IF "$(USE_DEFFILE_X64)"!=""
+ $(LINK_X64) @$(mktmp \
+ $(SHL2LINKFLAGS_X64) \
+ $(LINKFLAGSSHL_X64) \
+ $(SHL2STACK_X64) $(SHL2BASEX_X64) \
+ -out:$@ \
+ -map:$(MISC_X64)/$(@:b).map \
+ -def:$(SHL2DEF_X64) \
+ $(USE_2IMPLIB_X64) \
+ $(STDOBJ_X64) \
+ $(SHL2VERSIONOBJ_X64) $(SHL2OBJS_X64) \
+ $(SHL2LIBS_X64) \
+ $(SHL2STDLIBS_X64) \
+ $(SHL2STDSHL_X64) $(STDSHL2_X64) \
+ $(SHL2LINKRES_X64) \
+ ) $(LINKOUTPUTFILTER_X64)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ELSE # "$(USE_DEFFILE)"!=""
+ $(LINK_X64) @$(mktmp $(SHL2LINKFLAGS_X64) \
+ $(LINKFLAGSSHL_X64) $(SHL2BASEX_X64) \
+ $(SHL2STACK_X64) -out:$(SHL2TARGETN_X64) \
+ -map:$(MISC_X64)/$(@:B).map \
+ $(LB_X64)/$(SHL2IMPLIB_X64).exp \
+ $(STDOBJ_X64) \
+ $(SHL2OBJS_X64) $(SHL2VERSIONOBJ_X64) \
+ $(SHL2LIBS_X64) \
+ $(SHL2STDLIBS_X64) \
+ $(SHL2STDSHL_X64) $(STDSHL2_X64) \
+ $(SHL2LINKRES_X64) \
+ ) $(LINKOUTPUTFILTER_X64)
+# double check if target was really written... still making sense?
+ @@$(LS) $@
+ @echo linking $@.manifest ...
+.IF "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -manifest $(TRUSTED_MANIFEST_LOCATION)/trustedinfo.manifest -out:$@.tmanifest$(EMQ) $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.tmanifest -outputresource:$@$(EMQ);2 $(FI)
+.ELSE
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(MT) $(MTFLAGS) -manifest $@.manifest -outputresource:$@$(EMQ);2 $(FI)
+.ENDIF # "$(VISTA_MANIFEST)"!=""
+ $(COMMAND_ECHO)$(IFEXIST) $@.manifest $(THEN) $(RM:s/+//) $@.manifest $(FI)
+ $(COMMAND_ECHO)$(IFEXIST) $@.tmanifest $(THEN) $(RM:s/+//) $@.tmanifest $(FI)
+.ENDIF # "$(USE_DEFFILE)"!=""
+
+$(SHL2IMPLIBN_X64): \
+ $(SHL2DEF_X64) \
+ $(USE_SHL2TARGET_X64) \
+ $(USELIB2DEPN_X64) \
+ $(USELIBDEPN_X64)
+ @echo Making: $(SHL2IMPLIBN_X64)
+# bei use_deffile implib von linker erstellt
+ @-mkdir $(LB_X64)
+.IF "$(USE_DEFFILE_X64)"==""
+ $(IMPLIB_X64) $(IMPLIBFLAGS_X64) @$(mktmp -out:$(SHL2IMPLIBN_X64) \
+ -def:$(SHL2DEF_X64) )
+.ELSE # "$(USE_DEFFILE_X64)==""
+ @echo build of $(SHL2TARGETN_X64) creates $@
+.ENDIF # "$(USE_DEFFILE_X64)==""
+
+.ENDIF # "$(SHL2TARGETN_X64)"!=""
+
+
+$(SLO_X64)/%.obj : %.cpp
+ @echo ------------------------------
+ @echo Making: $@
+ @@-$(RM) $@ >& $(NULLDEV)
+ -$(MKDIR) $(@:d)
+ @-$(MKDIR) $(MISC_X64)
+ $(CAPTURE_COMMAND) $(CXX_X64) $(USE_CFLAGS_X64) $(INCLUDE_X64) $(CFLAGSCXX_X64) $(CFLAGSSLO_X64) $(USE_CDEFS_X64) $(CDEFSSLO_X64) $(CDEFSMT_X64) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO_X64)/$*.obj $(CFLAGSINCXX)$(PWD)/$*.cpp $(CAPTURE_OUTPUT)
+
+$(SLO_X64)/%.obj : %.cxx
+ @echo Making: $@
+ @@-$(RM) $@ >& $(NULLDEV)
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)@-$(MKDIR) $(MISC_X64)
+ $(COMMAND_ECHO)$(CAPTURE_COMMAND) $(CXX_X64) $(USE_CFLAGS_X64) $(INCLUDE_X64) $(CFLAGSCXX_X64) $(CFLAGSSLO_X64) $(USE_CDEFS_X64) $(CDEFSSLO_X64) $(CDEFSMT_X64) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ)$(SLO_X64)/$*.obj $(CFLAGSINCXX)$(PWD)/$*.cxx $(CAPTURE_OUTPUT)
+
+$(SLO_X64)/%.obj : $(MISC)/%.c
+ @echo Making: $@
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)@-$(MKDIR) $(MISC_X64)
+ @@-$(RM) $@
+ @$(TYPE) $(mktmp $(CC_X64) $(USE_CFLAGS_X64) $(INCLUDE_C) $(CFLAGSCC_X64) $(CFLAGSSLO_X64) $(USE_CDEFS_X64) $(CDEFSSLO_X64) $(CFLAGSAPPEND_X64) $(CFLAGSOUTOBJ)$(SLO_X64)/$*.obj $(MISC)/$*.c )
+ @$(ECHONL)
+ $(COMMAND_ECHO)$(CC_X64) @$(mktmp $(USE_CFLAGS_X64) $(INCLUDE_C) $(CFLAGSCC_X64) $(CFLAGSSLO_X64) $(USE_CDEFS_X64) $(CDEFSSLO_X64) $(CFLAGSAPPEND_X64) $(CFLAGSOUTOBJ)$(SLO_X64)/$*.obj $(MISC)/$*.c )
+
+$(SLO_X64)/%.obj : %.c
+ @echo Making: $@
+ $(COMMAND_ECHO)-$(MKDIR) $(@:d)
+ $(COMMAND_ECHO)@-$(MKDIR) $(MISC_X64)
+ @@-$(RM) $@
+ $(COMMAND_ECHO)$(CC_X64) @$(mktmp $(USE_CFLAGS_X64) $(INCLUDE_C) $(CFLAGSCC_X64) $(CFLAGSSLO_X64) $(USE_CDEFS_X64) $(CDEFSSLO_X64) $(CDEFSMT_X64) $(CFLAGSAPPEND_X64) $(CFLAGSOUTOBJ)$(SLO_X64)/$*.obj $*.c )
+
+.ENDIF # "$(BUILD_X64)"!=""
diff --git a/solenv/inc/tg_xmerge.mk b/solenv/inc/tg_xmerge.mk
new file mode 100755
index 000000000000..6ff412bb022f
--- /dev/null
+++ b/solenv/inc/tg_xmerge.mk
@@ -0,0 +1,108 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+.IF "$(XTXFILES)"!=""
+
+L10NEXT*=.txt
+XTX_TARGET_PATH*=$(MISC)/$(TARGET)
+
+ALLTAR : $(XTX_TARGET_PATH).xtx.pmerge.mk $(XTXFILES)
+
+$(XTX_TARGET_PATH).xtx.pmerge.mk : $(XTXFILES)
+
+$(XTXFILES) : $(LOCALIZESDF)
+
+.INCLUDE .IGNORE : $(XTX_TARGET_PATH).xtx.pmerge.mk
+
+.IF "$(alllangiso)"!="$(last_merge)"
+XTXMERGEPHONY:=.PHONY
+.ENDIF # "$(alllangiso)" != "$(last_merge)"
+
+$(XTX_TARGET_PATH)/%$(L10NEXT) $(XTXMERGEPHONY) : %.xtx
+ @@-$(MKDIRHIER) $(@:d)
+.IF "$(WITH_LANG)"==""
+ $(COMMAND_ECHO)$(COPY) $< $(@:d)$(@:b)_en-US$(L10NEXT)
+.ELSE # "$(WITH_LANG)"==""
+ @@-$(RM) $@
+ $(COMMAND_ECHO)@noop $(assign XTXMERGELIST+:=$(<:f))
+ $(COMMAND_ECHO)@noop $(assign XTXDESTDIR:=$(@:d))
+.ENDIF # "$(WITH_LANG)"==""
+
+$(XTX_TARGET_PATH).xtx.pmerge.mk : $(XTXMERGELIST)
+.IF "$(WITH_LANG)"!=""
+# xtxex command file requirements:
+# - one file per line
+# - no spaces
+# - no empty lines
+# $(uniq ...) to workaround $assign adding the value twice...
+ @noop $(assign XTXMERGEFILELIST:=$(uniq $(XTXMERGELIST)))
+ $(COMMAND_ECHO) $(SOLARBINDIR)/xtxex -p $(PRJNAME) -r $(PRJ) -o $(XTXDESTDIR) -i @$(mktmp $(XTXMERGEFILELIST:t"\n":s/ //)) -l $(alllangiso:s/ /,/) -f $(alllangiso:s/ /,/) -m $(LOCALIZESDF) -s"[path]/[fileNoExt]_[language]$(L10NEXT)"
+.ENDIF # "$(WITH_LANG)"!=""
+
+ @-$(RM) $@
+ $(COMMAND_ECHO)echo last_merge=$(alllangiso) > $@
+.ENDIF # "$(XTXFILES)"!=""
+
+.IF "$(TREEFILE)"!=""
+ALLTAR : $(MISC)/$(TARGET).tree.pmerge.mk $(TREEFILE)
+
+$(MISC)/$(TARGET).tree.pmerge.mk : $(TREEFILE)
+
+$(TREEFILE) : $(LOCALIZESDF)
+
+.INCLUDE .IGNORE : $(MISC)/$(TARGET).tree.pmerge.mk
+
+.IF "$(alllangiso)"!="$(last_merge)"
+TREEMERGEPHONY:=.PHONY
+.ENDIF # "$(alllangiso)" != "$(last_merge)"
+
+$(OUT_HELP)/en-US/help.tree $(TREEMERGEPHONY) : help.tree
+ @@-$(MKDIRHIER) $(@:d)
+.IF "$(WITH_LANG)"==""
+ $(COMMAND_ECHO)$(COPY) $< $@
+.ELSE # "$(WITH_LANG)"==""
+ @@-$(RM) $@
+ $(COMMAND_ECHO)@noop $(assign TREEMERGELIST+:=$(<:f))
+ $(COMMAND_ECHO)@noop $(assign TREEDESTDIR:=$(@:d:d:d))
+.ENDIF # "$(WITH_LANG)"==""
+
+$(MISC)/$(TARGET).tree.pmerge.mk : $(TREEMERGELIST)
+.IF "$(WITH_LANG)"!=""
+# xtxex command file requirements:
+# - one file per line
+# - no spaces
+# - no empty lines
+# $(uniq ...) to workaround $assign adding the value twice...
+ @noop $(assign TREEMERGEFILELIST:=$(uniq $(TREEMERGELIST)))
+# Variables for the pattern filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path
+ $(COMMAND_ECHO) $(SOLARBINDIR)/xhtex -p $(PRJNAME) -r $(PRJ) -o $(TREEDESTDIR) -i @$(mktmp $(TREEMERGEFILELIST:t"\n":s/ //)) -l $(alllangiso:s/ /,/) -f $(alllangiso:s/ /,/) -m $(LOCALIZESDF) -s"[path]/[language]/[fileNoExt].tree"
+.ENDIF # "$(WITH_LANG)"!=""
+ @-$(RM) $@
+ $(COMMAND_ECHO)echo last_merge=$(alllangiso) > $@
+.ENDIF # "$(TREEFILE)"!=""
+
+
diff --git a/solenv/inc/tg_yxx.mk b/solenv/inc/tg_yxx.mk
new file mode 100644
index 000000000000..5dfb95e07eec
--- /dev/null
+++ b/solenv/inc/tg_yxx.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+$(MISC)/%.cxx : %.y
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)tr -d "\015" < $< > $(MISC)/stripped_$<
+ $(BISON) $(YACCFLAGS) -o $(YACCTARGET) $(MISC)/stripped_$<
+# removing -f switch - avoid getting nothing when copying a file to itself
+ @@-$(COPY:s/-f//) $@.h $(INCCOM)/$(@:b).hxx
+ @@-$(COPY:s/-f//) $(@:d)/$(@:b).hxx $(INCCOM)/$(@:b).hxx
+# fail on not existing .hxx
+ $(COMMAND_ECHO)$(TYPE) $(INCCOM)/$(@:b).hxx >& $(NULLDEV)
+
+$(INCCOM)/yy%.cxx : %.y
+ @echo "Making: " $(@:f)
+ $(COMMAND_ECHO)tr -d "\015" < $< > $(MISC)/stripped_$<
+ $(COMMAND_ECHO)$(BISON) $(YACCFLAGS) -o $(YACCTARGET) $(MISC)/stripped_$<
+# removing -f switch - avoid getting nothing when copying a file to itself
+ @@-$(COPY:s/-f//) $@.h $(INCCOM)/$(@:b).hxx
+ @@-$(COPY:s/-f//) $(@:d)/$(@:b).hxx $(INCCOM)/$(@:b).hxx
+# fail on not existing .hxx
+ $(COMMAND_ECHO)$(TYPE) $(INCCOM)/$(@:b).hxx >& $(NULLDEV)
+
diff --git a/solenv/inc/tg_zip.mk b/solenv/inc/tg_zip.mk
new file mode 100644
index 000000000000..0a0364e02ab3
--- /dev/null
+++ b/solenv/inc/tg_zip.mk
@@ -0,0 +1,154 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#######################################################
+# unroll begin
+
+.IF "$(GUI)"=="WNT"
+command_seperator=&&
+#command_seperator=^
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+.ELIF "$(GUI)"=="OS2"
+command_seperator=&&
+.ELSE
+command_seperator=;
+avoid_cvs_dir=-x "*CVS*" -x "*.svn*"
+
+.ENDIF
+
+.IF "$(ZIP$(TNR)TARGET)"!=""
+
+ZIP$(TNR)EXT*=.zip
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP$(TNR)LIST:s/LANGDIR//)" == "$(ZIP$(TNR)LIST)"
+ZIP$(TNR)TARGETN=$(COMMONBIN)/$(ZIP$(TNR)TARGET)$(ZIP$(TNR)EXT)
+.ELSE
+ZIP$(TNR)TARGETN=$(foreach,i,$(zip$(TNR)alllangiso) $(COMMONBIN)/$(ZIP$(TNR)TARGET)_$i$(ZIP$(TNR)EXT) )
+.ENDIF
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP$(TNR)LIST:s/LANGDIR//)" == "$(ZIP$(TNR)LIST)"
+ZIP$(TNR)TARGETN=$(BIN)/$(ZIP$(TNR)TARGET)$(ZIP$(TNR)EXT)
+.ELSE
+ZIP$(TNR)TARGETN=$(foreach,i,$(zip$(TNR)alllangiso) $(BIN)/$(ZIP$(TNR)TARGET)_$i$(ZIP$(TNR)EXT) )
+.ENDIF
+.ENDIF # "$(common_build_zip)"!=""
+ZIP$(TNR)DEPFILE=$(subst,$(COMMON_OUTDIR),$(OUTPATH) $(subst,/bin/,/misc/ $(ZIP$(TNR)TARGETN:s/$(ZIP$(TNR)EXT)/.dpzz/)))
+ZIPDEPFILES+=$(ZIP$(TNR)DEPFILE)
+
+ZIP$(TNR)DIR*=$(ZIPDIR)
+ZIP$(TNR)FLAGS*=$(ZIPFLAGS)
+.IF "$(zip$(TNR)generatedlangs)"!=""
+zip$(TNR)langdirs*=$(alllangiso)
+.ELSE # "$(zip$(TNR)generatedlangs)"!=""
+zip$(TNR)langdirs:=$(shell @-test -d {$(subst,/$(LANGDIR), $(null,$(ZIP$(TNR)DIR) . $(ZIP$(TNR)DIR)))}/ && find {$(subst,/$(LANGDIR), $(null,$(ZIP$(TNR)DIR) . $(ZIP$(TNR)DIR)))}/ -type d ! -name CVS ! -name ".svn" ! -name "." | sed "s/\.\/\///" | sed "s/\.\///" )
+.ENDIF # "$(zip$(TNR)generatedlangs)"!=""
+.IF "$(ZIP$(TNR)FORCEALLLANG)"!=""
+zip$(TNR)alllangiso:=$(foreach,i,$(completelangiso) $(foreach,j,$(zip$(TNR)langdirs) $(eq,$i,$j $i $(NULL))))
+.ELSE # "$(ZIP$(TNR)ALLLANG)" != ""
+zip$(TNR)alllangiso*:=$(foreach,i,$(alllangiso) $(foreach,j,$(zip$(TNR)langdirs) $(eq,$i,$j $i $(NULL))))
+.ENDIF # "$(ZIP$(TNR)ALLLANG)" != ""
+.ENDIF # "$(ZIP$(TNR)TARGET)"!=""
+
+.IF "$(ZIP$(TNR)TARGETN)"!=""
+
+ZIP$(TNR)TMP:=$(mktmp iii)
+
+$(MISC)/$(TARGET).$(PWD:f).$(ZIP$(TNR)TARGET).dpzz : $(ZIP$(TNR)TARGETN)
+
+.IF "$(common_build_zip)"!=""
+ZIP$(TNR)HELPVAR=$(COMMONBIN)/$(ZIP$(TNR)TARGET)
+.ELSE # "$(common_build_zip)"!=""
+ZIP$(TNR)HELPVAR=$(BIN)/$(ZIP$(TNR)TARGET)
+.ENDIF # "$(common_build_zip)"!=""
+
+$(ZIP$(TNR)DEPFILE) :
+ @echo # > $(MISC)/$(@:f)
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP$(TNR)DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP$(TNR)DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP$(TNR)DIR))) $(command_seperator) $(ZIPDEP) $(ZIP$(TNR)FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP$(TNR)DIR)))/ $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP$(TNR)EXT)/))) $(foreach,j,$(ZIP$(TNR)LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP$(TNR)TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP$(TNR)DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP$(TNR)FLAGS) $(subst,$(OUTPATH),$(COMMON_OUTDIR) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP$(TNR)EXT)/))) $(foreach,j,$(ZIP$(TNR)LIST) "{$(subst,LANGDIR,{$(subst,$(ZIP$(TNR)TARGET)_, $(@:f:b))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP$(TNR)DIR)" != ""
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP$(TNR)DIR)" != ""
+ $(COMMAND_ECHO)-$(MKDIRHIER) $(ZIP$(TNR)DIR)
+ $(COMMAND_ECHO)$(CDD) $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP$(TNR)DIR))) $(command_seperator) $(ZIPDEP) $(ZIP$(TNR)FLAGS) -prefix $(subst,LANGDIR,. $(subst,/LANGDIR, $(ZIP$(TNR)DIR)))/ $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP$(TNR)EXT)/)) $(foreach,j,$(ZIP$(TNR)LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP$(TNR)TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(PWD)/$(PRJ)/$(ROUT)/misc/$(@:f)
+.ELSE # "$(ZIP$(TNR)DIR)" != ""
+ $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP$(TNR)FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP$(TNR)EXT)/)) $(foreach,j,$(ZIP$(TNR)LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP$(TNR)TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") $(avoid_cvs_dir) >> $(MISC)/$(@:f)
+.ENDIF # "$(ZIP$(TNR)DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+ @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f)
+
+
+$(ZIP$(TNR)TARGETN) : delzip $(ZIP$(TNR)DEPS)
+ @echo "Making: " $(@:f)
+ @@$(!eq,$?,$(?:s/delzip/zzz/) -$(RM) echo) $(uniq $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@))
+ @$(eq,$?,$(?:s/delzip/zzz/) noop echo ) rebuilding zipfiles
+ @echo ------------------------------ $(eq,$?,$(?:s/delzip/zzz/) >&$(NULLDEV) )
+.IF "$(common_build_zip)"!=""
+.IF "$(ZIP$(TNR)DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP$(TNR)HELPVAR)_, $(@:db))} $(ZIP$(TNR)DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP$(TNR)FLAGS) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) $(subst,LANGDIR_away/, $(ZIP$(TNR)LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) $@.$(INPATH)
+ $(COMMAND_ECHO)$(RM) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT)
+.ELSE # "$(ZIP$(TNR)DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP$(TNR)FLAGS) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(foreach,j,$(ZIP$(TNR)LIST) $(subst,LANGDIR,{$(subst,$(ZIP$(TNR)HELPVAR)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) \
+ $(FI)
+ @@-$(GNUCOPY) -p $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@) $@.$(INPATH)
+ @-$(RM) $(subst,$(COMMON_OUTDIR),$(OUTPATH) $@)
+.ENDIF # "$(ZIP$(TNR)DIR)" != ""
+ @@-$(RM) $@
+ @$(IFEXIST) $@.$(INPATH) $(THEN) $(RENAME:s/+//) $@.$(INPATH) $@ $(FI)
+# @$(IFEXIST) $@ $(THEN) $(TOUCH) $@ $(FI) # even if it's not used...
+.ELSE # "$(common_build_zip)"!=""
+.IF "$(ZIP$(TNR)DIR)" != ""
+ @@-$(GNUCOPY) -p $@ $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT)
+ $(COMMAND_ECHO)-$(CDD) $(subst,LANGDIR,{$(subst,$(ZIP$(TNR)HELPVAR)_, $(@:db))} $(ZIP$(TNR)DIR)) $(command_seperator) zip $(ZIP_VERBOSITY) $(ZIP$(TNR)FLAGS) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) $(subst,LANGDIR_away/, $(ZIP$(TNR)LIST:s/LANGDIR/LANGDIR_away/)) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) \
+ $(FI)
+ $(COMMAND_ECHO)$(COPY) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT) $@
+ $(COMMAND_ECHO)$(RM) $(ZIP$(TNR)TMP).$(ZIP$(TNR)TARGET){$(subst,$(ZIP$(TNR)HELPVAR),_ $(@:db))}$(ZIP$(TNR)EXT)
+.ELSE # "$(ZIP$(TNR)DIR)" != ""
+ $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP$(TNR)FLAGS) $@ $(foreach,j,$(ZIP$(TNR)LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP$(TNR)TARGET)_, $(@:db))} $j )) -x delzip $(avoid_cvs_dir) $(CHECKZIPRESULT)
+ $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \
+ $(PERL) -w $(SOLARENV)/bin/cleanzip.pl $@ \
+ $(FI)
+.ENDIF # "$(ZIP$(TNR)DIR)" != ""
+.ENDIF # "$(common_build_zip)"!=""
+.ENDIF
+
+# unroll end
+#######################################################
+
diff --git a/solenv/inc/trustedinfo.manifest b/solenv/inc/trustedinfo.manifest
new file mode 100644
index 000000000000..292ed2a30b3c
--- /dev/null
+++ b/solenv/inc/trustedinfo.manifest
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="asInvoker" uiAccess="false">
+ </requestedExecutionLevel>
+ </requestedPrivileges>
+ </security>
+</trustInfo>
+</assembly> \ No newline at end of file
diff --git a/solenv/inc/udkversion.mk b/solenv/inc/udkversion.mk
new file mode 100644
index 000000000000..18fa3cf45d77
--- /dev/null
+++ b/solenv/inc/udkversion.mk
@@ -0,0 +1,33 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# major
+UDK_MAJOR=3
+# minor
+UDK_MINOR=2
+# micro
+UDK_MICRO=7
diff --git a/solenv/inc/unitools.mk b/solenv/inc/unitools.mk
new file mode 100644
index 000000000000..cea303c2ae0f
--- /dev/null
+++ b/solenv/inc/unitools.mk
@@ -0,0 +1,192 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# Common tools - move this to the end / consolidate
+TRANSEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/transex3
+ULFEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/ulfex
+XMLEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xmlex
+XRMEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xrmex
+CFGEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/cfgex
+AUTODOC*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/autodoc
+LOCALIZE_SL*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/localize_sl
+GSICHECK*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/gsicheck
+
+.IF "$(SYSTEM_LIBXSLT)"!="YES"
+XSLTPROC*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xsltproc
+.ELSE # "$(SYSTEM_LIBXSLT)"!="YES"
+XSLTPROC*=$(AUGMENT_LIBRARY_PATH) xsltproc
+.ENDIF # "$(SYSTEM_LIBXSLT)"!="YES"
+
+ULFCONV*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/ulfconv
+
+MAKEDEPEND*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/makedepend
+
+SCP_CHECK_TOOL:=checkscp$E
+
+# iz32110: Calling a cygwin application from a non-cygwin shell requires
+# backslashes to be escaped by another backslash: EES .. extra escape slash
+EES:=
+
+# iz29675: 4nt must not quote special characters, but tcsh has to.
+# *NIX shells needs to use " quotes, but 4nt must not.
+# EMQ .. extra meta quote (\\ at line end is \)
+# USQ .. unix shell quote
+EMQ:=\\
+USQ:="
+
+NULLDEV:=/dev/null
+
+
+# iz29609 helpmacro to check if file exists
+IFEXIST:=if [ -f
+IFNOTEXIST:= if ! test -f
+THEN:= ] ; then
+FI:= ; fi
+PIPEERROR=2>&1 |
+
+# iz31658
+CHECKZIPRESULT:=|| ret=$$?; if [[ "$$ret" != "12" && "$$ret" != "1" ]] ; then exit $$ret ; fi && echo "Nothing to update for zip"
+
+# Platform specific
+.IF "$(GUI)"=="WNT"
+AWK*=awk
+SORT*=sort
+SED*=sed
+GNUPATCH*=patch
+# change drive and directory
+CDD=cd
+# expect cygwin tools to exist
+COPY*=cp
+COPYRECURSE=-r
+DEREFERENCE=-L
+COPYUPDATE=-u
+ECHON=echo -n
+ECHONL=echo
+FIND*=find
+FLIPCMD*=$(PERL) $(SOLARENV)/bin/slfl.pl
+GNUCOPY*=cp
+GNUMAKE*=make
+GREP*=grep
+LS*=ls
+PERL*:=perl
+.EXPORT : PERL
+RENAME*=mv
+TOUCH*=touch
+TYPE*=cat
+DUMPBIN*=dumpbin
+
+.ELIF "$(GUI)"=="UNX" # "$(GUI)"=="WNT"
+SED*=sed
+SORT*=sort
+PERL*=perl
+.EXPORT : PERL
+TYPE=cat
+CDD=cd
+COPY=cp -f
+.IF "$(OS)"=="MACOSX"
+COPYRECURSE=-R
+.ELSE #"$(OS)"=="MACOSX"
+COPYRECURSE=-r
+.ENDIF
+.IF "$(OS)"=="SOLARIS"
+AWK*=nawk
+GNUCOPY*=gnucp
+GNUPATCH*=gnupatch
+GNUTAR*=/usr/sfw/bin/gtar
+DEREFERENCE=
+.ELSE # "$(OS)"=="SOLARIS"
+AWK*=awk
+# this is not true, as BSD does not default to a GNU cp, but BSD cp
+# so in dmake makefiles one should be restricted to use the subset
+# of features that both BSD and GNU make support.
+# as the GNU make build system requires GNUCOPY to really be a GNU copy
+# we work around that for now by not setting GNUCOPY in sdev300.ini
+# for fbsd for now, but for all other platforms it is set.
+GNUCOPY*=cp
+GNUPATCH*=patch
+DEREFERENCE=-L
+.ENDIF # "$(OS)"=="SOLARIS"
+.IF "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
+GNUMAKE*=make
+.ELSE # "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
+GNUMAKE*=gmake
+.ENDIF # "$(OS)"=="LINUX" || "$(OS)"=="MACOSX"
+TOUCH=touch
+RENAME=mv
+GREP=grep
+FIND=find
+LS=ls
+ECHON=echo -n
+ECHONL=echo
+.ELIF "$(GUI)"=="OS2"
+SED*=sed
+SORT*=sort
+PERL*=perl
+TYPE=cat
+CDD=@cd
+COPY*=$(SHELL) /c copy /b
+COPYRECURSE=/s
+COPYUPDATE=/u
+DELAY=sleep
+ECHON*=echos
+ECHONL=+echo.
+AWK*=awk
+GNUCOPY*=cp
+GNUPATCH*=gnupatch
+GNUMAKE*=make
+TOUCH=touch /c
+#YD rename doesn't work across different drives!
+RENAME=mv
+MKDIR=+md
+MKDIRHIER=+md /s
+GREP=grep
+FIND=find
+LS=ls
+DUMPBIN=echo
+4nt_force_shell:=+
+
+.ENDIF # "$(GUI)"=="UNX"
+
+# (Global) Set if not set before
+DELAY*=sleep
+MKDIR*=mkdir$E
+MKDIRHIER*=mkdir$E -p
+RMDIR*=rmdir
+XARGS*=xargs
+GNUTAR*:=tar
+
+RM+=$(RMFLAGS)
+ADJUSTVISIBILITY*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/adjustvisibility
+CONVERT*:=$(PERL) $(SOLARENV)/bin/leconvert.pl
+EXECTEST := $(PERL) -w $(SOLARENV)/bin/exectest.pl
+GCCINSTLIB:=$(PERL) -w $(SOLARENV)/bin/gccinstlib.pl
+
+# The dmake $(PWD) apparantly produces paths with symlinks resolved, while the
+# bash pwd command by default produces paths with unresolved symlinks, so that
+# computing PATH_IN_MODULE in settings.mk would fail without the -P flag to the
+# bash pwd command:
+PWDFLAGS = -P
diff --git a/solenv/inc/unx.mk b/solenv/inc/unx.mk
new file mode 100644
index 000000000000..e558c9955d82
--- /dev/null
+++ b/solenv/inc/unx.mk
@@ -0,0 +1,208 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# --- Unix-Environment ---------------------------------------
+# Used if "$(GUI)" == "UNX"
+
+
+# Dieses Define gilt fuer alle WNT- Plattformen
+# fuer Compiler, wo kein Java unterstuetzt wird, muss dies ge'undeft werden
+#JAVADEF=-DSOLAR_JAVA
+
+# --- Compiler ---
+
+.IF "$(COM)$(OS)$(CPU)" == "C50SOLARISS"
+.INCLUDE : unxsols2.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "C50SOLARISI"
+.INCLUDE : unxsoli2.mk
+.ENDIF
+
+.IF "$(OS)$(CPU)$(COMEX)" == "SOLARISS3"
+.INCLUDE : unxsols3.mk
+.ENDIF
+
+.IF "$(OS)$(CPU)$(COMEX)" == "SOLARISI3"
+.INCLUDE : unxsoli3.mk
+.ENDIF
+
+.IF "$(OS)$(CPU)$(COMEX)" == "SOLARISS4"
+.INCLUDE : unxsols4.mk
+.ENDIF
+
+.IF "$(OS)$(CPU)$(COMEX)" == "SOLARISI4"
+.INCLUDE : unxsoli4.mk
+.ENDIF
+
+.IF "$(OS)$(CPU)$(COMEX)" == "SOLARISU4"
+.INCLUDE : unxsolu4.mk
+.ENDIF
+
+.IF "$(OS)$(CPU)$(COMEX)" == "SOLARISX4"
+.INCLUDE : unxsolx4.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCSOLARISS"
+.INCLUDE : unxsogs.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCSOLARISI"
+.INCLUDE : unxsogi.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCSCOI"
+.INCLUDE : unxscoi.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXS"
+.INCLUDE : unxlngs.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXI"
+.INCLUDE : unxlngi.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXX"
+.INCLUDE : unxlngx.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)$(CPUNAME)" == "GCCLINUXPPOWERPC"
+.INCLUDE : unxlngppc.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)$(CPUNAME)" == "GCCLINUXPPOWERPC64"
+.INCLUDE : unxlngppc64.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)$(CPUNAME)" == "GCCLINUX3S390"
+.INCLUDE : unxlngs390.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)$(CPUNAME)" == "GCCLINUX3S390X"
+.INCLUDE : unxlngs390x.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXR"
+.INCLUDE : unxlngr.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXA"
+.INCLUDE : unxlnga.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "ACCHPUXR"
+.INCLUDE : unxhpxr.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCHPUXR"
+.INCLUDE : unxhpgr.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCNETBSDA"
+.INCLUDE : unxbsda.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "ICCAIXP"
+.INCLUDE : unxaixp.mk
+.ENDIF
+
+.IF "$(COM)$(CVER)$(OS)$(CPU)" == "GCCC295NETBSDI"
+.INCLUDE : unxbsdi.mk
+.ENDIF
+
+.IF "$(COM)$(CVER)$(OS)$(CPU)" == "GCCC300NETBSDI"
+.INCLUDE : unxbsdi2.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCNETBSDS"
+.INCLUDE : unxbsds.mk
+.ENDIF
+
+.IF "$(COM)$(OS)" == "GCCFREEBSD"
+.INCLUDE : unxfbsd.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCMACOSXP"
+.INCLUDE : unxmacxp.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCMACOSXI"
+.INCLUDE : unxmacxi.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXM"
+.INCLUDE : unxlngmips.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCLINUX6"
+.INCLUDE : unxlngm68k.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXH"
+.INCLUDE : unxlnghppa.mk
+.ENDIF
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXL"
+.INCLUDE : unxlngaxp.mk
+.ENDIF
+
+# --- general *ix settings ---
+HC=hc
+HCFLAGS=
+PATH_SEPERATOR*=:
+CDEFS+=-D__DMAKE
+
+CDEFS+=-DUNIX
+
+# fuer linux: bison -y -d
+YACC*=yacc
+YACCFLAGS*=-d -t
+
+EXECPOST=
+SCPPOST=.ins
+DLLDEST=$(LB)
+SOLARSHAREDBIN=$(SOLARLIBDIR)
+SONAME_SWITCH*=-h
+
+.IF "$(UNIXVERSIONNAMES)"!=""
+DLLPOST!:=$(DLLPOST).$($(UNIXVERSIONNAMES)_MAJOR)
+.ENDIF # "$(UNIXVERSIONNAMES)"!=""
+
+# enable building/linking KDE-dependent code in both OOo and SO build environment
+.IF "$(ENABLE_KDE)" != ""
+.IF "$(KDE_ROOT)"!=""
+KDE_CFLAGS:=-I$(KDE_ROOT)/include -DQT_CLEAN_NAMESPACE
+KDE_LIBS:=-lkdeui -lkdecore -lqt-mt
+SOLARLIB+=-L$(KDE_ROOT)/lib
+.IF "$(OS)$(CPU)" == "LINUXX"
+SOLARLIB+=-L$(KDE_ROOT)/lib64
+.ENDIF # "$(OS)$(CPU)" == "LINUXX"
+.ENDIF # "$(KDE_ROOT)"!=""
+.ENDIF # "$(ENABLE_KDE)" != ""
+
+OOO_LIBRARY_PATH_VAR *= LD_LIBRARY_PATH
diff --git a/solenv/inc/unxaixp.mk b/solenv/inc/unxaixp.mk
new file mode 100644
index 000000000000..571cee1053c6
--- /dev/null
+++ b/solenv/inc/unxaixp.mk
@@ -0,0 +1,113 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mak file fuer unxaixp
+ASM=
+AFLAGS=
+
+ARCH_FLAGS*=
+
+CXX= xlC_r
+CC= xlc_r
+CFLAGS= -c -qlanglvl=extended -qchars=signed
+CDEFS+= -D_PTHREADS
+CDEFS+= -D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE
+CFLAGSCC=$(ARCH_FLAGS)
+CFLAGSCXX=$(ARCH_FLAGS)
+CFLAGSOBJGUIMT=
+CFLAGSOBJCUIMT=
+CFLAGSSLOGUIMT=
+CFLAGSSLOCUIMT=
+CFLAGSPROF=
+CFLAGSDEBUG=
+CFLAGSDBGUTIL=
+CFLAGSOPT= -O
+CFLAGSNOOPT=
+CFLAGSOUTOBJ= -o
+
+STATIC= # -Bstatic
+DYNAMIC= # -Bdynamic
+
+#
+# Zu den Linkflags von shared Libraries:
+#
+# -G Erzeugen eines Shared-Objects
+# -brtl aktiviert Runtime-Linking, wird von -G mitgesetzt
+# -bsymbolc loest Symbole innerhalb einer Library zur Linkzeit auf
+# -p0 ??? (ENOMANPAGESINSTALLABLEFROMCD)
+# -bnoquiet verbose
+#
+LINK=
+LINKFLAGS=
+LINKFLAGSAPPCUI= xlC_r -qlanglvl=extended -qchars=signed -brtl -bnolibpath
+LINKFLAGSAPPGUI= xlC_r -qlanglvl=extended -qchars=signed -brtl -bnolibpath
+LINKFLAGSSHLCUI= makeC++SharedLib_r -G -bsymbolic -bdynamic -bnolibpath -p0
+LINKFLAGSSHLGUI= makeC++SharedLib_r -G -bsymbolic -bdynamic -bnolibpath -p0
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=
+LINKFLAGSOPT=
+
+# Reihenfolge der libs NICHT egal!
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+# application
+STDLIBGUIMT= # -lX11 -ldl
+STDLIBCUIMT= # -lX11 -ldl
+# shared library
+STDSHLGUIMT= -lX11 -ldl
+STDSHLCUIMT= -lX11 -ldl
+THREADLIB=
+
+LIBMGR= ar
+LIBFLAGS= -r
+# LIBEXT= .so
+
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=irc
+RCFLAGS= -fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX= ap
+.IF "$(WORK_STAMP)"=="MIX364"
+DLLPOSTFIX=
+.ENDIF
+DLLPRE= lib
+DLLPOST= .so
+
+
+LDUMP= cppfilt /b /n /o /p
+
diff --git a/solenv/inc/unxbsda.mk b/solenv/inc/unxbsda.mk
new file mode 100644
index 000000000000..fefaa1f02bd7
--- /dev/null
+++ b/solenv/inc/unxbsda.mk
@@ -0,0 +1,99 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mak file fuer unxbsda
+
+ASM=
+AFLAGS=
+
+ARCH_FLAGS*=
+
+CC= gcc -c
+CXX= g++ -c
+CDEFS+= -D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE
+CDEFS+= -D_REENTRANT # -D_PTHREADS -DPOSIX_PTHREAD_SEMANTICS
+CDEFS+= -DPRINTER_DUMMY
+CFLAGSCC= -fsigned-char $(ARCH_FLAGS)
+CFLAGSCXX= -fsigned-char $(ARCH_FLAGS)
+PICSWITCH:=-fPIC
+CFLAGSOBJGUIMT=
+CFLAGSOBJCUIMT=
+CFLAGSSLOGUIMT=$(PICSWITCH)
+CFLAGSSLOCUIMT=$(PICSWITCH)
+CFLAGSPROF=
+CFLAGSDEBUG= -g
+CFLAGSDBGUTIL=
+CFLAGSOPT= -O2
+CFLAGSNOOPT=
+CFLAGSOUTOBJ= -o
+
+STATIC= -Bstatic
+DYNAMIC= -Bdynamic
+
+THREADLIB= pthread
+LINK= ld -e start -dc -dp
+LINKFLAGS=
+LINKFLAGSAPPGUI=
+LINKFLAGSSHLGUI=
+LINKFLAGSAPPCUI=
+LINKFLAGSSHLCUI=
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=
+LINKFLAGSOPT=
+
+STDOBJGUI= /usr/lib/crt0.o
+STDSLOGUI= /usr/lib/crt0.o
+STDOBJCUI= /usr/lib/crt0.o
+STDSLOCUI= /usr/lib/crt0.o
+STDLIBGUIMT= -Bdynamic -lc -Bstatic -lg++ -lstdc++ -Bdynamic -lm -lgcc -lc -lgcc
+STDLIBCUIMT= -Bdynamic -lc -Bstatic -lg++ -lstdc++ -Bdynamic -lm -lgcc -lc -lgcc
+STDSHLGUIMT= -Bdynamic -lc -Bstatic -lg++ -lstdc++ -Bdynamic -lm -lgcc -lc -lgcc
+STDSHLCUIMT= -Bdynamic -lc -Bstatic -lg++ -lstdc++ -Bdynamic -lm -lgcc -lc -lgcc
+
+LIBMGR= ar
+LIBFLAGS= -r
+LIBEXT= .a
+
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=irc
+RCFLAGS= -fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX= ba
+DLLPRE= lib
+DLLPOST= .so
+
+LDUMP=
+
diff --git a/solenv/inc/unxbsdi.mk b/solenv/inc/unxbsdi.mk
new file mode 100644
index 000000000000..5e9c06605940
--- /dev/null
+++ b/solenv/inc/unxbsdi.mk
@@ -0,0 +1,179 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for unxbsdi
+ASM=
+AFLAGS=
+
+SOLAR_JAVA=TRUE
+JAVAFLAGSDEBUG=-g
+
+# filter for supressing verbose messages from linker
+#not needed at the moment
+#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
+
+# _PTHREADS is needed for the stl
+CDEFS+=-DX86 -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=$(STLPORT_VER)
+
+# this is a platform with JAVA support
+.IF "$(SOLAR_JAVA)"!=""
+JAVADEF=-DSOLAR_JAVA
+.IF "$(debug)"==""
+JAVA_RUNTIME=-ljava
+.ELSE
+JAVA_RUNTIME=-ljava_g
+.ENDIF
+.ENDIF
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=-mpentiumpro
+
+# name of C++ Compiler
+CXX*=g++
+# name of C Compiler
+CC*=gcc
+# flags for C and C++ Compiler
+CFLAGS+=-c
+# flags for the C++ Compiler
+CFLAGSCC= -pipe $(ARCH_FLAGS)
+# Flags for enabling exception handling
+CFLAGSEXCEPTIONS=-fexceptions
+# Flags for disabling exception handling
+CFLAGS_NO_EXCEPTIONS=-fno-exceptions
+
+CFLAGSCXX= -pipe -frtti $(ARCH_FLAGS)
+PICSWITCH:=-fpic
+
+# Compiler flags for compiling static object in multi threaded environment with graphical user interface
+CFLAGSOBJGUIMT=
+# Compiler flags for compiling static object in multi threaded environment with character user interface
+CFLAGSOBJCUIMT=
+# Compiler flags for compiling shared object in multi threaded environment with graphical user interface
+CFLAGSSLOGUIMT=$(PICSWITCH)
+# Compiler flags for compiling shared object in multi threaded environment with character user interface
+CFLAGSSLOCUIMT=$(PICSWITCH)
+# Compiler flags for profiling
+CFLAGSPROF=
+# Compiler flags for debugging
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+# Compiler flags for enabling optimizations
+CFLAGSOPT=-O2
+# Compiler flags for disabling optimizations
+CFLAGSNOOPT=-O
+# Compiler flags for describing the output path
+CFLAGSOUTOBJ=-o
+
+CFLAGSWARNCC=
+CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy
+# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
+CFLAGSWALLCC=-Wall -Wextra -Wendif-labels
+CFLAGSWALLCXX=$(CFLAGSWALLCC) -Wshadow -Wno-ctor-dtor-privacy
+CFLAGSWERRCC=-Werror
+
+# switches for dynamic and static linking
+STATIC = -Wl,-Bstatic
+DYNAMIC = -Wl,-Bdynamic
+
+# name of linker
+LINK*=gcc
+# default linker flags
+LINKFLAGS=
+
+# linker flags for linking applications
+LINKFLAGSAPPGUI= -Wl,-export-dynamic
+LINKFLAGSAPPCUI= -Wl,-export-dynamic
+
+# linker flags for linking shared libraries
+LINKFLAGSSHLGUI= -shared
+LINKFLAGSSHLCUI= -shared
+
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=-g
+LINKFLAGSOPT=
+
+.IF "$(NO_BSYMBOLIC)"==""
+.IF "$(PRJNAME)" != "envtest"
+LINKFLAGSSHLGUI+=-Wl,-Bsymbolic
+LINKFLAGSSHLCUI+=-Wl,-Bsymbolic
+.ENDIF
+.ENDIF # "$(NO_BSYMBOLIC)"==""
+
+LINKVERSIONMAPFLAG=-Wl,--version-script
+
+SONAME_SWITCH=-Wl,-h
+
+# Sequence of libs does matter !
+
+STDLIBCPP=-lstdc++
+
+# default objectfilenames to link
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+
+# libraries for linking applications
+STDLIBGUIMT=-lX11 -lpthread -lm
+STDLIBCUIMT=-lpthread -lm
+# libraries for linking shared libraries
+STDSHLGUIMT=-lX11 -lXext -lpthread -lm
+STDSHLCUIMT=-lpthread -lm
+
+.IF "$(STLPORT_VER)" >= "500"
+LIBSTLPORT=$(DYNAMIC) -lstlport
+LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
+.ELSE
+LIBSTLPORT=$(DYNAMIC) -lstlport_gcc
+LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
+.ENDIF
+
+
+# name of library manager
+LIBMGR=ar
+LIBFLAGS=-r
+
+# tool for generating import libraries
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=irc
+RCFLAGS=-fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+# platform specific identifier for shared libs
+DLLPOSTFIX=bi
+DLLPRE=lib
+DLLPOST=.so
+
diff --git a/solenv/inc/unxbsdi2.mk b/solenv/inc/unxbsdi2.mk
new file mode 100644
index 000000000000..f4206304501b
--- /dev/null
+++ b/solenv/inc/unxbsdi2.mk
@@ -0,0 +1,198 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for unxbsdi2
+ASM=
+AFLAGS=
+
+SOLAR_JAVA=TRUE
+JAVAFLAGSDEBUG=-g
+
+# filter for supressing verbose messages from linker
+#not needed at the moment
+#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
+
+# _PTHREADS is needed for the stl
+CDEFS+= -DX86 -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=$(STLPORT_VER)
+
+# this is a platform with JAVA support
+.IF "$(SOLAR_JAVA)"!=""
+JAVADEF=-DSOLAR_JAVA
+.IF "$(debug)"==""
+JAVA_RUNTIME=-ljava
+.ELSE
+JAVA_RUNTIME=-ljava_g
+.ENDIF
+.ENDIF
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=
+
+# name of C++ Compiler
+CXX*=g++
+# name of C Compiler
+CC*=gcc
+# flags for C and C++ Compiler
+CFLAGS+=-fmessage-length=0 -c
+
+# flags to enable build with symbols; required for crashdump feature
+.IF "$(ENABLE_SYMBOLS)"=="SMALL"
+CFLAGSENABLESYMBOLS=-g1
+.ELSE
+CFLAGSENABLESYMBOLS=-g
+.ENDIF
+
+# flags for the C++ Compiler
+CFLAGSCC= -pipe $(ARCH_FLAGS)
+# Flags for enabling exception handling
+CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
+# Flags for disabling exception handling
+CFLAGS_NO_EXCEPTIONS=-fno-exceptions
+
+CFLAGSCXX= -pipe -frtti $(ARCH_FLAGS)
+PICSWITCH:=-fpic
+
+# Compiler flags for compiling static object in multi threaded environment with graphical user interface
+CFLAGSOBJGUIMT=
+# Compiler flags for compiling static object in multi threaded environment with character user interface
+CFLAGSOBJCUIMT=
+# Compiler flags for compiling shared object in multi threaded environment with graphical user interface
+CFLAGSSLOGUIMT=$(PICSWITCH)
+# Compiler flags for compiling shared object in multi threaded environment with character user interface
+CFLAGSSLOCUIMT=$(PICSWITCH)
+# Compiler flags for profiling
+CFLAGSPROF=
+# Compiler flags for debugging
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+# Compiler flags for enabling optimizations
+# CFLAGSOPT=-O2
+# reduce to -O1 to avoid optimization problems
+CFLAGSOPT=-O1
+# Compiler flags for disabling optimizations
+CFLAGSNOOPT=-O
+# Compiler flags for describing the output path
+CFLAGSOUTOBJ=-o
+
+CFLAGSWARNCC=
+CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy
+# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
+CFLAGSWALLCC=-Wall -Wextra -Wendif-labels
+CFLAGSWALLCXX=$(CFLAGSWALLCC) -Wshadow -Wno-ctor-dtor-privacy
+CFLAGSWERRCC=-Werror
+
+# switches for dynamic and static linking
+STATIC = -Wl,-Bstatic
+DYNAMIC = -Wl,-Bdynamic
+
+# name of linker
+LINK*=$(CC)
+
+# default linker flags
+LINKFLAGSDEFS*=-z defs
+LINKFLAGSRUNPATH_URELIB=-Wl,-rpath,\''$$ORIGIN'\'
+LINKFLAGSRUNPATH_UREBIN=-Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\'
+ #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
+LINKFLAGSRUNPATH_OOO=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
+LINKFLAGSRUNPATH_SDK=-Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\'
+LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
+LINKFLAGSRUNPATH_OXT=
+LINKFLAGSRUNPATH_NONE=
+LINKFLAGS=-z combreloc $(LINKFLAGSDEFS)
+
+# linker flags for linking applications
+LINKFLAGSAPPGUI= -Wl,-export-dynamic
+LINKFLAGSAPPCUI= -Wl,-export-dynamic
+
+# linker flags for linking shared libraries
+LINKFLAGSSHLGUI= -shared
+LINKFLAGSSHLCUI= -shared
+
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=-g
+LINKFLAGSOPT=
+
+# linker flags for optimization (symbol hashtable)
+# for now, applied to symbol scoped libraries, only
+LINKFLAGSOPTIMIZE*=-Wl,-O1
+LINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script
+
+SONAME_SWITCH=-Wl,-h
+
+# Sequence of libs does matter !
+
+STDLIBCPP=-lstdc++
+
+# default objectfilenames to link
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+
+# libraries for linking applications
+STDLIBGUIMT=-lX11 -lpthread -lm
+STDLIBCUIMT=-lpthread -lm
+# libraries for linking shared libraries
+STDSHLGUIMT=-lX11 -lXext -lpthread -lm
+STDSHLCUIMT=-lpthread -lm
+
+LIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
+
+.IF "$(STLPORT_VER)" >= "500"
+LIBSTLPORT=$(DYNAMIC) -lstlport -lstdc++
+LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
+.ELSE
+LIBSTLPORT=$(DYNAMIC) -lstlport_gcc -lstdc++
+LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
+.ENDIF
+
+#FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
+
+# name of library manager
+LIBMGR=ar
+LIBFLAGS=-r
+
+# tool for generating import libraries
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=irc
+RCFLAGS=-fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+# platform specific identifier for shared libs
+DLLPOSTFIX=bi
+DLLPRE=lib
+DLLPOST=.so
+
diff --git a/solenv/inc/unxbsds.mk b/solenv/inc/unxbsds.mk
new file mode 100644
index 000000000000..0811c85a4c6d
--- /dev/null
+++ b/solenv/inc/unxbsds.mk
@@ -0,0 +1,179 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for unxbsds
+ASM=gcc
+AFLAGS=-Wa,-Av8plusa,-K,PIC -x assembler-with-cpp -c $(CDEFS)
+
+SOLAR_JAVA=TRUE
+JAVAFLAGSDEBUG=-g
+
+# filter for supressing verbose messages from linker
+#not needed at the moment
+#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
+
+# _PTHREADS is needed for the stl
+CDEFS+=-D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=$(STLPORT_VER) -DOSL_USE_SYS_V_SEMAPHORE
+
+# this is a platform with JAVA support
+.IF "$(SOLAR_JAVA)"!=""
+JAVADEF=-DSOLAR_JAVA
+.IF "$(debug)"==""
+JAVA_RUNTIME=-ljava
+.ELSE
+JAVA_RUNTIME=-ljava_g
+.ENDIF
+.ENDIF
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=
+
+# name of C++ Compiler
+CXX=g++
+# name of C Compiler
+CC=gcc
+# flags for C and C++ Compiler
+CFLAGS=-c
+# flags for the C++ Compiler
+CFLAGSCC= -pipe $(ARCH_FLAGS)
+
+# Flags for enabling exception handling
+CFLAGSEXCEPTIONS=-fexceptions
+# Flags for disabling exception handling
+CFLAGS_NO_EXCEPTIONS=-fno-exceptions
+
+CFLAGSCXX= -pipe $(ARCH_FLAGS)
+PICSWITCH:=-fPIC
+
+# Compiler flags for compiling static object in multi threaded environment with graphical user interface
+CFLAGSOBJGUIMT=$(PICSWITCH)
+# Compiler flags for compiling static object in multi threaded environment with character user interface
+CFLAGSOBJCUIMT=$(PICSWITCH)
+# Compiler flags for compiling shared object in multi threaded environment with graphical user interface
+CFLAGSSLOGUIMT=$(PICSWITCH)
+# Compiler flags for compiling shared object in multi threaded environment with character user interface
+CFLAGSSLOCUIMT=$(PICSWITCH)
+# Compiler flags for profiling
+CFLAGSPROF=
+# Compiler flags for debugging
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+# Compiler flags for enabling optimizations
+CFLAGSOPT=-O2
+# Compiler flags for disabling optimizations
+CFLAGSNOOPT=-O
+# Compiler flags for describing the output path
+CFLAGSOUTOBJ=-o
+
+CFLAGSWARNCC=
+CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy
+# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
+CFLAGSWALLCC=-Wall -Wextra -Wendif-labels
+CFLAGSWALLCXX=$(CFLAGSWALLCC) -Wshadow -Wno-ctor-dtor-privacy
+CFLAGSWERRCC=-Werror
+
+# switches for dynamic and static linking
+STATIC = -Wl,-Bstatic
+DYNAMIC = -Wl,-Bdynamic
+
+# name of linker
+LINK=gcc
+# default linker flags
+LINKFLAGS=
+
+# linker flags for linking applications
+LINKFLAGSAPPGUI= -Wl,-export-dynamic
+LINKFLAGSAPPCUI= -Wl,-export-dynamic
+# linker flags for linking shared libraries
+LINKFLAGSSHLGUI= -shared
+LINKFLAGSSHLCUI= -shared
+
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=-g
+LINKFLAGSOPT=
+
+.IF "$(NO_BSYMBOLIC)"==""
+.IF "$(PRJNAME)" != "envtest"
+LINKFLAGSSHLGUI+=-Wl,-Bsymbolic
+LINKFLAGSSHLCUI+=-Wl,-Bsymbolic
+.ENDIF
+.ENDIF # "$(NO_BSYMBOLIC)"==""
+
+LINKVERSIONMAPFLAG=-Wl,--version-script
+
+# Sequence of libs does matter !
+
+STDLIBCPP=-lstdc++
+
+# default objectfilenames to link
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+
+# libraries for linking applications
+STDLIBGUIMT=-lX11 -lpthread -lm
+STDLIBCUIMT=-lpthread -lm
+# libraries for linking shared libraries
+STDSHLGUIMT=-lX11 -lXext -lpthread -lm
+STDSHLCUIMT=-lpthread -lm
+
+# STLport always needs pthread. This may yield some redundant -lpthread
+# but that doesn't matter.
+.IF "$(STLPORT_VER)" >= "500"
+LIBSTLPORT=$(DYNAMIC) -lstlport -lpthread
+LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC) -lpthread
+.ELSE
+LIBSTLPORT=$(DYNAMIC) -lstlport_gcc -lpthread
+LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC) -lpthread
+.ENDIF
+
+
+# name of library manager
+LIBMGR=ar
+LIBFLAGS=-r
+
+# tool for generating import libraries
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=irc
+RCFLAGS=-fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+# platform specific identifier for shared libs
+DLLPOSTFIX=bs
+DLLPRE=lib
+DLLPOST=.so
+
diff --git a/solenv/inc/unxfbsd.mk b/solenv/inc/unxfbsd.mk
new file mode 100644
index 000000000000..4a22beaec256
--- /dev/null
+++ b/solenv/inc/unxfbsd.mk
@@ -0,0 +1,229 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# Makefile for FreeBSD.
+
+ASM=
+AFLAGS=
+
+SOLAR_JAVA*=
+JAVAFLAGSDEBUG=-g
+
+# Include arch specific makefile.
+.IF "$(CPUNAME)" == "INTEL"
+.INCLUDE : unxfbsdi.mk
+.ENDIF
+.IF "$(CPUNAME)" == "X86_64"
+.INCLUDE : unxfbsdx.mk
+.ENDIF
+
+# filter for supressing verbose messages from linker
+#not needed at the moment
+#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
+
+# _PTHREADS is needed for the stl
+CDEFS+=$(PTHREAD_CFLAGS) -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=450
+
+# enable visibility define in "sal/types.h"
+.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
+.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+
+# this is a platform with JAVA support
+.IF "$(SOLAR_JAVA)"!=""
+JAVADEF=-DSOLAR_JAVA
+.IF "$(debug)"==""
+JAVA_RUNTIME=-ljava
+.ELSE
+JAVA_RUNTIME=-ljava_g
+.ENDIF
+.ENDIF
+
+# name of C++ Compiler
+CXX*=g++
+# name of C Compiler
+CC*=gcc
+.IF "$(SYSBASE)"!=""
+CFLAGS_SYSBASE:=-isystem $(SYSBASE)/usr/include
+CXX+:=$(CFLAGS_SYSBASE)
+CC+:=$(CFLAGS_SYSBASE)
+.ENDIF # "$(SYSBASE)"!=""
+CFLAGS+=-fmessage-length=0 -c
+
+# flags to enable build with symbols; required for crashdump feature
+.IF "$(ENABLE_SYMBOLS)"=="SMALL"
+CFLAGSENABLESYMBOLS=-g1
+.ELSE
+CFLAGSENABLESYMBOLS=-g # was temporarily commented out, reenabled before Beta
+
+.ENDIF
+
+# flags for the C++ Compiler
+CFLAGSCC= -pipe $(ARCH_FLAGS)
+# Flags for enabling exception handling
+CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
+# Flags for disabling exception handling
+CFLAGS_NO_EXCEPTIONS=-fno-exceptions
+
+# -fpermissive should be removed as soon as possible
+CFLAGSCXX= -pipe $(ARCH_FLAGS)
+PICSWITCH:=-fpic
+.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+CFLAGSCXX += -fvisibility-inlines-hidden
+.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+
+# Compiler flags for compiling static object in multi threaded environment with graphical user interface
+CFLAGSOBJGUIMT=
+# Compiler flags for compiling static object in multi threaded environment with character user interface
+CFLAGSOBJCUIMT=
+# Compiler flags for compiling shared object in multi threaded environment with graphical user interface
+CFLAGSSLOGUIMT=$(PICSWITCH)
+# Compiler flags for compiling shared object in multi threaded environment with character user interface
+CFLAGSSLOCUIMT=$(PICSWITCH)
+# Compiler flags for profiling
+CFLAGSPROF=
+# Compiler flags for debugging
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+# Compiler flags for disabling optimizations
+CFLAGSNOOPT=-O0
+# Compiler flags for describing the output path
+CFLAGSOUTOBJ=-o
+
+# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
+CFLAGSWARNCC=-Wall -Wextra -Wendif-labels
+CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \
+ -Wno-non-virtual-dtor
+CFLAGSWALLCC=$(CFLAGSWARNCC)
+CFLAGSWALLCXX=$(CFLAGSWARNCXX)
+CFLAGSWERRCC=-Werror
+
+# Once all modules on this platform compile without warnings, set
+# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
+# settings.mk): Currently this is not tested on FreeBSD
+#MODULES_WITH_WARNINGS :=
+
+# switches for dynamic and static linking
+STATIC = -Wl,-Bstatic
+DYNAMIC = -Wl,-Bdynamic
+
+# name of linker
+LINK*=$(CXX)
+LINKC*=$(CC)
+
+# default linker flags
+LINKFLAGSDEFS*=#-Wl,-z,defs
+LINKFLAGSRUNPATH_URELIB=-Wl,-rpath,\''$$ORIGIN'\'
+LINKFLAGSRUNPATH_UREBIN=-Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\'
+ #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
+LINKFLAGSRUNPATH_OOO=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
+LINKFLAGSRUNPATH_SDK=-Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\'
+LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
+LINKFLAGSRUNPATH_OXT=
+LINKFLAGSRUNPATH_NONE=
+LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS)
+
+# linker flags for linking applications
+LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
+LINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec
+
+# linker flags for linking shared libraries
+LINKFLAGSSHLGUI= -shared
+LINKFLAGSSHLCUI= -shared
+
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=-g
+LINKFLAGSOPT=
+
+# linker flags for optimization (symbol hashtable)
+# for now, applied to symbol scoped libraries, only
+LINKFLAGSOPTIMIZE*=-Wl,-O1
+LINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script
+
+SONAME_SWITCH=-Wl,-h
+
+# Sequence of libs does matter !
+
+STDLIBCPP=-lstdc++
+
+# default objectfilenames to link
+STDOBJVCL=$(L)/salmain.o
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+
+# libraries for linking applications
+STDLIBGUIMT=-lX11 $(PTHREAD_LIBS) -lm
+STDLIBCUIMT=$(PTHREAD_LIBS) -lm
+# libraries for linking shared libraries
+STDSHLGUIMT=-lX11 -lXext $(PTHREAD_LIBS) -lm
+STDSHLCUIMT=$(PTHREAD_LIBS) -lm
+
+LIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
+
+.IF "$(USE_STLP_DEBUG)" != ""
+.IF "$(STLPORT_VER)" >= "500"
+LIBSTLPORT=$(DYNAMIC) -lstlportstlg
+LIBSTLPORTST=$(STATIC) -lstlportstlg $(DYNAMIC)
+.ELSE
+LIBSTLPORT=$(DYNAMIC) -lstlport_gcc_stldebug
+LIBSTLPORTST=$(STATIC) -lstlport_gcc_stldebug $(DYNAMIC)
+.ENDIF
+.ELSE # "$(USE_STLP_DEBUG)" != ""
+.IF "$(STLPORT_VER)" >= "500"
+LIBSTLPORT=$(DYNAMIC) -lstlport
+LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
+.ELSE
+LIBSTLPORT=$(DYNAMIC) -lstlport_gcc
+LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
+.ENDIF
+.ENDIF # "$(USE_STLP_DEBUG)" != ""
+
+#FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
+
+# name of library manager
+LIBMGR=ar
+LIBFLAGS=-r
+
+# tool for generating import libraries
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=irc
+RCFLAGS=-fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+# platform specific identifier for shared libs
+DLLPRE=lib
+DLLPOST=.so
diff --git a/solenv/inc/unxfbsdi.mk b/solenv/inc/unxfbsdi.mk
new file mode 100644
index 000000000000..c1227a35f2d3
--- /dev/null
+++ b/solenv/inc/unxfbsdi.mk
@@ -0,0 +1,46 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#
+# FreBSD/i386 specific defines
+#
+
+CDEFS+=-DX86
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=-mtune=pentiumpro
+
+# Compiler flags for enabling optimizations
+.IF "$(PRODUCT)"!=""
+CFLAGSOPT=-Os -fno-strict-aliasing # optimizing for products
+.ELSE # "$(PRODUCT)"!=""
+CFLAGSOPT= # no optimizing for non products
+.ENDIF # "$(PRODUCT)"!=""
+
+# platform specific identifier for shared libs
+DLLPOSTFIX=fi
diff --git a/solenv/inc/unxfbsdx.mk b/solenv/inc/unxfbsdx.mk
new file mode 100644
index 000000000000..4a8e120d318e
--- /dev/null
+++ b/solenv/inc/unxfbsdx.mk
@@ -0,0 +1,49 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#
+# FreBSD/amd64 specific defines
+#
+
+CDEFS+=-DX86_64
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+.IF "$(CPUNAME)" == "X86_64"
+ARCH_FLAGS*=
+.ENDIF
+
+# Compiler flags for enabling optimizations
+.IF "$(PRODUCT)"!=""
+CFLAGSOPT=-O2 -fno-strict-aliasing # optimizing for products
+.ELSE # "$(PRODUCT)"!=""
+CFLAGSOPT= # no optimizing for non products
+.ENDIF # "$(PRODUCT)"!=""
+
+# platform specific identifier for shared libs
+DLLPOSTFIX=fx
+BUILD64=1
diff --git a/solenv/inc/unxhpgr.mk b/solenv/inc/unxhpgr.mk
new file mode 100644
index 000000000000..9ac0c7e3daf1
--- /dev/null
+++ b/solenv/inc/unxhpgr.mk
@@ -0,0 +1,133 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+# mak file fuer unxhpxr
+ASM=
+AFLAGS=
+
+CDEFS+=-D_PTHREADS -D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE
+CDEFS+=-DSYSV -D_POSIX_PTHREAD_SEMANTICS -D_HPUX_SOURCE -DRWSTD_MULTI_THREAD -D_REENTRANT -D__HPACC_NOEH -D__STL_NO_EXCEPTIONS
+ #CDEFS+= -D__hppa__
+
+# obernervige Warnungen abschalten
+# 67 = invalid pragma name
+# 251 = An object cannot be deleted using a pointer of type 'void *' since the
+# type of the object allocated is unknown.
+# 370 = The friend declaration is not in the correct form for either a function or a class.
+# (future error)
+# 600 = Type specifier is omitted; "int" is no longer assumed.
+DISWARN=+W67,251,370,600
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=
+
+#CXX=/opt/aCC/bin/aCC
+#CC=/opt/ansic/bin/cc
+CXX=g++
+CC=gcc
+CFLAGSWALL=-Wall
+CFLAGS=-nostdinc -c
+CFLAGSCC=-pipe -fguiding-decls $(ARCH_FLAGS)
+CFLAGSCXX=-pipe -fguiding-decls $(ARCH_FLAGS)
+PICSWITCH:=-fPIC
+CFLAGSOBJGUIMT=
+CFLAGSOBJCUIMT=
+CFLAGSSLOGUIMT=$(PICSWITCH)
+CFLAGSSLOCUIMT=$(PICSWITCH)
+CFLAGSPROF=
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+CFLAGSOPT=-O2
+CFLAGSNOOPT=
+CFLAGSOUTOBJ=-o
+
+
+ #THREADLIB=-L/opt/dce/lib -ldce
+# use native aCC to build or link with shared libs, for the sake of
+# global class-instances
+
+STATIC = -Bstatic
+DYNAMIC = -Bdynamic
+
+#LINK=$(SOLARENV)/unxhpgr/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.90.29/ld
+LINK=ld
+LINKFLAGS=-L/nw386/dev/s/solenv/unxhpgr/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.91.57/threads -L/nw386/dev/s/solenv/unxhpgr/lib/gcc-lib/hppa1.1-hp-hpux10.20/egcs-2.91.57
+LINKFLAGSAPPGUI= /usr/lib/crt0.o
+LINKFLAGSSHLGUI= -b -noinhibit-exec -Bsymbolic -G $(THREADLIB)
+LINKFLAGSAPPCUI= /usr/lib/crt0.o
+LINKFLAGSSHLCUI= -b -noinhibit-exec -warn-once -Bsymbolic -G
+LINKFLAGSTACK=
+APPLINKSTATIC=-Bstatic
+APPLINKSHARED=-Bsymbolic
+APP_LINKTYPE=
+
+# reihenfolge der libs NICHT egal!
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+#STDLIBGUIMT= -lX11 -lXext -lcma -lsec -lcxx -ldld -lc_r -lm
+STDLIBGUIMT= -lX11 -lXext -ldce
+STDLIBCUIMT= -lc_r -lgcc -ldce
+#STDSHLGUIMT= -lX11 -lXext -lcma -lsec -lcxx -ldld -lc_r
+STDSHLGUIMT= -lcma -lsec -ldld -lc_r
+STDSHLCUIMT=
+# -L/opt/dce/lib -ldce -lsec -lcxx
+
+LIBMGR=ar
+LIBFLAGS=-r
+# LIBEXT=.so
+
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=
+RCFLAGS=
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX=hg
+DLLPRE=lib
+DLLPOST=.sl
+
+LDUMP=c++filt
+
+.IF "$(PRJNAME)"=="uno" || "$(PRJNAME)"=="vos"
+#CFLAGS += -D_PTHREADS -U_REENTRANT -U_POSIX_PTHREAD_SEMANTICS
+#CFLAGSSLO += -instances=extern -template=wholeclass -ptr$(SLO)
+#CFLAGSOBJ += -instances=global -template=wholeclass -ptr$(SLO)
+#LINKFLAGS+= -temp=/tmp -PIC -instances=extern -ptr$(SLO)
+.ENDIF
+
+#SHLLINKARCONLY=yes
+
diff --git a/solenv/inc/unxhpxr.mk b/solenv/inc/unxhpxr.mk
new file mode 100644
index 000000000000..174d61fc2b4c
--- /dev/null
+++ b/solenv/inc/unxhpxr.mk
@@ -0,0 +1,131 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mak file fuer unxhpxr
+ASM=
+AFLAGS=
+
+CDEFS+=-D_PTHREADS -D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE -DSYSV -D_POSIX_PTHREAD_SEMANTICS -D_HPUX_SOURCE -DRWSTD_MULTI_THREAD -D_REENTRANT -D__HPACC_NOEH -D__STL_NO_EXCEPTIONS
+
+# kann c++ was c braucht??
+
+# obernervige Warnungen abschalten
+# 67 = invalid pragma name
+# 251 = An object cannot be deleted using a pointer of type 'void *' since the
+# type of the object allocated is unknown.
+# 370 = The friend declaration is not in the correct form for either a function or a class.
+# (future error)
+# 600 = Type specifier is omitted; "int" is no longer assumed.
+DISWARN=+W67,251,370,600
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=
+
+#CXX=/opt/aCC/bin/aCC
+#CC=/opt/ansic/bin/cc
+CXX=aCC
+CC=cc
+CFLAGS= -c
+CFLAGSCC= -Aa +e +Z $(ARCH_FLAGS)
+CFLAGSCXX=$(DISWARN) +Z $(ARCH_FLAGS)
+CFLAGSOBJGUIMT=
+CFLAGSOBJCUIMT=
+CFLAGSSLOGUIMT=
+CFLAGSSLOCUIMT=
+CFLAGSPROF=
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+CFLAGSOPT=-O
+CFLAGSNOOPT=
+CFLAGSOUTOBJ=-o
+
+
+THREADLIB=-L/opt/dce/lib -ldce
+# use native aCC to build or link with shared libs, for the sake of
+# global class-instances
+LINK=/opt/aCC/bin/aCC
+LINKFLAGS=
+LINKFLAGSAPPGUI=-Wl,+s
+LINKFLAGSSHLGUI=-b -L/usr/solar/lib -L/usr/contrib/X11R6/lib
+LINKFLAGSAPPCUI=-Wl,+s
+LINKFLAGSSHLCUI=-b -L/usr/contrib/X11R6/lib
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=
+LINKFLAGSOPT=
+
+# reihenfolge der libs NICHT egal!
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+#STDLIBGUIMT= -lX11 -lXext -lcma -lsec -lcxx -ldld -lc_r -lm
+STDLIBGUIMT= -lX11 -lXext -lpthread
+STDLIBCUIMT= -lcma
+#STDSHLGUIMT= -lX11 -lXext -lcma -lsec -lcxx -ldld -lc_r
+STDSHLCUIMT=
+# -L/opt/dce/lib -ldce -lsec -lcxx
+
+LIBMGR=ar
+LIBFLAGS=-r
+# LIBEXT=.so
+
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=
+RCFLAGS=
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX=hr
+DLLPRE=lib
+DLLPOST=.sl
+
+LDUMP=c++filt
+
+.IF "$(WORK_STAMP)"!="MIX364"
+DLLPOSTFIX=ss
+.ELSE
+DLLPOSTFIX=
+.ENDIF
+
+
+.IF "$(PRJNAME)"=="uno" || "$(PRJNAME)"=="vos"
+#CFLAGS += -D_PTHREADS -U_REENTRANT -U_POSIX_PTHREAD_SEMANTICS
+#CFLAGSSLO += -instances=extern -template=wholeclass -ptr$(SLO)
+#CFLAGSOBJ += -instances=global -template=wholeclass -ptr$(SLO)
+#LINKFLAGS+= -temp=/tmp -PIC -instances=extern -ptr$(SLO)
+.ENDIF
+
+#SHLLINKARCONLY=yes
+
diff --git a/solenv/inc/unxlng.mk b/solenv/inc/unxlng.mk
new file mode 100644
index 000000000000..fd9f7832808d
--- /dev/null
+++ b/solenv/inc/unxlng.mk
@@ -0,0 +1,268 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# generic mk file for unxlng (unix linux glibc)
+ASM*=
+AFLAGS*=
+SOLAR_JAVA*=
+# default optimization level for product code
+CDEFAULTOPT*=-O2
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=
+# position independent code switch
+PICSWITCH*:=-fpic
+JAVAFLAGSDEBUG=-g
+
+# filter for supressing verbose messages from linker
+#not needed at the moment
+#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
+
+# _PTHREADS is needed for the stl
+CDEFS+=-DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=$(STLPORT_VER)
+
+# enable visibility define in "sal/types.h"
+.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
+.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+
+# this is a platform with JAVA support
+.IF "$(SOLAR_JAVA)"!=""
+JAVADEF=-DSOLAR_JAVA
+.IF "$(debug)"==""
+JAVA_RUNTIME=-ljava
+.ELSE
+JAVA_RUNTIME=-ljava_g
+.ENDIF
+.ENDIF
+
+# name of C++ Compiler
+CXX*=g++
+# name of C Compiler
+CC*=gcc
+.IF "$(SYSBASE)"!=""
+CFLAGS_SYSBASE:=--sysroot=$(SYSBASE)
+CXX+:=$(CFLAGS_SYSBASE)
+CC+:=$(CFLAGS_SYSBASE)
+.ENDIF # "$(SYSBASE)"!=""
+CFLAGS+=-fmessage-length=0 -c
+
+# flags to enable build with symbols; required for crashdump feature
+.IF "$(ENABLE_SYMBOLS)"=="SMALL"
+CFLAGSENABLESYMBOLS=-g1
+.ELSE
+CFLAGSENABLESYMBOLS=-g # was temporarily commented out, reenabled before Beta
+
+.ENDIF
+
+# flags for the C++ Compiler
+CFLAGSCC= -pipe $(ARCH_FLAGS)
+# Flags for enabling exception handling
+CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
+# Flags for disabling exception handling
+CFLAGS_NO_EXCEPTIONS=-fno-exceptions
+
+# -fpermissive should be removed as soon as possible
+CFLAGSCXX= -pipe $(ARCH_FLAGS)
+.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+CFLAGSCXX += -fvisibility-inlines-hidden
+.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+
+CFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS
+CFLAGS_USE_PCH=-I$(SLO)$/pch -DPRECOMPILED_HEADERS -Winvalid-pch
+CFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)$/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch
+
+# Compiler flags for compiling static object in multi threaded environment with graphical user interface
+CFLAGSOBJGUIMT=
+# Compiler flags for compiling static object in multi threaded environment with character user interface
+CFLAGSOBJCUIMT=
+# Compiler flags for compiling shared object in multi threaded environment with graphical user interface
+CFLAGSSLOGUIMT=$(PICSWITCH)
+# Compiler flags for compiling shared object in multi threaded environment with character user interface
+CFLAGSSLOCUIMT=$(PICSWITCH)
+# Compiler flags for profiling
+CFLAGSPROF=
+# Compiler flags for debugging
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+# Compiler flags for enabling optimizations
+.IF "$(PRODUCT)"!=""
+CFLAGSOPT=$(CDEFAULTOPT) -fno-strict-aliasing # optimizing for products
+.ELSE # "$(PRODUCT)"!=""
+CFLAGSOPT= # no optimizing for non products
+.ENDIF # "$(PRODUCT)"!=""
+# Compiler flags for disabling optimizations
+CFLAGSNOOPT=-O0
+# Compiler flags for describing the output path
+CFLAGSOUTOBJ=-o
+
+# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
+CFLAGSWARNCC=-Wall -Wextra -Wendif-labels
+CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \
+ -Wno-non-virtual-dtor
+CFLAGSWALLCC=$(CFLAGSWARNCC)
+CFLAGSWALLCXX=$(CFLAGSWARNCXX)
+CFLAGSWERRCC=-Werror
+
+# Once all modules on this platform compile without warnings, set
+# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
+# settings.mk):
+MODULES_WITH_WARNINGS := \
+ soldep
+
+# switches for dynamic and static linking
+STATIC = -Wl,-Bstatic
+DYNAMIC = -Wl,-Bdynamic
+
+# name of linker
+LINK*=$(CXX)
+LINKC*=$(CC)
+
+# default linker flags
+.IF "$(SYSBASE)"!=""
+LINKFLAGS_SYSBASE:=-Wl,--sysroot=$(SYSBASE)
+.ENDIF # "$(SYSBASE)"!=""
+LINKFLAGSDEFS*=-Wl,-z,defs
+LINKFLAGSRUNPATH_URELIB=-Wl,-rpath,\''$$ORIGIN'\'
+LINKFLAGSRUNPATH_UREBIN=-Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\'
+ #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
+LINKFLAGSRUNPATH_OOO=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
+LINKFLAGSRUNPATH_SDK=-Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\'
+LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
+LINKFLAGSRUNPATH_OXT=
+LINKFLAGSRUNPATH_BOXT=-Wl,-rpath,\''$$ORIGIN/../../../basis-link/program'\'
+LINKFLAGSRUNPATH_NONE=
+LINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS) $(LINKFLAGS_SYSBASE)
+.IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
+LINKFLAGS += -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo
+.ENDIF
+
+# linker flags for linking applications
+LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
+ -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib
+LINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
+ -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib
+
+# linker flags for linking shared libraries
+LINKFLAGSSHLGUI= -shared
+LINKFLAGSSHLCUI= -shared
+
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=-g
+LINKFLAGSOPT=
+
+# linker flags for optimization (symbol hashtable)
+# for now, applied to symbol scoped libraries, only
+LINKFLAGSOPTIMIZE*=-Wl,-O1
+LINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script
+
+SONAME_SWITCH=-Wl,-h
+
+# Sequence of libs does matter !
+
+STDLIBCPP=-lstdc++
+
+# default objectfilenames to link
+STDOBJVCL=$(L)$/salmain.o
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+
+.IF "$(ALLOC)" == "TCMALLOC"
+STDLIBGUIMT+=-ltcmalloc
+STDLIBCUIMT+=-ltcmalloc
+STDSHLGUIMT+=-ltcmalloc
+STDSHLCUIMT+=-ltcmalloc
+.ENDIF
+
+.IF "$(ALLOC)" == "JEMALLOC"
+STDLIBGUIMT+=-ljemalloc
+STDLIBCUIMT+=-ljemalloc
+STDSHLGUIMT+=-ljemalloc
+STDSHLCUIMT+=-ljemalloc
+.ENDIF
+
+.IF "$(HAVE_LD_HASH_STYLE)" == "TRUE"
+LINKFLAGS += -Wl,--hash-style=both
+.ELSE
+LINKFLAGS += -Wl,-zdynsort
+.ENDIF
+
+# libraries for linking applications
+STDLIBGUIMT+=-Wl,--as-needed -ldl -lpthread -lm -Wl,--no-as-needed
+STDLIBCUIMT+=-Wl,--as-needed -ldl -lpthread -lm -Wl,--no-as-needed
+# libraries for linking shared libraries
+STDSHLGUIMT+=-Wl,--as-needed -ldl -lpthread -lm -Wl,--no-as-needed
+STDSHLCUIMT+=-Wl,--as-needed -ldl -lpthread -lm -Wl,--no-as-needed
+
+X11LINK_DYNAMIC = -Wl,--as-needed -lXext -lX11 -Wl,--no-as-needed
+
+LIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
+
+.IF "$(USE_STLP_DEBUG)" != ""
+.IF "$(STLPORT_VER)" >= "500"
+LIBSTLPORT=$(DYNAMIC) -lstlportstlg
+LIBSTLPORTST=$(STATIC) -lstlportstlg $(DYNAMIC)
+.ELSE
+LIBSTLPORT=$(DYNAMIC) -lstlport_gcc_stldebug
+LIBSTLPORTST=$(STATIC) -lstlport_gcc_stldebug $(DYNAMIC)
+.ENDIF
+.ELSE # "$(USE_STLP_DEBUG)" != ""
+.IF "$(STLPORT_VER)" >= "500"
+LIBSTLPORT=$(DYNAMIC) -lstlport
+LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
+.ELSE
+LIBSTLPORT=$(DYNAMIC) -lstlport_gcc
+LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
+.ENDIF
+.ENDIF # "$(USE_STLP_DEBUG)" != ""
+
+#FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
+
+# name of library manager
+LIBMGR*=ar
+LIBFLAGS=-r
+
+# tool for generating import libraries
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=irc
+RCFLAGS=-fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+# platform specific identifier for shared libs
+DLLPRE=lib
+DLLPOST=.so
+PCHPOST=.gch
diff --git a/solenv/inc/unxlnga.mk b/solenv/inc/unxlnga.mk
new file mode 100644
index 000000000000..da5d2fcd3d38
--- /dev/null
+++ b/solenv/inc/unxlnga.mk
@@ -0,0 +1,33 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Unix Linux Itanium using gcc, please make generic modifications to unxlng.mk
+
+.INCLUDE : unxlng.mk
+CFLAGS+=-DIA64
+DLLPOSTFIX=la
+BUILD64=1
diff --git a/solenv/inc/unxlngaxp.mk b/solenv/inc/unxlngaxp.mk
new file mode 100644
index 000000000000..bf7711a10c5b
--- /dev/null
+++ b/solenv/inc/unxlngaxp.mk
@@ -0,0 +1,34 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Unix Linux Alpha using gcc, please make generic modifications to unxlng.mk
+
+PICSWITCH:=-fPIC
+.INCLUDE : unxlng.mk
+CFLAGS+=-DAXP
+DLLPOSTFIX=ll
+BUILD64=1
diff --git a/solenv/inc/unxlnghppa.mk b/solenv/inc/unxlnghppa.mk
new file mode 100644
index 000000000000..7ae2d25c332e
--- /dev/null
+++ b/solenv/inc/unxlnghppa.mk
@@ -0,0 +1,35 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Unix Linux HPPA using GCC, please make generic modifications to unxlng.mk
+PICSWITCH:=-fPIC
+.INCLUDE : unxlng.mk
+CDEFS+=-DHPPA
+CFLAGS+=
+CFLAGSCC+=
+CFLAGSCXX+=
+DLLPOSTFIX=lh
diff --git a/solenv/inc/unxlngi.mk b/solenv/inc/unxlngi.mk
new file mode 100644
index 000000000000..d86aab185d0e
--- /dev/null
+++ b/solenv/inc/unxlngi.mk
@@ -0,0 +1,34 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Unix Linux Intel (X86) using GCC, please make generic modifications to unxlng.mk
+CDEFAULTOPT=-Os
+ARCH_FLAGS*=-mtune=pentiumpro
+.INCLUDE : unxlng.mk
+CDEFS+=-DX86
+DLLPOST=.so
+DLLPOSTFIX=li
diff --git a/solenv/inc/unxlngm68k.mk b/solenv/inc/unxlngm68k.mk
new file mode 100644
index 000000000000..da6ed55d8cfd
--- /dev/null
+++ b/solenv/inc/unxlngm68k.mk
@@ -0,0 +1,37 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Unix Linux m68k using GCC, please make generic modifications to unxlng.mk
+
+CDEFAULTOPT=-Os
+PICSWITCH:=-fPIC
+.INCLUDE : unxlng.mk
+CDEFS+=-DM68K
+CFLAGS+=-fsigned-char -fno-omit-frame-pointer
+CFLAGSCC+=-fsigned-char
+CFLAGSCXX+=-fsigned-char
+DLLPOSTFIX=lm
diff --git a/solenv/inc/unxlngmips.mk b/solenv/inc/unxlngmips.mk
new file mode 100644
index 000000000000..53c927d10b32
--- /dev/null
+++ b/solenv/inc/unxlngmips.mk
@@ -0,0 +1,33 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Unix Linux Mips using GCC, please make generic modifications to unxlng.mk
+
+CDEFAULTOPT=-Os
+.INCLUDE : unxlng.mk
+CDEFS+=-DMIPS
+DLLPOSTFIX=lm
diff --git a/solenv/inc/unxlngppc.mk b/solenv/inc/unxlngppc.mk
new file mode 100644
index 000000000000..408233539bf8
--- /dev/null
+++ b/solenv/inc/unxlngppc.mk
@@ -0,0 +1,37 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Unix Linux PowerPC using GCC, please make generic modifications to unxlng.mk
+
+DEFAULTOPT=-Os
+PICSWITCH:=-fPIC
+.INCLUDE : unxlng.mk
+CDEFS+=-DPOWERPC -DPPC
+CFLAGS+=-fsigned-char
+CFLAGSCC+=-fsigned-char
+CFLAGSCXX+=-fsigned-char
+DLLPOSTFIX=lp
diff --git a/solenv/inc/unxlngppc64.mk b/solenv/inc/unxlngppc64.mk
new file mode 100644
index 000000000000..7ce9f35c4ad8
--- /dev/null
+++ b/solenv/inc/unxlngppc64.mk
@@ -0,0 +1,34 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Unix Linux 64Bit PowerPC using GCC, inherit from ppc and add some flags
+
+.INCLUDE : unxlngppc.mk
+
+CDEFS+=-DPOWERPC64
+CFLAGSCXX+=-mminimal-toc
+BUILD64=1
diff --git a/solenv/inc/unxlngr.mk b/solenv/inc/unxlngr.mk
new file mode 100644
index 000000000000..1bcbb6626219
--- /dev/null
+++ b/solenv/inc/unxlngr.mk
@@ -0,0 +1,34 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Unix Linux ARM using GCC, please make generic modifications to unxlng.mk
+
+CDEFAULTOPT=-Os
+.INCLUDE : unxlng.mk
+CDEFS+=-DARM32
+CFLAGS+=-fno-omit-frame-pointer
+DLLPOSTFIX=lr
diff --git a/solenv/inc/unxlngs.mk b/solenv/inc/unxlngs.mk
new file mode 100644
index 000000000000..b4e6f5f58f4d
--- /dev/null
+++ b/solenv/inc/unxlngs.mk
@@ -0,0 +1,36 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Unix Linux Sparc using GCC, please make generic modifications to unxlng.mk
+
+ASM=$(CC)
+AFLAGS=-Wa,-K,PIC -c $(CDEFS)
+CDEFAULTOPT=-Os
+PICSWITCH:=-fPIC
+.INCLUDE : unxlng.mk
+CDEFS+=-DSPARC
+DLLPOSTFIX=ls
diff --git a/solenv/inc/unxlngs390.mk b/solenv/inc/unxlngs390.mk
new file mode 100644
index 000000000000..47e2e37011e8
--- /dev/null
+++ b/solenv/inc/unxlngs390.mk
@@ -0,0 +1,36 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Unix Linux s390 using GCC, please make generic modifications to unxlng.mk
+
+PICSWITCH:=-fPIC
+.INCLUDE : unxlng.mk
+CDEFS+=-DS390
+CFLAGS+=-fsigned-char -fno-omit-frame-pointer
+CFLAGSCC+=-fsigned-char
+CFLAGSCXX+=-fsigned-char
+DLLPOSTFIX=l3
diff --git a/solenv/inc/unxlngs390x.mk b/solenv/inc/unxlngs390x.mk
new file mode 100644
index 000000000000..108e30b7337a
--- /dev/null
+++ b/solenv/inc/unxlngs390x.mk
@@ -0,0 +1,33 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Unix Linux 64bit s390x using GCC, inherit from s390 and add some flags
+
+.INCLUDE : unxlngs390.mk
+
+CDEFS+=-DS390X
+BUILD64=1
diff --git a/solenv/inc/unxlngx.mk b/solenv/inc/unxlngx.mk
new file mode 100644
index 000000000000..414f15d0dc92
--- /dev/null
+++ b/solenv/inc/unxlngx.mk
@@ -0,0 +1,33 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Linux Unix X86-64 using GCC, please make generic modifications to unxlng.mk
+
+.INCLUDE : unxlng.mk
+CDEFS+=-DX86_64
+DLLPOSTFIX=lx
+BUILD64=1
diff --git a/solenv/inc/unxmacx.mk b/solenv/inc/unxmacx.mk
new file mode 100644
index 000000000000..ce049a672d23
--- /dev/null
+++ b/solenv/inc/unxmacx.mk
@@ -0,0 +1,290 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+##########################################################################
+# Platform MAKEFILE for Mac OS X and Darwin on both PowerPC and Intel
+##########################################################################
+
+# PROCESSOR_DEFINES and DLLPOSTFIX are defined in the particular platform file
+
+ASM=
+AFLAGS=
+LINKOUTPUT_FILTER=
+
+# Definitions that we may need on the compile line.
+# -D_PTHREADS and -D_REENTRANT are needed for STLport, and must be specified when
+# compiling STLport sources too, either internally or externally.
+CDEFS+=-DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNO_PTHREAD_PRIORITY $(PROCESSOR_DEFINES) -DSTLPORT_VERSION=$(STLPORT_VER) -D_USE_NAMESPACE=1
+.IF "$(GUIBASE)"=="unx" && "$(USE_SYSTEM_STL)"!="YES"
+CDEFS+=-DX_LOCALE
+.ENDIF
+.IF "$(GUIBASE)"=="aqua"
+# MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build,
+# build can assume functions/libraries of that version to be available
+# unless you want to do runtime checks for 10.5 api, you also want to use the 10.4 sdk
+# (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro)
+# http://developer.apple.com/technotes/tn2002/tn2064.html
+# done in setsolar/configure now. left here for documentation
+#MACOSX_DEPLOYMENT_TARGET=10.4
+#.EXPORT: MACOSX_DEPLOYMENT_TARGET
+CDEFS+=-DQUARTZ
+EXTRA_CDEFS*=-isysroot /Developer/SDKs/MacOSX10.4u.sdk
+.ENDIF
+
+# Name of library where static data members are initialized
+# STATICLIBNAME=static$(DLLPOSTFIX)
+# STATICLIB=-l$(STATICLIBNAME)
+
+# enable visibility define in "sal/types.h"
+.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
+.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+
+
+# MacOS X specific Java compilation/link flags
+SOLAR_JAVA*=TRUE
+.IF "$(SOLAR_JAVA)"!=""
+ JAVADEF=-DSOLAR_JAVA
+ JAVAFLAGSDEBUG=-g
+ JAVA_RUNTIME=-framework JavaVM
+.ENDIF
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=
+
+# Specify the compiler to use. NOTE: MacOS X should always specify
+# c++ for C++ compilation as it does certain C++ specific things
+# behind the scenes for us.
+# CC = C++ compiler to use
+# cc = C compiler to use
+# objc = Objective C compiler to use
+# objcpp = Objective C++ compiler to use
+CXX*=g++
+CC*=gcc
+objc*=$(CC)
+objcpp*=$(CXX)
+
+CFLAGS=-fsigned-char -fmessage-length=0 -malign-natural -c $(EXTRA_CFLAGS)
+
+.IF "$(DISABLE_DEPRECATION_WARNING)" == "TRUE"
+CFLAGS+=-Wno-deprecated-declarations
+.ENDIF
+# ---------------------------------
+# Compilation flags
+# ---------------------------------
+# Normal C compilation flags
+CFLAGSCC=-pipe -fsigned-char -malign-natural $(ARCH_FLAGS)
+
+# Normal Objective C compilation flags
+#OBJCFLAGS=-no-precomp
+OBJCFLAGS=-fobjc-exceptions
+# -x options generally ignored by ccache, tell it that it can cache
+# the result nevertheless
+CCACHE_SKIP:=$(eq,$(USE_CCACHE),YES --ccache-skip $(NULL))
+OBJCXXFLAGS:=$(CCACHE_SKIP) -x $(CCACHE_SKIP) objective-c++ -fobjc-exceptions
+
+# Comp Flags for files that need exceptions enabled (C and C++)
+CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
+
+# Comp Flags for files that do not need exceptions enabled (C and C++)
+CFLAGS_NO_EXCEPTIONS=-fno-exceptions
+
+# Normal C++ compilation flags
+CFLAGSCXX=-pipe -malign-natural -fsigned-char -Wno-long-double $(ARCH_FLAGS)
+CFLAGSCXX+= -Wno-ctor-dtor-privacy
+
+PICSWITCH:=-fPIC
+# Other flags
+CFLAGSOBJGUIMT=$(PICSWITCH) -fno-common
+CFLAGSOBJCUIMT=$(PICSWITCH) -fno-common
+CFLAGSSLOGUIMT=$(PICSWITCH) -fno-common
+CFLAGSSLOCUIMT=$(PICSWITCH) -fno-common
+CFLAGSPROF=
+
+# Flag for including debugging information in object files
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+
+# Flag to specify output file to compiler/linker
+CFLAGSOUTOBJ=-o
+
+# Flags to enable precompiled headers
+CFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS
+CFLAGS_USE_PCH=-I$(SLO)/pch -DPRECOMPILED_HEADERS -Winvalid-pch
+CFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch
+
+# ---------------------------------
+# Optimization flags
+# ---------------------------------
+CFLAGSOPT=-O2 -fno-strict-aliasing
+CFLAGSNOOPT=-O0
+
+# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
+# -Wshadow does not work for C++ as /usr/include/c++/4.0.0/ext/hashtable.h
+# l. 717 contains a declaration of __cur2 shadowing the declaration at l. 705,
+# in template code for which a #pragma gcc system_header would not work:
+# -Wextra doesn not work for gcc-3.3
+CFLAGSWARNCC=-Wall -Wendif-labels
+CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor
+CFLAGSWALLCC=$(CFLAGSWARNCC)
+CFLAGSWALLCXX=$(CFLAGSWARNCXX)
+CFLAGSWERRCC=-Werror
+
+# All modules on this platform compile without warnings.
+# If you need to set MODULES_WITH_WARNINGS here, comment
+# COMPILER_WARN_ERRORS=TRUE here (see settings.mk):
+COMPILER_WARN_ERRORS=TRUE
+
+#special settings form environment
+CDEFS+=$(EXTRA_CDEFS)
+
+STDLIBCPP=-lstdc++
+
+# ---------------------------------
+# STLport library names
+# ---------------------------------
+.IF "$(USE_STLP_DEBUG)" != ""
+.IF "$(STLPORT_VER)" >= "500"
+LIBSTLPORT=-lstlportstlg
+LIBSTLPORTST=$(STATIC) -lstlportstlg
+.ELSE
+LIBSTLPORT=-lstlport_gcc_stldebug
+LIBSTLPORTST=$(SOLARVERSION)/$(INPATH)/lib/libstlport_gcc_stldebug.a
+.ENDIF
+.ELSE # "$(USE_STLP_DEBUG" != ""
+.IF "$(STLPORT_VER)" >= "500"
+LIBSTLPORT=-lstlport
+LIBSTLPORTST=$(STATIC) -lstlport
+.ELSE
+LIBSTLPORT=-lstlport_gcc
+LIBSTLPORTST=$(SOLARVERSION)/$(INPATH)/lib/libstlport_gcc.a
+.ENDIF
+.ENDIF # "$(USE_STLP_DEBUG" != ""
+
+# ---------------------------------
+# Link stage flags
+# ---------------------------------
+# always link with gcc since you may be linking c code and don't want -lstdc++ linked in!
+
+## ericb 04 mars 2005
+
+LINK*=$(CXX)
+LINKC*=$(CC)
+
+LINKFLAGSDEFS*=-Wl,-multiply_defined,suppress
+# assure backwards-compatibility
+EXTRA_LINKFLAGS*=-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
+# Very long install_names are needed so that install_name_tool -change later on
+# does not complain that "larger updated load commands do not fit:"
+LINKFLAGSRUNPATH_URELIB=-install_name '@__________________________________________________URELIB/$(@:f)'
+LINKFLAGSRUNPATH_UREBIN=
+LINKFLAGSRUNPATH_OOO=-install_name '@__________________________________________________OOO/$(@:f)'
+LINKFLAGSRUNPATH_SDK=
+LINKFLAGSRUNPATH_BRAND=
+LINKFLAGSRUNPATH_OXT=
+LINKFLAGSRUNPATH_BOXT=
+LINKFLAGSRUNPATH_NONE=-install_name '@__________________________________________________NONE/$(@:f)'
+LINKFLAGS=$(LINKFLAGSDEFS)
+
+# [ed] 5/14/02 If we're building for aqua, add in the objc runtime library into our link line
+.IF "$(GUIBASE)" == "aqua"
+ LINKFLAGS+=-lobjc
+ # Sometimes we still use files that would be in a GUIBASE="unx" specific directory
+ # because they really aren't GUIBASE specific, so we've got to account for that here.
+ INCGUI+= -I$(PRJ)/unx/inc
+.ENDIF
+
+#special settings form environment
+LINKFLAGS+=$(EXTRA_LINKFLAGS)
+
+# Random link flags dealing with different cases of linking
+
+LINKFLAGSAPPGUI=-bind_at_load
+LINKFLAGSSHLGUI=-dynamiclib -single_module
+LINKFLAGSAPPCUI=-bind_at_load
+LINKFLAGSSHLCUI=-dynamiclib -single_module
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+
+# Flag to add debugging information to final products
+LINKFLAGSDEBUG=-g
+LINKFLAGSOPT=
+
+# ---------------------------------
+# MacOS X shared library specifics
+# ---------------------------------
+
+# Tag to identify an output file as a library
+DLLPRE=lib
+# File extension to identify dynamic shared libraries on MacOS X
+DLLPOST=.dylib
+# Precompiled header file extension
+PCHPOST=.gch
+
+# We don't use mapping on MacOS X
+#LINKVERSIONMAPFLAG=-Wl,--version-script
+LINKVERSIONMAPFLAG=-Wl,-exported_symbols_list
+
+SONAME_SWITCH=-Wl,-h
+
+STDLIBCPP=-lstdc++
+
+STDOBJVCL=$(L)/salmain.o
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+
+.IF "$(GUIBASE)" == "aqua"
+ STDLIBCUIMT=CPPRUNTIME -lm
+ STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm
+ STDSHLCUIMT=-lpthread CPPRUNTIME -lm
+ STDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm
+.ELSE
+ STDLIBCUIMT= CPPRUNTIME -lm
+ STDLIBGUIMT=-lX11 -lpthread CPPRUNTIME -lm
+ STDSHLCUIMT=-lpthread CPPRUNTIME -lm
+ STDSHLGUIMT=-lX11 -lXext -lpthread CPPRUNTIME -lm -framework CoreFoundation
+.ENDIF
+
+LIBMGR=ar
+LIBFLAGS=-r
+
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=irc
+RCFLAGS=-fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+OOO_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH
diff --git a/solenv/inc/unxmacxi.mk b/solenv/inc/unxmacxi.mk
new file mode 100644
index 000000000000..7c7f0a88f4f4
--- /dev/null
+++ b/solenv/inc/unxmacxi.mk
@@ -0,0 +1,53 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#
+# Mac OS X/Intel specific defines
+#
+
+PROCESSOR_DEFINES=-DX86
+
+DLLPOSTFIX=mxi
+
+# special for SO build environment
+.IF "$(SYSBASE)"!=""
+.IF "$(EXTRA_CFLAGS)"!=""
+CPP:=gcc -E $(EXTRA_CFLAGS)
+CXXCPP*:=g++ -E $(EXTRA_CFLAGS)
+.EXPORT : CPP CXXCPP
+.ENDIF # "$(EXTRA_CFLAGS)"!=""
+.ENDIF # "$(SYSBASE)"!=""
+
+# flags to enable build with symbols; required by crashdump feature
+.IF "$(ENABLE_SYMBOLS)"=="SMALL"
+CFLAGSENABLESYMBOLS=-g1
+.ELSE
+CFLAGSENABLESYMBOLS=-g
+.ENDIF
+
+# Include generic Mac OS X makefile
+.INCLUDE : unxmacx.mk
diff --git a/solenv/inc/unxmacxp.mk b/solenv/inc/unxmacxp.mk
new file mode 100644
index 000000000000..28b2881962de
--- /dev/null
+++ b/solenv/inc/unxmacxp.mk
@@ -0,0 +1,37 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+#
+# Mac OS X/PowerPC specific defines
+#
+
+PROCESSOR_DEFINES=-DPOWERPC -DPPC
+
+DLLPOSTFIX=mxp
+
+# Include generic Mac OS X makefile
+.INCLUDE : unxmacx.mk
diff --git a/solenv/inc/unxscoi.mk b/solenv/inc/unxscoi.mk
new file mode 100644
index 000000000000..901fe7b2cb22
--- /dev/null
+++ b/solenv/inc/unxscoi.mk
@@ -0,0 +1,140 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+# mak file fuer wnticci
+ASM=
+AFLAGS=
+
+CDEFS+=-D_PTHREADS -D_REENTRANT
+CDEFS+=-D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE -DX86 -DNEW_SOLAR
+# kann c++ was c braucht??
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=-mpentium
+
+CXX*=/nw386/dev/s/solenv/unxscoi/bin/g++
+CC*=/nw386/dev/s/solenv/unxscoi/bin/gcc
+CFLAGS=-c
+CFLAGSCC=$(ARCH_FLAGS)
+CFLAGSEXCEPTIONS=-fexceptions
+CFLAGS_NO_EXCEPTIONS=-fno-exceptions
+CFLAGSCXX=-fguiding-decls -frtti $(ARCH_FLAGS)
+PICSWITCH:=-fPIC
+CFLAGSOBJGUIMT=$(PICSWITCH)
+CFLAGSOBJCUIMT=$(PICSWITCH)
+CFLAGSSLOGUIMT=$(PICSWITCH)
+CFLAGSSLOCUIMT=$(PICSWITCH)
+CFLAGSPROF=
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+CFLAGSOPT=-O2
+CFLAGSNOOPT=-O
+CFLAGSOUTOBJ=-o
+
+CFLAGSWARNCC=
+CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy
+# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
+CFLAGSWALLCC=-Wall -Wextra -Wendif-labels
+CFLAGSWALLCXX=$(CFLAGSWALLCC) -Wshadow -Wno-ctor-dtor-privacy
+CFLAGSWERRCC=-Werror
+
+STATIC = -Wl,-Bstatic
+DYNAMIC = -Wl,-Bdynamic
+
+THREADLIB=
+LINK=/nw386/dev/s/solenv/unxscoi/bin/gcc
+LINKFLAGS=
+# SCO hat grosse Probleme mit fork/exec und einigen shared libraries
+# rsc2 muss daher statisch gelinkt werden
+.IF "$(PRJNAME)"=="rsc"
+LINKFLAGSAPPGUI=-L/nw386/dev/s/solenv/unxscoi/lib $(STATIC) -lpthread_init $(DYNAMIC)
+LINKFLAGSAPPCUI=-L/nw386/dev/s/solenv/unxscoi/lib $(STATIC) -lpthread_init $(DYNAMIC)
+.ELSE
+LINKFLAGSAPPGUI=-L/nw386/dev/s/solenv/unxscoi/lib -lpthread_init
+LINKFLAGSAPPCUI=-L/nw386/dev/s/solenv/unxscoi/lib -lpthread_init
+.ENDIF
+LINKFLAGSSHLGUI=-G -W,l,-Bsymbolic
+LINKFLAGSSHLCUI=-G -W,l,-Bsymbolic
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=-g
+LINKFLAGSOPT=
+
+# standard C++ Library
+#
+# das statische dazulinken der libstdc++ macht jede shared library um 50k
+# (ungestrippt) oder so groesser, auch wenn sie ueberhaupt nicht gebraucht
+# wird. Da muessen wir uns was besseres ueberlegen.
+STDLIBCPP=-Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
+
+# reihenfolge der libs NICHT egal!
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+.IF "$(PRJNAME)"=="rsc"
+STDLIBGUIMT=-lXext -lX11 $(STATIC) -lpthread $(DYNAMIC) -ldl -lsocket -lm
+STDLIBCUIMT=$(STATIC) -lpthread $(DYNAMIC) -ldl -lsocket -lm
+.ELSE
+STDLIBGUIMT=-lXext -lX11 -lpthread -ldl -lsocket -lm
+STDLIBCUIMT=-lpthread -ldl -lsocket -lm
+.ENDIF
+#STDSHLGUIMT=-lXext -lX11 -lpthread -ldl -lsocket -lm
+#STDSHLCUIMT=-lpthread -ldl -lsocket -lm
+
+STDLIBCPP= -lstdc++
+SHLLINKARCONLY=yes
+
+LIBMGR=ar
+LIBFLAGS=-r
+# LIBEXT=.so
+
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=irc
+RCFLAGS=-fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX=ci
+DLLPRE=lib
+DLLPOST=.so
+
+LDUMP=cppfilt /b /n /o /p
+
+.IF "$(WORK_STAMP)"!="MIX364"
+DLLPOSTFIX=ci
+.ELSE
+DLLPOSTFIX=
+.ENDIF
diff --git a/solenv/inc/unxsogi.mk b/solenv/inc/unxsogi.mk
new file mode 100644
index 000000000000..ce82fca29fa9
--- /dev/null
+++ b/solenv/inc/unxsogi.mk
@@ -0,0 +1,141 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for unxsogi
+ASM=/usr/ccs/bin/as
+AFLAGS=-P
+
+SOLAR_JAVA=TRUE
+JAVAFLAGSDEBUG=-g
+
+# _PTHREADS is needed for the stl
+CDEFS+=-D_PTHREADS -D_REENTRANT -DSYSV -DSUN -DSUN4 -D_POSIX_PTHREAD_SEMANTICS -DSTLPORT_VERSION=$(STLPORT_VER) -D_USE_NAMESPACE=1
+
+
+.IF "$(SOLAR_JAVA)"!=""
+JAVADEF=-DSOLAR_JAVA
+.IF "$(debug)"==""
+JAVA_RUNTIME=-ljava
+.ELSE
+JAVA_RUNTIME=-ljava_g
+.ENDIF
+.ENDIF
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=
+
+CXX*=g++
+CC*=gcc
+CFLAGS=-c
+CFLAGSCC= -pipe $(ARCH_FLAGS)
+
+CFLAGSEXCEPTIONS=-fexceptions
+CFLAGS_NO_EXCEPTIONS=-fno-exceptions
+
+CFLAGSCXX= -pipe $(ARCH_FLAGS)
+PICSWITCH:=-fPIC
+
+CFLAGSOBJGUIMT=
+CFLAGSOBJCUIMT=
+CFLAGSSLOGUIMT=$(PICSWITCH)
+CFLAGSSLOCUIMT=$(PICSWITCH)
+CFLAGSPROF=
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+CFLAGSOPT=-O2
+CFLAGSNOOPT=
+CFLAGSOUTOBJ=-o
+
+STATIC = -Wl,-Bstatic
+DYNAMIC = -Wl,-Bdynamic
+
+LINK*=$(CXX)
+LINKC*=$(CC)
+
+LINKFLAGS=
+LINKFLAGSAPPGUI=-Wl,-export-dynamic
+LINKFLAGSSHLGUI=-shared
+LINKFLAGSAPPCUI=-Wl,-export-dynamic
+LINKFLAGSSHLCUI=-shared
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=-g
+LINKFLAGSOPT=
+
+LINKVERSIONMAPFLAG=-Wl,--version-script
+
+# enable visibility define in "sal/types.h"
+.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
+.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+
+# Reihenfolge der libs NICHT egal!
+
+STDLIBCPP=-lstdc++
+
+STDOBJVCL=$(L)/salmain.o
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+
+STDLIBGUIMT=$(DYNAMIC) -lpthread -lthread -lm
+STDLIBCUIMT=$(DYNAMIC) -lpthread -lthread -lm
+# libraries for linking shared libraries
+STDSHLGUIMT=$(DYNAMIC) -lpthread -lthread -lm
+STDSHLCUIMT=$(DYNAMIC) -lpthread -lthread -lm
+
+STDLIBGUIMT+=-lX11
+
+.IF "$(STLPORT_VER)" >= "500"
+LIBSTLPORT=$(DYNAMIC) -lstlport
+LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
+.ELSE
+LIBSTLPORT=$(DYNAMIC) -lstlport_gcc
+LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
+.ENDIF
+
+LIBMGR=ar
+LIBFLAGS=-r
+# LIBEXT=.so
+
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=irc
+RCFLAGS=-fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX=sogi
+DLLPRE=lib
+DLLPOST=.so
diff --git a/solenv/inc/unxsogs.mk b/solenv/inc/unxsogs.mk
new file mode 100644
index 000000000000..dd0fb53272f8
--- /dev/null
+++ b/solenv/inc/unxsogs.mk
@@ -0,0 +1,140 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for unxsogs
+ASM=/usr/ccs/bin/as
+AFLAGS=-P
+
+SOLAR_JAVA=TRUE
+JAVAFLAGSDEBUG=-g
+
+# _PTHREADS is needed for the stl
+CDEFS+=-D_PTHREADS -D_REENTRANT -DSYSV -DSUN -DSUN4 -D_POSIX_PTHREAD_SEMANTICS -DSTLPORT_VERSION=$(STLPORT_VER) -D_USE_NAMESPACE=1
+
+
+.IF "$(SOLAR_JAVA)"!=""
+JAVADEF=-DSOLAR_JAVA
+.IF "$(debug)"==""
+JAVA_RUNTIME=-ljava
+.ELSE
+JAVA_RUNTIME=-ljava_g
+.ENDIF
+.ENDIF
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=
+
+CXX*=g++
+CC*=gcc
+CFLAGS=-c
+CFLAGSCC= -pipe $(ARCH_FLAGS)
+
+CFLAGSEXCEPTIONS=-fexceptions
+CFLAGS_NO_EXCEPTIONS=-fno-exceptions
+
+CFLAGSCXX= -pipe $(ARCH_FLAGS)
+PICSWITCH:=-fPIC
+CFLAGSOBJGUIMT=
+CFLAGSOBJCUIMT=
+CFLAGSSLOGUIMT=$(PICSWITCH)
+CFLAGSSLOCUIMT=$(PICSWITCH)
+CFLAGSPROF=
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+CFLAGSOPT=-O2
+CFLAGSNOOPT=
+CFLAGSOUTOBJ=-o
+
+STATIC = -Wl,-Bstatic
+DYNAMIC = -Wl,-Bdynamic
+
+LINK*=$(CXX)
+LINKC*=$(CC)
+
+LINKFLAGS=
+LINKFLAGSAPPGUI=-Wl,-export-dynamic
+LINKFLAGSSHLGUI=-shared
+LINKFLAGSAPPCUI=-Wl,-export-dynamic
+LINKFLAGSSHLCUI=-shared
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=-g
+LINKFLAGSOPT=
+
+LINKVERSIONMAPFLAG=-Wl,--version-script
+
+# enable visibility define in "sal/types.h"
+.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
+.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+
+# Reihenfolge der libs NICHT egal!
+
+STDLIBCPP=-lstdc++
+
+STDOBJVCL=$(L)/salmain.o
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+
+STDLIBGUIMT=$(DYNAMIC) -lpthread -lthread -lm
+STDLIBCUIMT=$(DYNAMIC) -lpthread -lthread -lm
+# libraries for linking shared libraries
+STDSHLGUIMT=$(DYNAMIC) -lpthread -lthread -lm
+STDSHLCUIMT=$(DYNAMIC) -lpthread -lthread -lm
+
+STDLIBGUIMT+=-lX11
+
+.IF "$(STLPORT_VER)" >= "500"
+LIBSTLPORT=$(DYNAMIC) -lstlport
+LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
+.ELSE
+LIBSTLPORT=$(DYNAMIC) -lstlport_gcc
+LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
+.ENDIF
+
+LIBMGR=ar
+LIBFLAGS=-r
+# LIBEXT=.so
+
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=irc
+RCFLAGS=-fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX=sogs
+DLLPRE=lib
+DLLPOST=.so
diff --git a/solenv/inc/unxsoli4.mk b/solenv/inc/unxsoli4.mk
new file mode 100644
index 000000000000..b1778a0edfde
--- /dev/null
+++ b/solenv/inc/unxsoli4.mk
@@ -0,0 +1,241 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+ASM=/usr/ccs/bin/as
+AFLAGS=-P
+
+CDEFS+=-D_PTHREADS -DSYSV -DSUN -DSUN4 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DSTLPORT_VERSION=$(STLPORT_VER)
+
+SOLAR_JAVA*=TRUE
+.IF "$(SOLAR_JAVA)"!=""
+JAVADEF=-DSOLAR_JAVA
+JAVAFLAGSDEBUG=-g
+.IF "$(debug)"==""
+JAVA_RUNTIME=-ljava
+.ELSE
+JAVA_RUNTIME=-ljava_g
+.ENDIF
+.ENDIF
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=
+
+CXX*=CC
+CC*=cc
+
+CFLAGS=$(PREENVCFLAGS) -c -temp=/tmp
+CFLAGSCC=-xCC $(ARCH_FLAGS)
+CFLAGSCXX=-features=no%altspell -library=no%Cstd $(ARCH_FLAGS)
+
+# flags to enable build with symbols; required for crashdump feature
+CFLAGSENABLESYMBOLS=-g0 -xs # was temporarily commented out, reenabled before Beta
+CFLAGSENABLESYMBOLS_CC_ONLY=-g -xs # was temporarily commented out, reenabled before Beta
+
+CFLAGSEXCEPTIONS=
+CFLAGS_NO_EXCEPTIONS=-noex
+
+CFLAGSOBJGUIMT=-KPIC -mt
+CFLAGSOBJCUIMT=-KPIC -mt
+CFLAGSSLOGUIMT=-KPIC -mt
+CFLAGSSLOCUIMT=-KPIC -mt
+CFLAGSPROF=-xpg
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+CFLAGSOPT=-xarch=generic -xO3
+CFLAGSNOOPT=
+CFLAGSOUTOBJ=-o
+
+# Warnings switched off for CXX:
+# - doubunder: we have many identifiers containing double underscores, some of
+# them in the stable UDK API we cannot change
+# - identexpected: Identifier expected instead of "}"
+# if an enum ends with a comma before the '}'
+# this warning does not seem to heed #pragma disable_warn, and is not helpful
+# - inllargeuse: "function is too large and will not be expanded inline" is
+# merely a hint
+# - inllargeint: "function is too large to generate inline, consider writing
+# it yourself" is merely a hint
+# - notemsource: "could not find source for function" appears to be spurious
+# - reftotemp: warns about calling non-const functions on temporary objects,
+# something legally done by boost::scoped_array<T>::reset, for example
+# (this_type(p).swap(*this))
+# - truncwarn: "conversion of 64 bit type value to smaller type causes
+# truncation" at least with CC 5.8 is reported only at the end of a
+# compilation unit that uses std::hash_map<sal_Int64, sal_Int64> (see
+# sfx2/source/toolbox/imgmgr.cxx:1.27) and thus unfortunately needs to be
+# disabled globally
+# - wnoretvalue: warning about the last statement of a function not
+# returning a value. Unfortunately triggers on perfectly acceptable
+# code, for example if the last statement in is a throw statement
+# - anonnotype: Warns if a type is declared in an anonymous union. Temporary
+# disabled until issue i97325 is fixed. Note: The compiler is actually
+# right about this warning, the C++ standard is explicit about this.
+CFLAGSWARNCC=
+CFLAGSWARNCXX=+w2 -erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,anonnotype
+CFLAGSWALLCC=$(CFLAGSWARNCC)
+CFLAGSWALLCXX=$(CFLAGSWARNCXX)
+CFLAGSWERRCC=-errwarn=%all
+CFLAGSWERRCXX=-xwe
+
+# Once all modules on this platform compile without warnings, set
+# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
+# settings.mk):
+MODULES_WITH_WARNINGS := \
+ soldep
+
+STDOBJVCL=$(L)/salmain.o
+
+THREADLIB=
+.IF "$(PURIFY)"!=""
+LINK=/usr/local/purify-4.2-solaris2/purify CC
+.ELSE
+LINK=$(CXX)
+.ENDIF
+LINKC=$(CC)
+
+# link against set of baseline libraries
+.IF "$(SYSBASE)"!=""
+C_RESTRICTIONFLAGS*=-xc99=none
+#LD_OPTIONS+:=-L$(SYSBASE)/usr/lib
+CDEFS+=-DSYSBASE="$(SYSBASE)"
+CFLAGSCC+=$(C_RESTRICTIONFLAGS)
+#.EXPORT : LD_OPTIONS
+.ENDIF # "$(SYSBASE)"!=""
+
+# -z combreloc combines multiple relocation sections. Reduces overhead on startup
+# -norunpath prevents the compiler from recording his own libs in the runpath
+LINKFLAGSRUNPATH_URELIB=-R\''$$ORIGIN'\'
+LINKFLAGSRUNPATH_UREBIN=-R\''$$ORIGIN/../lib:$$ORIGIN'\'
+ #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
+LINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
+LINKFLAGSRUNPATH_SDK=-R\''$$ORIGIN/../../ure-link/lib'\'
+LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
+LINKFLAGSRUNPATH_OXT=
+LINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN/../../../basis-link/program'\'
+LINKFLAGSRUNPATH_NONE=
+LINKFLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=no%Cstd
+LINKCFLAGS=-w -mt -z combreloc -norunpath
+
+# -z text force fatal error if non PIC code is linked into shared library. Such code
+# would be expensive on startup
+CHECKFORPIC =-z text
+LINKFLAGSSHLGUI=$(CHECKFORPIC) -G
+LINKFLAGSSHLCUI=$(CHECKFORPIC) -G
+
+# switches for dynamic and static linking
+LINKFLAGSDEFS*= -z defs
+STATIC = -Bstatic
+DIRECT = -Bdirect $(LINKFLAGSDEFS)
+DYNAMIC = -Bdynamic
+
+LINKFLAGSAPPGUI+=$(DIRECT)
+LINKFLAGSAPPCUI+=$(DIRECT)
+LINKFLAGSSHLGUI+=$(DIRECT)
+LINKFLAGSSHLCUI+=$(DIRECT)
+
+LINKFLAGSTACK=
+LINKFLAGSPROF=-L$(COMPATH)/WS6U1/lib/libp -xpg -z allextract
+LINKFLAGSDEBUG=
+LINKFLAGSOPT=
+LINKVERSIONMAPFLAG=-M
+
+# mapfile for non-executable stack
+LINKFLAGSNOEXSTK*=$(LINKVERSIONMAPFLAG) $(SOLARENV)/src/solaris_noexstk.map
+LINKFLAGSAPPGUI+=$(LINKFLAGSNOEXSTK)
+LINKFLAGSAPPCUI+=$(LINKFLAGSNOEXSTK)
+
+APPLINKSTATIC=$(STATIC)
+APPLINKSHARED=$(DIRECT)
+APP_LINKTYPE=
+
+STDLIBCPP=-lCrun
+
+# reihenfolge der libs NICHT egal!
+STDOBJGUI=
+.IF "DBG_UTIL" != ""
+STDSLOGUI=#-lpthread
+.ELSE
+STDSLOGUI=
+.ENDIF
+STDOBJCUI=
+STDSLOCUI=
+
+# CPPRUNTIME - define where to place C++ runtime if required
+STDLIBGUIMT=$(DYNAMIC) -lpthread -lm
+STDLIBCUIMT=$(DYNAMIC) -lpthread -lm
+STDSHLGUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
+STDSHLCUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
+
+# libdl.so - no really an GUI library but required in this context
+STDLIBGUIMT+=-ldl
+STDSHLGUIMT+=-ldl
+X11LINK_DYNAMIC = -lXext -lX11
+
+# @@@ interposer needed for -Bdirect @@@
+# LIBSALCPPRT*=-z allextract -lsalcpprt -z defaultextract
+LIBSALCPPRT=
+
+.IF "$(USE_STLP_DEBUG)" != ""
+LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro_debug
+LIBSTLPORTST=$(STATIC) -lstlport_sunpro_debug $(DYNAMIC)
+.ELSE
+LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro
+LIBSTLPORTST=$(STATIC) -lstlport_sunpro $(DYNAMIC)
+.ENDIF # "$(USE_STLP_DEBUG)" != ""
+
+LIBMGR=CC
+LIBFLAGS=-xar -o
+
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+IGNORE_SYMBOLS=S-LP64
+
+RC=irc
+RCFLAGS=-fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX=si
+
+DLLPRE=lib
+DLLPOST=.so
+
+LDUMP=cppfilt /b /n /o /p
+
+CFLAGSCXXSLO +=
+CFLAGSCXXOBJ +=
+
+LINKFLAGSAPPGUI+=
+LINKFLAGSSHLGUI+=
+LINKFLAGSAPPCUI+=
+LINKFLAGSSHLCUI+=
diff --git a/solenv/inc/unxsols4.mk b/solenv/inc/unxsols4.mk
new file mode 100644
index 000000000000..4febb67d446a
--- /dev/null
+++ b/solenv/inc/unxsols4.mk
@@ -0,0 +1,247 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+ASM=/usr/ccs/bin/as
+# needs -D__sparcv8plus because it's not defined by the assembler with -xarch=v8plus
+AFLAGS=-P -xarch=v8plus -D__sparcv8plus
+
+CDEFS+=-D_PTHREADS -DSYSV -DSUN -DSUN4 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DSTLPORT_VERSION=$(STLPORT_VER)
+
+SOLAR_JAVA*=TRUE
+.IF "$(SOLAR_JAVA)"!=""
+JAVADEF=-DSOLAR_JAVA
+JAVAFLAGSDEBUG=-g
+.IF "$(debug)"==""
+JAVA_RUNTIME=-ljava
+.ELSE
+JAVA_RUNTIME=-ljava_g
+.ENDIF
+.ENDIF
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=
+
+CXX*=CC
+CC*=cc
+
+CFLAGS=$(PREENVCFLAGS) -c -temp=/tmp
+# CC defines __sparcv8plus with -xarch=v8plus, cc does not (sigh)
+CFLAGSCC=-xCC -D__sparcv8plus $(ARCH_FLAGS)
+CFLAGSCXX=-features=no%altspell -library=no%Cstd $(ARCH_FLAGS)
+
+# flags to enable build with symbols; required for crashdump feature
+CFLAGSENABLESYMBOLS=-g0 -xs # was temporarily commented out, reenabled before Beta
+CFLAGSENABLESYMBOLS_CC_ONLY=-g -xs # was temporarily commented out, reenabled before Beta
+
+CFLAGSEXCEPTIONS=
+CFLAGS_NO_EXCEPTIONS=-noex
+
+CFLAGSOBJGUIMT=-KPIC -mt
+CFLAGSOBJCUIMT=-KPIC -mt
+CFLAGSSLOGUIMT=-KPIC -mt
+CFLAGSSLOCUIMT=-KPIC -mt
+CFLAGSPROF=-xpg
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+# -m32 -xarch=sparc restrict target to 32 bit sparc
+# -xO3 optimization level 3
+# -xspace don't do optimizations which do increase binary size
+# -xprefetch=yes do prefetching (helps on UltraSparc III)
+CFLAGSOPT=-m32 -xarch=sparc -xO3 -xspace -xprefetch=yes
+CFLAGSNOOPT=
+CFLAGSOUTOBJ=-o
+
+# Warnings switched off for CXX:
+# - doubunder: we have many identifiers containing double underscores, some of
+# them in the stable UDK API we cannot change
+# - identexpected: Identifier expected instead of "}"
+# if an enum ends with a comma before the '}'
+# this warning does not seem to heed #pragma disable_warn, and is not helpful
+# - inllargeuse: "function is too large and will not be expanded inline" is
+# merely a hint
+# - inllargeint: "function is too large to generate inline, consider writing
+# it yourself" is merely a hint
+# - notemsource: "could not find source for function" appears to be spurious
+# - reftotemp: warns about calling non-const functions on temporary objects,
+# something legally done by boost::scoped_array<T>::reset, for example
+# (this_type(p).swap(*this))
+# - truncwarn: "conversion of 64 bit type value to smaller type causes
+# truncation" at least with CC 5.8 is reported only at the end of a
+# compilation unit that uses std::hash_map<sal_Int64, sal_Int64> (see
+# sfx2/source/toolbox/imgmgr.cxx:1.27) and thus unfortunately needs to be
+# disabled globally
+# - wnoretvalue: warning about the last statement of a function not
+# returning a value. Unfortunately triggers on perfectly acceptable
+# code, for example if the last statement in is a throw statement
+# - anonnotype: Warns if a type is declared in an anonymous union. Temporary
+# disabled until issue i97325 is fixed. Note: The compiler is actually
+# right about this warning, the C++ standard is explicit about this.
+CFLAGSWARNCC=
+CFLAGSWARNCXX=+w2 -erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,anonnotype
+CFLAGSWALLCC=$(CFLAGSWARNCC)
+CFLAGSWALLCXX=$(CFLAGSWARNCXX)
+CFLAGSWERRCC=-errwarn=%all
+CFLAGSWERRCXX=-xwe
+
+# Once all modules on this platform compile without warnings, set
+# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
+# settings.mk):
+MODULES_WITH_WARNINGS := \
+ soldep
+
+STDOBJVCL=$(L)/salmain.o
+
+THREADLIB=
+.IF "$(PURIFY)"!=""
+LINK=/usr/local/purify-4.2-solaris2/purify CC
+.ELSE
+LINK=$(CXX)
+.ENDIF
+LINKC=$(CC)
+
+# link against set of baseline libraries
+.IF "$(SYSBASE)"!=""
+C_RESTRICTIONFLAGS*=-xc99=none
+#LD_OPTIONS+:=-L$(SYSBASE)/usr/lib
+CDEFS+=-DSYSBASE="$(SYSBASE)"
+CFLAGSCC+=$(C_RESTRICTIONFLAGS)
+#.EXPORT : LD_OPTIONS
+.ENDIF # "$(SYSBASE)"!=""
+
+# -z combreloc combines multiple relocation sections. Reduces overhead on startup
+# -norunpath prevents the compiler from recording his own libs in the runpath
+LINKFLAGSRUNPATH_URELIB=-R\''$$ORIGIN'\'
+LINKFLAGSRUNPATH_UREBIN=-R\''$$ORIGIN/../lib:$$ORIGIN'\'
+ #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
+LINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
+LINKFLAGSRUNPATH_SDK=-R\''$$ORIGIN/../../ure-link/lib'\'
+LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
+LINKFLAGSRUNPATH_OXT=
+LINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN/../../../basis-link/program'\'
+LINKFLAGSRUNPATH_NONE=
+LINKFLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=no%Cstd
+LINKCFLAGS=-w -mt -z combreloc -norunpath
+
+# -z text force fatal error if non PIC code is linked into shared library. Such code
+# would be expensive on startup
+CHECKFORPIC =-z text
+LINKFLAGSSHLGUI=$(CHECKFORPIC) -G
+LINKFLAGSSHLCUI=$(CHECKFORPIC) -G
+
+# switches for dynamic and static linking
+LINKFLAGSDEFS*= -z defs
+STATIC = -Bstatic
+DIRECT = -Bdirect $(LINKFLAGSDEFS)
+DYNAMIC = -Bdynamic
+
+LINKFLAGSAPPGUI+=$(DIRECT)
+LINKFLAGSAPPCUI+=$(DIRECT)
+LINKFLAGSSHLGUI+=$(DIRECT)
+LINKFLAGSSHLCUI+=$(DIRECT)
+
+LINKFLAGSTACK=
+LINKFLAGSPROF=-L$(COMPATH)/WS6U1/lib/libp -xpg -z allextract
+LINKFLAGSDEBUG=
+LINKFLAGSOPT=
+LINKVERSIONMAPFLAG=-M
+
+# mapfile for non-executable stack
+LINKFLAGSNOEXSTK*=$(LINKVERSIONMAPFLAG) $(SOLARENV)/src/solaris_noexstk.map
+LINKFLAGSAPPGUI+=$(LINKFLAGSNOEXSTK)
+LINKFLAGSAPPCUI+=$(LINKFLAGSNOEXSTK)
+
+APPLINKSTATIC=$(STATIC)
+APPLINKSHARED=$(DIRECT)
+APP_LINKTYPE=
+
+STDLIBCPP=-lCrun
+
+# reihenfolge der libs NICHT egal!
+STDOBJGUI=
+.IF "DBG_UTIL" != ""
+STDSLOGUI=#-lpthread
+.ELSE
+STDSLOGUI=
+.ENDIF
+STDOBJCUI=
+STDSLOCUI=
+
+# CPPRUNTIME - define where to place C++ runtime if required
+STDLIBGUIMT=$(DYNAMIC) -lpthread -lm
+STDLIBCUIMT=$(DYNAMIC) -lpthread -lm
+STDSHLGUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
+STDSHLCUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
+
+# libdl.so - no really an GUI library but required in this context
+STDLIBGUIMT+=-ldl
+STDSHLGUIMT+=-ldl
+X11LINK_DYNAMIC = -lXext -lX11
+
+# @@@ interposer needed for -Bdirect @@@
+# LIBSALCPPRT*=-z allextract -lsalcpprt -z defaultextract
+LIBSALCPPRT=
+
+.IF "$(USE_STLP_DEBUG)" != ""
+LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro_debug
+LIBSTLPORTST=$(STATIC) -lstlport_sunpro_debug $(DYNAMIC)
+.ELSE
+LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro
+LIBSTLPORTST=$(STATIC) -lstlport_sunpro $(DYNAMIC)
+.ENDIF # "$(USE_STLP_DEBUG)" != ""
+
+LIBMGR=CC
+LIBFLAGS=-xar -o
+
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+IGNORE_SYMBOLS=S-LP64
+
+RC=irc
+RCFLAGS=-fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX=ss
+
+DLLPRE=lib
+DLLPOST=.so
+
+LDUMP=cppfilt /b /n /o /p
+
+CFLAGSCXXSLO +=
+CFLAGSCXXOBJ +=
+
+LINKFLAGSAPPGUI+=
+LINKFLAGSSHLGUI+=
+LINKFLAGSAPPCUI+=
+LINKFLAGSSHLCUI+=
diff --git a/solenv/inc/unxsolu4.mk b/solenv/inc/unxsolu4.mk
new file mode 100644
index 000000000000..c73d6fc37283
--- /dev/null
+++ b/solenv/inc/unxsolu4.mk
@@ -0,0 +1,242 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+
+# 64 bit (LP64) platform
+IS_LP64=TRUE
+
+ASM=/usr/ccs/bin/as
+AFLAGS=-P -xarch=v9
+
+
+CDEFS+=-D_PTHREADS -DSYSV -DSUN -DSUN4 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DIS_LP64
+
+SOLAR_JAVA*=TRUE
+.IF "$(SOLAR_JAVA)"!=""
+JAVADEF=-DSOLAR_JAVA
+JAVAFLAGSDEBUG=-g
+.IF "$(debug)"==""
+JAVA_RUNTIME=-ljava
+.ELSE
+JAVA_RUNTIME=-ljava_g
+.ENDIF
+.ENDIF
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=-m64
+
+CXX*=CC
+CC*=cc
+
+CFLAGS=$(PREENVCFLAGS) -c -temp=/tmp
+CFLAGSCC=-xCC $(ARCH_FLAGS)
+CFLAGSCXX= -features=no%altspell -library=stlport4 $(ARCH_FLAGS)
+
+# flags to enable build with symbols; required for crashdump feature
+CFLAGSENABLESYMBOLS=-g0 -xs # was temporarily commented out, reenabled before Beta
+CFLAGSENABLESYMBOLS_CC_ONLY=-g -xs # was temporarily commented out, reenabled before Beta
+
+CFLAGSEXCEPTIONS=
+CFLAGS_NO_EXCEPTIONS=-noex
+
+CFLAGSOBJGUIMT=-KPIC -mt
+CFLAGSOBJCUIMT=-KPIC -mt
+CFLAGSSLOGUIMT=-KPIC -mt
+CFLAGSSLOCUIMT=-KPIC -mt
+CFLAGSPROF=-xpg
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+# -xO3 optimization level 3
+CFLAGSOPT= -xO3 -xalias_level=compatible
+CFLAGSNOOPT=
+CFLAGSOUTOBJ=-o
+
+# Warnings switched off for CXX:
+# - doubunder: we have many identifiers containing double underscores, some of
+# them in the stable UDK API we cannot change
+# - identexpected: Identifier expected instead of "}"
+# if an enum ends with a comma before the '}'
+# this warning does not seem to heed #pragma disable_warn, and is not helpful
+# - inllargeuse: "function is too large and will not be expanded inline" is
+# merely a hint
+# - inllargeint: "function is too large to generate inline, consider writing
+# it yourself" is merely a hint
+# - notemsource: "could not find source for function" appears to be spurious
+# - reftotemp: warns about calling non-const functions on temporary objects,
+# something legally done by boost::scoped_array<T>::reset, for example
+# (this_type(p).swap(*this))
+# - truncwarn: "conversion of 64 bit type value to smaller type causes
+# truncation" at least with CC 5.8 is reported only at the end of a
+# compilation unit that uses std::hash_map<sal_Int64, sal_Int64> (see
+# sfx2/source/toolbox/imgmgr.cxx:1.27) and thus unfortunately needs to be
+# disabled globally
+# - wnoretvalue: "The last statement should return a value."
+# CC 5.9: the compiler does often not notice that there is no way
+# to reach the closing brace of a function without either returning a proper
+# value or throwing an exception.
+# - hidef: "d::foo() hides the function b::foo()." We got still some cases of mixed
+# sal_uInt32 and ULONG usages which needs to be fixed. We can then remove this one
+CFLAGSWARNCC=
+CFLAGSWARNCXX=+w2 -erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,hidef,anonnotype,unassigned,badargtype2w
+CFLAGSWALLCC=$(CFLAGSWARNCC)
+CFLAGSWALLCXX=$(CFLAGSWARNCXX)
+CFLAGSWERRCC=-errwarn=%all
+CFLAGSWERRCXX=-xwe
+
+# Once all modules on this platform compile without warnings, set
+# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
+# settings.mk):
+MODULES_WITH_WARNINGS := \
+ soldep
+
+STDOBJVCL=$(L)/salmain.o
+
+THREADLIB=
+LINK=$(CXX)
+LINKC=$(CC)
+
+# link against set of baseline libraries
+.IF "$(SYSBASE)"!=""
+C_RESTRICTIONFLAGS*=-xc99=none
+LD_OPTIONS+=-L$(SYSBASE)/usr/lib
+CDEFS+=-DSYSBASE="$(SYSBASE)"
+CFLAGSCC+=$(C_RESTRICTIONFLAGS)
+.EXPORT : LD_OPTIONS
+.ENDIF # "$(SYSBASE)"!=""
+
+# -z combreloc combines multiple relocation sections. Reduces overhead on startup
+# -norunpath prevents the compiler from recording his own libs in the runpath
+LINKFLAGSRUNPATH_URELIB=-R\''$$ORIGIN'\'
+LINKFLAGSRUNPATH_UREBIN=-R\''$$ORIGIN/../lib:$$ORIGIN'\'
+ #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
+LINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
+LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
+LINKFLAGSRUNPATH_OXT=
+LINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN/../../../basis-link/program'\'
+LINKFLAGSRUNPATH_NONE=
+LINKFLAGS=-m64 -w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=stlport4
+LINKCFLAGS=-m64 -w -mt -z combreloc -norunpath
+
+# -z text force fatal error if non PIC code is linked into shared library. Such code
+# would be expensive on startup
+CHECKFORPIC =-z text
+LINKFLAGSSHLGUI=$(CHECKFORPIC) -G
+LINKFLAGSSHLCUI=$(CHECKFORPIC) -G
+
+# switches for dynamic and static linking
+LINKFLAGSDEFS*= -z defs
+STATIC = -Bstatic
+DIRECT = -Bdirect $(LINKFLAGSDEFS)
+DYNAMIC = -Bdynamic
+
+LINKFLAGSAPPGUI+=$(DIRECT)
+LINKFLAGSAPPCUI+=$(DIRECT)
+LINKFLAGSSHLGUI+=$(DIRECT)
+LINKFLAGSSHLCUI+=$(DIRECT)
+
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=
+LINKFLAGSOPT=
+LINKVERSIONMAPFLAG=-M
+
+# mapfile for non-executable stack
+LINKFLAGSNOEXSTK*=$(LINKVERSIONMAPFLAG) $(SOLARENV)/src/solaris_noexstk.map
+LINKFLAGSAPPGUI+=$(LINKFLAGSNOEXSTK)
+LINKFLAGSAPPCUI+=$(LINKFLAGSNOEXSTK)
+
+APPLINKSTATIC=$(STATIC)
+APPLINKSHARED=$(DIRECT)
+APP_LINKTYPE=
+
+STDLIBCPP=-lCrun
+
+# reihenfolge der libs NICHT egal!
+STDOBJGUI=
+.IF "DBG_UTIL" != ""
+STDSLOGUI=#-lpthread
+.ELSE
+STDSLOGUI=
+.ENDIF
+STDOBJCUI=
+STDSLOCUI=
+
+# CPPRUNTIME - define where to place C++ runtime if required
+STDLIBGUIMT=$(DYNAMIC) -lpthread -lm
+STDLIBCUIMT=$(DYNAMIC) -lpthread -lm
+STDSHLGUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
+STDSHLCUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
+
+# libdl.so - no really an GUI library but required in this context
+STDLIBGUIMT+=-lX11 -ldl
+STDSHLGUIMT+=-lX11 -ldl
+
+# @@@ interposer needed for -Bdirect @@@
+# LIBSALCPPRT*=-z allextract -lsalcpprt -z defaultextract
+LIBSALCPPRT=
+
+.IF "$(USE_STLP_DEBUG)" != ""
+LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro_debug
+LIBSTLPORTST=$(STATIC) -lstlport_sunpro_debug $(DYNAMIC)
+.ELSE
+LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro
+LIBSTLPORTST=$(STATIC) -lstlport_sunpro $(DYNAMIC)
+.ENDIF # "$(USE_STLP_DEBUG)" != ""
+
+LIBMGR=CC
+LIBFLAGS=-xar -o
+
+IMPLIB=
+IMPLIBFLAGS=
+
+MAPSYM=
+MAPSYMFLAGS=
+IGNORE_SYMBOLS=S-ILP32
+
+RC=irc
+RCFLAGS=-fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX=su
+
+DLLPRE=lib
+DLLPOST=.so
+
+LDUMP=cppfilt /b /n /o /p
+
+CFLAGSCXXSLO +=
+CFLAGSCXXOBJ +=
+
+LINKFLAGSAPPGUI+=
+LINKFLAGSSHLGUI+=
+LINKFLAGSAPPCUI+=
+LINKFLAGSSHLCUI+=
+
+BUILD64=1
diff --git a/solenv/inc/verinfo.hrc b/solenv/inc/verinfo.hrc
new file mode 100644
index 000000000000..d0a585af90ee
--- /dev/null
+++ b/solenv/inc/verinfo.hrc
@@ -0,0 +1,229 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _VERINFO_HRC
+#define _VERINFO_HRC
+
+// include ---------------------------------------------------------------
+
+#ifndef WIN32
+#include <ver.h>
+#else
+#include <winver.h>
+#endif
+
+// general preprocessor string management --------------------------------
+
+#ifndef PPSX
+#define PPSX(s) #s
+#endif
+#ifndef PPS
+#define PPS(s) PPSX(s)
+#endif
+
+#ifndef PPCX
+#define PPCX(s1, s2) s1##s2
+#endif
+#ifndef PPCAT
+#define PPCAT(s1, s2) PPCX(s1, s2)
+#endif
+
+// define order of date parts --------------------------------------------
+
+#if defined(LG_D)
+ #define VER_DMY
+#else
+ #define VER_YMD
+#endif
+
+// set VERVARIANT to 0 if not defined ------------------------------------
+
+#if !defined(VERVARIANT)
+ #define VERVARIANT 0
+#endif
+
+// define pre release state ----------------------------------------------
+
+#ifdef VER_CONCEPT
+ #define VER_PREL 1
+ #define VER_COUNT (0+VER_CONCEPT)
+ #define VER1 Concept (Level VER_CONCEPT)
+#endif
+
+#ifdef VER_ALPHA
+ #define VER_PREL 1
+ #define VER_COUNT (100+VER_ALPHA)
+ #define VER1 Alpha (Level VER_ALPHA)
+#endif
+
+#ifdef VER_BETA
+ #define VER_PREL 1
+ #define VER_COUNT (200+VER_BETA)
+ #define VER1 Beta (Level VER_BETA)
+#endif
+
+#ifdef VER_GAMMA
+ #define VER_PREL 1
+ #define VER_COUNT (300+VER_GAMMA)
+ #define VER1 Gamma (Level VER_GAMMA)
+#endif
+
+#ifdef VER_FINAL
+ #define VER_COUNT (500+VER_FINAL)
+ #if VER_FINAL==0
+ #undef VER1
+ #elif VER_FINAL==1
+ #define VER1 1
+ #elif VER_FINAL==2
+ #define VER1 2
+ #elif VER_FINAL==3
+ #define VER1 3
+ #elif VER_FINAL==4
+ #define VER1 4
+ #elif VER_FINAL==5
+ #define VER1 5
+ #elif VER_FINAL==6
+ #define VER1 6
+ #elif VER_FINAL==7
+ #define VER1 7
+ #elif VER_FINAL==8
+ #define VER1 8
+ #elif VER_FINAL==9
+ #define VER1 9
+ #elif VER_FINAL==10
+ #define VER1 a
+ #elif VER_FINAL==11
+ #define VER1 b
+ #elif VER_FINAL==12
+ #define VER1 c
+ #endif
+#endif
+
+#ifdef SUBVERSION
+#if SUBVERSION < 10
+ #define VER4 PPCAT(0, SUBVERSION)
+#else
+ #define VER4 SUBVERSION
+#endif
+#else
+ #define VER4 0.0
+#endif
+
+#ifndef VER1
+#if VERVARIANT > 0
+ #define VER_LEVEL VERSION.VER4.VERVARIANT
+#else
+ #define VER_LEVEL VERSION.VER4
+#endif
+#else
+ #define VERC1(a, b, c) a.b##c
+ #define VERC2(a, b, c) VERC1(a, b, c)
+ #define VER_LEVEL VERC2(VERSION, VER4, VER1)
+#endif
+
+#if !defined(VER_DMY) && VER_DAY < 10
+ #define VER5 PPCAT(0, VER_DAY)
+#else
+ #define VER5 VER_DAY
+#endif
+
+// define month strings --------------------------------------------------
+
+#if VER_MONTH==1
+ #define VER2 Jan
+#elif VER_MONTH==2
+ #define VER2 Feb
+#elif VER_MONTH==3
+ #ifdef LG_D
+ #define VER2 M\344r
+ #else
+ #define VER2 Mar
+ #endif
+#elif VER_MONTH==4
+ #define VER2 Apr
+#elif VER_MONTH==5
+ #ifdef LG_D
+ #define VER2 Mai
+ #else
+ #define VER2 May
+ #endif
+#elif VER_MONTH==6
+ #define VER2 Jun
+#elif VER_MONTH==7
+ #define VER2 Jul
+#elif VER_MONTH==8
+ #define VER2 Aug
+#elif VER_MONTH==9
+ #define VER2 Sep
+#elif VER_MONTH==10
+ #ifdef LG_D
+ #define VER2 Okt
+ #else
+ #define VER2 Oct
+ #endif
+#elif VER_MONTH==11
+ #define VER2 Nov
+#elif VER_MONTH==12
+ #ifdef LG_D
+ #define VER2 Dez
+ #else
+ #define VER2 Dec
+ #endif
+#endif
+
+#ifdef LG_D
+ #define VERC3(a, b, c) a.b.c
+#else
+ #define VERC3(a, b, c) c-b-a
+#endif
+#define VERC4(a, b, c) VERC3(a, b, c)
+#define VER_DATE VERC4(VER5, VER2, VER_YEAR)
+
+#if PPCAT(1, VER_FIRSTYEAR)==PPCAT(1, VER_YEAR)
+ #define VER_YEARRANGE VER_FIRSTYEAR
+#else
+ #define VER_YEARRANGE VER_FIRSTYEAR-VER_YEAR
+#endif
+
+#if VER_FIRSTYEAR > 100
+#define VERC5(a) Copyright \251 a by
+#define VERC6(a) VERC5(a)
+#else
+#define VERC5(a) Copyright \251 20##a by
+#define VERC6(a) VERC5(a)
+#endif
+
+#define S_CRIGHT PPS(VERC6(VER_YEARRANGE))
+
+#ifdef LG_D
+#define S_VERSION PPS(Version VER_LEVEL vom VER_DATE)
+#else
+#define S_VERSION PPS(Version VER_LEVEL of VER_DATE)
+#endif
+
+#endif // _VERINFO_HRC
+
diff --git a/solenv/inc/version.hrc b/solenv/inc/version.hrc
new file mode 100755
index 000000000000..0a0d0d103ac3
--- /dev/null
+++ b/solenv/inc/version.hrc
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ *************************************************************************/
+
+#include "versionlist.hrc"
+
+//#define VERVARIANT 0 // never define this one, will be provided by build environment (BUILD_ID)
+
+#define VER_FINAL 0
+
+#ifndef VER_FIRSTYEAR
+#define VER_FIRSTYEAR VER_YEAR
+#endif
+
+#include "verinfo.hrc"
+
+#ifdef WIN32
+#define FOR_WIN_X " (32 Bit)"
+#else
+#define FOR_WIN_X ""
+#endif
+
+// -----------------------------------------------------------------------
+// language/character set specification table
+// -----------------------------------------------------------------------
+
+RCD_LANGUAGE rcdata
+{
+#ifdef LG_D
+ "040704B0", // Germany -> Unicode
+ "040704E4", // Germany -> Windows, Multilingual
+#else
+ "040904B0", // Germany -> Unicode
+ "040904E4", // USA -> Windows, Multilingual
+#endif
+ "04090000", // USA -> 7-Bit-ASCII
+ 0 // end of table
+}
+
+
+// version binary entry
+VS_VERSION_INFO rcdata
+{
+ 0xF0, "sw", 0x0F, VER_YEAR, VER_MONTH, VER_DAY,
+ VERSION, SUBVERSION, VERVARIANT, VER_COUNT
+};
+
diff --git a/solenv/inc/version.lst b/solenv/inc/version.lst
new file mode 100755
index 000000000000..200cdf53e924
--- /dev/null
+++ b/solenv/inc/version.lst
@@ -0,0 +1,34 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+OOOBASEVERSIONMAJOR=3
+OOOBASEVERSIONMINOR=4
+OOOBASEVERSIONMICRO=0
+
+OOOBASEVERSIONDAY=1
+OOOBASEVERSIONMONTH=10
+OOOBASEVERSIONYEAR=2010
diff --git a/solenv/inc/version_so.hrc b/solenv/inc/version_so.hrc
new file mode 100755
index 000000000000..383f3530ccbf
--- /dev/null
+++ b/solenv/inc/version_so.hrc
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ *************************************************************************/
+
+#include "versionlist.hrc"
+
+//#define VERVARIANT 0 // never define this one, will be provided by build environment (BUILD_ID)
+
+#define VER_FINAL 0
+
+#ifndef VER_FIRSTYEAR
+#define VER_FIRSTYEAR VER_YEAR
+#endif
+
+#include "verinfo.hrc"
+
+#ifdef WIN32
+#define FOR_WIN_X " (32 Bit)"
+#else
+#define FOR_WIN_X ""
+#endif
+
+// -----------------------------------------------------------------------
+// language/character set specification table
+// -----------------------------------------------------------------------
+
+RCD_LANGUAGE rcdata
+{
+#ifdef LG_D
+ "040704B0", // Germany -> Unicode
+ "040704E4", // Germany -> Windows, Multilingual
+#else
+ "040904B0", // Germany -> Unicode
+ "040904E4", // USA -> Windows, Multilingual
+#endif
+ "04090000", // USA -> 7-Bit-ASCII
+ 0 // end of table
+}
+
+// version binary entry
+VS_VERSION_INFO rcdata
+{
+ 0xF0, "sw", 0x0F, VER_YEAR, VER_MONTH, VER_DAY,
+ VERSION, SUBVERSION, VERVARIANT, VER_COUNT
+};
+
diff --git a/solenv/inc/versionlist.mk b/solenv/inc/versionlist.mk
new file mode 100755
index 000000000000..672df7bd7602
--- /dev/null
+++ b/solenv/inc/versionlist.mk
@@ -0,0 +1,30 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+.INCLUDE: version.lst
+
+.EXPORT : OOOBASEVERSIONMAJOR OOOBASEVERSIONMINOR OOOBASEVERSIONMICRO OOOBASEVERSIONDAY OOOBASEVERSIONMONTH OOOBASEVERSIONYEAR
diff --git a/solenv/inc/wnt.mk b/solenv/inc/wnt.mk
new file mode 100644
index 000000000000..f369bd15ad30
--- /dev/null
+++ b/solenv/inc/wnt.mk
@@ -0,0 +1,72 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# --- Windows-NT-Environment ---------------------------------------
+# Used if "$(GUI)" == "WNT"
+
+# --- Compiler ---
+
+.IF "$(OS)$(COM)$(CPU)" == "WNTMSCI"
+.IF "$(COMEX)" == "10"
+.INCLUDE : wntmsci10.mk
+.ELSE
+# for wntmsci11 (.Net 2005) and wntmsci12 (.Net 2008)
+.INCLUDE : wntmsci11.mk
+.ENDIF # "$(COMEX)" == "10"
+.ENDIF # "$(OS)$(COM)$(CPU)" == "WNTMSCI"
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCWNTI"
+.INCLUDE : wntgcci.mk
+.ENDIF
+
+# --- changes for W32-tcsh - should move into settings.mk ---
+JAVAC=javac
+JAVA=java
+JAVAI!:=java
+PATH_SEPERATOR*=:
+
+# --- general WNT settings ---
+
+HC=hc
+HCFLAGS=
+DLLPRE=
+DLLPOST=.dll
+EXECPOST=.exe
+SCPPOST=.inf
+DLLDEST=$(BIN)
+SOLARSHAREDBIN=$(SOLARBINDIR)
+
+.IF "$(SOLAR_JAVA)"!=""
+JAVADEF=-DSOLAR_JAVA
+.IF "$(debug)"==""
+JAVA_RUNTIME=javai.lib
+.ELSE
+JAVA_RUNTIME=javai_g.lib
+.ENDIF
+.ENDIF
+
+OOO_LIBRARY_PATH_VAR = PATH
diff --git a/solenv/inc/wntgcci.mk b/solenv/inc/wntgcci.mk
new file mode 100644
index 000000000000..a6c7e67cfd9f
--- /dev/null
+++ b/solenv/inc/wntgcci.mk
@@ -0,0 +1,217 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for Window Intel using GCC
+
+SOLAR_JAVA*=TRUE
+FULL_DESK=TRUE
+JAVAFLAGSDEBUG=-g
+
+# SOLAR JAva Unterstuetzung nur fuer wntmsci
+
+ASM=ml
+AFLAGS=/c /Cp /coff
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=-march=pentium
+
+CXX*=gcc
+### Der gcc vertraegt kein Semikolon im Include-Pfad RT
+# old:
+#CFLAGS=-c -Wall -I$(INCLUDE) $(OLE2DEF)
+# new:
+#CYGINC=$(INCLUDE:s/-I /-I/:+" ":s/;/ -I/:s/-I //:s/ / /)
+CFLAGS=-fmessage-length=0 -c -nostdinc $(OLE2DEF)
+###
+CFLAGSCC=-pipe $(ARCH_FLAGS)
+CFLAGSCXX=-pipe $(ARCH_FLAGS)
+CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
+CFLAGS_NO_EXCEPTIONS=-fno-exceptions
+PICSWITCH:=
+
+CFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS
+CFLAGS_USE_PCH=-I$(SLO)$/pch -DPRECOMPILED_HEADERS -Winvalid-pch
+CFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)$/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch
+
+CFLAGSOBJGUIST=
+CFLAGSOBJCUIST=
+CFLAGSOBJGUIMT=-D_MT
+CFLAGSOBJCUIMT=-D_MT
+CFLAGSSLOGUIMT=-D_MT $(PICSWITCH)
+CFLAGSSLOCUIMT=-D_MT $(PICSWITCH)
+CFLAGSPROF=
+CFLAGSDEBUG=-g
+CFLAGSDBGUTIL=
+.IF "$(PRODUCT)"!=""
+CFLAGSOPT=-O2 -fno-strict-aliasing # optimizing for products
+.ELSE # "$(PRODUCT)"!=""
+CFLAGSOPT= # no optimizing for non products
+.ENDIF # "$(PRODUCT)"!=""
+# Compiler flags for disabling optimizations
+CFLAGSNOOPT=-O0
+# Compiler flags for describing the output path
+CFLAGSOUTOBJ=-o
+#plattform hart setzen
+CDEFS+=-DWIN32 -DWINVER=0x500 -D_WIN32_WINNT=0x500 -D_WIN32_IE=0x500 -D_M_IX86 -DSTLPORT_VERSION=450 -D_NATIVE_WCHAR_T_DEFINED -D_MSC_EXTENSIONS -D_FORCENAMELESSUNION
+.IF "$(DYNAMIC_CRT)"!=""
+CDEFS+=-D_DLL
+.ENDIF
+
+# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
+CFLAGSWARNCC=-Wall -Wextra -Wendif-labels
+CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \
+ -Wno-non-virtual-dtor -Wno-uninitialized
+CFLAGSWALLCC=$(CFLAGSWARNCC)
+CFLAGSWALLCXX=$(CFLAGSWARNCXX)
+CFLAGSWERRCC=-Werror
+CFLAGSWERRCXX=-Werror
+
+MODULES_WITH_WARNINGS := \
+ b_server \
+ chart2 \
+ devtools \
+ extensions \
+ lingu \
+ r_tools \
+ soldep \
+ starmath \
+ sw \
+ xmlsecurity
+
+STATIC= -static
+DYNAMIC= -dynamic
+
+LINK*=$(CXX)
+LINKC*=$(CC)
+
+CYGLIB=$(LIB:s/;/ -L/)
+LINKFLAGS=-nostdlib -Wl,--enable-stdcall-fixup,--enable-runtime-pseudo-reloc-v2 -L$(CYGLIB)
+.IF "$(USE_MINGW)"=="cygwin"
+MINGWLIBDIR=$(COMPATH)$/lib$/mingw
+.ELSE
+MINGWLIBDIR=$(COMPATH)$/lib
+.ENDIF
+MINGWSSTDOBJ=$(MINGW_CLIB_DIR)$/crtbegin.o
+MINGWSSTDENDOBJ=$(MINGW_CLIB_DIR)$/crtend.o
+LINKFLAGSAPPGUI=-mwindows $(MINGWLIBDIR)$/crt2.o
+LINKFLAGSSHLGUI=--warn-once -mwindows -shared $(MINGWLIBDIR)$/dllcrt2.o
+LINKFLAGSAPPCUI=-mconsole $(MINGWLIBDIR)$/crt2.o
+LINKFLAGSSHLCUI=--warn-once -mconsole -shared $(MINGWLIBDIR)$/dllcrt2.o
+LINKFLAGSTACK=
+LINKFLAGSPROF=
+LINKFLAGSDEBUG=-g
+LINKFLAGSOPT=
+
+.IF "$(MINGW_SHARED_GXXLIB)"=="YES" && "$(DYNAMIC_CRT)"!=""
+STDLIBCPP=-lstdc++_s
+.ELSE
+STDLIBCPP=-lstdc++
+.ENDIF
+UWINAPILIB*=$(DYNAMIC) -luwinapi
+
+.IF "$(MINGW_SHARED_GCCLIB)"=="YES" && "$(DYNAMIC_CRT)"!=""
+MINGW_LIBGCC=-lgcc_s -lgcc
+LINKFLAGS+=-shared-libgcc
+.ELSE
+.IF "$(MINGW_GCCLIB_EH)"=="YES"
+MINGW_LIBGCC=-lgcc_eh -lgcc
+.ELSE
+MINGW_LIBGCC=-lgcc
+.ENDIF
+.ENDIF
+STDOBJVCL=$(L)$/salmain.obj
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+STDLIBGUIMT=-Wl,--start-group CPPRUNTIME $(MINGW_LIBGCC)
+STDLIBCUIMT=-Wl,--start-group CPPRUNTIME $(MINGW_LIBGCC)
+STDSHLGUIMT=-Wl,--start-group CPPRUNTIME $(MINGW_LIBGCC)
+STDSHLCUIMT=-Wl,--start-group CPPRUNTIME $(MINGW_LIBGCC)
+.IF "$(DYNAMIC_CRT)"!=""
+STDLIBGUIMT+=-lmingwthrd
+STDLIBCUIMT+=-lmingwthrd
+STDSHLGUIMT+=-lmingwthrd
+STDSHLCUIMT+=-lmingwthrd
+.ENDIF
+STDLIBGUIMT+=-lmingw32 -lmoldname -lmingwex -Wl,--end-group $(UWINAPILIB) -lm -lkernel32 -luser32 -lmsvcrt
+STDLIBCUIMT+=-lmingw32 -lmoldname -lmingwex -Wl,--end-group $(UWINAPILIB) -lm -lkernel32 -luser32 -lmsvcrt
+STDSHLGUIMT+=-lmingw32 -lmoldname -lmingwex -Wl,--end-group $(UWINAPILIB) -lm -lkernel32 -luser32 -lmsvcrt
+STDSHLCUIMT+=-lmingw32 -lmoldname -lmingwex -Wl,--end-group $(UWINAPILIB) -lm -lkernel32 -luser32 -lmsvcrt
+
+LIBSTLPORT=-lstlport_gcc
+LIBSTLPORTST=-lstlport_gcc_static $(STDLIBCPP)
+
+LIBMGR=ar
+LIBFLAGS=-rsu
+
+IMPLIB=ld
+IMPLIBFLAGS=
+
+MAPSYM=tmapsym
+MAPSYMFLAGS=
+
+RC=rc
+RCFLAGS=-D__MINGW32__ -DWIN32 -D_WIN32_IE=0x400 -fo$@ $(RCFILES)
+RCLINK=
+RCLINKFLAGS=
+RCSETVERSION=
+
+DLLPOSTFIX=gi
+PCHPOST=.gch
+
+ADVAPI32LIB=-ladvapi32
+SHELL32LIB=-lshell32
+GDI32LIB=-lgdi32
+OLE32LIB=-lole32
+OLEAUT32LIB=-loleaut32
+UUIDLIB=$(PSDK_HOME)$/lib$/uuid.lib
+WINSPOOLLIB=-lwinspool
+IMM32LIB=-limm32
+VERSIONLIB=-lversion
+WINMMLIB=-lwinmm
+WSOCK32LIB=-lwsock32
+MPRLIB=-lmpr
+WS2_32LIB=-lws2_32
+KERNEL32LIB=-lkernel32
+USER32LIB=-luser32
+LIBCMT=-lmsvcrt
+COMDLG32LIB=-lcomdlg32
+COMCTL32LIB=-lcomctl32
+CRYPT32LIB=$(PSDK_HOME)$/lib$/crypt32.lib
+GDIPLUSLIB=$(PSDK_HOME)$/lib$/gdiplus.lib
+DBGHELPLIB=$(PSDK_HOME)$/lib$/dbghelp.lib
+MSILIB=$(PSDK_HOME)$/lib$/msi.lib
+DDRAWLIB=$(DIRECTXSDK_LIB)/ddraw.lib
+SHLWAPILIB=$(PSDK_HOME)$/lib$/shlwapi.lib
+URLMONLIB=$(PSDK_HOME)$/lib$/urlmon.lib
+UNICOWSLIB=$(PSDK_HOME)$/lib$/unicows.lib
+WININETLIB=-lwininet
+OLDNAMESLIB=-lmoldname
+MSIMG32LIB=$(PSDK_HOME)$/lib$/msimg32.lib
+PROPSYSLIB=-lpropsys
diff --git a/solenv/inc/wntmsci10.mk b/solenv/inc/wntmsci10.mk
new file mode 100644
index 000000000000..5c959f7d0e3c
--- /dev/null
+++ b/solenv/inc/wntmsci10.mk
@@ -0,0 +1,343 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for $(OS)$(COM)$(CPU)$(COMEX) == WNTMSCI10
+
+SOLAR_JAVA*=TRUE
+FULL_DESK=TRUE
+JAVAFLAGSDEBUG=-g
+
+# SOLAR JAva Unterstuetzung nur fuer wntmsci
+
+ASM=ml
+AFLAGS=/c /Cp /coff /safeseh
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=
+
+CC*:=cl
+.IF "$(bndchk)" != ""
+CXX*=nmcl
+.ELSE
+.IF "$(truetime)" != ""
+CXX*=nmcl /NMttOn
+.ELSE
+CXX*:=cl
+.ENDIF
+.ENDIF # "$(bndchk)" != ""
+
+.IF "$(stoponerror)" != ""
+CXX+= /NMstoponerror
+.ENDIF
+
+.IF "$(nmpass)" != ""
+CXX+= /NMpass
+.ENDIF
+
+.IF "$(ttinlines)" != ""
+CXX+= /NMttInlines
+.ENDIF
+
+.IF "$(ttnolines)" != ""
+CXX+= /NMttNoLines
+.ENDIF
+
+# Flags for COMEX == 10
+
+CFLAGS+=-Zm500 -Zc:forScope -GR
+CFLAGS+=-c -nologo -Gs $(NOLOGO)
+
+CDEFS+= -D_X86_=1
+
+.IF "$(product)" != ""
+CFLAGS+= -Gy
+.ENDIF # "$(product)" != ""
+
+.IF "$(bndchk)" == ""
+.IF "$(VC_STANDARD)"==""
+CFLAGS+= -Ob1
+.ENDIF # "$(VC_STANDARD)"==""
+.ENDIF
+
+# flags to enable build with symbols; required for crashdump feature
+#CFLAGSENABLESYMBOLS=-Zi -Fd$(MISC)/_ooo_st_$(TARGET).PDB
+# full debug for RE builds only due to size concerns
+.IF "$(UPDATER)"!=""
+CFLAGSENABLESYMBOLS=-Z7 -Yd
+.ELSE # "$(UPDATER)"!=""
+# -Zd got higher priority and overrides debug switches
+.IF "$(debug)"==""
+CFLAGSENABLESYMBOLS=-Zd
+.ENDIF # "$(debug)"==""
+.ENDIF # "$(UPDATER)"!=""
+
+.IF "$(bndchk)" != ""
+.IF "$(debug)" == ""
+CFLAGS+= -Z7
+.ENDIF
+.ENDIF
+
+.IF "$(truetime)" != ""
+.IF "$(debug)" == ""
+CFLAGS+= -Z7
+.ENDIF
+.ENDIF
+
+.IF "$(FULL_DESK)"!=""
+CDEFS+=-DFULL_DESK
+RSCDEFS+=-DFULL_DESK
+.ENDIF
+
+CFLAGSEXCEPTIONS=-GX
+CFLAGS_NO_EXCEPTIONS=
+
+CFLAGS_CREATE_PCH=-I$(INCPCH) -Fo$(SLO)/pchname.obj -Ycprecompiled_$(PRJNAME).hxx -DPRECOMPILED_HEADERS
+CFLAGS_USE_PCH=-I$(INCPCH) -Yuprecompiled_$(PRJNAME).hxx -Fp$(SLO)/pch/precompiled_$(PRJNAME).hxx$(PCHPOST) -DPRECOMPILED_HEADERS
+CFLAGS_USE_EXCEPTIONS_PCH=-I$(INCPCH) -Yuprecompiled_$(PRJNAME).hxx -Fp$(SLO)/pch_ex/precompiled_$(PRJNAME).hxx$(PCHPOST) -DPRECOMPILED_HEADERS
+.IF "$(CALL_CDECL)"=="TRUE"
+CFLAGSCALL=-Gd
+.ELSE # "$(CALL_CDECL)"=="TRUE"
+CFLAGSCALL=-Gz
+.ENDIF # "$(CALL_CDECL)"=="TRUE"
+
+CFLAGSCC=$(ARCH_FLAGS)
+.IF "$(DYNAMIC_CRT)"!=""
+CDEFSSLOMT+=-DWIN32 -D_MT -D_DLL
+CDEFSSLOMT+=-DWIN32 -D_MT -D_DLL
+.IF "$(NO_DYNAMIC_OBJ)"==""
+CDEFSOBJMT+=-DWIN32 -D_MT -D_DLL
+CDEFSOBJMT+=-DWIN32 -D_MT -D_DLL
+.ELSE
+CDEFSOBJMT+=-DWIN32 -D_MT
+CDEFSOBJMT+=-DWIN32 -D_MT
+.ENDIF
+.ELSE
+CDEFSSLOMT+=-DWIN32 -D_MT
+CDEFSSLOMT+=-DWIN32 -D_MT
+CDEFSOBJMT+=-DWIN32 -D_MT
+CDEFSOBJMT+=-DWIN32 -D_MT
+.ENDIF
+CFLAGSPROF=-Gh -Fd$(MISC)/$(@:b).pdb
+CFLAGSDEBUG=-Zi -Fd$(MISC)\_ooo_st_$(TARGET).PDB
+CFLAGSDBGUTIL=
+.IF "$(VC_STANDARD)"==""
+CFLAGSOPT=-Oxs -Oy-
+CFLAGSNOOPT=-Od
+.ELSE # "$(VC_STANDARD)"==""
+CFLAGSOPT=
+CFLAGSNOOPT=
+.ENDIF # "$(VC_STANDARD)"==""
+CFLAGSOUTOBJ=-Fo
+
+# For C and C++, certain warnings are disabled globally, as they result in
+# spurious warnings and are hard or impossible to workaround:
+# - "warning C4061: enumerate in switch of enum is not explicitly handled by a
+# case label",
+# - "warning C4063: case 'identifier' is not a valid value for switch of enum
+# 'enumeration'",
+# - "warning C4127: conditional expression is constant",
+# - "warning C4191: unsafe conversion from function type to function type",
+# - "warning C4217: member template functions cannot be used for copy-assignment
+# or copy-construction",
+# - "warning C4250: 'class1' : inherits 'class2::member' via dominance",
+# - "warning C4292: compiler limit : terminating debug information emission",
+# - "warning C4344: behavior change: use of explicit template arguments results
+# in call to 'function",
+# - "warning C4347: behavior change: 'overload A' is called instead of
+# 'overload B'",
+# - "warning C4355: 'this' used in base member initializer list",
+# - "warning C4503: 'identifier': decorated name length exceeded, name was
+# truncated" (http://msdn2.microsoft.com/en-us/library/074af4b6.aspx),
+# - "warning C4511: copy constructor could not be generated",
+# - "warning C4512: assignment operator could not be generated",
+# - "warning C4514: unreferenced inline function has been removed",
+# - "warning C4611: interaction between '_setjmp' and C++ object destruction is
+# non-portable",
+# - "warning C4619: warning Cnnnn unknown",
+# - "warning C4625: copy constructor could not be generated because a base class
+# copy constructor is inaccessible",
+# - "warning C4626: assignment operator could not be generated because a base
+# class assignment operator is inaccessible",
+# - "warning C4675: resolved overload was found by argument-dependent lookup",
+# - "warning C4686: possible change in behavior, change in UDT return calling
+# convention",
+# - "warning C4710: function not inlined",
+# - "warning C4711: function selected for automatic inline expansion",
+# - "warning C4820: padding added after member".
+# For C, certain warnings from system headers (stdlib.h etc.) have to be
+# disabled globally (for C++, this is not necessary, as the system headers are
+# wrapped by STLport):
+# - "warning C4255: no function prototype given: converting '()' to '(void)'".
+CFLAGSWARNCXX=-Wall -wd4061 -wd4063 -wd4127 -wd4191 -wd4217 -wd4250 -wd4251 \
+ -wd4275 -wd4290 -wd4292 -wd4294 -wd4344 -wd4347 -wd4355 -wd4503 -wd4511 \
+ -wd4512 -wd4514 -wd4611 -wd4619 -wd4625 -wd4626 -wd4640 -wd4675 -wd4686 \
+ -wd4710 -wd4711 -wd4786 -wd4800 -wd4820
+CFLAGSWARNCC=$(CFLAGSWARNCXX) -wd4255
+CFLAGSWALLCC=$(CFLAGSWARNCC)
+CFLAGSWALLCXX=$(CFLAGSWARNCXX)
+CFLAGSWERRCC=-WX
+
+# Once all modules on this platform compile without warnings, set
+# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
+# settings.mk):
+MODULES_WITH_WARNINGS := \
+ lingucomponent \
+ soldep
+
+CDEFS+=-DSTLPORT_VERSION=$(STLPORT_VER) -D_MT -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500
+
+COMMENTFLAG=/COMMENT:"$(PRJNAME)_$(UPD)_$(VCSID)_"
+
+LINK=link $(COMMENTFLAG) $(NOLOGO) /MACHINE:IX86
+LINKOUTPUTFILTER= $(PIPEERROR) $(GREP) -v "LNK4197:"
+.IF "$(PRODUCT)"!="full"
+.ELSE
+LINKFLAGS=/MAP /OPT:NOREF
+.ENDIF
+
+.IF "$(linkinc)" != ""
+LINKFLAGS=-NODEFAULTLIB -DEBUG:full -DEBUGTYPE:cv -INCREMENTAL:YES
+MAPFILE=
+.ELSE # "$(linkinc)" != ""
+.IF "$(PRODUCT)"!="full"
+LINKFLAGS+= -NODEFAULTLIB -DEBUG:full -DEBUGTYPE:cv
+.ELSE # "$(PRODUCT)"!="full"
+LINKFLAGS+= -NODEFAULTLIB -RELEASE -DEBUG:full
+.ENDIF # "$(PRODUCT)"!="full"
+MAPFILE=-out:$$@
+.ENDIF # "$(linkinc)" != ""
+
+.IF "$(bndchk)" != ""
+LINK=nmlink $(COMMENTFLAG) $(NOLOGO) -MACHINE:IX86
+LINKFLAGS=-NODEFAULTLIB -DEBUG:full -DEBUGTYPE:cv
+.ENDIF
+
+.IF "$(truetime)" != ""
+LINK=nmlink /NMttOn $(COMMENTFLAG) $(NOLOGO) /MACHINE:IX86
+LINKFLAGS=/NODEFAULTLIB /DEBUG:full /DEBUGTYPE:cv
+.ENDIF
+
+LINKFLAGSAPPGUI=/SUBSYSTEM:WINDOWS,4.0
+LINKFLAGSSHLGUI=/SUBSYSTEM:WINDOWS,4.0 /DLL
+LINKFLAGSAPPCUI=/SUBSYSTEM:CONSOLE /BASE:0x1b000000
+LINKFLAGSSHLCUI=/SUBSYSTEM:CONSOLE /DLL
+LINKFLAGSTACK=/STACK:
+LINKFLAGSPROF=-DEBUG:mapped,partial -DEBUGTYPE:coff cap.lib
+LINKFLAGSWST=-DEBUG:mapped,partial -DEBUGTYPE:coff wst.lib -NODEFAULTLIB
+LINKFLAGSDEBUG=-DEBUG:full -DEBUGTYPE:cv
+LINKFLAGSOPT=
+
+UWINAPILIB*=uwinapi.lib
+.IF "$(DYNAMIC_CRT)"!=""
+.IF "$(USE_STLP_DEBUG)" != ""
+LIBCMT=msvcrtd.lib
+.ELSE # "$(USE_STLP_DEBUG)" != ""
+LIBCMT=msvcrt.lib
+.ENDIF # "$(USE_STLP_DEBUG)" != ""
+.ELSE # "$(DYNAMIC_CRT)"!=""
+.IF "$(USE_STLP_DEBUG)" != ""
+LIBCMT=libcmtd.lib
+.ELSE # "$(USE_STLP_DEBUG)" != ""
+LIBCMT=libcmt.lib
+.ENDIF # "$(USE_STLP_DEBUG)" != ""
+.ENDIF # "$(DYNAMIC_CRT)"!=""
+
+STDOBJVCL=$(L)/salmain.obj
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+
+STDLIBGUIMT=$(LIBCMT) $(UWINAPILIB) kernel32.lib user32.lib oldnames.lib psapi.lib
+STDLIBCUIMT=$(LIBCMT) $(UWINAPILIB) kernel32.lib user32.lib oldnames.lib psapi.lib
+STDSHLGUIMT=$(LIBCMT) $(UWINAPILIB) kernel32.lib user32.lib oldnames.lib psapi.lib
+STDSHLCUIMT=$(LIBCMT) $(UWINAPILIB) kernel32.lib user32.lib oldnames.lib psapi.lib
+
+.IF "$(USE_STLP_DEBUG)" != ""
+CFLAGS+=-MTd
+LIBSTLPORT=stlport_vc71_stldebug.lib
+LIBSTLPORTST=stlport_vc71_stldebug_static.lib
+.ELSE
+LIBSTLPORT=stlport_vc71.lib
+LIBSTLPORTST=stlport_vc71_static.lib
+.ENDIF
+
+ATL_INCLUDE*=$(COMPATH)/atlmfc/include
+ATL_LIB*=$(COMPATH)/atlmfc/lib
+
+LIBMGR=lib $(NOLOGO)
+IMPLIB=lib
+LIBFLAGS=
+
+IMPLIBFLAGS=-machine:IX86
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=rc
+RCFLAGS=-r -DWIN32 -fo$@ $(RCFILES)
+RCLINK=rc
+RCLINKFLAGS=
+RCSETVERSION=
+
+
+DLLPOSTFIX=mi
+PCHPOST=.pch
+
+CSC*=$(FLIPCMD) csc
+VBC*=vbc
+
+ADVAPI32LIB=advapi32.lib
+SHELL32LIB=shell32.lib
+GDI32LIB=gdi32.lib
+OLE32LIB=ole32.lib
+OLEAUT32LIB=oleaut32.lib
+UUIDLIB=uuid.lib
+WINSPOOLLIB=winspool.lib
+IMM32LIB=imm32.lib
+VERSIONLIB=version.lib
+WINMMLIB=winmm.lib
+WSOCK32LIB=wsock32.lib
+MPRLIB=mpr.lib
+WS2_32LIB=ws2_32.lib
+KERNEL32LIB=kernel32.lib
+USER32LIB=user32.lib
+COMDLG32LIB=comdlg32.lib
+COMCTL32LIB=comctl32.lib
+CRYPT32LIB=crypt32.lib
+GDIPLUSLIB=gdiplus.lib
+DBGHELPLIB=dbghelp.lib
+MSILIB=msi.lib
+DDRAWLIB=ddraw.lib
+SHLWAPILIB=shlwapi.lib
+URLMONLIB=urlmon.lib
+UNICOWSLIB=unicows.lib
+WININETLIB=wininet.lib
+OLDNAMESLIB=oldnames.lib
+MSIMG32LIB=msimg32.lib
+
diff --git a/solenv/inc/wntmsci11.mk b/solenv/inc/wntmsci11.mk
new file mode 100755
index 000000000000..972feb0a8fdc
--- /dev/null
+++ b/solenv/inc/wntmsci11.mk
@@ -0,0 +1,391 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# mk file for $(OS)$(COM)$(CPU)$(COMEX) == WNTMSCI11 and WNTMSCI12
+
+SOLAR_JAVA*=TRUE
+FULL_DESK=TRUE
+JAVAFLAGSDEBUG=-g
+
+# SOLAR JAva Unterstuetzung nur fuer wntmsci
+
+ASM=ml
+AFLAGS=/c /Cp /coff /safeseh
+
+# architecture dependent flags for the C and C++ compiler that can be changed by
+# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
+ARCH_FLAGS*=
+
+CC*:=cl
+.IF "$(bndchk)" != ""
+CXX*=nmcl
+.ELSE
+.IF "$(truetime)" != ""
+CXX*=nmcl /NMttOn
+.ELSE
+CXX*:=cl
+.ENDIF
+.ENDIF # "$(bndchk)" != ""
+
+.IF "$(stoponerror)" != ""
+CXX+= /NMstoponerror
+.ENDIF
+
+.IF "$(nmpass)" != ""
+CXX+= /NMpass
+.ENDIF
+
+.IF "$(ttinlines)" != ""
+CXX+= /NMttInlines
+.ENDIF
+
+.IF "$(ttnolines)" != ""
+CXX+= /NMttNoLines
+.ENDIF
+
+.IF "$(VERBOSE)" != "TRUE"
+NOLOGO*=-nologo
+.ENDIF
+
+.IF "$(VERBOSE)" != "TRUE"
+COMPILE_ECHO_SWITCH=-n
+COMPILE_ECHO_FILE=
+.ENDIF
+
+# Flags for COMEX == 11
+
+# disable "warning C4675: resolved overload was found by argument-dependent
+# lookup":
+# -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800
+CFLAGS+=-Zm500 -Zc:forScope,wchar_t- -GR
+
+# Stack buffer overrun detection.
+CFLAGS+=-GS
+
+CFLAGS+=-c -nologo -Gs $(NOLOGO)
+
+CDEFS+= -D_X86_=1 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NON_CONFORMING_SWPRINTFS
+
+.IF "$(product)" != ""
+CFLAGS+= -Gy
+.ENDIF # "$(product)" != ""
+
+.IF "$(bndchk)" == ""
+.IF "$(VC_STANDARD)"==""
+CFLAGS+= -Ob1
+.ENDIF # "$(VC_STANDARD)"==""
+.ENDIF
+
+# flags to enable build with symbols; required for crashdump feature
+#CFLAGSENABLESYMBOLS=-Zi -Fd$(MISC)/_ooo_st_$(TARGET).PDB
+CFLAGSENABLESYMBOLS=-Z7 -Yd
+
+.IF "$(bndchk)" != ""
+.IF "$(debug)" == ""
+CFLAGS+= -Z7
+.ENDIF
+.ENDIF
+
+.IF "$(truetime)" != ""
+.IF "$(debug)" == ""
+CFLAGS+= -Z7
+.ENDIF
+.ENDIF
+
+.IF "$(FULL_DESK)"!=""
+CDEFS+=-DFULL_DESK
+RSCDEFS+=-DFULL_DESK
+.ENDIF
+
+CFLAGSEXCEPTIONS=-EHa
+CFLAGS_NO_EXCEPTIONS=
+
+# enable boost support for __cdecl (SAL_CALL) C++-UNO interface methods
+CDEFS+=-DBOOST_MEM_FN_ENABLE_CDECL
+
+# with the current debug switches PCH won't work
+# anyway. so keep the existing .pch intact and don't
+# touch it
+.IF "$(debug)"!=""
+ENABLE_PCH:=
+.ENDIF "$(debug)"!=""
+
+CFLAGS_CREATE_PCH=-I$(INCPCH) -Fo$(SLO)/pchname.obj -Ycprecompiled_$(PRJNAME).hxx -DPRECOMPILED_HEADERS
+CFLAGS_USE_PCH=-I$(INCPCH) -Yuprecompiled_$(PRJNAME).hxx -Fp$(SLO)/pch/precompiled_$(PRJNAME).hxx$(PCHPOST) -DPRECOMPILED_HEADERS
+CFLAGS_USE_EXCEPTIONS_PCH=-I$(INCPCH) -Yuprecompiled_$(PRJNAME).hxx -Fp$(SLO)/pch_ex/precompiled_$(PRJNAME).hxx$(PCHPOST) -DPRECOMPILED_HEADERS
+.IF "$(CALL_CDECL)"=="TRUE"
+CFLAGSCALL=-Gd
+.ELSE # "$(CALL_CDECL)"=="TRUE"
+CFLAGSCALL=-Gz
+.ENDIF # "$(CALL_CDECL)"=="TRUE"
+
+CFLAGSCC=$(ARCH_FLAGS)
+.IF "$(DYNAMIC_CRT)"!=""
+CDEFSSLOMT+=-DWIN32 -D_MT -D_DLL
+CDEFSSLOMT+=-DWIN32 -D_MT -D_DLL
+.IF "$(NO_DYNAMIC_OBJ)"==""
+CDEFSOBJMT+=-DWIN32 -D_MT -D_DLL
+CDEFSOBJMT+=-DWIN32 -D_MT -D_DLL
+.ELSE
+CDEFSOBJMT+=-DWIN32 -D_MT
+CDEFSOBJMT+=-DWIN32 -D_MT
+.ENDIF # "$(NO_DYNAMIC_OBJ)"==""
+.ELSE
+CDEFSSLOMT+=-DWIN32 -D_MT
+CDEFSSLOMT+=-DWIN32 -D_MT
+CDEFSOBJMT+=-DWIN32 -D_MT
+CDEFSOBJMT+=-DWIN32 -D_MT
+.ENDIF # "$(DYNAMIC_CRT)"!=""
+
+CFLAGSPROF=-Gh -Fd$(MISC)/$(@:b).pdb
+CFLAGSDEBUG=-Zi -Fd$(MISC)/$(@:b).pdb
+CFLAGSDBGUTIL=
+.IF "$(VC_STANDARD)"==""
+CFLAGSOPT=-Oxs -Oy-
+CFLAGSNOOPT=-Od
+.ELSE # "$(VC_STANDARD)"==""
+CFLAGSOPT=
+CFLAGSNOOPT=
+.ENDIF # "$(VC_STANDARD)"==""
+CFLAGSOUTOBJ=-Fo
+
+# For C and C++, certain warnings are disabled globally, as they result in
+# spurious warnings and are hard or impossible to workaround:
+# - "warning C4061: enumerate in switch of enum is not explicitly handled by a
+# case label",
+# - "warning C4127: conditional expression is constant",
+# - "warning C4191: unsafe conversion from function type to function type",
+# - "warning C4217: member template functions cannot be used for copy-assignment
+# or copy-construction",
+# - "warning C4250: 'class1' : inherits 'class2::member' via dominance",
+# - "warning C4355: 'this' used in base member initializer list",
+# - "warning C4511: copy constructor could not be generated",
+# - "warning C4512: assignment operator could not be generated",
+# - "warning C4514: unreferenced inline function has been removed",
+# - "warning C4611: interaction between '_setjmp' and C++ object destruction is
+# non-portable",
+# - "warning C4625: copy constructor could not be generated because a base class
+# copy constructor is inaccessible",
+# - "warning C4626: assignment operator could not be generated because a base
+# class assignment operator is inaccessible",
+# - "warning C4675: resolved overload was found by argument-dependent lookup",
+# - "warning C4710: function not inlined",
+# - "warning C4711: function selected for automatic inline expansion",
+# - "warning C4820: padding added after member".
+# - "warning C4503: 'identifier' : decorated name length exceeded, name was truncated"
+# (http://msdn2.microsoft.com/en-us/library/074af4b6.aspx)
+# - "warning C4180: qualifier applied to function type has no meaning; ignored"
+# (frequently seen with a recent boost)
+# For C, certain warnings from system headers (stdlib.h etc.) have to be
+# disabled globally (for C++, this is not necessary, as the system headers are
+# wrapped by STLport):
+# - "warning C4255: no function prototype given: converting
+# '()' to '(void)'".
+# - "warning C4365: conversion from ... to ... signed/unsigned mismatch"
+
+CFLAGSWARNCXX=-Wall -wd4061 -wd4127 -wd4191 -wd4217 -wd4250 -wd4251 -wd4275 \
+ -wd4290 -wd4294 -wd4355 -wd4511 -wd4512 -wd4514 -wd4611 -wd4625 -wd4626 \
+ -wd4640 -wd4675 -wd4710 -wd4711 -wd4786 -wd4800 -wd4820 -wd4503 -wd4619 \
+ -wd4365 -wd4668 -wd4738 -wd4826 -wd4350 -wd4505 -wd4692 -wd4189 -wd4005 \
+ -wd4180
+CFLAGSWARNCC=$(CFLAGSWARNCXX) -wd4255
+CFLAGSWALLCC=$(CFLAGSWARNCC)
+CFLAGSWALLCXX=$(CFLAGSWARNCXX)
+CFLAGSWERRCC=-WX
+
+# Once all modules on this platform compile without warnings, set
+# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
+# settings.mk):
+MODULES_WITH_WARNINGS := \
+ soldep
+
+CDEFS+=-DSTLPORT_VERSION=400 -D_MT -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0500
+.IF "$(COMEX)" == "11"
+_VC_MANIFEST_BASENAME=__VC80
+.ELSE
+_VC_MANIFEST_BASENAME=__VC90
+.ENDIF
+
+LINK=link /MACHINE:IX86
+ # do *not* add $(NOLOGO) to LINK or LINKFLAGS. Strangely, the wntmsci12 linker links fine then, but exits with
+ # a return value 1, which makes dmake think it failed
+LINKOUTPUTFILTER= $(PIPEERROR) $(GREP) -v "LNK4197:"
+.IF "$(PRODUCT)"!="full"
+.ELSE
+LINKFLAGS=/MAP /OPT:NOREF
+.ENDIF
+
+# excetion handling protection
+LINKFLAGS+=-safeseh
+
+# enable DEP
+LINKFLAGS+=-nxcompat
+
+# enable ASLR
+LINKFLAGS+=-dynamicbase
+
+.IF "$(linkinc)" != ""
+LINKFLAGS+=-NODEFAULTLIB -INCREMENTAL:YES -DEBUG
+MAPFILE=
+_VC_MANIFEST_INC=1
+.ELSE # "$(linkinc)" != ""
+_VC_MANIFEST_INC=0
+.IF "$(PRODUCT)"!="full"
+LINKFLAGS+= -NODEFAULTLIB -DEBUG
+.ELSE # "$(PRODUCT)"!="full"
+LINKFLAGS+= -NODEFAULTLIB -RELEASE -DEBUG -INCREMENTAL:NO
+.ENDIF # "$(PRODUCT)"!="full"
+MAPFILE=-out:$$@
+.ENDIF # "$(linkinc)" != ""
+
+.IF "$(bndchk)" != ""
+LINK=nmlink $(COMMENTFLAG) $(NOLOGO) /MACHINE:IX86
+LINKFLAGS=-NODEFAULTLIB -DEBUG
+.ENDIF
+
+.IF "$(truetime)" != ""
+LINK=nmlink /NMttOn $(COMMENTFLAG) $(NOLOGO) /MACHINE:IX86
+LINKFLAGS=-NODEFAULTLIB -DEBUG
+.ENDIF
+
+.IF "$(COMEX)" == "11"
+LINKFLAGSAPPGUI=/SUBSYSTEM:WINDOWS,4.0
+LINKFLAGSSHLGUI=/SUBSYSTEM:WINDOWS,4.0 /DLL
+.ELSE
+LINKFLAGSAPPGUI=/SUBSYSTEM:WINDOWS
+LINKFLAGSSHLGUI=/SUBSYSTEM:WINDOWS /DLL
+.ENDIF # "$(COMEX)" == "11"
+LINKFLAGSAPPCUI=/SUBSYSTEM:CONSOLE /BASE:0x1b000000
+LINKFLAGSSHLCUI=/SUBSYSTEM:CONSOLE /DLL
+LINKFLAGSTACK=/STACK:
+LINKFLAGSPROF=/DEBUG:mapped,partial /DEBUGTYPE:coff cap.lib
+LINKFLAGSWST=/DEBUG:mapped,partial /DEBUGTYPE:coff wst.lib /NODEFAULTLIB
+LINKFLAGSDEBUG=-DEBUG
+LINKFLAGSOPT=
+
+UWINAPILIB*=uwinapi.lib
+.IF "$(DYNAMIC_CRT)"!=""
+.IF "$(USE_STLP_DEBUG)" != ""
+LIBCMT=msvcrtd.lib
+.ELSE # "$(USE_STLP_DEBUG)" != ""
+LIBCMT=msvcrt.lib
+.ENDIF # "$(USE_STLP_DEBUG)" != ""
+.ELSE # "$(DYNAMIC_CRT)"!=""
+.IF "$(USE_STLP_DEBUG)" != ""
+LIBCMT=libcmtd.lib
+CDEFS+=-D_DEBUG
+.ELSE # "$(USE_STLP_DEBUG)" != ""
+LIBCMT=libcmt.lib
+.ENDIF # "$(USE_STLP_DEBUG)" != ""
+.ENDIF # "$(DYNAMIC_CRT)"!=""
+
+STDOBJVCL=$(L)/salmain.obj
+STDOBJGUI=
+STDSLOGUI=
+STDOBJCUI=
+STDSLOCUI=
+
+STDLIBGUIMT=$(LIBCMT) $(UWINAPILIB) kernel32.lib user32.lib oldnames.lib
+STDLIBCUIMT=$(LIBCMT) $(UWINAPILIB) kernel32.lib user32.lib oldnames.lib
+STDSHLGUIMT=$(LIBCMT) $(UWINAPILIB) kernel32.lib user32.lib oldnames.lib
+STDSHLCUIMT=$(LIBCMT) $(UWINAPILIB) kernel32.lib user32.lib oldnames.lib
+
+.IF "$(USE_STLP_DEBUG)" != ""
+LIBSTLPORT=stlport_vc71_stldebug.lib
+LIBSTLPORTST=stlport_vc71_stldebug_static.lib
+.ELSE
+LIBSTLPORT=stlport_vc71.lib
+LIBSTLPORTST=stlport_vc71_static.lib
+.ENDIF
+
+.IF "$(PROF_EDITION)" == ""
+ATL_INCLUDE*=$(COMPATH)/PlatformSDK/include/atl
+ATL_LIB*=$(COMPATH)/atlmfc/lib
+MFC_INCLUDE*=$(COMPATH)/PlatformSDK/include/mfc
+MFC_LIB*=$(COMPATH)/atlmfc/lib
+.ELSE
+ATL_INCLUDE*=$(COMPATH)/atlmfc/include
+ATL_LIB*=$(COMPATH)/atlmfc/lib
+MFC_INCLUDE*=$(COMPATH)/atlmfc/include
+MFC_LIB*=$(COMPATH)/atlmfc/lib
+.ENDIF
+
+LIBMGR=lib $(NOLOGO)
+IMPLIB=lib
+LIBFLAGS=
+
+IMPLIBFLAGS=-machine:IX86
+
+MAPSYM=
+MAPSYMFLAGS=
+
+RC=rc
+RCFLAGS=-r -DWIN32 -fo$@ $(RCFILES)
+RCLINK=rc
+RCLINKFLAGS=
+RCSETVERSION=
+
+MT=mt.exe
+MTFLAGS=$(NOLOGO)
+
+
+DLLPOSTFIX=mi
+PCHPOST=.pch
+
+CSC*=$(FLIPCMD) csc
+VBC*=vbc
+
+ADVAPI32LIB=advapi32.lib
+SHELL32LIB=shell32.lib
+GDI32LIB=gdi32.lib
+OLE32LIB=ole32.lib
+OLEAUT32LIB=oleaut32.lib
+UUIDLIB=uuid.lib
+WINSPOOLLIB=winspool.lib
+IMM32LIB=imm32.lib
+VERSIONLIB=version.lib
+WINMMLIB=winmm.lib
+WSOCK32LIB=wsock32.lib
+MPRLIB=mpr.lib
+WS2_32LIB=ws2_32.lib
+KERNEL32LIB=kernel32.lib
+USER32LIB=user32.lib
+COMDLG32LIB=comdlg32.lib
+COMCTL32LIB=comctl32.lib
+CRYPT32LIB=crypt32.lib
+GDIPLUSLIB=gdiplus.lib
+DBGHELPLIB=dbghelp.lib
+MSILIB=msi.lib
+DDRAWLIB=ddraw.lib
+SHLWAPILIB=shlwapi.lib
+URLMONLIB=urlmon.lib
+UNICOWSLIB=unicows.lib
+WININETLIB=wininet.lib
+OLDNAMESLIB=oldnames.lib
+MSIMG32LIB=msimg32.lib
+PROPSYSLIB=propsys.lib
+
diff --git a/solenv/makefile.mk b/solenv/makefile.mk
new file mode 100755
index 000000000000..c4a2d0893d7c
--- /dev/null
+++ b/solenv/makefile.mk
@@ -0,0 +1,45 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=.
+PRJNAME=solenv
+TARGET=init
+
+# --- Settings ----------------------------------
+.INCLUDE : settings.mk
+.INCLUDE : target.mk
+.INCLUDE : versionlist.mk
+
+ALLTAR : $(INCCOM)/versionlist.hrc
+
+$(INCCOM)/versionlist.hrc : ./inc/version.lst
+ $(COMMAND_ECHO)echo "#define VERSION $(OOOBASEVERSIONMAJOR)" > $@
+ $(COMMAND_ECHO)echo "#define SUBVERSION $(OOOBASEVERSIONMINOR)" >> $@
+ $(COMMAND_ECHO)echo "#define MICROVERSION $(OOOBASEVERSIONMICRO)" >> $@
+ $(COMMAND_ECHO)echo "#define VER_DAY $(OOOBASEVERSIONDAY)" >> $@
+ $(COMMAND_ECHO)echo "#define VER_MONTH $(OOOBASEVERSIONMONTH)" >> $@
+ $(COMMAND_ECHO)echo "#define VER_YEAR $(OOOBASEVERSIONYEAR)" >> $@
diff --git a/solenv/prj/build.lst b/solenv/prj/build.lst
new file mode 100644
index 000000000000..d7a7f36b19fe
--- /dev/null
+++ b/solenv/prj/build.lst
@@ -0,0 +1,3 @@
+sn solenv : NULL
+sn solenv usr1 - all sn_mkout NULL
+sn solenv nmake - all sn_init NULL
diff --git a/solenv/prj/d.lst b/solenv/prj/d.lst
new file mode 100755
index 000000000000..05ceea226515
--- /dev/null
+++ b/solenv/prj/d.lst
@@ -0,0 +1,4 @@
+mkdir: %_DEST%\bin%_EXT%
+mkdir: %_DEST%\inc%_EXT%
+..\inc\version.lst %_DEST%\bin%_EXT%\version.lst
+..\%__SRC%\inc\versionlist.hrc %_DEST%\inc%_EXT%\versionlist.hrc
diff --git a/solenv/src/component.map b/solenv/src/component.map
new file mode 100755
index 000000000000..62b8829a0f51
--- /dev/null
+++ b/solenv/src/component.map
@@ -0,0 +1,7 @@
+UDK_3_0_0 {
+ global:
+ component_getImplementationEnvironment;
+ component_getFactory;
+ local:
+ *;
+};
diff --git a/solenv/src/default_description.xml b/solenv/src/default_description.xml
new file mode 100644
index 000000000000..2f5cda8681d9
--- /dev/null
+++ b/solenv/src/default_description.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
+<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
+ <module-name> XXX </module-name>
+ <component-description>
+ <author> automatic generated </author>
+ <name> XXX </name>
+ <description> no description yet. </description>
+ <loader-name> com.sun.star.loader.SharedLibrary </loader-name>
+ <language> c++ </language>
+ <status value="under_construction"/>
+ <supported-service> XXX </supported-service>
+ </component-description>
+</module-description>
+
diff --git a/solenv/src/reg-component.map b/solenv/src/reg-component.map
new file mode 100644
index 000000000000..ac2c3750bfe0
--- /dev/null
+++ b/solenv/src/reg-component.map
@@ -0,0 +1,8 @@
+UDK_3_0_0 {
+ global:
+ component_getImplementationEnvironment;
+ component_writeInfo;
+ component_getFactory;
+ local:
+ *;
+};
diff --git a/solenv/src/solaris_noexstk.map b/solenv/src/solaris_noexstk.map
new file mode 100644
index 000000000000..2608b1b2d388
--- /dev/null
+++ b/solenv/src/solaris_noexstk.map
@@ -0,0 +1,4 @@
+# mapfile for non-executable stack
+# see @ /usr/lib/ld/map.noexstk
+#
+stack = STACK ?RW;
diff --git a/solenv/src/unloadablecomponent.map b/solenv/src/unloadablecomponent.map
new file mode 100755
index 000000000000..2da0c5709c7b
--- /dev/null
+++ b/solenv/src/unloadablecomponent.map
@@ -0,0 +1,8 @@
+UDK_3_0_0 {
+ global:
+ component_getImplementationEnvironment;
+ component_getFactory;
+ component_canUnload;
+ local:
+ *;
+};
diff --git a/solenv/src/version.c b/solenv/src/version.c
new file mode 100644
index 000000000000..b06b1510f300
--- /dev/null
+++ b/solenv/src/version.c
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+
+
+#include <_version.h>
+
+
+struct VersionInfo
+{
+ const char* pTime;
+ const char* pDate;
+ const char* pUpd;
+ const char* pMinor;
+ const char* pBuild;
+ const char* pInpath;
+};
+
+static const struct VersionInfo g_aVersionInfo =
+{
+ __TIME__,
+ __DATE__,
+ _UPD,
+ _LAST_MINOR,
+ _BUILD,
+ _INPATH
+};
+
+#if defined(WNT) || defined(OS2)
+__declspec(dllexport) const struct VersionInfo* GetVersionInfo(void);
+#endif
+
+#if defined(WNT) || defined(OS2)
+__declspec(dllexport) const struct VersionInfo* GetVersionInfo(void)
+#else
+const struct VersionInfo *GetVersionInfo(void)
+#endif
+{
+ return &g_aVersionInfo;
+}
+
+#if 0
+#include <stdio.h>
+
+int main( int argc, char **argv )
+{
+ const VersionInfo *pInfo = GetVersionInfo();
+ fprintf( stderr, "Date : %s\n", pInfo->pDate);
+ fprintf( stderr, "Time : %s\n", pInfo->pTime);
+ fprintf( stderr, "UPD : %s\n", pInfo->pUpd);
+ delete pInfo;
+ return 0;
+}
+#endif
+
diff --git a/solenv/unxmacxp/inc/poll.h b/solenv/unxmacxp/inc/poll.h
new file mode 100644
index 000000000000..761b59dbec1f
--- /dev/null
+++ b/solenv/unxmacxp/inc/poll.h
@@ -0,0 +1,173 @@
+// poll.h
+// MacOS X does not implement poll(). Therefore, this replacement
+// is required. It uses select().
+
+#ifndef _FAKE_POLL_H
+#define _FAKE_POLL_H
+
+#include <sys/errno.h>
+#include <string.h>
+#include <limits.h>
+#undef FD_SETSIZE
+#define FD_SETSIZE OPEN_MAX
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+typedef struct pollfd {
+ int fd; /* file desc to poll */
+ short events; /* events of interest on fd */
+ short revents; /* events that occurred on fd */
+} pollfd_t;
+
+
+// poll flags
+#define POLLIN 0x0001
+#define POLLOUT 0x0004
+#define POLLERR 0x0008
+
+// synonyms
+#define POLLNORM POLLIN
+#define POLLPRI POLLIN
+#define POLLRDNORM POLLIN
+#define POLLRDBAND POLLIN
+#define POLLWRNORM POLLOUT
+#define POLLWRBAND POLLOUT
+
+// ignored
+#define POLLHUP 0x0010
+#define POLLNVAL 0x0020
+
+inline int poll(struct pollfd *pollSet, int pollCount, int pollTimeout)
+{
+ struct timeval tv;
+ struct timeval *tvp;
+ fd_set readFDs, writeFDs, exceptFDs;
+ fd_set *readp, *writep, *exceptp;
+ struct pollfd *pollEnd, *p;
+ int selected;
+ int result;
+ int maxFD;
+
+ if ( !pollSet )
+ {
+ pollEnd = NULL;
+ readp = NULL;
+ writep = NULL;
+ exceptp = NULL;
+ maxFD = 0;
+ }
+ else
+ {
+ pollEnd = pollSet + pollCount;
+ readp = &readFDs;
+ writep = &writeFDs;
+ exceptp = &exceptFDs;
+
+ FD_ZERO(readp);
+ FD_ZERO(writep);
+ FD_ZERO(exceptp);
+
+ // Find the biggest fd in the poll set
+ maxFD = 0;
+ for (p = pollSet; p < pollEnd; p++)
+ {
+ if (p->fd > maxFD)
+ maxFD = p->fd;
+ }
+
+ if (maxFD >= FD_SETSIZE)
+ {
+ // At least one fd is too big
+ errno = EINVAL;
+ return -1;
+ }
+
+ // Transcribe flags from the poll set to the fd sets
+ for (p = pollSet; p < pollEnd; p++)
+ {
+ if (p->fd < 0)
+ {
+ // Negative fd checks nothing and always reports zero
+ }
+ else
+ {
+ if (p->events & POLLIN)
+ FD_SET(p->fd, readp);
+ if (p->events & POLLOUT)
+ FD_SET(p->fd, writep);
+ if (p->events != 0)
+ FD_SET(p->fd, exceptp);
+ // POLLERR is never set coming in; poll() always reports errors
+ // But don't report if we're not listening to anything at all.
+ }
+ }
+ }
+
+ // poll timeout is in milliseconds. Convert to struct timeval.
+ // poll timeout == -1 : wait forever : select timeout of NULL
+ // poll timeout == 0 : return immediately : select timeout of zero
+ if (pollTimeout >= 0)
+ {
+ tv.tv_sec = pollTimeout / 1000;
+ tv.tv_usec = (pollTimeout % 1000) * 1000;
+ tvp = &tv;
+ }
+ else
+ {
+ tvp = NULL;
+ }
+
+ selected = select(maxFD+1, readp, writep, exceptp, tvp);
+
+ if (selected < 0)
+ {
+ // Error during select
+ result = -1;
+ }
+ else if (selected > 0)
+ {
+ // Select found something
+ // Transcribe result from fd sets to poll set.
+ // Also count the number of selected fds. poll returns the
+ // number of ready fds; select returns the number of bits set.
+ int polled = 0;
+ for (p = pollSet; p < pollEnd; p++)
+ {
+ p->revents = 0;
+ if (p->fd < 0) {
+ // Negative fd always reports zero
+ }
+ else
+ {
+ if ( (p->events & POLLIN) && FD_ISSET(p->fd, readp) )
+ p->revents |= POLLIN;
+ if ( (p->events & POLLOUT) && FD_ISSET(p->fd, writep) )
+ p->revents |= POLLOUT;
+ if ( (p->events != 0) && FD_ISSET(p->fd, exceptp) )
+ p->revents |= POLLERR;
+
+ if (p->revents)
+ polled++;
+ }
+ }
+ result = polled;
+ }
+ else
+ {
+ // selected == 0, select timed out before anything happened
+ // Clear all result bits and return zero.
+ for (p = pollSet; p < pollEnd; p++)
+ p->revents = 0;
+
+ result = 0;
+ }
+
+ return result;
+}
+
+
+#undef FD_SETSIZE
+
+#endif