This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Check the alignment of long doubles if they are to be used;
[metaconfig.git] / U / modified / libs.U
CommitLineData
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:
d088635c 35?MAKE:libs ignore_versioned_solibs libsfound libsfiles libsdirs: \
508a21cd 36 test cat Myread Oldconfig Loc libpth package xlibpth so _a \
4ee071c7 37 usesocks ccflags
959f3c4c
JH
38?MAKE: -pick add $@ %<
39?S:libs:
40?S: This variable holds the additional libraries we want to use.
41?S: It is up to the Makefile to deal with it.
42?S:.
d088635c
JH
43?S:libsfound:
44?S: This variable holds the full pathnames of the libraries
45?S: we found and accepted.
46?S:.
47?S:libsfiles:
48?S: This variable holds the filenames aka basenames of the libraries
49?S: we found and accepted.
50?S:.
51?S:libsdirs:
52?S: This variable holds the directory names aka dirnames of the libraries
53?S: we found and accepted, duplicates are removed.
54?S:.
959f3c4c
JH
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).
59?S:.
d12857d9 60?T:xxx yyy thislib thisdir libswanted libstyle
959f3c4c
JH
61?D:libs=''
62?X:
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.
67?X:
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
72?X: it is available.
73?X:
74?X: The ordering of c, posix, and cposix is a guess and almost
75?X: certainly wrong on about half of all systems.
76?X:
77?X: Set proper libswanted in your private Myinit.U if needed.
78?X:
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"
d088635c 82?X:libswanted="$libswanted bsd BSD PW x iconv"
959f3c4c
JH
83?X:
84?INIT:: default library list
85?INIT:libswanted=''
86?INIT:: some systems want to use only the non-versioned libso:s
87?INIT:ignore_versioned_solibs=''
d12857d9 88?LINT:use libscheck
959f3c4c
JH
89: Looking for optional libraries
90echo " "
91echo "Checking for optional libraries..." >&4
92case "$libs" in
93' '|'') dflt='';;
94*) dflt="$libs";;
95esac
96case "$libswanted" in
97'') libswanted='c_s';;
98esac
99?X: libsocks has nasty naming.
100case "$usesocks" in
101$define)
102 libswanted="$libswanted socks5 socks5_sh"
103 ;;
104esac
105for thislib in $libswanted; do
959f3c4c
JH
106?X:
107?X: Comparisons via case statement use the string " $dflt " to ensure that
108?X: each library is separated by a space. That way, by looking to something
109?X: like *"-l$thislib "*, we ensure we find -lm and not -lmalloc (which was
110?X: the case with the old looking pattern *-l$thislib*.
111?X:
4ee071c7
JH
112 for thisdir in $libpth; do
113 xxx=''
114 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
115 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
116 $test -f "$xxx" && eval $libscheck
117 $test -f "$xxx" && libstyle=shared
118 fi
119 if test ! -f "$xxx"; then
120 xxx=$thisdir/lib$thislib.$so
121 $test -f "$xxx" && eval $libscheck
122 $test -f "$xxx" && libstyle=shared
123 fi
124 if test ! -f "$xxx"; then
125 xxx=$thisdir/lib$thislib$_a
126 $test -f "$xxx" && eval $libscheck
127 $test -f "$xxx" && libstyle=static
128 fi
129 if test ! -f "$xxx"; then
130 xxx=$thisdir/$thislib$_a
131 $test -f "$xxx" && eval $libscheck
132 $test -f "$xxx" && libstyle=static
133 fi
134 if test ! -f "$xxx"; then
135 xxx=$thisdir/lib${thislib}_s$_a
136 $test -f "$xxx" && eval $libscheck
137 $test -f "$xxx" && libstyle=static
138 fi
139 if test ! -f "$xxx"; then
140 xxx=$thisdir/Slib$thislib$_a
141 $test -f "$xxx" && eval $libscheck
142 $test -f "$xxx" && libstyle=static
143 fi
144 if $test -f "$xxx"; then
508a21cd 145 case "$libstyle" in
4ee071c7
JH
146 shared) echo "Found -l$thislib (shared)." ;;
147 static) echo "Found -l$thislib." ;;
148 *) echo "Found -l$thislib ($libstyle)." ;;
508a21cd 149 esac
959f3c4c
JH
150 case " $dflt " in
151 *"-l$thislib "*);;
4ee071c7 152 *) dflt="$dflt -l$thislib"
d088635c
JH
153 libsfound="$libsfound $xxx"
154 yyy=`basename $xxx`
155 libsfiles="$libsfiles $yyy"
156 yyy=`echo $xxx|sed "s@/$yyy\\$@@"`
157 case " $libsdirs " in
158 *" $yyy "*) ;;
159 *) libsdirs="$libsdirs $yyy" ;;
160 esac
161 ;;
959f3c4c 162 esac
4ee071c7
JH
163 break
164 fi
165 done
166 if $test ! -f "$xxx"; then
167 echo "No -l$thislib."
959f3c4c
JH
168 fi
169done
170set X $dflt
171shift
172dflt="$*"
173case "$libs" in
174'') dflt="$dflt";;
175*) dflt="$libs";;
176esac
177case "$dflt" in
178' '|'') dflt='none';;
179esac
180
181$cat <<EOM
182
183In order to compile $package on your machine, a number of libraries
184are usually needed. Include any other special libraries here as well.
185Say "none" for none. The default list is almost always right.
186EOM
187
188echo " "
189rp="What libraries to use?"
190. ./myread
191case "$ans" in
192none) libs=' ';;
193*) libs="$ans";;
194esac
195