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 libspath: \
36 test cat Myread Oldconfig Loc libpth package xlibpth so _a \
37 usesocks sed uselongdouble
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. The list can be empty.
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.
56 ?S: This variable holds the directory names probed for libraries.
58 ?S:ignore_versioned_solibs:
59 ?S: This variable should be non-empty if non-versioned shared
60 ?S: libraries (libfoo.so.x.y) are to be ignored (because they
61 ?S: cannot be linked against).
63 ?T:xxx yyy thislib thisdir libswanted libstyle
66 ?X: This order is chosen so that libraries -lndir, -ldir, -lucb, -lbsd,
67 ?X: -lBSD, -lPW, and -lx only get used if there are unresolved
68 ?X: routines at link time. Usually, these are backwards compatability
69 ?X: libraries, and may not be as reliable as the standard c library.
71 ?X: The -lsocket -linet -lnsl order has been reported to be necessary
72 ?X: for at least one SVR4 implementation.
73 ?X: -lc must proceed -lucb or -lbsd for most Solaris applications.
74 ?X: -lc_s proceeds -lc so we pick up the shared library version, if
77 ?X: The ordering of c, posix, and cposix is a guess and almost
78 ?X: certainly wrong on about half of all systems.
80 ?X: Set proper libswanted in your private Myinit.U if needed.
82 ?X:: default ordered library list
83 ?X:libswanted='net socket inet bind nsl nm sdbm gdbm ndbm dbm malloc dl'
84 ?X:libswanted="$libswanted dld sun m c_s c posix cposix ndir dir ucb"
85 ?X:libswanted="$libswanted bsd BSD PW x"
87 ?INIT:: default library list
89 ?INIT:: some systems want to use only the non-versioned libso:s
90 ?INIT:ignore_versioned_solibs=''
91 ?LINT:extern libscheck
94 ?LINT:use uselongdouble
95 : Looking for optional libraries
97 echo "Checking for optional libraries..." >&4
102 case "$libswanted" in
103 '') libswanted='c_s';;
105 ?X: libsocks has nasty naming scheme.
106 ?X: This does not work if somebody wants SOCKS 4.
108 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
114 for thisdir in $libpth $xlibpth; do
115 test -d $thisdir && libspath="$libspath $thisdir"
117 for thislib in $libswanted; do
118 for thisdir in $libspath; do
120 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
121 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
122 $test -f "$xxx" && eval $libscheck
123 $test -f "$xxx" && libstyle=shared
125 if test ! -f "$xxx"; then
126 xxx=$thisdir/lib$thislib.$so
127 $test -f "$xxx" && eval $libscheck
128 $test -f "$xxx" && libstyle=shared
130 if test ! -f "$xxx"; then
131 xxx=$thisdir/lib$thislib$_a
132 $test -f "$xxx" && eval $libscheck
133 $test -f "$xxx" && libstyle=static
135 if test ! -f "$xxx"; then
136 xxx=$thisdir/$thislib$_a
137 $test -f "$xxx" && eval $libscheck
138 $test -f "$xxx" && libstyle=static
140 if test ! -f "$xxx"; then
141 xxx=$thisdir/lib${thislib}_s$_a
142 $test -f "$xxx" && eval $libscheck
143 $test -f "$xxx" && libstyle=static
144 $test -f "$xxx" && thislib=${thislib}_s
146 if test ! -f "$xxx"; then
147 xxx=$thisdir/Slib$thislib$_a
148 $test -f "$xxx" && eval $libscheck
149 $test -f "$xxx" && libstyle=static
151 if $test -f "$xxx"; then
153 shared) echo "Found -l$thislib (shared)." ;;
154 static) echo "Found -l$thislib." ;;
155 *) echo "Found -l$thislib ($libstyle)." ;;
159 *) dflt="$dflt -l$thislib"
160 libsfound="$libsfound $xxx"
162 libsfiles="$libsfiles $yyy"
163 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
164 case " $libsdirs " in
166 *) libsdirs="$libsdirs $yyy" ;;
173 if $test ! -f "$xxx"; then
174 echo "No -l$thislib."
185 ' '|'') dflt='none';;
190 In order to compile $package on your machine, a number of libraries
191 are usually needed. Include any other special libraries here as well.
192 Say "none" for none. The default list is almost always right.
196 rp="What libraries to use?"