Commit | Line | Data |
2304df62 |
1 | ?X: These units are based on the ones supplied with dist-3.0 |
2 | ?X: patchlevel 22. They have been changed or enhanced to work with |
3 | ?X: perl5alpha. I would appreciate hearing about any changes, |
4 | ?X: corrections, or enhancements. |
5 | ?X: Andy Dougherty doughera@lafcol.lafayette.edu |
6 | ?X: Dept. of Physics |
7 | ?X: Lafayette College |
8 | ?X: Easton, PA 18042-1782 |
9 | ?X: Sat Apr 2 15:45:17 EST 1994 |
10 | ?RCS: $Id: libs.U,v 3.0.1.1 1993/08/25 14:02:31 ram Exp $ |
11 | ?RCS: |
12 | ?RCS: Copyright (c) 1991-1993, Raphael Manfredi |
13 | ?RCS: |
14 | ?RCS: You may redistribute only under the terms of the Artistic Licence, |
15 | ?RCS: as specified in the README file that comes with the distribution. |
16 | ?RCS: You may reuse parts of this distribution only within the terms of |
17 | ?RCS: that same Artistic Licence; a copy of which may be found at the root |
18 | ?RCS: of the source tree for dist 3.0. |
19 | ?RCS: |
20 | ?RCS: $Log: libs.U,v $ |
21 | ?RCS: Revision 3.0.1.1 1993/08/25 14:02:31 ram |
22 | ?RCS: patch6: added default for libs |
23 | ?RCS: |
24 | ?RCS: Revision 3.0 1993/08/18 12:09:03 ram |
25 | ?RCS: Baseline for dist 3.0 netwide release. |
26 | ?RCS: |
27 | ?MAKE:libs: test cat Myread Oldconfig Loc libpth package xlibpth |
28 | ?MAKE: -pick add $@ %< |
29 | ?S:libs: |
30 | ?S: This variable holds the additional libraries we want to use. |
31 | ?S: It is up to the Makefile to deal with it. |
32 | ?S:. |
33 | ?T:xxx yyy zzz thislib thatlib libswanted |
34 | ?D:libs='' |
35 | ?X: |
36 | ?X: This order is chosen so that libraries -lndir, -ldir, -lucb, -lbsd, |
37 | ?X: -lBSD, -lPW, and -lx only get used if there are unresolved |
38 | ?X: routines at link time. Usually, these are backwards compatability |
39 | ?X: libraries, and may not be as reliable as the standard c library. |
40 | ?X: The ordering of c_s, posix, and cposix is a guess and almost |
41 | ?X: certainly wrong on about half of all systems. |
42 | ?INIT:libswanted="net socket nsl inet nm sdbm gdbm ndbm dbm malloc dl dld sun m c_s posix cposix ndir dir ucb bsd BSD PW x" |
43 | ?INIT: |
44 | : Looking for optional libraries |
45 | echo " " |
46 | echo "Checking for optional libraries..." >&4 |
47 | case "$libs" in |
48 | ' '|'') dflt='';; |
49 | *) dflt="$libs";; |
50 | esac |
51 | case "$libswanted" in |
52 | '') libswanted='c_s';; |
53 | esac |
54 | for thislib in $libswanted; do |
55 | case "$thislib" in |
56 | dbm) thatlib=ndbm;; |
57 | *_s) thatlib=NONE;; |
58 | *) thatlib="${thislib}_s";; |
59 | esac |
60 | xxx=`./loc lib$thislib.a X $libpth` |
61 | yyy=`./loc lib$thatlib.a X $libpth` |
62 | zzz=`./loc lib$thislib.so.[0-9]'*' $libpth` |
63 | if $test -f $xxx; then |
64 | echo "Found -l$thislib." |
65 | case "$dflt" in |
66 | "*-l$thislib *.*"|"*-l$thatlib *.*") ;; |
67 | *) dflt="$dflt -l$thislib";; |
68 | esac |
69 | elif $test -f $yyy; then |
70 | echo "Found -l$thatlib." |
71 | case "$dflt" in |
72 | "*-l$thislib *.*"|"*-l$thatlib *.*") ;; |
73 | *) dflt="$dflt -l$thatlib";; |
74 | esac |
75 | elif $test -f $zzz; then |
76 | echo "Found -$thislib." |
77 | case "$dflt" in |
78 | "*-l$thislib *.*"|"*-l$thatlib *.*") ;; |
79 | *) dflt="$dflt -l$thislib";; |
80 | esac |
81 | else |
82 | xxx=`./loc Slib$thislib.a X $xlibpth` |
83 | yyy=`./loc Slib$thatlib.a X $xlibpth` |
84 | if $test -f $xxx; then |
85 | echo "Found -l$thislib." |
86 | case "$dflt" in |
87 | "*-l$thislib *.*"|"*-l$thatlib *.*") ;; |
88 | *) dflt="$dflt -l$thislib";; |
89 | esac |
90 | elif $test -f $yyy; then |
91 | echo "Found -l$thatlib." |
92 | case "$dflt" in |
93 | "*-l$thislib *.*"|"*-l$thatlib *.*") ;; |
94 | *) dflt="$dflt -l$thatlib";; |
95 | esac |
96 | else |
97 | echo "No -l$thislib." |
98 | fi |
99 | fi |
100 | done |
101 | set X $dflt |
102 | shift |
103 | dflt="$*" |
104 | case "$libs" in |
105 | '') dflt="$dflt";; |
106 | *) dflt="$libs";; |
107 | esac |
108 | case "$dflt" in |
109 | ' '|'') dflt='none';; |
110 | esac |
111 | |
112 | $cat <<EOM |
113 | |
114 | Some versions of Unix support shared libraries, which make executables smaller |
115 | but make load time slightly longer. |
116 | |
117 | On some systems, mostly newer Unix System V's, the shared library is included |
118 | by putting the option "-lc_s" as the last thing on the cc command line when |
119 | linking. Other systems use shared libraries by default. There may be other |
120 | libraries needed to compile $package on your machine as well. If your system |
121 | needs the "-lc_s" option, include it here. Include any other special libraries |
122 | here as well. Say "none" for none. |
123 | EOM |
124 | |
125 | echo " " |
126 | rp="Any additional libraries?" |
127 | . ./myread |
128 | case "$ans" in |
129 | none) libs=' ';; |
130 | *) libs="$ans";; |
131 | esac |
132 | |