author | Lokanath Das <Lokanath.Das@Sun.COM> |
Fri, 16 Nov 2007 16:54:07 -0800 | |
changeset 250 | 01f9dae8314d |
parent 241 | 30e6f29a3171 |
child 341 | 0a1eb61fd56e |
permissions | -rwxr-xr-x |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
1 |
#! /usr/perl5/bin/perl |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
2 |
# |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
3 |
# Copyright 2007 Sun Microsystems, Inc. All rights reserved. |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
4 |
# |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
5 |
# Permission is hereby granted, free of charge, to any person obtaining a |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
6 |
# copy of this software and associated documentation files (the |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
7 |
# "Software"), to deal in the Software without restriction, including |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
8 |
# without limitation the rights to use, copy, modify, merge, publish, |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
9 |
# distribute, and/or sell copies of the Software, and to permit persons |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
10 |
# to whom the Software is furnished to do so, provided that the above |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
11 |
# copyright notice(s) and this permission notice appear in all copies of |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
12 |
# the Software and that both the above copyright notice(s) and this |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
13 |
# permission notice appear in supporting documentation. |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
14 |
# |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
15 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
16 |
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
17 |
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
18 |
# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
19 |
# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
20 |
# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
21 |
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
22 |
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
23 |
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
24 |
# |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
25 |
# Except as contained in this notice, the name of a copyright holder |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
26 |
# shall not be used in advertising or otherwise to promote the sale, use |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
27 |
# or other dealings in this Software without prior written authorization |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
28 |
# of the copyright holder. |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
29 |
# |
241
30e6f29a3171
6624562 Xvnc should be built with Sun Studio
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
235
diff
changeset
|
30 |
# ident "@(#)delibtoolize.pl 1.8 07/11/02 SMI" |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
31 |
# |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
32 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
33 |
# |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
34 |
# Undo libtool damage to makefiles to allow us to control the linker |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
35 |
# settings that libtool tries to force on us. |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
36 |
# |
241
30e6f29a3171
6624562 Xvnc should be built with Sun Studio
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
235
diff
changeset
|
37 |
# Usage: delibtoolize.pl [-P] <path> |
30e6f29a3171
6624562 Xvnc should be built with Sun Studio
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
235
diff
changeset
|
38 |
# -P - Use large pic flags (-KPIC/-fPIC) instead of default/small (-Kpic/-fpic) |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
39 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
40 |
use strict; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
41 |
use warnings; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
42 |
use integer; |
241
30e6f29a3171
6624562 Xvnc should be built with Sun Studio
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
235
diff
changeset
|
43 |
use Getopt::Std; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
44 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
45 |
use File::Find; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
46 |
|
241
30e6f29a3171
6624562 Xvnc should be built with Sun Studio
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
235
diff
changeset
|
47 |
my %opts; |
30e6f29a3171
6624562 Xvnc should be built with Sun Studio
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
235
diff
changeset
|
48 |
getopts('P', \%opts); |
30e6f29a3171
6624562 Xvnc should be built with Sun Studio
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
235
diff
changeset
|
49 |
|
30e6f29a3171
6624562 Xvnc should be built with Sun Studio
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
235
diff
changeset
|
50 |
my $pic_size = "pic"; |
30e6f29a3171
6624562 Xvnc should be built with Sun Studio
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
235
diff
changeset
|
51 |
if (exists($opts{'P'})) { |
30e6f29a3171
6624562 Xvnc should be built with Sun Studio
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
235
diff
changeset
|
52 |
$pic_size = "PIC"; |
30e6f29a3171
6624562 Xvnc should be built with Sun Studio
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
235
diff
changeset
|
53 |
} |
30e6f29a3171
6624562 Xvnc should be built with Sun Studio
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
235
diff
changeset
|
54 |
|
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
55 |
sub process_file { |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
56 |
if ($_ eq 'Makefile' && -f $_) { |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
57 |
print "delibtoolizing $File::Find::name...\n"; |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
58 |
my $old_file = $_ . '~'; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
59 |
my $new_file = $_; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
60 |
rename($new_file, $old_file) or |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
61 |
die "Can't rename $new_file to $old_file: $!\n"; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
62 |
|
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
63 |
open my $OLD, '<', $old_file |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
64 |
or die "Can't open $old_file for reading: $!\n"; |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
65 |
open my $NEW, '>', $new_file |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
66 |
or die "Can't open $new_file for writing: $!\n"; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
67 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
68 |
my $compiler; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
69 |
my @inlines = (); |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
70 |
my %so_versions = (); |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
71 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
72 |
# Read in original file and preprocess for data we'll need later |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
73 |
while (my $l = <$OLD>) { |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
74 |
if ($l =~ m/^\s*CC\s*=\s*(\S*)/) { |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
75 |
$compiler = $1; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
76 |
} |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
77 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
78 |
# TODO: handle line continuation |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
79 |
if ($l =~ m/^(\S*)_la_LDFLAGS\s=.*-version-number (\d+)[:\d]+/ms) { |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
80 |
$so_versions{$1} = $2; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
81 |
} |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
82 |
if ($l =~ m/^(\S*)_la_LDFLAGS\s=.*\s*-avoid-version\b/ms) { |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
83 |
$so_versions{$1} = 'none'; |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
84 |
$l =~ s{-avoid-version\b}{}ms; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
85 |
} |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
86 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
87 |
push @inlines, $l; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
88 |
} |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
89 |
close($OLD) or die; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
90 |
|
241
30e6f29a3171
6624562 Xvnc should be built with Sun Studio
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
235
diff
changeset
|
91 |
my $picflags = "-K$pic_size -DPIC"; |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
92 |
my $sharedobjflags = '-G'; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
93 |
|
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
94 |
if (defined($compiler) && ($compiler =~ m/gcc/)) { |
241
30e6f29a3171
6624562 Xvnc should be built with Sun Studio
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
235
diff
changeset
|
95 |
$picflags = "-f$pic_size -DPIC"; |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
96 |
$sharedobjflags = '-shared'; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
97 |
} |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
98 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
99 |
my $curtarget = ""; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
100 |
|
191
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
101 |
my $l = ""; |
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
102 |
|
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
103 |
foreach my $curline (@inlines) { |
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
104 |
$l .= $curline; |
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
105 |
next if ($curline =~ m/\\$/); |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
106 |
chomp $l; |
191
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
107 |
|
100
8b89bd2a5118
6489660 Fix linking of 64-bit x86 driver modules
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
98
diff
changeset
|
108 |
# Remove libtool script from compile steps & |
8b89bd2a5118
6489660 Fix linking of 64-bit x86 driver modules
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
98
diff
changeset
|
109 |
# add PIC flags that libtool normally provides |
191
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
110 |
$l =~ s{\$\(LIBTOOL\) |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
111 |
(?:[\\\s]+ \$\(LT_QUIET\))? |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
112 |
(?:[\\\s]+ --tag=(?:CC|CXX))? |
191
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
113 |
(?:[\\\s]+ \$\(AM_LIBTOOLFLAGS\) [\\\s]+ \$\(LIBTOOLFLAGS\))? |
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
114 |
[\\\s]+ --mode=compile |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
115 |
[\\\s]+ (\$\(CC\)|\$\(CCAS\)|\$\(CXX\)) |
191
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
116 |
}{$1 $picflags}xs; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
117 |
|
100
8b89bd2a5118
6489660 Fix linking of 64-bit x86 driver modules
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
98
diff
changeset
|
118 |
# Remove libtool script from link step |
191
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
119 |
$l =~ s{\$\(LIBTOOL\) |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
120 |
(?:[\\\s]+ \$\(LT_QUIET\))? |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
121 |
(?:[\\\s]+ --tag=(?:CC|CXX))? |
191
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
122 |
(?:[\\\s]+ \$\(AM_LIBTOOLFLAGS\) [\\\s]+ \$\(LIBTOOLFLAGS\))? |
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
123 |
[\\\s]+ --mode=link |
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
124 |
}{}xs; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
125 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
126 |
# Change -rpath to -R in link arguments |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
127 |
$l =~ s{(\s*)-rpath(\s*)}{$1-R$2}msg; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
128 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
129 |
# Change flags for building shared object from arguments to libtool |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
130 |
# script into arguments to linker |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
131 |
if ($l =~ m/_la_LDFLAGS\s*=/) { |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
132 |
$l =~ s{(\s*$sharedobjflags)+\b}{}msg; |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
133 |
$l =~ s{(_la_LDFLAGS\s*=\s*)}{$1 $sharedobjflags }ms; |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
134 |
$l =~ s{\s+-module\b}{}ms; |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
135 |
$l =~ s{\s+-version-number\s+\d+[:\d]+}{}ms; |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
136 |
$l =~ s{\s+-no-undefined\b}{ -z defs}ms; |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
137 |
} |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
138 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
139 |
# Change file names |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
140 |
foreach my $so (keys %so_versions) { |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
141 |
if ($so_versions{$so} eq 'none') { |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
142 |
$l =~ s{$so\.la\b}{$so.so}msg; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
143 |
} else { |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
144 |
$l =~ s{$so\.la\b}{$so.so.$so_versions{$so}}msg; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
145 |
} |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
146 |
} |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
147 |
$l =~ s{\.la\b}{.a}msg; |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
148 |
$l =~ s{\.libs/\*\.o\b}{*.lo}msg; |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
149 |
$l =~ s{\.lo\b}{.o}msg; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
150 |
|
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
151 |
if ($l =~ m/^(\S+):/) { |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
152 |
$curtarget = $1; |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
153 |
} elsif ($l =~ m/^\s*$/) { |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
154 |
$curtarget = ""; |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
155 |
} |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
156 |
|
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
157 |
# Static libraries |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
158 |
if ($curtarget =~ m/^.*\.a$/) { |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
159 |
$l =~ s{\$\(\w*LINK\)}{\$(AR) cru $curtarget}ms; |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
160 |
$l =~ s{\$\(\w*(?:LIBS|LIBADD)\)}{}msg; |
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
161 |
$l =~ s{(\$\((?:\w*_)?AR\).*\s+)-R\s*\$\(libdir\)}{$1}msg; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
162 |
} |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
163 |
|
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
164 |
print $NEW $l, "\n"; |
191
8c3443e72486
6583543 Can't build X with JDS CBE 1.6
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
100
diff
changeset
|
165 |
$l = ""; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
166 |
} |
235
06772554f851
6572087 ship Xvnc for Solaris [PSARC/2007/545]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
191
diff
changeset
|
167 |
close($NEW) or die; |
98
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
168 |
} |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
169 |
} |
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
170 |
|
c21b46ed1efd
6489660 Xorg server 7.2 [PSARC 2007/051]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
171 |
find(\&process_file, @ARGV); |