1 ?RCS: $Id: libs.U,v 3.0.1.6 1997/02/28 16:09:11 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
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
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
11 ?RCS: $Log: libs.U,v $
12 ?RCS: Revision 3.0.1.6 1997/02/28 16:09:11 ram
13 ?RCS: patch61: replaced .a with $_a all over the place
15 ?RCS: Revision 3.0.1.5 1995/07/25 14:12:05 ram
16 ?RCS: patch56: now knows about OS/2 platforms
18 ?RCS: Revision 3.0.1.4 1994/10/29 16:24:22 ram
19 ?RCS: patch36: removed old broken thislib/thatlib processing (ADO)
21 ?RCS: Revision 3.0.1.3 1994/06/20 07:05:44 ram
22 ?RCS: patch30: code cleanup with if/elif by ADO and RAM
23 ?RCS: patch30: undone patch23 for libswanted default setting
25 ?RCS: Revision 3.0.1.2 1994/05/06 15:08:45 ram
26 ?RCS: patch23: now includes ordered default libswanted variable (ADO)
27 ?RCS: patch23: major cleanup for library lookups (ADO)
29 ?RCS: Revision 3.0.1.1 1993/08/25 14:02:31 ram
30 ?RCS: patch6: added default for libs
32 ?RCS: Revision 3.0 1993/08/18 12:09:03 ram
33 ?RCS: Baseline for dist 3.0 netwide release.
35 ?MAKE:libs ignore_versioned_solibs libsfound libsfiles libsdirs: \
36 test cat Myread Oldconfig Loc libpth package xlibpth so _a \
38 ?MAKE: -pick add $@ %<
40 ?S: This variable holds the additional libraries we want to use.
41 ?S: It is up to the Makefile to deal with it.
44 ?S: This variable holds the full pathnames of the libraries
45 ?S: we found and accepted.
48 ?S: This variable holds the filenames aka basenames of the libraries
49 ?S: we found and accepted.
52 ?S: This variable holds the directory names aka dirnames of the libraries
53 ?S: we found and accepted, duplicates are removed.
55 ?S:ignore_versioned_solibs:
56 ?S: This variable should be non-empty if non-versioned shared
57 ?S: libraries (libfoo.so.x.y) are to be ignored (because they
58 ?S: cannot be linked against).
60 ?T:xxx yyy thislib libswanted libstyle libname
63 ?X: This order is chosen so that libraries -lndir, -ldir, -lucb, -lbsd,
64 ?X: -lBSD, -lPW, and -lx only get used if there are unresolved
65 ?X: routines at link time. Usually, these are backwards compatability
66 ?X: libraries, and may not be as reliable as the standard c library.
68 ?X: The -lsocket -linet -lnsl order has been reported to be necessary
69 ?X: for at least one SVR4 implementation.
70 ?X: -lc must proceed -lucb or -lbsd for most Solaris applications.
71 ?X: -lc_s proceeds -lc so we pick up the shared library version, if
74 ?X: The ordering of c, posix, and cposix is a guess and almost
75 ?X: certainly wrong on about half of all systems.
77 ?X: Set proper libswanted in your private Myinit.U if needed.
79 ?X:: default ordered library list
80 ?X:libswanted='net socket inet nsl nm sdbm gdbm ndbm dbm malloc dl'
81 ?X:libswanted="$libswanted dld sun m c_s c posix cposix ndir dir ucb"
82 ?X:libswanted="$libswanted bsd BSD PW x iconv"
84 ?INIT:: default library list
86 ?INIT:: some systems want to use only the non-versioned libso:s
87 ?INIT:ignore_versioned_solibs=''
88 : Looking for optional libraries
90 echo "Checking for optional libraries..." >&4
96 '') libswanted='c_s';;
98 ?X: libsocks has nasty naming.
101 libswanted="$libswanted socks5 socks5_sh"
104 for thislib in $libswanted; do
106 ?X: Comparisons via case statement use the string " $dflt " to ensure that
107 ?X: each library is separated by a space. That way, by looking to something
108 ?X: like *"-l$thislib "*, we ensure we find -lm and not -lmalloc (which was
109 ?X: the case with the old looking pattern *-l$thislib*.
111 for thisdir in $libpth; do
113 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
114 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
115 $test -f "$xxx" && eval $libscheck
116 $test -f "$xxx" && libstyle=shared
118 if test ! -f "$xxx"; then
119 xxx=$thisdir/lib$thislib.$so
120 $test -f "$xxx" && eval $libscheck
121 $test -f "$xxx" && libstyle=shared
123 if test ! -f "$xxx"; then
124 xxx=$thisdir/lib$thislib$_a
125 $test -f "$xxx" && eval $libscheck
126 $test -f "$xxx" && libstyle=static
128 if test ! -f "$xxx"; then
129 xxx=$thisdir/$thislib$_a
130 $test -f "$xxx" && eval $libscheck
131 $test -f "$xxx" && libstyle=static
133 if test ! -f "$xxx"; then
134 xxx=$thisdir/lib${thislib}_s$_a
135 $test -f "$xxx" && eval $libscheck
136 $test -f "$xxx" && libstyle=static
138 if test ! -f "$xxx"; then
139 xxx=$thisdir/Slib$thislib$_a
140 $test -f "$xxx" && eval $libscheck
141 $test -f "$xxx" && libstyle=static
143 if $test -f "$xxx"; then
145 shared) echo "Found -l$thislib (shared)." ;;
146 static) echo "Found -l$thislib." ;;
147 *) echo "Found -l$thislib ($libstyle)." ;;
151 *) dflt="$dflt -l$thislib"
152 libsfound="$libsfound $xxx"
154 libsfiles="$libsfiles $yyy"
155 yyy=`echo $xxx|sed "s@/$yyy\\$@@"`
156 case " $libsdirs " in
158 *) libsdirs="$libsdirs $yyy" ;;
165 if $test ! -f "$xxx"; then
166 echo "No -l$thislib."
177 ' '|'') dflt='none';;
182 In order to compile $package on your machine, a number of libraries
183 are usually needed. Include any other special libraries here as well.
184 Say "none" for none. The default list is almost always right.
188 rp="What libraries to use?"