From f5b840a3ee14a2086647596246d3491a58bf33bb Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Tue, 17 Sep 2013 13:56:12 +0200 Subject: goodbye linkoo.. you have served well This commit: - removes linkoo and --disable-linkoo option - removes 'dev-update' make target - creates --disable-ooenv option - removes LD_LIBRARY_PATH and PATH settings in ooenv Change-Id: I9530558531e9cb58b8282754ec8a6c655f190480 --- Makefile.in | 12 - README.cross | 6 - config_host.mk.in | 2 +- configure.ac | 31 +- instsetoo_native/CustomTarget_setup.mk | 6 +- instsetoo_native/Package_setup.mk | 2 +- solenv/README | 5 - solenv/bin/linkoo | 602 --------------------------------- solenv/bin/ooinstall | 13 +- 9 files changed, 19 insertions(+), 660 deletions(-) delete mode 100755 solenv/bin/linkoo diff --git a/Makefile.in b/Makefile.in index 5598af47963c..da2beb20adf6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -271,7 +271,6 @@ dev-install: build ifeq ($(OS_FOR_BUILD),WNT) cd $(SRCDIR)/instsetoo_native && $(GNUMAKE) LIBO_DEV_INSTALL=TRUE $(GMAKE_OPTIONS) else -ifeq ($(DISABLE_LINKOO),TRUE) @ooinstall $(DEVINSTALLDIR)/opt ifneq ($(MACOSX_CODESIGNING_IDENTITY),) @macosx-codesign-app-bundle $(DEVINSTALLDIR)/opt/LibreOffice.app @@ -279,9 +278,6 @@ endif ifneq ($(OS),MACOSX) @install-gdb-printers -L endif -else - @ooinstall -l $(DEVINSTALLDIR)/opt -endif endif @rm -f $(BUILDDIR)/install && ln -s $(DEVINSTALLDIR)/opt/ $(BUILDDIR)/install @echo @@ -305,14 +301,6 @@ endif dev-install-nocheck: build-nocheck $(MAKE) dev-install -o build -# FIXME: shouldn't linkoo be BUILDDIR vs SRCDIR aware ? -dev-update: -ifeq ($(DISABLE_LINKOO),TRUE) - @linkoo --copy $(DEVINSTALLDIR)/opt $(SRCDIR) -else - @linkoo $(DEVINSTALLDIR)/opt $(SRCDIR) -endif - install-tb: @rm -rf $(DEVINSTALLDIR) @mkdir $(DEVINSTALLDIR) diff --git a/README.cross b/README.cross index 28e4a33387e4..6b68fde1713c 100644 --- a/README.cross +++ b/README.cross @@ -193,11 +193,6 @@ http://www.winehq.org/docs/wineusr-guide/environment-variables, and add Z:\tmp\LibO-Dev_4.1.0.0.alpha0_Win_x86_archive/LOdev\ 4.1\URE\bin to "Path" in My Computer->HKEY_CURRENT_USER->Environment. -Then run linkoo, so that when you rebuild something, you can directly see the -changes the next time you run it: - -solenv/bin/linkoo '/tmp/LibO-Dev_4.1.0.0.alpha0_Win_x86_archive/LOdev\ 4.1' - And start debugging: $ winedbg soffice.bin @@ -422,7 +417,6 @@ CC= --sysroot= CXX= --sysroot= --build=x86_64-unknown-linux-gnu --host=arm-unknown-linux-gnueabihf ---disable-linkoo --without-doxygen --disable-gnome-vfs --enable-python=system diff --git a/config_host.mk.in b/config_host.mk.in index cfd1357207c6..6b9768fe5c05 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -95,7 +95,6 @@ export DISABLE_CVE_TESTS=@DISABLE_CVE_TESTS@ export DISABLE_DBCONNECTIVITY=@DISABLE_DBCONNECTIVITY@ export DISABLE_DYNLOADING=@DISABLE_DYNLOADING@ export DISABLE_EXPORT=@DISABLE_EXPORT@ -export DISABLE_LINKOO=@DISABLE_LINKOO@ export DISABLE_NEON=@DISABLE_NEON@ export DISABLE_OPENSSL=@DISABLE_OPENSSL@ export DISABLE_PYTHON=@DISABLE_PYTHON@ @@ -145,6 +144,7 @@ export ENABLE_MARIADBC=@ENABLE_MARIADBC@ export ENABLE_NPAPI_FROM_BROWSER=@ENABLE_NPAPI_FROM_BROWSER@ export ENABLE_NPAPI_INTO_BROWSER=@ENABLE_NPAPI_INTO_BROWSER@ export ENABLE_ONLINE_UPDATE=@ENABLE_ONLINE_UPDATE@ +export ENABLE_OOENV=@ENABLE_OOENV@ export ENABLE_OPENGL=@ENABLE_OPENGL@ export ENABLE_OPENCL=@ENABLE_OPENCL@ export ENABLE_PACKAGEKIT=@ENABLE_PACKAGEKIT@ diff --git a/configure.ac b/configure.ac index c145970e4e82..bf78f359fe49 100644 --- a/configure.ac +++ b/configure.ac @@ -848,9 +848,9 @@ AC_ARG_ENABLE(compiler-plugins, [Enable compiler plugins that will perform additional checks during building. Enabled automatically by --enable-dbgutil.])) -AC_ARG_ENABLE(linkoo, - AS_HELP_STRING([--disable-linkoo], - [Disable linkoo for the smoketest installation.])) +AC_ARG_ENABLE(ooenv, + AS_HELP_STRING([--disable-ooenv], + [Disable ooenv for the instdir installation.])) AC_ARG_ENABLE(lto, AS_HELP_STRING([--enable-lto], @@ -4601,21 +4601,18 @@ else fi AC_SUBST(ASSERT_ALWAYS_ABORT) -dnl Determine whether to use linkoo for the smoketest installation -dnl =================================================================== -AC_MSG_CHECKING([whether to use linkoo for the smoketest installation]) -if test $_os = Darwin; then - enable_linkoo=no -fi - -if test "$enable_linkoo" = "no"; then - DISABLE_LINKOO="TRUE" - AC_MSG_RESULT([no]) -else - DISABLE_LINKOO= - AC_MSG_RESULT([yes]) +# Determine whether to use ooenv for the instdir installation +# =================================================================== +if test $_os != "WINNT" -a $_os != "Darwin"; then + AC_MSG_CHECKING([whether to use ooenv for the instdir installation]) + if test "$enable_ooenv" = "no"; then + AC_MSG_RESULT([no]) + else + ENABLE_OOENV="TRUE" + AC_MSG_RESULT([yes]) + fi fi -AC_SUBST(DISABLE_LINKOO) +AC_SUBST(ENABLE_OOENV) if test "$enable_headless" = "yes"; then # be sure to do not mess with uneeded stuff diff --git a/instsetoo_native/CustomTarget_setup.mk b/instsetoo_native/CustomTarget_setup.mk index 8556ff58b059..6f2c647eb6e1 100644 --- a/instsetoo_native/CustomTarget_setup.mk +++ b/instsetoo_native/CustomTarget_setup.mk @@ -12,7 +12,7 @@ $(eval $(call gb_CustomTarget_CustomTarget,instsetoo_native/setup)) $(eval $(call gb_CustomTarget_register_targets,instsetoo_native/setup,\ $(call gb_Helper_get_rcfile,bootstrap) \ $(call gb_Helper_get_rcfile,fundamental) \ - ooenv \ + $(if $(ENABLE_OOENV),ooenv) \ $(if $(filter TRUE,$(DISABLE_PYTHON)),,$(call gb_Helper_get_rcfile,pythonloader.uno)) \ $(call gb_Helper_get_rcfile,uno) \ $(call gb_Helper_get_rcfile,version) \ @@ -69,11 +69,7 @@ $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/$(call gb_Helper_get_ $(call gb_CustomTarget_get_workdir,instsetoo_native/setup)/ooenv : $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ECH,1) ( \ - echo 'java_path=`$(gb_INSTROOT)/ure/bin/javaldx 2>/dev/null`' && \ - echo 'export LD_LIBRARY_PATH="$(gb_INSTROOT)/program:$$java_path$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH}"' && \ echo 'ulimit -c unlimited' && \ - echo 'export PATH="$(gb_INSTROOT)/program:$(gb_INSTROOT)/ure/bin:$$PATH"' && \ - echo 'export GNOME_DISABLE_CRASH_DIALOG=1' && \ echo '# debugging assistance' && \ echo 'export SAL_DISABLE_FLOATGRAB=1' && \ echo 'export G_SLICE=always-malloc' && \ diff --git a/instsetoo_native/Package_setup.mk b/instsetoo_native/Package_setup.mk index 2cd15fcfb8d0..caada4f77655 100644 --- a/instsetoo_native/Package_setup.mk +++ b/instsetoo_native/Package_setup.mk @@ -14,7 +14,7 @@ $(eval $(call gb_Package_set_outdir,instsetoo_native_setup,$(gb_INSTROOT))) $(eval $(call gb_Package_add_files,instsetoo_native_setup,$(gb_PROGRAMDIRNAME),\ $(call gb_Helper_get_rcfile,bootstrap) \ $(call gb_Helper_get_rcfile,fundamental) \ - ooenv \ + $(if $(ENABLE_OOENV),ooenv) \ $(if $(filter TRUE,$(DISABLE_PYTHON)),,$(call gb_Helper_get_rcfile,pythonloader.uno)) \ $(call gb_Helper_get_rcfile,uno) \ $(call gb_Helper_get_rcfile,version) \ diff --git a/solenv/README b/solenv/README index 983b4c6c43b6..fd0c593c2f0d 100644 --- a/solenv/README +++ b/solenv/README @@ -15,11 +15,6 @@ bin/ 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. diff --git a/solenv/bin/linkoo b/solenv/bin/linkoo deleted file mode 100755 index 8f3db1b3f7ba..000000000000 --- a/solenv/bin/linkoo +++ /dev/null @@ -1,602 +0,0 @@ -: - eval 'exec perl -S $0 ${1+"$@"}' - if 0; - -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# -#************************************************************************* -# -# This app makes it easy to link a live build -# set into an install set. Then your devel iteration -# is: 'build', execute. -# -#************************************************************************* - -use strict; -use File::stat; -use File::Copy; -use File::Find; -use File::Spec::Functions qw[splitdir catdir]; - -# ends up in program/ooenv -( my $moz_lib = `pkg-config --variable=libdir mozilla-nss` ) =~ tr/\n/:/; -my $env_script = ' -java_path=`$thisdir/../ure-link/bin/javaldx 2>/dev/null` -export LD_LIBRARY_PATH="$thisdir:$java_path:' . $moz_lib . '$LD_LIBRARY_PATH" -ulimit -c unlimited -export PATH="$thisdir:$thisdir/../ure-link/bin:$PATH" -export GNOME_DISABLE_CRASH_DIALOG=1 -# debugging assistance -export SAL_DISABLE_FLOATGRAB=1 -export G_SLICE=always-malloc -export MALLOC_CHECK_=2 -export MALLOC_PERTURB_=153 -export OOO_DISABLE_RECOVERY=1 -export SAL_ALLOW_LINKOO_SYMLINKS=1 -'; - -my $dry_run = 0; -my $backup = 0; -my $copy = 0; -my $usage = 0; -my $windows = 0; -my $LANG; -my $TARGET; -my $LIBVER; -my $OOO_BUILD; -my $OOO_INSTALL; -my $SOLARVER; - -if ($ENV{'OS'} eq 'MACOSX') { - print "FIXME: linkoo currently does not work on Mac OS X\n"; - exit(0); -} - -# process options -for my $a (@ARGV) { - - # options - if ($a =~ /--dry-run/) { - $dry_run = 1; - } elsif (($a eq '--help') || ($a eq '-h')) { - $usage = 1; - } elsif ($a eq '--backup') { - $backup = 1; - } elsif ($a eq '--copy') { - $copy = 1; - # ordered arguments - } elsif (!defined $OOO_INSTALL) { - $OOO_INSTALL = $a; - } elsif (!defined $OOO_BUILD) { - $OOO_BUILD = $a; - } else { - print "Unknown argument '$a'\n"; - $usage = 1; - } -} - -if (!defined $OOO_BUILD && defined $ENV{SRC_ROOT}) { - $OOO_BUILD = $ENV{SRC_ROOT}; -} - -if ($usage || !defined $OOO_INSTALL || !defined $OOO_BUILD) { - printf "Usage: linkoo [] [--dry-run] [--backup] [--copy]\n"; - exit (1); -} - -File::Spec->file_name_is_absolute($OOO_INSTALL) || die "linkoo requires absolute paths ($OOO_INSTALL does not qualify)"; -File::Spec->file_name_is_absolute($OOO_BUILD) || die "linkoo requires absolute paths ($OOO_BUILD does not qualify)"; - --d $OOO_INSTALL || die "No such directory $OOO_INSTALL"; --w $OOO_INSTALL || die "You need write access to $OOO_INSTALL"; --d $OOO_BUILD || die "No such directory $OOO_BUILD"; - -($TARGET, $LIBVER, $LANG) = sniff_target ($OOO_BUILD); - -$SOLARVER = "$OOO_BUILD/solver"; - -if ($TARGET =~ /^wntgcci/ || $TARGET =~ /^wntgccx/ || $TARGET =~ /^wntmsci[0-9]+/|| $TARGET =~ /^wntmscx[0-9]+/) { - $windows = 1; -} - -if ($TARGET =~ /^wntmsci[0-9]+/ || $TARGET =~ /^wntmscx[0-9]+/) { - # wntgcci means are cross-compiling & can symlink, so copy only on real - # Windows - $copy = 1; -} - -# setup global variables -my $brand_program_dir = 'program'; -my $ure_lib_dir = 'ure-link/lib'; -my $win_ure_lib_dir = 'URE/bin'; - -my @exceptions = ( 'libsunjavaplugin', 'libjvmfwk' ); -push @exceptions, 'cppuhelper' if (!$windows); - -my $bin; -$bin = "|\\.bin" if ($windows); -my %replaceable = ( - $brand_program_dir => "(\\.so|\\.dll|\\.exe|\\.com$bin)\$", - $ure_lib_dir => "(\\.so\$|\\.so\\.3\$)", - $win_ure_lib_dir => "(\\.dll|\\.exe|\\.bin|\\.com)\$", - $brand_program_dir . '/resource' => '\.res$', - $brand_program_dir . '/classes' => '\.jar$', - 'ure-link/share/java' => '\.jar$', - 'share/extensions/nlpsolver' => '\.jar$', - 'share/extensions/wiki-publisher' => '\.jar$', - 'share/extensions/pdf-import' => "(\\.so|\\.dll|\\.exe|\\.com$bin)\$", - 'share/extensions/presenter-screen' => "(\\.so|\\.dll|\\.exe|\\.com$bin)\$", - 'share/extensions/presentation-minimizer' => "(\\.so|\\.dll|\\.exe|\\.com$bin)\$", - 'share/config' => '\.zip$', -# 'share/uno_packages' => '\.zip$' -); - -my @instdir_replaceable = ( - 'share', - 'program', -# 'presets', # leave these guys alone for now - 'help', -); - -my @search_dirs = ( 'lib', 'bin', 'class' ); - -my @known_duplicates = ( 'db.jar', 'libi18n', 'libnssckbi', 'libnssdbm', 'libsqlite3', 'libnssutil3', 'pythonloader.uno', 'pyuno', 'libpyuno' ); - -sub sniff_target($) -{ - my $build_dir = shift; - my ($target, $libver, $lang) = ( 'unxlngi6.pro', '680', 'en-US' ); # defaults - - chomp($target=`cat $build_dir/config_host.mk | grep INPATH= | sed -e 's/.*=//' | sed -e 's/"//g'`); - chomp($libver=`cat $build_dir/config_host.mk | grep UPD= | sed -e 's/.*=//' | sed -e 's/"//g'`); - - print "Sniffed target: $target, $libver\n"; - - return ($target, $libver, $lang); -} - -sub build_installed_list($) -{ - my $path = shift; - my %files = (); - - for my $suffix (keys %replaceable) { - my $dirname = "$path/$suffix"; - my $dirhandle; - my $pattern = $replaceable{$suffix}; - if (opendir ($dirhandle, $dirname)) { - while (my $fname = readdir ($dirhandle)) { - $fname =~ m/$pattern/ || next; - - my $skip = 0; - for $pattern (@exceptions) { - $fname =~ /$pattern/ || next; - $skip = 1; - } - $files{$fname} = $dirname if !$skip; - } - closedir ($dirhandle); - } else { - print "Couldn't find '$dirname': skipping\n"; - } - } - return \%files; -} - -sub check_create_linked($) -{ - my $path = shift; - my $linked_dir = "$path/linked"; - if (! -d $linked_dir) { - mkdir $linked_dir || die "Can't make $linked_dir: $!"; - } -} - -sub do_link($$$$@) -{ - my $src = shift; - my $dest = shift; - my $src_name = shift; - my $dest_name = shift; - my $dont_check_link = shift; - - if ($dest_name eq 'soffice' || - $dest_name eq 'unopkg' || - $dest_name eq 'unoinfo' || - $dest_name eq 'spadmin' || - $dest_name eq 'gengal' || - $dest_name eq 'python') - { return; } # these scripts uses `pwd`... - - if ($copy) { # copy if older ... - my $src_mtime = stat("$src/$src_name")->mtime; - my $dest_mtime = stat("$dest/$dest_name")->mtime; - if ($src_mtime > $dest_mtime) { -# print " copy $src/$src_name ($src_mtime) -> $dest/$dest_name ($dest_mtime)\n"; - print " copy $src/$src_name -> $dest/$dest_name\n"; - unlink ("$dest/$dest_name"); - copy("$src/$src_name", "$dest/$dest_name") || die "Failed top copy: $!"; - } else { -# print " up-to-date $src/$src_name -> $dest/$dest_name\n"; - } - } elsif (-l "$dest/$dest_name" ) { - my $link = readlink ("$dest/$dest_name"); - if ($link =~ /^\//) { # Absolute path - if (!$dry_run) { - # re-write the link - unlink ("$dest/$dest_name"); - symlink ("$src/$src_name", "$dest/$dest_name") || die "Failed to symlink $src/$src_name: $!"; - print " [$dest_name]"; - } else { - print "re-make link $src/$src_name => $dest/$dest_name\n"; - } - } elsif ($dry_run) { - print "skipping symbolic link $dest/$dest_name -> $link\n"; - } - } else { - if (!$dry_run) { - # move / write the link - if ($backup) { - check_create_linked ($dest); - rename ("$dest/$dest_name", "$dest/linked/$dest_name") || - defined $dont_check_link || die "Failed rename of $dest/$dest_name: $!"; - } else { - unlink ("$dest/$dest_name") || - defined $dont_check_link || die "Failed remove of $dest/$dest_name: $!"; - } - symlink ("$src/$src_name", "$dest/$dest_name") || die "Failed to symlink $src/$src_name: $!"; - print " $dest_name"; - } else { - print "move / symlink $src/$src_name => $dest/$dest_name\n"; - } - } -} - -sub scan_one_dir($$$$) -{ - my ($installed_files, $build_files, $path, $solver) = @_; - my $dirh_module; - - if (!$solver) { - if (opendir ($dirh_module, "$path/..")) { - while (my $file = readdir ($dirh_module)) { - if ($file =~ /Library_.*\.mk/) { - if (-d $path) { - print STDERR "gnu-makeified module contains stale output dir '$path', renaming it away\n"; - rename ($path, "$path.obsolete"); # if it fails, nevermind ... - } - return; - } - } - closedir ($dirh_module); - } - } - - for my $elem (@search_dirs) { - my $module_path = "$path/$elem"; - if (opendir ($dirh_module, $module_path)) { - while (my $file = readdir ($dirh_module)) { - if (defined $installed_files->{$file}) { - if (defined $build_files->{$file}) { - my $known = 0; - for my $regexp (@known_duplicates) { - if ($file =~ m/$regexp/) { - $known = 1; - } - } - if (!$known && !$solver) { - print STDERR "\nlinkoo:: Unknown duplicate file '$file' in: '" . - $build_files->{$file} . "' vs '" . - $module_path . "' in module $path\n"; - exit (1); - } - } else { - $build_files->{$file} = $module_path; - } - } - } - } - closedir ($dirh_module); - } -} - -sub get_modules($$) -{ - my $build_path = shift; - my $target = shift; - - my @modules = (); - my $dirh_toplevel; - opendir ($dirh_toplevel, $build_path) || die "Can't open '$build_path': $!"; - while ( my $subdir = readdir ($dirh_toplevel) ) - { - $subdir =~ m/\./ && next; # eg. vcl.old, - $subdir eq 'solver' && next; # skip solver dir itself - my $test = "$build_path/$subdir/$target"; - -d $test || next; - push @modules, $test; - } - closedir ($dirh_toplevel); - - return \@modules; -} - -sub scan_and_link_files($$$) -{ - my $build_path = shift; - my $installed_files = shift; - my $target = shift; - - my @modules = get_modules( $build_path, $target ); - - # Scan the old-style module/$target/lib directories ... - my %build_files; - for my $module (@modules) { - scan_one_dir ($installed_files, \%build_files, $module, 0); - } - - # Now scan the solver - scan_one_dir ($installed_files, \%build_files, "$SOLARVER/$target", 1); - - for my $file (keys %build_files) { - my $src = $build_files{$file}; - my $dest = $installed_files->{$file}; - - do_link ($src, $dest, $file, $file); - } - print "\n"; -} - -sub evilness($) -{ - my $doit = shift; - my $name = 'librecentfile.so'; - my $src = "$OOO_BUILD/shell/$TARGET/lib/$name"; - my $dest = "$OOO_BUILD/sfx2/$TARGET/lib/$name"; - - return if ($windows); - - if ($doit eq 'undo') { - if (-l $dest) { - print " unlink $name\n"; - unlink $dest; - } - } else { - $doit eq 'do' || die; - if (-f $src) { - print " link $name\n"; - symlink $src, $dest; - } - } -} - -sub do_link_gdb_py($$$) -{ - my $srcdir = shift; - my $libdir = shift; - my $loader = shift; - - my $lib = $loader =~ s/-gdb.py$//; - my $destdir = $libdir; - # Autoloader for a library is looked for in the same directory the library - # is (the library, not a symlink to it). Therefore it does not help to link - # it from solver into install, because there is only a symlink in install - # anyway. Instead, we must follow the link. - if (-l "$libdir/$lib") { - $destdir = readlink ("$libdir/$lib"); - $destdir =~ s@/[^/]*$@@; - } - - if ($destdir ne $srcdir) { - do_link ($srcdir, $destdir, $loader, $loader, 1); - } -} - -sub link_gdb_py() -{ - return if ($windows); - print "Special gdb.py helpers case: "; - - my $dirh; - my @basis; - my @ure; - my $src = "$SOLARVER/$TARGET/lib"; - opendir ($dirh, $src) || die "can't open solver: $src: $!"; - while (my $dent = readdir ($dirh)) { - $dent =~ /^\./ && next; - $dent =~ /\-gdb\.py/ || next; - if ($dent =~ /uno/) { - push @ure, $dent; - } else { - push @basis, $dent; - } - } - closedir ($dirh); - if (@ure < 1 || @basis < 1) { - print STDERR "Warning: missing helpful python debug helpers\n"; - } else { - for my $c (@basis) { - do_link_gdb_py ($src, "$OOO_INSTALL/program", $c); - } - for my $c (@ure) { - do_link_gdb_py ($src, "$OOO_INSTALL/ure/lib", $c); - } - } - print "\n"; -} - -sub link_pagein_files() -{ - return if ($windows); - - print "pagein case:"; - my $src = "$SOLARVER/$TARGET/bin"; - my $dest = "$OOO_INSTALL/" . $brand_program_dir; - for my $c ('calc', 'draw', 'impress', 'writer', 'common') { - do_link ($src, $dest, "pagein-$c", "pagein-$c"); - } - print "\n"; -} - -sub link_ui_files() -{ - # First find all the en-US .ui files installed - my @files = (); - - find( sub - { - if ( $File::Find::dir !~ /\/res\// && $_ =~ /\.ui$/ ) - { - push( @files, $File::Find::name ); - } - }, "$OOO_INSTALL/" ); - - my @modules = get_modules( $OOO_BUILD, $TARGET ); - - print "ui case:"; - # Search the files in the source tree - for my $dest ( @files ) - { - my @dest_dirs = splitdir( $dest ); - my $module_dir = @dest_dirs[-3]; - - my $name = @dest_dirs[-1]; - my $nb_dirs = @dest_dirs - 2; - my $dest_dir = catdir( @dest_dirs[0..$nb_dirs] ); - - # Find out the file to link to in the source tree - my $modulepath = ""; - my $nb_segments = 3; - if ( $dest =~ /\/modules\// ) - { - # Handle the modules/* cases - if ( $module_dir =~ /^sw/ || $module_dir eq "sglobal" ) { $modulepath = "sw/uiconfig"; } - elsif ( $module_dir eq "smath" ) { $modulepath = "starmath/uiconfig"; } - elsif ( $module_dir eq "simpress" || $module_dir eq "sdraw" ) { $modulepath = "sd/uiconfig"; } - elsif ( $module_dir eq "scalc" ) { $modulepath = "sc/uiconfig"; } - elsif ( $module_dir =~ /^db/ ) { $modulepath = "dbaccess/uiconfig"; } - elsif ( $module_dir eq "BasicIDE" ) { $modulepath = "basctl/uiconfig/basicide"; $nb_segments = 2; } - elsif ( $module_dir eq "schart" ) { $modulepath = "chart2/uiconfig"; $nb_segments = 2; } - elsif ( $module_dir eq "tubes" ) { $modulepath = "tubes/uiconfig"; } - elsif ( $module_dir eq "StartModule" ) { $modulepath = "framework/uiconfig/startmodule"; $nb_segments = 2; } - } - else - { - $nb_segments = 2; - # Handle the /ui/ cases - my $module = $module_dir; - if ( $module_dir eq "sfx" ) { $module = "sfx2"; } - elsif ( $module_dir eq "svt" ) { $module = "svtools"; } - elsif ( $module_dir eq "sw" ) { $module = "sw"; $nb_segments = 3; } - elsif ( $module_dir eq "spa" ) { $module = "padmin"; } - elsif ( $module_dir eq "xmlsec" ) { $module = "xmlsecurity"; } - - $modulepath = "$module/uiconfig"; - } - my $subpath = catdir( @dest_dirs[-$nb_segments..-2] ); - my $src_dir = "$OOO_BUILD/$modulepath/$subpath"; - -# print STDERR "$module_dir : $modulepath : '$src_dir/$name'\n"; - - if ( -e "$src_dir/$name" ) - { - do_link ( $src_dir, $dest_dir, $name, $name ); - } - } - print "\n"; -} - -sub link_rdb_files() -{ - print "linking rdb:"; - my $src_prefix = "$SOLARVER/$TARGET/"; - my $dest_prefix = "$OOO_INSTALL/"; - - do_link ($src_prefix . "xml" , $dest_prefix . $brand_program_dir . "/services", "services.rdb", "services.rdb"); - do_link ($src_prefix . "xml/ure" , $dest_prefix . "ure/share/misc", "services.rdb", "services.rdb"); - - do_link ($src_prefix . "bin" , $dest_prefix . "ure/share/misc", "udkapi.rdb", "types.rdb"); - - print "\n"; -} - -# instdir is an internal directory in the build tree -# installdir is the directory we installed into. -sub do_recursive_link($$) -{ - my ($instdir, $installdir) = @_; - - (-d $installdir && -d $instdir) || die "not directories"; - - my $dirhandle; - if (opendir ($dirhandle, $instdir)) { - while (my $fname = readdir ($dirhandle)) { - $fname =~ /^\./ && next; - if (-d "$instdir/$fname") { - if (-d "$installdir/$fname") { - do_recursive_link("$instdir/$fname", "$installdir/$fname"); - } else { - print STDERR "mismatching directories $instdir/$fname vs. $installdir/$fname\n"; - } - } elsif (-f "$installdir/$fname") { - do_link ($instdir, $installdir, $fname, $fname, 0); - } else { - print STDERR "Warning: odd file type for $instdir/$fname\n"; - } - } - } else { - print STDERR "Couldn't scan '$instdir': $!"; - } -} - -sub link_instdir($$) -{ - my ($instdir, $installdir) = @_; - - print "linking instdir ...\n"; - for my $dir (@instdir_replaceable) { -# include target ... - do_recursive_link("$instdir/$dir", "$installdir/$dir"); - } -} - -evilness ('undo'); - -my $installed_files = build_installed_list ($OOO_INSTALL); - -scan_and_link_files ($OOO_BUILD, $installed_files, $TARGET); -link_instdir("$OOO_BUILD/instdir/$TARGET", $OOO_INSTALL); -link_gdb_py(); -link_pagein_files(); -link_ui_files(); -link_rdb_files(); - -if (!-f "$OOO_INSTALL/" . $brand_program_dir . "/ooenv") { - my $ooenv; - print "Creating '$OOO_INSTALL/", $brand_program_dir, "/ooenv'\n"; - 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; - close ($ooenv); -} - -evilness ('do'); - -print "\nlinkoo finished\n"; - -# vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/solenv/bin/ooinstall b/solenv/bin/ooinstall index f2606f39e675..d634b617669a 100755 --- a/solenv/bin/ooinstall +++ b/solenv/bin/ooinstall @@ -20,7 +20,6 @@ use Cwd; $path = ''; $strip = ''; -$do_link = 0; $is_windows = 0; my $tmp_dir; @@ -45,9 +44,7 @@ if ($ENV{'SYSTEM_MOZILLA'} eq 'YES') { $ENV{'PYTHONPATH'} = "$ENV{'SRC_ROOT'}/instsetoo_native/$ENV{'INPATH'}/bin:$ENV{'SOLARVERSION'}/$ENV{'INPATH'}/lib:$ENV{'SOLARVERSION'}/$ENV{'INPATH'}/lib/python:$ENV{'SOLARVERSION'}/$ENV{'INPATH'}/lib/python/lib-dynload"; for $arg (@ARGV) { - if ($arg eq '-l' || $arg eq '--link') { - $do_link = 1; - } elsif ($arg eq '-s' || $arg eq '--strip') { + if ($arg eq '-s' || $arg eq '--strip') { $strip = "-strip"; } elsif ($arg eq '-h' || $arg eq '--help') { $help = 1; @@ -61,8 +58,7 @@ for $arg (@ARGV) { $help = 1 if $path eq ''; if ($help) { - print "ooinstall [-l] [-s] \n"; - print " -l/--link - performs a linkoo on the installed source\n"; + print "ooinstall [-s] \n"; print " -s/--strip - strip the installed binaries\n"; exit 1; } @@ -121,11 +117,6 @@ if ($ENV{BUILD_TYPE} =~ m/ODK/) { } print "Installer finished\n"; -if ($do_link && !$is_windows) { - system("$ENV{SOLARENV}/bin/linkoo $path $ENV{BUILDDIR}") && - die "linkoo failed: $!"; -} - # Local Variables: # cperl-indent-level: 4 # indent-tabs-mode: nil -- cgit