2 eval 'exec perl -wS $0 ${1+"$@"}'
4 #*************************************************************************
6 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 # Copyright 2008 by Sun Microsystems, Inc.
10 # OpenOffice.org - a multi-platform office productivity suite
12 # $RCSfile: gccinstlib.pl,v $
16 # This file is part of OpenOffice.org.
18 # OpenOffice.org is free software: you can redistribute it and/or modify
19 # it under the terms of the GNU Lesser General Public License version 3
20 # only, as published by the Free Software Foundation.
22 # OpenOffice.org is distributed in the hope that it will be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 # GNU Lesser General Public License version 3 for more details
26 # (a copy is included in the LICENSE file that accompanied this code).
28 # You should have received a copy of the GNU Lesser General Public License
29 # version 3 along with OpenOffice.org. If not, see
30 # <http://www.openoffice.org/license.html>
31 # for a copy of the LGPLv3 License.
33 #*************************************************************************
35 $ENV{'LC_MESSAGES'} = 'C';
37 $Dest = pop(@ARGV) || die "No destination to copy to";
39 $cc = $ENV{'CC'} || die "No CC environment set";
41 if ($Dest =~ /--help/ || @ARGV < 1) {
42 print "Syntax:\n gcc-instlib <library-in-libpath ...> <destination-dir>\n";
45 foreach $File (@ARGV) {
48 open (GCCOut
, "LANGUAGE=C LC_ALL=C $cc -print-file-name=$File|") || die "Failed to exec $cc -print-file-name=$File $!";
51 push (@CopySrc, $string);
55 foreach $Src (@CopySrc) {
56 printf "copy $Src to $Dest\n";
57 system ("/bin/cp $Src $Dest") && die "copy failed: $!";