Commit | Line | Data |
---|---|---|
959f3c4c JH |
1 | ?RCS: $Id: archname.U,v 3.0.1.3 1997/02/28 15:24:32 ram Exp $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1993, Raphael Manfredi | |
4c42341b | 4 | ?RCS: |
65a32477 | 5 | ?RCS: You may redistribute only under the terms of the Artistic License, |
959f3c4c JH |
6 | ?RCS: as specified in the README file that comes with the distribution. |
7 | ?RCS: You may reuse parts of this distribution only within the terms of | |
65a32477 | 8 | ?RCS: that same Artistic License; a copy of which may be found at the root |
959f3c4c JH |
9 | ?RCS: of the source tree for dist 3.0. |
10 | ?RCS: | |
11 | ?RCS: $Log: archname.U,v $ | |
12 | ?RCS: Revision 3.0.1.3 1997/02/28 15:24:32 ram | |
13 | ?RCS: patch61: changed the way the archname is mangled from uname | |
14 | ?RCS: | |
15 | ?RCS: Revision 3.0.1.2 1995/05/12 12:05:24 ram | |
16 | ?RCS: patch54: protect against spaces in "uname -m" output (ADO) | |
17 | ?RCS: | |
18 | ?RCS: Revision 3.0.1.1 1995/02/15 14:14:21 ram | |
19 | ?RCS: patch51: created | |
20 | ?RCS: | |
a4afc800 MBT |
21 | ?MAKE:archname myarchname useversionedarchname: sed Loc Myread Oldconfig \ |
22 | osname test rm usethreads usemultiplicity use64bitint use64bitall \ | |
23 | archname64 uselongdouble longdblsize doublesize targetarch Setvar \ | |
24 | api_versionstring | |
959f3c4c JH |
25 | ?MAKE: -pick add $@ %< |
26 | ?S:archname: | |
27 | ?S: This variable is a short name to characterize the current | |
28 | ?S: architecture. It is used mainly to construct the default archlib. | |
29 | ?S:. | |
30 | ?S:myarchname: | |
31 | ?S: This variable holds the architecture name computed by Configure in | |
32 | ?S: a previous run. It is not intended to be perused by any user and | |
33 | ?S: should never be set in a hint file. | |
34 | ?S:. | |
a4afc800 MBT |
35 | ?S:useversionedarchname: |
36 | ?S: This variable indicates whether to include the $api_versionstring | |
37 | ?S: as a component of the $archname. | |
38 | ?S:. | |
959f3c4c JH |
39 | ?C:ARCHNAME: |
40 | ?C: This symbol holds a string representing the architecture name. | |
41 | ?C: It may be used to construct an architecture-dependant pathname | |
42 | ?C: where library files may be held under a private library, for | |
43 | ?C: instance. | |
44 | ?C:. | |
45 | ?H:#define ARCHNAME "$archname" /**/ | |
46 | ?H:. | |
47 | ?T:xxx tarch | |
1fbd636f | 48 | ?F:!archname.cbu |
662bdb9a | 49 | ?INIT:archname='' |
959f3c4c JH |
50 | : determine the architecture name |
51 | echo " " | |
52 | ?X: We always recompute archname in case osname changes. However, we need | |
53 | ?X: to be careful since, as ADO rightfully pointed out, some systems pick | |
54 | ?X: silly architecture names (0001307135000-aix on AIX or 9000/715-ux under | |
55 | ?X: HP-UX). Therefore, we allow hint files to superseed our guess and ask | |
56 | ?X: the user for confirmation. | |
57 | if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then | |
58 | tarch=`arch`"-$osname" | |
59 | elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then | |
60 | if uname -m > tmparch 2>&1 ; then | |
61 | tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ | |
62 | -e 's/$/'"-$osname/" tmparch` | |
63 | else | |
64 | tarch="$osname" | |
65 | fi | |
66 | $rm -f tmparch | |
67 | else | |
68 | tarch="$osname" | |
69 | fi | |
70 | case "$myarchname" in | |
71 | ''|"$tarch") ;; | |
72 | *) | |
73 | echo "(Your architecture name used to be $myarchname.)" | |
74 | archname='' | |
75 | ;; | |
76 | esac | |
0f00356b JH |
77 | case "$targetarch" in |
78 | '') ;; | |
79 | ?X: Very GCCian. | |
80 | *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;; | |
81 | esac | |
959f3c4c JH |
82 | myarchname="$tarch" |
83 | case "$archname" in | |
84 | '') dflt="$tarch";; | |
85 | *) dflt="$archname";; | |
86 | esac | |
87 | rp='What is your architecture name' | |
88 | . ./myread | |
89 | archname="$ans" | |
a4afc800 | 90 | |
ed5d019e | 91 | : optionally add API version to the architecture for versioned archlibs |
a4afc800 MBT |
92 | case "$useversionedarchname" in |
93 | $define|true|[yY]*) dflt='y';; | |
94 | *) dflt='n';; | |
95 | esac | |
96 | rp='Add the Perl API version to your archname?' | |
97 | . ./myread | |
98 | case "$ans" in | |
99 | y|Y) useversionedarchname="$define" ;; | |
100 | *) useversionedarchname="$undef" ;; | |
101 | esac | |
102 | case "$useversionedarchname" in | |
103 | $define) | |
104 | case "$archname" in | |
105 | *-$api_versionstring) | |
106 | echo "...and architecture name already has -$api_versionstring" >&4 | |
107 | ;; | |
108 | *) | |
109 | archname="$archname-$api_versionstring" | |
110 | echo "...setting architecture name to $archname." >&4 | |
111 | ;; | |
112 | esac | |
113 | ;; | |
114 | esac | |
115 | ||
959f3c4c JH |
116 | @if usethreads |
117 | case "$usethreads" in | |
118 | $define) | |
119 | echo "Threads selected." >&4 | |
120 | case "$archname" in | |
121 | *-thread*) echo "...and architecture name already has -thread." >&4 | |
122 | ;; | |
123 | *) archname="$archname-thread" | |
124 | echo "...setting architecture name to $archname." >&4 | |
125 | ;; | |
126 | esac | |
127 | ;; | |
128 | esac | |
129 | @end | |
130 | @if usemultiplicity | |
131 | case "$usemultiplicity" in | |
132 | $define) | |
133 | echo "Multiplicity selected." >&4 | |
134 | case "$archname" in | |
135 | *-multi*) echo "...and architecture name already has -multi." >&4 | |
136 | ;; | |
137 | *) archname="$archname-multi" | |
138 | echo "...setting architecture name to $archname." >&4 | |
139 | ;; | |
140 | esac | |
141 | ;; | |
142 | esac | |
143 | @end | |
33b2427b | 144 | @if use64bitint |
2df8a4b1 JH |
145 | case "$use64bitint$use64bitall" in |
146 | *"$define"*) | |
959f3c4c JH |
147 | case "$archname64" in |
148 | '') | |
6cadf241 | 149 | echo "This architecture is naturally 64-bit, not changing architecture name." >&4 |
959f3c4c JH |
150 | ;; |
151 | *) | |
2df8a4b1 JH |
152 | case "$use64bitint" in |
153 | "$define") echo "64 bit integers selected." >&4 ;; | |
154 | esac | |
155 | case "$use64bitall" in | |
e7d5292a | 156 | "$define") echo "Maximal 64 bitness selected." >&4 ;; |
2df8a4b1 | 157 | esac |
959f3c4c JH |
158 | case "$archname" in |
159 | *-$archname64*) echo "...and architecture name already has $archname64." >&4 | |
160 | ;; | |
161 | *) archname="$archname-$archname64" | |
162 | echo "...setting architecture name to $archname." >&4 | |
163 | ;; | |
164 | esac | |
165 | ;; | |
166 | esac | |
167 | esac | |
168 | @end | |
2df8a4b1 JH |
169 | @if uselongdouble |
170 | case "$uselongdouble" in | |
171 | $define) | |
172 | echo "Long doubles selected." >&4 | |
e7d5292a JH |
173 | case "$longdblsize" in |
174 | $doublesize) | |
346608fb | 175 | echo "...but long doubles are equal to doubles, not changing architecture name." >&4 |
e7d5292a JH |
176 | ;; |
177 | *) | |
178 | case "$archname" in | |
179 | *-ld*) echo "...and architecture name already has -ld." >&4 | |
180 | ;; | |
181 | *) archname="$archname-ld" | |
182 | echo "...setting architecture name to $archname." >&4 | |
183 | ;; | |
184 | esac | |
185 | ;; | |
186 | esac | |
2df8a4b1 JH |
187 | ;; |
188 | esac | |
189 | @end | |
1fbd636f JH |
190 | if $test -f archname.cbu; then |
191 | echo "Your platform has some specific hints for architecture name, using them..." | |
192 | . ./archname.cbu | |
193 | fi | |
959f3c4c | 194 |