Commit | Line | Data |
---|---|---|
959f3c4c JH |
1 | ?RCS: $Id: libs.U,v 3.0.1.6 1997/02/28 16:09:11 ram Exp $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1993, Raphael Manfredi | |
4 | ?RCS: | |
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. | |
10 | ?RCS: | |
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 | |
14 | ?RCS: | |
15 | ?RCS: Revision 3.0.1.5 1995/07/25 14:12:05 ram | |
16 | ?RCS: patch56: now knows about OS/2 platforms | |
17 | ?RCS: | |
18 | ?RCS: Revision 3.0.1.4 1994/10/29 16:24:22 ram | |
19 | ?RCS: patch36: removed old broken thislib/thatlib processing (ADO) | |
20 | ?RCS: | |
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 | |
24 | ?RCS: | |
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) | |
28 | ?RCS: | |
29 | ?RCS: Revision 3.0.1.1 1993/08/25 14:02:31 ram | |
30 | ?RCS: patch6: added default for libs | |
31 | ?RCS: | |
32 | ?RCS: Revision 3.0 1993/08/18 12:09:03 ram | |
33 | ?RCS: Baseline for dist 3.0 netwide release. | |
34 | ?RCS: | |
35 | ?MAKE:libs ignore_versioned_solibs: \ | |
36 | test cat Myread Oldconfig Loc libpth package xlibpth so _a usesocks | |
37 | ?MAKE: -pick add $@ %< | |
38 | ?S:libs: | |
39 | ?S: This variable holds the additional libraries we want to use. | |
40 | ?S: It is up to the Makefile to deal with it. | |
41 | ?S:. | |
42 | ?S:ignore_versioned_solibs: | |
43 | ?S: This variable should be non-empty if non-versioned shared | |
44 | ?S: libraries (libfoo.so.x.y) are to be ignored (because they | |
45 | ?S: cannot be linked against). | |
46 | ?S:. | |
47 | ?T:xxx thislib libswanted | |
48 | ?D:libs='' | |
49 | ?X: | |
50 | ?X: This order is chosen so that libraries -lndir, -ldir, -lucb, -lbsd, | |
51 | ?X: -lBSD, -lPW, and -lx only get used if there are unresolved | |
52 | ?X: routines at link time. Usually, these are backwards compatability | |
53 | ?X: libraries, and may not be as reliable as the standard c library. | |
54 | ?X: | |
55 | ?X: The -lsocket -linet -lnsl order has been reported to be necessary | |
56 | ?X: for at least one SVR4 implementation. | |
57 | ?X: -lc must proceed -lucb or -lbsd for most Solaris applications. | |
58 | ?X: -lc_s proceeds -lc so we pick up the shared library version, if | |
59 | ?X: it is available. | |
60 | ?X: | |
61 | ?X: The ordering of c, posix, and cposix is a guess and almost | |
62 | ?X: certainly wrong on about half of all systems. | |
63 | ?X: | |
64 | ?X: Set proper libswanted in your private Myinit.U if needed. | |
65 | ?X: | |
66 | ?X:: default ordered library list | |
67 | ?X:libswanted='net socket inet nsl nm sdbm gdbm ndbm dbm malloc dl' | |
68 | ?X:libswanted="$libswanted dld sun m c_s c posix cposix ndir dir ucb" | |
69 | ?X:libswanted="$libswanted bsd BSD PW x" | |
70 | ?X: | |
71 | ?INIT:: default library list | |
72 | ?INIT:libswanted='' | |
73 | ?INIT:: some systems want to use only the non-versioned libso:s | |
74 | ?INIT:ignore_versioned_solibs='' | |
75 | : Looking for optional libraries | |
76 | echo " " | |
77 | echo "Checking for optional libraries..." >&4 | |
78 | case "$libs" in | |
79 | ' '|'') dflt='';; | |
80 | *) dflt="$libs";; | |
81 | esac | |
82 | case "$libswanted" in | |
83 | '') libswanted='c_s';; | |
84 | esac | |
85 | ?X: libsocks has nasty naming. | |
86 | case "$usesocks" in | |
87 | $define) | |
88 | libswanted="$libswanted socks5 socks5_sh" | |
89 | ;; | |
90 | esac | |
91 | for thislib in $libswanted; do | |
92 | ||
93 | ?X: | |
94 | ?X: Comparisons via case statement use the string " $dflt " to ensure that | |
95 | ?X: each library is separated by a space. That way, by looking to something | |
96 | ?X: like *"-l$thislib "*, we ensure we find -lm and not -lmalloc (which was | |
97 | ?X: the case with the old looking pattern *-l$thislib*. | |
98 | ?X: | |
99 | if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; | |
100 | $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then | |
101 | echo "Found -l$thislib (shared)." | |
102 | case " $dflt " in | |
103 | *"-l$thislib "*);; | |
104 | *) dflt="$dflt -l$thislib";; | |
105 | esac | |
106 | elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then | |
107 | echo "Found -l$thislib (shared)." | |
108 | case " $dflt " in | |
109 | *"-l$thislib "*);; | |
110 | *) dflt="$dflt -l$thislib";; | |
111 | esac | |
112 | elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then | |
113 | echo "Found -l$thislib." | |
114 | case " $dflt " in | |
115 | *"-l$thislib "*);; | |
116 | *) dflt="$dflt -l$thislib";; | |
117 | esac | |
118 | ?X: Don't forget about OS/2 where -lmalloc is spelled out malloc.a | |
119 | elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then | |
120 | echo "Found -l$thislib." | |
121 | case " $dflt " in | |
122 | *"-l$thislib "*);; | |
123 | *) dflt="$dflt -l$thislib";; | |
124 | esac | |
125 | elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then | |
126 | echo "Found -l${thislib}_s." | |
127 | case " $dflt " in | |
128 | *"-l$thislib "*);; | |
129 | *) dflt="$dflt -l${thislib}_s";; | |
130 | esac | |
131 | elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then | |
132 | echo "Found -l$thislib." | |
133 | case " $dflt " in | |
134 | *"-l$thislib "*);; | |
135 | *) dflt="$dflt -l$thislib";; | |
136 | esac | |
137 | else | |
138 | echo "No -l$thislib." | |
139 | fi | |
140 | done | |
141 | set X $dflt | |
142 | shift | |
143 | dflt="$*" | |
144 | case "$libs" in | |
145 | '') dflt="$dflt";; | |
146 | *) dflt="$libs";; | |
147 | esac | |
148 | case "$dflt" in | |
149 | ' '|'') dflt='none';; | |
150 | esac | |
151 | ||
152 | $cat <<EOM | |
153 | ||
154 | In order to compile $package on your machine, a number of libraries | |
155 | are usually needed. Include any other special libraries here as well. | |
156 | Say "none" for none. The default list is almost always right. | |
157 | EOM | |
158 | ||
159 | echo " " | |
160 | rp="What libraries to use?" | |
161 | . ./myread | |
162 | case "$ans" in | |
163 | none) libs=' ';; | |
164 | *) libs="$ans";; | |
165 | esac | |
166 |