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'
8 # usage: shobj-conf [-C compiler] -c host_cpu -o host_os -v host_vendor
13 # Copyright (C) 1996-2009 Free Software Foundation, Inc.
15 # This file is part of GNU Bash, the Bourne Again SHell.
17 # This program is free software: you can redistribute it and/or modify
18 # it under the terms of the GNU General Public License as published by
19 # the Free Software Foundation, either version 3 of the License, or
20 # (at your option) any later version.
22 # This program 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 General Public License for more details.
27 # You should have received a copy of the GNU General Public License
28 # along with this program. If not, see <http://www.gnu.org/licenses/>.
34 SHOBJ_STATUS
=supported
35 SHLIB_STATUS
=supported
51 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF)'
52 SHLIB_DLLVERSION
='$(SHLIB_MAJOR)'
54 PROGNAME
=`basename $0`
55 USAGE
="$PROGNAME [-C compiler] -c host_cpu -o host_os -v host_vendor"
57 while [ $# -gt 0 ]; do
59 -C) shift; SHOBJ_CC
="$1"; shift ;;
60 -c) shift; host_cpu
="$1"; shift ;;
61 -o) shift; host_os
="$1"; shift ;;
62 -v) shift; host_vendor
="$1"; shift ;;
63 *) echo "$USAGE" >&2 ; exit 2;;
67 case "${host_os}-${SHOBJ_CC}-${host_vendor}" in
71 SHOBJ_LDFLAGS
='-assert pure-text'
73 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
79 SHOBJ_LDFLAGS
='-assert pure-text'
81 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
84 sunos5
*-*gcc
*|solaris2
*-*gcc
*)
86 ld_used
=`gcc -print-prog-name=ld`
87 if ${ld_used} -V 2>&1 |
grep GNU
>/dev
/null
2>&1; then
88 # This line works for the GNU ld
89 SHOBJ_LDFLAGS
='-shared -Wl,-h,$@'
90 # http://sourceware.org/ml/binutils/2001-08/msg00361.html
93 # This line works for the Solaris linker in /usr/ccs/bin/ld
94 SHOBJ_LDFLAGS
='-shared -Wl,-i -Wl,-h,$@'
98 # SHLIB_XLDFLAGS='-R $(libdir)'
99 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
103 SHOBJ_CFLAGS
='-K pic'
104 SHOBJ_LD
=/usr
/ccs
/bin
/ld
105 SHOBJ_LDFLAGS
='-G -dy -z text -i -h $@'
107 # SHLIB_XLDFLAGS='-R $(libdir)'
108 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
111 # All versions of Linux (including Gentoo/FreeBSD) or the semi-mythical GNU Hurd.
112 linux
*-*|gnu
*-*|k
*bsd
*-gnu-*|freebsd
*-gentoo)
115 SHOBJ_LDFLAGS
='-shared -Wl,-soname,$@'
117 SHLIB_XLDFLAGS
='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
118 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
124 SHOBJ_LDFLAGS
='-x -Bshareable'
126 SHLIB_XLDFLAGS
='-R$(libdir)'
127 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
131 freebsd3
*|freebsdaout
*)
135 if [ -x /usr
/bin
/objformat
] && [ "`/usr/bin/objformat`" = "elf" ]; then
136 SHOBJ_LDFLAGS
='-shared -Wl,-soname,$@'
138 SHLIB_XLDFLAGS
='-Wl,-rpath,$(libdir)'
139 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
141 SHOBJ_LDFLAGS
='-shared'
143 SHLIB_XLDFLAGS
='-R$(libdir)'
144 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
148 # FreeBSD-4.x and later have only ELF
149 freebsd
[4-9]*|freebsdelf
*|dragonfly
*)
153 SHOBJ_LDFLAGS
='-shared -Wl,-soname,$@'
154 SHLIB_XLDFLAGS
='-Wl,-rpath,$(libdir)'
156 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
160 darwin
[89]*|darwin10
*)
161 SHOBJ_STATUS
=supported
162 SHLIB_STATUS
=supported
164 SHOBJ_CFLAGS
='-fno-common'
166 SHOBJ_LD
='MACOSX_DEPLOYMENT_TARGET=10.3 ${CC}'
168 SHLIB_LIBVERSION
='$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)'
169 SHLIB_LIBSUFF
='dylib'
171 SHOBJ_LDFLAGS
='-dynamiclib -dynamic -undefined dynamic_lookup -arch_only `/usr/bin/arch`'
172 SHLIB_XLDFLAGS
='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
174 SHLIB_LIBS
='-lncurses' # see if -lcurses works on MacOS X 10.1
178 SHOBJ_STATUS
=unsupported
179 SHLIB_STATUS
=supported
181 SHOBJ_CFLAGS
='-fno-common'
185 SHLIB_LIBVERSION
='$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)'
186 SHLIB_LIBSUFF
='dylib'
189 darwin
[789]*|darwin10
*) SHOBJ_LDFLAGS
=''
190 SHLIB_XLDFLAGS
='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
192 *) SHOBJ_LDFLAGS
='-dynamic'
193 SHLIB_XLDFLAGS
='-arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
197 SHLIB_LIBS
='-lncurses' # see if -lcurses works on MacOS X 10.1
203 SHOBJ_LDFLAGS
='-shared'
205 SHLIB_XLDFLAGS
='-R$(libdir)'
206 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
214 SHOBJ_LIBS
=-lc_s.2.1.0
216 # BSD/OS 2.x and 3.x `shared libraries' are too much of a pain in
217 # the ass -- they require changing {/usr/lib,etc}/shlib.map on
218 # each system, and the library creation process is byzantine
219 SHLIB_STATUS
=unsupported
227 SHOBJ_LIBS
=-lc_s.3.0.0
229 # BSD/OS 2.x and 3.x `shared libraries' are too much of a pain in
230 # the ass -- they require changing {/usr/lib,etc}/shlib.map on
231 # each system, and the library creation process is byzantine
232 SHLIB_STATUS
=unsupported
236 # BSD/OS 4.x now supports ELF and SunOS-style dynamically-linked
237 # shared libraries. gcc 2.x is the standard compiler, and the
238 # `normal' gcc options should work as they do in Linux.
242 SHOBJ_LDFLAGS
='-shared -Wl,-soname,$@'
244 SHLIB_XLDFLAGS
='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
245 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
249 # Fix to use gcc linker driver from bfischer@TechFak.Uni-Bielefeld.DE
251 SHOBJ_LDFLAGS
='-shared -Wl,-soname,$@'
253 SHLIB_XLDFLAGS
='-rpath $(libdir)'
254 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
259 SHOBJ_LDFLAGS
='-shared -soname $@ -expect_unresolved "*"'
261 SHLIB_XLDFLAGS
='-rpath $(libdir)'
262 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
265 aix4.
[2-9]*-*gcc
*|aix
[5-9].
*-*gcc
*) # lightly tested by jik@cisco.com
268 SHOBJ_LDFLAGS
='-bdynamic -bnoentry -bexpall'
271 SHLIB_XLDFLAGS
='-bM:SRE'
272 SHLIB_LIBS
='-lcurses -lc'
273 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
276 aix4.
[2-9]*|aix
[5-9].
*)
279 SHOBJ_LDFLAGS
='-bdynamic -bnoentry -bexpall'
282 SHLIB_XLDFLAGS
='-bM:SRE'
283 SHLIB_LIBS
='-lcurses -lc'
284 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
288 # THE FOLLOWING ARE UNTESTED -- and some may not support the dlopen interface
293 SHOBJ_LDFLAGS
='-shared -Wl,-soname,$@'
295 SHLIB_XLDFLAGS
='-Wl,-rpath,$(libdir)'
296 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
300 SHOBJ_CFLAGS
='-K PIC'
302 # SHOBJ_LDFLAGS='-call_shared -hidden_symbol -no_unresolved -soname $@'
303 # Change from David Kaelbling <drk@sgi.com>. If you have problems,
304 # remove the `-no_unresolved'
305 SHOBJ_LDFLAGS
='-shared -no_unresolved -soname $@'
307 SHLIB_XLDFLAGS
='-rpath $(libdir)'
308 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
312 # must use gcc; the bundled cc cannot compile PIC code
315 SHOBJ_LDFLAGS
='-shared -Wl,-b -Wl,+s'
317 SHLIB_XLDFLAGS
='-Wl,+b,$(libdir)'
319 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
323 SHOBJ_STATUS
=unsupported
324 SHLIB_STATUS
=unsupported
326 # If you are using the HP ANSI C compiler, you can uncomment and use
327 # this code (I have not tested it)
328 # SHOBJ_STATUS=supported
329 # SHLIB_STATUS=supported
333 # SHOBJ_LDFLAGS='-b +s'
335 # SHLIB_XLDFLAGS='+b $(libdir)'
337 # SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
342 # must use gcc; the bundled cc cannot compile PIC code
345 # if you have problems linking here, moving the `-Wl,+h,$@' from
346 # SHLIB_XLDFLAGS to SHOBJ_LDFLAGS has been reported to work
347 SHOBJ_LDFLAGS
='-shared -fpic -Wl,-b -Wl,+s'
349 SHLIB_XLDFLAGS
='-Wl,+h,$@ -Wl,+b,$(libdir)'
351 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
355 SHOBJ_STATUS
=unsupported
356 SHLIB_STATUS
=unsupported
358 # If you are using the HP ANSI C compiler, you can uncomment and use
359 # this code (I have not tested it)
360 # SHOBJ_STATUS=supported
361 # SHLIB_STATUS=supported
365 # SHOBJ_LDFLAGS='-b +s +h $@'
367 # SHLIB_XLDFLAGS='+b $(libdir)'
369 # SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
374 # must use gcc; the bundled cc cannot compile PIC code
377 # SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,-B,symbolic -Wl,+s -Wl,+std -Wl,+h,$@'
378 SHOBJ_LDFLAGS
='-shared -fpic -Wl,-b -Wl,+s -Wl,+h,$@'
380 SHLIB_XLDFLAGS
='-Wl,+b,$(libdir)'
382 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
386 SHOBJ_STATUS
=unsupported
387 SHLIB_STATUS
=unsupported
389 # If you are using the HP ANSI C compiler, you can uncomment and use
390 # this code (I have not tested it)
391 # SHOBJ_STATUS=supported
392 # SHLIB_STATUS=supported
396 # SHOBJ_LDFLAGS='-b +s +h $@'
398 # SHLIB_XLDFLAGS='+b $(libdir)'
400 # SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
406 SHOBJ_LDFLAGS
='-shared -h $@'
409 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
413 SHOBJ_CFLAGS
='-K PIC'
415 SHOBJ_LDFLAGS
='-dy -z text -G -h $@'
417 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
421 SHOBJ_CFLAGS
='-fpic' # DEFAULTS TO ELF
423 SHOBJ_LDFLAGS
='-shared'
425 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
429 SHOBJ_CFLAGS
='-K pic -b elf'
431 SHOBJ_LDFLAGS
='-G -b elf -dy -z text -h $@'
433 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
439 SHOBJ_LDFLAGS
='-shared'
441 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
445 SHOBJ_CFLAGS
='-K PIC'
447 SHOBJ_LDFLAGS
='-G -dy -z text -h $@'
449 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
452 sysv5UnixWare
*-*gcc
*)
455 SHOBJ_LDFLAGS
='-shared'
457 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
461 SHOBJ_CFLAGS
='-K PIC'
463 SHOBJ_LDFLAGS
='-G -dy -z text -h $@'
465 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
468 sysv5OpenUNIX
*-*gcc
*)
471 SHOBJ_LDFLAGS
='-shared'
473 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
477 SHOBJ_CFLAGS
='-K PIC'
479 SHOBJ_LDFLAGS
='-G -dy -z text -h $@'
481 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
487 SHOBJ_LDFLAGS
='-shared'
489 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
493 SHOBJ_CFLAGS
='-K pic'
495 SHOBJ_LDFLAGS
='-G -dy -h $@'
497 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
501 SHOBJ_STATUS
=unsupported
502 SHLIB_STATUS
=unsupported
507 SHOBJ_LDFLAGS
='-shared -Wl,--enable-auto-import -Wl,--enable-auto-image-base -Wl,--export-all -Wl,--out-implib=$(@).a'
510 SHLIB_LIBVERSION
='$(SHLIB_DLLVERSION).$(SHLIB_LIBSUFF)'
511 SHLIB_LIBS
='$(TERMCAP_LIB)'
514 # For official cygwin releases, DLLVERSION will be defined in the
515 # environment of configure, and will be incremented any time the API
516 # changes in a non-backwards compatible manner. Otherwise, it is just
518 if [ -n "$DLLVERSION" ] ; then
519 SHLIB_DLLVERSION
="$DLLVERSION"
525 SHOBJ_LDFLAGS
='-shared -Wl,--enable-auto-import -Wl,--enable-auto-image-base -Wl,--export-all -Wl,--out-implib=$(@).a'
527 SHLIB_LIBVERSION
='$(SHLIB_DLLVERSION).$(SHLIB_LIBSUFF)'
528 SHLIB_LIBS
='$(TERMCAP_LIB)'
531 # For official cygwin releases, DLLVERSION will be defined in the
532 # environment of configure, and will be incremented any time the API
533 # changes in a non-backwards compatible manner. Otherwise, it is just
535 if [ -n "$DLLVERSION" ] ; then
536 SHLIB_DLLVERSION
="$DLLVERSION"
541 # Rely on correct gcc configuration for everything else
546 SHOBJ_LDFLAGS
='-shared'
548 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
552 SHOBJ_STATUS
=unsupported
553 SHLIB_STATUS
=unsupported
558 echo SHOBJ_CC
=\'"$SHOBJ_CC"\'
559 echo SHOBJ_CFLAGS
=\'"$SHOBJ_CFLAGS"\'
560 echo SHOBJ_LD
=\'"$SHOBJ_LD"\'
561 echo SHOBJ_LDFLAGS
=\'"$SHOBJ_LDFLAGS"\'
562 echo SHOBJ_XLDFLAGS
=\'"$SHOBJ_XLDFLAGS"\'
563 echo SHOBJ_LIBS
=\'"$SHOBJ_LIBS"\'
565 echo SHLIB_XLDFLAGS
=\'"$SHLIB_XLDFLAGS"\'
566 echo SHLIB_LIBS
=\'"$SHLIB_LIBS"\'
568 echo SHLIB_DOT
=\'"$SHLIB_DOT"\'
570 echo SHLIB_LIBPREF
=\'"$SHLIB_LIBPREF"\'
571 echo SHLIB_LIBSUFF
=\'"$SHLIB_LIBSUFF"\'
573 echo SHLIB_LIBVERSION
=\'"$SHLIB_LIBVERSION"\'
574 echo SHLIB_DLLVERSION
=\'"$SHLIB_DLLVERSION"\'
576 echo SHOBJ_STATUS
=\'"$SHOBJ_STATUS"\'
577 echo SHLIB_STATUS
=\'"$SHLIB_STATUS"\'
This page took 0.045318 seconds and 4 git commands to generate.