From k5@cheerful.com  Fri Jul 28 12:27:17 2000
Return-Path: <k5@cheerful.com>
Received: from m08.alpha-net.ne.jp (m08.alpha-net.ne.jp [210.229.64.38])
	by hub.freebsd.org (Postfix) with ESMTP id A8ADE37BAAC
	for <FreeBSD-gnats-submit@FreeBSD.org>; Fri, 28 Jul 2000 12:27:15 -0700 (PDT)
	(envelope-from k5@cheerful.com)
Received: from kyoto-tc012-p11.alpha-net.ne.jp (kyoto-tc012-p11.alpha-net.ne.jp [210.237.119.139])
	by m08.alpha-net.ne.jp (8.9.3/3.7W) with ESMTP id EAA20920
	for <FreeBSD-gnats-submit@FreeBSD.org>; Sat, 29 Jul 2000 04:26:31 +0900 (JST)
Received: from souffle.bogus-local.net (souffle.bogus-local.net [192.168.1.1])
	by kyoto-tc012-p11.alpha-net.ne.jp (Postfix) with ESMTP id E84183D5E
	for <FreeBSD-gnats-submit@FreeBSD.org>; Sat, 29 Jul 2000 04:26:50 +0900 (JST)
Message-Id: <86ya2mf43p.wl@cheerful.com>
Date: Sat, 29 Jul 2000 04:26:50 +0900
From: FUJISHIMA Satsuki <k5@cheerful.com>
To: FreeBSD-gnats-submit@FreeBSD.org
Subject: libtool ldconfig and shlibs

>Number:         20270
>Category:       ports
>Synopsis:       libtool needlessly runs ldconfig after install shlibs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ade
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 28 12:30:01 PDT 2000
>Closed-Date:    Fri Jun 04 10:46:45 PDT 2004
>Last-Modified:  Fri Jun 04 10:46:45 PDT 2004
>Originator:     FUJISHIMA Satsuki
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
N/A
>Environment:
>Description:

	libtool installed with ports/devel/libtool runs ldconfig when
	shared library installed. This is FreeBSD specific, and now
	bsd.port.mk handles this properly. So libtool doesn't need to run
	ldconfig.

	I found this behavior of libtool when I work with audio/xmms port
	(ports/20261). This port installs some sharelibs as plugin module
	into ${X11BASE}/lib/xmms/* and libtool runs ldconfig -m there.

	The problem happens when you deinstall this port; pkg_delete
	removes all plugins and directories and then try to ldconfig -R.
	Of course there are no such directories and complains:

===>  Deinstalling for xmms-1.2.2
ldconfig: /usr/X11R6/lib/xmms/Output: No such file or directory
ldconfig: /usr/X11R6/lib/xmms/Effect: No such file or directory
ldconfig: /usr/X11R6/lib/xmms/General: No such file or directory
ldconfig: /usr/X11R6/lib/xmms/Visualization: No such file or directory

	So I think that ldconfig run by libtool is overkill.

>How-To-Repeat:

o make audio/xmms WITH patch ports/20261 applied.
/usr/ports/audio/xmms# make install
<< successfully installed >>

/usr/ports/audio/xmms# ldconfig -r|head -2
/var/run/ld-elf.so.hints:
        search directories: /usr/lib:/usr/lib/compat:/usr/X11R6/lib:/usr/local/lib:/usr/X11R6/lib/xmms/Input:/usr/X11R6/lib/xmms/Output:/usr/X11R6/lib/xmms/Effect:/usr/X11R6/lib/xmms/General:/usr/X11R6/lib/xmms/Visualization

o then remove this package.
/usr/ports/audio/xmms# make deinstall
ldconfig: /usr/X11R6/lib/xmms/Output: No such file or directory
ldconfig: /usr/X11R6/lib/xmms/Effect: No such file or directory
ldconfig: /usr/X11R6/lib/xmms/General: No such file or directory
ldconfig: /usr/X11R6/lib/xmms/Visualization: No such file or directory

>Fix:

Index: patches/patch-ac
===================================================================
RCS file: /home/ncvs/ports/devel/libtool/patches/patch-ac,v
retrieving revision 1.9
diff -u -w -B -b -r1.9 patch-ac
--- patches/patch-ac	2000/04/02 08:26:22	1.9
+++ patches/patch-ac	2000/07/28 19:24:02
@@ -1,5 +1,5 @@
---- ltconfig.orig	Tue Dec  7 13:50:48 1999
-+++ ltconfig	Mon Jan 17 16:31:24 2000
+--- ltconfig.orig	Wed Dec  8 06:50:48 1999
++++ ltconfig	Sat Jul 29 04:23:46 2000
 @@ -169,7 +169,7 @@
  # Constants:
  PROGRAM=ltconfig
@@ -90,7 +90,7 @@
  file_magic_cmd=
  file_magic_test_file=
  deplibs_check_method='unknown'
-@@ -1874,18 +1877,21 @@
+@@ -1874,18 +1877,20 @@
    case "$version_type" in
      freebsd-elf*)
        deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
@@ -116,11 +116,10 @@
 +  fi 
 +  need_version=no
 +  need_lib_prefix=no
-+  finish_cmds='/usr/bin/env OBJFORMAT="'"$objformat"'" /sbin/ldconfig -m $libdir'
    shlibpath_var=LD_LIBRARY_PATH
    case "$host_os" in
    freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*)
-@@ -2776,6 +2782,15 @@
+@@ -2776,6 +2781,15 @@
  
  # Shell to use when invoking shell scripts.
  SHELL=$LTSHELL

>Release-Note:
>Audit-Trail:

From: Jeremy Lea <reg@FreeBSD.ORG>
To: FUJISHIMA Satsuki <k5@cheerful.com>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: ports/20270: libtool ldconfig and shlibs
Date: Mon, 31 Jul 2000 00:06:18 -0700

 Hi,
 
 On Sat, Jul 29, 2000 at 04:26:50AM +0900, FUJISHIMA Satsuki wrote:
 > 	libtool installed with ports/devel/libtool runs ldconfig when
 > 	shared library installed. This is FreeBSD specific, and now
 > 	bsd.port.mk handles this properly. So libtool doesn't need to run
 > 	ldconfig.
 
 Well yes, and no.  Any ports specific behaviour in libtool is controled
 by command line options, so I'd have to add one for not running
 ldconfig when it's run from bsd.port.mk.
 
 > 	The problem happens when you deinstall this port; pkg_delete
 > 	removes all plugins and directories and then try to ldconfig -R.
 > 	Of course there are no such directories and complains:
 > 
 > ===>  Deinstalling for xmms-1.2.2
 > ldconfig: /usr/X11R6/lib/xmms/Output: No such file or directory
 > ldconfig: /usr/X11R6/lib/xmms/Effect: No such file or directory
 > ldconfig: /usr/X11R6/lib/xmms/General: No such file or directory
 > ldconfig: /usr/X11R6/lib/xmms/Visualization: No such file or directory
 > 
 > 	So I think that ldconfig run by libtool is overkill.
 
 It's also harmless.  Other than in this case.  I think we have multiple
 problems here:
 
 1.  ldconfig should be ignoring non existant directories.
 2.  bsd.port.mk should run ldconfig before @dirrms.
 3.  libtool shouldn't be running ldconfig for modules (xmms's plugins
 are compiled with --avoid-version).
 
 I'll fix the last problem.
 
 Regards,
  -Jeremy
 
 -- 
 FreeBSD - Because the best things in life are free...
                                            http://www.freebsd.org/
 

From: FUJISHIMA Satsuki <k5@cheerful.com>
To: reg@FreeBSD.ORG
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: ports/20270: libtool ldconfig and shlibs
Date: Mon, 31 Jul 2000 23:51:46 +0900

 At Mon, 31 Jul 2000 00:06:18 -0700,
 Jeremy Lea <reg@FreeBSD.ORG> wrote:
 > It's also harmless.  Other than in this case.  I think we have multiple
 > problems here:
 > 
 > 1.  ldconfig should be ignoring non existant directories.
 > 2.  bsd.port.mk should run ldconfig before @dirrms.
 > 3.  libtool shouldn't be running ldconfig for modules (xmms's plugins
 > are compiled with --avoid-version).
 > 
 > I'll fix the last problem.
 
 (1) This would be harmful. we would be hard to find a typo such as
     "/usr/X11R6/lbi", so current behavior is better.
 
 (2) Hmm, binaries linked against libraries installed non-standard
     place should be linked with -rpath doesn't it(and don't ldconfig -m
     its directory)? This is a design issue of FreeBSD system (ldconfig
     VS -rpath) so leave it as is for now. :-)
 
 (3) This is good solusion I think.
 
 BTW, would you please update libtool to 1.3.5 if it is better than 1.3.4?
 
 -- 
 FUJISHIMA Satsuki
 
Responsible-Changed-From-To: freebsd-ports->reg 
Responsible-Changed-By: ade 
Responsible-Changed-When: Sun Sep 17 11:13:38 PDT 2000 
Responsible-Changed-Why:  
Over to maintainer (yes, I read the audit trail again :) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20270 
Responsible-Changed-From-To: reg->ade 
Responsible-Changed-By: ade 
Responsible-Changed-When: Sun Jan 19 20:50:10 PST 2003 
Responsible-Changed-Why:  
I'll be looking at all things libtool prior to 4.8-RELEASE 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20270 
State-Changed-From-To: open->analyzed 
State-Changed-By: ade 
State-Changed-When: Mon Jun 30 13:12:05 PDT 2003 
State-Changed-Why:  
Will be dealt with as part of ongoing work with gnu building tools 
in general. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20270 
State-Changed-From-To: analyzed->closed 
State-Changed-By: ade 
State-Changed-When: Fri Jun 4 10:44:12 PDT 2004 
State-Changed-Why:  
Unfortunately, with the recent major changes to the autotools ports 
infrastructure, this PR would have to have extensive rebuilding work. 

If you believe this is still a problem, please submit a new PR against 
the updated bsd.autotools.mk as of today (June 4 2004) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20270 
>Unformatted:
