* libltdl/ltdl.c (dyld): Remove some debug printf's, fix a bug.
[libtool.git] / mail / libc_s
blobf28ff12157b66b62990f88a22ae76edf80b71404
1 From nobody Wed Jul  2 19:28:31 1997
2 X-From-Line: norm@connectware.ca Wed Jul 02 22:32:39 1997
3 Return-Path: <norm@connectware.ca>
4 Delivered-To: gord@profitpress.com
5 Received: (qmail 5508 invoked from network); 2 Jul 1997 22:32:38 -0000
6 Received: from localhost (HELO bambam.m-tech.ab.ca) (127.0.0.1)
7   by localhost with SMTP; 2 Jul 1997 22:32:38 -0000
8 X-POP3-Rcpt: gord@bambam
9 Return-Path: norm@connectware.ca
10 Received: from bunker.connectware.ca (norm.HIP.CAM.ORG [199.84.42.109]) by m-tech.ab.ca (8.6.12/8.6.9) with ESMTP id KAA07116 for <gord@m-tech.ab.ca>; Wed, 2 Jul 1997 10:12:18 -0600
11 Received: from castle.connectware.ca (castle.connectware.ca [204.19.223.2])
12         by bunker.connectware.ca (8.8.5/8.8.5) with SMTP id MAA02233
13         for <gord@m-tech.ab.ca>; Wed, 2 Jul 1997 12:15:54 -0400 (EDT)
14 Received: by castle.connectware.ca (AIX 3.2/UCB 5.64/4.03)
15           id AA21851; Wed, 2 Jul 1997 12:08:56 -0400
16 Date: Wed, 2 Jul 1997 12:08:53 -0400 (EDT)
17 From: Normand McGuire <norm@connectware.ca>
18 To: Gordon Matzigkeit <gord@m-tech.ab.ca>
19 Subject: Re: -lc_s shared libraries
20 In-Reply-To: <86yb7qipsd.fsf_-_@trick.profitpress.com>
21 Message-Id: <Pine.A32.3.91.970702113816.24858A-100000@castle.connectware.ca>
22 Mime-Version: 1.0
23 Content-Type: TEXT/PLAIN; charset=US-ASCII
24 Xref: trick.profitpress.com mail.libtool:299
25 Lines: 113
26 X-Gnus-Article-Number: 1   Mon Nov  2 17:19:44 1998
30 On 1 Jul 1997, Gordon Matzigkeit wrote:
32 > Are you sure that on SCO Openserver 5 you need to specify
33 > /lib/libc.so?  From what I understood about that platform, specifying
34 > `-lc' (which is what the C compiler does by default) is good enough,
35 > and links in the shared version if it exists.
37 >From my experience, definitely. Look below.
39 > Do you know otherwise?  Can you show the results of specific tests to
40 > me that would prove your point?
42 Here is a sample of a session demonstrating this on my system. I show the 
43 source code, default cc file and three compiles with three a.out file 
44 sizes. See for yourself:
46 Script started on Wed Jul  2 11:21:58 1997
47 $ cat t.c
48 main()
50         {
51         printf("Hello, world\n");
52         }
53 $ cat /etc/default/cc
54 #       @(#) cc.default 20.1 94/12/04 
55 #       
56 #       Copyright (C) The Santa Cruz Operation, Inc. 1994-1995.
57 #       This Module contains Proprietary Information of
58 #       The Santa Cruz Operation, and should be treated as Confidential.
60 #       Core development /bin/cc reads /etc/default/cc.
61 #       Cross development /usr/ods30/bin/cc reads /etc/default/crossdevcc.
62 #       If a prefix is specified, cc reads /etc/default/<prefix>cc instead.
64 FLAGS=
65 LIBS=
66 $ cc t.c
67 $ l a.out
68 -rwxrwxr-x   1 root     sys        46334 Jul  2 11:22 a.out
69 $ cc t.c -lc
70 $ l a.out
71 -rwxrwxr-x   1 root     sys        46334 Jul  2 11:22 a.out
72 $ cc t.c /lib/libc.so
73 $ l a.out
74 -rwxrwxr-x   1 root     sys         3988 Jul  2 11:22 a.out
75 $ exit
77 script done on Wed Jul  2 11:22:32 1997
79 And believe me, this script session is not a fake.
81 > The reason I'm asking is that I, too, would like to know how Autoconf
82 > packages can best take advantage of shared libraries, especially in a
83 > general, rather than a test-by-test way.
85 The section of my configure.in script that takes care of shared libraries
86 is short and not annoying to repeat. You may want to incorporate it into 
87 the AC_PROG_CC macro or create a new one for it. So far, I've seen only 
88 two kinds of behaviors regarding shared libraries: if they are not used 
89 automatically when invoking cc, just include them when linking the 
90 program. And it worked so far. However, you guys may have a whole lot 
91 more flavors of system to run on compared to me.
93 Here is the portion of the shared library check in my configure.in script:
95 # STEP 2 - Check for libraries
97 AC_MSG_CHECKING([for libc.so])
98 if test -r /lib/libc.so; then
99     AC_MSG_RESULT([yes (/lib/libc.so)])
100     LIBS="$LIBS /lib/libc.so"
101 elif test -r /usr/lib/libc.so; then
102     AC_MSG_RESULT([yes (/usr/lib/libc.so)])
103     LIBS="$LIBS /usr/lib/libc.so"
104 else
105     AC_MSG_RESULT(no)
106     AC_CHECK_LIB(c_s, main)
107     fi
109 > Could you be more specific when you mention `some other System V Unix
110 > systems'?  What are their canonical system names (i.e. *-*-sco3.2v4*)?
112 By 'some other Unix systems' requiring that you explicitely specify the 
113 shared library name when linking the program, I meant specifically:
115 o Bull Open Software (Unix System V Release 4, but don't remember if it is x86)
117 o Interactive Unix System V/386 all versions
119 o SCO Unix 3.2v4 and SCO OpenServer 5
121 o Sun Solaris 2.3 / SunOS 5.3
123 All others that we've compiled and run on will automatically use shared 
124 libraries when available, namely:
126 IBM's AIX 3.2.* and 4.*
127 HP's HPUX 8.*, 9.* and 10.*
128 DEC Ultrix, OSF/1 and DEC Unix all versions tried
129 DataGeneral's DGUX all versions tried
130 Sequent's DYNIX/ptx 2.1 and 4
131 Linux all versions tried
132 SGI's Irix all versions tried
133 NCR and AT&T Unix System V/386 Release 4
134 Sun Solaris 2.4 (SunOS 5.4) and Solaris 2.5 (SunOS 5.5)
135 SunOS 4.1*
136 Unisys Unix System V/386
137 Unixware all versions
139 Normand McGuire