diff options
author | David Tardon <dtardon@redhat.com> | 2012-04-01 11:55:47 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2012-04-01 12:21:00 +0200 |
commit | 59c0f8f452a538308a9d4098cdc8319b884c3c81 (patch) | |
tree | 6272bb19d30661acdc9995f8a18ce11e9f2fe6b0 /solenv | |
parent | b3b76d1abb5ab9af33ce559872c2e1c45ecdbbd0 (diff) | |
parent | 464a3a271cd4b97573e87d15a38b3f4cad727daf (diff) |
merge origin/master
Diffstat (limited to 'solenv')
177 files changed, 2243 insertions, 7874 deletions
diff --git a/solenv/README b/solenv/README new file mode 100644 index 000000000000..904c610a96ab --- /dev/null +++ b/solenv/README @@ -0,0 +1,48 @@ +Tools and makefile fragments necessary for compilation + +This module contains many tools and makefile configuration pieces, +critical for building LibreOffice: + +bin/ + contains lots of tools used during the build: + + build.pl + the top-level wrapper perl-script, from the dmake + days - we're incrementally removing this in favour + of gnumake + + deliver.pl + copies files from old-style dmake packages into the + top-level 'solver' directory + + concat-deps* + these aggregate, and remove duplicates from module + dependencies, to accelerate build times. + + make_installer.pl + this script executes the compiled instructions from + the scp2/ module to create an installer, and/or to + do a local install for the smoketest. + + linkoo + creates a forest of symlinks inside an install such + that a developer can re-compile in the source tree, + and re-run without re-installing (on Unix at least) + +gbuild/ + the (shiny new) gnumake build makefile fragments we are + migrating the codebase to use. + +gdb/ + lots of nice python helpers to make debugging -much- easier + that (eg.) print UCS2 strings as UTF-8 on the console to + help with debugging. + +inc/ + old / increasingly obsolete dmake setup and includes, we are + trying to entirely rid ourselves of this + +src/ + useful standard / re-usable component map files for components + which shouldn't export anything more than a few registration + symbols.
\ No newline at end of file diff --git a/solenv/bin/build.pl b/solenv/bin/build.pl index 760642d20574..e5e009f6f8ad 100755 --- a/solenv/bin/build.pl +++ b/solenv/bin/build.pl @@ -78,14 +78,14 @@ # This is to undo the EVIL in solenv/gbuild/BuildDirs.mk if ($ENV{OS_FOR_BUILD} eq 'WNT') { - $ENV{WORKDIR} = `cygpath -m '$ENV{WORKDIR}'`; - $ENV{OUTDIR} = `cygpath -m '$ENV{OUTDIR}'`; - $ENV{OUTDIR_FOR_BUILD} = `cygpath -m '$ENV{OUTDIR_FOR_BUILD}'`; - $ENV{SRCDIR} = `cygpath -m '$ENV{SRCDIR}'`; - chomp($ENV{WORKDIR}); - chomp($ENV{OUTDIR}); - chomp($ENV{OUTDIR_FOR_BUILD}); - chomp($ENV{SRCDIR}); + $ENV{WORKDIR} = `cygpath -m '$ENV{WORKDIR}'`; + $ENV{OUTDIR} = `cygpath -m '$ENV{OUTDIR}'`; + $ENV{OUTDIR_FOR_BUILD} = `cygpath -m '$ENV{OUTDIR_FOR_BUILD}'`; + $ENV{SRCDIR} = `cygpath -m '$ENV{SRCDIR}'`; + chomp($ENV{WORKDIR}); + chomp($ENV{OUTDIR}); + chomp($ENV{OUTDIR_FOR_BUILD}); + chomp($ENV{SRCDIR}); } my $modules_number++; @@ -116,7 +116,7 @@ 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 %module_deps_hash_backup = (); # backup hash of internal dependencies for each module my @broken_modules_names = (); # array of modules, which cannot be built further my @dmake_args = (); my %dead_parents = (); @@ -191,7 +191,7 @@ my $verbose = 0; my @modules_built = (); - my $deliver_command = $ENV{DELIVER}; + my $deliver_command = "deliver.pl"; my %prj_platform = (); my $check_error_string = ''; my $dmake = ''; @@ -479,13 +479,13 @@ sub get_build_list_path { my $possible_dir_path = $module_paths{$module}.'/prj/'; if (-d $possible_dir_path) { - my $possible_build_list_path = correct_path($possible_dir_path . "build.lst"); - 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.lst for $module"); + my $possible_build_list_path = correct_path($possible_dir_path . "build.lst"); + 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.lst for $module"); }; $dead_parents{$module}++; return $build_list_paths{$module}; @@ -748,10 +748,10 @@ sub store_build_list_content { if (open (BUILD_LST, $build_list_path)) { - my @build_lst = <BUILD_LST>; - $build_lists_hash{$module} = \@build_lst; - close BUILD_LST; - return; + my @build_lst = <BUILD_LST>; + $build_lists_hash{$module} = \@build_lst; + close BUILD_LST; + return; }; $dead_parents{$module}++; } @@ -1076,7 +1076,6 @@ sub pick_prj_to_build { 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 'WNT') && (($platform eq 'w') || ($platform eq 'n'))); @@ -1148,16 +1147,16 @@ sub check_deps_hash { $log_name = $module if ($log_name =~ /^\.+$/); $log_name .= '.txt'; - if ( $source_config->is_gbuild($module) ) - { - $log_path = correct_path("$workdir/Logs/${module}_${log_name}"); - $long_log_path = correct_path("$workdir/Logs/${module}_${log_name}"); - } - else - { - $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"), - } + if ( $source_config->is_gbuild($module) ) + { + $log_path = correct_path("$workdir/Logs/${module}_${log_name}"); + $long_log_path = correct_path("$workdir/Logs/${module}_${log_name}"); + } + else + { + $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"), + } push(@possible_order, $key); $jobs_hash{$key} = { SHORT_NAME => $string, @@ -1165,7 +1164,7 @@ sub check_deps_hash { STATUS => 'waiting', LOG_PATH => $log_path, LONG_LOG_PATH => $long_log_path, - MODULE => $module, + MODULE => $module, START_TIME => 0, FINISH_TIME => 0, CLIENT => '-' @@ -1335,7 +1334,7 @@ sub usage { 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 " file named $ENV{INPATH}.build.html will be generated in $ENV{SRC_ROOT}\n"; print STDERR " --html_path - set html page path\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"; @@ -1508,24 +1507,20 @@ sub cancel_build { print STDERR " it seems that the error is inside '$module', please re-run build\n"; print STDERR " inside this module to isolate the error and/or test your fix:\n"; } + print STDERR "\n"; + print STDERR "build_error.log should contain the captured output of the failed module(s)\n"; + print STDERR "\n"; print STDERR "-----------------------------------------------------------------------\n"; + print STDERR "To rebuild a specific module:\n"; print STDERR "\n"; - print STDERR "" . $ENV{'OOO_SHELL'} . "\n"; - print STDERR "cd " . $ENV{'SRC_ROOT'} . "\n"; - print STDERR "source ./" . $ENV{'ENV_SCRIPT'} . "\n"; - print STDERR "cd $module\n"; - if ($source_config->is_gbuild($module) ) - { - print STDERR "$ENV{GNUMAKE} clean # optional\n"; - print STDERR "$ENV{GNUMAKE} -r\n" - } - else - { - print STDERR "rm -Rf " . $ENV{'SRC_ROOT'} . "/$module/" . $ENV{'INPATH'} . " # optional module 'clean'\n"; - print STDERR "build\n"; + if ($module eq 'tail_build') { + print STDERR "$ENV{GNUMAKE} $module.clean # not recommended, this will re-build almost everything\n"; + } else { + print STDERR "$ENV{GNUMAKE} $module.clean # optional\n"; } + print STDERR "$ENV{GNUMAKE} $module\n"; print STDERR "\n"; - print STDERR "when the problem is isolated and fixed exit and re-run 'make' from the top-level\n"; + print STDERR "when the problem is isolated and fixed, re-run '$ENV{GNUMAKE}'\n"; zenity_message("LibreOffice Build Failed!"); zenity_close(); @@ -1656,6 +1651,7 @@ sub build_dependent { }; if (defined $modules_with_errors{$dependencies_hash}) { + push(@broken_modules_names, $module_by_hash{$dependencies_hash}); cancel_build(); } mp_success_exit(); @@ -1818,7 +1814,6 @@ sub run_job { my ($job, $path, $registered_name) = @_; my $job_to_do = $job; my $error_code = 0; - my $retry_counter = 10; print "$registered_name\n"; return 0 if ( $show ); @@ -1833,16 +1828,16 @@ sub run_job { if ( $source_config->is_gbuild($jobs_hash{$registered_name}->{MODULE}) ) { - mkpath("$workdir/Logs"); + mkpath("$workdir/Logs"); } else { - if (!-d $log_dir) - { - system("$perl $mkout"); - }; + if (!-d $log_dir) + { + system("$perl $mkout"); + }; } -RETRY: + open (MAKE, "$job_to_do 2>&1 |") or return 8; open (LOGFILE, "> $log_file") or return 8; while (<MAKE>) { print LOGFILE $_; print $_ } @@ -1851,11 +1846,6 @@ RETRY: close LOGFILE; if ( $error_code != 0) { - if ($ENV{GUI} eq 'WIN' && $retry_counter > 0) - { - $retry_counter -= 1; - system('grep "Error 126\$"') && goto RETRY; - } system("echo \"log for $path\" >> $build_error_log"); system("cat $log_file >> $build_error_log"); } diff --git a/solenv/bin/callcatcher.Makefile b/solenv/bin/callcatcher.Makefile new file mode 100644 index 000000000000..c8fe1649b8cd --- /dev/null +++ b/solenv/bin/callcatcher.Makefile @@ -0,0 +1,31 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +.PHONY: all + +include config_host_callcatcher.mk + +export CC:=callcatcher $(CC) +export CXX:=callcatcher $(CXX) +ifeq ($(AR),) +export AR:=callarchive ar +else +export AR:=callarchive $(AR) +endif +#old-school ones, can go post-gbuildification is complete +export LINK:=$(CXX) +ifeq ($(LIBMGR),) +export LIBMGR:=callarchive ar +else +export LIBMGR:=callarchive $(LIBMGR) +endif +export dbglevel:=2 + + +all: + cd instsetoo_native && \ + $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) --all -- -P$(GMAKE_PARALLELISM) + @callanalyse $(WORKDIR)/LinkTarget/*/* \ + */$(OUTPATH)/bin/* \ + */$(OUTPATH)/lib/* > unusedcode.all + +# vim: set noet sw=4 ts=4: diff --git a/solenv/bin/cleanzip.pl b/solenv/bin/cleanzip.pl deleted file mode 100755 index 5e1502b76611..000000000000 --- a/solenv/bin/cleanzip.pl +++ /dev/null @@ -1,59 +0,0 @@ -#!/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 ) { - my $attribs = $member->unixFileAttributes(); - if ( $member->isDirectory ) { - $attribs = $attribs & 0b101111111111; - $member->unixFileAttributes($attribs) - } -} -unless ( $zip->writeToFileNamed( ${filename}."_new" ) == AZ_OK ) { - die "$0: ERROR reading ${filename}_new\n"; -} -rename($filename."_new", $filename); - diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c index 84d688cb9309..28ac2edb560b 100644 --- a/solenv/bin/concat-deps.c +++ b/solenv/bin/concat-deps.c @@ -43,7 +43,11 @@ #if __BYTE_ORDER == __LITTLE_ENDIAN #define CORE_BIG_ENDIAN 0 #define CORE_LITTLE_ENDIAN 1 +#if defined(__x86_64) || defined(__i386) #define USE_MEMORY_ALIGNMENT 64 +#else +#define USE_MEMORY_ALIGNMENT 4 +#endif #else /* !(__BYTE_ORDER == __LITTLE_ENDIAN) */ #if __BYTE_ORDER == __BIG_ENDIAN #define CORE_BIG_ENDIAN 1 @@ -369,10 +373,10 @@ struct hash static unsigned int hash_compute( struct hash* hash, const char* key, int length) { -unsigned int a; -unsigned int b; -unsigned int c; /* internal state */ -const unsigned char* uk = (const unsigned char*)key; + unsigned int a; + unsigned int b; + unsigned int c; /* internal state */ + const unsigned char* uk = (const unsigned char*)key; /* Set up the internal state */ a = b = c = 0xdeadbeef + (length << 2); @@ -688,6 +692,8 @@ static void _cancel_relative(char* base, char** ref_cursor, char** ref_cursor_ou do { cursor += 3; + while(cursor_out > base && cursor_out[-1] == '/') + cursor_out--; while(cursor_out > base && *--cursor_out != '/'); } while(cursor + 3 < end && !memcmp(cursor, "/../", 4)); @@ -818,7 +824,6 @@ int rc = 0; off_t in_list_size = 0; char* in_list; char* in_list_cursor; -char* in_list_end; char* in_list_base; struct hash* dep_hash; char* base_dir; @@ -838,7 +843,6 @@ char* base_dir; if(!rc) { dep_hash = hash_create( kDEFAULT_HASH_SIZE); - in_list_end = in_list + in_list_size; in_list_base = in_list_cursor = in_list; /* extract filename of dep file from a 'space' separated list */ diff --git a/solenv/bin/create-ids b/solenv/bin/create-ids index 2c7f976fd018..e4d31474cd0f 100755 --- a/solenv/bin/create-ids +++ b/solenv/bin/create-ids @@ -2,7 +2,13 @@ # create ID file for the whole LibO tree. run it in toplevel dir -. ./config_host.mk && . ./Env.Host.sh +if [ -z "$INPATH" ] ; then + INPATH=$(grep "INPATH=" ./config_host.mk | sed -e "s/INPATH=//") +fi +if [ -z "$INPATH" ] ; then + echo "could not determine INPATH" >&2 + exit 1 +fi # --with-outpath includes projects/$INPATH/inc (also solver/$INPATH/inc) if [ "$1" = "--with-outpath" ]; then diff --git a/solenv/bin/create-tags b/solenv/bin/create-tags index e7cc71221e02..a61c5b68c65b 100755 --- a/solenv/bin/create-tags +++ b/solenv/bin/create-tags @@ -1,6 +1,13 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash + +if [ -z "$INPATH" ] ; then + INPATH=$(grep "INPATH=" ./config_host.mk | sed -e "s/INPATH=//") +fi +if [ -z "$INPATH" ] ; then + echo "could not determine INPATH" >&2 + exit 1 +fi -. ./config_host.mk && . ./Env.Host.sh omnicppoptions="--c++-kinds=+p --fields=+iaS --extra=+q" ctags -h "+.hdl.hrc" --langmap=c:+.hdl.hrc.src $omnicppoptions \ diff --git a/solenv/bin/image-sort.pl b/solenv/bin/image-sort.pl index e4fd8491baf2..86a1cb819f97 100755 --- a/solenv/bin/image-sort.pl +++ b/solenv/bin/image-sort.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -w # -*- Mode: Perl; tab-width: 4; indent-tabs-mode: nil -*- my @global_list = (); my %global_hash = (); @@ -9,10 +9,14 @@ sub read_icons($) my $fname = shift; my $fileh; my @images; + if (! -e "$base_path/$fname") { + print "Skipping non-existent $base_path/$fname\n"; + return @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); + m/xlink:href=\"\.uno:(\S+)\"\s+/ || next; + push @images, lc($1); } close ($fileh); @@ -28,12 +32,12 @@ sub read_new_icons($$) my @new_icons; my %new_icons; for my $icon (@images) { - my $iname = "cmd/" . $prefix . $icon . ".png"; - if (!defined $global_hash{$iname} && - !defined $new_icons{$iname}) { - push @new_icons, $iname; - $new_icons{$iname} = 1; - } + my $iname = "cmd/" . $prefix . $icon . ".png"; + if (!defined $global_hash{$iname} && + !defined $new_icons{$iname}) { + push @new_icons, $iname; + $new_icons{$iname} = 1; + } } return @new_icons; } @@ -47,22 +51,22 @@ sub process_group($@) # 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); + 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 } - } # else a duplicate - } } for my $icon (sort { $group{$a} <=> $group{$b} } keys %group) { - push @global_list, $icon; - $global_hash{$icon} = 1; + push @global_list, $icon; + $global_hash{$icon} = 1; } } @@ -71,8 +75,8 @@ sub process_file($$) my @images = read_new_icons (shift, shift); for my $icon (@images) { - push @global_list, $icon; - $global_hash{$icon} = 1; + push @global_list, $icon; + $global_hash{$icon} = 1; } } @@ -83,37 +87,43 @@ sub chew_controlfile($) 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; + /^\#/ && 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 { - die ("Unknown code '$code'"); + push @list, $line; } - @list = (); - } else { - push @list, $line; - } } close ($fileh); } @@ -147,3 +157,5 @@ for my $icon (@global_list) { } close $output if (!$stdout_out); + +# dnl vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/solenv/bin/install-gdb-printers b/solenv/bin/install-gdb-printers index 99686cf17702..df327a06ecdb 100755 --- a/solenv/bin/install-gdb-printers +++ b/solenv/bin/install-gdb-printers @@ -165,7 +165,7 @@ fi if [[ ${DESTDIR}${pythondir} != ${GDBDIR} ]]; then mkdir -p "${DESTDIR}${pythondir}" || die "cannot create dir '${DESTDIR}${pythondir}'" - cp -r "${GDBDIR}/libreoffice" "${DESTDIR}${pythondir}" + cp -pr "${GDBDIR}/libreoffice" "${DESTDIR}${pythondir}" fi make_autoload cppu ure-link/lib libuno_cppu."$DYLIB".3 diff --git a/solenv/bin/linkoo b/solenv/bin/linkoo index 06a103d3ff8d..86ac2476e954 100755 --- a/solenv/bin/linkoo +++ b/solenv/bin/linkoo @@ -113,7 +113,8 @@ my $brand_program_dir = 'program'; my $ure_lib_dir = 'ure-link/lib'; my $win_ure_lib_dir = 'URE/bin'; -my @exceptions = ( 'cppuhelper', 'sunjavaplugin', 'libjvmfwk' ); +my @exceptions = ( 'libsunjavaplugin', 'libjvmfwk' ); +push @exceptions, 'cppuhelper' if ($TARGET ne 'wntgcci.pro'); my $bin; $bin = "|\\.bin" if ($TARGET eq 'wntgcci.pro'); @@ -136,7 +137,7 @@ my %replaceable = ( my @search_dirs = ( 'lib', 'bin', 'class' ); -my @known_duplicates = ( 'db.jar', 'libi18n', 'libnssckbi', 'libnssdbm', 'libsqlite3', 'libnssutil3' ); +my @known_duplicates = ( 'db.jar', 'libi18n', 'libnssckbi', 'libnssdbm', 'libsqlite3', 'libnssutil3', 'pythonloader.uno', 'pyuno', 'libpyuno' ); sub sniff_target($) { @@ -413,12 +414,13 @@ if (!-f "$OOO_INSTALL/" . $brand_program_dir . "/ooenv") { open ($ooenv, ">$OOO_INSTALL/" . $brand_program_dir . "/ooenv") || die "Can't open $OOO_INSTALL/" . $brand_program_dir . "/ooenv: $!"; print $ooenv "thisdir=$OOO_INSTALL/" . $brand_program_dir . "/\n"; print $ooenv $env_script; - print $ooenv "# testtool\nexport SRC_ROOT=$OOO_BUILD\n"; close ($ooenv); } evilness ('do'); -print "\nlinkoo finished, please don't forget to source ooenv before ./soffice.\n"; +print "\nlinkoo finished"; +print ", please don't forget to source ooenv before ./soffice." if ($TARGET ne 'wntgcci.pro'); +print "\n"; # vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/solenv/bin/lo_find_src_root b/solenv/bin/lo_find_src_root deleted file mode 100755 index a91c84759822..000000000000 --- a/solenv/bin/lo_find_src_root +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -# -# (c) 2011 Norbert Thiebaud. License : GPLv3 -# -# try to locate the SRC_ROOT based on the working directory -# we search for first Repository.mk -# in the current directoyr or its parent, all teh way to / -# Ths is a heuristic. it works 'most of the times -# but it could give false positive if you try hard enough -# - -current=$(pwd) - -while [ "${current}" != "/" ] ; do - if [ -f ${current}/.src_root ] ; then - echo "${current}" - exit 0; - fi - current=$(dirname "${current}") -done - -echo "Error cannot determine SRC_ROOT" 1>&2 -exit 1; diff --git a/solenv/bin/lo_proxy_start b/solenv/bin/lo_proxy_start deleted file mode 100755 index 8aabf2838acd..000000000000 --- a/solenv/bin/lo_proxy_start +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -bin_dir=$(dirname $0) -action=$(basename $0) - -if [ "$action" = "lo_proxy_start" ] ; then - action=$1 - shift -fi - -if [ -z "$SRC_ROOT" ] ; then - SRC_ROOT=$($bin_dir/lo_find_src_root) || exit 1 -fi -if [ -z "$SOLARINC" ] ; then - if [ -e "$SRC_ROOT/config_host.mk" ] ; then - . "$SRC_ROOT/config_host.mk" - fi - if [ -e "$SRC_ROOT/Env.Host.sh" ] ; then - . "$SRC_ROOT/Env.Host.sh" - fi -fi - -if [ -e $SRC_ROOT/solenv/bin/$action.pl ] ; then - $SRC_ROOT/solenv/bin/$action.pl "$@" -elif [ -e $SRC_ROOT/solenv/bin/$action.sh ] ; then - $SRC_ROOT/solenv/bin/$action.sh "$@" -else - echo "$action.[pl|sh] not found" 2>&1 - exit 1 -fi - diff --git a/solenv/bin/localize b/solenv/bin/localize deleted file mode 100755 index 7cf035cbc889..000000000000 --- a/solenv/bin/localize +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -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_FOR_BUILD?}/lib -else - export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH_FOR_BUILD?}/lib -fi - -pushd $(pwd) -cd ${SRC_ROOT} -exec $SOLARVERSION/$INPATH_FOR_BUILD/bin/localize_sl "$@" -popd diff --git a/solenv/bin/macosx-change-install-names.pl b/solenv/bin/macosx-change-install-names.pl index 57f4e796d170..91bea7e165c1 100644 --- a/solenv/bin/macosx-change-install-names.pl +++ b/solenv/bin/macosx-change-install-names.pl @@ -25,8 +25,27 @@ # #************************************************************************* -use lib ("$ENV{SOLARENV}/bin/modules"); -use macosxotoolhelper; +# The install names of our dynamic libraries contain a special segment token +# that denotes where the dynamic library is located in the installation set. +# The segment token consists of "@", optionally followed by ".", followed by 50 +# "_", followed by a location token (one of "URELIB", "OOO", "OXT", or "NONE"). +# +# Typically, the segment token is the first segment of a relative install name. +# But the segment token may also appear within an absolute install name. That +# is useful when tunnelling the segment token into the external build process +# via a --prefix configure switch, for example. +# +# When another dynamic library or an executable links against such a dynamic +# library, the path recorded in the former to locate the latter is rewritten +# according to the below %action table. The result path consists of the prefix +# from the action table followed by the suffix of the dynamic library's install +# name. If the special segment token does not contain the optional "." after +# the "@", the suffix consists of all segments after the special token segment. +# If the special token segment does contain the optional ".", then the suffix +# consists of just the last segment of the original install name. +# +# That latter case is useful for libraries from external modules, where the +# external build process locates them in some sub-directory. sub action($$$) { @@ -41,7 +60,6 @@ sub action($$$) 'shl/URELIB/URELIB' => '@loader_path', 'shl/OOO/URELIB' => '@loader_path/../ure-link/lib', 'shl/OOO/OOO' => '@loader_path', - 'shl/LOADER/LOADER' => '@loader_path', 'shl/OXT/URELIB' => '@executable_path/urelibs', 'shl/NONE/URELIB' => '@__VIA_LIBRARY_PATH__', 'shl/OOO/NONE' => '@__VIA_LIBRARY_PATH__', @@ -53,52 +71,17 @@ sub action($$$) return $act; } -@ARGV == 3 || @ARGV >= 2 && $ARGV[0] eq "extshl" or die - 'Usage: app|shl|extshl UREBIN|URELIB|OOO|SDK|OXT|NONE|LOADER <filepath>*'; +@ARGV >= 2 or die 'Usage: app|shl UREBIN|URELIB|OOO|SDK|OXT|NONE <filepath>*'; $type = shift @ARGV; $loc = shift @ARGV; -if ($type eq "SharedLibrary") -{ - $type = "shl"; -} if ($type eq "Executable") { $type = "app" } -if ($type eq "Library") +elsif ($type eq "Library" || $type eq "SharedLibrary") { $type = "shl" } -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; - } - if( $loc eq "LOADER" ) - { - foreach $file (@ARGV) - { - my $call = "install_name_tool$change -id \@loader_path/$inames{$file} $file"; - system($call) == 0 or die "cannot $call"; - } - } - else - { - 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"; @@ -106,10 +89,14 @@ foreach $file (@ARGV) 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$'; - $change .= ' -change '.$1.' @loader_path/'.$2 - if m'^\s*(/python-inst/(OOoPython.framework/Versions/[^/]+/OOoPython))'; + if (m'^\s*(((/.*)?/)?@_{50}([^/]+)(/.+)) \(compatibility version \d+\.\d+\.\d+, current version \d+\.\d+\.\d+\)\n$') + { + $change .= " -change $1 " . action($type, $loc, $4) . $5; + } + elsif (m'^\s*(((/.*)?/)?@\._{50}([^/]+)(/.+)?(/[^/]+)) \(compatibility version \d+\.\d+\.\d+, current version \d+\.\d+\.\d+\)\n$') + { + $change .= " -change $1 " . action($type, $loc, $4) . $6; + } } close(IN); if ($change ne "") diff --git a/solenv/bin/make_download.pl b/solenv/bin/make_download.pl deleted file mode 100644 index 62d8888bc383..000000000000 --- a/solenv/bin/make_download.pl +++ /dev/null @@ -1,126 +0,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 -################# - -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" ); - } - - 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_installer.pl b/solenv/bin/make_installer.pl index 5bcee7fa4343..7d0f56ad29ef 100644 --- a/solenv/bin/make_installer.pl +++ b/solenv/bin/make_installer.pl @@ -32,6 +32,7 @@ use lib ("$ENV{SOLARENV}/bin/modules"); use Cwd; +use Data::Dumper; use File::Copy; use installer::archivefiles; use installer::control; @@ -57,8 +58,7 @@ use installer::scpzipfiles; use installer::scriptitems; use installer::setupscript; use installer::simplepackage; -use installer::sorter; -use installer::strip; +use installer::strip qw(strip_libraries); use installer::substfilenamefiles; use installer::systemactions; use installer::windows::assembly; @@ -87,7 +87,6 @@ use installer::windows::strip; use installer::windows::update; use installer::windows::upgrade; use installer::worker; -use installer::xpdinstaller; use installer::ziplist; ################################################# @@ -121,10 +120,6 @@ installer::environment::set_global_environment_variables($environmentvariablesha 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(); @@ -173,22 +168,16 @@ 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) { @@ -216,41 +205,30 @@ while (defined $parent) 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_branding( $allvariableshashref ); -if ( $installer::globals::globallogging ) { installer::files::save_hash($loggingdir . "allvariables3c.log", $allvariableshashref); } ######################################################## @@ -297,26 +275,20 @@ if ( $$includepathref eq "" ) } 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. +# paths in global hashes. ############################################## installer::worker::collect_all_files_from_includepathes($includepatharrayref); @@ -340,12 +312,6 @@ if ( $installer::globals::iswindowsbuild ) { installer::control::read_encodingli 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 ##################################### @@ -362,39 +328,30 @@ my $setupscriptref = installer::files::read_file($installer::globals::setupscrip # 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); @@ -404,28 +361,21 @@ 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::isrpmbuild ) && @@ -437,82 +387,60 @@ if (( ! $installer::globals::iswindowsbuild ) && { 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::helppack) { $filesinproductarrayref = installer::scriptitems::remove_Helppacklibraries_from_Installset($filesinproductarrayref); - if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles2b2.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); } - -# Note: Don't clean away XPD installer stuff before verified whether -# OxygenOffice still uses it or not, see insesetoo_native/util/openoffice.lst -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::helppack ) { installer::scriptitems::use_langpack_copy_scpaction($scpactionsinproductarrayref); } if ( $allvariableshashref->{'PRODUCTNAME'} eq "LibO-dev" ) { installer::scriptitems::use_devversion_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); } 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; @@ -525,36 +453,28 @@ if ( $installer::globals::iswindowsbuild ) # Windows specific items: Folder, Fo 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; @@ -564,42 +484,24 @@ 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) @@ -613,12 +515,9 @@ if ( $installer::globals::debug ) { installer::logger::savedebug($installer::glo # 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); @@ -738,7 +637,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) ################################################ $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); } @@ -755,14 +653,11 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) ##################################### 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); @@ -775,50 +670,35 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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); } } 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 @@ -829,15 +709,12 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $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); } } ##################################### @@ -847,7 +724,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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 @@ -858,7 +734,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $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 @@ -869,7 +744,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $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 @@ -878,7 +752,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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 @@ -889,36 +762,29 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $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. + # Advantage: Many paths 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); } ######################################################### # 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 @@ -927,27 +793,20 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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 @@ -956,13 +815,10 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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 @@ -976,33 +832,25 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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 )" @@ -1018,10 +866,8 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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 @@ -1030,10 +876,8 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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 @@ -1042,10 +886,8 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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); } } ######################################################### @@ -1059,22 +901,17 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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::select_required_language_strings($modulesinproductlanguageresolvedarrayref); # using english strings @@ -1087,27 +924,19 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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); } + @$directoriesforepmarrayref = sort { $a->{"HostName"} cmp $b->{"HostName"} } @$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); } } } @@ -1116,27 +945,19 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) if ( $installer::globals::helppack ) { $filesinproductlanguageresolvedarrayref = installer::helppack::select_help_items($filesinproductlanguageresolvedarrayref, $languagesarrayref, "File"); - if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productfiles16b2.log", $filesinproductlanguageresolvedarrayref); } $scpactionsinproductlanguageresolvedarrayref = installer::helppack::select_help_items($scpactionsinproductlanguageresolvedarrayref, $languagesarrayref, "ScpAction"); - if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productscpactions6b2.log", $scpactionsinproductlanguageresolvedarrayref); } $linksinproductlanguageresolvedarrayref = installer::helppack::select_help_items($linksinproductlanguageresolvedarrayref, $languagesarrayref, "Shortcut"); - if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "productlinks8b2.log", $linksinproductlanguageresolvedarrayref); } $unixlinksinproductlanguageresolvedarrayref = installer::helppack::select_help_items($unixlinksinproductlanguageresolvedarrayref, $languagesarrayref, "Unixlink"); - if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "unixlinks5b2.log", $unixlinksinproductlanguageresolvedarrayref); } @{$folderitemsinproductlanguageresolvedarrayref} = (); # no folderitems in helppacks # 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 . "directoriesforepmlist3ahelppack.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 . "directoriesforepmlist3bhelppack.log", $directoriesforepmarrayref); } - installer::sorter::sorting_array_of_hashes($directoriesforepmarrayref, "HostName"); - if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforepmlist3chelppack.log", $directoriesforepmarrayref); } + @$directoriesforepmarrayref = sort { $a->{"HostName"} cmp $b->{"HostName"} } @$directoriesforepmarrayref; if ( $installer::globals::iswindowsbuild ) { $registryitemsinproductlanguageresolvedarrayref = installer::worker::select_helppack_items($registryitemsinproductlanguageresolvedarrayref, "RegistryItem"); - if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "registryitems3aa2.log", $registryitemsinproductlanguageresolvedarrayref); } } } @@ -1148,31 +969,22 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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); } + @$directoriesforepmarrayref = sort { $a->{"HostName"} cmp $b->{"HostName"} } @$directoriesforepmarrayref; } } @@ -1190,7 +1002,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) { 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); } } ########################################################### @@ -1222,23 +1033,14 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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 @@ -1376,39 +1178,27 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) ############################################# 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 @@ -1448,8 +1238,7 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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); } + strip_libraries($filesinpackage, $languagestringref); } ############################################################### @@ -1462,22 +1251,14 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) if ( $installer::globals::linuxlinkrpms =~ /\b$onepackagename\b/ ) { - my $run = 0; - - if (( $installer::globals::makelinuxlinkrpm ) && ( ! $run )) + if ( $installer::globals::makelinuxlinkrpm ) { $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 )) + else { $filesinpackage = installer::worker::prepare_linuxlinkfiles($filesinpackage); $linksinpackage = installer::worker::prepare_forced_linuxlinkfiles($linksinpackage); @@ -1485,11 +1266,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) $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); } } } } @@ -1538,7 +1314,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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 )) { @@ -1650,25 +1425,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) } # end of "if ( ! $installer::globals::simple ) - ########################################### - # xpd installation mechanism - ########################################### - - # Creating the xpd file for the package. This has to happen always - - if ( $installer::globals::isxpdplatform ) - { - if (( ! $installer::globals::languagepack ) && ( ! $installer::globals::helppack ) && ( ! $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++ )" @@ -1705,12 +1461,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) if (( $installer::globals::patch ) && ( $installer::globals::issolarispkgbuild )) { installer::epmfile::finalize_patch($installer::globals::epmoutpath, $allvariableshashref); } if (( $installer::globals::patch ) && ( $installer::globals::isrpmbuild )) { 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); - } - chdir($currentdir); # changing back into start directory } @@ -1772,14 +1522,10 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) } } # 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) @@ -1798,7 +1544,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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); @@ -1835,7 +1580,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) # 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"); @@ -1846,42 +1590,30 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) # 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); } # Attention: The table "Director.idt" contains language specific strings -> parameter: $languagesarrayref ! installer::windows::directory::create_directory_table($directoriesforepmarrayref, $languagesarrayref, $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, $allvariableshashref); - 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); @@ -1890,7 +1622,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) 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); @@ -1925,7 +1656,7 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) my $onelanguage = ${$languagesarrayref}[$m]; my $is_rtl = 0; - if ( installer::existence::exists_in_array($onelanguage, \@installer::globals::rtllanguages) ) { $is_rtl = 1; } + if ( grep {$_ eq $onelanguage} @installer::globals::rtllanguages ) { $is_rtl = 1; } my $languageidtdir = $idtdirbase . $installer::globals::separator . $onelanguage; if ( -d $languageidtdir ) { installer::systemactions::remove_complete_directory($languageidtdir, 1); } @@ -1939,20 +1670,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) installer::windows::idtglobal::prepare_language_idt_directory($languageidtdir, $newidtdir, $onelanguage, $filesinproductlanguageresolvedarrayref, \@iconfilecollector, $binarytablefiles, $allvariableshashref); - if ( ! $installer::globals::languagepack && ! $installer::globals::helppack ) - { - # 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 @@ -2003,22 +1720,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) # 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); @@ -2086,8 +1787,6 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) # 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 @@ -2226,17 +1925,14 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) } # 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); + my $speciallogfilename = $loggingdir . "fileinfo_" . $installer::globals::product . "\.log"; + open my $log_fh, '>', $speciallogfilename + or die "Could not open $speciallogfilename for writing: $!"; + print $log_fh Dumper($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 ####################################################### diff --git a/solenv/bin/mkdocs.sh b/solenv/bin/mkdocs.sh index dbf4c4691afc..a075a74bbbce 100755 --- a/solenv/bin/mkdocs.sh +++ b/solenv/bin/mkdocs.sh @@ -1,27 +1,114 @@ -#!/bin/bash +#!/usr/bin/env bash # -# Doxygen Doc generation +# Doxygen / README doc generation # +# See git for contributors +# + +function header { + title=$1 + breadcrumb=$2 + output=$3 + + cat - > $output <<EOF +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> + <title>$title</title> + + <style> + * { margin: 0; padding: 0; } + body { font-family: sans-serif; font-size: 12px; } + #head { padding: 20px; background: #18A303; } + #head a { color: #000; } + #body { padding: 20px; } + #foot { padding: 10px; font-size: 9px; border-top: 1px #18A303 solid; margin-top: 25px; } + p { line-height: 1.7em; margin-bottom: 1em; } + pre { margin-bottom: 0.5em; } + .multi-col { -moz-column-width: 13em; -webkit-column-width: 13em; -moz-column-gap: 1em; -webkit-column-gap: 1em; } + h1 {margin-bottom: 0.5em;} + h2,h3,h4 { margin: 1.3em 0 0.5em 0; } + ul, ol { margin: 0.5em 1.5em; } + </style> +</head> +<body> + <div id="head"> + <h1>$title</h1> + <p>$breadcrumb</p> + </div> + <div id="body"> +EOF +} + +function footer { + output=$1 + + cat - >> $output <<EOF + +</div> +<div id="foot"> + <small> + <p>Generated by Libreoffice <a href="http://cgit.freedesktop.org/libreoffice/core/plain/solenv/bin/mkdocs.sh">Module Description Tool</a></p> + <p>Last updated: +EOF +LANG= date >> $output +cat - >> $output <<EOF + </p> + </small> +</div> +</body> +</html> +EOF + +} + +function proc_text { + # Local links: [[...]] + # Git links: [git:...] + # Other remote links: [...] + # Headings: == bleh == + # Paragraphs: \n\n + sed -re ' s/\[\[([-_a-zA-Z0-9]+)\]\]/<a href="\1.html">\1<\/a>/g' - \ + | sed -re ' s/\[git:([^]]+)\]/<a href="http:\/\/cgit.freedesktop.org\/libreoffice\/core\/tree\/\1">\1<\/a>/g' \ + | sed -re ' s/\[([^]]+)\]/<a href="\1">\1<\/a>/g' \ + | sed -re ' s/====([^=]+)====/<h4>\1<\/h4>/g' \ + | sed -re ' s/===([^=]+)===/<h3>\1<\/h3>/g' \ + | sed -re ' s/==([^=]+)==/<h2>\1<\/h2>/g' \ + | sed -re ':a;N;$!ba;s/\n\n/<\/p><p>/g' \ + | awk 'BEGIN { print "<p>" } { print } END { print "</p>" }' +} + +function setup { + parm=$1 + if [ -z "${!parm}" ] ; then + echo "grep \"${parm}=\" ./config_host.mk | sed -re \" s/${parm}=//\")" + echo "$parm=$(grep \"${parm}=\" ./config_host.mk | sed -re \" s/${parm}=//\")" + eval "$parm=$(grep \"${parm}=\" ./config_host.mk | sed -re \" s/${parm}=//\")" + fi + if [ -z "${!parm}" ] ; then + echo "could not determine $parm" >&2 + exit 1 + fi +} # binaries that we need which doxygen > /dev/null 2>&1 || { - echo "You need doxygen for doc generation" + echo "You need doxygen for doc generation" >&2 exit 1 } which dot > /dev/null 2>&1 || { - echo "You need the graphviz tools to create the nice inheritance graphs" + echo "You need the graphviz tools to create the nice inheritance graphs" >&2 exit 1 } -# otherwise, aliases are not expanded below -shopt -s expand_aliases +# suck setup +setup "INPATH" +setup "SOLARINC" +shopt -s nullglob # Title of the documentation DOXYGEN_PROJECT_PREFIX="LibreOffice" -# suck setup -. ./Env.Host.sh - # get list of modules in build order - bah, blows RAM & disk, static list below INPUT_PROJECTS="o3tl basegfx basebmp basic comphelper svl vcl canvas cppcanvas oox svtools goodies drawinglayer xmloff slideshow sfx2 editeng svx writerfilter cui chart2 dbaccess sd starmath sc sw" @@ -44,7 +131,7 @@ fi DOXYGEN_INCLUDE_PATH=`echo $SOLARINC | sed -e ' s/-I\.//'g | sed -e ' s/ -I/ /'g | sed -e ' s|/usr/[^ ]*| |g'` # setup version string -DOXYGEN_VERSION="$GITTAG" +DOXYGEN_VERSION="master" ################################################### @@ -54,12 +141,13 @@ DOXYGEN_VERSION="$GITTAG" ################################################### # cleanup -rm -rf $BASE_OUTPUT/* +echo "cleaning up" && rm -rf $BASE_OUTPUT/* # make the stuff world-readable umask 022 # generate docs +echo "generating doxygen docs" DOXYGEN_REF_TAGFILES="" for PROJECT in `echo $INPUT_PROJECTS|tr ' ' '\n'|sort|tr '\n' ' '`; do @@ -96,32 +184,41 @@ do done # generate entry page -cat - > $BASE_OUTPUT/index.html <<EOF -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> - <head> - <title>LibreOffice Source Code Documentation (fragmentary)</title> - </head> - <body> - <h1>LibreOffice Source Code Documentation (fragmentary)</h1> - <ul> -EOF - -for PROJECT in $INPUT_PROJECTS; -do - echo "<li><a href=\"$PROJECT/html/classes.html\">$PROJECT</a></li>" >> $BASE_OUTPUT/index.html +echo "generating index page" +header "LibreOffice Modules" " " "$BASE_OUTPUT/index.html" +for module_name in *; do + if [ -d $module_name ]; then + cur_file=$(echo $module_name/README* $module_name/readme.txt*) + if [ -f "$cur_file" ]; then + # write index.html entry + text="<h2><a href=\"${module_name}.html\">${module_name}</a></h2>\n" + text="${text}$(head -n1 $cur_file | proc_text )" + echo -e $text >> "$BASE_OUTPUT/index.html" + + # write detailed module content + header "$module_name" "<a href=\"index.html\">LibreOffice</a> » ${module_name}" "$BASE_OUTPUT/${module_name}.html" + text="<p><b>View module in:</b>" + text="${text} <a href=\"http://cgit.freedesktop.org/libreoffice/core/tree/${module_name}\">cgit</a>" + if $(echo $INPUT_PROJECTS | grep -q $module_name); then + text="${text} <a href=\"${module_name}/html/classes.html\">Doxygen</a>" + fi + text="${text} </p><p> </p>" + echo -e $text >> "$BASE_OUTPUT/${module_name}.html" + proc_text < $cur_file >> "$BASE_OUTPUT/${module_name}.html" + footer "$BASE_OUTPUT/${module_name}.html" + else + empty_modules[${#empty_modules[*]}]=$module_name + fi + fi done +if [ ${#empty_modules[*]} -gt 0 ]; then + echo -e "<p> </p><p>READMEs were not available for these modules:</p><ul>\n" >> "$BASE_OUTPUT/index.html" + for module_name in "${empty_modules[@]}"; do + echo -e "<li><a href=\"http://cgit.freedesktop.org/libreoffice/core/tree/${module_name}\">${module_name}</a></li>\n" >> "$BASE_OUTPUT/index.html" + done + echo -e "</ul>\n" >> "$BASE_OUTPUT/index.html" +fi -cat - >> $BASE_OUTPUT/index.html <<EOF - </ul> - <p>Last updated: -EOF -LANG= date >> $BASE_OUTPUT/index.html - -cat - >> $BASE_OUTPUT/index.html <<EOF - </p> - </body> -</html> -EOF +footer "$BASE_OUTPUT/index.html" ## done diff --git a/solenv/bin/modules/installer/archivefiles.pm b/solenv/bin/modules/installer/archivefiles.pm index af23ed21e3a6..0d75b671a213 100644 --- a/solenv/bin/modules/installer/archivefiles.pm +++ b/solenv/bin/modules/installer/archivefiles.pm @@ -29,7 +29,6 @@ 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; @@ -149,8 +148,6 @@ 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); @@ -377,7 +374,7 @@ sub resolving_archive_flag if ( $set_executable_privileges ) { - # All pathes to executables are saved in the hash %executable_files_in_extensions + # All paths 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}) ) @@ -390,7 +387,7 @@ sub resolving_archive_flag if ( $select_files ) { - if ( ! installer::existence::exists_in_array($zipname,$selectlistfiles) ) + if ( ! grep {$_ eq $zipname} @{$selectlistfiles} ) { $infoline = "Removing from ARCHIVE file $onefilename: $zipname\n"; push( @installer::globals::logfileinfo, $infoline); @@ -409,7 +406,7 @@ sub resolving_archive_flag # 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) ) + if ( ! grep {$_ eq $zipname} @{$patchlistfiles} ) { $newfile{'Styles'} =~ s/\bPATCH\b//; # removing the flag PATCH $newfile{'Styles'} =~ s/\,\s*\,/\,/; @@ -476,7 +473,7 @@ sub resolving_archive_flag for ( my $k = 0; $k <= $#{$selectlistfiles}; $k++ ) { - if ( ! installer::existence::exists_in_array(${$selectlistfiles}[$k],\@keptfiles) ) + if ( ! grep {$_ eq ${$selectlistfiles}[$k]} @keptfiles ) { push(@warningfiles, ${$selectlistfiles}[$k]); } @@ -514,7 +511,7 @@ sub resolving_archive_flag for ( my $k = 0; $k <= $#{$patchlistfiles}; $k++ ) { - if ( ! installer::existence::exists_in_array(${$patchlistfiles}[$k],\@keptpatchflags) ) + if ( ! grep {$_ eq ${$patchlistfiles}[$k]} @keptpatchflags ) { push(@warningfiles, ${$patchlistfiles}[$k]); } diff --git a/solenv/bin/modules/installer/control.pm b/solenv/bin/modules/installer/control.pm index 0b1032080c71..43694b733e41 100644 --- a/solenv/bin/modules/installer/control.pm +++ b/solenv/bin/modules/installer/control.pm @@ -252,7 +252,7 @@ sub check_makecab_version } ###################################################################### -# Reading the environment variables for the pathes in ziplist. +# Reading the environment variables for the paths in ziplist. # solarpath, solarenvpath, solarcommonpath, os, osdef, pmiscpath ###################################################################### @@ -464,17 +464,6 @@ sub 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" #################################################################### diff --git a/solenv/bin/modules/installer/converter.pm b/solenv/bin/modules/installer/converter.pm index 2fe728b3dbac..a141b501db5f 100644 --- a/solenv/bin/modules/installer/converter.pm +++ b/solenv/bin/modules/installer/converter.pm @@ -27,6 +27,9 @@ package installer::converter; +use strict; +use warnings; + use installer::globals; ############################# @@ -166,7 +169,7 @@ sub copy_item_object } ################################################################# -# Windows pathes must not contain the following structure: +# Windows paths must not contain the following structure: # c:\dirA\dirB\..\dirC # This has to be exchanged to # c:\dirA\dirC diff --git a/solenv/bin/modules/installer/copyproject.pm b/solenv/bin/modules/installer/copyproject.pm index 8157db4983f8..2e4f93a1677d 100644 --- a/solenv/bin/modules/installer/copyproject.pm +++ b/solenv/bin/modules/installer/copyproject.pm @@ -27,6 +27,9 @@ package installer::copyproject; +use strict; +use warnings; + use installer::control; use installer::converter; use installer::files; diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm index 5f186b7be9d8..facdd160b7d9 100644 --- a/solenv/bin/modules/installer/download.pm +++ b/solenv/bin/modules/installer/download.pm @@ -157,70 +157,6 @@ sub put_checksum_and_size_into_script } ######################################################### -# 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 ######################################################### diff --git a/solenv/bin/modules/installer/downloadsigner.pm b/solenv/bin/modules/installer/downloadsigner.pm deleted file mode 100644 index d3af89851f40..000000000000 --- a/solenv/bin/modules/installer/downloadsigner.pm +++ /dev/null @@ -1,569 +0,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. -# -#************************************************************************* - -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 -{ - 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; } - - 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'}; } - - # This is broken, we don't want to support any UPDMINOR - # complexities in LibreOffice. (Or do we?) This needs updating if - # we want to actually use this file for signing. - - 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; -} - -######################################################################## -# 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 index c80d8375f3c2..54597612d46f 100644 --- a/solenv/bin/modules/installer/environment.pm +++ b/solenv/bin/modules/installer/environment.pm @@ -75,7 +75,7 @@ sub create_pathvariables } ################################################## -# Replacing tilde in pathes, because of +# Replacing tilde in paths, because of # problem with deep recursion (task 104830) ################################################## diff --git a/solenv/bin/modules/installer/epmfile.pm b/solenv/bin/modules/installer/epmfile.pm index 8d78f6226b57..388f9cc82d84 100644 --- a/solenv/bin/modules/installer/epmfile.pm +++ b/solenv/bin/modules/installer/epmfile.pm @@ -29,7 +29,6 @@ package installer::epmfile; use Cwd; use installer::converter; -use installer::existence; use installer::exiter; use installer::files; use installer::globals; @@ -58,7 +57,7 @@ sub 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 + # Can be a comma separated list. All files have to be found in include paths my $allpackagemapnames = installer::converter::convert_stringlist_into_hash(\$packagemapname, ","); foreach my $onepackagemapname ( keys %{$allpackagemapnames} ) { @@ -136,77 +135,6 @@ sub read_packagemap } -############################################################################ -# 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 ########################################################## @@ -741,20 +669,6 @@ sub replace_variable_in_shellscripts } } -################################################### -# 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 ################################################ @@ -1680,7 +1594,7 @@ sub set_tab_into_datafile push(@installer::globals::logfileinfo, $infoline); # collecting all new classes - if (! installer::existence::exists_in_array($onefile->{'SolarisClass'}, \@newclasses)) + if (! grep {$_ eq $onefile->{'SolarisClass'}} @newclasses) { push(@newclasses, $onefile->{'SolarisClass'}); } @@ -2179,32 +2093,6 @@ sub prepare_packages 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. @@ -2914,11 +2802,6 @@ sub copy_childproject_files 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); - } } } @@ -3029,9 +2912,7 @@ sub put_systemintegration_into_installset # 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); @@ -3062,11 +2943,6 @@ sub put_systemintegration_into_installset # 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); - } } } diff --git a/solenv/bin/modules/installer/existence.pm b/solenv/bin/modules/installer/existence.pm deleted file mode 100644 index 1f362f7a0aeb..000000000000 --- a/solenv/bin/modules/installer/existence.pm +++ /dev/null @@ -1,140 +0,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. -# -#************************************************************************* - -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; -} - -1; diff --git a/solenv/bin/modules/installer/exiter.pm b/solenv/bin/modules/installer/exiter.pm index 016de1d43473..55a1dbb57850 100644 --- a/solenv/bin/modules/installer/exiter.pm +++ b/solenv/bin/modules/installer/exiter.pm @@ -27,6 +27,9 @@ package installer::exiter; +use strict; +use warnings; + use installer::files; use installer::globals; use installer::logger; @@ -91,11 +94,11 @@ sub exit_program 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); } + print("ERROR, saved logfile $installer::globals::logfilename is:\n"); + open(LOG, "<", $installer::globals::logfilename); + print ": $_" while (<LOG>); + print "\n"; + close(LOG); installer::logger::stoptime(); diff --git a/solenv/bin/modules/installer/files.pm b/solenv/bin/modules/installer/files.pm index 73ea26738b05..26715ed919c9 100644 --- a/solenv/bin/modules/installer/files.pm +++ b/solenv/bin/modules/installer/files.pm @@ -27,6 +27,9 @@ package installer::files; +use strict; +use warnings; + use installer::exiter; use installer::logger; @@ -38,8 +41,6 @@ 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"); @@ -51,14 +52,12 @@ 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> ) { + while ( my $line = <IN> ) { push @localfile, $line; } @@ -75,8 +74,6 @@ 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}; @@ -98,89 +95,6 @@ sub 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 ########################################### @@ -189,8 +103,6 @@ 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"); @@ -208,8 +120,6 @@ 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; diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm index 33d6e0aa47cc..6d8785a3b601 100644 --- a/solenv/bin/modules/installer/globals.pm +++ b/solenv/bin/modules/installer/globals.pm @@ -237,8 +237,6 @@ BEGIN $strip = 1; - $globallogging = 0; - $globalloggingform21 = 1; $logfilename = "logfile.log"; # the default logfile name for global errors @logfileinfo = (); @errorlogfileinfo = (); @@ -253,10 +251,7 @@ BEGIN $followme_from_directory = 0; $internal_cabinet_signing = 0; - $debug = 0; - $debugfilename = "debug.txt"; $checksumfilename = "checksum.txt"; - @functioncalls = (); $ismultilingual = 0; @multilanguagemodules = (); @@ -279,7 +274,6 @@ BEGIN $infodirectory = ""; @currentcontent = (); @installsetcontent = (); - %xpdpackageinfo = (); $signfiles_checked = 0; $dosign = 0; $pwfile = ""; @@ -296,14 +290,7 @@ BEGIN $lastsequence_before_merge = 0; $lastcabfilename = ""; - $createdxpddefaultlang = 0; - $xpddir = ""; - $productxpdfile = "setup.xpd"; - $xpd_files_prepared = 0; $defaultlanguage = ""; - @createdxpdfiles = (); - @allxpdfiles = (); - $isxpdplatform = 0; $javalanguagepath = ""; $javasettozero = 0; $addlicensefile = 1; @@ -431,8 +418,6 @@ BEGIN $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"); diff --git a/solenv/bin/modules/installer/helppack.pm b/solenv/bin/modules/installer/helppack.pm index e4fad3767ead..a6a9627c64f6 100644 --- a/solenv/bin/modules/installer/helppack.pm +++ b/solenv/bin/modules/installer/helppack.pm @@ -27,8 +27,10 @@ package installer::helppack; +use strict; +use warnings; + use installer::converter; -use installer::existence; use installer::files; use installer::globals; use installer::logger; @@ -137,7 +139,7 @@ sub create_tar_gz_file $packagename =~ s/\.rpm\s*$//; my $targzname = $packagename . ".tar.gz"; - $systemcall = "cd $installdir; tar -cf - $packagestring | gzip > $targzname"; + my $systemcall = "cd $installdir; tar -cf - $packagestring | gzip > $targzname"; installer::logger::print_message( "... $systemcall ...\n" ); my $returnvalue = system($systemcall); diff --git a/solenv/bin/modules/installer/languagepack.pm b/solenv/bin/modules/installer/languagepack.pm index 9c8e16c818d9..1bfcd8a37678 100644 --- a/solenv/bin/modules/installer/languagepack.pm +++ b/solenv/bin/modules/installer/languagepack.pm @@ -28,7 +28,6 @@ package installer::languagepack; use installer::converter; -use installer::existence; use installer::files; use installer::globals; use installer::logger; diff --git a/solenv/bin/modules/installer/languages.pm b/solenv/bin/modules/installer/languages.pm index 82ac7d0a1345..757ea9dbba93 100644 --- a/solenv/bin/modules/installer/languages.pm +++ b/solenv/bin/modules/installer/languages.pm @@ -28,7 +28,6 @@ package installer::languages; use installer::converter; -use installer::existence; use installer::exiter; use installer::globals; use installer::remover; @@ -98,7 +97,7 @@ sub all_elements_of_array1_in_array2 for ( my $i = 0; $i <= $#{$array1}; $i++ ) { - if (! installer::existence::exists_in_array(${$array1}[$i], $array2)) + if (! grep {$_ eq ${$array1}[$i]} @{$array2}) { $array2_contains_all_elements_of_array1 = 0; last; diff --git a/solenv/bin/modules/installer/logger.pm b/solenv/bin/modules/installer/logger.pm index c5982c6a05f9..7191539a0c2e 100644 --- a/solenv/bin/modules/installer/logger.pm +++ b/solenv/bin/modules/installer/logger.pm @@ -27,9 +27,29 @@ package installer::logger; +use strict; +use warnings; + +use base 'Exporter'; + use installer::files; use installer::globals; +our @EXPORT_OK = qw( + include_header_into_logfile + include_timestamp_into_logfile + log_hashref + globallog + copy_globalinfo_into_logfile + starttime + stoptime + print_message + print_warning + print_error +); + +my $starttime; + #################################################### # Including header files into the logfile #################################################### @@ -40,7 +60,7 @@ sub include_header_into_logfile my $infoline; - $infoline = "\n" . get_time_string(); + $infoline = "\n" . _get_time_string(); push( @installer::globals::logfileinfo, $infoline); $infoline = "######################################################\n"; @@ -55,30 +75,6 @@ sub include_header_into_logfile } #################################################### -# 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 #################################################### @@ -87,7 +83,7 @@ sub include_timestamp_into_logfile my ($message) = @_; my $infoline; - my $timestring = get_time_string(); + my $timestring = _get_time_string(); $infoline = "$message\t$timestring"; push( @installer::globals::logfileinfo, $infoline); } @@ -128,16 +124,16 @@ sub globallog my $infoline; - $infoline = "\n" . get_time_string(); + $infoline = "\n" . _get_time_string(); push( @installer::globals::globallogfileinfo, $infoline); - $infoline = "################################################################\n"; + $infoline = "######################################################\n"; push( @installer::globals::globallogfileinfo, $infoline); $infoline = "$message\n"; push( @installer::globals::globallogfileinfo, $infoline); - $infoline = "################################################################\n"; + $infoline = "######################################################\n"; push( @installer::globals::globallogfileinfo, $infoline); } @@ -156,44 +152,19 @@ sub copy_globalinfo_into_logfile } ############################################################### -# 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(); + $starttime = time(); } ############################################################### # Convert time string ############################################################### -sub convert_timestring +sub _convert_timestring { my ($secondstring) = @_; @@ -234,59 +205,22 @@ sub convert_timestring # Returning time string for logging ############################################################### -sub get_time_string +sub _get_time_string { my $currenttime = time(); - $currenttime = $currenttime - $installer::globals::starttime; - $currenttime = convert_timestring($currenttime); + $currenttime = $currenttime - $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; + print_message( _get_time_string() ); } ############################################################### @@ -302,14 +236,6 @@ sub print_message return; } -sub print_message_without_newline -{ - my $message = shift; - chomp $message; - print "$message" if ( ! $installer::globals::quiet ); - return; -} - ############################################################### # Console output: warnings ############################################################### diff --git a/solenv/bin/modules/installer/packagelist.pm b/solenv/bin/modules/installer/packagelist.pm index 1c5d6fa00ba0..e39917cebe39 100644 --- a/solenv/bin/modules/installer/packagelist.pm +++ b/solenv/bin/modules/installer/packagelist.pm @@ -214,7 +214,7 @@ sub remove_multiple_modules_packages # 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 + if ( $packagecount < $comparepackagecount ) { next; } # nothing to do, take next package # iterating over all modules of this package @@ -728,7 +728,7 @@ sub log_packages_content } ##################################################################### -# Creating assignments from modules to destination pathes. +# Creating assignments from modules to destination paths. # 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 @@ -754,7 +754,7 @@ sub create_module_destination_hash } ##################################################################### -# Adding the default pathes into the files collector for Unixes. +# Adding the default paths into the files collector for Unixes. # This is necessary to know the complete destination path in # fileinfo log file. ##################################################################### diff --git a/solenv/bin/modules/installer/parameter.pm b/solenv/bin/modules/installer/parameter.pm index 5f9638ffd8c9..6d99aaa1a953 100644 --- a/solenv/bin/modules/installer/parameter.pm +++ b/solenv/bin/modules/installer/parameter.pm @@ -41,8 +41,6 @@ use installer::systemactions; sub usage { - if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::parameter::usage"); } - print <<Ende; -------------------------------------------------------------------------------- $installer::globals::prog @@ -74,7 +72,6 @@ The following parameter are needed: -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: @@ -98,8 +95,6 @@ Ende sub saveparameter { - if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::parameter::saveparameter"); } - my $include = ""; installer::logger::globallog("Command line arguments:"); @@ -123,8 +118,6 @@ sub saveparameter sub getparameter { - if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::parameter::getparameter"); } - while ( $#ARGV >= 0 ) { my $param = shift(@ARGV); @@ -139,10 +132,8 @@ sub getparameter 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); } @@ -195,8 +186,6 @@ sub getparameter 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!" ); @@ -207,15 +196,13 @@ sub control_fundamental_parameter ########################################################## # The path parameters can be relative or absolute. -# This function creates absolute pathes. +# This function creates absolute paths. ########################################################## 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 @@ -266,8 +253,6 @@ sub make_path_absolute 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 @@ -286,7 +271,6 @@ sub setglobalvariables { $installer::globals::issolarispkgbuild = 1; $installer::globals::epmoutpath = "packages"; - $installer::globals::isxpdplatform = 1; } } @@ -325,7 +309,6 @@ sub setglobalvariables if ( $installer::globals::packageformat eq "rpm" ) { $installer::globals::isrpmbuild = 1; - $installer::globals::isxpdplatform = 1; $installer::globals::epmoutpath = "RPMS"; } if ( $installer::globals::rpm eq "" ) { installer::exiter::exit_program("ERROR: Environment variable \"\$RPM\" has to be defined!", "setglobalvariables"); } @@ -337,7 +320,6 @@ sub setglobalvariables if ( $installer::globals::packageformat eq "rpm" ) { $installer::globals::isrpmbuild = 1; - $installer::globals::isxpdplatform = 1; $installer::globals::epmoutpath = "RPMS"; if ( $installer::globals::compiler =~ /unxlngi/ ) { @@ -462,8 +444,6 @@ sub setglobalvariables sub control_required_parameter { - if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::parameter::control_required_parameter"); } - if (!($installer::globals::is_copy_only_project)) { ############################################################################################## @@ -574,8 +554,6 @@ sub control_required_parameter sub outputparameter { - if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::parameter::outputparameter"); } - my $element; my @output = (); @@ -612,8 +590,6 @@ sub outputparameter 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"); } diff --git a/solenv/bin/modules/installer/profiles.pm b/solenv/bin/modules/installer/profiles.pm index 2b794ce98c9c..fba586b56526 100644 --- a/solenv/bin/modules/installer/profiles.pm +++ b/solenv/bin/modules/installer/profiles.pm @@ -28,7 +28,6 @@ package installer::profiles; use installer::converter; -use installer::existence; use installer::exiter; use installer::files; use installer::globals; @@ -59,7 +58,7 @@ sub sorting_profile { my $section = $1; - if (!(installer::existence::exists_in_array($section, \@definedsections))) + if (! grep {$_ eq $section} @definedsections) { my $sectionline = $section . "\n"; push(@definedsections, $section); @@ -97,7 +96,10 @@ sub add_profile_into_filelist my $vclgid = "gid_File_Lib_Vcl"; if ( $allvariables->{'GLOBALFILEGID'} ) { $vclgid = $allvariables->{'GLOBALFILEGID'}; } - my $vclfile = installer::existence::get_specified_file($filesarrayref, $vclgid); + my ($vclfile) = grep {$_->{gid} eq $vclgid} @{$filesarrayref}; + if (! defined $vclfile) { + installer::exiter::exit_program("ERROR: Could not find file $vclgid in list of files!", "add_profile_into_filelist"); + } # copying all base data installer::converter::copy_item_object($vclfile, \%profile); diff --git a/solenv/bin/modules/installer/scriptitems.pm b/solenv/bin/modules/installer/scriptitems.pm index 905b37e844db..a1cbbbf95609 100644 --- a/solenv/bin/modules/installer/scriptitems.pm +++ b/solenv/bin/modules/installer/scriptitems.pm @@ -28,7 +28,6 @@ package installer::scriptitems; use installer::converter; -use installer::existence; use installer::exiter; use installer::globals; use installer::languages; @@ -45,8 +44,6 @@ 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. @@ -160,8 +157,6 @@ 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++ ) @@ -189,8 +184,6 @@ 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++ ) @@ -223,8 +216,6 @@ 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++ ) @@ -256,8 +247,6 @@ 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++ ) @@ -309,8 +298,6 @@ 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); @@ -726,8 +713,6 @@ 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++ ) @@ -776,7 +761,7 @@ sub collect_language_specific_names if (( $language ne "" ) && ( $language eq $specificlanguage )) { - if (! installer::existence::exists_in_array($oneitem->{'Name'}, \@installer::globals::languagenames )) + if (! grep {$_ eq $oneitem->{'Name'}} @installer::globals::languagenames ) { push(@installer::globals::languagenames, $oneitem->{'Name'}); } @@ -794,8 +779,6 @@ 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 @@ -815,7 +798,7 @@ sub replace_setup_variables if ( $localbuild =~ /^\s*(\w+?)(\d+)\s*$/ ) { $localbuild = $2; } # using "680" instead of "src680" - my $buildidstring = `$ENV{'SRC_ROOT'}/g -s log -n 1 --pretty=format:%h- && git describe --abbrev=0`; + my $buildidstring = join( '-', split( ' ', `$ENV{'SRC_ROOT'}/g -s log -n 1 --pretty=format:"%h "` )); if ($? || !$buildidstring) { $buildidstring = $localbuild . $localminor . "(Build:" . $installer::globals::buildid . ")"; } @@ -888,8 +871,6 @@ 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:"); @@ -937,8 +918,6 @@ 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; @@ -990,8 +969,6 @@ sub get_Destination_Directory_For_Item_From_Directorylist # this is used f { 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]; @@ -1046,15 +1023,13 @@ sub get_Destination_Directory_For_Item_From_Directorylist # this is used f } ########################################################################## -# Searching a file in a list of pathes +# Searching a file in a list of paths ########################################################################## 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; @@ -1110,8 +1085,6 @@ 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; @@ -1214,7 +1187,7 @@ sub determine_directory_language_dependency } ############################################################## -# Getting all source pathes for all files to be packed +# Getting all source paths for all files to be packed # $item can be "Files" or "ScpActions" ############################################################## @@ -1222,8 +1195,6 @@ 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 = ""; @@ -1316,8 +1287,6 @@ 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 = (); @@ -1352,8 +1321,6 @@ 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_occurred = 0; @@ -1412,7 +1379,7 @@ sub remove_Files_Without_Sourcedirectory push( @installer::globals::logfileinfo, $infoline); push(@missingfiles, "ERROR: File not found: $filename\n"); - $error_occured = 1; + $error_occurred = 1; next; # removing this file from list, if sourcepath is empty } @@ -1487,8 +1454,6 @@ 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 = (); @@ -1646,8 +1611,6 @@ 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 = (); @@ -1681,8 +1644,6 @@ 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]; @@ -1718,44 +1679,6 @@ sub change_keys_of_scpactions } ############################################################################ -# 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. ############################################################################ @@ -1764,8 +1687,6 @@ 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 = (); @@ -1802,8 +1723,6 @@ sub remove_Helppacklibraries_from_Installset { my ($itemsarrayref) = @_; - if ( $installer::globals::debug ) { installer::logger::debuginfo("installer::scriptitems::remove_Helppacklibraries_from_Installset : $#{$itemsarrayref}"); } - my $infoline; my @newitemsarray = (); @@ -1840,8 +1759,6 @@ 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 = (); @@ -1878,8 +1795,6 @@ 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 = (); @@ -1916,8 +1831,6 @@ 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 = (); @@ -1953,8 +1866,6 @@ 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:"); @@ -2016,8 +1927,6 @@ 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 = (); @@ -2087,8 +1996,6 @@ 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 = (); @@ -2211,8 +2118,6 @@ 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++ ) @@ -2258,8 +2163,6 @@ 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++ ) @@ -2305,8 +2208,6 @@ 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++ ) @@ -2335,12 +2236,10 @@ 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 + # If the flag RELATIVE is set, the paths 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++ ) @@ -2434,8 +2333,6 @@ 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 = (); @@ -2471,8 +2368,6 @@ 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 = (); @@ -2537,8 +2432,6 @@ 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]; @@ -2568,8 +2461,6 @@ 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]; @@ -2583,8 +2474,6 @@ 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]; @@ -2627,7 +2516,7 @@ sub collect_all_parent_feature if ( $parentgid ne "" ) { - if (! installer::existence::exists_in_array($parentgid, \@allparents)) + if (! grep {$_ eq $parentgid} @allparents) { push(@allparents, $parentgid); } @@ -2668,7 +2557,7 @@ sub set_children_flag # is this gid a parent? - if ( installer::existence::exists_in_array($gid, $allparents) ) + if ( grep {$_ eq $gid} @{$allparents} ) { $onefeature->{'has_children'} = 1; } diff --git a/solenv/bin/modules/installer/setupscript.pm b/solenv/bin/modules/installer/setupscript.pm index 3018bb31429f..2275cd10096e 100644 --- a/solenv/bin/modules/installer/setupscript.pm +++ b/solenv/bin/modules/installer/setupscript.pm @@ -27,14 +27,29 @@ package installer::setupscript; -use installer::existence; +use base 'Exporter'; + use installer::exiter; use installer::globals; -use installer::logger; +use installer::logger qw(globallog); use installer::remover; use installer::scriptitems; use installer::ziplist; +our @EXPORT_OK = qw( + add_forced_properties + add_installationobject_to_variables + add_lowercase_productname_setupscriptvariable + add_predefined_folder + get_all_items_from_script + get_all_scriptvariables_from_installation_object + prepare_non_advertised_files + replace_all_setupscriptvariables_in_script + replace_preset_properties + resolve_lowercase_productname_setupscriptvariable + set_setupscript_name +); + ####################################################### # Set setup script name, if not defined as parameter ####################################################### @@ -241,7 +256,7 @@ sub replace_all_setupscriptvariables_in_script { my ( $scriptref, $variablesref ) = @_; - installer::logger::include_header_into_globallogfile("Replacing variables in setup script (start)"); + globallog("Replacing variables in setup script (start)"); # make hash of variables to be substituted if they appear in the script my %subs; @@ -282,7 +297,7 @@ sub replace_all_setupscriptvariables_in_script } } - installer::logger::include_header_into_globallogfile("Replacing variables in setup script (end)"); + globallog("Replacing variables in setup script (end)"); return $scriptref; } @@ -377,23 +392,16 @@ 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; + for my $folderid ( map { $_->{FolderID} } @{$folderitemref} ) { + # FIXME: Anchor to start of line? + next unless ( $folderid =~ /PREDEFINED_/ ); + next if grep { $_->{gid} eq $folderid } @{$folderref}; - push(@{$folderref}, \%folder); - } - } + push @{$folderref}, { + ismultilingual => 0, + Name => "", + gid => $folderid, + }; } } diff --git a/solenv/bin/modules/installer/simplepackage.pm b/solenv/bin/modules/installer/simplepackage.pm index 8c0e9ee0be79..29a98b0c1820 100755 --- a/solenv/bin/modules/installer/simplepackage.pm +++ b/solenv/bin/modules/installer/simplepackage.pm @@ -33,7 +33,7 @@ use installer::download; use installer::exiter; use installer::globals; use installer::logger; -use installer::strip; +use installer::strip qw(strip_libraries); use installer::systemactions; use installer::worker; @@ -408,11 +408,6 @@ sub create_package 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::helppack ) || ( $installer::globals::patch )) @@ -535,7 +530,7 @@ sub create_package 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 && "; + $systemcall = "cd $localtempdir && hdiutil makehybrid -hfs -hfs-openfolder $folder $folder -hfs-volume-name \"$volume_name\" -ov -o $installdir/tmp && hdiutil convert -ov -format UDBZ $installdir/tmp.dmg -o $archive && "; if (( $ref ne "" ) && ( $$ref ne "" )) { $systemcall .= "hdiutil unflatten $archive && Rez -a $$ref -o $archive && hdiutil flatten $archive &&"; } @@ -677,7 +672,7 @@ sub create_simple_package } # stripping files ?! - if (( $installer::globals::strip ) && ( ! $installer::globals::iswindowsbuild )) { installer::strip::strip_libraries($filesref, $languagestringref); } + if (( $installer::globals::strip ) && ( ! $installer::globals::iswindowsbuild )) { strip_libraries($filesref, $languagestringref); } # copy Files installer::logger::print_message( "... copying files ...\n" ); diff --git a/solenv/bin/modules/installer/sorter.pm b/solenv/bin/modules/installer/sorter.pm deleted file mode 100644 index dd983c060093..000000000000 --- a/solenv/bin/modules/installer/sorter.pm +++ /dev/null @@ -1,116 +0,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. -# -#************************************************************************* - -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 index a9541879d119..7a36672ca9a0 100644 --- a/solenv/bin/modules/installer/strip.pm +++ b/solenv/bin/modules/installer/strip.pm @@ -27,18 +27,23 @@ package installer::strip; -use installer::converter; -use installer::existence; +use strict; +use warnings; + +use base 'Exporter'; + use installer::globals; use installer::logger; use installer::pathanalyzer; use installer::systemactions; +our @EXPORT_OK = qw(strip_libraries); + ##################################################################### # Checking whether a file has to be stripped ##################################################################### -sub need_to_strip +sub _need_to_strip { my ( $filename ) = @_; @@ -59,7 +64,7 @@ sub need_to_strip # Checking whether a file has to be stripped ##################################################################### -sub do_strip +sub _do_strip { my ( $filename ) = @_; @@ -94,7 +99,7 @@ sub strip_libraries my $strippeddirbase = installer::systemactions::create_directories("stripped", $languagestringref); - if (! installer::existence::exists_in_array($strippeddirbase, \@installer::globals::removedirs)) + if (! grep {$_ eq $strippeddirbase} @installer::globals::removedirs) { push(@installer::globals::removedirs, $strippeddirbase); } @@ -103,12 +108,12 @@ sub strip_libraries { my $sourcefilename = ${$filelist}[$i]->{'sourcepath'}; - if ( need_to_strip($sourcefilename) ) + if ( _need_to_strip($sourcefilename) ) { my $shortfilename = $sourcefilename; installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$shortfilename); - $infoline = "Strip: $shortfilename\n"; + my $infoline = "Strip: $shortfilename\n"; push( @installer::globals::logfileinfo, $infoline); # copy file into directory for stripped libraries @@ -131,7 +136,7 @@ sub strip_libraries # strip file - do_strip($destfilename); + _do_strip($destfilename); } } } diff --git a/solenv/bin/modules/installer/systemactions.pm b/solenv/bin/modules/installer/systemactions.pm index 559953ae5067..899ad2482ef7 100644 --- a/solenv/bin/modules/installer/systemactions.pm +++ b/solenv/bin/modules/installer/systemactions.pm @@ -1295,7 +1295,7 @@ sub find_new_content_in_directory if (( -f $completeentry ) || ( -d $completeentry )) { push(@allcontent, $completeentry); - if (! installer::existence::exists_in_array($completeentry, $oldcontent)) + if (! grep {$_ eq $completeentry} @{$oldcontent}) { push(@newcontent, $completeentry); } diff --git a/solenv/bin/modules/installer/windows/admin.pm b/solenv/bin/modules/installer/windows/admin.pm index 6c79aaedea3c..194a65f8ad01 100644 --- a/solenv/bin/modules/installer/windows/admin.pm +++ b/solenv/bin/modules/installer/windows/admin.pm @@ -410,7 +410,7 @@ sub create_directory_structure foreach $dir (@startparents) { create_directory_tree($dir, \%fullpathhash, $targetdir, $dirhash); } - # Also adding the pathes of the startparents + # Also adding the paths of the startparents foreach $dir (@startparents) { if ( ! exists($fullpathhash{$dir}) ) { $fullpathhash{$dir} = $targetdir; } diff --git a/solenv/bin/modules/installer/windows/binary.pm b/solenv/bin/modules/installer/windows/binary.pm index 96ee50eb4b19..bc5eeaf585f4 100644 --- a/solenv/bin/modules/installer/windows/binary.pm +++ b/solenv/bin/modules/installer/windows/binary.pm @@ -27,7 +27,6 @@ package installer::windows::binary; -use installer::existence; use installer::files; use installer::globals; diff --git a/solenv/bin/modules/installer/windows/component.pm b/solenv/bin/modules/installer/windows/component.pm index da11997e5f83..72382607e508 100644 --- a/solenv/bin/modules/installer/windows/component.pm +++ b/solenv/bin/modules/installer/windows/component.pm @@ -28,7 +28,6 @@ package installer::windows::component; use installer::converter; -use installer::existence; use installer::exiter; use installer::files; use installer::globals; @@ -467,7 +466,7 @@ sub get_component_name_from_modulegid my $filemodules = $onefile->{'modules'}; my $filemodulesarrayref = installer::converter::convert_stringlist_into_array_without_newline(\$filemodules, ","); - if (installer::existence::exists_in_array($modulegid, $filemodulesarrayref)) + if (grep {$_ eq $modulegid} @{$filemodulesarrayref}) { $componentname = $onefile->{'componentname'}; last; diff --git a/solenv/bin/modules/installer/windows/createfolder.pm b/solenv/bin/modules/installer/windows/createfolder.pm index cc3d87e47bb7..5f42ee71c74a 100644 --- a/solenv/bin/modules/installer/windows/createfolder.pm +++ b/solenv/bin/modules/installer/windows/createfolder.pm @@ -27,7 +27,6 @@ package installer::windows::createfolder; -use installer::existence; use installer::exiter; use installer::files; use installer::globals; @@ -94,10 +93,14 @@ sub get_createfolder_component my $globalfilegid = $allvariableshashref->{'GLOBALFILEGID'}; if ( $installer::globals::patch ) { $globalfilegid = $allvariableshashref->{'GLOBALPATCHFILEGID'}; } - my $onefile = ""; + my $onefile; if ( $installer::globals::languagepack ) { $onefile = get_languagepack_file($filesref, $onedir); } - elsif ( $installer::globals::helppack ) { $onefile = installer::existence::get_specified_file($filesref, 'gid_File_Help_Common_Zip'); } - else { $onefile = installer::existence::get_specified_file($filesref, $globalfilegid); } + elsif ( $installer::globals::helppack ) { ($onefile) = grep {$_->{gid} eq 'gid_File_Help_Common_Zip'} @{$filesref} } + else { ($onefile) = grep {$_->{gid} eq $globalfilegid} @{$filesref} } + + if (! defined $onefile) { + installer::exiter::exit_program("ERROR: Could not find file!", "get_createfolder_component"); + } return $onefile->{'componentname'}; } diff --git a/solenv/bin/modules/installer/windows/directory.pm b/solenv/bin/modules/installer/windows/directory.pm index 7a588edeb71b..cd922ad1c030 100644 --- a/solenv/bin/modules/installer/windows/directory.pm +++ b/solenv/bin/modules/installer/windows/directory.pm @@ -175,7 +175,7 @@ sub create_unique_directorynames if ( ! $allvariables->{'NOSHORTDIRECTORYNAMES'} ) { - # This process does not work for SDK, because of its long and similar pathes + # This process does not work for SDK, because of its long and similar paths $uniquename = make_short_dir_version($uniquename, $startlength, $hostname); # taking care of underlines! } @@ -542,14 +542,10 @@ sub create_directory_table my $infoline; overwrite_programfilesfolder($allvariableshashref); - if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_1.log", $directoryref); } create_unique_directorynames($directoryref, $allvariableshashref); $already_checked_the_frigging_directories_for_uniqueness++; - if ( $installer::globals::globallogging ) { installer::files::save_array_of_hashes($loggingdir . "directoriesforidt_local_1a.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, $onelanguage); create_directorytable_from_collection(\@directorytable, $directoryref); diff --git a/solenv/bin/modules/installer/windows/feature.pm b/solenv/bin/modules/installer/windows/feature.pm index d570ec017518..80f7954cb786 100644 --- a/solenv/bin/modules/installer/windows/feature.pm +++ b/solenv/bin/modules/installer/windows/feature.pm @@ -27,11 +27,9 @@ 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; @@ -244,8 +242,7 @@ sub collect_modules_recursive { if ( $directparent->{$modulegid} eq $parentid ) { - my %childhash = ( "gid" => "$modulegid", "Sortkey" => "$directsortkey->{$modulegid}"); - push(@allchildren, \%childhash); + push @allchildren, [ $directsortkey->{$modulegid}, $modulegid ]; $childrenexist = 1; } } @@ -255,14 +252,13 @@ sub collect_modules_recursive if ( $childrenexist ) { # Sort children - installer::sorter::sort_array_of_hashes_numerically(\@allchildren, "Sortkey"); + @allchildren = map { $_->[1] } + sort { $a->[0] <=> $b->[0] } + @allchildren; # Adding children to new array - my $childhashref; - foreach $childhashref ( @allchildren ) + foreach my $gid ( @allchildren ) { - my $gid = $childhashref->{'gid'}; - # Saving all lines, that have this 'gid' my $unique; @@ -412,7 +408,7 @@ sub create_feature_table 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) ) + if ( ! grep {$_ eq $feature{'feature'}} @installer::globals::featurecollector ) { push(@installer::globals::featurecollector, $feature{'feature'}); } diff --git a/solenv/bin/modules/installer/windows/featurecomponent.pm b/solenv/bin/modules/installer/windows/featurecomponent.pm index 8e9ebee84703..580630fff9ca 100644 --- a/solenv/bin/modules/installer/windows/featurecomponent.pm +++ b/solenv/bin/modules/installer/windows/featurecomponent.pm @@ -28,7 +28,6 @@ package installer::windows::featurecomponent; use installer::converter; -use installer::existence; use installer::exiter; use installer::files; use installer::globals; @@ -78,7 +77,7 @@ sub create_featurecomponent_table_from_files_collector # control of uniqueness - if (! installer::existence::exists_in_array($oneline, $featurecomponenttableref)) + if (! grep {$_ eq $oneline} @{$featurecomponenttableref}) { push(@{$featurecomponenttableref}, $oneline); } @@ -124,7 +123,7 @@ sub create_featurecomponent_table_from_registry_collector # control of uniqueness - if (! installer::existence::exists_in_array($oneline, $featurecomponenttableref)) + if (! grep {$_ eq $oneline} @{$featurecomponenttableref}) { push(@{$featurecomponenttableref}, $oneline); } diff --git a/solenv/bin/modules/installer/windows/file.pm b/solenv/bin/modules/installer/windows/file.pm index 044a1af01c4b..100bf9ae34dc 100644 --- a/solenv/bin/modules/installer/windows/file.pm +++ b/solenv/bin/modules/installer/windows/file.pm @@ -28,7 +28,6 @@ package installer::windows::file; use Digest::MD5; -use installer::existence; use installer::exiter; use installer::files; use installer::globals; @@ -358,7 +357,11 @@ sub get_component_from_assigned_file { my ($gid, $filesref) = @_; - my $onefile = installer::existence::get_specified_file($filesref, $gid); + my ($onefile) = grep {$_->{gid} eq $gid} @{$filesref}; + if (! defined $onefile) { + installer::exiter::exit_program("ERROR: Could not find file $gid in list of files!", "get_component_from_assigned_file"); + } + 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"); } diff --git a/solenv/bin/modules/installer/windows/idtglobal.pm b/solenv/bin/modules/installer/windows/idtglobal.pm index 76e49888d34b..cb5fa18fb4c5 100644 --- a/solenv/bin/modules/installer/windows/idtglobal.pm +++ b/solenv/bin/modules/installer/windows/idtglobal.pm @@ -29,7 +29,6 @@ package installer::windows::idtglobal; use Cwd; use installer::converter; -use installer::existence; use installer::exiter; use installer::files; use installer::globals; @@ -1038,147 +1037,6 @@ sub add_officedir_to_database } -############################################################## -# 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 $checkboxattribute = "3"; - - 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; - - 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. diff --git a/solenv/bin/modules/installer/windows/inifile.pm b/solenv/bin/modules/installer/windows/inifile.pm index de279da8d48b..d13fafc26fd6 100644 --- a/solenv/bin/modules/installer/windows/inifile.pm +++ b/solenv/bin/modules/installer/windows/inifile.pm @@ -27,7 +27,7 @@ package installer::windows::inifile; -use installer::existence; +use installer::exiter; use installer::files; use installer::globals; use installer::windows::idtglobal; @@ -40,7 +40,10 @@ sub get_profile_for_profileitem { my ($profileid, $filesref) = @_; - my $profile = installer::existence::get_specified_file($filesref, $profileid); + my ($profile) = grep {$_->{gid} eq $profileid} @{$filesref}; + if (! defined $profile) { + installer::exiter::exit_program("ERROR: Could not find file $profileid in list of files!", "get_profile_for_profileitem"); + } return $profile; } diff --git a/solenv/bin/modules/installer/windows/msiglobal.pm b/solenv/bin/modules/installer/windows/msiglobal.pm index f7185d3d5cf0..f1d1e3df9998 100644 --- a/solenv/bin/modules/installer/windows/msiglobal.pm +++ b/solenv/bin/modules/installer/windows/msiglobal.pm @@ -202,7 +202,7 @@ sub generate_cab_file_list if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; } # to avoid lines with more than 256 characters, it can be useful to use relative paths - if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); } + $sourcepath = make_relative_ddf_path($sourcepath); # all files with the same cabinetfile have increasing sequencenumbers @@ -224,7 +224,7 @@ sub generate_cab_file_list $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 paths - if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); } + $sourcepath = make_relative_ddf_path($sourcepath); $uniquename = $nextfile->{'uniquename'}; my $localdoinclude = 1; my $nextfilestyles = ""; @@ -296,7 +296,7 @@ sub generate_cab_file_list if ( $styles =~ /\bDONT_PACK\b/ ) { $doinclude = 0; } # to avoid lines with more than 256 characters, it can be useful to use relative paths - if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); } + $sourcepath = make_relative_ddf_path($sourcepath); my @ddffile = (); @@ -317,7 +317,7 @@ sub generate_cab_file_list $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 paths - if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); } + $sourcepath = make_relative_ddf_path($sourcepath); $uniquename = $nextfile->{'uniquename'}; my $localdoinclude = 1; my $nextfilestyles = ""; @@ -376,7 +376,7 @@ sub generate_cab_file_list # to avoid lines with more than 256 characters, it can be useful to use relative paths - if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); } + $sourcepath = make_relative_ddf_path($sourcepath); # all files with the same cabinetfile are directly behind each other in the files collector @@ -397,7 +397,7 @@ sub generate_cab_file_list $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 paths - if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); } + $sourcepath = make_relative_ddf_path($sourcepath); $uniquename = $nextfile->{'uniquename'}; my $localdoinclude = 1; my $nextfilestyles = ""; @@ -459,7 +459,7 @@ sub generate_cab_file_list my $uniquename = $onefile->{'uniquename'}; # to avoid lines with more than 256 characters, it can be useful to use relative paths - if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); } + $sourcepath = make_relative_ddf_path($sourcepath); if ( $counter == 1 ) { write_ddf_file_header(\@ddffile, $cabinetfile, $installdir); } @@ -513,7 +513,7 @@ sub generate_cab_file_list my $uniquename = $onefile->{'uniquename'}; # to avoid lines with more than 256 characters, it can be useful to use relative paths - if ( $allvariables->{'RELATIVE_PATHES_IN_DDF'} ) { $sourcepath = make_relative_ddf_path($sourcepath); } + $sourcepath = make_relative_ddf_path($sourcepath); if ( $i == 0 ) { write_ddf_file_header(\@ddffile, $cabinetfile, $installdir); } @@ -1111,6 +1111,19 @@ sub create_transforms chdir($installdir); $systemcall = $msidb . " " . " -d " . $basedbname . " -r " . $windowslanguage; system($systemcall); + # fdo#46181 - zh-HK and zh-MO should have fallen back to zh-TW not to zh-CN + # we need to hack zh-HK and zh-MO LCIDs directly into the MSI + if($windowslanguage eq '1028') + { + rename 1028,3076; + $systemcall = $msidb . " " . " -d " . $basedbname . " -r " . 3076; + system($systemcall); + rename 3076,5124; + $systemcall = $msidb . " " . " -d " . $basedbname . " -r " . 5124; + system($systemcall); + $templatevalue = $templatevalue . "," . 3076 . "," . 5124; + rename 5124,1028; + } chdir($from); unlink($transformfile); @@ -1597,14 +1610,11 @@ sub execute_packaging $infoline = "chdir: $to \n"; push( @installer::globals::logfileinfo, $infoline); - # if the ddf file contains relative paths, 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); - } + # the ddf file contains relative paths, it is necessary to change into the temp directory + $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 = ""; diff --git a/solenv/bin/modules/installer/windows/msp.pm b/solenv/bin/modules/installer/windows/msp.pm index be9ed624e0e9..0de6effff0b2 100644 --- a/solenv/bin/modules/installer/windows/msp.pm +++ b/solenv/bin/modules/installer/windows/msp.pm @@ -1402,7 +1402,7 @@ sub create_msp_patch if ( $installer::globals::languagepack ) { $pcpfilename =~ s/.pcp\s*$/languagepack.pcp/; } elsif ( $installer::globals::helppack ) { $pcpfilename =~ s/.pcp\s*$/helppack.pcp/; } - # Searching the pcp file in the include pathes + # Searching the pcp file in the include paths 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; diff --git a/solenv/bin/modules/installer/windows/property.pm b/solenv/bin/modules/installer/windows/property.pm index 6319276954b9..27b19d7170c5 100644 --- a/solenv/bin/modules/installer/windows/property.pm +++ b/solenv/bin/modules/installer/windows/property.pm @@ -390,29 +390,6 @@ sub set_important_properties 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 "" ) { diff --git a/solenv/bin/modules/installer/windows/registry.pm b/solenv/bin/modules/installer/windows/registry.pm index ba9f7a8e6488..8312e56beefe 100644 --- a/solenv/bin/modules/installer/windows/registry.pm +++ b/solenv/bin/modules/installer/windows/registry.pm @@ -401,7 +401,7 @@ sub create_registry_table $registry{'Component_'} = get_registry_component($oneregistry, $allvariableshashref); # Collecting all components - if (!(installer::existence::exists_in_array($registry{'Component_'}, $allregistrycomponentsref))) + if (! grep {$_ eq $registry{'Component_'}} @{$allregistrycomponentsref}) { push(@{$allregistrycomponentsref}, $registry{'Component_'}); } diff --git a/solenv/bin/modules/installer/windows/removefile.pm b/solenv/bin/modules/installer/windows/removefile.pm index ec2a6142db71..ec12636ed224 100644 --- a/solenv/bin/modules/installer/windows/removefile.pm +++ b/solenv/bin/modules/installer/windows/removefile.pm @@ -122,7 +122,7 @@ sub create_removefile_table if ( $onelink->{'used'} == 0 ) { next; } - if ( installer::existence::exists_in_array($onelink->{'directory'}, \@directorycollector)) { next; } + next if grep {$_ eq $onelink->{'directory'}} @directorycollector; push(@directorycollector, $onelink->{'directory'}); diff --git a/solenv/bin/modules/installer/windows/shortcut.pm b/solenv/bin/modules/installer/windows/shortcut.pm index 6c73f773cb24..4b7ff36f2e10 100644 --- a/solenv/bin/modules/installer/windows/shortcut.pm +++ b/solenv/bin/modules/installer/windows/shortcut.pm @@ -27,7 +27,6 @@ package installer::windows::shortcut; -use installer::existence; use installer::exiter; use installer::files; use installer::globals; @@ -516,7 +515,7 @@ sub get_folderitem_icon my $sourcepath = $onefile->{'sourcepath'}; - if (! installer::existence::exists_in_array($sourcepath, $iconfilecollector)) + if (! grep {$_ eq $sourcepath} @{$iconfilecollector}) { push(@{$iconfilecollector}, $sourcepath); } @@ -674,7 +673,7 @@ sub create_shortcut_table 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)) + if (! grep {$_ eq $$sourcepathref} @{$iconfilecollector}) { unshift(@{$iconfilecollector}, $$sourcepathref); $installer::globals::sofficeiconadded = 1; diff --git a/solenv/bin/modules/installer/windows/sign.pm b/solenv/bin/modules/installer/windows/sign.pm deleted file mode 100644 index 8fb7b3fe13a0..000000000000 --- a/solenv/bin/modules/installer/windows/sign.pm +++ /dev/null @@ -1,1242 +0,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. -# -#************************************************************************* - -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 = ""; - } - - 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; - - 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 $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 occurred calling diff.exe (File: $lastfile)\n"; - push( @installer::globals::logfileinfo, $infoline); - installer::exiter::exit_program("ERROR: Problem occurred 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; } - - 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 index 79b1046c1e8f..8cccba19de99 100644 --- a/solenv/bin/modules/installer/windows/strip.pm +++ b/solenv/bin/modules/installer/windows/strip.pm @@ -29,7 +29,6 @@ package installer::windows::strip; use File::Temp qw(tmpnam); use installer::converter; -use installer::existence; use installer::globals; use installer::logger; use installer::pathanalyzer; @@ -97,7 +96,7 @@ sub strip_binaries my $strippeddirbase = installer::systemactions::create_directories("stripped", $languagestringref); - if (! installer::existence::exists_in_array($strippeddirbase, \@installer::globals::removedirs)) + if (! grep {$_ eq $strippeddirbase} @installer::globals::removedirs) { push(@installer::globals::removedirs, $strippeddirbase); } diff --git a/solenv/bin/modules/installer/windows/update.pm b/solenv/bin/modules/installer/windows/update.pm index 50d31f022024..4378ecf89a87 100644 --- a/solenv/bin/modules/installer/windows/update.pm +++ b/solenv/bin/modules/installer/windows/update.pm @@ -313,7 +313,7 @@ sub readdatabase 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 + # Searching the list in the include paths 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; diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm index c91ece7108ab..1d3d19a987a8 100644 --- a/solenv/bin/modules/installer/worker.pm +++ b/solenv/bin/modules/installer/worker.pm @@ -34,7 +34,6 @@ use File::Temp qw(tmpnam); use File::Path; use installer::control; use installer::converter; -use installer::existence; use installer::exiter; use installer::files; use installer::globals; @@ -42,179 +41,9 @@ use installer::logger; 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); - - # 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"); } - - 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 @@ -432,9 +261,6 @@ sub analyze_and_save_logfile 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); } @@ -450,21 +276,6 @@ sub analyze_and_save_logfile } ############################################################### -# 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; - 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 ############################################################### @@ -824,7 +635,7 @@ sub collect_all_modules $registryitem = ${$registryitemsref}[$i]; my $module = $registryitem->{'ModuleID'}; - if ( ! installer::existence::exists_in_array($module, \@allmodules) ) + if ( ! grep {$_ eq $module} @allmodules ) { push(@allmodules, $module); } @@ -906,7 +717,11 @@ sub write_content_into_inf_file replace_in_template_file($templatefile, $placeholder, $tooltip); my $executablegid = $folderitem->{'FileID'}; - my $exefile = installer::existence::get_specified_file($filesref, $executablegid); + my ($exefile) = grep {$_->{gid} eq $executablegid} @{$filesref}; + if (! defined $exefile) { + installer::exiter::exit_program("ERROR: Could not find file $executablegid in list of files!", "write_content_into_inf_file"); + } + my $exefilename = $exefile->{'Name'}; $placeholder = "PLACEHOLDER_FOLDERITEM_TARGET_" . $app; replace_in_template_file($templatefile, $placeholder, $exefilename); @@ -1533,23 +1348,6 @@ sub shift_file_to_end } ########################################################### -# 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 ########################################################### @@ -1608,10 +1406,13 @@ sub prepare_windows_patchfiles my $winpatchdirname = "winpatch"; my $winpatchdir = installer::systemactions::create_directories($winpatchdirname, $languagestringref); - my $patchlistfile = installer::existence::get_specified_file_by_name($filesref, $patchfilename); + my ($patchlistfile) = grep {$_->{Name} eq $patchfilename} @{$filesref}; + if (! defined $patchlistfile) { + installer::exiter::exit_program("ERROR: Could not find file $patchfilename in list of files!", "prepare_windows_patchfiles"); + } # reorganizing the patchfile content, sorting for directory to decrease the file size - my $sorteddirectorylist = sort_hash(\%patchfiledirectories); + my $sorteddirectorylist = [ sort keys %patchfiledirectories ]; my $patchfilelist = reorg_patchfile(\@patchfiles, $sorteddirectorylist); # shifting version.ini to the end of the list, to guarantee, that all files are patched @@ -2457,141 +2258,6 @@ sub filter_pkgmapfile 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 diff --git a/solenv/bin/modules/installer/xpdinstaller.pm b/solenv/bin/modules/installer/xpdinstaller.pm deleted file mode 100644 index ac38b6489657..000000000000 --- a/solenv/bin/modules/installer/xpdinstaller.pm +++ /dev/null @@ -1,1813 +0,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. -# -#************************************************************************* -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; - } - } - - 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 $value = "false"; - 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 occurrences of "<" by "<" -# and all occurrences of ">" by ">" -################################################### - -sub replace_brackets_in_string -{ - my ( $string ) = @_; - - if ( $string =~ /\</ ) { $string =~ s/\</\<\;/g; } - if ( $string =~ /\>/ ) { $string =~ s/\>/\>\;/g; } - - return $string; -} - -################################################### -# Substituting all occurrences 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::isrpmbuild ) && ( $isrpmfile )) - { - 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::isrpmbuild ) - { - 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::isrpmbuild ) && ( $isrpmfile )) - { - if ( $xpdinfo->{'FullPackageName'} ) - { - $value = $xpdinfo->{'FullPackageName'}; - return $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_occurred = 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_occurred = 1; - } - else - { - $infoline = "ERROR: $systemcall\n"; - push( @installer::globals::logfileinfo, $infoline); - $error_occurred = 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"}; - } - 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::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; - - 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::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($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 = 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]; - - my $infoline = "Creating xpd file for package: $newpackagename\n"; - push( @installer::globals::logfileinfo, $infoline); - - my $childmodule = {%{$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 index c078155c3f7b..6435445dc883 100644 --- a/solenv/bin/modules/installer/ziplist.pm +++ b/solenv/bin/modules/installer/ziplist.pm @@ -27,11 +27,11 @@ package installer::ziplist; -use installer::existence; +use File::Spec::Functions qw(rel2abs); + use installer::exiter; use installer::globals; use installer::logger; -use installer::parameter; use installer::remover; use installer::systemactions; @@ -383,7 +383,7 @@ sub remove_multiples_from_ziplist $itemname = $1; } - if (! installer::existence::exists_in_array($itemname, \@itemarray)) + if (! grep {$_ eq $itemname} @itemarray) { push(@itemarray, $itemname); } @@ -518,7 +518,7 @@ sub replace_packagetype_in_pathes } #################################################### -# Removing ending separators in pathes +# Removing ending separators in paths #################################################### sub remove_ending_separator @@ -546,7 +546,7 @@ sub replace_languages_in_pathes { my ( $patharrayref, $languagesref ) = @_; - installer::logger::include_header_into_logfile("Replacing languages in include pathes:"); + installer::logger::include_header_into_logfile("Replacing languages in include paths:"); my @patharray = (); my $infoline = ""; @@ -570,7 +570,7 @@ sub replace_languages_in_pathes installer::remover::remove_leading_and_ending_whitespaces(\$newline); - # Is it necessary to refresh the global array, containing all files of all include pathes? + # Is it necessary to refresh the global array, containing all files of all include paths? if ( -d $newdir ) { # Checking if $newdir is empty @@ -703,10 +703,10 @@ sub resolve_relative_pathes { my ( $patharrayref ) = @_; - for ( my $i = 0; $i <= $#{$patharrayref}; $i++ ) + for my $path ( @{$patharrayref} ) { - installer::parameter::make_path_absolute(\${$patharrayref}[$i]); - simplify_path(\${$patharrayref}[$i]); + $path = rel2abs($path); + simplify_path(\$path); } } diff --git a/solenv/bin/modules/packager/existence.pm b/solenv/bin/modules/packager/existence.pm deleted file mode 100644 index 81f13395befc..000000000000 --- a/solenv/bin/modules/packager/existence.pm +++ /dev/null @@ -1,52 +0,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. -# -#************************************************************************* - -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/work.pm b/solenv/bin/modules/packager/work.pm index e18b6fb5127d..cd5a7fc43f99 100644 --- a/solenv/bin/modules/packager/work.pm +++ b/solenv/bin/modules/packager/work.pm @@ -28,11 +28,20 @@ package packager::work; +use strict; +use warnings; + +use base 'Exporter'; + use packager::exiter; -use packager::existence; -use packager::files; use packager::globals; +our @EXPORT_OK = qw( + set_global_variable + create_package_todos + execute_system_calls +); + ########################################### # Setting global variables ########################################### @@ -46,31 +55,6 @@ sub set_global_variable $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 @@ -82,51 +66,29 @@ sub create_package_todos 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, ","); + for my $line ( @{$packagelist} ) { + next if ($line =~ /^\s*\#/); # comment line - # is the compiler of this "build" part of the compiler list in pack.lst ? + my ($product, $compilerlist, $languagelist, $target) = + ($line =~ /^\s*(\w+?)\s+(\S+?)\s+(\S+?)\s+(\w+?)\s*$/); - if ( packager::existence::exists_in_array($packager::globals::compiler, $compilers) ) - { - # products are separated in pack.lst by "|" + my @compilers = split ',', $compilerlist; - my $languagesets = convert_stringlist_into_array(\$languagelist, "\|"); + # is the compiler of this "build" part of the compiler list in pack.lst ? - # now all information is available to create the targets for the systemcalls + next unless grep { $_ eq $packager::globals::compiler } @compilers; - for ( my $j = 0; $j <= $#{$languagesets}; $j++ ) - { - my $languagestring = ${$languagesets}[$j]; - $languagestring =~ s/\,/\_/g; # comma in pack.lst becomes "_" in dmake command + # products are separated in pack.lst by "|" + # now all information is available to create the targets for the systemcalls + for my $languagestring (split '\|', $languagelist) { + $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); - } - } + push @targets, $target . '_' . $languagestring; } } + push @packager::globals::logfileinfo, map { $_ . "\n" } @targets; + return \@targets; } diff --git a/solenv/bin/modules/par2script/existence.pm b/solenv/bin/modules/par2script/existence.pm deleted file mode 100644 index 08fb8eda4c7c..000000000000 --- a/solenv/bin/modules/par2script/existence.pm +++ /dev/null @@ -1,74 +0,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. -# -#************************************************************************* - - -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/files.pm b/solenv/bin/modules/par2script/files.pm index 3b7e70d2d4a9..cc1be422939d 100644 --- a/solenv/bin/modules/par2script/files.pm +++ b/solenv/bin/modules/par2script/files.pm @@ -58,7 +58,7 @@ sub read_file } ########################################### -# Saving files, arrays and hashes +# Saving files ########################################### sub save_file @@ -70,55 +70,4 @@ sub save_file 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/parameter.pm b/solenv/bin/modules/par2script/parameter.pm index 9c8abec78a0c..38a2d39dcb78 100644 --- a/solenv/bin/modules/par2script/parameter.pm +++ b/solenv/bin/modules/par2script/parameter.pm @@ -51,7 +51,7 @@ sub usage -------------------------------------------------------------- $par2script::globals::prog The following parameter are needed: --i: include pathes, comma separated list +-i: include paths, comma separated list -o: setup script file name -v: writing logfile.txt (optional) \@\@list: list of all par files @@ -105,7 +105,7 @@ sub control_parameter if ($par2script::globals::includepathlist eq "") { print "\n************************************************\n"; - print "Error: Include pathes not set not set (-i)!"; + print "Error: Include paths not set not set (-i)!"; print "\n************************************************\n"; usage(); exit(-1); diff --git a/solenv/bin/modules/par2script/work.pm b/solenv/bin/modules/par2script/work.pm index c9b0bb150bce..9fc2aec67d91 100644 --- a/solenv/bin/modules/par2script/work.pm +++ b/solenv/bin/modules/par2script/work.pm @@ -28,7 +28,6 @@ package par2script::work; -use par2script::existence; use par2script::globals; use par2script::remover; @@ -66,14 +65,14 @@ sub analyze_comma_separated_list } ############################################ -# setting list of include pathes +# setting list of include paths ############################################ sub setincludes { my ($list) = @_; - # input is the comma separated list of include pathes + # input is the comma separated list of include paths my $includes = analyze_comma_separated_list($list); @@ -131,7 +130,7 @@ sub make_complete_pathes_for_parfiles if ( ! $foundparfile ) { - die "ERROR: Could not find parfile ${$parfiles}[$i] in includes pathes: $par2script::globals::includepathlist !\n"; + die "ERROR: Could not find parfile ${$parfiles}[$i] in includes paths: $par2script::globals::includepathlist !\n"; } } } diff --git a/solenv/bin/modules/pre2par/existence.pm b/solenv/bin/modules/pre2par/existence.pm deleted file mode 100644 index 1775f1d9394c..000000000000 --- a/solenv/bin/modules/pre2par/existence.pm +++ /dev/null @@ -1,74 +0,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. -# -#************************************************************************* - - -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/files.pm b/solenv/bin/modules/pre2par/files.pm index e3de88b6dd4e..6dbfd9358140 100644 --- a/solenv/bin/modules/pre2par/files.pm +++ b/solenv/bin/modules/pre2par/files.pm @@ -57,7 +57,7 @@ sub read_file } ########################################### -# Saving files, arrays and hashes +# Saving files ########################################### sub save_file @@ -71,55 +71,4 @@ sub save_file 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/language.pm b/solenv/bin/modules/pre2par/language.pm index a6025e4fc804..13718af695a5 100644 --- a/solenv/bin/modules/pre2par/language.pm +++ b/solenv/bin/modules/pre2par/language.pm @@ -28,7 +28,6 @@ package pre2par::language; use strict; -use pre2par::existence; ############################################################## # Returning a specific language string from the block diff --git a/solenv/bin/modules/pre2par/parameter.pm b/solenv/bin/modules/pre2par/parameter.pm index 763f1963051c..efda79df42ba 100644 --- a/solenv/bin/modules/pre2par/parameter.pm +++ b/solenv/bin/modules/pre2par/parameter.pm @@ -130,35 +130,6 @@ sub control_parameter 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 ##################################### diff --git a/solenv/gbuild/platform/NETBSD_POWERPC_GCC.mk b/solenv/bin/modules/t/installer-packagelist.t index a426e2f8321d..b4ef6cead5fb 100644 --- a/solenv/gbuild/platform/NETBSD_POWERPC_GCC.mk +++ b/solenv/bin/modules/t/installer-packagelist.t @@ -1,4 +1,3 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- # Version: MPL 1.1 / GPLv3+ / LGPLv3+ # # The contents of this file are subject to the Mozilla Public License Version @@ -12,8 +11,7 @@ # License. # # Major Contributor(s): -# Copyright (C) 2010 Red Hat, Inc., Caolán McNamara <caolanm@redhat.com> -# (initial developer) +# [ Copyright (C) 2012 Tim Retout <tim@retout.co.uk> (initial developer) ] # # All Rights Reserved. # @@ -25,15 +23,35 @@ # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable # instead of those above. -#please make generic modifications to unxgcc.mk +use strict; +use warnings; -gb_COMPILERDEFAULTOPTFLAGS := -O2 +use lib '.'; -include $(GBUILDDIR)/platform/unxgcc.mk +use Test::More; -NB_ADD_LIBPATH := /usr/pkg/lib:/usr/X11R7/lib +BEGIN { + use_ok('installer::packagelist'); +} -gb_Helper_set_ld_path := LD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib:$(NB_ADD_LIBPATH) -gb_CppunitTest_CPPTESTPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib:$(NB_ADD_LIBPATH) +my @packagemodules = ( + { allmodules => [qw(a b c d)] }, + { allmodules => [qw(a b c)] }, + { allmodules => [qw(e f g)] }, + { allmodules => [qw(h)] }, + { allmodules => [qw(a b g)] }, +); -# vim: set noet sw=4: +my @expected_packagemodules = ( + { allmodules => [qw(d)] }, + { allmodules => [qw(c)] }, + { allmodules => [qw(e f)] }, + { allmodules => [qw(h)] }, + { allmodules => [qw(a b g)] }, +); + +installer::packagelist::remove_multiple_modules_packages(\@packagemodules); + +is_deeply(\@packagemodules, \@expected_packagemodules); + +done_testing(); diff --git a/solenv/bin/modules/t/installer-setupscript.t b/solenv/bin/modules/t/installer-setupscript.t new file mode 100644 index 000000000000..1320d7f4282f --- /dev/null +++ b/solenv/bin/modules/t/installer-setupscript.t @@ -0,0 +1,76 @@ +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# Major Contributor(s): +# [ Copyright (C) 2012 Tim Retout <tim@retout.co.uk> (initial developer) ] +# +# All Rights Reserved. +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +use strict; +use warnings; + +use Test::More; + +use lib '.'; + +BEGIN { + use_ok('installer::setupscript', qw( + add_forced_properties + add_installationobject_to_variables + add_lowercase_productname_setupscriptvariable + add_predefined_folder + get_all_items_from_script + get_all_scriptvariables_from_installation_object + prepare_non_advertised_files + replace_all_setupscriptvariables_in_script + replace_preset_properties + resolve_lowercase_productname_setupscriptvariable + set_setupscript_name + )); +} + +my @folders = ( + { gid => '123' }, + { gid => 'PREDEFINED_FOO' }, + { gid => 'PREDEFINED_BAR' }, +); + +my @folderitems = ( + { FolderID => 'PREDEFINED_AUTOSTART' }, + { FolderID => 'PREDEFINED_BAR' }, + { FolderID => '456' }, +); + +my @expected_folders = ( + { gid => '123' }, + { gid => 'PREDEFINED_FOO' }, + { gid => 'PREDEFINED_BAR' }, + { + ismultilingual => 0, + Name => "", + gid => 'PREDEFINED_AUTOSTART' + }, +); + +add_predefined_folder(\@folderitems, \@folders); + +is_deeply(\@folders, \@expected_folders); + +done_testing(); diff --git a/solenv/gbuild/platform/NETBSD_SPARC_GCC.mk b/solenv/bin/modules/t/packager-work.t index a426e2f8321d..af1fe021b67e 100644 --- a/solenv/gbuild/platform/NETBSD_SPARC_GCC.mk +++ b/solenv/bin/modules/t/packager-work.t @@ -1,4 +1,3 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- # Version: MPL 1.1 / GPLv3+ / LGPLv3+ # # The contents of this file are subject to the Mozilla Public License Version @@ -12,8 +11,7 @@ # License. # # Major Contributor(s): -# Copyright (C) 2010 Red Hat, Inc., Caolán McNamara <caolanm@redhat.com> -# (initial developer) +# [ Copyright (C) 2012 Tim Retout <tim@retout.co.uk> (initial developer) ] # # All Rights Reserved. # @@ -25,15 +23,40 @@ # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable # instead of those above. -#please make generic modifications to unxgcc.mk +use strict; +use warnings; -gb_COMPILERDEFAULTOPTFLAGS := -O2 +use Test::More; -include $(GBUILDDIR)/platform/unxgcc.mk +use lib '.'; -NB_ADD_LIBPATH := /usr/pkg/lib:/usr/X11R7/lib +BEGIN { + use_ok('packager::work', qw( + set_global_variable + create_package_todos + execute_system_calls + )); +} -gb_Helper_set_ld_path := LD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib:$(NB_ADD_LIBPATH) -gb_CppunitTest_CPPTESTPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib:$(NB_ADD_LIBPATH) +$packager::globals::compiler = 'gcc'; +@packager::globals::logfileinfo = (); -# vim: set noet sw=4: +my $packagelist = <<'END'; + # Comment + some_product gcc,gcc3.3 en_US,en_GB|fr_FR some_target + other_thing x y z +END + +my @packagelist = split "\n", $packagelist; + +my $targets = create_package_todos( \@packagelist ); + +is_deeply(\@packager::globals::logfileinfo, + ["some_target_en_US_en_GB\n", + "some_target_fr_FR\n"]); + +is_deeply($targets, + ["some_target_en_US_en_GB", + "some_target_fr_FR"]); + +done_testing(); diff --git a/solenv/bin/ooinstall b/solenv/bin/ooinstall index 794e81b930df..693397ae2063 100755 --- a/solenv/bin/ooinstall +++ b/solenv/bin/ooinstall @@ -16,7 +16,8 @@ $do_link = 0; $is_windows = 0; my $tmp_dir; -die "You need to source Env.Host.sh first " if (!defined $ENV{SRC_ROOT}); +# FIXME: really we should hunt and parse / source the config_host.mk magic I guess. +die "You need your environment setup right, eg. run make cmd cmd='ooinstall /path/to/install'" if (!defined $ENV{SRC_ROOT}); if ($ENV{GUI} eq 'WNT') { $is_windows = 1; @@ -48,10 +49,6 @@ for $arg (@ARGV) { # Cwd::realpath does not work if the path does not exist mkpath($ENV{DESTDIR} . $arg) unless -d $ENV{DESTDIR} . $arg; $path = Cwd::realpath( $ENV{DESTDIR} . $arg ); - if (!$do_link) { - my $destdir = Cwd::realpath( $ENV{DESTDIR} ); - $path =~ s|$destdir||; - } } } diff --git a/solenv/bin/packimages.pl b/solenv/bin/packimages.pl index 70823c5a8b41..12eb3ea1b9ad 100755 --- a/solenv/bin/packimages.pl +++ b/solenv/bin/packimages.pl @@ -49,7 +49,7 @@ 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 @imagelist_path; # paths to directories containing the image lists my $verbose; # be verbose my $extra_verbose; # be extra verbose my $do_rebuild = 0; # is rebuilding zipfile required? diff --git a/solenv/doc/gbuild/solenv/gbuild/gbuild.mk b/solenv/doc/gbuild/solenv/gbuild/gbuild.mk index 2b65f3fce66e..6bb3a58d956b 100644 --- a/solenv/doc/gbuild/solenv/gbuild/gbuild.mk +++ b/solenv/doc/gbuild/solenv/gbuild/gbuild.mk @@ -13,7 +13,6 @@ 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; diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk index 21570c7bc305..10eebdd47920 100644 --- a/solenv/gbuild/AllLangResTarget.mk +++ b/solenv/gbuild/AllLangResTarget.mk @@ -50,7 +50,6 @@ gb_SrsPartMergeTarget_TRANSEXTARGET := $(call gb_Executable_get_target_for_build,transex3) gb_SrsPartMergeTarget_TRANSEXCOMMAND := \ $(gb_Helper_set_ld_path) $(gb_SrsPartMergeTarget_TRANSEXTARGET) -gb_SrsPartMergeTarget_SDFLOCATION := $(SRCDIR)/translations/$(INPATH)/misc/sdf/ define gb_SrsPartMergeTarget__command $(call gb_Output_announce,$(3),$(true),srs,1) @@ -58,14 +57,14 @@ $(call gb_Helper_abbreviate_dirs_native,\ mkdir -p $(dir $(1)) && \ $(gb_SrsPartMergeTarget_TRANSEXCOMMAND) \ -p $(firstword $(subst /, ,$(2))) \ - -i $(realpath $(3)) \ + -i $(3) \ -o $(1) \ -m $(SDF) \ -l all) endef -$(call gb_SrsPartMergeTarget_get_target,%) : $(SRCDIR)/% $(gb_Helper_MISCDUMMY) | $(gb_SrsPartMergeTarget_TRANSEXTARGET) +$(call gb_SrsPartMergeTarget_get_target,%) : $(SRCDIR)/% $(gb_Helper_MISCDUMMY) $(gb_SrsPartMergeTarget_TRANSEXTARGET) $(if $(SDF),$(call gb_SrsPartMergeTarget__command,$@,$*,$<),mkdir -p $(dir $@) && cp $< $@) @@ -83,10 +82,10 @@ $(call gb_Helper_abbreviate_dirs_native,\ RESPONSEFILE=`$(gb_MKTEMP)` && \ echo "-s \ $(INCLUDE) \ - -I$(realpath $(dir $(3))) \ + -I$(dir $(3)) \ $(DEFS) \ -fp=$(1) \ - $(realpath $(if $(MERGEDFILE),$(MERGEDFILE),$<))" > $${RESPONSEFILE} && \ + $(if $(MERGEDFILE),$(MERGEDFILE),$<)" > $${RESPONSEFILE} && \ $(gb_SrsPartTarget_RSCCOMMAND) -presponse @$${RESPONSEFILE} && \ rm -rf $${RESPONSEFILE}) @@ -113,7 +112,7 @@ $(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 := $(realpath $(gb_SrsPartMergeTarget_SDFLOCATION)$(dir $(1))localize.sdf) +$(call gb_SrsPartMergeTarget_get_target,$(1)) : SDF := $(wildcard $(gb_SDFLOCATION)/$(dir $(1))localize.sdf) endif endef @@ -126,7 +125,7 @@ $(call gb_SrsTemplatePartTarget_get_target,$(1)) : $(call gb_SrsPartMergeTarget_ mkdir -p $$(dir $$@) && \ cp $$< $$@) ifneq ($(strip $(WITH_LANG)),) -$(call gb_SrsPartMergeTarget_get_target,$(1)) : SDF := $(realpath $(gb_SrsPartMergeTarget_SDFLOCATION)$(dir $(1))localize.sdf) +$(call gb_SrsPartMergeTarget_get_target,$(1)) : SDF := $(wildcard $(gb_SDFLOCATION)/$(dir $(1))localize.sdf) $(call gb_SrsPartMergeTarget_get_target,$(1)) : $$(SDF) endif @@ -311,7 +310,7 @@ endef gb_ResTarget_RSCTARGET := $(gb_SrsPartTarget_RSCTARGET) gb_ResTarget_RSCCOMMAND := $(gb_SrsPartTarget_RSCCOMMAND) -gb_ResTarget_DEFIMAGESLOCATION := $(realpath $(SRCDIR)/icon-themes/galaxy)/ +gb_ResTarget_DEFIMAGESLOCATION := $(SRCDIR)/icon-themes/galaxy/ $(call gb_ResTarget_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),RES,2) @@ -327,15 +326,15 @@ $(call gb_ResTarget_get_target,%) : $(gb_Helper_MISCDUMMY) | $(gb_ResTarget_RSCT 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)$(RESLOCATION)/$(LIBRARY) \ + -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst/$(LANGUAGE) \ + -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/imglst \ + -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res/$(LANGUAGE) \ + -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)/res \ + -lip=$(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION) \ -lip=$(gb_ResTarget_DEFIMAGESLOCATION)res/$(LANGUAGE) \ -lip=$(gb_ResTarget_DEFIMAGESLOCATION)res \ - -subMODULE=$(dir $(realpath $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION))) \ + -subMODULE=$(dir $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)) \ -subGLOBALRES=$(gb_ResTarget_DEFIMAGESLOCATION)res \ -oil=$(dir $(call gb_ResTarget_get_imagelist_target,$*)) \ $(filter-out $(gb_Helper_MISCDUMMY),$^)" > $${RESPONSEFILE} && \ @@ -357,6 +356,8 @@ $(call gb_ResTarget_get_imagelist_target,$(1)) : $(call gb_ResTarget_get_target, $(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_ResTarget_get_outdir_imagelist_target,$(1)) :| \ + $(dir $(call gb_ResTarget_get_outdir_imagelist_target,$(1))).dir $(call gb_Deliver_add_deliverable,$(call gb_ResTarget_get_outdir_target,$(1)),$(call gb_ResTarget_get_target,$(1)),$(1)) $(call gb_Deliver_add_deliverable,$(call gb_ResTarget_get_outdir_imagelist_target,$(1)),$(call gb_ResTarget_get_imagelist_target,$(1)),$(1)) diff --git a/solenv/gbuild/BuildDirs.mk b/solenv/gbuild/BuildDirs.mk index 5955082d54d7..4aa7176d3fdc 100644 --- a/solenv/gbuild/BuildDirs.mk +++ b/solenv/gbuild/BuildDirs.mk @@ -26,15 +26,6 @@ # #************************************************************************* -# extend for JDK include (seems only needed in setsolar env?) -SOLARINC += $(JDKINCS) - -OUTDIR := $(SOLARVERSION)/$(INPATH) -OUTDIR_FOR_BUILD := $(SOLARVERSION)/$(INPATH_FOR_BUILD) -ifeq ($(strip $(SOLARENV)),) -$(error SOLARENV variable is empty, no environment set, aborting) -endif - # The entire gbuild operates in unix paths, and then when calling the # native tools, converts them back to the Windows native paths. # @@ -53,6 +44,4 @@ override OUTDIR_FOR_BUILD := $(shell cygpath -u $(OUTDIR_FOR_BUILD)) override SRCDIR := $(shell cygpath -u $(SRCDIR)) endif -REPODIR := $(patsubst %/,%,$(dir $(SRCDIR))) - # vim: set noet sw=4: diff --git a/solenv/gbuild/ComponentTarget.mk b/solenv/gbuild/ComponentTarget.mk index efe481991a19..ee57d7643d2f 100644 --- a/solenv/gbuild/ComponentTarget.mk +++ b/solenv/gbuild/ComponentTarget.mk @@ -29,14 +29,19 @@ gb_ComponentTarget_XSLTCOMMANDFILE := $(SOLARENV)/bin/createcomponent.xslt gb_ComponentTarget_get_source = $(1)/$(2).component +# In the DISABLE_DYNLOADING case we don't need any COMPONENTPREFIX, we +# put just the static library filename into the uri parameter. For +# each statically linked app using some subset of LO components, there +# is a mapping from library filenames to direct pointers to the +# corresponding PREFIX_component_getFactory functions. define gb_ComponentTarget__command $(call gb_Output_announce,$(3),$(true),CMP,1) $(if $(LIBFILENAME),,$(call gb_Output_error,No LIBFILENAME set at component target: $(1))) $(call gb_Helper_abbreviate_dirs_native,\ mkdir -p $(dir $(1)) && \ $(gb_XSLTPROC) --nonet --stringparam uri \ - '$(subst \d,$$,$(COMPONENTPREFIX))$(LIBFILENAME)' -o $(1) \ - $(gb_ComponentTarget_XSLTCOMMANDFILE) $(realpath $(2))) + '$(if $(filter TRUE,$(DISABLE_DYNLOADING)),,$(subst \d,$$,$(COMPONENTPREFIX)))$(LIBFILENAME)' -o $(1) \ + $(gb_ComponentTarget_XSLTCOMMANDFILE) $(2)) endef @@ -52,6 +57,10 @@ $(call gb_ComponentTarget_get_target,%) : $(call gb_ComponentTarget_get_source,$ $(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 xsltproc is missing.)) +# the .dir is for make 3.81, which ignores trailing / +$(dir $(call gb_ComponentTarget_get_outdir_target,))%/.dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + $(call gb_ComponentTarget_get_outdir_target,%) : $(call gb_Deliver_deliver,$<,$@) @@ -59,7 +68,8 @@ define gb_ComponentTarget_ComponentTarget $(call gb_ComponentTarget_get_target,$(1)) : COMPONENTPREFIX := $(2) $(call gb_ComponentTarget_get_target,$(1)) : LIBFILENAME := $(3) $(call gb_ComponentTarget_get_outdir_target,$(1)) : \ - $(call gb_ComponentTarget_get_target,$(1)) + $(call gb_ComponentTarget_get_target,$(1)) \ + | $(dir $(call gb_ComponentTarget_get_outdir_target,$(1))).dir $(call gb_Deliver_add_deliverable,$(call gb_ComponentTarget_get_outdir_target,$(1)),$(call gb_ComponentTarget_get_target,$(1)),$(1)) endef diff --git a/solenv/gbuild/Configuration.mk b/solenv/gbuild/Configuration.mk index 0674837c1311..60f5b81a384a 100644 --- a/solenv/gbuild/Configuration.mk +++ b/solenv/gbuild/Configuration.mk @@ -101,6 +101,12 @@ $(call gb_XcsTarget_get_clean_target,%) : rm -f $(call gb_XcsTarget_get_target,$*) \ $(call gb_XcsTarget_get_outdir_target,$(XCSFILE))) +# the .dir is for make 3.81, which ignores trailing / +$(dir $(call gb_XcsTarget_get_outdir_target,%))%/.dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) +$(dir $(call gb_XcsTarget_get_outdir_target,%)).dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + $(call gb_XcsTarget_get_outdir_target,%) : $(call gb_Helper_abbreviate_dirs,\ $(call gb_Deliver_deliver,$<,$@)) @@ -142,6 +148,12 @@ $(call gb_XcuDataTarget_get_clean_target,%) : rm -f $(call gb_XcuDataTarget_get_target,$*) \ $(call gb_XcuDataTarget_get_outdir_target,$(XCUFILE))) +# the .dir is for make 3.81, which ignores trailing / +$(dir $(call gb_XcuDataTarget_get_outdir_target,))%/.dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) +$(dir $(call gb_XcuDataTarget_get_outdir_target,)).dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + $(call gb_XcuDataTarget_get_outdir_target,%) : $(call gb_Helper_abbreviate_dirs,\ $(call gb_Deliver_deliver,$<,$@)) @@ -179,6 +191,10 @@ $(call gb_XcuModuleTarget_get_clean_target,%) : rm -f $(call gb_XcuModuleTarget_get_target,$*) \ $(call gb_XcuModuleTarget_get_outdir_target,$(XCUFILE))) +# the .dir is for make 3.81, which ignores trailing / +$(dir $(call gb_XcuModuleTarget_get_outdir_target,))%/.dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + $(call gb_XcuModuleTarget_get_outdir_target,%) : $(call gb_Helper_abbreviate_dirs,\ $(call gb_Deliver_deliver,$<,$@)) @@ -214,6 +230,12 @@ $(call gb_XcuLangpackTarget_get_clean_target,%) : $(call gb_XcuLangpackTarget__get_target_with_lang,$*,$(lang)) \ $(call gb_XcuLangpackTarget__get_outdir_target_with_lang,$(XCUFILE),$(lang)))) +# the .dir is for make 3.81, which ignores trailing / +$(dir $(call gb_XcuLangpackTarget_get_outdir_target,))%/.dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) +$(dir $(call gb_XcuLangpackTarget_get_outdir_target,)).dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + $(call gb_XcuLangpackTarget_get_outdir_target,%) : $(call gb_Helper_abbreviate_dirs,\ $(call gb_Deliver_deliver,$<,$@)) @@ -223,7 +245,6 @@ $(call gb_XcuLangpackTarget_get_outdir_target,%) : gb_XcuMergeTarget_CFGEXTARGET := $(call gb_Executable_get_target,cfgex) gb_XcuMergeTarget_CFGEXCOMMAND := $(gb_Helper_set_ld_path) $(gb_XcuMergeTarget_CFGEXTARGET) -gb_XcuMergeTarget_SDFLOCATION := $(SRCDIR)/translations/$(INPATH)/misc/sdf/ # PRJNAME is computed from the stem (parameter $(2)) define gb_XcuMergeTarget__command @@ -238,7 +259,7 @@ $(call gb_Helper_abbreviate_dirs_native,\ -l all) endef -$(call gb_XcuMergeTarget_get_target,%) : | $(gb_XcuMergeTarget_CFGEXTARGET) +$(call gb_XcuMergeTarget_get_target,%) : $(gb_XcuMergeTarget_CFGEXTARGET) $(if $(SDF),$(call gb_XcuMergeTarget__command,$@,$*,$(filter %.xcu,$^)),mkdir -p $(dir $@) && cp $(filter %.xcu,$^) $@) $(call gb_XcuMergeTarget_get_clean_target,%) : @@ -250,9 +271,9 @@ $(call gb_XcuMergeTarget_get_clean_target,%) : define gb_XcuMergeTarget_XcuMergeTarget $(call gb_XcuMergeTarget_get_target,$(1)) : \ $(call gb_Configuration__get_source,$(2),$(3)/$(4)) \ - $(realpath $(gb_XcuMergeTarget_SDFLOCATION)$(dir $(1))localize.sdf) + $(wildcard $(gb_SDFLOCATION)/$(dir $(1))localize.sdf) $(call gb_XcuMergeTarget_get_target,$(1)) : \ - SDF := $(realpath $(gb_XcuMergeTarget_SDFLOCATION)$(dir $(1))localize.sdf) + SDF := $(wildcard $(gb_SDFLOCATION)/$(dir $(1))localize.sdf) endef @@ -344,7 +365,8 @@ $(call gb_XcsTarget_get_clean_target,$(2)/$(3)) : XCSFILE := $(3) $(call gb_Configuration_get_target,$(1)) : \ $(call gb_XcsTarget_get_outdir_target,$(3)) $(call gb_XcsTarget_get_outdir_target,$(3)) : \ - $(call gb_XcsTarget_get_target,$(2)/$(3)) + $(call gb_XcsTarget_get_target,$(2)/$(3)) \ + | $(dir $(call gb_XcsTarget_get_outdir_target,$(3))).dir $(call gb_Deliver_add_deliverable,$(call gb_XcsTarget_get_outdir_target,$(3)),\ $(call gb_XcsTarget_get_target,$(2)/$(3)),$(2)/$(3)) @@ -369,7 +391,8 @@ ifeq ($(strip $(gb_Configuration_NODELIVER_$(1))),) $(call gb_Configuration_get_target,$(1)) : \ $(call gb_XcuDataTarget_get_outdir_target,$(3)) $(call gb_XcuDataTarget_get_outdir_target,$(3)) : \ - $(call gb_XcuDataTarget_get_target,$(2)/$(3)) + $(call gb_XcuDataTarget_get_target,$(2)/$(3)) \ + | $(dir $(call gb_XcuDataTarget_get_outdir_target,$(3))).dir $(call gb_Deliver_add_deliverable,\ $(call gb_XcuDataTarget_get_outdir_target,$(3)),\ $(call gb_XcuDataTarget_get_target,$(2)/$(3)),\ @@ -399,7 +422,8 @@ ifeq ($(strip $(gb_Configuration_NODELIVER_$(1))),) $(call gb_Configuration_get_target,$(1)) : \ $(call gb_XcuModuleTarget_get_outdir_target,$(3)) $(call gb_XcuModuleTarget_get_outdir_target,$(3)) : \ - $(call gb_XcuModuleTarget_get_target,$(2)/$(3)) + $(call gb_XcuModuleTarget_get_target,$(2)/$(3)) \ + | $(dir $(call gb_XcuModuleTarget_get_outdir_target,$(3))).dir $(call gb_Deliver_add_deliverable,\ $(call gb_XcuModuleTarget_get_outdir_target,$(3)),\ $(call gb_XcuModuleTarget_get_target,$(2)/$(3)),\ @@ -429,7 +453,8 @@ $(call gb_XcuLangpackTarget__get_target_with_lang,$(2)/$(3),$(4)) : \ $(call gb_XcuLangpackTarget_get_clean_target,$(2)/$(3)) : XCUFILE := $(3) $(call gb_XcuLangpackTarget__get_target_with_lang,$(2)/$(3),$(4)) : LANG := $(4) $(call gb_XcuLangpackTarget__get_outdir_target_with_lang,$(3),$(4)) : \ - $(call gb_XcuLangpackTarget__get_target_with_lang,$(2)/$(3),$(4)) + $(call gb_XcuLangpackTarget__get_target_with_lang,$(2)/$(3),$(4)) \ + | $(dir $(call gb_XcuLangpackTarget__get_outdir_target_with_lang,$(3),$(4))).dir $(call gb_Deliver_add_deliverable,\ $(call gb_XcuLangpackTarget__get_outdir_target_with_lang,$(3),$(4)),\ $(call gb_XcuLangpackTarget__get_target_with_lang,$(2)/$(3),$(4)),\ diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index 0d8959e0c841..ff6d30068d16 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -51,12 +51,14 @@ endif # gb_CppunitTest_TARGETTYPE # gb_CppunitTest_get_filename # DBGSV_ERROR_OUT => in non-product builds, ensure that tools-based assertions do not pop up as message box, but are routed to the shell +ifneq ($(OS),IOS) gb_CppunitTest_CPPTESTTARGET := $(call gb_Executable_get_target,cppunit/cppunittester) -gb_CppunitTest_CPPTESTCOMMAND := $(gb_CppunitTest_CPPTESTPRECOMMAND) $(if $(G_SLICE),G_SLICE=$(G_SLICE)) $(if $(GLIBCXX_FORCE_NEW),GLIBCXX_FORCE_NEW=$(GLIBCXX_FORCE_NEW)) DBGSV_ERROR_OUT=shell STAR_RESOURCEPATH=$(dir $(call gb_ResTarget_get_outdir_target,example)) $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_CPPTESTTARGET) +endif + gb_CppunitTest__get_linktargetname = CppunitTest/$(call gb_CppunitTest_get_filename,$(1)) # TODO: move this to platform under suitable name -gb_CppunitTarget__make_url = file://$(if $(filter WNT,$(OS_FOR_BUILD)),/)$(1) +gb_CppunitTarget__make_url = file://$(if $(filter WNT,$(OS_FOR_BUILD)),/)$(strip $(1)) gb_CppunitTest__get_uno_type_target = $(OUTDIR)/bin/$(1).rdb define gb_CppunitTest__make_args @@ -83,7 +85,16 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTTARGET) $(call gb_Output_announce,$*,$(true),CUT,2) $(call gb_Helper_abbreviate_dirs_native,\ mkdir -p $(dir $@) && \ - ($(gb_CppunitTest_CPPTESTCOMMAND) $(call gb_LinkTarget_get_target,CppunitTest/$(call gb_CppunitTest_get_libfilename,$*)) $(call gb_CppunitTest__make_args,$(ARGS),$(UNO_SERVICES),$(UNO_TYPES)) $(if $(gb_CppunitTest__interactive),,> $@.log 2>&1 || (cat $@.log && $(UNIT_FAILED_MSG) && false)))) + ($(gb_CppunitTest_CPPTESTPRECOMMAND) \ + $(if $(G_SLICE),G_SLICE=$(G_SLICE)) \ + $(if $(GLIBCXX_FORCE_NEW),GLIBCXX_FORCE_NEW=$(GLIBCXX_FORCE_NEW)) \ + $(if $(DBGSV_ERROR_OUT),DBGSV_ERROR_OUT=$(DBGSV_ERROR_OUT)) \ + $(if $(SAL_DIAGNOSE_ABORT),SAL_DIAGNOSE_ABORT=$(SAL_DIAGNOSE_ABORT)) \ + STAR_RESOURCEPATH=$(dir $(call gb_ResTarget_get_outdir_target,example)) \ + $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_CPPTESTTARGET) \ + $(call gb_LinkTarget_get_target,CppunitTest/$(call gb_CppunitTest_get_libfilename,$*)) \ + $(call gb_CppunitTest__make_args,$(ARGS),$(UNO_SERVICES),$(UNO_TYPES)) \ + $(if $(gb_CppunitTest__interactive),,> $@.log 2>&1 || (cat $@.log && $(UNIT_FAILED_MSG) && false)))) define gb_CppunitTest_CppunitTest $(call gb_CppunitTest__CppunitTest_impl,$(1),$(call gb_CppunitTest__get_linktargetname,$(1))) @@ -111,10 +122,18 @@ $(call gb_CppunitTest_get_target,$(1)) : ARGS := $(call gb_CppunitTest_get_target,$(1)) : URE := $(false) $(call gb_CppunitTest_get_target,$(1)) : UNO_SERVICES := $(call gb_CppunitTest_get_target,$(1)) : UNO_TYPES := +$(call gb_CppunitTest_get_target,$(1)) : DBGSV_ERROR_OUT := shell +$(call gb_CppunitTest_get_target,$(1)) : SAL_DIAGNOSE_ABORT := $$(eval $$(call gb_Module_register_target,$(call gb_CppunitTest_get_target,$(1)),$(call gb_CppunitTest_get_clean_target,$(1)))) endef +define gb_CppunitTest_abort_on_assertion +$(call gb_CppunitTest_get_target,$(1)) : DBGSV_ERROR_OUT := abort +$(call gb_CppunitTest_get_target,$(1)) : SAL_DIAGNOSE_ABORT := TRUE + +endef + define gb_CppunitTest_set_args $(call gb_CppunitTest_get_target,$(1)) : ARGS := $(2) @@ -159,8 +178,22 @@ $(call gb_CppunitTest_get_target,$(1)) : \ endef +# Given a list of component files, filter out those corresponding +# to libraries not built in this configuration. +define gb_CppunitTest__filter_not_built_components +$(filter-out \ + $(if $(filter SCRIPTING,$(BUILD_TYPE)),, \ + basic/util/sb \ + sw/util/vbaswobj \ + scripting/source/basprov/basprov \ + scripting/util/scriptframe) \ + $(if $(filter DBCONNECTIVITY,$(BUILD_TYPE)),, \ + dbaccess/util/dba \ + forms/util/frm),$(1)) +endef + define gb_CppunitTest_add_components -$(foreach component,$(2),$(call gb_CppunitTest_add_component,$(1),$(component))) +$(foreach component,$(call gb_CppunitTest__filter_not_built_components,$(2)),$(call gb_CppunitTest_add_component,$(1),$(component))) endef diff --git a/solenv/gbuild/CustomTarget.mk b/solenv/gbuild/CustomTarget.mk index 84c6f11cb206..c2456c0f5278 100644 --- a/solenv/gbuild/CustomTarget.mk +++ b/solenv/gbuild/CustomTarget.mk @@ -30,17 +30,21 @@ define gb_CustomTarget__command +$(call gb_Helper_abbreviate_dirs,\ mkdir -p $(call gb_CustomTarget_get_workdir,$(2)) && \ - O='$(OUTDIR)' R='$(REPODIR)' S='$(SRCDIR)' W='$(WORKDIR)' gb_AWK='$(gb_AWK)' \ - gb_SourceEnvAndRecurse_STAGE=gbuild \ + O='$(OUTDIR)' S='$(SRCDIR)' W='$(WORKDIR)' gb_AWK='$(gb_AWK)' \ gb_XSLTPROC='$(gb_XSLTPROC)' GBUILDDIR='$(GBUILDDIR)' SRCDIR='$(SRCDIR)' \ $(MAKE) -C $(call gb_CustomTarget_get_workdir,$(2)) -f $< && \ touch $(1)) endef +# the .dir is for make 3.81, which ignores trailing / +$(call gb_CustomTarget_get_workdir,%)/.dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + $(call gb_CustomTarget_get_target,%) : $(call gb_Output_announce,$*,$(true),MAK,3) - $(call gb_CustomTarget__command,$@,$*) + $(if $(NEW_STYLE),touch $@,\ + $(call gb_CustomTarget__command,$@,$*)) .PHONY: $(call gb_CustomTarget_get_clean_target,%) $(call gb_CustomTarget_get_clean_target,%) : @@ -54,8 +58,13 @@ $(SRCDIR)/$(1)/Makefile endef define gb_CustomTarget_CustomTarget +$(call gb_CustomTarget_get_target,$(1)) : NEW_STYLE := $(2) +ifeq ($(2),) $(call gb_CustomTarget_get_target,$(1)) : \ $(call gb_CustomTarget__get_makefile,$(1)) +else +$$(eval $$(call gb_Module_register_target,$(call gb_CustomTarget_get_target,$(1)),$(call gb_CustomTarget_get_clean_target,$(1)))) +endif endef diff --git a/solenv/gbuild/Deliver.mk b/solenv/gbuild/Deliver.mk index 1387892312c2..79e40414b516 100644 --- a/solenv/gbuild/Deliver.mk +++ b/solenv/gbuild/Deliver.mk @@ -40,7 +40,7 @@ gb_Deliver_DELIVERABLES_INDEX := endef define gb_Deliver_register_deliverable -gb_Deliver_DELIVERABLES_$(notdir $(3)) += $$(patsubst $(REPODIR)/%,%,$(2)):$$(patsubst $(REPODIR)/%,%,$(1)) +gb_Deliver_DELIVERABLES_$(notdir $(3)) += $(2):$(1) gb_Deliver_DELIVERABLES_INDEX := $(sort $(gb_Deliver_DELIVERABLES_INDEX) $(notdir $(3))) $(if $(gb_LOWRESTIME),.LOW_RESOLUTION_TIME : $(1),) @@ -49,18 +49,18 @@ endef define gb_Deliver_add_deliverable $$(if $(3),,$$(error - missing third parameter for deliverable $(1))) ifeq ($(MAKECMDGOALS),showdeliverables) -$(call gb_Deliver_register_deliverable,$(OUTDIR)/$(1),$(2),$(3)) +$(call gb_Deliver_register_deliverable,$(1),$(2),$(3)) endif endef ifeq ($(strip $(gb_Deliver_GNUCOPY)),) define gb_Deliver__deliver -mkdir -p $(dir $(2)) && $(if $(gb_Deliver_CLEARONDELIVER),rm -f $(2) &&) $(if $(gb_Deliver_HARDLINK),ln,cp -P -f) $(1) $(2) && touch -r $(1) $(2) +$(if $(gb_Deliver_CLEARONDELIVER),rm -f $(2) &&) $(if $(gb_Deliver_HARDLINK),ln,cp -P -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) $(if $(gb_Deliver_HARDLINK),--link) --no-dereference --force --preserve=timestamps $(1) $(2) +$(gb_Deliver_GNUCOPY) $(if $(gb_Deliver_CLEARONDELIVER),--remove-destination) $(if $(gb_Deliver_HARDLINK),--link) --no-dereference --force --preserve=timestamps $(1) $(2) endef endif @@ -71,13 +71,13 @@ $(if $(1),$(call gb_Deliver__deliver,$(1),$(2)),\ endef define gb_Deliver_print_deliverable -$(info $(1) $(patsubst $(OUTDIR)/%,%,$(2))) +$(info $(1) $(2)) endef showdeliverables : $(eval MAKEFLAGS := s) $(foreach deliverable,$(sort $(foreach list,$(gb_Deliver_DELIVERABLES_INDEX),$(gb_Deliver_DELIVERABLES_$(list)))),\ - $(call gb_Deliver_print_deliverable,$(REPODIR)/$(firstword $(subst :, ,$(deliverable))),$(REPODIR)/$(lastword $(subst :, ,$(deliverable))))) + $(call gb_Deliver_print_deliverable,$(firstword $(subst :, ,$(deliverable))),$(lastword $(subst :, ,$(deliverable))))) true # vim: set noet sw=4: diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk index 2c5d9ea7791b..8a7fc2601f83 100644 --- a/solenv/gbuild/Executable.mk +++ b/solenv/gbuild/Executable.mk @@ -55,7 +55,8 @@ define gb_Executable__Executable_impl $(call gb_Executable_set_targettype_gui,$(2)) $(call gb_LinkTarget_LinkTarget,$(2)) $(call gb_LinkTarget_set_targettype,$(2),Executable) -$(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) +$(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \ + | $(dir $(call gb_Executable_get_target,$(1))).dir $(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)))) @@ -108,9 +109,11 @@ $(eval $(foreach method,\ add_linked_static_libs \ use_external \ use_externals \ + add_custom_headers \ add_package_headers \ add_sdi_headers \ add_nativeres \ + set_warnings_not_errors \ ,\ $(call gb_Executable_forward_to_Linktarget,$(method))\ )) diff --git a/solenv/gbuild/Extension.mk b/solenv/gbuild/Extension.mk index 5ee8a97450af..80112272f752 100644 --- a/solenv/gbuild/Extension.mk +++ b/solenv/gbuild/Extension.mk @@ -42,10 +42,20 @@ gb_Extension_PROPMERGECOMMAND := \ gb_Extension_HELPEXTARGET := $(call gb_Executable_get_target,helpex) gb_Extension_HELPEXCOMMAND := \ $(gb_Helper_set_ld_path) $(gb_Extension_HELPEXTARGET) -gb_Extension_SDFLOCATION := $(L10N_MODULE)/$(INPATH)/misc/sdf/ # does not contain en-US because it is special cased in gb_Extension_Extension gb_Extension_LANGS := $(filter-out en-US,$(gb_WITH_LANG)) +# Substitute platform or copy if no platform has been set +define gb_Extension__subst_platform +$(if $(PLATFORM),\ + sed \ + -e 's/@PLATFORM@/$(PLATFORM)/' \ + -e 's/@EXEC_EXTENSION@/$(gb_Executable_EXT)/' \ + -e 's/@SHARED_EXTENSION@/$(gb_Library_DLLEXT)/' \ + $(1) > $(2),\ + cp -f $(1) $(2)) +endef + # remove extension directory in workdir and oxt file in workdir and outdir $(call gb_Extension_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),OXT,3) @@ -61,28 +71,16 @@ $(call gb_Extension_get_workdir,%)/description.xml : mkdir -p $(call gb_Extension_get_workdir,$*) && \ cp -f $(LOCATION)/description.xml $@) else -$(call gb_Extension_get_workdir,%)/description.xml : | \ - $(gb_Extension_XRMEXTARGET) +$(call gb_Extension_get_workdir,%)/description.xml : $(gb_Extension_XRMEXTARGET) $(call gb_Output_announce,$*/description.xml,$(true),XRM,3) -ifeq ($(OS_FOR_BUILD),WNT) $(call gb_Helper_abbreviate_dirs_native,\ mkdir -p $(call gb_Extension_get_workdir,$*) && \ $(gb_Extension_XRMEXCOMMAND) \ -p $(PRJNAME) \ - -i $(shell cygpath -m $(filter %.xml,$^)) \ - -o $(shell cygpath -m $@) \ + -i $(call gb_Helper_native_path,$(filter %.xml,$^)) \ + -o $(call gb_Helper_native_path,$@) \ -m $(SDF) \ -l all) -else - $(call gb_Helper_abbreviate_dirs_native,\ - mkdir -p $(call gb_Extension_get_workdir,$*) && \ - $(gb_Extension_XRMEXCOMMAND) \ - -p $(PRJNAME) \ - -i $(filter %.xml,$^) \ - -o $@ \ - -m $(SDF) \ - -l all) -endif endif # rule to create oxt package in workdir @@ -91,11 +89,12 @@ $(call gb_Extension_get_target,%) : \ $(call gb_Extension_get_workdir,%)/description.xml $(call gb_Output_announce,$*,$(true),OXT,3) $(call gb_Helper_abbreviate_dirs_native,\ - mkdir -p $(call gb_Extension_get_workdir,$*)/META-INF \ - $(call gb_Extension_get_workdir,$*)/registration && \ - cp -f $(LOCATION)/manifest.xml $(call gb_Extension_get_workdir,$*)/META-INF && \ - cp -f $(OUTDIR)/bin/osl/$(gb_Extension_LICENSEFILE) $(call gb_Extension_get_workdir,$*)/registration && \ - cd $(call gb_Extension_get_workdir,$*) && \ + mkdir -p $(call gb_Extension_get_rootdir,$*)/META-INF \ + $(call gb_Extension_get_rootdir,$*)/registration && \ + $(call gb_Extension__subst_platform,$(call gb_Extension_get_workdir,$*)/description.xml,$(call gb_Extension_get_rootdir,$*)/description.xml) && \ + $(call gb_Extension__subst_platform,$(LOCATION)/manifest.xml,$(call gb_Extension_get_rootdir,$*)/META-INF/manifest.xml) && \ + cp -f $(OUTDIR)/bin/osl/$(gb_Extension_LICENSEFILE) $(call gb_Extension_get_rootdir,$*)/registration && \ + cd $(call gb_Extension_get_rootdir,$*) && \ $(gb_Extension_ZIPCOMMAND) -rX --filesync \ $(call gb_Extension_get_target,$*) \ $(FILES) \ @@ -111,10 +110,11 @@ $(call gb_Extension_get_target,%) : \ define gb_Extension_Extension $(call gb_Extension_get_target,$(1)) : FILES := META-INF description.xml registration $(call gb_Extension_get_target,$(1)) : LOCATION := $(SRCDIR)/$(2) +$(call gb_Extension_get_target,$(1)) : PLATFORM := $(call gb_Extension_get_target,$(1)) : PRJNAME := $(firstword $(subst /, ,$(2))) $(call gb_Extension_get_workdir,$(1))/description.xml : $(SRCDIR)/$(2)/description.xml ifneq ($(strip $(gb_WITH_LANG)),) -$(call gb_Extension_get_target,$(1)) : SDF := $(gb_Extension_SDFLOCATION)$(2)/localize.sdf +$(call gb_Extension_get_target,$(1)) : SDF := $(gb_SDFLOCATION)/$(2)/localize.sdf $(call gb_Extension_get_workdir,$(1))/description.xml : $$(SDF) endif $(call gb_Extension_add_file,$(1),description-en-US.txt,$(SRCDIR)/$(2)/description-en-US.txt) @@ -124,34 +124,51 @@ $(call gb_Extension_get_outdir_target,$(1)) : $(call gb_Extension_get_target,$(1 endef +# Set platform. +# +# Only use this if the extension is platform-dependent. +define gb_Extension_set_platform +$(call gb_Extension_get_target,$(1)) : PLATFORM := $(2) + +endef + # adding a file creates a dependency to it # file is copied to $(WORKDIR) define gb_Extension_add_file $(call gb_Extension_get_target,$(1)) : FILES += $(2) -$(call gb_Extension_get_target,$(1)) : $(call gb_Extension_get_workdir,$(1))/$(2) -$(call gb_Extension_get_workdir,$(1))/$(2) : $(3) - mkdir -p $$(dir $$@) +$(call gb_Extension_get_target,$(1)) : $(call gb_Extension_get_rootdir,$(1))/$(2) +$(call gb_Extension_get_rootdir,$(1))/$(2) : $(3) + mkdir -p $$(dir $$@) && \ cp -f $$< $$@ endef +# Add several files at once +# +# This function avoids the need to specify each file's name twice. The +# files are added directly under specified path in the extension, +# without any subpath. If no path is specified, they are added directly +# to the root dir of the extension. +define gb_Extension_add_files +$(foreach file,$(3),$(call gb_Extension_add_file,$(1),$(if $(strip $(2)),$(strip $(2))/)$(notdir $(file)),$(file))) + +endef + # localize .properties file # source file is copied to $(WORKDIR) define gb_Extension_localize_properties $(call gb_Extension_get_target,$(1)) : FILES += $(2) ifneq ($(strip $(gb_WITH_LANG)),) $(call gb_Extension_get_target,$(1)) : FILES += $(foreach lang,$(subst -,_,$(gb_Extension_LANGS)),$(subst en_US,$(lang),$(2))) -$(call gb_Extension_get_target,$(1)) : SDF2 := $(gb_Extension_SDFLOCATION)$(subst $(SRCDIR),,$(dir $(3)))localize.sdf -$(call gb_Extension_get_target,$(1)) : $$(SDF2) +$(call gb_Extension_get_rootdir,$(1))/$(2) : SDF := $(gb_SDFLOCATION)$(subst $(SRCDIR),,$(dir $(3)))localize.sdf +$(call gb_Extension_get_rootdir,$(1))/$(2) : $$(SDF) endif -$(call gb_Extension_get_target,$(1)) : $(call gb_Extension_get_workdir,$(1))/$(2) -$(call gb_Extension_get_workdir,$(1))/$(2) : $(3) +$(call gb_Extension_get_target,$(1)) : $(call gb_Extension_get_rootdir,$(1))/$(2) +$(call gb_Extension_get_rootdir,$(1))/$(2) : $(3) $$(call gb_Output_announce,$(2),$(true),PRP,3) - mkdir -p $$(dir $$@) - cp -f $$< $$@ -ifneq ($(strip $(gb_WITH_LANG)),) - $(gb_Extension_PROPMERGECOMMAND) -i $$@ -m $$(SDF2) -endif + mkdir -p $$(dir $$@) && \ + cp -f $$< $$@ \ + $(if $(strip $(gb_WITH_LANG)),&& $(gb_Extension_PROPMERGECOMMAND) -i $$@ -m $$(SDF)) endef @@ -159,23 +176,30 @@ endef define gb_Extension_localize_help ifneq ($(strip $(gb_WITH_LANG)),) $(call gb_Extension_get_target,$(1)) : FILES += $(foreach lang,$(gb_Extension_LANGS),$(subst lang,$(lang),$(2))) -$(call gb_Extension_get_target,$(1)) : SDF3 := $(gb_Extension_SDFLOCATION)$(subst $(SRCDIR),,$(dir $(3)))localize.sdf -$(call gb_Extension_get_target,$(1)) : $$(SDF3) $(foreach lang,$(gb_Extension_LANGS),$(call gb_Extension_localize_help_onelang,$(1),$(subst lang,$(lang),$(2)),$(3),$(lang))) endif endef define gb_Extension_localize_help_onelang -$(call gb_Extension_get_target,$(1)) : $(call gb_Extension_get_workdir,$(1))/$(2) -$(call gb_Extension_get_workdir,$(1))/$(2) : $(3) - $(call gb_Output_announce,$(2),$(true),XHP,3) - mkdir -p $$(dir $$@) -ifeq ($(OS_FOR_BUILD),WNT) - $(gb_Extension_HELPEXCOMMAND) -i $$(shell cygpath -m $$<) -o $$(shell cygpath -m $$@) -l $(4) -m $$(SDF3) -else - $(gb_Extension_HELPEXCOMMAND) -i $$< -o $$@ -l $(4) -m $$(SDF3) -endif +$(call gb_Extension_get_target,$(1)) : $(call gb_Extension_get_rootdir,$(1))/$(2) +$(call gb_Extension_get_rootdir,$(1))/$(2) : SDF := $(gb_SDFLOCATION)$(subst $(SRCDIR),,$(subst $(WORKDIR)/CustomTarget,,$(dir $(3))))localize.sdf +$(call gb_Extension_get_rootdir,$(1))/$(2) : $$(SDF) +$(call gb_Extension_get_rootdir,$(1))/$(2) : $(gb_Extension_HELPEXTARGET) +$(call gb_Extension_get_rootdir,$(1))/$(2) : $(3) + $$(call gb_Output_announce,$(2),$(true),XHP,3) + mkdir -p $$(dir $$@) && \ + $(gb_Extension_HELPEXCOMMAND) -i $$(call gb_Helper_native_path,$$<) -o $$(call gb_Helper_native_path,$$@) -l $(4) -m $$(SDF) + +endef + +define gb_Extension_add_package_dependency +$(call gb_Extension_get_target,$(1)) : $(call gb_Package_get_target,$(2)) + +endef + +define gb_Extension_add_package_dependencies +$(foreach package,$(2),$(call gb_Extension_add_package_dependency,$(1),$(package))) endef diff --git a/solenv/gbuild/ExternalLib.mk b/solenv/gbuild/ExternalLib.mk index 4fe079361c22..cb8eb017659b 100644 --- a/solenv/gbuild/ExternalLib.mk +++ b/solenv/gbuild/ExternalLib.mk @@ -99,7 +99,7 @@ endef define gb_ExternalLib__command_autotools rm -fr $(call gb_ExternalLib_get_workdir,$(1)) && \ mkdir -p $(call gb_ExternalLib_get_builddir,$(1)) && \ - $(GNUTAR) -x -C $(call gb_ExternalLib_get_builddir,$(1)) --strip-component=1 -f $< && \ + $(GNUTAR) -x -C $(call gb_ExternalLib_get_builddir,$(1)) --strip-components=1 -f $< && \ cd $(call gb_ExternalLib_get_builddir,$(1)) && for p in $(T_PATCHES) ; do patch -p 1 < $(SRCDIR)/$$p || exit 1; done && \ CC="$(gb_CC)" CXX="$(gb_CXX)" CFLAGS="$(T_CFLAGS)" CXXFLAGS="$(T_CXXFLAGS)" PKG_CONFIG_PATH="$(PKG_CONFIG_PATH) $(OUTDIR)/lib/pkgconfig" ./configure $(if $(findstring YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) --prefix=$(OUTDIR) $(T_CONF_ARGS) && \ for p in $(T_POST_PATCHES) ; do patch -p 1 < $(SRCDIR)/$p || exit 1; done diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk index 965542418f44..10dac0b6ddf8 100644 --- a/solenv/gbuild/Helper.mk +++ b/solenv/gbuild/Helper.mk @@ -30,10 +30,10 @@ gb_Helper_NULLFILE := /dev/null gb_Helper_MISC := $(WORKDIR)/Misc -# general propose phony target +# general purpose phony target gb_Helper_PHONY := $(gb_Helper_MISC)/PHONY -# general propose empty dummy target +# general purpose empty dummy target gb_Helper_MISCDUMMY := $(gb_Helper_MISC)/DUMMY .PHONY : $(WORKDIR)/Misc/PHONY @@ -41,10 +41,9 @@ $(gb_Helper_MISCDUMMY) : @mkdir -p $(dir $@) && touch $@ define gb_Helper_abbreviate_dirs -R=$(REPODIR) && \ -$(subst $(REPODIR)/,$$R/,S=$(SRCDIR) && \ +S=$(SRCDIR) && \ $(subst $(SRCDIR)/,$$S/,O=$(OUTDIR)) && \ -$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,W=$(WORKDIR) && $(subst $(WORKDIR)/,$$W/,$(1))))) +$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,W=$(WORKDIR) && $(subst $(WORKDIR)/,$$W/,$(1)))) endef define gb_Helper_abbreviate_dirs_native diff --git a/solenv/gbuild/InternalUnoApi.mk b/solenv/gbuild/InternalUnoApi.mk index 1011d9c4bdbe..163e7a064090 100644 --- a/solenv/gbuild/InternalUnoApi.mk +++ b/solenv/gbuild/InternalUnoApi.mk @@ -47,6 +47,7 @@ $(call gb_UnoApiTarget_set_root,$(1)_out,/) $(call gb_UnoApiTarget_set_root,$(1),UCR) $(call gb_UnoApiTarget_merge_rdbfile,$(1),$(1)_out) +$(call gb_InternalUnoApi_get_target,$(1)) :| $(dir $(call gb_InternalUnoApi_get_target,$(1))).dir $(call gb_InternalUnoApi_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)_out) $(call gb_InternalUnoApi_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_clean_target,$(1)_out) $(call gb_InternalUnoApi_get_clean_target,$(1)) : $(call gb_UnoApiHeadersTarget_get_clean_target,$(1)) diff --git a/solenv/gbuild/Jar.mk b/solenv/gbuild/Jar.mk index f1fe1444c8f4..d07467e2c698 100644 --- a/solenv/gbuild/Jar.mk +++ b/solenv/gbuild/Jar.mk @@ -59,13 +59,13 @@ define gb_Jar__command $(call gb_Helper_abbreviate_dirs_native,\ mkdir -p $(call gb_Jar_get_workdir,$(1))/META-INF && \ echo Manifest-Version: 1.0 > $(call gb_Jar_get_manifest_target,$(1)) && \ - echo "Class-Path: $(JARCLASSPATH)" >> $(call gb_Jar_get_manifest_target,$(1)) && \ + $(if $(JARCLASSPATH),echo "Class-Path: $(strip $(JARCLASSPATH))" >> $(call gb_Jar_get_manifest_target,$(1)) &&) \ echo "Solar-Version: $(RSCREVISION)" >> $(call gb_Jar_get_manifest_target,$(1)) && \ cat $(if $(MANIFEST),$(MANIFEST),$(gb_Helper_MISCDUMMY)) >> $(call gb_Jar_get_manifest_target,$(1)) && \ mkdir -p $(dir $(2)) && cd $(call gb_Jar_get_workdir,$(1)) && \ $(gb_Jar_JARCOMMAND) cfm $(2) $(call gb_Jar_get_manifest_target,$(1)) \ META-INF $(PACKAGEROOTS) $(PACKAGEFILES) \ - $(foreach root,$(PACKAGEDIRS),&& $(gb_Jar_JARCOMMAND) uf $(2) -C $(dir $(root)) $(notdir $(root))) \ + $(foreach root,$(PACKAGEDIRS),&& cd $(dir $(root)) && $(gb_Jar_JARCOMMAND) uf $(2) $(notdir $(root))) \ || (rm $(2); false) ) endef @@ -201,6 +201,16 @@ $(call gb_JavaClassSet_use_externals,$(call gb_Jar_get_classsetname,$(1)),$(2)) endef +define gb_Jar_add_package_dependency +$(call gb_JavaClassSet_add_package_dependency,$(call gb_Jar_get_classsetname,$(1)),$(2)) + +endef + +define gb_Jar_add_package_dependencies +$(call gb_JavaClassSet_add_package_dependencies,$(call gb_Jar_get_classsetname,$(1)),$(2)) + +endef + # possible directories for jar files containing UNO services gb_Jar_COMPONENTPREFIXES := \ OOO:vnd.sun.star.expand:\dLO_JAVA_DIR/ \ @@ -222,5 +232,4 @@ $(call gb_Jar_get_clean_target,$(1)) : $(call gb_ComponentTarget_get_clean_targe endef - # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/JavaClassSet.mk b/solenv/gbuild/JavaClassSet.mk index 6fd19fe7194c..8f48f5a6c8fc 100644 --- a/solenv/gbuild/JavaClassSet.mk +++ b/solenv/gbuild/JavaClassSet.mk @@ -29,6 +29,10 @@ gb_JavaClassSet_JAVACCOMMAND := $(JAVACOMPILER) $(JAVAFLAGS) gb_JavaClassSet_JAVACDEBUG := +# Enforces correct dependency order for possibly generated stuff: +# generated sources, jars/classdirs etc. +gb_JavaClassSet_get_preparation_target = $(WORKDIR)/JavaClassSet/$(1)/prepared + ifneq ($(gb_DEBUGLEVEL),0) gb_JavaClassSet_JAVACDEBUG := -g endif @@ -36,17 +40,16 @@ endif define gb_JavaClassSet__command $(call gb_Helper_abbreviate_dirs_native,\ mkdir -p $(dir $(1)) && \ - RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,\ - $(call gb_Helper_convert_native,\ - $(if $(filter-out $(JARDEPS),$(3)),\ - $(filter-out $(JARDEPS),$(3)),\ - $(filter-out $(JARDEPS),$(4))))) && \ - $(if $(3),$(gb_JavaClassSet_JAVACCOMMAND) \ - $(gb_JavaClassSet_JAVACDEBUG) \ - -cp "$(T_CP)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(2))" \ - -d $(call gb_JavaClassSet_get_classdir,$(2)) \ - @$$RESPONSEFILE &&) \ - rm -f $$RESPONSEFILE && \ + $(if $(filter-out $(JARDEPS),$(4)), \ + RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,\ + $(call gb_Helper_convert_native,\ + $(filter-out $(JARDEPS),$(4)))) && \ + $(if $(3),$(gb_JavaClassSet_JAVACCOMMAND) \ + $(gb_JavaClassSet_JAVACDEBUG) \ + -cp "$(T_CP)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(2))" \ + -d $(call gb_JavaClassSet_get_classdir,$(2)) \ + @$$RESPONSEFILE &&) \ + rm -f $$RESPONSEFILE &&) \ touch $(1)) endef @@ -60,8 +63,12 @@ $(call gb_JavaClassSet_get_clean_target,%) : $(call gb_Helper_abbreviate_dirs,\ rm -rf $(dir $(call gb_JavaClassSet_get_target,$*))) +$(call gb_JavaClassSet_get_preparation_target,%) : + mkdir -p $(dir $@) && touch $@ + define gb_JavaClassSet_JavaClassSet -$(call gb_JavaClassSet_get_target,$(1)) : JARDEPS := +$(call gb_JavaClassSet_get_target,$(1)) : $(call gb_JavaClassSet_get_preparation_target,$(1)) +$(call gb_JavaClassSet_get_target,$(1)) : JARDEPS := $(call gb_JavaClassSet_get_preparation_target,$(1)) endef @@ -85,7 +92,7 @@ endef define gb_JavaClassSet_add_generated_sourcefile $(call gb_JavaClassSet_get_target,$(1)) : $(call gb_JavaClassSet__get_generated_sourcefile,$(2)) -$(call gb_JavaClassSet__get_generated_sourcefile,$(2)) : $(gb_Helper_PHONY) +$(call gb_JavaClassSet__get_generated_sourcefile,$(2)) :| $(call gb_JavaClassSet_get_preparation_target,$(1)) endef @@ -103,15 +110,15 @@ endef # build order dependency is a hack to get these prerequisites out of the way in the build command define gb_JavaClassSet_add_jar $(call gb_JavaClassSet_get_target,$(1)) : $(2) -$(call gb_JavaClassSet_get_target,$(1)) : T_CP := $$(T_CP)$(gb_CLASSPATHSEP)$(strip $(2)) $(call gb_JavaClassSet_get_target,$(1)) : JARDEPS += $(2) +$(call gb_JavaClassSet_get_target,$(1)) : T_CP := $$(if $$(T_CP),$$(T_CP)$(gb_CLASSPATHSEP))$(strip $(2)) +$(2) :| $(gb_Helper_PHONY) endef # this does not generate dependency on the jar define gb_JavaClassSet_add_system_jar -$(call gb_JavaClassSet_get_target,$(1)) : T_CP := $$(T_CP)$(gb_CLASSPATHSEP)$(strip $(2)) -$(call gb_JavaClassSet_get_target,$(1)) : JARDEPS += $(2) +$(call gb_JavaClassSet_get_target,$(1)) : T_CP := $$(if $$(T_CP),$$(T_CP)$(gb_CLASSPATHSEP))$(strip $(2)) endef @@ -125,6 +132,19 @@ $(foreach jar,$(2),$(call gb_JavaClassSet_add_system_jar,$(1),$(jar))) endef +# gb_JavaClassSet_add_jar_classset: Like gb_JavaClassSet_add_jar, but instead of +# using the jar, use the directory tree with the class files that make up the +# jar. This is sometimes necessary in JunitTests that have test classes in +# packages that belong to a sealed jar. +# $1: token identifying this JavaClassSet +# $2: token identifying the Jar being used +define gb_JavaClassSet_add_jar_classset +$(call gb_JavaClassSet_get_target,$(1)) : $(call gb_JavaClassSet_get_target,$(call gb_Jar_get_classsetname,$(2))) +$(call gb_JavaClassSet_get_target,$(1)) : JARDEPS += $(call gb_JavaClassSet_get_target,$(call gb_Jar_get_classsetname,$(2))) +$(call gb_JavaClassSet_get_target,$(1)) : T_CP := $$(if $$(T_CP),$$(T_CP)$(gb_CLASSPATHSEP))$(call gb_JavaClassSet_get_classdir,$(call gb_Jar_get_classsetname,$(2))) + +endef + # this forwards to functions that must be defined in RepositoryExternal.mk. # $(eval $(call gb_LinkTarget_use_external,library,external)) define gb_JavaClassSet_use_external @@ -139,4 +159,15 @@ $(foreach external,$(2),$(call gb_JavaClassSet_use_external,$(1),$(external))) endef +define gb_JavaClassSet_add_package_dependency +$(call gb_JavaClassSet_get_preparation_target,$(1)) : \ + $(call gb_Package_get_target,$(2)) + +endef + +define gb_JavaClassSet_add_package_dependencies +$(foreach dependency,$(2),$(call gb_JavaClassSet_add_package_dependency,$(1),$(dependency))) + +endef + # vim: set noet sw=4: diff --git a/solenv/gbuild/JunitTest.mk b/solenv/gbuild/JunitTest.mk index 177cad6f7e2b..19b5e09c85ea 100644 --- a/solenv/gbuild/JunitTest.mk +++ b/solenv/gbuild/JunitTest.mk @@ -52,7 +52,6 @@ $(call gb_JunitTest_get_target,%) : org.junit.runner.JUnitCore \ $(CLASSES) > $@.log 2>&1 || \ (grep -v -e 'at org.junit.' \ - -e 'at com.sun.star.lib.uno.' \ -e 'at java.lang.reflect.' \ -e 'at sun.reflect.' $@.log \ && echo "see full error log at $@.log" \ @@ -69,11 +68,12 @@ $(call gb_JunitTest_get_target,%) : $(CLEAN_CMD) define gb_JunitTest_JunitTest -$(call gb_JunitTest_get_target,$(1)) : T_CP := $(value XCLASSPATH)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(call gb_JunitTest_get_classsetname,$(1)))$(gb_CLASSPATHSEP)$(OOO_JUNIT_JAR)$(gb_CLASSPATHSEP)$(OUTDIR)/lib +$(call gb_JunitTest_get_target,$(1)) : T_CP := $(if $(value XCLASSPATH),$(value XCLASSPATH)$(gb_CLASSPATHSEP))$(call gb_JavaClassSet_get_classdir,$(call gb_JunitTest_get_classsetname,$(1)))$(gb_CLASSPATHSEP)$(OOO_JUNIT_JAR)$(gb_CLASSPATHSEP)$(OUTDIR)/lib $(call gb_JunitTest_get_target,$(1)) : CLASSES := $(call gb_JunitTest_JunitTest_platform,$(1)) $(call gb_JavaClassSet_JavaClassSet,$(call gb_JunitTest_get_classsetname,$(1))) +$(call gb_JavaClassSet_add_system_jar,$(call gb_JunitTest_get_classsetname,$(1)),$(OOO_JUNIT_JAR)) $(call gb_JunitTest_get_target,$(1)) : $(call gb_JavaClassSet_get_target,$(call gb_JunitTest_get_classsetname,$(1))) $(eval $(call gb_Module_register_target,$(call gb_JunitTest_get_target,$(1)),$(call gb_JunitTest_get_clean_target,$(1)))) endef @@ -104,14 +104,11 @@ $(foreach sourcefile,$(2),$(call gb_JunitTest_add_sourcefile,$(1),$(sourcefile)) endef -define gb_JunitTest_set_classpath -$(call gb_JunitTest_get_target,$(1)) : T_CP := $(2) - -endef - define gb_JunitTest_add_jar +$(call gb_JavaClassSet_add_jar,$(call gb_JunitTest_get_classsetname,$(1)),$(2)) $(call gb_JunitTest_get_target,$(1)) : T_CP := $$(T_CP)$(gb_CLASSPATHSEP)$(2) $(call gb_JunitTest_get_target,$(1)) : $(2) +$(2) :| $(gb_Helper_PHONY) endef @@ -120,6 +117,23 @@ $(foreach jar,$(2),$(call gb_JunitTest_add_jar,$(1),$(jar))) endef +# see gb_JavaClassSet_add_jar_classset +define gb_JunitTest_add_jar_classset +$(call gb_JavaClassSet_add_jar_classset,$(call gb_JunitTest_get_classsetname,$(1)),$(2)) +$(call gb_JunitTest_get_target,$(1)) : T_CP := $$(T_CP)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(call gb_Jar_get_classsetname,$(2))) + +endef + +define gb_JunitTest_add_package_dependency +$(call gb_JavaClassSet_add_package_dependency,$(call gb_JunitTest_get_classsetname,$(1)),$(2)) + +endef + +define gb_JunitTest_add_package_dependencies +$(call gb_JavaClassSet_add_package_dependencies,$(call gb_JunitTest_get_classsetname,$(1)),$(2)) + +endef + else # OOO_JUNIT_JAR .PHONY : $(call gb_JunitTest_get_target,$(1)) @@ -136,9 +150,10 @@ gb_JunitTest_add_classes := gb_JunitTest_add_class := gb_JunitTest_add_sourcefile := gb_JunitTest_add_sourcefiles := -gb_JunitTest_set_classpath := gb_JunitTest_add_jar := gb_JunitTest_add_jars := +gb_JunitTest_add_package_dependency := +gb_JunitTest_add_package_dependencies := endif # OOO_JUNIT_JAR # vim: set noet sw=4: diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk index 8cc71b56562d..358a8e6aa6f8 100644 --- a/solenv/gbuild/Library.mk +++ b/solenv/gbuild/Library.mk @@ -105,15 +105,19 @@ endef # But the component target also must be delivered, so a new phony target # gb_Library__get_final_target has been invented for that purpose... define gb_Library_set_componentfile -$(call gb_ComponentTarget_ComponentTarget,$(2),$(call gb_Library__get_componentprefix,$(1)),\ - $(call gb_Library_get_runtime_filename,$(if $(filter $(1),$(gb_MERGEDLIBS)),merged,$(1)))) -$(call gb_Library__get_final_target,$(1)) : \ +$(call gb_ComponentTarget_ComponentTarget,$(2),\ + $(call gb_Library__get_componentprefix,$(gb_Library__get_name)),\ + $(call gb_Library_get_runtime_filename,$(gb_Library__get_name))) +$(call gb_Library__get_final_target,$(gb_Library__get_name)) : \ $(call gb_ComponentTarget_get_outdir_target,$(2)) -$(call gb_ComponentTarget_get_target,$(2)) :| $(call gb_Library_get_target,$(1)) -$(call gb_Library_get_clean_target,$(1)) : \ +$(call gb_ComponentTarget_get_target,$(2)) :| \ + $(call gb_Library_get_target,$(gb_Library__get_name)) +$(call gb_Library_get_clean_target,$(gb_Library__get_name)) : \ $(call gb_ComponentTarget_get_clean_target,$(2)) endef +gb_Library__get_name = $(if $(filter $(1),$(gb_MERGEDLIBS)),merged,$(1)) + gb_Library__get_componentprefix = \ $(call gb_Library__get_layer_componentprefix,$(call \ gb_Library_get_layer,$(1))) @@ -123,6 +127,11 @@ gb_Library__get_layer_componentprefix = \ $(filter $(1):%,$(gb_Library__COMPONENTPREFIXES)), \ $(call gb_Output_error,no ComponentTarget native prefix for layer '$(1)'))) +# The \d gets turned into a dollar sign by a $(subst) call in +# gb_ComponentTarget__command in ComponentTarget.mk. As far as I +# understand, there is nothing magic to it, it is not some +# Make/awk/sed/whatever syntax. + gb_Library__COMPONENTPREFIXES := \ NONE:vnd.sun.star.expand:\dLO_LIB_DIR/ \ OOO:vnd.sun.star.expand:\dLO_LIB_DIR/ \ @@ -179,11 +188,13 @@ $(eval $(foreach method,\ add_linked_static_libs \ use_external \ use_externals \ + add_custom_headers \ add_external_headers \ add_package_headers \ add_sdi_headers \ export_objects_list \ add_nativeres \ + set_warnings_not_errors \ ,\ $(call gb_Library__forward_to_Linktarget,$(method))\ )) diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index ec141c0ced77..197e31535024 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -38,8 +38,8 @@ # CFLAGS from environment override debug/optimization flags ifeq ($(gb_DEBUGLEVEL),2) CFLAGS ?= $(gb_COMPILEROPTFLAGS) $(gb_DEBUG_CFLAGS) -CXXFLAGS ?= $(gb_COMPILEROPTFLAGS) $(gb_DEBUG_CFLAGS) -OBJCXXFLAGS ?= $(gb_COMPILEROPTFLAGS) $(gb_DEBUG_CFLAGS) +CXXFLAGS ?= $(gb_COMPILEROPTFLAGS) $(gb_DEBUG_CFLAGS) $(gb_DEBUG_CXXFLAGS) +OBJCXXFLAGS ?= $(gb_COMPILEROPTFLAGS) $(gb_DEBUG_CFLAGS) $(gb_DEBUG_CXXFLAGS) else CFLAGS ?= $(gb_COMPILEROPTFLAGS) CXXFLAGS ?= $(gb_COMPILEROPTFLAGS) @@ -85,7 +85,7 @@ endif # require different compiler flags define gb_Object__owner $$(if $$(OBJECTOWNER),\ - $$(call gb_Output_warn,$(1) is linked in by $$(OBJECTOWNER) $(2)))$(2) + $$(call gb_Output_error,fdo#47246: $(1) is linked in by $$(OBJECTOWNER) $(2)))$(2) endef # For every object there is a dep file (if gb_FULLDEPS is active). @@ -123,8 +123,6 @@ $(call gb_CObject_get_dep_target,%) : $(call gb_CObject_get_target,%) endif -gb_CObject_CObject = - # CxxObject class @@ -142,8 +140,6 @@ $(call gb_CxxObject_get_dep_target,%) : $(call gb_CxxObject_get_target,%) endif -gb_CxxObject_CxxObject = - # GenCObject class @@ -162,8 +158,6 @@ $(call gb_GenCObject_get_dep_target,%) : $(call gb_GenCObject_get_target,%) endif -gb_GenCObject_GenCObject = - # GenCxxObject class @@ -182,7 +176,6 @@ $(call gb_GenCxxObject_get_dep_target,%) : $(call gb_GenCxxObject_get_target,%) endif -gb_GenCxxObject_GenCxxObject = # YaccTarget class @@ -192,6 +185,8 @@ gb_GenCxxObject_GenCxxObject = # tries to use it. gb_YaccTarget_get_source = $(1)/$(2).y +# defined by platform +# gb_YaccTarget__command(grammar-file, stem-for-message, source-target, include-target) .PHONY : $(call gb_YaccTarget_get_clean_target,%) $(call gb_YaccTarget_get_clean_target,%) : @@ -210,9 +205,6 @@ endef gb_YACC := bison -# YaccTarget class -# defined by platform -# gb_YaccTarget__command(grammar-file, stem-for-message, source-target, include-target) # ObjCxxObject class # @@ -231,7 +223,6 @@ $(call gb_ObjCxxObject_get_dep_target,%) : $(call gb_ObjCxxObject_get_target,%) endif -gb_ObjCxxObject_ObjCxxObject = # ObjCObject class # @@ -240,30 +231,15 @@ gb_ObjCObject_get_source = $(1)/$(2).m # defined by platform # gb_ObjCObject__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_ObjCObject__command_dep -mkdir -p $(dir $(1)) && \ - echo '$(call gb_ObjCObject_get_target,$(2)) : $$(gb_Helper_PHONY)' > $(1) - -endef -else -gb_ObjCObject__command_dep = -endif - $(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%) - $(call gb_ObjCObject__command,$@,$*,$<,$(DEFS),$(OBJCFLAGS),$(INCLUDE_STL) $(INCLUDE)) + $(call gb_ObjCObject__command,$@,$*,$<) ifeq ($(gb_FULLDEPS),$(true)) -$(call gb_ObjCObject_get_dep_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%) - $(call gb_ObjCObject__command_dep,$@,$*,$<,$(DEFS),$(OBJCFLAGS),$(INCLUDE_STL) $(INCLUDE)) +$(call gb_ObjCObject_get_dep_target,%) : $(call gb_ObjCObject_get_target,%) + $(call gb_Object__command_dep,$@,$(call gb_ObjCObject_get_target,$*)) endif -gb_ObjCObject_ObjCObject = - - # AsmObject class @@ -281,8 +257,6 @@ $(call gb_AsmObject_get_dep_target,%) : $(call gb_AsmObject_get_target,%) endif -gb_AsmObject_AsmObject = - # LinkTarget class @@ -472,6 +446,7 @@ $(call gb_LinkTarget_get_headers_target,$(1)) \ $(call gb_LinkTarget_get_target,$(1)) : PDBFILE := $(call gb_LinkTarget_get_target,$(1)) : EXTRAOBJECTLISTS := $(call gb_LinkTarget_get_target,$(1)) : NATIVERES := +$(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS := ifeq ($(gb_FULLDEPS),$(true)) -include $(call gb_LinkTarget_get_dep_target,$(1)) @@ -494,6 +469,7 @@ $(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE_STL := $$(gb_LinkTarget_INCL $(call gb_LinkTarget_get_dep_target,$(1)) : TARGETTYPE := $(call gb_LinkTarget_get_dep_target,$(1)) : LIBRARY_X64 := $(call gb_LinkTarget_get_dep_target,$(1)) : EXTRAOBJECTLISTS := +$(call gb_LinkTarget_get_dep_target,$(1)) : WARNINGS_NOT_ERRORS := endif endef @@ -858,7 +834,9 @@ endef define gb_LinkTarget_add_linktarget_objects $(call gb_LinkTarget_get_target,$(1)) : $(foreach linktarget,$(2),$(call gb_LinkTarget_get_target,$(linktarget))) +ifneq ($(OS),IOS) $(call gb_LinkTarget_get_target,$(1)) : EXTRAOBJECTLISTS += $(foreach linktarget,$(2),$(call gb_LinkTarget_get_objects_list,$(linktarget))) +endif endef @@ -952,6 +930,17 @@ $(2) :| $(call gb_LinkTarget_get_external_headers_target,$(1)) endef +define gb_LinkTarget_add_custom_headers +$(call gb_LinkTarget_get_headers_target,$(1)) \ +$(call gb_LinkTarget_get_target,$(1)) : INCLUDE += -I$(call gb_CustomTarget_get_workdir,$(2)) +ifeq ($(gb_FULLDEPS),$(true)) +$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE += -I$(call gb_CustomTarget_get_workdir,$(2)) +endif +$(call gb_LinkTarget__add_internal_headers,$(1),$(call gb_CustomTarget_get_target,$(2))) +$(call gb_LinkTarget_get_clean_target,$(1)) : $(call gb_CustomTarget_get_clean_target,$(2)) + +endef + define gb_LinkTarget_add_package_headers $(foreach package,$(2),$(call gb_LinkTarget__add_internal_headers,$(1),$(call gb_Package_get_target,$(package)))) $(call gb_LinkTarget_get_clean_target,$(1)) : $(foreach package,$(2),$(call gb_Package_get_clean_target,$(package))) @@ -979,5 +968,12 @@ endef gb_LinkTarget_use_externals = \ $(foreach external,$(2),$(call gb_LinkTarget_use_external,$(1),$(external))) +define gb_LinkTarget_set_warnings_not_errors +$(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS := $(true) +ifeq ($(gb_FULLDEPS),$(true)) +$(call gb_LinkTarget_get_dep_target,$(1)) : WARNINGS_NOT_ERRORS := $(true) +endif + +endef # vim: set noet sw=4: diff --git a/solenv/gbuild/Module.mk b/solenv/gbuild/Module.mk index 24cc1e587f1f..15237eb2fc67 100644 --- a/solenv/gbuild/Module.mk +++ b/solenv/gbuild/Module.mk @@ -34,10 +34,12 @@ # excluding tests recursive Modules # Module/unitcheck run unit tests all unit tests # recursive Module/checks +# Module/slowcheck run all slow unit tests # Module/subsequentcheck run system tests all system tests # recursive Module/subsequentchecks # build (global) build the product top-level Module # unitcheck (global) run unit tests top-level Module/unitcheck +# slowcheck (global) run slow unit tests top-level Module/slowcheck # subsequentcheck (global) run system tests top-level Module/subsequentcheck # all (global) default goal build unitcheck @@ -48,6 +50,7 @@ gb_Module_ALLMODULES := gb_Module_MODULELOCATIONS := gb_Module_TARGETSTACK := gb_Module_CHECKTARGETSTACK := +gb_Module_SLOWCHECKTARGETSTACK := gb_Module_SUBSEQUENTCHECKTARGETSTACK := gb_Module_CLEANTARGETSTACK := @@ -56,7 +59,7 @@ $(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_check_target,$*) $(call gb_Module_get_subsequentcheck_target,$*)) + rm -f $(call gb_Module_get_target,$*) $(call gb_Module_get_check_target,$*) $(call gb_Module_get_slowcheck_target,$*) $(call gb_Module_get_subsequentcheck_target,$*)) $(call gb_Module_get_check_target,%) : $(call gb_Output_announce,$*,$(true),CHK,5) @@ -65,6 +68,13 @@ $(call gb_Module_get_check_target,%) : mkdir -p $(dir $@) && \ touch $@) +$(call gb_Module_get_slowcheck_target,%) : + $(call gb_Output_announce,$*,$(true),SLC,5) + $(call gb_Output_announce_title,module $* slowchecks done.) + -$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $@) && \ + touch $@) + $(call gb_Module_get_subsequentcheck_target,%) : $(call gb_Output_announce,$*,$(true),SCK,5) $(call gb_Output_announce_title,module $* subsequentchecks done.) @@ -79,7 +89,7 @@ $(call gb_Module_get_target,%) : mkdir -p $(dir $@) && \ touch $@) -.PHONY : build all clean unitcheck subsequentcheck dev-install +.PHONY : build all clean unitcheck slowcheck subsequentcheck dev-install .DEFAULT_GOAL := all ifeq ($(strip $(gb_PARTIALBUILD)),) @@ -134,6 +144,11 @@ unitcheck : $(call gb_Output_announce_title,all unittests checked.) $(call gb_Output_announce_bell) +slowcheck : + $(call gb_Output_announce,loaded modules: $(sort $(gb_Module_ALLMODULES)),$(true),SLC,6) + $(call gb_Output_announce_title,all slowtests checked.) + $(call gb_Output_announce_bell) + # removing the dependency on build for now until we can make a full build with gbuild #subsequentcheck : all subsequentcheck : @@ -147,7 +162,7 @@ clean : $(call gb_Output_announce_title,all cleared.) $(call gb_Output_announce_bell) -check : unitcheck +check : unitcheck slowcheck $(call gb_Output_announce_title,all tests checked.) $(call gb_Output_announce_bell) @@ -164,6 +179,7 @@ gb_Module_ALLMODULES += $(1) gb_Module_MODULELOCATIONS += $(1):$(dir $(realpath $(lastword $(MAKEFILE_LIST)))) gb_Module_TARGETSTACK := $(call gb_Module_get_target,$(1)) $(gb_Module_TARGETSTACK) gb_Module_CHECKTARGETSTACK := $(call gb_Module_get_check_target,$(1)) $(gb_Module_CHECKTARGETSTACK) +gb_Module_SLOWCHECKTARGETSTACK := $(call gb_Module_get_slowcheck_target,$(1)) $(gb_Module_SLOWCHECKTARGETSTACK) gb_Module_SUBSEQUENTCHECKTARGETSTACK := $(call gb_Module_get_subsequentcheck_target,$(1)) $(gb_Module_SUBSEQUENTCHECKTARGETSTACK) gb_Module_CLEANTARGETSTACK := $(call gb_Module_get_clean_target,$(1)) $(gb_Module_CLEANTARGETSTACK) @@ -198,18 +214,6 @@ $(call gb_Module_get_clean_target,$(1)) : $$(gb_Module_CURRENTCLEANTARGET) endef -# We don't build normal unit test dynamic libraries (CppUnit -# "plugins") for iOS, but instead statically linked unit test -# executables, so make gb_Module_add_check_target a no-op for iOS. - -# As such we could build normal "plugins", as dynamic loading of -# modules presumably does work on iOS, it is just not allowed in apps -# distributed through the App Store. Unit testing at LO development -# time obviously is not anything that would be distributed as -# apps. But let's not, as we have to make this stuff work without -# dynamic loading anyway if the App Store is an eventual target, and -# why shouldn't it be. - define gb_Module_add_check_target $(call gb_Module__read_targetfile,$(1),$(2),check target) @@ -218,6 +222,14 @@ $(call gb_Module_get_clean_target,$(1)) : $$(gb_Module_CURRENTCLEANTARGET) endef +define gb_Module_add_slowcheck_target +$(call gb_Module__read_targetfile,$(1),$(2),slowcheck target) + +$(call gb_Module_get_slowcheck_target,$(1)) : $$(gb_Module_CURRENTTARGET) +$(call gb_Module_get_clean_target,$(1)) : $$(gb_Module_CURRENTCLEANTARGET) + +endef + define gb_Module_add_subsequentcheck_target $(call gb_Module__read_targetfile,$(1),$(2),subsequentcheck target) @@ -230,10 +242,12 @@ define gb_Module_add_moduledir include $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Module_MODULELOCATIONS)))/$(2)/Module_$(2).mk $(call gb_Module_get_target,$(1)) : $$(firstword $$(gb_Module_TARGETSTACK)) $(call gb_Module_get_check_target,$(1)) : $$(firstword $$(gb_Module_CHECKTARGETSTACK)) +$(call gb_Module_get_slowcheck_target,$(1)) : $$(firstword $$(gb_Module_SLOWCHECKTARGETSTACK)) $(call gb_Module_get_subsequentcheck_target,$(1)) : $$(firstword $$(gb_Module_SUBSEQUENTCHECKTARGETSTACK)) $(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_CHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_CHECKTARGETSTACK)),$$(gb_Module_CHECKTARGETSTACK)) +gb_Module_SLOWCHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_SLOWCHECKTARGETSTACK)),$$(gb_Module_SLOWCHECKTARGETSTACK)) gb_Module_SUBSEQUENTCHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_SUBSEQUENTCHECKTARGETSTACK)),$$(gb_Module_SUBSEQUENTCHECKTARGETSTACK)) gb_Module_CLEANTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_CLEANTARGETSTACK)),$$(gb_Module_CLEANTARGETSTACK)) @@ -249,6 +263,11 @@ $(foreach target,$(2),$(call gb_Module_add_check_target,$(1),$(target))) endef +define gb_Module_add_slowcheck_targets +$(foreach target,$(2),$(call gb_Module_add_slowcheck_target,$(1),$(target))) + +endef + define gb_Module_add_subsequentcheck_targets $(foreach target,$(2),$(call gb_Module_add_subsequentcheck_target,$(1),$(target))) @@ -267,6 +286,7 @@ include $(1) build : $$(firstword $$(gb_Module_TARGETSTACK)) unitcheck : $$(firstword $$(gb_Module_CHECKTARGETSTACK)) +slowcheck : $$(firstword $$(gb_Module_SLOWCHECKTARGETSTACK)) subsequentcheck : $$(firstword $$(gb_Module_SUBSEQUENTCHECKTARGETSTACK)) clean : $$(firstword $$(gb_Module_CLEANTARGETSTACK)) @@ -276,10 +296,11 @@ endif gb_Module_TARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_TARGETSTACK)),$$(gb_Module_TARGETSTACK)) gb_Module_CHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_CHECKTARGETSTACK)),$$(gb_Module_CHECKTARGETSTACK)) +gb_Module_SLOWCHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_SLOWCHECKTARGETSTACK)),$$(gb_Module_SLOWCHECKTARGETSTACK)) gb_Module_SUBSEQUENTCHECKTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_SUBSEQUENTCHECKTARGETSTACK)),$$(gb_Module_SUBSEQUENTCHECKTARGETSTACK)) gb_Module_CLEANTARGETSTACK := $$(wordlist 2,$$(words $$(gb_Module_CLEANTARGETSTACK)),$$(gb_Module_CLEANTARGETSTACK)) -ifneq ($$(and $$(gb_Module_TARGETSTACK),$$(gb_Module_CHECKTARGETSTACK),$$(gb_Module_SUBSEQUENTCHECKTARGETSTACK)),) +ifneq ($$(and $$(gb_Module_TARGETSTACK),$$(gb_Module_CHECKTARGETSTACK),$$(gb_Module_SLOWCHECKTARGETSTACK),$$(gb_Module_SUBSEQUENTCHECKTARGETSTACK)),) $$(eval $$(call gb_Output_error,Corrupted module target stack!3)) endif diff --git a/solenv/gbuild/Package.mk b/solenv/gbuild/Package.mk index 0179dd147dd1..1a4bf52e39c9 100644 --- a/solenv/gbuild/Package.mk +++ b/solenv/gbuild/Package.mk @@ -29,11 +29,23 @@ # PackagePart class -$(foreach destination,$(call gb_PackagePart_get_destinations), $(destination)/%) : - $(call gb_Deliver_deliver,$<,$@) +# a pattern rule with multiple targets is actually executed only once for each +# match, so define only pattern rules with one target here +# the .dir is for make 3.81, which ignores trailing / +define gb_PackagePart__rule +$(1)/.dir : + $$(if $$(wildcard $$(dir $$@)),,mkdir -p $$(dir $$@)) +$(1)/%/.dir : + $$(if $$(wildcard $$(dir $$@)),,mkdir -p $$(dir $$@)) +$(1)/% : + $$(call gb_Deliver_deliver,$$<,$$@) +endef + +$(foreach destination,$(call gb_PackagePart_get_destinations),$(eval \ + $(call gb_PackagePart__rule,$(destination)))) define gb_PackagePart_PackagePart -$(OUTDIR)/$(1) : $(2) +$(OUTDIR)/$(1) : $(2) | $(dir $(OUTDIR)/$(1)).dir $(2) :| $(3) $(call gb_Deliver_add_deliverable,$(OUTDIR)/$(1),$(2),$(3)) endef diff --git a/solenv/gbuild/Pagein.mk b/solenv/gbuild/Pagein.mk new file mode 100644 index 000000000000..60d98acfb158 --- /dev/null +++ b/solenv/gbuild/Pagein.mk @@ -0,0 +1,77 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# Major Contributor(s): +# Copyright (C) 2011 Red Hat, Inc., David Tardon <dtardon@redhat.com> +# (initial developer) +# +# All Rights Reserved. +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +gb_Pagein_UREPATH := ../ure-link/lib/ + +gb_Pagein__is_library = $(filter $(1),$(gb_Library_KNOWNLIBS)) + +gb_Pagein__get_libdir = $(if $(filter URELIB,$(call gb_Library_get_layer,$(1))),$(call gb_Pagein_UREPATH)) + +gb_Pagein__make_library_path = $(call gb_Pagein__get_libdir,$(1))$(call gb_Library_get_runtime_filename,$(1)) + +gb_Pagein__make_path = \ +$(if $(call gb_Pagein__is_library,$(1)),$(call gb_Pagein__make_library_path,$(1)),$(1)) + +define gb_Pagein__command +$(call gb_Output_announce,$(2),$(true),PAG,5) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) && rm -f $(1) \ + $(foreach object,$(OBJECTS),&& echo $(call gb_Pagein__make_path,$(object)) >> $(1))) + +endef + +.PHONY : $(call gb_Pagein_get_clean_target,%) +$(call gb_Pagein_get_clean_target,%) : + $(call gb_Output_announce,$*,$(false),PAG,5) + $(call gb_Helper_abbreviate_dirs,\ + rm -f $(call gb_Pagein_get_target,$*) $(call gb_Pagein_get_outdir_target,$*)) + +$(call gb_Pagein_get_target,%) : + $(call gb_Pagein__command,$@,$*,$^) + +$(call gb_Pagein_get_outdir_target,%) : $(call gb_Pagein_get_target,%) + $(call gb_Deliver_deliver,$<,$@) + +define gb_Pagein_Pagein +$(call gb_Pagein_get_target,$(1)) : OBJECTS := +$(call gb_Pagein_get_target,$(1)) : $(realpath $(lastword $(MAKEFILE_LIST))) +$$(eval $$(call gb_Module_register_target,$(call gb_Pagein_get_outdir_target,$(1)),$(call gb_Pagein_get_clean_target,$(1)))) +$(call gb_Pagein_get_outdir_target,$(1)) : $(call gb_Pagein_get_target,$(1)) + +endef + +define gb_Pagein_add_object +$(call gb_Pagein_get_target,$(1)) : OBJECTS += $(2) + +endef + +define gb_Pagein_add_objects +$(foreach object,$(2),$(call gb_Pagein_add_object,$(1),$(object))) + +endef + +# vim: set ts=4 sw=4 noet: diff --git a/solenv/gbuild/Rdb.mk b/solenv/gbuild/Rdb.mk index bea289f41815..86aee2d532b9 100644 --- a/solenv/gbuild/Rdb.mk +++ b/solenv/gbuild/Rdb.mk @@ -59,13 +59,19 @@ $(call gb_Rdb_get_clean_target,%) : $(call gb_Helper_abbreviate_dirs_native,\ rm -f $(call gb_Rdb_get_outdir_target,$*) $(call gb_Rdb_get_target,$*)) +# DO NOT DEFINE: it overwrites the definition from Package.mk for xml/ +# and doesn't work on 3.81 +#$(dir $(call gb_Rdb_get_outdir_target,))%/.dir : +# mkdir -p $(dir $@) + $(call gb_Rdb_get_outdir_target,%) : $(call gb_Deliver_deliver,$<,$@) define gb_Rdb_Rdb $(call gb_Rdb_get_target,$(1)) : COMPONENTS := $(call gb_Rdb_get_clean_target,$(1)) : COMPONENTS := -$(call gb_Rdb_get_outdir_target,$(1)) : $(call gb_Rdb_get_target,$(1)) +$(call gb_Rdb_get_outdir_target,$(1)) : $(call gb_Rdb_get_target,$(1)) \ + | $(dir $(call gb_Rdb_get_outdir_target,$(1))).dir $(call gb_Deliver_add_deliverable,$(call gb_ResTarget_get_outdir_target,$(1)),$(call gb_Rdb_get_target,$(1)),$(1)) $$(eval $$(call gb_Module_register_target,$(call gb_Rdb_get_outdir_target,$(1)),$(call gb_Rdb_get_clean_target,$(1)))) diff --git a/solenv/gbuild/SdiTarget.mk b/solenv/gbuild/SdiTarget.mk index 611ba9f81cd4..9510ef9400ab 100644 --- a/solenv/gbuild/SdiTarget.mk +++ b/solenv/gbuild/SdiTarget.mk @@ -50,7 +50,7 @@ $(call gb_SdiTarget_get_target,%) : $(SRCDIR)/%.sdi | $(gb_SdiTarget_SVIDLTARGET -fx$(EXPORTS) \ -fm$@ \ -fM$(call gb_SdiTarget_get_dep_target,$*) \ - $(realpath $<)) + $<) ifeq ($(gb_FULLDEPS),$(true)) $(call gb_SdiTarget_get_dep_target,%) : $(call gb_SdiTarget_get_target,%) diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk index 23ceef49d62b..20588396e76f 100644 --- a/solenv/gbuild/StaticLibrary.mk +++ b/solenv/gbuild/StaticLibrary.mk @@ -111,8 +111,10 @@ $(eval $(foreach method,\ add_linked_static_libs \ use_external \ use_externals \ + add_custom_headers \ add_package_headers \ add_sdi_headers \ + set_warnings_not_errors \ ,\ $(call gb_StaticLibrary_forward_to_Linktarget,$(method))\ )) diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 2176746ac9a7..27d19988e209 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -32,6 +32,7 @@ gb_ComponentTarget_get_outdir_target = $(OUTDIR)/xml/component/$(1).component gb_Executable_get_target = $(OUTDIR)/bin/$(1)$(gb_Executable_EXT) gb_Executable_get_target_for_build = $(OUTDIR_FOR_BUILD)/bin/$(1)$(gb_Executable_EXT_for_build) gb_Extension_get_outdir_target = $(OUTDIR)/bin/$(1).oxt +gb_Pagein_get_outdir_target = $(OUTDIR)/bin/pagein-$(1) gb_PackagePart_get_destinations = \ $(OUTDIR)/bin \ $(OUTDIR)/idl \ @@ -53,7 +54,8 @@ gb_Jar_get_outdir_target = $(OUTDIR)/bin/$(1).jar gb_Zip_get_outdir_target = $(OUTDIR)/pck/$(1).zip # outdir targets: $(1) is path gb_Configuration_registry = $(OUTDIR)/xml/registry -gb_XcsTarget_get_outdir_target = $(gb_Configuration_registry)/schema/$(1) +gb_XcsTarget_get_outdir_target = \ + $(gb_Configuration_registry)/schema$(if $(1),/)$(1) gb_XcuDataTarget_get_outdir_target = $(gb_Configuration_registry)/data/$(1) gb_XcuLangpackTarget_get_outdir_target = $(gb_Configuration_registry)/spool/$(1) gb_XcuModuleTarget_get_outdir_target = $(gb_Configuration_registry)/spool/$(1) @@ -85,6 +87,7 @@ gb_GenCxxObject_get_target = $(WORKDIR)/GenCxxObject/$(1).o gb_Executable_get_external_headers_target = $(WORKDIR)/ExternalHeaders/Executable/$(1) gb_Executable_get_headers_target = $(WORKDIR)/Headers/Executable/$(1) gb_Extension_get_target = $(WORKDIR)/Extension/$(1).oxt +gb_Extension_get_rootdir = $(WORKDIR)/Extension/$(1)/root gb_Extension_get_workdir = $(WORKDIR)/Extension/$(1) gb_ExternalLib_get_workdir = $(WORKDIR)/ExternalLib/$(1) gb_ExternalLib_get_builddir = $(WORKDIR)/ExternalLib/$(1)/build @@ -102,12 +105,14 @@ gb_LinkTarget_get_headers_target = $(WORKDIR)/Headers/$(1) gb_LinkTarget_get_target = $(WORKDIR)/LinkTarget/$(1) gb_LinkTarget_get_objects_list = $(WORKDIR)/LinkTarget/$(1).objectlist gb_Module_get_check_target = $(WORKDIR)/Module/check/$(1) +gb_Module_get_slowcheck_target = $(WORKDIR)/Module/slowcheck/$(1) gb_Module_get_subsequentcheck_target = $(WORKDIR)/Module/subsequentcheck/$(1) gb_Module_get_target = $(WORKDIR)/Module/$(1) gb_ObjCxxObject_get_target = $(WORKDIR)/ObjCxxObject/$(1).o gb_ObjCObject_get_target = $(WORKDIR)/ObjCObject/$(1).o gb_Package_get_preparation_target = $(WORKDIR)/Package/prepared/$(1) gb_Package_get_target = $(WORKDIR)/Package/$(1) +gb_Pagein_get_target = $(WORKDIR)/Pagein/$(1) gb_Pyuno_get_target = $(WORKDIR)/Pyuno/$(1).zip gb_Pyuno_get_outdir_target = $(OUTDIR)/bin/$(1).zip gb_PyunoFile_get_target = $(WORKDIR)/Pyuno/$(1)/contents/$(2) @@ -173,6 +178,7 @@ $(eval $(call gb_Helper_make_clean_targets,\ Module \ PackagePart \ Package \ + Pagein \ Pyuno \ Rdb \ ResTarget \ @@ -250,4 +256,8 @@ gb_Library_DLLDIR = $(WORKDIR)/LinkTarget/Library gb_CppunitTest_DLLDIR = $(WORKDIR)/LinkTarget/CppunitTest gb_StaticLibrary_OUTDIRLOCATION = $(OUTDIR)/lib +# static variables declared here because they are used globally + +gb_SDFLOCATION := $(WORKDIR)/CustomTarget/translations/translate/sdf + # vim: set noet sw=4: diff --git a/solenv/gbuild/Tempfile.mk b/solenv/gbuild/Tempfile.mk index e7e927986298..691abc453c74 100644 --- a/solenv/gbuild/Tempfile.mk +++ b/solenv/gbuild/Tempfile.mk @@ -1,4 +1,10 @@ # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +ifeq ($(HAVE_GNUMAKE_FILE_FUNC),YES) +define var2file +$(file >$(1),$(3))$(1) +endef +else # Write string to temporary file by chopping into pieces that # fit the commandline # parameters: filename, maxitems (for one write), string @@ -16,5 +22,6 @@ $(foreach item,$(3),$(eval gb_var2file_curblock += $(item) gb_var2file_curblock := )) endef +endif # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/UnoApi.mk b/solenv/gbuild/UnoApi.mk index bb82ddba653a..fba9b1f7643f 100644 --- a/solenv/gbuild/UnoApi.mk +++ b/solenv/gbuild/UnoApi.mk @@ -38,6 +38,7 @@ $(call gb_Package_Package,$(1)_inc,$(call gb_UnoApiHeadersTarget_get_dir,$(1))) $(call gb_UnoApiTarget_set_root,$(1),UCR) +$(call gb_UnoApi_get_target,$(1)) :| $(dir $(call gb_UnoApi_get_target,$(1))).dir $(call gb_UnoApi_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) $(call gb_UnoApi_get_target,$(1)) : $(call gb_UnoApiHeadersTarget_get_target,$(1)) $(call gb_UnoApi_get_target,$(1)) : $(call gb_Package_get_target,$(1)_idl) diff --git a/solenv/gbuild/UnoApiMerge.mk b/solenv/gbuild/UnoApiMerge.mk index 067a4c1b4fa4..5b4fafb5f2fd 100644 --- a/solenv/gbuild/UnoApiMerge.mk +++ b/solenv/gbuild/UnoApiMerge.mk @@ -34,6 +34,7 @@ $(call gb_UnoApiTarget_UnoApiTarget,$(1)) $(call gb_UnoApiTarget_set_root,$(1),/) +$(call gb_UnoApiMerge_get_target,$(1)) :| $(dir $(call gb_UnoApiMerge_get_target,$(1))).dir $(call gb_UnoApiMerge_get_target,$(1)) : $(call gb_UnoApiTarget_get_target,$(1)) $(call gb_UnoApiMerge_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_clean_target,$(1)) diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk index 388fe3c3bbe7..d2adfe993c27 100644 --- a/solenv/gbuild/UnoApiTarget.mk +++ b/solenv/gbuild/UnoApiTarget.mk @@ -41,8 +41,12 @@ gb_UnoApiPartTarget_IDLCCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR # invoked with the .idl file corresponding to the .urd in that case. # Touch the .urd file, so it is newer than the .done file, causing that to # be rebuilt and overwriting the .urd file again. +# the .dir is for make 3.81, which ignores trailing / +$(dir $(call gb_UnoApiPartTarget_get_target,))%/.dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + $(call gb_UnoApiPartTarget_get_target,%.urd) : - mkdir -p $(dir $@) && touch $@ + touch $@ # TODO: # - get idlc switch "-P" (generate .urd into package dir) @@ -68,7 +72,7 @@ $(call gb_UnoApiPartTarget_get_target,%.done) : ifeq ($(gb_FULLDEPS),$(true)) $(call gb_UnoApiPartTarget_get_dep_target,%) : - $(if $(realpath $@),touch $@,\ + $(if $(wildcard $@),touch $@,\ $(call gb_Object__command_dep,$@,$(call gb_UnoApiPartTarget_get_target,$*.urd))) endif @@ -186,6 +190,8 @@ define gb_UnoApiTarget__add_idlfile $(call gb_UnoApiPartTarget_get_target,$(2)/idl.done) : \ $(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd) $(call gb_UnoApiTarget__add_urdfile,$(1),$(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd)) +$(call gb_UnoApiPartTarget_get_target,$(2)/$(3).urd) :| \ + $(call gb_UnoApiPartTarget_get_target,$(2)/.dir) ifeq ($(gb_FULLDEPS),$(true)) $(call gb_UnoApiTarget_get_dep_target,$(1)) : UNOAPI_IDLFILES += $(2)/$(3).idl diff --git a/solenv/gbuild/Zip.mk b/solenv/gbuild/Zip.mk index f6d492ed9c6d..38f133536455 100644 --- a/solenv/gbuild/Zip.mk +++ b/solenv/gbuild/Zip.mk @@ -37,8 +37,9 @@ $(call gb_Zip_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),ZIP,3) $(call gb_Helper_abbreviate_dirs,\ rm -f $(call gb_Zip_get_target,$*) && \ - rm -f $(call gb_Zip_get__preparation_target,$*) && \ + rm -f $(call gb_Zip__get_preparation_target,$*) && \ rm -f $(call gb_Zip_get_final_target,$*) && \ + $(if $(CLEAR_LOCATION),rm -rf $(gb_Package_Location_$*) &&) \ rm -f $(call gb_Zip_get_outdir_target,$*)) # rule to create zip package in workdir @@ -71,22 +72,27 @@ $(call gb_Zip__get_preparation_target,%) : define gb_Zip_Zip $(call gb_Zip_get_target,$(1)) : FILES := $(call gb_Zip_get_target,$(1)) : LOCATION := $(2) +$(call gb_Zip_get_clean_target,$(1)) : CLEAR_LOCATION := gb_Package_Location_$(1) := $(2) $(eval $(call gb_Module_register_target,$(call gb_Zip_get_final_target,$(1)),$(call gb_Zip_get_clean_target,$(1)))) $(call gb_Deliver_add_deliverable,$(call gb_Zip_get_outdir_target,$(1)),$(call gb_Zip_get_target,$(1)),$(1)) -$(call gb_Zip_get_outdir_target,$(1)) : $(call gb_Zip_get_target,$(1)) +$(call gb_Zip_get_outdir_target,$(1)) : $(call gb_Zip_get_target,$(1)) \ + | $(dir $(call gb_Zip_get_outdir_target,$(1))).dir endef # adding a file creates a dependency to it # the full path name of the file needs access to the package location # as scoped variables only exist in rules, we use a postfixed name to refer to the location +# # if package location is in $(WORKDIR) we can specify third parameter and copy file from different place +# then we need also remove the location on make clean define gb_Zip_add_file $(call gb_Zip_get_target,$(1)) : FILES += $(2) $(call gb_Zip_get_target,$(1)) : $(gb_Package_Location_$(1))/$(2) $(gb_Package_Location_$(1))/$(2) :| $(call gb_Zip__get_preparation_target,$(1)) ifneq ($(3),) +$(call gb_Zip_get_clean_target,$(1)) : CLEAR_LOCATION := TRUE $(gb_Package_Location_$(1))/$(2) : $(3) mkdir -p $$(dir $$@) cp -f $$< $$@ @@ -110,4 +116,9 @@ $(foreach dependency,$(2),$(call gb_Zip_add_dependency,$(1),$(dependency))) endef +define gb_Zip_add_commandoptions +$(call gb_Zip_get_target,$(1)) : gb_Zip_ZIPCOMMAND += $(2) + +endef + # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/extensions/post_AuxTargets.mk b/solenv/gbuild/extensions/post_AuxTargets.mk deleted file mode 100644 index 354a91bd6b52..000000000000 --- a/solenv/gbuild/extensions/post_AuxTargets.mk +++ /dev/null @@ -1,130 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# Version: MPL 1.1 / GPLv3+ / LGPLv3+ -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License or as specified alternatively below. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# Major Contributor(s): -# [ Copyright (C) 2011 Bjoern Michaelsen <bjoern.michaelsen@canonical.com> (initial developer) ] -# -# All Rights Reserved. -# -# For minor contributions see the git repository. -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 3 or later (the "GPLv3+"), or -# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), -# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable -# instead of those above. - -.PHONY: id tags docs distro-pack-install install fetch clean-host clean-build bootstrap - -$(WORKDIR)/bootstrap: - @cd $(SRCDIR) && ./bootstrap - @mkdir -p $(dir $@) && touch $@ - -bootstrap: $(WORKDIR)/bootstrap - -autogen.lastrun: - -ifneq ($(gb_SourceEnvAndRecurse_STAGE),buildpl) - -id: - @create-ids - -tags: - @create-tags - -docs: - @mkdocs.sh $(SRCDIR)/docs $(SOLARENV)/inc/doxygen.cfg - -distro-pack-install: install - $(SRCDIR)/bin/distro-install-clean-up - $(SRCDIR)/bin/distro-install-desktop-integration - $(SRCDIR)/bin/distro-install-sdk - $(SRCDIR)/bin/distro-install-file-lists - - -#these need to stay in the buildpl phase as buildpl depends on them -$(SRCDIR)/src.downloaded: - @true - -fetch: - @true - -# fixme: can we prevent these exports in the first place? -$(SRCDIR)/Env.Host.sh: autogen.lastrun configure.in ooo.lst.in set_soenv.in - $(if $(filter reconfigure,$(gb_SourceEnvAndRecurse_STAGE)),$(SRCDIR)/autogen.sh,@echo "cannot reconfigure from within solarenv" && rm -f $(SRCDIR)/Env.Host.sh && exit 2) - - -ifeq ($(strip $(gb_PARTIALBUILD)),) - -clean-host: - rm -rf $(SRCDIR)/*/$(INPATH) - rm -rf install - -clean-build: - if [ -f $(SRCDIR)/dmake/Makefile ] ; then $(GNUMAKE) -C $(SRCDIR)/dmake clean; fi - rm -f solenv/*/bin/dmake* - $(if $(filter-out $(INPATH),$(INPATH_FOR_BUILD)),rm -rf $(SRCDIR)/*/$(INPATH_FOR_BUILD)) - -distclean: clean - if [ -f $(SRCDIR)/dmake/Makefile ] ; then $(GNUMAKE) -C $(SRCDIR)/dmake clean; fi - cd $(SRCDIR) && rm -rf config_host.mk config_build.mk Env.Host.sh Env.Build.sh autogen.lastrun autom4te.cache \ - bin/repo-list build_env config.log config.status \ - desktop/scripts/soffice.sh ooo.lst post_download post_download.log \ - set_soenv set_soenv.last set_soenv.stamp src.downloaded warn - -install: build - echo "Installing in $(INSTALLDIR)..." && \ - ooinstall "$(INSTALLDIR)" && \ - echo "" && \ - echo "Installation finished, you can now execute:" && \ - echo "$(INSTALLDIR)/program/soffice" - -endif - -else -$(SRCDIR)/src.downloaded: $(SRCDIR)/ooo.lst $(SRCDIR)/download - $(if $(filter YES,$(DO_FETCH_TARBALLS)),cd $(SRCDIR) && ./download ./ooo.lst && touch $@,touch $@) - -fetch: $(SRCDIR)/src.downloaded - -id: - @true - -tags: - @true - -docs: - @true - -distro-pack-install: - @true - -$(SRCDIR)/Env.Host.sh: - @true - -clean-host: - @true - -clean-build: - @true - -distclean: - @true - -install: - @true - -endif - -# vim:set shiftwidth=4 softtabstop=4 noexpandtab: diff --git a/solenv/gbuild/extensions/post_BuildplTargets.mk b/solenv/gbuild/extensions/post_BuildplTargets.mk deleted file mode 100644 index 2af8930e7116..000000000000 --- a/solenv/gbuild/extensions/post_BuildplTargets.mk +++ /dev/null @@ -1,192 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# Version: MPL 1.1 / GPLv3+ / LGPLv3+ -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License or as specified alternatively below. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# Major Contributor(s): -# [ Copyright (C) 2011 Bjoern Michaelsen <bjoern.michaelsen@canonical.com> (initial developer) ] -# -# All Rights Reserved. -# -# For minor contributions see the git repository. -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 3 or later (the "GPLv3+"), or -# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), -# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable -# instead of those above. - -.PHONY: cross-build-toolset dev-install build findunusedcode - -ifeq ($(gb_SourceEnvAndRecurse_STAGE),buildpl) - -.DEFAULT_GOAL=all -#include $(GBUILDDIR)/Module.mk - -.PHONY: build all - -all: build - @true - -# fake targets -- whatever is requested from gbuild requires a full build before (dev-install for JunitTests) -$(call gb_Package_get_target,%): build - @true - -$(call gb_Executable_get_target,%): build - @true - -$(call gb_Extension_get_target,%): build - @true - -$(call gb_ComponentsTarget_get_target,%): build - @true - -$(call gb_Jar_get_target,%): build - @true - -$(call gb_RdbTarget_get_target,%): build - @true - -$(call gb_Pyuno_get_target,%): build - @true - -$(call gb_WinResTarget_get_target,%): build - @true - -$(call gb_CppunitTest_get_target,%): build - @true - -$(call gb_Configuration_get_target,%): build - @true - -#$(call gb_StaticLibrary_get_target,%): build -# @true - -$(call gb_AllLangResTarget_get_target,%): build - @true - -$(call gb_ExternalLib_get_target,%): build - @true - -#$(call gb_Library_get_target,%): build -# @true - -$(call gb_Package_get_target,%): build - @true - -$(call gb_UnoApiTarget_get_target,%): build - @true - -$(call gb_Zip_get_target,%): build - @true - -$(call gb_JunitTest_get_target,%): dev-install - @true - -gb_MAKETARGET=all -# if we have only build as target use build instead of all -ifneq ($(strip $(MAKECMDGOALS)),) -ifeq ($(filter-out build,$(MAKECMDGOALS)),) -gb_MAKETARGET=build -endif -endif - -define gb_BuildplTarget_command -cd $(SRCDIR)/$(1) && unset MAKEFLAGS && export gb_SourceEnvAndRecurse_STAGE=gbuild && $(SOLARENV)/bin/build.pl $(if $(findstring s,$(MAKEFLAGS)),,VERBOSE=T) -P$(BUILD_NCPUS) $(2) -- -P$(GMAKE_PARALLELISM) gb_MAKETARGET=$(gb_MAKETARGET) -endef - -# the build order dependencies are rather ugly... -dev-install: \ - $(WORKDIR)/bootstrap \ - $(SRCDIR)/src.downloaded \ - $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross_toolset) \ - | $(filter build,$(MAKECMDGOALS)) \ - $(if $(filter check,$(MAKECMDGOALS)),build) - $(call gb_BuildplTarget_command,smoketestoo_native,) - -build: $(WORKDIR)/bootstrap $(SRCDIR)/src.downloaded $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross_toolset) - $(call gb_BuildplTarget_command,instsetoo_native,--all) - -cross_toolset: $(WORKDIR)/bootstrap $(SRCDIR)/src.downloaded - source $(SRCDIR)/config_build.mk && source $(SRCDIR)/Env.Build.sh && $(call gb_BuildplTarget_command,$@,--all) - -# experimental callcatcher target -# http://www.skynet.ie/~caolan/Packages/callcatcher.html -findunusedcode: - @which callcatcher > /dev/null 2>&1 || \ - (echo "callcatcher not installed" && false) - @sed -e s,$(INPATH),callcatcher,g $(SRCDIR)/config_host.mk > $(SRCDIR)/config_host_callcatcher.mk - @sed -e s,config_host,config_host_callcatcher,g $(SRCDIR)/Env.Host.sh > $(SRCDIR)/Env.callcatcher.sh - @mkdir -p $(SRCDIR)/solenv/callcatcher/bin && \ - ln -sf $(SRCDIR)/solenv/$(INPATH)/bin/dmake \ - $(SRCDIR)/solenv/callcatcher/bin/dmake && \ - source $(SRCDIR)/config_host_callcatcher.mk && \ - source $(SRCDIR)/Env.callcatcher.sh && \ - source $(SRCDIR)/solenv/bin/callcatchEnv.Set.sh && \ - $(call gb_BuildplTarget_command,instsetoo_native,--all) - @source $(SRCDIR)/config_host_callcatcher.mk && \ - source $(SRCDIR)/Env.callcatcher.sh && \ - callanalyse \ - $$WORKDIR/LinkTarget/*/* \ - */$$OUTPATH/bin/* \ - */$$OUTPATH/lib/* > unusedcode.all -#because non-c++ symbols could be dlsymed lets make a list of class level -#unused methods which don't require much effort to determine if they need -#to be just removed, or put behind appropiate platform or debug level ifdefs -# -#filter out cppu:: because there's a concern they might be required for the -#extensions abi -# -#filter out boost:: and Icc*:: because there are external libraries we -#build but don't include into our install sets -# -#filter out Atom*:: from libcmis, because its too painful to customize -#it to only build the methods we directly call - @grep ::.*\( unusedcode.all \ - | grep -v ^cppu:: \ - | grep -v ^boost:: \ - | grep -v ^CIcc \ - | grep -v ^Atom \ - > unusedcode.easy - -subsequentcheck: dev-install - -clean: - @true - -check: subsequentcheck - @true - -unitcheck: build - @true - -debugrun: - @true - -endif # gb_SourceEnvAndRecurse_STAGE=buildpl - -ifeq ($(gb_SourceEnvAndRecurse_STAGE),gbuild) - -clean: clean-host clean-build - -dev-install: $(WORKDIR)/bootstrap $(SRCDIR)/src.downloaded $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross_toolset) | $(filter build,$(MAKECMDGOALS)) - -build: $(WORKDIR)/bootstrap $(SRCDIR)/src.downloaded $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross_toolset) - -cross_toolset: $(WORKDIR)/bootstrap $(SRCDIR)/src.downloaded - -findunusedcode: - -endif - - -# vim: set noet sw=4: diff --git a/solenv/gbuild/extensions/post_DisableIosUnitchecks.mk b/solenv/gbuild/extensions/post_DisableIosUnitchecks.mk deleted file mode 100644 index 01914a19342d..000000000000 --- a/solenv/gbuild/extensions/post_DisableIosUnitchecks.mk +++ /dev/null @@ -1,34 +0,0 @@ -# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -# -# Version: MPL 1.1 / GPLv3+ / LGPLv3+ -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License or as specified alternatively below. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# Major Contributor(s): -# [ Copyright (C) 2011 Bjoern Michaelsen <bjoern.michaelsen@canonical.com> (initial developer) ] -# -# All Rights Reserved. -# -# For minor contributions see the git repository. -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 3 or later (the "GPLv3+"), or -# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), -# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable -# instead of those above. - -# disable check target on IOS -ifeq ($(OS),IOS) -gb_Module_add_check_target= -endif - - -# vim:set shiftwidth=4 softtabstop=4 noexpandtab: diff --git a/solenv/gbuild/extensions/post_SpeedUpTargets.mk b/solenv/gbuild/extensions/post_SpeedUpTargets.mk index f6df03bd37fc..a4cc23f4d62f 100644 --- a/solenv/gbuild/extensions/post_SpeedUpTargets.mk +++ b/solenv/gbuild/extensions/post_SpeedUpTargets.mk @@ -1,4 +1,4 @@ -# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- # # Version: MPL 1.1 / GPLv3+ / LGPLv3+ # @@ -29,14 +29,14 @@ # speed up if no target need to parse all modules gb_SpeedUpTargets_WRAPPEDBUILD:= ifneq ($(strip $(MAKECMDGOALS)),) -ifeq ($(filter-out id tags docs distro-pack-install fetch help debugrun $(SRCDIR)/Env.Host.sh,$(MAKECMDGOALS)),) +ifeq ($(filter-out id tags docs distro-pack-install fetch help debugrun $(SRCDIR)/config_host.mk,$(MAKECMDGOALS)),) gb_SpeedUpTargets_WRAPPEDBUILD:=T endif endif ifeq ($(strip $(gb_PARTIALBUILD)),) ifneq ($(strip $(MAKECMDGOALS)),) -ifeq ($(filter-out clean distclean id tags docs distro-pack-install fetch help debugrun $(SRCDIR)/Env.Host.sh,$(MAKECMDGOALS)),) +ifeq ($(filter-out clean distclean id tags docs distro-pack-install fetch help debugrun $(SRCDIR)/config_host.mk,$(MAKECMDGOALS)),) gb_SpeedUpTargets_WRAPPEDBUILD:=T endif endif @@ -45,6 +45,7 @@ endif ifneq ($(strip $(gb_SpeedUpTargets_WRAPPEDBUILD)),) gb_Module_add_target= gb_Module_add_check_target= +gb_Module_add_slowcheck_target= gb_Module_add_subsequentcheck_target= gb_Module_add_moduledir= gb_FULLDEPS= diff --git a/solenv/gbuild/extensions/pre_MergedLibsList.mk b/solenv/gbuild/extensions/pre_MergedLibsList.mk index e39e6f428cb0..3bcab1a7debc 100644 --- a/solenv/gbuild/extensions/pre_MergedLibsList.mk +++ b/solenv/gbuild/extensions/pre_MergedLibsList.mk @@ -31,18 +31,31 @@ ifeq ($(MERGELIBS),TRUE) gb_MERGEDLIBS := \ avmedia \ canvastools \ + configmgr \ cppcanvas \ deploymentmisc \ drawinglayer \ editeng \ filterconfig \ + fwe \ + fwi \ + fwk \ + fwl \ + fwm \ lng \ package2 \ + sb \ + sfx \ sofficeapp \ spl \ + svt \ svx \ svxcore \ + tk \ + ucb1 \ + ucpfile1 \ uui \ + xcr \ xo \ endif diff --git a/solenv/gbuild/filter-showIncludes.pl b/solenv/gbuild/filter-showIncludes.pl index ee9a34bb8902..d7082a29c083 100755 --- a/solenv/gbuild/filter-showIncludes.pl +++ b/solenv/gbuild/filter-showIncludes.pl @@ -13,6 +13,10 @@ # # Original author: Jan Holesovsky <kendy@suse.cz> +use File::Basename; +use File::Copy; +use File::Temp qw/tempfile/; + my $outfile = $ARGV[0]; my $objfile = $ARGV[1]; my $srcfile = $ARGV[2]; @@ -25,8 +29,9 @@ if ( !defined( $showincludes_prefix ) || $showincludes_prefix eq "" ) { $showincludes_prefix = 'Note: including file:'; } -open( OUT, "> $outfile" ) or die "Cannot open $outfile for writing."; -print OUT "$objfile: \\\n $srcfile"; +my ($OUT, $tmp_filename) = tempfile( 'showIncludesXXXXXX', DIR => dirname( $outfile ) ) or die "Cannot create a temp file."; + +print $OUT "$objfile: \\\n $srcfile"; my %seen; my $first_line = 1; @@ -45,7 +50,7 @@ while ( <STDIN> ) { if ( !defined $seen{$_} ) { $seen{$_} = 1; - print OUT " \\\n $_"; + print $OUT " \\\n $_"; } } else { @@ -56,7 +61,7 @@ while ( <STDIN> ) { $first_line = 0; } -print OUT "\n"; +print $OUT "\n"; # fdo#40099 if header.h does not exist, it will simply be considered out of # date and any targets that use it as a prerequisite will be updated, @@ -64,9 +69,11 @@ print OUT "\n"; # as an include # see http://www.makelinux.net/make3/make3-CHP-8-SECT-3 foreach my $key ( keys %seen ) { - print OUT "\n$key:\n"; + print $OUT "\n$key:\n"; } -close( OUT ) or die "Cannot close $outfile."; +close( $OUT ) or die "Cannot close $tmp_filename."; + +move( $tmp_filename, $outfile ) or die "Cannot move $tmp_filename to $outfile."; # vim: shiftwidth=4 softtabstop=4 expandtab: diff --git a/solenv/gbuild/gbuild.help.txt b/solenv/gbuild/gbuild.help.txt new file mode 100644 index 000000000000..3e170754f384 --- /dev/null +++ b/solenv/gbuild/gbuild.help.txt @@ -0,0 +1,77 @@ +NAME + gbuild - GNU make based build system for LibreOffice + +SYNOPSIS + make [ -f makefile ] [ options ] [ variable=value ... ] [ targets ] ... + +IMPORTANT OPTIONS + -s Silent operation; do not print the commands as they are executed. + + -n Print the commands that would be executed, but do not execute them. + -k Continue as much as possible after an error. + + -j Specifies the number of jobs (commands) to run simultaneously. + -l Specifies that no new jobs (commands) should be started if there are + others jobs running and the load average is at least load. + + -t Touch files (mark them up to date without really changing them) + instead of running their commands. + -W Pretend that the target file has just been modified. + -o Do not remake the file file even if it is older than its + dependencies, and do not remake anything on account of changes in file. + + -p Print the data base (rules and variable values) that results from + reading the makefiles. + --debug=b debug make run, see GNU make man page for details + + (descriptions from GNU make man page) + +AVAILABLE TARGETS + all build product and run unit tests (default goal) + build build product + unitcheck run unit tests + slowcheck run slow unit tests + subsequentcheck run system tests (requires full installation) + check run unit tests and if in toplevel subsequentcheck + clean remove all generated files + showdeliverables show the targets delivered to OUTDIR and their source + debugrun starts the dev-install instance and allows tests to be run + against it + <module> build the named module + <module>.clean clean the named module + <module>.all for dmake modules only, build the named module and + the pre-requisite modules for this module + <module>.deliver for dmake modules only, deliver the named module + cmd execute the command contained in the variable cmd="" + in a shell with config_host.mk or config_build.mk + environement set. (see gb_SIDE) + +INTERACTIVE VARIABLES: + DEBUG / debug If not empty, build with DBGLEVEL=1 (see below). + ENABLE_SYMBOLS / enable_symbols + If not empty, build with debug symbols. Automatically + enabled by DEBUG/debug. + DBGLEVEL / dbglevel + If not empty, force the debug level to the specified value. The + debug level is passed to the source code through OSL_DEBUG_LEVEL + macro. + 0 = no debug + 1 = symbols + no optimizations + 2 = symbols + no optimizations + extra debug output. OSL_TRACE + starts being active on this level. + 3... = symbols + no optimizations + extra debug output (usually + extremely verbose). Levels > 2 are not used very much. + + YACCFLAGS Add as flags for YACC parser generator invocation. + CPPFLAGS Add as preprocessor flags for C/C++/ObjC/ObjC++ compilation. + CFLAGS Add as compiler flags for plain C compilation. + CXXFLAGS Add as compiler flags for C++ compilation. + OBJCFLAGS Add as compiler flags for Objective C compilation. + OBJCXXFLAGS Add as compiler flags for Objective C++ compilation. + LDFLAGS Add as linker flags. + gb_FULLDEPS Generate and use dependencies (on by default, handle with care). + gb_COLOR Use ASCII color output. + gb_TITLES Show progress in terminal title. + gb_Side Either "host" of "build" (default to "host"). + determine if config_host.mk or config_build.mk is used to + set the build environment. diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index f35a84b77917..45d3b4ad0b69 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -33,7 +33,6 @@ GBUILDDIR:=$(SRCDIR)/solenv/gbuild # DEBUG # INPATH # JAVA_HOME -# JDKINCS # LIBXML_CFLAGS # OS # PRODUCT @@ -71,19 +70,15 @@ endif include $(GBUILDDIR)/Output.mk -# BuildDirs uses the Output functions already +# BuildDirs overrides *DIR variables for Windows 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 $(ENABLE_SYMBOLS)$(enable_symbols)),) gb_SYMBOL := $(true) @@ -116,12 +111,16 @@ ifneq ($(gb_DEBUGLEVEL),0) gb_SYMBOL := $(true) endif +ifneq ($(nodep),) +gb_FULLDEPS := $(false) +else # for clean, setuplocal and removelocal goals we switch off dependencies ifneq ($(filter cleanpackmodule clean setuplocal removelocal showdeliverables help debugrun,$(MAKECMDGOALS)),) gb_FULLDEPS := $(false) else gb_FULLDEPS := $(true) endif +endif # save user-supplied flags for latter use ifneq ($(strip $(CFLAGS)),) @@ -151,9 +150,7 @@ $(eval $(call gb_Helper_collect_libtargets)) gb_Library_DLLPOSTFIX := lo # Include platform/cpu/compiler specific config/definitions -ifneq ($(filter gbuild buidpl,$(gb_SourceEnvAndRecurse_STAGE)),) include $(GBUILDDIR)/platform/$(OS)_$(CPUNAME)_$(COM).mk -endif ifeq ($(CROSS_COMPILING),YES) # We can safely Assume all cross-compilation is from Unix systems. @@ -187,11 +184,7 @@ gb_GLOBALDEFS := \ $(gb_CPUDEFS) \ -ifeq ($(gb_PRODUCT),$(true)) -gb_GLOBALDEFS += \ - -DPRODUCT \ - -else +ifeq ($(gb_PRODUCT),$(false)) gb_GLOBALDEFS += \ -DDBG_UTIL \ @@ -239,6 +232,26 @@ ifeq ($(strip $(ENABLE_GRAPHITE)),TRUE) gb_GLOBALDEFS += -DENABLE_GRAPHITE endif +ifeq ($(strip $(ENABLE_HEADLESS)),TRUE) +gb_GLOBALDEFS += -DLIBO_HEADLESS +endif + +ifeq ($(strip $(DISABLE_DBCONNECTIVITY)),TRUE) +gb_GLOBALDEFS += -DDISABLE_DBCONNECTIVITY +endif + +ifeq ($(strip $(DISABLE_EXTENSIONS)),TRUE) +gb_GLOBALDEFS += -DDISABLE_EXTENSIONS +endif + +ifeq ($(strip $(DISABLE_SCRIPTING)),TRUE) +gb_GLOBALDEFS += -DDISABLE_SCRIPTING +endif + +ifeq ($(strip $(DISABLE_DYNLOADING)),TRUE) +gb_GLOBALDEFS += -DDISABLE_DYNLOADING +endif + ifeq ($(HAVE_THREADSAFE_STATICS),TRUE) gb_GLOBALDEFS += -DHAVE_THREADSAFE_STATICS endif @@ -268,7 +281,6 @@ include $(SOLARENV)/inc/minor.mk # shortest stem instead of first match. However, upon intoduction this version # is not available everywhere by default. -ifeq ($(gb_SourceEnvAndRecurse_STAGE),gbuild) include $(foreach class, \ ComponentTarget \ ComponentsTarget \ @@ -282,6 +294,7 @@ include $(foreach class, \ Package \ CustomTarget \ ExternalLib \ + Pagein \ Pyuno \ Rdb \ CppunitTest \ @@ -297,7 +310,6 @@ include $(foreach class, \ Configuration \ Extension \ ,$(GBUILDDIR)/$(class).mk) -endif # optional extensions that should never be essential ifneq ($(wildcard $(GBUILDDIR)/extensions/post_*.mk),) @@ -320,6 +332,14 @@ gb_XSLTPROCTARGET := $(call gb_Executable_get_target_for_build,xsltproc) gb_XSLTPROC := $(gb_Helper_set_ld_path) $(gb_XSLTPROCTARGET) endif +ifeq ($(SYSTEM_LIBXML_FOR_BUILD),YES) +gb_XMLLINTTARGET := +gb_XMLLINT := xsltproc +else +gb_XMLLINTTARGET := $(call gb_Executable_get_target_for_build,xsltproc) +gb_XMLLINT := $(gb_Helper_set_ld_path) $(gb_XMLLINTTARGET) +endif + ifeq ($(SYSTEM_PYTHON),YES) gb_PYTHONTARGET := gb_PYTHON := $(PYTHON) @@ -337,78 +357,9 @@ gb_PYTHONTARGET := $(OUTDIR)/bin/python gb_PYTHON := $(gb_PYTHON_PRECOMMAND) $(gb_PYTHONTARGET) endif -define gb_HelpMessage -NAME - gbuild - GNU make based build system for LibreOffice - -SYNOPSIS - make [ -f makefile ] [ options ] [ variable=value ... ] [ targets ] ... - -IMPORTANT OPTIONS - -s Silent operation; do not print the commands as they are executed. - - -n Print the commands that would be executed, but do not execute them. - -k Continue as much as possible after an error. - - -j Specifies the number of jobs (commands) to run simultaneously. - -l Specifies that no new jobs (commands) should be started if there are - others jobs running and the load average is at least load. - - -t Touch files (mark them up to date without really changing them) - instead of running their commands. - -W Pretend that the target file has just been modified. - -o Do not remake the file file even if it is older than its - dependencies, and do not remake anything on account of changes in file. - - -p Print the data base (rules and variable values) that results from - reading the makefiles. - --debug=b debug make run, see GNU make man page for details - - (descriptions from GNU make man page) - -AVAILABLE TARGETS - all build product and run unit tests (default goal) - build build product - unitcheck run unit tests - subsequentcheck run system tests (requires full installation) - check run unit tests and if in toplevel subsequentcheck - clean remove all generated files - showdeliverables show the targets delivered to OUTDIR and their source - debugrun starts the dev-install instance and allows tests to be run - against it - -INTERACTIVE VARIABLES: - DEBUG / debug If not empty, build with DBGLEVEL=1 (see below). - ENABLE_SYMBOLS / enable_symbols - If not empty, build with debug symbols. Automatically - enabled by DEBUG/debug. - DBGLEVEL / dbglevel - If not empty, force the debug level to the specified value. The - debug level is passed to the source code through OSL_DEBUG_LEVEL - macro. - 0 = no debug - 1 = symbols + no optimizations - 2 = symbols + no optimizations + extra debug output. OSL_TRACE - starts being active on this level. - 3... = symbols + no optimizations + extra debug output (usually - extremely verbose). Levels > 2 are not used very much. - - YACCFLAGS Add as flags for YACC parser generator invocation. - CPPFLAGS Add as preprocessor flags for C/C++/ObjC/ObjC++ compilation. - CFLAGS Add as compiler flags for plain C compilation. - CXXFLAGS Add as compiler flags for C++ compilation. - OBJCFLAGS Add as compiler flags for Objective C compilation. - OBJCXXFLAGS Add as compiler flags for Objective C++ compilation. - LDFLAGS Add as linker flags. - gb_FULLDEPS Generate and use dependencies (on by default, handle with care). - gb_COLOR Use ASCII color output. - gb_TITLES Show progress in terminal title. - -endef - .PHONY: help help: - $(info $(gb_HelpMessage)) + @cat $(SRCDIR)/solenv/gbuild/gbuild.help.txt @true # vim: set noet sw=4: diff --git a/solenv/gbuild/gbuild_simple.mk b/solenv/gbuild/gbuild_simple.mk index a4cdb0d73847..6ee9e09f4034 100644 --- a/solenv/gbuild/gbuild_simple.mk +++ b/solenv/gbuild/gbuild_simple.mk @@ -34,7 +34,7 @@ COMMA :=, include $(GBUILDDIR)/Output.mk -# BuildDirs uses the Output functions already +# BuildDirs overrides *DIR variables for Windows include $(GBUILDDIR)/BuildDirs.mk # Presumably the common parts in gbuild.mk and gbuild_simple.mk should @@ -49,12 +49,8 @@ include $(GBUILDDIR)/BuildDirs.mk ifneq ($(strip $(PRODUCT)$(product)),) gb_PRODUCT := $(true) else -ifneq ($(strip $(product)),) -gb_PRODUCT := $(true) -else gb_PRODUCT := $(false) endif -endif # These are useful, too, for stuff built in "custom" Makefiles ifneq ($(strip $(ENABLE_SYMBOLS)$(enable_symbols)),) @@ -81,8 +77,33 @@ gb_SYMBOL := $(true) endif include $(GBUILDDIR)/Helper.mk +include $(GBUILDDIR)/Tempfile.mk # Include platform/cpu/compiler specific config/definitions include $(GBUILDDIR)/platform/$(OS)_$(CPUNAME)_$(COM).mk +ifeq ($(CROSS_COMPILING),YES) +# We can safely Assume all cross-compilation is from Unix systems. +gb_Executable_EXT_for_build := +else +gb_Executable_EXT_for_build := $(gb_Executable_EXT) +endif + +ifeq ($(SYSTEM_PYTHON),YES) +gb_PYTHONTARGET := +gb_PYTHON := $(PYTHON) +else ifeq ($(OS),MACOSX) +#fixme: remove this MACOSX ifeq branch by filling in gb_PYTHON_PRECOMMAND in +#gbuild/platform/macosx.mk correctly for mac, e.g. PYTHONPATH and PYTHONHOME +#dirs for in-tree internal python +gb_PYTHONTARGET := +gb_PYTHON := $(PYTHON) +else ifeq ($(DISABLE_PYTHON),TRUE) +# Build-time python +gb_PYTHON := python +else +gb_PYTHONTARGET := $(OUTDIR)/bin/python +gb_PYTHON := $(gb_PYTHON_PRECOMMAND) $(gb_PYTHONTARGET) +endif + # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/partial_build.mk b/solenv/gbuild/partial_build.mk new file mode 100644 index 000000000000..4a390fca9784 --- /dev/null +++ b/solenv/gbuild/partial_build.mk @@ -0,0 +1,13 @@ + +gb_PARTIALBUILD := T + +ifeq ($(SOLARENV),) +ifeq ($(gb_Side),) +gb_Side:=host +endif +include $(dir $(realpath $(lastword $(MAKEFILE_LIST))))../../config_$(gb_Side).mk +endif + +include $(SOLARENV)/gbuild/gbuild.mk + +$(eval $(call gb_Module_make_global_targets,$(shell ls $(module_directory)/Module*.mk))) diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk index 4a41bba1a971..932f24ad030d 100644 --- a/solenv/gbuild/platform/IOS_ARM_GCC.mk +++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk @@ -31,8 +31,6 @@ COM := GCC gb_CPUDEFS := -DARM32 -gb_COMPILERDEFAULTOPTFLAGS := -O2 - ifeq ($(CC),) $(error You must set CC in the environment. See README.cross for example.) endif @@ -59,16 +57,23 @@ gb_CFLAGS := \ -Wshadow \ -fno-strict-aliasing \ +# For -Wno-non-virtual-dtor see <http://markmail.org/message/664jsoqe6n6smy3b> +# "Re: [dev] warnings01: -Wnon-virtual-dtor" message to dev@openoffice.org from +# Feb 1, 2006: gb_CXXFLAGS := \ $(gb_CXXFLAGS_COMMON) \ -Wno-ctor-dtor-privacy \ -Wno-non-virtual-dtor \ -fno-strict-aliasing \ - -fsigned-char \ - -malign-natural \ - #-Wshadow \ break in compiler headers already - #-fsigned-char \ might be removed? - #-malign-natural \ might be removed? + -fsigned-char + +# No idea if -malign-natural is needed, but macosx.mk uses it... +# Why it isn't used in gb_CFLAGS I have no idea. +# Anyway, Clang doesn't have this option. +ifneq ($(COM_GCC_IS_CLANG),TRUE) +gb_CXXFLAGS += \ + -malign-natural +endif # these are to get gcc to switch to Objective-C++ or Objective-C mode gb_OBJC_OBJCXX_COMMON_FLAGS := -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 @@ -81,6 +86,8 @@ gb_LinkTarget_LDFLAGS := \ $(subst -L../lib , ,$(SOLARLIB)) \ #man ld says: obsolete -Wl,-multiply_defined,suppress \ +gb_DEBUG_CFLAGS += -fno-inline + # ObjCxxObject class define gb_ObjCxxObject__command @@ -90,6 +97,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(gb_CXX) \ $(DEFS) \ $(T_OBJCXXFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -MMD -MT $(1) \ @@ -107,6 +115,7 @@ $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(call gb_ObjCObject_get_dep_target,$(2))) && \ $(gb_CC) \ $(DEFS) $(OBJCFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -MMD -MT $(call gb_ObjCObject_get_target,$(2)) \ @@ -118,9 +127,9 @@ endef # LinkTarget class -gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_COMPILEROPTFLAGS) -gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) -gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) $(gb_OBJCXXFLAGS) $(gb_COMPILEROPTFLAGS) +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_COMPILEROPTFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) +gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) $(gb_COMPILEROPTFLAGS) gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) $(gb_COMPILEROPTFLAGS) ifeq ($(gb_SYMBOL),$(true)) @@ -181,8 +190,7 @@ endef define gb_LinkTarget__command $(call gb_Output_announce,$(2),$(true),LNK,4) -$(if $(filter CppunitTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2))) -$(if $(filter Library StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1))) +$(call gb_LinkTarget__command_staticlink,$(1)) endef @@ -202,6 +210,7 @@ gb_Library__FRAMEWORKS := \ Foundation \ CoreFoundation \ CoreGraphics \ + CoreText \ gb_Library_PLAINLIBS_NONE += \ objc \ @@ -254,8 +263,8 @@ gb_StaticLibrary_StaticLibrary_platform = # Executable class -gb_Executable_EXT := -gb_Executable_TARGETTYPEFLAGS := -dead_strip +gb_Executable_EXT := .a +gb_Executable_TARGETTYPEFLAGS := gb_Executable_LAYER := \ $(foreach exe,$(gb_Executable_UREBIN),$(exe):OOO) \ @@ -274,7 +283,7 @@ endef gb_CppunitTest_CPPTESTPRECOMMAND := : gb_CppunitTest_SYSPRE := libtest_ -gb_CppunitTest_EXT := .dylib +gb_CppunitTest_EXT := .a gb_CppunitTest_LIBDIR := $(gb_Helper_OUTDIRLIBDIR) gb_CppunitTest_get_filename = $(gb_CppunitTest_SYSPRE)$(1)$(gb_CppunitTest_EXT) gb_CppunitTest_get_libfilename = $(gb_CppunitTest_get_filename) @@ -284,17 +293,6 @@ $(call gb_LinkTarget_get_target,$(2)) : LAYER := NONE endef -# JunitTest class - -define gb_JunitTest_JunitTest_platform -$(call gb_JunitTest_get_target,$(1)) : DEFS := \ - -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(OUTDIR)/installation/opt/LibreOffice.app/Contents/MacOS/soffice}" \ - -Dorg.openoffice.test.arg.env=DYLD_LIBRARY_PATH \ - -Dorg.openoffice.test.arg.user=file://$(call gb_JunitTest_get_userdir,$(1)) \ - -Dorg.openoffice.test.arg.workdir=$(call gb_JunitTest_get_userdir,$(1)) \ - -endef - # Python gb_PYTHON_PRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib diff --git a/solenv/gbuild/platform/NETBSD_INTEL_GCC.mk b/solenv/gbuild/platform/NETBSD_INTEL_GCC.mk index c0c31c9181ed..6c79b781540c 100644 --- a/solenv/gbuild/platform/NETBSD_INTEL_GCC.mk +++ b/solenv/gbuild/platform/NETBSD_INTEL_GCC.mk @@ -28,7 +28,7 @@ #please make generic modifications to unxgcc.mk gb_CPUDEFS := -DX86 -gb_COMPILERDEFAULTOPTFLAGS := -O2 +gb_COMPILERDEFAULTOPTFLAGS := -O -g include $(GBUILDDIR)/platform/unxgcc.mk diff --git a/solenv/gbuild/platform/NETBSD_X86_64_GCC.mk b/solenv/gbuild/platform/NETBSD_X86_64_GCC.mk index a426e2f8321d..d4288fa9543c 100644 --- a/solenv/gbuild/platform/NETBSD_X86_64_GCC.mk +++ b/solenv/gbuild/platform/NETBSD_X86_64_GCC.mk @@ -27,7 +27,7 @@ #please make generic modifications to unxgcc.mk -gb_COMPILERDEFAULTOPTFLAGS := -O2 +gb_COMPILERDEFAULTOPTFLAGS := -O -g include $(GBUILDDIR)/platform/unxgcc.mk diff --git a/solenv/gbuild/platform/WNT_INTEL_GCC.mk b/solenv/gbuild/platform/WNT_INTEL_GCC.mk index d68157035292..1ba676f4cc14 100644 --- a/solenv/gbuild/platform/WNT_INTEL_GCC.mk +++ b/solenv/gbuild/platform/WNT_INTEL_GCC.mk @@ -34,6 +34,10 @@ gb_TMPDIR:=$(if $(TMPDIR),$(TMPDIR),/tmp) include $(GBUILDDIR)/platform/com_GCC_defs.mk include $(GBUILDDIR)/platform/windows.mk +gb_CCVER := $(shell $(gb_CC) -dumpversion | $(gb_AWK) -F. -- \ + '{ print $$1*10000+$$2*100+$$3 }') +gb_GccLess470 := $(shell expr $(gb_CCVER) \< 40700) + gb_RC := $(WINDRES) ifeq ($(GXX_INCLUDE_PATH),) @@ -46,6 +50,14 @@ gb_COMPILERDEFS += \ -D_MSC_EXTENSIONS \ -D_FORCENAMELESSUNION \ +# Until GCC 4.6, MinGW used __cdecl by default, and BOOST_MEM_FN_ENABLE_CDECL +# would result in ambiguous calls to overloaded boost::bind; since GCC 4.7, +# MinGW uses __thiscall by default, so now needs BOOST_MEM_FN_ENABLE_CDECL for +# uses of boost::bind with functions annotated with SAL_CALL: +ifeq ($(gb_GccLess470),0) +gb_COMPILERDEFS += -DBOOST_MEM_FN_ENABLE_CDECL +endif + gb_RCDEFS := \ -DWINVER=0x0400 \ -DWIN32 \ @@ -58,6 +70,9 @@ gb_CFLAGS += \ -Wdeclaration-after-statement \ -fno-strict-aliasing \ +# For -Wno-non-virtual-dtor see <http://markmail.org/message/664jsoqe6n6smy3b> +# "Re: [dev] warnings01: -Wnon-virtual-dtor" message to dev@openoffice.org from +# Feb 1, 2006: gb_CXXFLAGS := \ $(gb_CXXFLAGS_COMMON) \ -Wno-ctor-dtor-privacy \ @@ -75,14 +90,17 @@ endif ifeq ($(HAVE_CXX0X),TRUE) # We can turn on additional useful checks with c++0x -# FIXME still does not compile fully gb_CXXFLAGS += -std=c++0x +# FIXME still does not compile fully gb_CXXFLAGS += -std=gnu++0x endif gb_LinkTarget_EXCEPTIONFLAGS += \ -fno-enforce-eh-specs \ +# At least sal defines its own __main, which would cause DLLs linking against +# sal to pick up sal's __main instead of the one from MinGW's dllcrt2.o: gb_LinkTarget_LDFLAGS := \ -Wl,--export-all-symbols \ + -Wl,--exclude-symbols,__main \ -Wl,--enable-stdcall-fixup \ -Wl,--enable-runtime-pseudo-reloc-v2 \ $(subst -L../lib , ,$(SOLARLIB)) \ @@ -91,7 +109,15 @@ ifeq ($(MINGW_GCCLIB_EH),YES) gb_LinkTarget_LDFLAGS += -shared-libgcc endif -gb_DEBUG_CFLAGS := -ggdb2 -finline-limit=0 -fno-inline -fno-default-inline +# clang does not know -ggdb2 +ifneq ($(COM_GCC_IS_CLANG),TRUE) +GGDB2=-ggdb2 +else +GGDB2=-g2 +endif + +gb_DEBUG_CFLAGS := $(GGDB2) -finline-limit=0 -fno-inline +gb_DEBUG_CXXFLAGS := -fno-default-inline gb_STDLIBS := \ mingwthrd \ @@ -102,14 +128,6 @@ gb_STDLIBS := \ # Helper class -# For LibreOffice, MinGW is always cross-compilation, so the "native" -# platform for the BUILD *is* Unix. No Cygwin/Win32 stuff needed. - -gb_Helper_SRCDIR_NATIVE := $(SRCDIR) -gb_Helper_WORKDIR_NATIVE := $(WORKDIR) -gb_Helper_OUTDIR_NATIVE := $(OUTDIR) -gb_Helper_REPODIR_NATIVE := $(REPODIR) - # Convert parameters filesystem root to native notation # does some real work only on Windows, and this file is for # cross-compilation. @@ -117,6 +135,11 @@ define gb_Helper_convert_native $(1) endef +# Convert path to native notation +define gb_Helper_native_path +$(1) +endef + # AsmObject class gb_AsmObject_get_source = $(1)/$(2).s @@ -129,6 +152,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(gb_CC) \ $(DEFS) \ $(T_CFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -I$(dir $(3)) \ @@ -139,12 +163,12 @@ endef # LinkTarget class -gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) -gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) ifeq ($(gb_SYMBOL),$(true)) -gb_LinkTarget_CXXFLAGS += -ggdb2 -gb_LinkTarget_CFLAGS += -ggdb2 +gb_LinkTarget_CXXFLAGS += $(GGDB2) +gb_LinkTarget_CFLAGS += $(GGDB2) endif gb_LinkTarget_INCLUDE +=\ @@ -224,7 +248,7 @@ gb_Library_UDK_MAJORVER := 3 gb_Library_PLAINEXT := .dll.a gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT) -gb_Library_RTVEREXT := $(gb_Library_RTEXT) +gb_Library_RTVEREXT := $(gb_Library_UDK_MAJORVER)$(gb_Library_RTEXT) gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT) gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT) gb_Library_UNOVEREXT := $(gb_Library_UDK_MAJORVER)$(gb_Library_PLAINEXT) @@ -232,7 +256,7 @@ gb_Library_UNOVEREXT := $(gb_Library_UDK_MAJORVER)$(gb_Library_PLAINEXT) gb_Library_DLLEXT := .dll gb_Library_RTDLLEXT := gcc3$(gb_Library_DLLEXT) -gb_Library_RTVERDLLEXT := $(gb_Library_RTDLLEXT) +gb_Library_RTVERDLLEXT := $(gb_Library_UDK_MAJORVER)$(gb_Library_RTDLLEXT) gb_Library_OOODLLEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_DLLEXT) gb_Library_UNODLLEXT := .uno$(gb_Library_DLLEXT) gb_Library_UNOVERDLLEXT := $(gb_Library_UDK_MAJORVER)$(gb_Library_DLLEXT) @@ -291,7 +315,7 @@ gb_Library_FILENAMES :=\ $(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_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTVEREXT)) \ $(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)) \ @@ -303,7 +327,7 @@ gb_Library_DLLFILENAMES :=\ $(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_RTDLLEXT)) \ - $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTDLLEXT)) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVERDLLEXT)) \ $(foreach lib,$(gb_Library_UNOLIBS_URE),$(lib):$(lib)$(gb_Library_UNODLLEXT)) \ $(foreach lib,$(gb_Library_UNOLIBS_OOO),$(lib):$(lib)$(gb_Library_UNODLLEXT)) \ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVERDLLEXT)) \ @@ -439,7 +463,6 @@ $(call gb_Helper_abbreviate_dirs,\ -v OUTDIR=$(OUTDIR)/ \ -v WORKDIR=$(WORKDIR)/ \ -v SRCDIR=$(SRCDIR)/ \ - -v REPODIR=$(REPODIR)/ \ > $(call gb_WinResTarget_get_dep_target,$(1))) endef else diff --git a/solenv/gbuild/platform/WNT_INTEL_MSC.mk b/solenv/gbuild/platform/WNT_INTEL_MSC.mk index 284c2ebab5c7..90fca91e82a1 100644 --- a/solenv/gbuild/platform/WNT_INTEL_MSC.mk +++ b/solenv/gbuild/platform/WNT_INTEL_MSC.mk @@ -147,6 +147,7 @@ gb_CXXFLAGS := \ -wd4245 \ -wd4250 \ -wd4251 \ + -wd4265 \ -wd4275 \ -wd4290 \ -wd4294 \ @@ -191,6 +192,11 @@ gb_CFLAGS_WERROR := -WX -DLIBO_WERROR gb_CXXFLAGS_WERROR := -WX -DLIBO_WERROR endif +ifeq ($(MERGELIBS),TRUE) +gb_CFLAGS += -DLIBO_MERGELIBS +gb_CXXFLAGS += -DLIBO_MERGELIBS +endif + gb_LinkTarget_EXCEPTIONFLAGS := \ -DEXCEPTIONS_ON \ -EHa \ @@ -226,7 +232,7 @@ gb_COMPILERNOOPTFLAGS := -Od ifeq ($(gb_FULLDEPS),$(true)) gb_COMPILERDEPFLAGS := -showIncludes define gb_create_deps -| $(GBUILDDIR)/filter-showIncludes.pl $(2) $(1) $(3); exit $${PIPESTATUS[0]} +| $(GBUILDDIR)/filter-showIncludes.pl $(1) $(2) $(3); exit $${PIPESTATUS[0]} endef else gb_COMPILERDEPFLAGS := @@ -236,29 +242,29 @@ endif # Helper class +gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/bin +gb_Helper_OUTDIR_FOR_BUILDLIBDIR := $(OUTDIR_FOR_BUILD)/bin + gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }') gb_Helper_WORKDIR_NATIVE := $(shell cygpath -m $(WORKDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }') gb_Helper_OUTDIR_NATIVE := $(shell cygpath -m $(OUTDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }') -gb_Helper_REPODIR_NATIVE := $(shell cygpath -m $(REPODIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }') gb_Helper_set_ld_path := PATH="$${PATH}:$(OUTDIR)/bin" # convert parameters filesystem root to native notation # does some real work only on windows, make sure not to # break the dummy implementations on unx* - -# This file:/// -> file:!!! -> file:/// substitution is to protect the -# slashes after file: in a file: URL from being unduplicated by the -# // -> / substitution. define gb_Helper_convert_native -$(subst file:!!!,file:///, \ -$(subst //,/, \ -$(subst file:///,file:!!!, \ -$(subst $(REPODIR),$(patsubst %/,%,$(gb_Helper_REPODIR_NATIVE)), \ +$(strip \ $(subst $(SRCDIR),$(gb_Helper_SRCDIR_NATIVE), \ $(subst $(WORKDIR),$(gb_Helper_WORKDIR_NATIVE), \ $(subst $(OUTDIR),$(gb_Helper_OUTDIR_NATIVE), \ -$(1)))))))) +$(1))))) +endef + +# Convert path to native notation +define gb_Helper_native_path +$(shell cygpath -m $(1)) endef # YaccTarget class @@ -273,6 +279,7 @@ endef # CObject class +# $(call gb_CObject__command,object,relative-source,source,dep-file) define gb_CObject__command $(call gb_Output_announce,$(2).c,$(true),C ,3) $(call gb_Helper_abbreviate_dirs_native,\ @@ -280,17 +287,19 @@ $(call gb_Helper_abbreviate_dirs_native,\ $(gb_CC) \ $(DEFS) \ $(T_CFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ -Fd$(PDBFILE) \ $(gb_COMPILERDEPFLAGS) \ - -I$(realpath $(dir $(3))) \ + -I$(dir $(3)) \ $(INCLUDE) \ - -c $(realpath $(3)) \ - -Fo$(1)) $(call gb_create_deps,$(1),$(4),$(realpath $(3))) + -c $(3) \ + -Fo$(1)) $(call gb_create_deps,$(4),$(1),$(3)) endef # CxxObject class +# $(call gb_CxxObject__command,object,relative-source,source,dep-file) define gb_CxxObject__command $(call gb_Output_announce,$(2).cxx,$(true),CXX,3) $(call gb_Helper_abbreviate_dirs_native,\ @@ -298,13 +307,14 @@ $(call gb_Helper_abbreviate_dirs_native,\ $(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), $(gb_CXX)) \ $(DEFS) \ $(T_CXXFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \ -Fd$(PDBFILE) \ $(gb_COMPILERDEPFLAGS) \ - -I$(realpath $(dir $(3))) \ + -I$(dir $(3)) \ $(INCLUDE_STL) $(INCLUDE) \ $(if $(filter YES,$(CXXOBJECT_X64)), -U_X86_ -D_AMD64_,) \ - -c $(realpath $(3)) \ - -Fo$(1)) $(call gb_create_deps,$(1),$(4),$(realpath $(3))) + -c $(3) \ + -Fo$(1)) $(call gb_create_deps,$(4),$(1),$(3)) endef @@ -317,14 +327,14 @@ $(call gb_Output_announce,$(2),$(true),ASM,3) $(call gb_Helper_abbreviate_dirs_native,\ mkdir -p $(dir $(1)) $(dir $(4)) && \ "$(ML_EXE)" $(gb_AFLAGS) -D$(COM) /Fo$(1) $(3)) && \ - echo "$(1) : $(realpath $(3))" > $(4) + echo "$(1) : $(3)" > $(4) endef # LinkTarget class -gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) -gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) gb_LinkTarget_INCLUDE :=\ $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) \ @@ -362,16 +372,18 @@ $(call gb_Helper_abbreviate_dirs_native,\ $(if $(filter-out StaticLibrary,$(TARGETTYPE)),user32.lib) \ $(if $(DLLTARGET),-out:$(DLLTARGET) -implib:$(1),-out:$(1)); RC=$$?; rm $${RESPONSEFILE} \ $(if $(DLLTARGET),; if [ ! -f $(DLLTARGET) ]; then rm -f $(1) && false; fi) \ - $(if $(filter Executable,$(TARGETTYPE)),; if [ -f $@.manifest ]; then mt.exe $(MTFLAGS) -manifest $@.manifest -outputresource:$@\;1; fi) ; exit $$RC) + $(if $(filter Library,$(TARGETTYPE)),; if [ -f $(DLLTARGET).manifest ]; then mt.exe $(MTFLAGS) -manifest $(DLLTARGET).manifest -outputresource:$(DLLTARGET)\;2; fi) \ + $(if $(filter Executable,$(TARGETTYPE)),; if [ -f $(1).manifest ]; then mt.exe $(MTFLAGS) -manifest $(1).manifest -outputresource:$(1)\;1; fi) \ + ; exit $$RC) endef # Flags common for PE executables (EXEs and DLLs) gb_Windows_PE_TARGETTYPEFLAGS := \ - -release \ - -opt:noref \ - -incremental:no \ - -debug \ + -release \ + -opt:noref \ + -incremental:no \ + -debug \ -nxcompat \ -dynamicbase \ @@ -380,8 +392,8 @@ gb_Windows_PE_TARGETTYPEFLAGS := \ gb_Library_DEFS := -D_DLL gb_Library_TARGETTYPEFLAGS := \ - -DLL \ - $(gb_Windows_PE_TARGETTYPEFLAGS) + -DLL \ + $(gb_Windows_PE_TARGETTYPEFLAGS) gb_Library_get_rpath := @@ -468,8 +480,9 @@ $(call gb_LinkTarget_add_auxtargets,$(2),\ $(patsubst %.dll,%.ilk,$(3)) \ ) +$(if $(filter $(gb_MERGEDLIBS),$(1)),,\ $(call gb_Library_get_target,$(1)) \ -$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3)) +$(call gb_Library_get_clean_target,$(1)) : AUXTARGETS := $(OUTDIR)/bin/$(notdir $(3))) ifneq ($(ENABLE_CRASHDUMP),) $(call gb_Library_get_target,$(1)) \ @@ -481,7 +494,7 @@ endif $(call gb_Library_add_default_nativeres,$(1),$(1)/default) -$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3),$(1)) +$(if $(filter $(gb_MERGEDLIBS),$(1)),,$(call gb_Deliver_add_deliverable,$(OUTDIR)/bin/$(notdir $(3)),$(3),$(1))) $(call gb_LinkTarget_get_target,$(2)) \ $(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile,$(2)) @@ -655,7 +668,6 @@ $(call gb_Helper_abbreviate_dirs_native,\ -v OUTDIR=$(OUTDIR)/ \ -v WORKDIR=$(WORKDIR)/ \ -v SRCDIR=$(SRCDIR)/ \ - -v REPODIR=$(REPODIR)/ \ > $(call gb_SrsPartTarget_get_dep_target,$(1))) endef else @@ -672,7 +684,6 @@ $(call gb_Helper_abbreviate_dirs_native,\ mkdir -p $(dir $(1)) && \ $(gb_RC) \ $(DEFS) $(FLAGS) \ - -I$(dir $(3)) \ $(INCLUDE) \ -Fo$(1) \ $(RCFILE) ) @@ -695,7 +706,6 @@ $(call gb_Helper_abbreviate_dirs_native,\ -v OUTDIR=$(OUTDIR)/ \ -v WORKDIR=$(WORKDIR)/ \ -v SRCDIR=$(SRCDIR)/ \ - -v REPODIR=$(REPODIR)/ \ > $(call gb_WinResTarget_get_dep_target,$(1))) endef else @@ -703,6 +713,6 @@ gb_WinResTarget__command_dep = endif # Python -gb_PYTHON_PRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" PYTHONHOME="$(OUTDIR)/lib/python" PYTHONPATH="$(OUTDIR)/lib/python;$(OUTDIR)/lib/python/lib-dynload" +gb_PYTHON_PRECOMMAND := PATH="$${PATH}:$(shell cygpath -m $(OUTDIR)/bin)" PYTHONHOME="$(shell cygpath -m $(OUTDIR))/lib/python" PYTHONPATH="$(shell cygpath -m $(OUTDIR))/lib/python;$(shell cygpath -m $(OUTDIR))/lib/python/lib-dynload" # vim: set noet sw=4: diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk index da909489baaf..b8de73e62df5 100644 --- a/solenv/gbuild/platform/com_GCC_class.mk +++ b/solenv/gbuild/platform/com_GCC_class.mk @@ -32,6 +32,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(DEFS) \ $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \ $(T_CFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -MMD -MT $(1) \ @@ -51,6 +52,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(DEFS) \ $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \ $(T_CXXFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -MMD -MT $(1) \ diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk index f2bf866e7046..4018ebc6e50b 100644 --- a/solenv/gbuild/platform/com_GCC_defs.mk +++ b/solenv/gbuild/platform/com_GCC_defs.mk @@ -107,14 +107,24 @@ gb_CFLAGS_WERROR := -Werror -DLIBO_WERROR gb_CXXFLAGS_WERROR := -Werror -DLIBO_WERROR endif +ifeq ($(MERGELIBS),TRUE) +gb_CFLAGS_COMMON += -DLIBO_MERGELIBS +gb_CXXFLAGS_COMMON += -DLIBO_MERGELIBS +endif + ifeq ($(ENABLE_LTO),TRUE) gb_Library_LTOFLAGS := -flto endif gb_LinkTarget_EXCEPTIONFLAGS := \ -DEXCEPTIONS_ON \ - -fexceptions \ - -fno-enforce-eh-specs \ + -fexceptions + +# Clang doesn't have this option +ifneq ($(COM_GCC_IS_CLANG),TRUE) +gb_LinkTarget_EXCEPTIONFLAGS += \ + -fno-enforce-eh-specs +endif gb_LinkTarget_NOEXCEPTIONFLAGS := \ -DEXCEPTIONS_OFF \ @@ -159,4 +169,14 @@ define gb_Helper_convert_native $(1) endef +# Convert path to native notation +define gb_Helper_native_path +$(1) +endef + gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/lib +gb_Helper_OUTDIR_FOR_BUILDLIBDIR := $(OUTDIR_FOR_BUILD)/lib + +gb_Helper_abbreviate_dirs_native = $(gb_Helper_abbreviate_dirs) + +gb_Helper_get_rcfile = $(1)rc diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk index 13abade7d908..22a1fa8e94d9 100644 --- a/solenv/gbuild/platform/macosx.mk +++ b/solenv/gbuild/platform/macosx.mk @@ -51,6 +51,11 @@ gb_COMPILERDEFS += \ -DHAVE_GCC_VISIBILITY_FEATURE \ +ifeq ($(HAVE_SFINAE_ANONYMOUS_BROKEN),TRUE) +gb_COMPILERDEFS += \ + -DHAVE_SFINAE_ANONYMOUS_BROKEN \ + +endif gb_CFLAGS := \ -isysroot $(gb_SDKDIR) \ @@ -59,6 +64,9 @@ gb_CFLAGS := \ -fno-strict-aliasing \ #-Wshadow \ break in compiler headers already +# For -Wno-non-virtual-dtor see <http://markmail.org/message/664jsoqe6n6smy3b> +# "Re: [dev] warnings01: -Wnon-virtual-dtor" message to dev@openoffice.org from +# Feb 1, 2006: gb_CXXFLAGS := \ -isysroot $(gb_SDKDIR) \ $(gb_CXXFLAGS_COMMON) \ @@ -110,6 +118,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(gb_CXX) \ $(DEFS) \ $(T_OBJCXXFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -MMD -MT $(1) \ @@ -127,6 +136,7 @@ $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(call gb_ObjCObject_get_dep_target,$(2))) && \ $(gb_CC) \ $(DEFS) $(T_OBJCFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ -MMD -MT $(call gb_ObjCObject_get_target,$(2)) \ @@ -155,10 +165,10 @@ $(if $(3),-install_name '$(3)$(1)$(if $(2),.$(2))', $(call gb_Output_error,cannot determine -install_name for $(3))) endef -gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) -gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) -gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) $(gb_OBJCXXFLAGS) -gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) $(gb_OBJCFLAGS) $(gb_COMPILEROPTFLAGS) +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) +gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) +gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) $(gb_COMPILEROPTFLAGS) ifeq ($(gb_SYMBOL),$(true)) gb_LinkTarget_CFLAGS += -g diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index c826beae46b7..3e10ca79d012 100644 --- a/solenv/gbuild/platform/solaris.mk +++ b/solenv/gbuild/platform/solaris.mk @@ -26,23 +26,17 @@ # #************************************************************************* -# FIXME: this is currently hardcoded to SunStudio. -# We really don't want to support building with that because of all its -# bugs that need painful work-arounds; if somebody revives the Solaris -# port then please make it use GCC instead (there used to be a Solaris/GCC -# port at some point in the past, see solenv/inc/unxsog{i,s}.mk). - GUI := UNX -COM := C52 + +gb_Executable_EXT:= + +include $(GBUILDDIR)/platform/com_GCC_defs.mk gb_MKTEMP := mktemp -t gbuild.XXXXXX -gb_CC := cc -gb_CXX := CC -gb_GCCP := cc -gb_AR := ar -gb_AWK := /usr/xpg4/bin/awk -gb_CLASSPATHSEP := : +ifneq ($(origin AR),default) +gb_AR := $(AR) +endif # use CC/CXX if they are nondefaults ifneq ($(origin CC),default) @@ -53,9 +47,12 @@ ifneq ($(origin CXX),default) gb_CXX := $(CXX) endif +ifeq ($(CPUNAME),SPARC) +gb_CPUDEFS := -D__sparcv8plus +endif + gb_OSDEFS := \ -D$(OS) \ - -D$(GUI) \ -DSYSV \ -DSUN \ -DSUN4 \ @@ -63,135 +60,158 @@ gb_OSDEFS := \ -D_POSIX_PTHREAD_SEMANTICS \ -D_PTHREADS \ -DUNIX \ + -DUNX \ + $(PTHREAD_CFLAGS) \ -gb_COMPILERDEFS := \ - -D$(COM) \ - -DCPPU_ENV=sunpro5 \ - -ifeq ($(CPUNAME),SPARC) -gb_CPUDEFS := -D__sparcv8plus +ifeq ($(GXX_INCLUDE_PATH),) +GXX_INCLUDE_PATH=$(COMPATH)/include/c++/$(shell gcc -dumpversion) endif gb_CFLAGS := \ - -temp=/tmp \ - -KPIC \ - -mt \ - -xldscope=hidden \ - -xCC \ - -xc99=none \ + $(gb_CFLAGS_COMMON) \ + -fPIC \ + -Wdeclaration-after-statement \ + -Wshadow \ 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_CXXFLAGS_COMMON) \ + -fPIC \ + -Wshadow \ + -Wsign-promo \ + -Woverloaded-virtual \ + -Wno-non-virtual-dtor \ + +ifeq ($(HAVE_GCC_VISIBILITY_FEATURE),TRUE) +gb_COMPILERDEFS += \ + -DHAVE_GCC_VISIBILITY_FEATURE \ + +gb_CFLAGS += \ + -fvisibility=hidden + +gb_CXXFLAGS += \ + -fvisibility=hidden \ + +ifneq ($(HAVE_GCC_VISIBILITY_BROKEN),TRUE) +gb_CXXFLAGS += \ + -fvisibility-inlines-hidden \ -ifeq ($(gb_SYMBOL),$(true)) -gb_CFLAGS += -g -xs -gb_CXXFLAGS += -g0 -xs endif -ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE) -gb_CFLAGS_WERROR := -errwarn=%all -gb_CXXFLAGS_WERROR := -xwe endif -gb_LinkTarget_EXCEPTIONFLAGS := \ - -DEXCEPTIONS_ON \ +# enable debug STL +ifeq ($(gb_PRODUCT),$(false)) +gb_COMPILERDEFS += \ + -D_GLIBCXX_DEBUG \ -gb_LinkTarget_NOEXCEPTIONFLAGS := \ - -DEXCEPTIONS_OFF \ - -noex \ +endif -gb_LinkTarget_LDFLAGS := \ - $(subst -L../lib , ,$(SOLARLIB)) \ - -temp=/tmp \ - -w \ - -mt \ - -Bdirect \ - -z defs \ - -z combreloc \ - -norunpath \ - -PIC \ - -library=no%Cstd \ - - -gb_DEBUG_CFLAGS := -g -ifneq ($(gb_DEBUGLEVEL),0) -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 +gb_CCVER := $(shell $(gb_CC) -dumpversion | $(gb_AWK) -F. -- '{ print $$1*10000+$$2*100+$$3 }') +gb_GccLess460 := $(shell expr $(gb_CCVER) \< 40600) + +#At least SLED 10.2 gcc 4.3 overly agressively optimizes uno::Sequence into +#junk, so only strict-alias on >= 4.6.0 +gb_StrictAliasingUnsafe := $(gb_GccLess460) + +ifeq ($(gb_StrictAliasingUnsafe),1) +gb_CFLAGS += -fno-strict-aliasing +gb_CXXFLAGS += -fno-strict-aliasing +endif + +ifeq ($(HAVE_CXX0X),TRUE) +#Currently, as well as for its own merits, c++11/c++0x mode allows use to use +#a template for SAL_N_ELEMENTS to detect at compiler time its misuse +gb_CXXFLAGS += -std=c++0x + +#We have so many std::auto_ptr uses that we need to be able to disable +#warnings for those so that -Werror continues to be useful, seeing as moving +#to unique_ptr isn't an option when we must support different compilers + +#When we are using 4.6.0 we can use gcc pragmas to selectively silence auto_ptr +#warnings in isolation, but for <= 4.5.X we need to globally disable +#deprecation +ifeq ($(gb_GccLess460),1) +gb_CXXFLAGS += -Wno-deprecated-declarations endif endif -gb_COMPILERNOOPTFLAGS := +ifeq ($(ENABLE_LTO),TRUE) +gb_LinkTarget_LDFLAGS += -fuse-linker-plugin $(gb_COMPILERDEFAULTOPTFLAGS) +endif -# Helper class +ifneq ($(strip $(SYSBASE)),) +gb_CXXFLAGS += --sysroot=$(SYSBASE) +gb_CFLAGS += --sysroot=$(SYSBASE) +gb_LinkTarget_LDFLAGS += \ + -Wl,--sysroot=$(SYSBASE) +endif -gb_Helper_set_ld_path := LD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib +#JAD# -Wl,-rpath-link,$(SYSBASE)/lib:$(SYSBASE)/usr/lib \ +gb_LinkTarget_LDFLAGS += \ + -L$(SYSBASE)/lib \ + -L$(SYSBASE)/usr/lib \ + -Wl,-z,combreloc \ + $(subst -L../lib , ,$(SOLARLIB)) \ -# $(1): list of directory pathnames to append at the end of the ld path -define gb_Helper_extend_ld_path -$(gb_Helper_set_ld_path)$(foreach dir,$(1),:$(dir)) -endef +ifeq ($(HAVE_LD_HASH_STYLE),TRUE) +gb_LinkTarget_LDFLAGS += \ + -Wl,--hash-style=$(WITH_LINKER_HASH_STYLE) \ -# convert parameters filesystem root to native notation -# does some real work only on windows, make sure not to -# break the dummy implementations on unx* -define gb_Helper_convert_native +endif + +# Convert path to native notation +define gb_Helper_native_path $(1) endef -gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/lib +ifneq ($(HAVE_LD_BSYMBOLIC_FUNCTIONS),) +gb_LinkTarget_LDFLAGS += \ + -Wl,--dynamic-list-cpp-new \ + -Wl,--dynamic-list-cpp-typeinfo \ + -Wl,-Bsymbolic-functions \ -# CObject class +endif -define gb_CObject__command -$(call gb_Output_announce,$(2).c,$(true),C ,3) -$(call gb_Helper_abbreviate_dirs,\ - rm -f $(4) && \ - mkdir -p $(dir $(1)) $(dir $(4)) && \ - $(gb_CC) \ - -c $(3) \ - -o $(1) \ - -xMMD \ - -xMF $(4) \ - $(DEFS) \ - $(T_CFLAGS) \ - -I$(dir $(3)) \ - $(INCLUDE)) -endef +ifneq ($(gb_SYMBOL),$(true)) +ifeq ($(gb_STRIP),$(true)) +gb_LinkTarget_LDFLAGS += -Wl,--strip-all +endif +endif + +ifneq ($(gb_DEBUGLEVEL),0) +gb_COMPILEROPTFLAGS := -O0 +gb_LINKEROPTFLAGS := +else +gb_COMPILEROPTFLAGS := $(gb_COMPILERDEFAULTOPTFLAGS) +gb_LINKEROPTFLAGS := -Wl,-O1 +endif + +gb_DEBUG_CFLAGS := -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline +gb_COMPILERNOOPTFLAGS := -O0 -# CxxObject class +# AsmObject class -define gb_CxxObject__command -$(call gb_Output_announce,$(2).cxx,$(true),CXX,3) +gb_AsmObject_get_source = $(1)/$(2).s + +# $(call gb_AsmObject__command,object,relative-source,source,dep-file) +define gb_AsmObject__command +$(call gb_Output_announce,$(2),$(true),ASM,3) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) $(dir $(4)) && \ - $(gb_CXX) \ + $(gb_CC) \ $(DEFS) \ - $(T_CXXFLAGS) \ + $(T_CFLAGS) \ + $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ -c $(3) \ -o $(1) \ - -xMMD \ - -xMF $(4) \ + -MMD -MT $(1) \ + -MP -MF $(4) \ -I$(dir $(3)) \ - $(INCLUDE_STL) $(INCLUDE)) + $(INCLUDE)) && \ + echo "$(1) : $(3)" > $(4) endef - # LinkTarget class define gb_LinkTarget__get_rpath_for_layer @@ -208,28 +228,31 @@ gb_LinkTarget__RPATHS := \ gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) +ifeq ($(gb_SYMBOL),$(true)) +gb_LinkTarget_CXXFLAGS += -ggdb2 +gb_LinkTarget_CFLAGS += -ggdb2 +endif -gb_LinkTarget_INCLUDE := $(filter-out %/stl, $(subst -I. , ,$(SOLARINC))) -gb_LinkTarget_INCLUDE_STL := $(filter %/stl, $(subst -I. , ,$(SOLARINC))) - +# note that `cat $(extraobjectlist)` is needed to build with older gcc versions, e.g. 4.1.2 on SLED10 +# we want to use @$(extraobjectlist) in the long run define gb_LinkTarget__command_dynamiclink $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $(1)) && \ $(gb_CXX) \ $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ - $(if $(SOVERSIONSCRIPT),-M $(SOVERSIONSCRIPT)) \ + $(if $(filter Library,$(TARGETTYPE)),$(gb_Library_LTOFLAGS)) \ $(subst \d,$$,$(RPATH)) \ $(T_LDFLAGS) \ - $(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ + $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ - $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),@$(extraobjectlist)) \ - $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \ - $(LIBS) \ - -o $(if $(SOVERSION),$(1).$(SOVERSION),$(1))) - $(if $(SOVERSION),ln -sf $(notdir $(1)).$(SOVERSION) $(1)) + $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \ + -Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \ + $(LIBS) -lnsl -lsocket \ + $(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib))))) \ + -o $(1)) endef define gb_LinkTarget__command_staticlink @@ -238,8 +261,10 @@ $(call gb_Helper_abbreviate_dirs,\ $(gb_AR) -rsu $(1) \ $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ + $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ + $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),@$(extraobjectlist)) \ $(if $(findstring s,$(MAKEFLAGS)),2> /dev/null)) endef @@ -249,40 +274,34 @@ $(if $(filter Library CppunitTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget $(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1))) endef + # Library class gb_Library_DEFS := -gb_Library_TARGETTYPEFLAGS := -Bdynamic -z text -G +gb_Library_TARGETTYPEFLAGS := -shared gb_Library_SYSPRE := lib gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_ gb_Library_PLAINEXT := .so gb_Library_DLLEXT := .so -gb_Library_RTEXT := C52$(gb_Library_PLAINEXT) +gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT) gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT) gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT) -gb_STDLIBS := \ - Crun \ - m \ - c \ - gb_Library_PLAINLIBS_NONE += \ - $(gb_STDLIBS) \ dl \ fontconfig \ freetype \ GL \ GLU \ - jpeg \ + ICE \ m \ - nsl \ pthread \ - socket \ - X11 \ - Xext \ SM \ ICE \ + X11 \ + Xext \ + Xrender \ gb_Library_FILENAMES := \ $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \ @@ -307,7 +326,9 @@ gb_Library_LAYER := \ $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \ define gb_Library_get_rpath -'-R$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))' +'-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))' \ +'-L$(gb_Library_OUTDIRLOCATION)' +#JAD#'-Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION)' endef define gb_Library_Library_platform @@ -342,7 +363,9 @@ gb_Executable_LAYER := \ define gb_Executable_get_rpath -'-R$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Executable_get_layer,$(1)))' +'-Wl,-rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Executable_get_layer,$(1)))' \ +-L$(gb_Library_OUTDIRLOCATION) +#JAD#-Wl,-rpath-link,$(gb_Library_OUTDIRLOCATION) endef define gb_Executable_Executable_platform @@ -368,34 +391,42 @@ endef # JunitTest class +ifneq ($(OOO_TEST_SOFFICE),) +gb_JunitTest_SOFFICEARG:=$(OOO_TEST_SOFFICE) +else +ifneq ($(gb_JunitTest_DEBUGRUN),) +gb_JunitTest_SOFFICEARG:=connect:pipe,name=$(USER) +else +gb_JunitTest_SOFFICEARG:=path:$(OUTDIR)/installation/opt/program/soffice +endif +endif + define gb_JunitTest_JunitTest_platform $(call gb_JunitTest_get_target,$(1)) : DEFS := \ - -Dorg.openoffice.test.arg.soffice="$$$${OOO_TEST_SOFFICE:-path:$(OUTDIR)/installation/opt/program/soffice}" \ - -Dorg.openoffice.test.arg.env=LD_LIBRARY_PATH \ + -Dorg.openoffice.test.arg.env=$(gb_Helper_LIBRARY_PATH_VAR) \ -Dorg.openoffice.test.arg.user=file://$(call gb_JunitTest_get_userdir,$(1)) \ -Dorg.openoffice.test.arg.workdir=$(call gb_JunitTest_get_userdir,$(1)) \ + -Dorg.openoffice.test.arg.postprocesscommand=$(GBUILDDIR)/platform/unxgcc_gdbforjunit.sh \ + -Dorg.openoffice.test.arg.soffice="$(gb_JunitTest_SOFFICEARG)" \ endef -# 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,\ - $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \ - $(INCLUDE) \ - $(DEFS) \ - $(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))) +# Module class + +define gb_Module_DEBUGRUNCOMMAND +OFFICESCRIPT=`mktemp` && \ +printf ". $(OUTDIR)/installation/opt/program/ooenv\\n" > $${OFFICESCRIPT} && \ +printf "gdb --tui $(OUTDIR)/installation/opt/program/soffice.bin" >> $${OFFICESCRIPT} && \ +printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' -env:UserInstallation=file://$(OUTDIR)/installation/\"" >> $${OFFICESCRIPT} && \ +printf " -ex \"r\"\\n" >> $${OFFICESCRIPT} && \ +$(SHELL) $${OFFICESCRIPT} && \ +rm $${OFFICESCRIPT} endef + # Python gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME=$(OUTDIR)/lib/python PYTHONPATH=$(OUTDIR)/lib/python:$(OUTDIR)/lib/python/lib-dynload +include $(GBUILDDIR)/platform/com_GCC_class.mk + # vim: set noet sw=4: diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk index a22d23410496..5fb5f57adede 100644 --- a/solenv/gbuild/platform/unxgcc.mk +++ b/solenv/gbuild/platform/unxgcc.mk @@ -32,6 +32,9 @@ gb_Executable_EXT:= include $(GBUILDDIR)/platform/com_GCC_defs.mk +gb_CCVER := $(shell $(gb_CC) -dumpversion | $(gb_AWK) -F. -- '{ print $$1*10000+$$2*100+$$3 }') +gb_GccLess460 := $(shell expr $(gb_CCVER) \< 40600) + gb_MKTEMP := mktemp -t gbuild.XXXXXX ifneq ($(origin AR),default) @@ -61,7 +64,21 @@ gb_CXXFLAGS := \ -Wshadow \ -Wsign-promo \ -Woverloaded-virtual \ - -Wno-non-virtual-dtor \ + +ifneq ($(COM_GCC_IS_CLANG),TRUE) +# Only GCC 4.6 has a fix for <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7302> +# "-Wnon-virtual-dtor should't complain of protected dtor" and supports #pragma +# GCC diagnostic push/pop required e.g. in cppuhelper/propertysetmixin.hxx to +# silence warnings about a protected, non-virtual dtor in a class with virtual +# members and friends: +ifeq ($(gb_GccLess460),1) +gb_CXXFLAGS += -Wno-non-virtual-dtor +else +gb_CXXFLAGS += -Wnon-virtual-dtor +endif +else +gb_CXXFLAGS += -Wnon-virtual-dtor +endif ifeq ($(HAVE_GCC_VISIBILITY_FEATURE),TRUE) gb_COMPILERDEFS += \ @@ -81,6 +98,12 @@ endif endif +ifeq ($(HAVE_SFINAE_ANONYMOUS_BROKEN),TRUE) +gb_COMPILERDEFS += \ + -DHAVE_SFINAE_ANONYMOUS_BROKEN \ + +endif + # enable debug STL ifeq ($(gb_PRODUCT),$(false)) gb_COMPILERDEFS += \ @@ -88,9 +111,6 @@ gb_COMPILERDEFS += \ endif -gb_CCVER := $(shell $(gb_CC) -dumpversion | $(gb_AWK) -F. -- '{ print $$1*10000+$$2*100+$$3 }') -gb_GccLess460 := $(shell expr $(gb_CCVER) \< 40600) - #At least SLED 10.2 gcc 4.3 overly agressively optimizes uno::Sequence into #junk, so only strict-alias on >= 4.6.0 gb_StrictAliasingUnsafe := $(gb_GccLess460) @@ -103,7 +123,7 @@ endif ifeq ($(HAVE_CXX0X),TRUE) #Currently, as well as for its own merits, c++11/c++0x mode allows use to use #a template for SAL_N_ELEMENTS to detect at compiler time its misuse -gb_CXXFLAGS += -std=c++0x +gb_CXXFLAGS += -std=gnu++0x #We have so many std::auto_ptr uses that we need to be able to disable #warnings for those so that -Werror continues to be useful, seeing as moving @@ -161,7 +181,15 @@ gb_COMPILEROPTFLAGS := $(gb_COMPILERDEFAULTOPTFLAGS) gb_LINKEROPTFLAGS := -Wl,-O1 endif -gb_DEBUG_CFLAGS := -ggdb2 -finline-limit=0 -fno-inline -fno-default-inline +# clang does not know -ggdb2 +ifneq ($(COM_GCC_IS_CLANG),TRUE) +GGDB2=-ggdb2 +else +GGDB2=-g2 +endif + +gb_DEBUG_CFLAGS := $(GGDB2) -finline-limit=0 -fno-inline +gb_DEBUG_CXXFLAGS := -fno-default-inline gb_COMPILERNOOPTFLAGS := -O0 @@ -200,12 +228,12 @@ gb_LinkTarget__RPATHS := \ SDKBIN:\dORIGIN/../../ure-link/lib \ NONE:\dORIGIN/../lib:\dORIGIN \ -gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) -gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR) +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) ifeq ($(gb_SYMBOL),$(true)) -gb_LinkTarget_CXXFLAGS += -ggdb2 -gb_LinkTarget_CFLAGS += -ggdb2 +gb_LinkTarget_CXXFLAGS += $(GGDB2) +gb_LinkTarget_CFLAGS += $(GGDB2) endif # note that `cat $(extraobjectlist)` is needed to build with older gcc versions, e.g. 4.1.2 on SLED10 @@ -393,7 +421,7 @@ endef define gb_Module_DEBUGRUNCOMMAND OFFICESCRIPT=`mktemp` && \ -printf ". $(OUTDIR)/installation/opt/program/ooenv\\n" > $${OFFICESCRIPT} && \ +printf 'if [ -e $(OUTDIR)/installation/opt/program/ooenv ]; then . $(OUTDIR)/installation/opt/program/ooenv; fi\n' > $${OFFICESCRIPT} && \ printf "gdb --tui $(OUTDIR)/installation/opt/program/soffice.bin" >> $${OFFICESCRIPT} && \ printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' -env:UserInstallation=file://$(OUTDIR)/installation/\"" >> $${OFFICESCRIPT} && \ printf " -ex \"r\"\\n" >> $${OFFICESCRIPT} && \ diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk index 5207cb506729..7cfe7d8b33da 100644 --- a/solenv/gbuild/platform/windows.mk +++ b/solenv/gbuild/platform/windows.mk @@ -27,7 +27,7 @@ GUI := WNT -gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/bin +gb_Helper_get_rcfile = $(1).ini gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX diff --git a/solenv/gbuild/processdeps.awk b/solenv/gbuild/processdeps.awk index 9014427fa461..e564b0babd76 100644 --- a/solenv/gbuild/processdeps.awk +++ b/solenv/gbuild/processdeps.awk @@ -31,7 +31,6 @@ # -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: @@ -40,7 +39,6 @@ # - 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/... @@ -51,7 +49,6 @@ function mangle_path(path) { 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; @@ -61,11 +58,9 @@ BEGIN { WORKDIR = tolower(substr(WORKDIR,0,1)) substr(WORKDIR,2); OUTDIR = tolower(substr(OUTDIR,0,1)) substr(OUTDIR,2); SRCDIR = tolower(substr(SRCDIR,0,1)) substr(SRCDIR,2); - REPODIR = tolower(substr(REPODIR,0,1)) substr(REPODIR,2); # print "# WORKDIR=" WORKDIR; # print "# OUTDIR=" OUTDIR; # print "# SRCDIR=" SRCDIR; -# print "# REPODIR=" REPODIR; print mangle_path(OBJECTFILE) ": \\"; } diff --git a/solenv/gbuild/source_and_rerun.mk b/solenv/gbuild/source_and_rerun.mk deleted file mode 100644 index 4d8101a0c3b5..000000000000 --- a/solenv/gbuild/source_and_rerun.mk +++ /dev/null @@ -1,35 +0,0 @@ - -gb_MAKEFILEDIR:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) - -define gb_SourceEnvAndRecurse_recurse -$(MAKE) -f $(firstword $(MAKEFILE_LIST)) -j $${GMAKE_PARALLELISM} $(1) gb_SourceEnvAndRecurse_STAGE=$(2) -endef - -ifneq ($(strip $(gb_PARTIALBUILD)),) - -SRCDIR:=$(realpath $(gb_MAKEFILEDIR)/..) -gb_SourceEnvAndRecurse_reconfigure=true -gb_SourceEnvAndRecurse_buildpl=true - -else - -SRCDIR:=$(realpath $(gb_MAKEFILEDIR)) -gb_SourceEnvAndRecurse_reconfigure=$(call gb_SourceEnvAndRecurse_recurse,$(SRCDIR)/Env.Host.sh,reconfigure) -gb_SourceEnvAndRecurse_buildpl=$(call gb_SourceEnvAndRecurse_recurse,$(MAKECMDGOALS),buildpl) - -endif - -source-env-and-recurse: - @$(gb_SourceEnvAndRecurse_reconfigure) && \ - if test -f $(SRCDIR)/config_host.mk ; then . $(SRCDIR)/config_host.mk; fi && \ - if test -f $(SRCDIR)/Env.Host.sh; then . $(SRCDIR)/Env.Host.sh; fi && \ - if test -z "$${SOLARENV}"; then echo "no configuration found and could not create one" && exit 1; fi && \ - $(gb_SourceEnvAndRecurse_buildpl) && \ - $(call gb_SourceEnvAndRecurse_recurse,$(MAKECMDGOALS),gbuild) \ - - -ifneq ($(strip $(MAKECMDGOALS)),) -ifneq ($(MAKECMDGOALS),$(SRCDIR)/Env.Host.sh) -$(eval $(MAKECMDGOALS) : source-env-and-recurse) -endif -endif diff --git a/solenv/gbuild/templates/Makefile b/solenv/gbuild/templates/Makefile index f9ac01ef0747..841c9b4b7ad4 100644 --- a/solenv/gbuild/templates/Makefile +++ b/solenv/gbuild/templates/Makefile @@ -1,39 +1,8 @@ # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -ifeq ($(strip $(SOLARENV)),) -include $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/../solenv/gbuild/source_and_rerun.mk -else +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) -gb_PARTIALBUILD := T -include $(SOLARENV)/gbuild/gbuild.mk +include $(module_directory)/../solenv/gbuild/partial_build.mk -$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk))) - -endif # vim: set noet sw=4 ts=4: + diff --git a/solenv/gbuild/templates/makefile.mk b/solenv/gbuild/templates/makefile.mk index d4cf94ec9f4e..0997622e00f6 100644 --- a/solenv/gbuild/templates/makefile.mk +++ b/solenv/gbuild/templates/makefile.mk @@ -1,40 +1 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General 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=.. -TARGET=prj - -.INCLUDE : settings.mk - -.IF "$(VERBOSE)"!="" -VERBOSEFLAG := -.ELSE -VERBOSEFLAG := -s -.ENDIF - -all: - cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(GMAKE_MODULE_PARALLELISM) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog +.INCLUDE : gbuildbridge.mk diff --git a/solenv/gdb/libreoffice/__init__.py b/solenv/gdb/libreoffice/__init__.py index a3b4f4b7ca6b..9175812a6190 100644 --- a/solenv/gdb/libreoffice/__init__.py +++ b/solenv/gdb/libreoffice/__init__.py @@ -1,4 +1,4 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # Version: MPL 1.1 / GPLv3+ / LGPLv3+ # # The contents of this file are subject to the Mozilla Public License Version diff --git a/solenv/gdb/libreoffice/cppu.py b/solenv/gdb/libreoffice/cppu.py index 340325163cc5..852281f8d6e9 100644 --- a/solenv/gdb/libreoffice/cppu.py +++ b/solenv/gdb/libreoffice/cppu.py @@ -1,4 +1,4 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # Version: MPL 1.1 / GPLv3+ / LGPLv3+ # # The contents of this file are subject to the Mozilla Public License Version diff --git a/solenv/gdb/libreoffice/sal.py b/solenv/gdb/libreoffice/sal.py index df87ed5521cb..e26c008c0e7d 100644 --- a/solenv/gdb/libreoffice/sal.py +++ b/solenv/gdb/libreoffice/sal.py @@ -1,4 +1,4 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # Version: MPL 1.1 / GPLv3+ / LGPLv3+ # # The contents of this file are subject to the Mozilla Public License Version @@ -26,6 +26,7 @@ # instead of those above. import gdb +import gdb.types from libreoffice.util import printing from libreoffice.util.string import StringPrinterHelper @@ -90,6 +91,69 @@ class RtlReferencePrinter(object): else: return "empty %s" % self.typename +class OslFileStatusPrinter(object): + '''Prints oslFileStatus''' + + def __init__(self, typename, val): + self.val = val + + def to_string(self): + osl_file_type = gdb.lookup_type('oslFileType').strip_typedefs() + fields_to_enum_val = gdb.types.make_enum_dict(osl_file_type) + + etype = self.field_val_if_valid('eType') + if etype is not None: + pretty_etype = '<unknown type>' # in case it's not one of the fields + + for field_name, field_val in fields_to_enum_val.iteritems(): + if etype == field_val: + pretty_etype = self.pretty_file_type(field_name) + else: + pretty_etype = '<invalid type>' + + file_url = self.field_val_if_valid('ustrFileURL') + if file_url is not None: + pretty_file_url = str(file_url.dereference()) + else: + pretty_file_url = '<invalid file url>' + + pretty_file_status = pretty_etype + ': ' + pretty_file_url + + # for links append the link target if valid + if etype == fields_to_enum_val['osl_File_Type_Link']: + link_target = self.field_val_if_valid('ustrLinkTargetURL') + if link_target is None: + pretty_link_target = '<invalid link target>' + else: + pretty_link_target = str(link_target.dereference()) + + pretty_file_status += ' -> ' + pretty_link_target + + return pretty_file_status + + def pretty_file_type(self, file_type_name): + if file_type_name != 'osl_File_Type_Regular': + return file_type_name.replace('osl_File_Type_', '').lower() + else: + return 'file' # regular is not very descriptive, file is better + + def field_val_if_valid(self, field): + mask_for_field = {'eType': 0x00000001, + 'uAttributes': 0x00000002, + 'aCreationTime': 0x00000010, + 'aAccessTime': 0x00000020, + 'aModifyTime': 0x00000040, + 'uFileSize': 0x00000080, + 'ustrFileName': 0x00000100, + 'ustrFileURL': 0x00000200, + 'ustrLinkTargetURL': 0x00000400} + + valid_fields = self.val['uValidFields'] + if valid_fields & mask_for_field[field]: + return self.val[field] + else: + return None + printer = None def build_pretty_printers(): @@ -109,6 +173,7 @@ def build_pretty_printers(): # other stuff printer.add('rtl::Reference', RtlReferencePrinter) + printer.add('_oslFileStatus', OslFileStatusPrinter) return printer diff --git a/solenv/gdb/libreoffice/svl.py b/solenv/gdb/libreoffice/svl.py index 57d60d9374b1..cfb22f9ce765 100644 --- a/solenv/gdb/libreoffice/svl.py +++ b/solenv/gdb/libreoffice/svl.py @@ -1,4 +1,4 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # Version: MPL 1.1 / GPLv3+ / LGPLv3+ # # The contents of this file are subject to the Mozilla Public License Version diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py index 8f25522c9dee..5007d0d3fe9e 100644 --- a/solenv/gdb/libreoffice/sw.py +++ b/solenv/gdb/libreoffice/sw.py @@ -1,4 +1,4 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # Version: MPL 1.1 / GPLv3+ / LGPLv3+ # # The contents of this file are subject to the Mozilla Public License Version @@ -100,7 +100,7 @@ class BigPtrArrayPrinter(object): # accessing this is completely non-obvious... # also, node.dynamic_cast(node.dynamic_type) is null? value = " TextNode " + \ - str(node.cast(node.dynamic_type).dereference()['m_Text']) + unicode(node.cast(node.dynamic_type).dereference()['m_Text']) elif str(node.dynamic_type.target()) == "SwOLENode": value = " OLENode " elif str(node.dynamic_type.target()) == "SwGrfNode": diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py index 4f944f030008..9571573fd221 100644 --- a/solenv/gdb/libreoffice/tl.py +++ b/solenv/gdb/libreoffice/tl.py @@ -1,4 +1,4 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # Version: MPL 1.1 / GPLv3+ / LGPLv3+ # # The contents of this file are subject to the Mozilla Public License Version diff --git a/solenv/gdb/libreoffice/util/__init__.py b/solenv/gdb/libreoffice/util/__init__.py index a3b4f4b7ca6b..9175812a6190 100644 --- a/solenv/gdb/libreoffice/util/__init__.py +++ b/solenv/gdb/libreoffice/util/__init__.py @@ -1,4 +1,4 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # Version: MPL 1.1 / GPLv3+ / LGPLv3+ # # The contents of this file are subject to the Mozilla Public License Version diff --git a/solenv/gdb/libreoffice/util/compatibility.py b/solenv/gdb/libreoffice/util/compatibility.py index 3419fa9cf534..6751b7d25ae0 100644 --- a/solenv/gdb/libreoffice/util/compatibility.py +++ b/solenv/gdb/libreoffice/util/compatibility.py @@ -1,4 +1,4 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # Version: MPL 1.1 / GPLv3+ / LGPLv3+ # # The contents of this file are subject to the Mozilla Public License Version diff --git a/solenv/gdb/libreoffice/util/printing.py b/solenv/gdb/libreoffice/util/printing.py index a315603ab5dd..e6c413648fae 100644 --- a/solenv/gdb/libreoffice/util/printing.py +++ b/solenv/gdb/libreoffice/util/printing.py @@ -1,4 +1,4 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # Version: MPL 1.1 / GPLv3+ / LGPLv3+ # # The contents of this file are subject to the Mozilla Public License Version diff --git a/solenv/gdb/libreoffice/util/string.py b/solenv/gdb/libreoffice/util/string.py index e85999a49df8..5ad0e8d8fd30 100644 --- a/solenv/gdb/libreoffice/util/string.py +++ b/solenv/gdb/libreoffice/util/string.py @@ -1,4 +1,4 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # Version: MPL 1.1 / GPLv3+ / LGPLv3+ # # The contents of this file are subject to the Mozilla Public License Version diff --git a/solenv/gdb/libreoffice/util/uno.py b/solenv/gdb/libreoffice/util/uno.py index a3190d59a138..0ffeb5d15e1a 100644 --- a/solenv/gdb/libreoffice/util/uno.py +++ b/solenv/gdb/libreoffice/util/uno.py @@ -1,4 +1,4 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # Version: MPL 1.1 / GPLv3+ / LGPLv3+ # # The contents of this file are subject to the Mozilla Public License Version diff --git a/solenv/inc/_tg_rslb.mk b/solenv/inc/_tg_rslb.mk index 9c583fc86a0d..78e2422c8725 100644 --- a/solenv/inc/_tg_rslb.mk +++ b/solenv/inc/_tg_rslb.mk @@ -12,11 +12,11 @@ $(RSC_MULTI1) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB1NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB1IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SRC_ROOT)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB1IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ - -subMODULE=$(SOLARDEFIMG) \ - -subGLOBALRES=$(SOLARDEFIMG)/res \ + -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res/$i -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res ) \ + -subMODULE=$(SRC_ROOT)/$(RSCDEFIMG) \ + -subGLOBALRES=$(SRC_ROOT)/$(RSCDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC1HEADER) $(RESLIB1SRSFILES) \ @@ -48,11 +48,11 @@ $(RSC_MULTI2) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB2NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB2IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SRC_ROOT)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB2IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ - -subMODULE=$(SOLARDEFIMG) \ - -subGLOBALRES=$(SOLARDEFIMG)/res \ + -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res/$i -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res ) \ + -subMODULE=$(SRC_ROOT)/$(RSCDEFIMG) \ + -subGLOBALRES=$(SRC_ROOT)/$(RSCDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC2HEADER) $(RESLIB2SRSFILES) \ @@ -84,11 +84,11 @@ $(RSC_MULTI3) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB3NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB3IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SRC_ROOT)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB3IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ - -subMODULE=$(SOLARDEFIMG) \ - -subGLOBALRES=$(SOLARDEFIMG)/res \ + -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res/$i -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res ) \ + -subMODULE=$(SRC_ROOT)/$(RSCDEFIMG) \ + -subGLOBALRES=$(SRC_ROOT)/$(RSCDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC3HEADER) $(RESLIB3SRSFILES) \ @@ -120,11 +120,11 @@ $(RSC_MULTI4) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB4NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB4IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SRC_ROOT)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB4IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ - -subMODULE=$(SOLARDEFIMG) \ - -subGLOBALRES=$(SOLARDEFIMG)/res \ + -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res/$i -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res ) \ + -subMODULE=$(SRC_ROOT)/$(RSCDEFIMG) \ + -subGLOBALRES=$(SRC_ROOT)/$(RSCDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC4HEADER) $(RESLIB4SRSFILES) \ @@ -156,11 +156,11 @@ $(RSC_MULTI5) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB5NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB5IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SRC_ROOT)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB5IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ - -subMODULE=$(SOLARDEFIMG) \ - -subGLOBALRES=$(SOLARDEFIMG)/res \ + -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res/$i -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res ) \ + -subMODULE=$(SRC_ROOT)/$(RSCDEFIMG) \ + -subGLOBALRES=$(SRC_ROOT)/$(RSCDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC5HEADER) $(RESLIB5SRSFILES) \ @@ -192,11 +192,11 @@ $(RSC_MULTI6) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB6NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB6IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SRC_ROOT)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB6IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ - -subMODULE=$(SOLARDEFIMG) \ - -subGLOBALRES=$(SOLARDEFIMG)/res \ + -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res/$i -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res ) \ + -subMODULE=$(SRC_ROOT)/$(RSCDEFIMG) \ + -subGLOBALRES=$(SRC_ROOT)/$(RSCDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC6HEADER) $(RESLIB6SRSFILES) \ @@ -228,11 +228,11 @@ $(RSC_MULTI7) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB7NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB7IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SRC_ROOT)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB7IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ - -subMODULE=$(SOLARDEFIMG) \ - -subGLOBALRES=$(SOLARDEFIMG)/res \ + -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res/$i -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res ) \ + -subMODULE=$(SRC_ROOT)/$(RSCDEFIMG) \ + -subGLOBALRES=$(SRC_ROOT)/$(RSCDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC7HEADER) $(RESLIB7SRSFILES) \ @@ -264,11 +264,11 @@ $(RSC_MULTI8) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB8NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB8IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SRC_ROOT)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB8IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ - -subMODULE=$(SOLARDEFIMG) \ - -subGLOBALRES=$(SOLARDEFIMG)/res \ + -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res/$i -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res ) \ + -subMODULE=$(SRC_ROOT)/$(RSCDEFIMG) \ + -subGLOBALRES=$(SRC_ROOT)/$(RSCDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC8HEADER) $(RESLIB8SRSFILES) \ @@ -300,11 +300,11 @@ $(RSC_MULTI9) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB9NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB9IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SRC_ROOT)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB9IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ - -subMODULE=$(SOLARDEFIMG) \ - -subGLOBALRES=$(SOLARDEFIMG)/res \ + -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res/$i -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res ) \ + -subMODULE=$(SRC_ROOT)/$(RSCDEFIMG) \ + -subGLOBALRES=$(SRC_ROOT)/$(RSCDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC9HEADER) $(RESLIB9SRSFILES) \ @@ -336,11 +336,11 @@ $(RSC_MULTI10) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB10NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB10IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SRC_ROOT)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB10IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ - -subMODULE=$(SOLARDEFIMG) \ - -subGLOBALRES=$(SOLARDEFIMG)/res \ + -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res/$i -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res ) \ + -subMODULE=$(SRC_ROOT)/$(RSCDEFIMG) \ + -subGLOBALRES=$(SRC_ROOT)/$(RSCDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC10HEADER) $(RESLIB10SRSFILES) \ diff --git a/solenv/inc/_tg_zip.mk b/solenv/inc/_tg_zip.mk index deb2aa018781..0f0443439240 100644 --- a/solenv/inc/_tg_zip.mk +++ b/solenv/inc/_tg_zip.mk @@ -3,10 +3,8 @@ .IF "$(GUI)"=="WNT" command_seperator=&& #command_seperator=^ -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ELSE command_seperator=; -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ENDIF @@ -49,34 +47,25 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP1TARGET).dpzz : $(ZIP1TARGETN) ZIP1HELPVAR=$(BIN)/$(ZIP1TARGET) $(ZIP1DEPFILE) : - @echo # > $(MISC)/$(@:f) .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) + $(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 )}") >> $(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) + $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP1FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP1EXT)/)) $(foreach,j,$(ZIP1LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP1TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") >> $(MISC)/$(@:f) .ENDIF # "$(ZIP1DIR)" != "" @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f) $(ZIP1TARGETN) : delzip $(ZIP1DEPS) - @echo "Making: " $(@:f) + @echo "[ building ZIP ]" $(@: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 "$(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)-$(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 $(CHECKZIPRESULT) $(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) + $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP1FLAGS) $@ $(foreach,j,$(ZIP1LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP1TARGET)_, $(@:db))} $j )) -x delzip $(CHECKZIPRESULT) .IF "$(ZIP1STRIPLANGUAGETAGS)" != "" $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \ $(SOLARENV)/bin/striplanguagetags.sh $@ \ @@ -90,10 +79,8 @@ $(ZIP1TARGETN) : delzip $(ZIP1DEPS) .IF "$(GUI)"=="WNT" command_seperator=&& #command_seperator=^ -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ELSE command_seperator=; -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ENDIF @@ -136,34 +123,25 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP2TARGET).dpzz : $(ZIP2TARGETN) ZIP2HELPVAR=$(BIN)/$(ZIP2TARGET) $(ZIP2DEPFILE) : - @echo # > $(MISC)/$(@:f) .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) + $(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 )}") >> $(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) + $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP2FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP2EXT)/)) $(foreach,j,$(ZIP2LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP2TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") >> $(MISC)/$(@:f) .ENDIF # "$(ZIP2DIR)" != "" @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f) $(ZIP2TARGETN) : delzip $(ZIP2DEPS) - @echo "Making: " $(@:f) + @echo "[ building ZIP ]" $(@: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 "$(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)-$(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 $(CHECKZIPRESULT) $(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) + $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP2FLAGS) $@ $(foreach,j,$(ZIP2LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP2TARGET)_, $(@:db))} $j )) -x delzip $(CHECKZIPRESULT) .IF "$(ZIP2STRIPLANGUAGETAGS)" != "" $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \ $(SOLARENV)/bin/striplanguagetags.sh $@ \ @@ -177,10 +155,8 @@ $(ZIP2TARGETN) : delzip $(ZIP2DEPS) .IF "$(GUI)"=="WNT" command_seperator=&& #command_seperator=^ -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ELSE command_seperator=; -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ENDIF @@ -223,34 +199,25 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP3TARGET).dpzz : $(ZIP3TARGETN) ZIP3HELPVAR=$(BIN)/$(ZIP3TARGET) $(ZIP3DEPFILE) : - @echo # > $(MISC)/$(@:f) .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) + $(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 )}") >> $(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) + $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP3FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP3EXT)/)) $(foreach,j,$(ZIP3LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP3TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") >> $(MISC)/$(@:f) .ENDIF # "$(ZIP3DIR)" != "" @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f) $(ZIP3TARGETN) : delzip $(ZIP3DEPS) - @echo "Making: " $(@:f) + @echo "[ building ZIP ]" $(@: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 "$(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)-$(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 $(CHECKZIPRESULT) $(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) + $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP3FLAGS) $@ $(foreach,j,$(ZIP3LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP3TARGET)_, $(@:db))} $j )) -x delzip $(CHECKZIPRESULT) .IF "$(ZIP3STRIPLANGUAGETAGS)" != "" $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \ $(SOLARENV)/bin/striplanguagetags.sh $@ \ @@ -264,10 +231,8 @@ $(ZIP3TARGETN) : delzip $(ZIP3DEPS) .IF "$(GUI)"=="WNT" command_seperator=&& #command_seperator=^ -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ELSE command_seperator=; -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ENDIF @@ -310,34 +275,25 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP4TARGET).dpzz : $(ZIP4TARGETN) ZIP4HELPVAR=$(BIN)/$(ZIP4TARGET) $(ZIP4DEPFILE) : - @echo # > $(MISC)/$(@:f) .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) + $(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 )}") >> $(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) + $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP4FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP4EXT)/)) $(foreach,j,$(ZIP4LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP4TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") >> $(MISC)/$(@:f) .ENDIF # "$(ZIP4DIR)" != "" @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f) $(ZIP4TARGETN) : delzip $(ZIP4DEPS) - @echo "Making: " $(@:f) + @echo "[ building ZIP ]" $(@: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 "$(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)-$(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 $(CHECKZIPRESULT) $(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) + $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP4FLAGS) $@ $(foreach,j,$(ZIP4LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP4TARGET)_, $(@:db))} $j )) -x delzip $(CHECKZIPRESULT) .IF "$(ZIP4STRIPLANGUAGETAGS)" != "" $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \ $(SOLARENV)/bin/striplanguagetags.sh $@ \ @@ -351,10 +307,8 @@ $(ZIP4TARGETN) : delzip $(ZIP4DEPS) .IF "$(GUI)"=="WNT" command_seperator=&& #command_seperator=^ -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ELSE command_seperator=; -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ENDIF @@ -397,34 +351,25 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP5TARGET).dpzz : $(ZIP5TARGETN) ZIP5HELPVAR=$(BIN)/$(ZIP5TARGET) $(ZIP5DEPFILE) : - @echo # > $(MISC)/$(@:f) .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) + $(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 )}") >> $(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) + $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP5FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP5EXT)/)) $(foreach,j,$(ZIP5LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP5TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") >> $(MISC)/$(@:f) .ENDIF # "$(ZIP5DIR)" != "" @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f) $(ZIP5TARGETN) : delzip $(ZIP5DEPS) - @echo "Making: " $(@:f) + @echo "[ building ZIP ]" $(@: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 "$(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)-$(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 $(CHECKZIPRESULT) $(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) + $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP5FLAGS) $@ $(foreach,j,$(ZIP5LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP5TARGET)_, $(@:db))} $j )) -x delzip $(CHECKZIPRESULT) .IF "$(ZIP5STRIPLANGUAGETAGS)" != "" $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \ $(SOLARENV)/bin/striplanguagetags.sh $@ \ @@ -438,10 +383,8 @@ $(ZIP5TARGETN) : delzip $(ZIP5DEPS) .IF "$(GUI)"=="WNT" command_seperator=&& #command_seperator=^ -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ELSE command_seperator=; -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ENDIF @@ -484,34 +427,25 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP6TARGET).dpzz : $(ZIP6TARGETN) ZIP6HELPVAR=$(BIN)/$(ZIP6TARGET) $(ZIP6DEPFILE) : - @echo # > $(MISC)/$(@:f) .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) + $(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 )}") >> $(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) + $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP6FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP6EXT)/)) $(foreach,j,$(ZIP6LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP6TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") >> $(MISC)/$(@:f) .ENDIF # "$(ZIP6DIR)" != "" @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f) $(ZIP6TARGETN) : delzip $(ZIP6DEPS) - @echo "Making: " $(@:f) + @echo "[ building ZIP ]" $(@: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 "$(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)-$(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 $(CHECKZIPRESULT) $(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) + $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP6FLAGS) $@ $(foreach,j,$(ZIP6LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP6TARGET)_, $(@:db))} $j )) -x delzip $(CHECKZIPRESULT) .IF "$(ZIP6STRIPLANGUAGETAGS)" != "" $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \ $(SOLARENV)/bin/striplanguagetags.sh $@ \ @@ -525,10 +459,8 @@ $(ZIP6TARGETN) : delzip $(ZIP6DEPS) .IF "$(GUI)"=="WNT" command_seperator=&& #command_seperator=^ -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ELSE command_seperator=; -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ENDIF @@ -571,34 +503,25 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP7TARGET).dpzz : $(ZIP7TARGETN) ZIP7HELPVAR=$(BIN)/$(ZIP7TARGET) $(ZIP7DEPFILE) : - @echo # > $(MISC)/$(@:f) .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) + $(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 )}") >> $(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) + $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP7FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP7EXT)/)) $(foreach,j,$(ZIP7LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP7TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") >> $(MISC)/$(@:f) .ENDIF # "$(ZIP7DIR)" != "" @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f) $(ZIP7TARGETN) : delzip $(ZIP7DEPS) - @echo "Making: " $(@:f) + @echo "[ building ZIP ]" $(@: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 "$(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)-$(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 $(CHECKZIPRESULT) $(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) + $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP7FLAGS) $@ $(foreach,j,$(ZIP7LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP7TARGET)_, $(@:db))} $j )) -x delzip $(CHECKZIPRESULT) .IF "$(ZIP7STRIPLANGUAGETAGS)" != "" $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \ $(SOLARENV)/bin/striplanguagetags.sh $@ \ @@ -612,10 +535,8 @@ $(ZIP7TARGETN) : delzip $(ZIP7DEPS) .IF "$(GUI)"=="WNT" command_seperator=&& #command_seperator=^ -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ELSE command_seperator=; -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ENDIF @@ -658,34 +579,25 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP8TARGET).dpzz : $(ZIP8TARGETN) ZIP8HELPVAR=$(BIN)/$(ZIP8TARGET) $(ZIP8DEPFILE) : - @echo # > $(MISC)/$(@:f) .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) + $(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 )}") >> $(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) + $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP8FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP8EXT)/)) $(foreach,j,$(ZIP8LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP8TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") >> $(MISC)/$(@:f) .ENDIF # "$(ZIP8DIR)" != "" @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f) $(ZIP8TARGETN) : delzip $(ZIP8DEPS) - @echo "Making: " $(@:f) + @echo "[ building ZIP ]" $(@: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 "$(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)-$(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 $(CHECKZIPRESULT) $(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) + $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP8FLAGS) $@ $(foreach,j,$(ZIP8LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP8TARGET)_, $(@:db))} $j )) -x delzip $(CHECKZIPRESULT) .IF "$(ZIP8STRIPLANGUAGETAGS)" != "" $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \ $(SOLARENV)/bin/striplanguagetags.sh $@ \ @@ -699,10 +611,8 @@ $(ZIP8TARGETN) : delzip $(ZIP8DEPS) .IF "$(GUI)"=="WNT" command_seperator=&& #command_seperator=^ -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ELSE command_seperator=; -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ENDIF @@ -745,34 +655,25 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP9TARGET).dpzz : $(ZIP9TARGETN) ZIP9HELPVAR=$(BIN)/$(ZIP9TARGET) $(ZIP9DEPFILE) : - @echo # > $(MISC)/$(@:f) .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) + $(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 )}") >> $(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) + $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP9FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP9EXT)/)) $(foreach,j,$(ZIP9LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP9TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") >> $(MISC)/$(@:f) .ENDIF # "$(ZIP9DIR)" != "" @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f) $(ZIP9TARGETN) : delzip $(ZIP9DEPS) - @echo "Making: " $(@:f) + @echo "[ building ZIP ]" $(@: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 "$(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)-$(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 $(CHECKZIPRESULT) $(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) + $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP9FLAGS) $@ $(foreach,j,$(ZIP9LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP9TARGET)_, $(@:db))} $j )) -x delzip $(CHECKZIPRESULT) .IF "$(ZIP9STRIPLANGUAGETAGS)" != "" $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \ $(SOLARENV)/bin/striplanguagetags.sh $@ \ @@ -786,10 +687,8 @@ $(ZIP9TARGETN) : delzip $(ZIP9DEPS) .IF "$(GUI)"=="WNT" command_seperator=&& #command_seperator=^ -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ELSE command_seperator=; -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ENDIF @@ -832,34 +731,25 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP10TARGET).dpzz : $(ZIP10TARGETN) ZIP10HELPVAR=$(BIN)/$(ZIP10TARGET) $(ZIP10DEPFILE) : - @echo # > $(MISC)/$(@:f) .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) + $(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 )}") >> $(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) + $(COMMAND_ECHO)-$(ZIPDEP) $(ZIP10FLAGS) $(subst,/misc/,/bin/ $(@:s/.dpzz/$(ZIP10EXT)/)) $(foreach,j,$(ZIP10LIST) "{$(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP10TARGET)_, $(subst,/misc/,/bin/ $(@:db)))} $j )}") >> $(MISC)/$(@:f) .ENDIF # "$(ZIP10DIR)" != "" @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f) $(ZIP10TARGETN) : delzip $(ZIP10DEPS) - @echo "Making: " $(@:f) + @echo "[ building ZIP ]" $(@: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 "$(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)-$(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 $(CHECKZIPRESULT) $(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) + $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP10FLAGS) $@ $(foreach,j,$(ZIP10LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP10TARGET)_, $(@:db))} $j )) -x delzip $(CHECKZIPRESULT) .IF "$(ZIP10STRIPLANGUAGETAGS)" != "" $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \ $(SOLARENV)/bin/striplanguagetags.sh $@ \ diff --git a/solenv/inc/doxygen.cfg b/solenv/inc/doxygen.cfg index 7aa1548c0d22..b1a443a3aa69 100644 --- a/solenv/inc/doxygen.cfg +++ b/solenv/inc/doxygen.cfg @@ -1059,10 +1059,8 @@ PREDEFINED = LINUX \ UNX \ VCL \ GCC \ - C341 \ X86_64 \ _DEBUG_RUNTIME \ - VER=C341 \ NPTL \ GLIBC=2 \ NEW_SOLAR \ diff --git a/solenv/inc/extension_helplink.mk b/solenv/inc/extension_helplink.mk index df61f421ce6f..11b6f1f6d699 100644 --- a/solenv/inc/extension_helplink.mk +++ b/solenv/inc/extension_helplink.mk @@ -25,18 +25,6 @@ # #************************************************************************* -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) @@ -48,10 +36,6 @@ HELPLINKALLADDEDDEPS=$(foreach,i,$(aux_alllangiso) $(subst,LANGUAGE,$i $(LINKADD 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 @@ -65,15 +49,10 @@ $(HELPLINKALLTARGETS) : $(foreach,i,$(LINKLINKFILES) $(XHPLINKSRC)/$$(@:b:s/_/./ @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 + $(HELPINDEXER) -lang $(@:b:s/_/./:e:s/.//) -mod $(LINKNAME) -dir $(XHPLINKSRC)/{$(subst,$(TARGET)_$(LINKNAME)_, $(@:b))} && $(TOUCH) $@ -$(RM) $(XHPLINKSRC)/$(@:b:s/_/./:e:s/.//)/content/*.* + -$(RMDIR) $(XHPLINKSRC)/$(@:b:s/_/./:e:s/.//)/content -$(RM) $(XHPLINKSRC)/$(@:b:s/_/./:e:s/.//)/caption/*.* -.ENDIF + -$(RMDIR) $(XHPLINKSRC)/$(@:b:s/_/./:e:s/.//)/caption diff --git a/solenv/inc/extension_post.mk b/solenv/inc/extension_post.mk index 20b86823d1b5..8a1a328828e3 100644 --- a/solenv/inc/extension_post.mk +++ b/solenv/inc/extension_post.mk @@ -39,15 +39,15 @@ fixme4=$(fixme:n) $(EXTENSIONDIR)/$(COMPONENT_CONFIGDEST)/%.xcu : %.xcu # ugly hacking to workaround prepended first source path @@-$(MKDIRHIER) $(subst,$(fixme2),$(MISC) $(@:d)) - $(GNUCOPY) $< $(subst,$(fixme2),$(MISC) $@) + $(COMMAND_ECHO)$(GNUCOPY) $< $(subst,$(fixme2),$(MISC) $@) $(EXTENSIONDIR)/$(COMPONENT_CONFIGDESTSCHEMA)/%.xcs : %.xcs @@-$(MKDIRHIER) $(subst,$(fixme4),$(MISC) $(@:d)) - $(GNUCOPY) $< $(subst,$(fixme4),$(MISC) $@) + $(COMMAND_ECHO)$(GNUCOPY) $< $(subst,$(fixme4),$(MISC) $@) $(EXTENSIONDIR)/%.jar : $(SOLARBINDIR)/%.jar @@-$(MKDIRHIER) $(@:d) - $(GNUCOPY) $< $@ + $(COMMAND_ECHO)$(GNUCOPY) $< $@ .IF "$(COMPONENT_FILES)"!="" COMPONENT_FILES_SRC*=./ diff --git a/solenv/inc/extension_pre.mk b/solenv/inc/extension_pre.mk index 056d50efaf4f..d24d9cda809a 100644 --- a/solenv/inc/extension_pre.mk +++ b/solenv/inc/extension_pre.mk @@ -38,7 +38,7 @@ DESCRIPTION_SRC*:=description.xml COMPONENT_MANIFEST*:=$(EXTENSIONDIR)/META-INF/manifest.xml MANIFEST_SRC*:=manifest.xml -.IF "$(GUI)" == "WIN" || "$(GUI)" == "WNT" +.IF "$(GUI)" == "WNT" PACKLICS*:=$(EXTENSIONDIR)/registration/license.txt COMPONENT_LIC_TEMPL*:=registration/license.txt .ELSE @@ -52,7 +52,7 @@ ZIP9DEPS= $(PACKLICS) $(DESCRIPTION) $(COMPONENT_XCU) $(COMPONENT_FILES) $(COMP ZIP9TARGET= $(EXTENSION_ZIPNAME) ZIP9DIR= $(EXTENSIONDIR) ZIP9EXT= .oxt -ZIP9FLAGS=-r +ZIP9FLAGS=-0 -r ZIP9LIST= * .ENDIF # "$(COMPONNENT_COPYONLY)"=="" diff --git a/solenv/inc/gbuildbridge.mk b/solenv/inc/gbuildbridge.mk index de438007634c..529d6e2f27a5 100644 --- a/solenv/inc/gbuildbridge.mk +++ b/solenv/inc/gbuildbridge.mk @@ -34,8 +34,8 @@ TARGET=prj all: .ELIF "$(VERBOSE)"!="" all: - cd $(PRJ) && $(GNUMAKE) -r -j$(GMAKE_MODULE_PARALLELISM) $(gb_MAKETARGET) gb_PARTIALBUILD=T + cd $(PRJ) && $(GNUMAKE) -r -j$(GMAKE_MODULE_PARALLELISM) all slowcheck .ELSE all: - @cd $(PRJ) && $(GNUMAKE) -rs -j$(GMAKE_MODULE_PARALLELISM) $(gb_MAKETARGET) gb_PARTIALBUILD=T + @cd $(PRJ) && $(GNUMAKE) -rs -j$(GMAKE_MODULE_PARALLELISM) all slowcheck .END diff --git a/solenv/inc/installationtest.mk b/solenv/inc/installationtest.mk index 3c5cf32b1ace..2ddedb6af3d2 100644 --- a/solenv/inc/installationtest.mk +++ b/solenv/inc/installationtest.mk @@ -55,7 +55,7 @@ my_instsets = $(shell ls -dt \ installationtest_instset = $(my_instsets:1) .ELSE installationtest_instset = \ - $(SOLARSRC)/instsetoo_native/$(INPATH)/LibreOffice/archive/install/$(defaultlangiso) + $(SRC_ROOT)/instsetoo_native/$(INPATH)/LibreOffice/archive/install/$(defaultlangiso) .END .IF "$(OS)" == "WNT" && "$(CROSS_COMPILING)" != "YES" diff --git a/solenv/inc/langlist.mk b/solenv/inc/langlist.mk index 42c11723169b..5ba2dc87ad8c 100644 --- a/solenv/inc/langlist.mk +++ b/solenv/inc/langlist.mk @@ -27,12 +27,14 @@ # Complete list of all supported localizations (ISO codes) completelangiso=af \ +am \ ar \ as \ ast \ be \ bg \ bn \ +bn-IN \ bo \ br \ brx \ @@ -76,7 +78,6 @@ ko \ kok \ ks \ ku \ -ky-CN \ lb \ lo \ lt \ diff --git a/solenv/inc/libs.mk b/solenv/inc/libs.mk index 12db54a70e17..3adeb01d3a0e 100644 --- a/solenv/inc/libs.mk +++ b/solenv/inc/libs.mk @@ -34,6 +34,14 @@ LIBSMKREV!:="$$Revision: 1.134.2.3 $$" .IF ("$(GUI)"=="UNX" || "$(COM)"=="GCC") +# workaround for MinGW to get the same DLL names as with MSC +# e.g., uno_salhelper3gcc3.dll (vs. uno_salhelpergcc3.dll) +.IF "$(GUI)" == "WNT" +COMID_WITH_VERSION = $(UDK_MAJOR)$(COMID) +.ELSE +COMID_WITH_VERSION = $(COMID) +.ENDIF + .IF "$(GUI)" == "WNT" ODMA_LIB_LIB=-lodma_lib .ENDIF @@ -61,9 +69,8 @@ ICUDATALIB=-licudata .ENDIF I18NUTILLIB=-li18nutil$(COMID) I18NISOLANGLIB=-li18nisolang$(ISOLANG_MAJOR)$(COMID) -I18NPAPERLIB=-li18npaper$(DLLPOSTFIX) I18NREGEXPLIB=-li18nregexp$(DLLPOSTFIX) -SALHELPERLIB=-luno_salhelper$(COMID) +SALHELPERLIB=-luno_salhelper$(COMID_WITH_VERSION) XMLSCRIPTLIB =-lxcr$(DLLPOSTFIX) COMPHELPERLIB=-lcomphelp$(COMID) CONNECTIVITYLIB=-lconnectivity @@ -72,7 +79,7 @@ TOOLSLIBST=-latools BPICONVLIB=-lbpiconv TOOLSLIB=-ltl$(DLLPOSTFIX) CPPULIB=-luno_cppu -CPPUHELPERLIB=-luno_cppuhelper$(COMID) +CPPUHELPERLIB=-luno_cppuhelper$(COMID_WITH_VERSION) UCBHELPERLIB=-lucbhelper4$(COMID) .IF "$(SYSTEM_OPENSSL)" == "YES" OPENSSLLIB=$(OPENSSL_LIBS) @@ -174,6 +181,11 @@ HM2LIBSH=-lhmwrpdll HM2LIBST=-lhmwrap LINGULIB=$(HM2LIBST) LNGLIB=-llng$(DLLPOSTFIX) +.IF "$(SYSTEM_CLUCENE)"=="YES" +CLUCENELIB=$(LIBCLUCENE_LIBS) +.ELSE +CLUCENELIB=-lclucene +.ENDIF .IF "$(SYSTEM_EXPAT)"=="YES" EXPAT3RDLIB=-lexpat EXPATASCII3RDLIB=-lexpat @@ -186,6 +198,12 @@ ZLIB3RDLIB=-lz .ELSE ZLIB3RDLIB=-lzlib .ENDIF +.IF "$(SYSTEM_MINIZIP)"=="YES" +MINIZIP3RDLIB=$(MINIZIP_LIBS) +.ELSE +# internally, minizip is included in zlib +MINIZIP3RDLIB= +.ENDIF .IF "$(SYSTEM_JPEG)"=="YES" JPEG3RDLIB=-ljpeg .ELSE @@ -202,6 +220,8 @@ NEON3RDLIB=-lneon .ENDIF .IF "$(SYSTEM_DB)" == "YES" BERKELEYLIB=-l$(DB_LIB) +.ELIF "$(GUI)$(COM)"=="WNTGCC" +BERKELEYLIB=-ldb47 .ELSE BERKELEYLIB=-ldb-4.7 .ENDIF @@ -236,7 +256,7 @@ ISCLIB=-lsc$(DLLPOSTFIX) ISDLIB=-lsd$(DLLPOSTFIX) PKGCHKLIB=-lpkgchk$(DLLPOSTFIX) HELPLINKERLIB=-lhelplinker$(DLLPOSTFIX) -JVMACCESSLIB = -ljvmaccess$(COMID) +JVMACCESSLIB = -ljvmaccess$(COMID_WITH_VERSION) .IF "$(SYSTEM_CPPUNIT)"=="YES" CPPUNITLIB = $(CPPUNIT_LIBS) .ELSE @@ -344,7 +364,7 @@ UNOTOOLSLIB+=$(UCBHELPERLIB) TOOLSLIB+=$(BASEGFXLIB) TOOLSLIB+=$(ZLIB3RDLIB) -VCLLIB+=$(ICUUCLIB) $(I18NPAPERLIB) +VCLLIB+=$(ICUUCLIB) .ENDIF @@ -370,7 +390,6 @@ ICUUCLIB=icuuc.lib ICUDATALIB=icudt.lib I18NUTILLIB=ii18nutil.lib I18NISOLANGLIB=ii18nisolang.lib -I18NPAPERLIB=ii18npaper.lib I18NREGEXPLIB=ii18nregexp.lib SALHELPERLIB=isalhelper.lib XMLSCRIPTLIB=ixcr.lib @@ -445,6 +464,7 @@ HM2LIBSH=hmwrpdll.lib HM2LIBST=hmwrap.lib LINGULIB=$(HM2LIBST) LNGLIB=ilng.lib +CLUCENELIB=iclucene.lib EXPAT3RDLIB=expat_xmltok.lib expat_xmlparse.lib EXPATASCII3RDLIB=expat_xmltok.lib ascii_expat_xmlparse.lib ZLIB3RDLIB=zlib.lib diff --git a/solenv/inc/rules.mk b/solenv/inc/rules.mk index f45d46be9942..68ae855172e9 100644 --- a/solenv/inc/rules.mk +++ b/solenv/inc/rules.mk @@ -535,7 +535,7 @@ $(MISC)/%.dpz : @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" >> $@ + $(COMMAND_ECHO)$(TYPE) $(ZIPDEPFILES) $(mktmp $(NULL)) >> $@ @echo zipdep_langs=$(alllangiso) >> $@ @@-$(RM) $(ZIPDEPFILES) .ENDIF # "$(nodep)"=="" diff --git a/solenv/inc/settings.mk b/solenv/inc/settings.mk index a8bd275ebbd7..9988f7c0b909 100644 --- a/solenv/inc/settings.mk +++ b/solenv/inc/settings.mk @@ -271,6 +271,9 @@ PROFILE= DBGUTIL= dbgutil= +ZIPDEP:="zipdep.pl" + + # =========================================================================== # unter NT werden Variablennamen an untergeordnete makefiles UPPERCASE # weitergereicht, aber case significant ausgewertet! @@ -563,7 +566,7 @@ LOCAL_COMMON_OUT:=$(subst,$(OUTPATH),$(COMMON_OUTDIR) $(OUT)) # target instead of using $(OUT)/inc/myworld.mk as target name. # (See iz62795) $(posix_PWD)/$(OUT)/inc/%world.mk : - @$(MKOUT) $(ROUT) + @mkout.pl $(ROUT) @echo $(EMQ)# > $@ .INCLUDE : $(posix_PWD)/$(OUT)/inc/myworld.mk @@ -739,12 +742,12 @@ SOLARCOMMONSDFDIR=$(SOLARSDFDIR) .EXPORT : SOLARBINDIR .IF "$(WITH_LANG)"!="" -.INCLUDE .IGNORE: $(L10N_MODULE)/$(COMMON_OUTDIR)$(PROEXT)/inc/localization_present.mk +.INCLUDE .IGNORE: $(WORKDIR)$/CustomTarget$/translations$/localization_present.mk # 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 +TRYSDF:=$(WORKDIR)$/CustomTarget$/translations$/translate$/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 @@ -1003,6 +1006,7 @@ CPPUNITTESTER=$(AUGMENT_LIBRARY_PATH_LOCAL) $(GDBCPPUNITTRACE) $(VALGRINDTOOL) $ HELPEX=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/helpex LNGCONVEX=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/lngconvex HELPLINKER=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/HelpLinker +HELPINDEXER=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/HelpIndexer .IF "$(JAVAINTERPRETER)" == "" JAVA*:=java @@ -1012,7 +1016,7 @@ JAVA*:=$(JAVAINTERPRETER) .EXPORT : JAVA JAVAI # Define SCPCOMP without wrapper because pre2par.pl chokes on DOS style -# pathes. (See iz57443) +# paths. (See iz57443) SCPCOMP=$(PERL) $(SOLARENV)/bin/pre2par.pl SCPLINK=$(PERL) $(SOLARENV)/bin/par2script.pl LZIP*=lzip @@ -1121,6 +1125,10 @@ CDEFS+=-DGSTREAMER CDEFS += -DHAVE_THREADSAFE_STATICS .END +.IF "$(DISABLE_DYNLOADING)" == "TRUE" +CDEFS += -DDISABLE_DYNLOADING +.ENDIF + # compose flags and defines for GUI .IF "$(TARGETTYPE)"=="GUI" CFLAGSSLO+=$(CFLAGSSLOGUIMT) @@ -1193,7 +1201,7 @@ CFLAGSCXX+=$(CFLAGSWARNCXX) CFLAGSCC+=$(CFLAGSWALLCC) CFLAGSCXX+=$(CFLAGSWALLCXX) .ENDIF -.IF "$(COMPILER_WARN_ERRORS)"!="" && "$(EXTERNAL_WARNINGS_NOT_ERRORS)"=="" +.IF "$(COMPILER_WARN_ERRORS)"!="" && "$(EXTERNAL_WARNINGS_NOT_ERRORS)"=="FALSE" CFLAGSCC+=$(CFLAGSWERRCC) CFLAGSCXX+=$(CFLAGSWERRCXX) .ENDIF @@ -1297,12 +1305,18 @@ XERCES_JAR*=$(SOLARBINDIR)/xercesImpl.jar CPPUNIT_CFLAGS = .END +.IF "$(DISABLE_DYNLOADING)" == "TRUE" +COMPONENTPREFIX_URE_NATIVE = +COMPONENTPREFIX_BASIS_NATIVE = +COMPONENTPREFIX_INBUILD_NATIVE = +.ELSE COMPONENTPREFIX_URE_NATIVE = vnd.sun.star.expand:$$URE_INTERNAL_LIB_DIR/ -COMPONENTPREFIX_URE_JAVA = vnd.sun.star.expand:$$URE_INTERNAL_JAVA_DIR/ COMPONENTPREFIX_BASIS_NATIVE = vnd.sun.star.expand:$$LO_LIB_DIR/ +COMPONENTPREFIX_INBUILD_NATIVE = vnd.sun.star.expand:$$LO_LIB_DIR/ +.ENDIF +COMPONENTPREFIX_URE_JAVA = vnd.sun.star.expand:$$URE_INTERNAL_JAVA_DIR/ COMPONENTPREFIX_BASIS_JAVA = vnd.sun.star.expand:$$LO_JAVA_DIR/ COMPONENTPREFIX_BASIS_PYTHON = vnd.openoffice.pymodule: -COMPONENTPREFIX_INBUILD_NATIVE = vnd.sun.star.expand:$$LO_LIB_DIR/ COMPONENTPREFIX_INBUILD_JAVA = vnd.sun.star.expand:$$LO_JAVA_DIR/ COMPONENTPREFIX_EXTENSION = ./ diff --git a/solenv/inc/target.mk b/solenv/inc/target.mk index 3cca55d28550..d5b4ce195806 100644 --- a/solenv/inc/target.mk +++ b/solenv/inc/target.mk @@ -1921,8 +1921,6 @@ UNOUCRDEPxxx : $(UNOUCRDEP); .ENDIF # "$(SOLAR_JAVA)"!="" .INCLUDE : tg_merge.mk -.INCLUDE : tg_propmerge.mk -.INCLUDE : tg_xmerge.mk wordcount: wc *.* >> $(TMP)/wc.lst diff --git a/solenv/inc/tg_compv.mk b/solenv/inc/tg_compv.mk index 2eb256d5f478..8036d0a370f9 100644 --- a/solenv/inc/tg_compv.mk +++ b/solenv/inc/tg_compv.mk @@ -75,11 +75,6 @@ COMNAME=mscx SHORTSTDCPP3:= SHORTSTDC3:="1" -.IF "$(CCNUMVER)">="000200910000" -COMID=GCC -COMNAME=gcc2 -.ENDIF - .IF "$(CCNUMVER)">="000300000001" COMID=gcc3 diff --git a/solenv/inc/tg_ext.mk b/solenv/inc/tg_ext.mk index 0adec0c96683..9588456e3ffe 100644 --- a/solenv/inc/tg_ext.mk +++ b/solenv/inc/tg_ext.mk @@ -47,8 +47,8 @@ PATH!:=.$(PATH_SEPERATOR)$(SOLARBINDIR)$(PATH_SEPERATOR)$(PATH) .EXPORT : PATH #override -PACKAGE_DIR=$(MISC)/build -ABS_PACKAGE_DIR:=$(MAKEDIR)/$(MISC)/build +PACKAGE_DIR*=$(MISC)/build +ABS_PACKAGE_DIR:=$(MAKEDIR)/$(PACKAGE_DIR) #MUST match with PACKAGE_DIR BACK_PATH=../../../ @@ -174,8 +174,9 @@ $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE) : $(PRJ)/$(ROUT)/misc/$(TARFILE_MD5)-$(TARFILE @-cd $(PACKAGE_DIR) && chmod -R +rw $(TARFILE_ROOTDIR) && $(TOUCH) $(UNTAR_FLAG_FILE) @-cd $(PACKAGE_DIR) && find $(TARFILE_ROOTDIR) -type d -print0 | xargs -0 chmod a+x -#add new files to patch +#add new files to patch and remove files from patch $(PACKAGE_DIR)/$(ADD_FILES_FLAG_FILE) : $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE) $(T_ADDITIONAL_FILES:+".dummy") + $(RM) $(foreach,i,$(REMOVE_FILES) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) .IF "$(GUI)"=="WNT" @$(TOUCH) $@ .ELSE # "$(GUI)"=="WNT" @@ -252,7 +253,7 @@ $(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 \ + $(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl shl \ $(EXTRPATH) \ $(shell ls $(foreach,j,$(OUT2LIB) $(LB)/$(j:f)) | \ (grep -v '\.a$$' || test $$? = 1)) @@ -271,16 +272,31 @@ $(PACKAGE_DIR)/$(PREDELIVER_FLAG_FILE) : $(PACKAGE_DIR)/$(INSTALL_FLAG_FILE) .ENDIF # "$(OUTDIR2INC)"!="" .IF "$(OUT2BIN)"!="" $(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2BIN) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(BIN) -.IF "$(GUI)$(COM)$(COMEX)"=="WNTMSC12" +.IF "$(OS)"=="MACOSX" + $(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl app \ + $(EXTRPATH) $(shell ls $(foreach,j,$(OUT2BIN) $(BIN)/$(j:f))) +.ELIF "$(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 "$(OUT2BIN_NONE)"!="" + $(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2BIN_NONE) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(BIN) +.IF "$(OS)"=="MACOSX" + $(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl app \ + NONE $(shell ls $(foreach,j,$(OUT2BIN_NONE) $(BIN)/$(j:f))) +.ELIF "$(GUI)$(COM)$(COMEX)"=="WNTMSC12" + @noop $(foreach,j,$(foreach,k,$(OUT2BIN_NONE) \ + $(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))) +.END +.ENDIF # "$(OUT2BIN_NONE)"!="" .IF "$(OUT2CLASS)"!="" $(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2CLASS) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(CLASSDIR) -.ENDIF # "$(OUT2BIN)"!="" +.ENDIF # "$(OUT2CLASS)"!="" $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(PREDELIVER_FLAG_FILE) $(MISC)/$(TARFILE_ROOTDIR).done : $(MISC)/$(TARFILE_MD5)-$(TARFILE_NAME).unpack $(PATCH_FILES) diff --git a/solenv/inc/tg_help.mk b/solenv/inc/tg_help.mk index cce5b9ee62b2..c67e04ae1a1e 100644 --- a/solenv/inc/tg_help.mk +++ b/solenv/inc/tg_help.mk @@ -41,7 +41,7 @@ HELP_OUT:=$(MISC) 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 +ALLTAR : $(HELP_OUT)$/$(TARGET).done $(HELP_OUT)$/xhp_changed.flag $(HLANGXHPFILES) : $$(@:d)thisdir.created @@ -53,15 +53,12 @@ $(XHPDEST)$/{$(aux_alllangiso)}$/$(SHELL_PACKAGE)$/%.xhp :| %.xhp $(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) $@ + @echo Localizing help files... + $(COMMAND_ECHO)$(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) $@ + @echo Copying help files... + $(COMMAND_ECHO)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) $@ @@ -80,9 +77,6 @@ $(HELP_OUT)$/$(TARGET).done : $(LOCALIZESDF) .ENDIF # "$(HELPTRANSPHONY)"!="" .ENDIF # "$(HLANGXHPFILES)"!="" -optix: $(HELP_OUT)$/$(TARGET).done - @echo done - %.created : @@-$(MKDIRHIER) $(@:d) @$(TOUCH) $@ diff --git a/solenv/inc/tg_propmerge.mk b/solenv/inc/tg_propmerge.mk deleted file mode 100644 index 796bca982815..000000000000 --- a/solenv/inc/tg_propmerge.mk +++ /dev/null @@ -1,66 +0,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. -# -#************************************************************************* - -.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_rslb.mk b/solenv/inc/tg_rslb.mk index 9d3ed1557660..71a88b2347dc 100644 --- a/solenv/inc/tg_rslb.mk +++ b/solenv/inc/tg_rslb.mk @@ -40,11 +40,11 @@ $(RSC_MULTI$(TNR)) : \ $(foreach,i,$(alllangiso) -lg$i \ $(null,$(rescharset_{$i}) $(default$(LANG_GUI)) $(rescharset_{$i})) \ -fs={$(BIN)/$(RESLIB$(TNR)NAME)$i.res} \ - $(foreach,j,$(subst,$(PRJ),$(SOLARDEFIMG)/$(PRJNAME) $(RESLIB$(TNR)IMAGES)) -lip={$j}/$i \ + $(foreach,j,$(subst,$(PRJ),$(SRC_ROOT)/$(RSCDEFIMG)/$(PRJNAME) $(RESLIB$(TNR)IMAGES)) -lip={$j}/$i \ -lip={$j} ) \ - -lip=$(SOLARDEFIMG)/res/$i -lip=$(SOLARDEFIMG)/res ) \ - -subMODULE=$(SOLARDEFIMG) \ - -subGLOBALRES=$(SOLARDEFIMG)/res \ + -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res/$i -lip=$(SRC_ROOT)/$(RSCDEFIMG)/res ) \ + -subMODULE=$(SRC_ROOT)/$(RSCDEFIMG) \ + -subGLOBALRES=$(SRC_ROOT)/$(RSCDEFIMG)/res \ -oil=$(BIN) \ -ft=$@ \ $(RSC$(TNR)HEADER) $(RESLIB$(TNR)SRSFILES) \ diff --git a/solenv/inc/tg_xmerge.mk b/solenv/inc/tg_xmerge.mk deleted file mode 100644 index 6ff412bb022f..000000000000 --- a/solenv/inc/tg_xmerge.mk +++ /dev/null @@ -1,108 +0,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. -# -#************************************************************************* - -.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_zip.mk b/solenv/inc/tg_zip.mk index 084fad31a2c4..b7283382c65e 100644 --- a/solenv/inc/tg_zip.mk +++ b/solenv/inc/tg_zip.mk @@ -31,10 +31,8 @@ .IF "$(GUI)"=="WNT" command_seperator=&& #command_seperator=^ -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ELSE command_seperator=; -avoid_cvs_dir=-x "*CVS*" -x "*.svn*" .ENDIF @@ -77,34 +75,25 @@ $(MISC)/$(TARGET).$(PWD:f).$(ZIP$(TNR)TARGET).dpzz : $(ZIP$(TNR)TARGETN) ZIP$(TNR)HELPVAR=$(BIN)/$(ZIP$(TNR)TARGET) $(ZIP$(TNR)DEPFILE) : - @echo # > $(MISC)/$(@:f) .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) + $(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 )}") >> $(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) + $(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 )}") >> $(MISC)/$(@:f) .ENDIF # "$(ZIP$(TNR)DIR)" != "" @echo $(@:n:s#\#/#) : makefile.mk >> $(MISC)/$(@:f) $(ZIP$(TNR)TARGETN) : delzip $(ZIP$(TNR)DEPS) - @echo "Making: " $(@:f) + @echo "[ building ZIP ]" $(@: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 "$(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)-$(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 $(CHECKZIPRESULT) $(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) + $(COMMAND_ECHO)zip $(ZIP_VERBOSITY) $(ZIP$(TNR)FLAGS) $@ $(foreach,j,$(ZIP$(TNR)LIST) $(subst,LANGDIR,{$(subst,$(BIN)/$(ZIP$(TNR)TARGET)_, $(@:db))} $j )) -x delzip $(CHECKZIPRESULT) .IF "$(ZIP$(TNR)STRIPLANGUAGETAGS)" != "" $(COMMAND_ECHO)$(IFEXIST) $@ $(THEN) \ $(SOLARENV)/bin/striplanguagetags.sh $@ \ diff --git a/solenv/inc/unitools.mk b/solenv/inc/unitools.mk index a46e0828ca95..863c4ad23db6 100644 --- a/solenv/inc/unitools.mk +++ b/solenv/inc/unitools.mk @@ -31,7 +31,7 @@ ULFEX*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/ulfex 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 +LOCALIZE*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/localize GSICHECK*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/gsicheck .IF "$(XSLTPROC)"=="" @@ -42,6 +42,14 @@ XSLTPROC=$(AUGMENT_LIBRARY_PATH) xsltproc .ENDIF # "$(SYSTEM_LIBXSLT)"!="YES" .ENDIF +.IF "$(XMLLINT)"=="" +.IF "$(SYSTEM_LIBXML)"!="YES" +XMLLINT=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/xmllint +.ELSE # "$(SYSTEM_LIBXML)"!="YES" +XMLLINT=$(AUGMENT_LIBRARY_PATH) xmllint +.ENDIF # "$(SYSTEM_LIBXML)"!="YES" +.ENDIF + ULFCONV*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/ulfconv MAKEDEPEND*=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/makedepend @@ -121,7 +129,7 @@ AWK*=nawk GNUCOPY*=/usr/gnu/bin/cp GNUPATCH*=/usr/gnu/bin/patch GNUTAR*=/usr/sfw/bin/gtar -GNUMAKE=/usr/sfw/bin/make +GNUMAKE*=gmake DEREFERENCE= .ELIF "$(OS)"=="AIX" AWK*=/opt/freeware/bin/awk diff --git a/solenv/inc/unxandr/lo-bootstrap.h b/solenv/inc/unxandr/lo-bootstrap.h deleted file mode 100644 index d78d88beaaab..000000000000 --- a/solenv/inc/unxandr/lo-bootstrap.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * Version: MPL 1.1 / GPLv3+ / LGPLv3+ - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License or as specified alternatively below. You may obtain a copy of - * the License at http: *www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * Major Contributor(s): - * Copyright (C) 2011 Tor Lillqvist <tml@iki.fi> (initial developer) - * Copyright (C) 2011 SUSE Linux http://suse.com (initial developer's employer) - * - * All Rights Reserved. - * - * For minor contributions see the git repository. - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 3 or later (the "GPLv3+"), or - * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), - * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable - * instead of those above. - */ - -#if defined(ANDROID) - -#include <jni.h> -#include <dlfcn.h> -#include <dirent.h> - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct lo_apk_dir lo_apk_dir; - -char **lo_dlneeds(const char *library); - -void *lo_dlopen(const char *library); - -void *lo_dlsym(void *handle, - const char *symbol); - -int lo_dladdr(void *addr, - Dl_info *info); - -void *lo_apkentry(const char *filename, - size_t *size); - -lo_apk_dir *lo_apk_opendir(const char *dirname); - -struct dirent *lo_apk_readdir(lo_apk_dir *dirp); - -int lo_apk_closedir(lo_apk_dir *dirp); - -int lo_apk_lstat(const char *path, struct stat *statp); - -int lo_dlcall_argc_argv(void *function, - int argc, - const char **argv); - -JavaVM *lo_get_javavm(void); - -struct android_app *lo_get_app(void); - -#ifdef __cplusplus -} -#endif - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/solenv/inc/unxgcc.mk b/solenv/inc/unxgcc.mk index a3231a69d7d6..4f9ebee6c816 100644 --- a/solenv/inc/unxgcc.mk +++ b/solenv/inc/unxgcc.mk @@ -51,6 +51,10 @@ CDEFS+=-D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE .ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" +.IF "$(HAVE_SFINAE_ANONYMOUS_BROKEN)" == "TRUE" +CDEFS += -DHAVE_SFINAE_ANONYMOUS_BROKEN +.ENDIF # "$(HAVE_SFINAE_ANONYMOUS_BROKEN)" == "TRUE" + # this is a platform with JAVA support .IF "$(SOLAR_JAVA)"!="" JAVADEF=-DSOLAR_JAVA @@ -78,7 +82,10 @@ CFLAGSENABLESYMBOLS=-g # flags for the C++ Compiler CFLAGSCC= -pipe $(ARCH_FLAGS) # Flags for enabling exception handling -CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs +CFLAGSEXCEPTIONS=-fexceptions +.IF "$(COM_GCC_IS_CLANG)" != "TRUE" +CFLAGSEXCEPTIONS+=-fno-enforce-eh-specs +.ENDIF # Flags for disabling exception handling CFLAGS_NO_EXCEPTIONS=-fno-exceptions @@ -88,7 +95,7 @@ CFLAGSCXX= -pipe $(ARCH_FLAGS) CFLAGSCXX+=-fvisibility-inlines-hidden .ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" .IF "$(HAVE_CXX0X)" == "TRUE" -CFLAGSCXX+=-std=c++0x +CFLAGSCXX+=-std=gnu++0x .IF "$(GCCNUMVER)" <= "000400059999" CFLAGSCXX+=-Wno-deprecated-declarations .ENDIF @@ -136,12 +143,26 @@ CFLAGSOUTOBJ=-o # -Wshadow does not work for C with nested uses of pthread_cleanup_push: CFLAGSWARNBOTH=-Wall -Wextra -Wendif-labels CFLAGSWARNCC=$(CFLAGSWARNBOTH) -Wdeclaration-after-statement -CFLAGSWARNCXX=$(CFLAGSWARNBOTH) -Wshadow -Wno-ctor-dtor-privacy \ - -Wno-non-virtual-dtor +CFLAGSWARNCXX=$(CFLAGSWARNBOTH) -Wshadow -Wno-ctor-dtor-privacy CFLAGSWALLCC=$(CFLAGSWARNCC) CFLAGSWALLCXX=$(CFLAGSWARNCXX) CFLAGSWERRCC=-Werror -DLIBO_WERROR +.IF "$(COM_GCC_IS_CLANG)" != "TRUE" +# Only GCC 4.6 has a fix for <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7302> +# "-Wnon-virtual-dtor should't complain of protected dtor" and supports #pragma +# GCC diagnostic push/pop required e.g. in cppuhelper/propertysetmixin.hxx to +# silence warnings about a protected, non-virtual dtor in a class with virtual +# members and friends: +.IF "$(GCCNUMVER)" <= "000400059999" +CFLAGSWARNCXX += -Wno-non-virtual-dtor +.ELSE +CFLAGSWARNCXX += -Wnon-virtual-dtor +.END +.ELSE +CFLAGSWARNCXX += -Wnon-virtual-dtor +.END + COMPILER_WARN_ERRORS=TRUE # switches for dynamic and static linking diff --git a/solenv/inc/unxiosr.mk b/solenv/inc/unxiosr.mk index 6ddb15af841e..05bded5b55f2 100644 --- a/solenv/inc/unxiosr.mk +++ b/solenv/inc/unxiosr.mk @@ -40,11 +40,6 @@ LINKOUTPUT_FILTER= CFLAGS=-fmessage-length=0 -c $(EXTRA_CFLAGS) -# enable visibility define in "sal/types.h" -.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" -CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE -.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" - # --------------------------------- # Compilation flags # --------------------------------- @@ -57,7 +52,10 @@ OBJCFLAGS=-fexceptions -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS OBJCXXFLAGS:=-x objective-c++ $(OBJCFLAGS) # Comp Flags for files that need exceptions enabled (C and C++) -CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs +CFLAGSEXCEPTIONS=-fexceptions +.IF "$(COM_GCC_IS_CLANG)" != "TRUE" +CFLAGSEXCEPTIONS+=-fno-enforce-eh-specs +.ENDIF # Comp Flags for files that do not need exceptions enabled (C and C++) CFLAGS_NO_EXCEPTIONS=-fno-exceptions diff --git a/solenv/inc/unxmacx.mk b/solenv/inc/unxmacx.mk index b0c862ec17c1..8f36772f4d06 100644 --- a/solenv/inc/unxmacx.mk +++ b/solenv/inc/unxmacx.mk @@ -60,6 +60,9 @@ EXTRA_CDEFS+:=-isysroot $(MACOSX_SDK_PATH) -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MA CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE .ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" +.IF "$(HAVE_SFINAE_ANONYMOUS_BROKEN)" == "TRUE" +CDEFS += -DHAVE_SFINAE_ANONYMOUS_BROKEN +.ENDIF # "$(HAVE_SFINAE_ANONYMOUS_BROKEN)" == "TRUE" # MacOS X specific Java compilation/link flags SOLAR_JAVA*=TRUE @@ -103,7 +106,10 @@ OBJCFLAGS=-fobjc-exceptions OBJCXXFLAGS=-x objective-c++ -fobjc-exceptions # Comp Flags for files that need exceptions enabled (C and C++) -CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs +CFLAGSEXCEPTIONS=-fexceptions +.IF "$(COM_GCC_IS_CLANG)" != "TRUE" +CFLAGSEXCEPTIONS+=-fno-enforce-eh-specs +.ENDIF # Comp Flags for files that do not need exceptions enabled (C and C++) CFLAGS_NO_EXCEPTIONS=-fno-exceptions diff --git a/solenv/inc/unxsogi.mk b/solenv/inc/unxsogi.mk index 2ebcbc468e42..49ca1f3190c6 100644 --- a/solenv/inc/unxsogi.mk +++ b/solenv/inc/unxsogi.mk @@ -78,22 +78,27 @@ LINK*=$(CXX) LINKC*=$(CC) LINKFLAGS= -LINKFLAGSAPPGUI=-Wl,-export-dynamic +#LINKFLAGSAPPGUI=-Wl,-export-dynamic LINKFLAGSSHLGUI=-shared -LINKFLAGSAPPCUI=-Wl,-export-dynamic +#LINKFLAGSAPPCUI=-Wl,-export-dynamic LINKFLAGSSHLCUI=-shared LINKFLAGSTACK= LINKFLAGSPROF= LINKFLAGSDEBUG=-g LINKFLAGSOPT= -LINKVERSIONMAPFLAG=-Wl,--version-script +#LINKVERSIONMAPFLAG=-Wl,--version-script +LINKVERSIONMAPFLAG=-Wl,-M # enable visibility define in "sal/types.h" .IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE .ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" +.IF "$(HAVE_SFINAE_ANONYMOUS_BROKEN)" == "TRUE" +CDEFS += -DHAVE_SFINAE_ANONYMOUS_BROKEN +.ENDIF # "$(HAVE_SFINAE_ANONYMOUS_BROKEN)" == "TRUE" + # Reihenfolge der libs NICHT egal! STDLIBCPP=-lstdc++ diff --git a/solenv/inc/unxsogs.mk b/solenv/inc/unxsogs.mk index 4f80b42c0a4a..6a17f5969f90 100644 --- a/solenv/inc/unxsogs.mk +++ b/solenv/inc/unxsogs.mk @@ -77,9 +77,9 @@ LINK*=$(CXX) LINKC*=$(CC) LINKFLAGS= -LINKFLAGSAPPGUI=-Wl,-export-dynamic +#LINKFLAGSAPPGUI=-Wl,-export-dynamic LINKFLAGSSHLGUI=-shared -LINKFLAGSAPPCUI=-Wl,-export-dynamic +#LINKFLAGSAPPCUI=-Wl,-export-dynamic LINKFLAGSSHLCUI=-shared LINKFLAGSTACK= LINKFLAGSPROF= @@ -93,6 +93,10 @@ LINKVERSIONMAPFLAG=-Wl,--version-script CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE .ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" +.IF "$(HAVE_SFINAE_ANONYMOUS_BROKEN)" == "TRUE" +CDEFS += -DHAVE_SFINAE_ANONYMOUS_BROKEN +.ENDIF # "$(HAVE_SFINAE_ANONYMOUS_BROKEN)" == "TRUE" + # Reihenfolge der libs NICHT egal! STDLIBCPP=-lstdc++ diff --git a/solenv/inc/wntgcci.mk b/solenv/inc/wntgcci.mk index 6795d0f8f68c..bdf46b4d04af 100644 --- a/solenv/inc/wntgcci.mk +++ b/solenv/inc/wntgcci.mk @@ -48,7 +48,7 @@ CFLAGSCC=-pipe $(ARCH_FLAGS) CFLAGSCXX=-pipe $(ARCH_FLAGS) .IF "$(HAVE_CXX0X)" == "TRUE" -# FIXME still does not compile fully CFLAGSCXX+=-std=c++0x +# FIXME still does not compile fully CFLAGSCXX+=-std=gnu++0x .ENDIF CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs diff --git a/solenv/inc/wntmsc.mk b/solenv/inc/wntmsc.mk index f7b2dbedfd3f..afafe3861dc9 100644 --- a/solenv/inc/wntmsc.mk +++ b/solenv/inc/wntmsc.mk @@ -173,6 +173,8 @@ CFLAGSOUTOBJ=-Fo # (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) +# - "warning C4265: 'identifier' : class has virtual functions, but destructor is not +# virtual" # 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): @@ -184,7 +186,7 @@ CFLAGSWARNCXX=-Wall -wd4061 -wd4127 -wd4191 -wd4217 -wd4242 -wd4244 -wd4245 -wd4 -wd4290 -wd4294 -wd4355 -wd4511 -wd4512 -wd4514 -wd4555 -wd4611 -wd4625 -wd4626 \ -wd4640 -wd4675 -wd4686 -wd4706 -wd4710 -wd4711 -wd4786 -wd4800 -wd4820 -wd4503 -wd4619 \ -wd4365 -wd4668 -wd4738 -wd4826 -wd4350 -wd4505 -wd4692 -wd4189 -wd4005 \ - -wd4180 + -wd4180 -wd4265 CFLAGSWARNCC=$(CFLAGSWARNCXX) -wd4255 CFLAGSWALLCC=$(CFLAGSWARNCC) CFLAGSWALLCXX=$(CFLAGSWARNCXX) diff --git a/solenv/lldb/libreoffice/LO.py b/solenv/lldb/libreoffice/LO.py new file mode 100644 index 000000000000..8f7c2474d203 --- /dev/null +++ b/solenv/lldb/libreoffice/LO.py @@ -0,0 +1,71 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# Major Contributor(s): +# Copyright (C) 2012 Tor Lillqvist <tml@iki.fi> (initial developer) +# Copyright (C) 2012 SUSE Linux http://suse.com (initial developer's employer) +# +# All Rights Reserved. +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +# To use, add something like this to your ~/.lldbinit: + +# script sys.path[:0] = [os.path.expanduser('~/lo/ios/solenv/lldb/libreoffice')] +# script import LO +# type summary add --python-function LO.rtluString_summary rtl_uString +# type summary add --python-function LO.rtl_OUString_summary rtl::OUString + +import lldb + +def rtluString_summary(rtlustring, dict): + e = lldb.SBError() + + length = rtlustring.GetChildMemberWithName('length').GetValueAsUnsigned(0) + buffer = rtlustring.GetChildMemberWithName('buffer') + + s = '"' + i = 0 + while i < length: + c = buffer.GetPointeeData(i, 1).GetUnsignedInt16(e, 0) + if c == ord('"'): + s = s + '\\"' + elif c == ord('\\'): + s = s + '\\\\' + elif c == ord('\n'): + s = s + '\\n' + elif c == ord('\r'): + s = s + '\\r' + elif c == ord('\t'): + s = s + '\\t' + elif c < ord(' '): + s = s + '\\{:03o}'.format(c) + elif c < 127: + s = s + chr(c) + else: + s = s + '\\u{:04x}'.format(c) + i = i + 1 + s = s + '"' + + return s + +def rtl_OUString_summary(rtloustring, dict): + return rtluString_summary(rtloustring.GetChildMemberWithName('pData'), dict) + +# vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/solenv/makefile.mk b/solenv/makefile.mk index 4d806057f1f4..4d806057f1f4 100755..100644 --- a/solenv/makefile.mk +++ b/solenv/makefile.mk diff --git a/solenv/prj/d.lst b/solenv/prj/d.lst index 14b66d1572d8..14b66d1572d8 100755..100644 --- a/solenv/prj/d.lst +++ b/solenv/prj/d.lst |