ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/config.rpath
Revision: 1.3
Committed: Tue Apr 26 00:55:55 2005 UTC (19 years, 5 months ago) by pcg
Branch: MAIN
CVS Tags: rel-2_01, rel-3_0, rel-2_2, rel-2_0, rel-2_21, rel-2_22, rel-2_25, HEAD
Changes since 1.2: +3 -3 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 pcg 1.1 #! /bin/sh
2     # Output a system dependent set of variables, describing how to set the
3     # run time search path of shared libraries in an executable.
4     #
5     # Copyright 1996-2002 Free Software Foundation, Inc.
6     # Taken from GNU libtool, 2001
7     # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8     #
9 pcg 1.2 # This file is part of GVPE.
10 pcg 1.3 #
11     # GVPE is free software; you can redistribute it and/or modify
12 pcg 1.1 # it under the terms of the GNU General Public License as published by
13     # the Free Software Foundation; either version 2 of the License, or
14     # (at your option) any later version.
15     #
16     # This program is distributed in the hope that it will be useful, but
17     # WITHOUT ANY WARRANTY; without even the implied warranty of
18     # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19     # General Public License for more details.
20     #
21     # You should have received a copy of the GNU General Public License
22 pcg 1.2 # along with gvpe; if not, write to the Free Software
23 pcg 1.3 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02110-1301, USA.
24 pcg 1.1 #
25     # As a special exception to the GNU General Public License, if you
26     # distribute this file as part of a program that contains a
27     # configuration script generated by Autoconf, you may include it under
28     # the same distribution terms that you use for the rest of that program.
29     #
30     # The first argument passed to this file is the canonical host specification,
31     # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
32     # or
33     # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
34     # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
35     # should be set by the caller.
36     #
37     # The set of defined variables is at the end of this script.
38    
39     # All known linkers require a `.a' archive for static linking (except M$VC,
40     # which needs '.lib').
41     libext=a
42     shlibext=
43    
44     host="$1"
45     host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
46     host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
47     host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
48    
49     wl=
50     if test "$GCC" = yes; then
51     wl='-Wl,'
52     else
53     case "$host_os" in
54     aix3* | aix4* | aix5*)
55     wl='-Wl,'
56     ;;
57     hpux9* | hpux10* | hpux11*)
58     wl='-Wl,'
59     ;;
60     irix5* | irix6*)
61     wl='-Wl,'
62     ;;
63     linux*)
64     echo '__INTEL_COMPILER' > conftest.$ac_ext
65     if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null
66     then
67     :
68     else
69     # Intel icc
70     wl='-Qoption,ld,'
71     fi
72     ;;
73     osf3* | osf4* | osf5*)
74     wl='-Wl,'
75     ;;
76     solaris*)
77     wl='-Wl,'
78     ;;
79     sunos4*)
80     wl='-Qoption ld '
81     ;;
82     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
83     if test "x$host_vendor" = xsni; then
84     wl='-LD'
85     else
86     wl='-Wl,'
87     fi
88     ;;
89     esac
90     fi
91    
92     hardcode_libdir_flag_spec=
93     hardcode_libdir_separator=
94     hardcode_direct=no
95     hardcode_minus_L=no
96    
97     case "$host_os" in
98     cygwin* | mingw* | pw32*)
99     # FIXME: the MSVC++ port hasn't been tested in a loooong time
100     # When not using gcc, we currently assume that we are using
101     # Microsoft Visual C++.
102     if test "$GCC" != yes; then
103     with_gnu_ld=no
104     fi
105     ;;
106     openbsd*)
107     with_gnu_ld=no
108     ;;
109     esac
110    
111     ld_shlibs=yes
112     if test "$with_gnu_ld" = yes; then
113     case "$host_os" in
114     aix3* | aix4* | aix5*)
115     # On AIX, the GNU linker is very broken
116     ld_shlibs=no
117     ;;
118     amigaos*)
119     hardcode_libdir_flag_spec='-L$libdir'
120     hardcode_minus_L=yes
121     # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
122     # that the semantics of dynamic libraries on AmigaOS, at least up
123     # to version 4, is to share data among multiple programs linked
124     # with the same dynamic library. Since this doesn't match the
125     # behavior of shared libraries on other platforms, we can use
126     # them.
127     ld_shlibs=no
128     ;;
129     beos*)
130     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
131     :
132     else
133     ld_shlibs=no
134     fi
135     ;;
136     cygwin* | mingw* | pw32*)
137     # hardcode_libdir_flag_spec is actually meaningless, as there is
138     # no search path for DLLs.
139     hardcode_libdir_flag_spec='-L$libdir'
140     ;;
141     solaris* | sysv5*)
142     if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
143     ld_shlibs=no
144     elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
145     :
146     else
147     ld_shlibs=no
148     fi
149     ;;
150     sunos4*)
151     hardcode_direct=yes
152     ;;
153     *)
154     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
155     :
156     else
157     ld_shlibs=no
158     fi
159     ;;
160     esac
161     if test "$ld_shlibs" = yes; then
162     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
163     fi
164     else
165     case "$host_os" in
166     aix3*)
167     # Note: this linker hardcodes the directories in LIBPATH if there
168     # are no directories specified by -L.
169     hardcode_minus_L=yes
170     if test "$GCC" = yes; then
171     # Neither direct hardcoding nor static linking is supported with a
172     # broken collect2.
173     hardcode_direct=unsupported
174     fi
175     ;;
176     aix4* | aix5*)
177     if test "$host_cpu" = ia64; then
178     # On IA64, the linker does run time linking by default, so we don't
179     # have to do anything special.
180     aix_use_runtimelinking=no
181     else
182     aix_use_runtimelinking=no
183     # Test if we are trying to use run time linking or normal
184     # AIX style linking. If -brtl is somewhere in LDFLAGS, we
185     # need to do runtime linking.
186     case $host_os in aix4.[23]|aix4.[23].*|aix5*)
187     for ld_flag in $LDFLAGS; do
188     if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
189     aix_use_runtimelinking=yes
190     break
191     fi
192     done
193     esac
194     fi
195     hardcode_direct=yes
196     hardcode_libdir_separator=':'
197     if test "$GCC" = yes; then
198     case $host_os in aix4.[012]|aix4.[012].*)
199     collect2name=`${CC} -print-prog-name=collect2`
200     if test -f "$collect2name" && \
201     strings "$collect2name" | grep resolve_lib_name >/dev/null
202     then
203     # We have reworked collect2
204     hardcode_direct=yes
205     else
206     # We have old collect2
207     hardcode_direct=unsupported
208     hardcode_minus_L=yes
209     hardcode_libdir_flag_spec='-L$libdir'
210     hardcode_libdir_separator=
211     fi
212     esac
213     fi
214     if test "$aix_use_runtimelinking" = yes; then
215     hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
216     else
217     if test "$host_cpu" = ia64; then
218     hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
219     else
220     hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
221     fi
222     fi
223     ;;
224     amigaos*)
225     hardcode_libdir_flag_spec='-L$libdir'
226     hardcode_minus_L=yes
227     # see comment about different semantics on the GNU ld section
228     ld_shlibs=no
229     ;;
230     cygwin* | mingw* | pw32*)
231     # When not using gcc, we currently assume that we are using
232     # Microsoft Visual C++.
233     # hardcode_libdir_flag_spec is actually meaningless, as there is
234     # no search path for DLLs.
235     hardcode_libdir_flag_spec=' '
236     libext=lib
237     ;;
238     darwin* | rhapsody*)
239     hardcode_direct=yes
240     ;;
241     freebsd1*)
242     ld_shlibs=no
243     ;;
244     freebsd2.2*)
245     hardcode_libdir_flag_spec='-R$libdir'
246     hardcode_direct=yes
247     ;;
248     freebsd2*)
249     hardcode_direct=yes
250     hardcode_minus_L=yes
251     ;;
252     freebsd*)
253     hardcode_libdir_flag_spec='-R$libdir'
254     hardcode_direct=yes
255     ;;
256     hpux9* | hpux10* | hpux11*)
257     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
258     hardcode_libdir_separator=:
259     hardcode_direct=yes
260     hardcode_minus_L=yes # Not in the search PATH, but as the default
261     # location of the library.
262     ;;
263     irix5* | irix6*)
264     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
265     hardcode_libdir_separator=:
266     ;;
267     netbsd*)
268     hardcode_libdir_flag_spec='-R$libdir'
269     hardcode_direct=yes
270     ;;
271     newsos6)
272     hardcode_direct=yes
273     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
274     hardcode_libdir_separator=:
275     ;;
276     openbsd*)
277     hardcode_direct=yes
278     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
279     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
280     else
281     case "$host_os" in
282     openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
283     hardcode_libdir_flag_spec='-R$libdir'
284     ;;
285     *)
286     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
287     ;;
288     esac
289     fi
290     ;;
291     os2*)
292     hardcode_libdir_flag_spec='-L$libdir'
293     hardcode_minus_L=yes
294     ;;
295     osf3*)
296     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
297     hardcode_libdir_separator=:
298     ;;
299     osf4* | osf5*)
300     if test "$GCC" = yes; then
301     hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
302     else
303     # Both cc and cxx compiler support -rpath directly
304     hardcode_libdir_flag_spec='-rpath $libdir'
305     fi
306     hardcode_libdir_separator=:
307     ;;
308     sco3.2v5*)
309     ;;
310     solaris*)
311     hardcode_libdir_flag_spec='-R$libdir'
312     ;;
313     sunos4*)
314     hardcode_libdir_flag_spec='-L$libdir'
315     hardcode_direct=yes
316     hardcode_minus_L=yes
317     ;;
318     sysv4)
319     if test "x$host_vendor" = xsno; then
320     hardcode_direct=yes # is this really true???
321     else
322     hardcode_direct=no # Motorola manual says yes, but my tests say they lie
323     fi
324     ;;
325     sysv4.3*)
326     ;;
327     sysv5*)
328     hardcode_libdir_flag_spec=
329     ;;
330     uts4*)
331     hardcode_libdir_flag_spec='-L$libdir'
332     ;;
333     dgux*)
334     hardcode_libdir_flag_spec='-L$libdir'
335     ;;
336     sysv4*MP*)
337     if test -d /usr/nec; then
338     ld_shlibs=yes
339     fi
340     ;;
341     sysv4.2uw2*)
342     hardcode_direct=yes
343     hardcode_minus_L=no
344     ;;
345     sysv5uw7* | unixware7*)
346     ;;
347     *)
348     ld_shlibs=no
349     ;;
350     esac
351     fi
352    
353     # Check dynamic linker characteristics
354     libname_spec='lib$name'
355     sys_lib_dlsearch_path_spec="/lib /usr/lib"
356     sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
357     case "$host_os" in
358     aix3*)
359     shlibext=so
360     ;;
361     aix4* | aix5*)
362     shlibext=so
363     ;;
364     amigaos*)
365     shlibext=ixlibrary
366     ;;
367     beos*)
368     shlibext=so
369     ;;
370     bsdi4*)
371     shlibext=so
372     sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
373     sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
374     ;;
375     cygwin* | mingw* | pw32*)
376     case $GCC,$host_os in
377     yes,cygwin*)
378     shlibext=dll.a
379     ;;
380     yes,mingw*)
381     shlibext=dll
382     sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
383     ;;
384     yes,pw32*)
385     shlibext=dll
386     ;;
387     *)
388     shlibext=dll
389     ;;
390     esac
391     ;;
392     darwin* | rhapsody*)
393     shlibext=dylib
394     ;;
395     freebsd1*)
396     ;;
397     freebsd*)
398     shlibext=so
399     ;;
400     gnu*)
401     shlibext=so
402     ;;
403     hpux9* | hpux10* | hpux11*)
404     shlibext=sl
405     ;;
406     irix5* | irix6*)
407     shlibext=so
408     case "$host_os" in
409     irix5*)
410     libsuff= shlibsuff=
411     ;;
412     *)
413     case $LD in
414     *-32|*"-32 ") libsuff= shlibsuff= ;;
415     *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;;
416     *-64|*"-64 ") libsuff=64 shlibsuff=64 ;;
417     *) libsuff= shlibsuff= ;;
418     esac
419     ;;
420     esac
421     sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
422     sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
423     ;;
424     linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
425     ;;
426     linux-gnu*)
427     shlibext=so
428     ;;
429     netbsd*)
430     shlibext=so
431     ;;
432     newsos6)
433     shlibext=so
434     ;;
435     openbsd*)
436     shlibext=so
437     ;;
438     os2*)
439     libname_spec='$name'
440     shlibext=dll
441     ;;
442     osf3* | osf4* | osf5*)
443     shlibext=so
444     sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
445     sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
446     ;;
447     sco3.2v5*)
448     shlibext=so
449     ;;
450     solaris*)
451     shlibext=so
452     ;;
453     sunos4*)
454     shlibext=so
455     ;;
456     sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
457     shlibext=so
458     case "$host_vendor" in
459     motorola)
460     sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
461     ;;
462     esac
463     ;;
464     uts4*)
465     shlibext=so
466     ;;
467     dgux*)
468     shlibext=so
469     ;;
470     sysv4*MP*)
471     if test -d /usr/nec; then
472     shlibext=so
473     fi
474     ;;
475     esac
476    
477     sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
478     escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
479     escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
480     escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
481     escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
482    
483     sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
484    
485     # How to pass a linker flag through the compiler.
486     wl="$escaped_wl"
487    
488     # Static library suffix (normally "a").
489     libext="$libext"
490    
491     # Shared library suffix (normally "so").
492     shlibext="$shlibext"
493    
494     # Flag to hardcode \$libdir into a binary during linking.
495     # This must work even if \$libdir does not exist.
496     hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
497    
498     # Whether we need a single -rpath flag with a separated argument.
499     hardcode_libdir_separator="$hardcode_libdir_separator"
500    
501     # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
502     # resulting binary.
503     hardcode_direct="$hardcode_direct"
504    
505     # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
506     # resulting binary.
507     hardcode_minus_L="$hardcode_minus_L"
508    
509     # Compile-time system search path for libraries
510     sys_lib_search_path_spec="$escaped_sys_lib_search_path_spec"
511    
512     # Run-time system search path for libraries
513     sys_lib_dlsearch_path_spec="$escaped_sys_lib_dlsearch_path_spec"
514    
515     EOF