libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: installing modules sans .la file and ugo-x


From: Thien-Thi Nguyen
Subject: Re: installing modules sans .la file and ugo-x
Date: Sat, 22 Mar 2008 20:19:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

() Thien-Thi Nguyen <address@hidden>
() Wed, 19 Mar 2008 09:55:06 +0100

   I would like to install a "module" (ie, package-private shared-object
   library to be loaded by libltdl) sans the .la file and w/ perms -x.
   Sans .la because the package has other mechanisms for keeping track
   of modules (and their dependencies); the .la is superfluous.  Perm -x
   mostly because i'm irrationally paranoid about +x.

BTW, here are some other folks looking to avoid installing the .la file
(they don't mention -x munging, however):

http://permalink.gmane.org/gmane.comp.freedesktop.xcb/3254

I see that libtool needs the .la files for `mode=uninstall', so at the
risk of further annoying the libtool maintainers, below is a shell
script for those foolhardy enough to remove the .la file, that effects a
"libtool --mode=uninstall".  It only works if you have the .la file in
the build tree.  Note that the script "sofix" mentioned in the comments
is part of ttn-do:

http://www.gnuvola.org/software/ttn-do/

and is the "rightfully denounced" program i referred to in the previous
message.  I hope these (pair of) kludges can be useful to other libtool
users, even if they are, you know, kludges.

thi

____________________________________________________________________
#!/bin/sh
# uninstall-sofixed --- manually do "libtool --mode=uninstall"
#
# Copyright (C) 2008 Thien-Thi Nguyen
#
# This program is part of ttn-do, released under the terms of the
# GNU General Public License as published by the Free Software
# Foundation; either version 3, or (at your option) any later
# version.  There is NO WARRANTY.  See file COPYING for details.
##
# Usage: uninstall-sofixed DIR FOO.la...
#
# NOTE: This program does, more or less, the equivalent of
# "libtool --mode=uninstall FOO.la".  It is only necessary if
# "libtool --mode=install" was followed by a call to "sofix".
# This is because libtool (more precisely, GNU Libtool 1.5.26)
# mines the filenames out of the installed .la file, which
# sofix may or may not have deleted previously.
#
# Yes, this is ugly, but so is sofix.
# Such a vicious circle.
#
# Do "sofix --help" for an explanation of DIR and FOO.la...,
# which should be the same as for the sofix invocation.
##

version="1.0"
v () { echo $(basename $0) $version ; echo ; }
usage () { sed '/^##/,/^##/!d;/^##/d;s/^# //g;s/^#$//g' $0 ; }

[ x"$1" = x--help ] && { v ; usage ; exit 0 ; }
[ x"$1" = x--version ] && { v ; exit 0 ; }
[ x"$2" = x ] && { usage ; exit 1 ; }

inst="$1" ; shift

for la ; do
    if [ -r "$la" ] ; then : ; else
        echo No such file: "$la"
        exit 1
    fi
    eval $(sed '/^library_names=/!d' "$la")
    if [ x"$library_names" = x ] ; then : ; else
        ( cd "$inst" && rm -f $library_names )
    fi
done

# uninstall-sofixed ends here





reply via email to

[Prev in Thread] Current Thread [Next in Thread]