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-2002 Free Software Foundation, Inc.
15 # This program is free software; you can redistribute it and/or modify
16 # it under the terms of the GNU General Public License as published by
17 # the Free Software Foundation; either version 2, or (at your option)
20 # This program is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
32 SHOBJ_STATUS
=supported
33 SHLIB_STATUS
=supported
49 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF)'
50 SHLIB_DLLVERSION
='$(SHLIB_MAJOR)'
52 PROGNAME
=`basename $0`
53 USAGE
="$PROGNAME [-C compiler] -c host_cpu -o host_os -v host_vendor"
55 while [ $# -gt 0 ]; do
57 -C) shift; SHOBJ_CC
="$1"; shift ;;
58 -c) shift; host_cpu
="$1"; shift ;;
59 -o) shift; host_os
="$1"; shift ;;
60 -v) shift; host_vendor
="$1"; shift ;;
61 *) echo "$USAGE" >&2 ; exit 2;;
65 case "${host_os}-${SHOBJ_CC}" in
69 SHOBJ_LDFLAGS
='-assert pure-text'
71 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
77 SHOBJ_LDFLAGS
='-assert pure-text'
79 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
82 sunos5
*-*gcc
*|solaris2
*-*gcc
*)
85 ld_used
=`gcc -print-prog-name=ld`
86 if ${ld_used} -V 2>&1 |
grep GNU
>/dev
/null
2>&1; then
87 # This line works for the GNU ld
88 SHOBJ_LDFLAGS
='-shared -Wl,-h,$@'
90 # This line works for the Solaris linker in /usr/ccs/bin/ld
91 SHOBJ_LDFLAGS
='-shared -Wl,-i -Wl,-h,$@'
94 # SHLIB_XLDFLAGS='-R $(libdir)'
95 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
100 SHOBJ_LD
=/usr
/ccs
/bin
/ld
101 SHOBJ_LDFLAGS
='-G -dy -z text -i -h $@'
103 # SHLIB_XLDFLAGS='-R $(libdir)'
104 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
107 # All versions of Linux or the semi-mythical GNU Hurd.
108 linux
*-*|gnu
*-*|k
*bsd
*-gnu-*)
111 SHOBJ_LDFLAGS
='-shared -Wl,-soname,$@'
113 SHLIB_XLDFLAGS
='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
114 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
120 SHOBJ_LDFLAGS
='-x -Bshareable'
122 SHLIB_XLDFLAGS
='-R$(libdir)'
123 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
127 freebsd
[3-9]*|freebsdelf
[3-9]*|freebsdaout
[3-9]*|dragonfly
*)
131 if [ -x /usr
/bin
/objformat
] && [ "`/usr/bin/objformat`" = "elf" ]; then
132 SHOBJ_LDFLAGS
='-shared -Wl,-soname,$@'
134 SHLIB_XLDFLAGS
='-Wl,-rpath,$(libdir)'
135 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
137 SHOBJ_LDFLAGS
='-shared'
139 SHLIB_XLDFLAGS
='-R$(libdir)'
140 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
146 SHOBJ_STATUS
=unsupported
147 SHLIB_STATUS
=supported
149 SHOBJ_CFLAGS
='-fno-common'
153 SHLIB_LIBVERSION
='$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)'
154 SHLIB_LIBSUFF
='dylib'
157 darwin
[78]*) SHOBJ_LDFLAGS
=''
158 SHLIB_XLDFLAGS
='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
160 *) SHOBJ_LDFLAGS
='-dynamic'
161 SHLIB_XLDFLAGS
='-arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
165 SHLIB_LIBS
='-lncurses' # see if -lcurses works on MacOS X 10.1
171 SHOBJ_LDFLAGS
='-shared'
173 SHLIB_XLDFLAGS
='-R$(libdir)'
174 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
182 SHOBJ_LIBS
=-lc_s.2.1.0
184 # BSD/OS 2.x and 3.x `shared libraries' are too much of a pain in
185 # the ass -- they require changing {/usr/lib,etc}/shlib.map on
186 # each system, and the library creation process is byzantine
187 SHLIB_STATUS
=unsupported
195 SHOBJ_LIBS
=-lc_s.3.0.0
197 # BSD/OS 2.x and 3.x `shared libraries' are too much of a pain in
198 # the ass -- they require changing {/usr/lib,etc}/shlib.map on
199 # each system, and the library creation process is byzantine
200 SHLIB_STATUS
=unsupported
204 # BSD/OS 4.x now supports ELF and SunOS-style dynamically-linked
205 # shared libraries. gcc 2.x is the standard compiler, and the
206 # `normal' gcc options should work as they do in Linux.
210 SHOBJ_LDFLAGS
='-shared -Wl,-soname,$@'
212 SHLIB_XLDFLAGS
='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
213 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
217 # Fix to use gcc linker driver from bfischer@TechFak.Uni-Bielefeld.DE
219 SHOBJ_LDFLAGS
='-shared -Wl,-soname,$@'
221 SHLIB_XLDFLAGS
='-rpath $(libdir)'
222 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
227 SHOBJ_LDFLAGS
='-shared -soname $@ -expect_unresolved "*"'
229 SHLIB_XLDFLAGS
='-rpath $(libdir)'
230 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
233 aix4.
[2-9]*-*gcc
*) # lightly tested by jik@cisco.com
236 SHOBJ_LDFLAGS
='-bdynamic -bnoentry -bexpall'
239 SHLIB_XLDFLAGS
='-bM:SRE'
240 SHLIB_LIBS
='-lcurses -lc'
241 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
247 SHOBJ_LDFLAGS
='-bdynamic -bnoentry -bexpall'
250 SHLIB_XLDFLAGS
='-bM:SRE'
251 SHLIB_LIBS
='-lcurses -lc'
252 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
256 # THE FOLLOWING ARE UNTESTED -- and some may not support the dlopen interface
261 SHOBJ_LDFLAGS
='-shared -Wl,-soname,$@'
263 SHLIB_XLDFLAGS
='-Wl,-rpath,$(libdir)'
264 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
268 SHOBJ_CFLAGS
='-K PIC'
270 # SHOBJ_LDFLAGS='-call_shared -hidden_symbol -no_unresolved -soname $@'
271 # Change from David Kaelbling <drk@sgi.com>. If you have problems,
272 # remove the `-no_unresolved'
273 SHOBJ_LDFLAGS
='-shared -no_unresolved -soname $@'
275 SHLIB_XLDFLAGS
='-rpath $(libdir)'
276 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
280 # must use gcc; the bundled cc cannot compile PIC code
283 SHOBJ_LDFLAGS
='-shared -Wl,-b -Wl,+s'
285 SHLIB_XLDFLAGS
='-Wl,+b,$(libdir)'
287 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
291 SHOBJ_STATUS
=unsupported
292 SHLIB_STATUS
=unsupported
294 # If you are using the HP ANSI C compiler, you can uncomment and use
295 # this code (I have not tested it)
296 # SHOBJ_STATUS=supported
297 # SHLIB_STATUS=supported
301 # SHOBJ_LDFLAGS='-b +s'
303 # SHLIB_XLDFLAGS='+b $(libdir)'
305 # SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
310 # must use gcc; the bundled cc cannot compile PIC code
313 # if you have problems linking here, moving the `-Wl,+h,$@' from
314 # SHLIB_XLDFLAGS to SHOBJ_LDFLAGS has been reported to work
315 SHOBJ_LDFLAGS
='-shared -Wl,-b -Wl,+s'
317 SHLIB_XLDFLAGS
='-Wl,+h,$@ -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 +h $@'
335 # SHLIB_XLDFLAGS='+b $(libdir)'
337 # SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
342 # must use gcc; the bundled cc cannot compile PIC code
345 # SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,-B,symbolic -Wl,+s -Wl,+std -Wl,+h,$@'
346 SHOBJ_LDFLAGS
='-shared -fpic -Wl,-b -Wl,+s -Wl,+h,$@'
348 SHLIB_XLDFLAGS
='-Wl,+b,$(libdir)'
350 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
354 SHOBJ_STATUS
=unsupported
355 SHLIB_STATUS
=unsupported
357 # If you are using the HP ANSI C compiler, you can uncomment and use
358 # this code (I have not tested it)
359 # SHOBJ_STATUS=supported
360 # SHLIB_STATUS=supported
364 # SHOBJ_LDFLAGS='-b +s +h $@'
366 # SHLIB_XLDFLAGS='+b $(libdir)'
368 # SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
374 SHOBJ_LDFLAGS
='-shared -h $@'
377 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
381 SHOBJ_CFLAGS
='-K PIC'
383 SHOBJ_LDFLAGS
='-dy -z text -G -h $@'
385 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
389 SHOBJ_CFLAGS
='-fpic' # DEFAULTS TO ELF
391 SHOBJ_LDFLAGS
='-shared'
393 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
397 SHOBJ_CFLAGS
='-K pic -b elf'
399 SHOBJ_LDFLAGS
='-G -b elf -dy -z text -h $@'
401 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
407 SHOBJ_LDFLAGS
='-shared'
409 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
413 SHOBJ_CFLAGS
='-K PIC'
415 SHOBJ_LDFLAGS
='-G -dy -z text -h $@'
417 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
420 sysv5UnixWare
*-*gcc
*)
423 SHOBJ_LDFLAGS
='-shared'
425 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
429 SHOBJ_CFLAGS
='-K PIC'
431 SHOBJ_LDFLAGS
='-G -dy -z text -h $@'
433 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
436 sysv5OpenUNIX
*-*gcc
*)
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)'
455 SHOBJ_LDFLAGS
='-shared'
457 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
461 SHOBJ_CFLAGS
='-K pic'
463 SHOBJ_LDFLAGS
='-G -dy -h $@'
465 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
469 SHOBJ_STATUS
=unsupported
470 SHLIB_STATUS
=unsupported
475 SHOBJ_LDFLAGS
='-shared -Wl,--enable-auto-import -Wl,--enable-auto-image-base -Wl,--export-all -Wl,--out-implib=$(@).a'
478 SHLIB_LIBVERSION
='$(SHLIB_DLLVERSION).$(SHLIB_LIBSUFF)'
479 SHLIB_LIBS
='$(TERMCAP_LIB)'
482 # For official cygwin releases, DLLVERSION will be defined in the
483 # environment of configure, and will be incremented any time the API
484 # changes in a non-backwards compatible manner. Otherwise, it is just
486 if [ -n "$DLLVERSION" ] ; then
487 SHLIB_DLLVERSION
="$DLLVERSION"
492 # Rely on correct gcc configuration for everything else
497 SHOBJ_LDFLAGS
='-shared'
499 SHLIB_LIBVERSION
='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
503 SHOBJ_STATUS
=unsupported
504 SHLIB_STATUS
=unsupported
509 echo SHOBJ_CC
=\'"$SHOBJ_CC"\'
510 echo SHOBJ_CFLAGS
=\'"$SHOBJ_CFLAGS"\'
511 echo SHOBJ_LD
=\'"$SHOBJ_LD"\'
512 echo SHOBJ_LDFLAGS
=\'"$SHOBJ_LDFLAGS"\'
513 echo SHOBJ_XLDFLAGS
=\'"$SHOBJ_XLDFLAGS"\'
514 echo SHOBJ_LIBS
=\'"$SHOBJ_LIBS"\'
516 echo SHLIB_XLDFLAGS
=\'"$SHLIB_XLDFLAGS"\'
517 echo SHLIB_LIBS
=\'"$SHLIB_LIBS"\'
519 echo SHLIB_DOT
=\'"$SHLIB_DOT"\'
521 echo SHLIB_LIBPREF
=\'"$SHLIB_LIBPREF"\'
522 echo SHLIB_LIBSUFF
=\'"$SHLIB_LIBSUFF"\'
524 echo SHLIB_LIBVERSION
=\'"$SHLIB_LIBVERSION"\'
525 echo SHLIB_DLLVERSION
=\'"$SHLIB_DLLVERSION"\'
527 echo SHOBJ_STATUS
=\'"$SHOBJ_STATUS"\'
528 echo SHLIB_STATUS
=\'"$SHLIB_STATUS"\'
This page took 0.041489 seconds and 4 git commands to generate.