OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [oc/] [gdb-5.0/] [readline/] [support/] [shobj-conf] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 106 markom
#! /bin/sh
2
#
3
# shobj-conf -- output a series of variable assignments to be substituted
4
#               into a Makefile by configure which specify system-dependent
5
#               information for creating shared objects that may be loaded
6
#               into bash with `enable -f'
7
#
8
# usage: shobj-conf [-C compiler] -c host_cpu -o host_os -v host_vendor
9
#
10
# Chet Ramey
11
# chet@po.cwru.edu
12
 
13
#
14
# defaults
15
#
16
SHOBJ_STATUS=supported
17
SHLIB_STATUS=supported
18
 
19
SHOBJ_CC=cc
20
SHOBJ_CFLAGS=
21
SHOBJ_LD=
22
SHOBJ_LDFLAGS=
23
SHOBJ_XLDFLAGS=
24
SHOBJ_LIBS=
25
 
26
SHLIB_XLDFLAGS=
27
SHLIB_LIBS=
28
SHLIB_LIBSUFF='so'
29
 
30
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF)'
31
 
32
PROGNAME=`basename $0`
33
USAGE="$PROGNAME [-C compiler] -c host_cpu -o host_os -v host_vendor"
34
 
35
while [ $# -gt 0 ]; do
36
        case "$1" in
37
        -C)     shift; SHOBJ_CC="$1"; shift ;;
38
        -c)     shift; host_cpu="$1"; shift ;;
39
        -o)     shift; host_os="$1"; shift ;;
40
        -v)     shift; host_vendor="$1"; shift ;;
41
        *)      echo "$USAGE" >&2 ; exit 2;;
42
        esac
43
done
44
 
45
case "${host_os}-${SHOBJ_CC}" in
46
sunos4*-gcc*)
47
        SHOBJ_CFLAGS=-fpic
48
        SHOBJ_LD=/usr/bin/ld
49
        SHOBJ_LDFLAGS='-assert pure-text'
50
 
51
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
52
        ;;
53
 
54
sunos4*)
55
        SHOBJ_CFLAGS=-pic
56
        SHOBJ_LD=/usr/bin/ld
57
        SHOBJ_LDFLAGS='-assert pure-text'
58
 
59
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
60
        ;;
61
 
62
sunos5*-gcc*|solaris2*-gcc*)
63
        SHOBJ_CFLAGS=-fpic
64
        SHOBJ_LD='${CC}'
65
        SHOBJ_LDFLAGS='-shared -Wl,-i'
66
 
67
        SHLIB_XLDFLAGS='-R $(libdir)'
68
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
69
        ;;
70
 
71
sunos5*|solaris2*)
72
        SHOBJ_CFLAGS='-K pic'
73
        SHOBJ_LD=/usr/ccs/bin/ld
74
        SHOBJ_LDFLAGS='-G -dy -z text -i -h $@'
75
 
76
        SHLIB_XLDFLAGS='-R $(libdir)'
77
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
78
        ;;
79
 
80
freebsd2* | netbsd* | openbsd*)
81
        SHOBJ_CFLAGS=-fpic
82
        SHOBJ_LD=ld
83
        SHOBJ_LDFLAGS='-x -Bshareable'
84
 
85
        SHLIB_XLDFLAGS='-R$(libdir)'
86
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
87
        ;;
88
 
89
freebsd3*)
90
        SHOBJ_CFLAGS=-fpic
91
        SHOBJ_LD='${CC}'
92
        SHOBJ_LDFLAGS='-shared'
93
 
94
        SHLIB_XLDFLAGS='-R$(libdir)'
95
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
96
        ;;
97
 
98
linux*)
99
        SHOBJ_CFLAGS=-fPIC
100
        SHOBJ_LD='${CC}'
101
        SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
102
 
103
        SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)'
104
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
105
        ;;
106
 
107
bsdi2*)
108
        SHOBJ_CC=shlicc2
109
        SHOBJ_CFLAGS=
110
        SHOBJ_LD=ld
111
        SHOBJ_LDFLAGS=-r
112
        SHOBJ_LIBS=-lc_s.2.1.0
113
 
114
        # BSD/OS 2.x and 3.x `shared libraries' are too much of a pain in
115
        # the ass -- they require changing {/usr/lib,etc}/shlib.map on
116
        # each system, and the library creation process is byzantine
117
        SHLIB_STATUS=unsupported
118
        ;;
119
 
120
bsdi3*)
121
        SHOBJ_CC=shlicc2
122
        SHOBJ_CFLAGS=
123
        SHOBJ_LD=ld
124
        SHOBJ_LDFLAGS=-r
125
        SHOBJ_LIBS=-lc_s.3.0.0
126
 
127
        # BSD/OS 2.x and 3.x `shared libraries' are too much of a pain in
128
        # the ass -- they require changing {/usr/lib,etc}/shlib.map on
129
        # each system, and the library creation process is byzantine
130
        SHLIB_STATUS=unsupported
131
        ;;
132
 
133
bsdi4*)
134
        # BSD/OS 4.x now supports ELF and SunOS-style dynamically-linked
135
        # shared libraries.  gcc 2.x is the standard compiler, and the
136
        # `normal' gcc options should work as they do in Linux.
137
 
138
        SHOBJ_CFLAGS=-fPIC
139
        SHOBJ_LD='${CC}'
140
        SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
141
 
142
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
143
        ;;
144
 
145
osf*)
146
        SHOBJ_LD=ld
147
        SHOBJ_LDFLAGS='-shared -soname $@ -expect_unresolved "*"'
148
 
149
        SHLIB_XLDFLAGS='-rpath $(libdir)'
150
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
151
        ;;
152
 
153
aix4.[2-9]*-gcc*)               # lightly tested by jik@cisco.com
154
        SHOBJ_CFLAGS=-fpic
155
        SHOBJ_LD='ld'
156
        SHOBJ_LDFLAGS='-bdynamic -bnoentry -bexpall'
157
        SHOBJ_XLDFLAGS='-G'
158
 
159
        SHLIB_XLDFLAGS='-bM:SRE'
160
        SHLIB_LIBS='-lcurses -lc'
161
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
162
        ;;
163
 
164
aix4.[2-9]*)
165
        SHOBJ_CFLAGS=-K
166
        SHOBJ_LD='ld'
167
        SHOBJ_LDFLAGS='-bdynamic -bnoentry -bexpall'
168
        SHOBJ_XLDFLAGS='-G'
169
 
170
        SHLIB_XLDFLAGS='-bM:SRE'
171
        SHLIB_LIBS='-lcurses -lc'
172
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
173
        ;;
174
 
175
#
176
# THE FOLLOWING ARE UNTESTED -- and some may not support the dlopen interface
177
#
178
irix[56]*-gcc*)
179
        SHOBJ_CFLAGS='-fpic'
180
        SHOBJ_LD='${CC}'
181
        SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
182
 
183
        SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)'
184
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
185
        ;;
186
 
187
irix[56]*)
188
        SHOBJ_CFLAGS='-K PIC'
189
        SHOBJ_LD=ld
190
        SHOBJ_LDFLAGS='-call_shared -hidden_symbol -no_unresolved -soname $@'
191
 
192
        SHLIB_XLDFLAGS='-rpath $(libdir)'
193
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
194
        ;;
195
 
196
hpux9*-gcc*)
197
        # must use gcc; the bundled cc cannot compile PIC code
198
        SHOBJ_CFLAGS='-fpic'
199
        SHOBJ_LD='${CC}'
200
        SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s'
201
 
202
        SHLIB_XLDFLAGS='-Wl,+b,$(libdir)'
203
        SHLIB_LIBSUFF='sl'
204
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
205
        ;;
206
 
207
hpux9*)
208
        SHOBJ_STATUS=unsupported
209
        SHLIB_STATUS=unsupported
210
        ;;
211
 
212
hpux10*-gcc*)
213
        # must use gcc; the bundled cc cannot compile PIC code
214
        SHOBJ_CFLAGS='-fpic'
215
        SHOBJ_LD='${CC}'
216
        SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s'
217
 
218
        SHLIB_XLDFLAGS='-Wl,+h,$@ -Wl,+b,$(libdir)'
219
        SHLIB_LIBSUFF='sl'
220
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
221
        ;;
222
 
223
hpux10*)
224
        SHOBJ_STATUS=unsupported
225
        SHLIB_STATUS=unsupported
226
        ;;
227
 
228
hpux11*-gcc*)
229
        # must use gcc; the bundled cc cannot compile PIC code
230
        SHOBJ_CFLAGS='-fpic'
231
        SHOBJ_LD='${CC}'
232
#       SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,-B,symbolic -Wl,+s -Wl,+std -Wl,+h,$@'
233
        SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s -Wl,+h,$@'
234
 
235
        SHLIB_XLDFLAGS='-Wl,+b,$(libdir)'
236
        SHLIB_LIBSUFF='sl'
237
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
238
        ;;
239
 
240
hpux11*)
241
        SHOBJ_STATUS=unsupported
242
        SHLIB_STATUS=unsupported
243
        ;;
244
 
245
sysv4*-gcc*)
246
        SHOBJ_CFLAGS=-shared
247
        SHOBJ_LDFLAGS='-shared -h $@'
248
        SHOBJ_LD='${CC}'
249
 
250
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
251
        ;;
252
 
253
sysv4*)
254
        SHOBJ_CFLAGS='-K PIC'
255
        SHOBJ_LD=ld
256
        SHOBJ_LDFLAGS='-dy -z text -G -h $@'
257
 
258
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
259
        ;;
260
 
261
sco3.2v5*-gcc*)
262
        SHOBJ_CFLAGS='-fpic'            # DEFAULTS TO ELF
263
        SHOBJ_LD='${CC}'
264
        SHOBJ_LDFLAGS='-shared'
265
 
266
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
267
        ;;
268
 
269
sco3.2v5*)
270
        SHOBJ_CFLAGS='-K pic -b elf'
271
        SHOBJ_LD=ld
272
        SHOBJ_LDFLAGS='-G -b elf -dy -z text -h $@'
273
 
274
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
275
        ;;
276
 
277
sysv5uw7*-gcc*)
278
        SHOBJ_CFLAGS='-fpic'
279
        SHOBJ_LD='${CC}'
280
        SHOBJ_LDFLAGS='-shared'
281
 
282
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
283
        ;;
284
 
285
sysv5uw7*)
286
        SHOBJ_CFLAGS='-K PIC'
287
        SHOBJ_LD=ld
288
        SHOBJ_LDFLAGS='-G -dy -z text -h $@'
289
 
290
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
291
        ;;
292
 
293
dgux*-gcc*)
294
        SHOBJ_CFLAGS=-fpic
295
        SHOBJ_LD='${CC}'
296
        SHOBJ_LDFLAGS='-shared'
297
 
298
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
299
        ;;
300
 
301
dgux*)
302
        SHOBJ_CFLAGS='-K pic'
303
        SHOBJ_LD=ld
304
        SHOBJ_LDFLAGS='-G -dy -h $@'
305
 
306
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
307
        ;;
308
 
309
msdosdjgpp*)
310
        SHOBJ_STATUS=unsupported
311
        SHLIB_STATUS=unsupported
312
        ;;
313
 
314
#
315
# Rely on correct gcc configuration for everything else
316
#
317
*-gcc*)
318
        SHOBJ_CFLAGS=-fpic
319
        SHOBJ_LD='${CC}'
320
        SHOBJ_LDFLAGS='-shared'
321
 
322
        SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
323
        ;;
324
 
325
*)
326
        SHOBJ_STATUS=unsupported
327
        SHLIB_STATUS=unsupported
328
        ;;
329
 
330
esac
331
 
332
echo SHOBJ_CC=\'"$SHOBJ_CC"\'
333
echo SHOBJ_CFLAGS=\'"$SHOBJ_CFLAGS"\'
334
echo SHOBJ_LD=\'"$SHOBJ_LD"\'
335
echo SHOBJ_LDFLAGS=\'"$SHOBJ_LDFLAGS"\'
336
echo SHOBJ_XLDFLAGS=\'"$SHOBJ_XLDFLAGS"\'
337
echo SHOBJ_LIBS=\'"$SHOBJ_LIBS"\'
338
 
339
echo SHLIB_XLDFLAGS=\'"$SHLIB_XLDFLAGS"\'
340
echo SHLIB_LIBS=\'"$SHLIB_LIBS"\'
341
echo SHLIB_LIBSUFF=\'"$SHLIB_LIBSUFF"\'
342
echo SHLIB_LIBVERSION=\'"$SHLIB_LIBVERSION"\'
343
 
344
echo SHOBJ_STATUS=\'"$SHOBJ_STATUS"\'
345
echo SHLIB_STATUS=\'"$SHLIB_STATUS"\'
346
 
347
exit 0

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.