libtool
[Top][All Lists]
Advanced

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

Re: Problem with post(un)install cmds


From: Ralf Wildenhues
Subject: Re: Problem with post(un)install cmds
Date: Mon, 22 Jan 2007 20:37:50 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Markus,

* Duft Markus wrote on Mon, Jan 22, 2007 at 08:22:04AM CET:
> 
> I wrote the following two for libtool 1.5.22 and they worked perfectly.
> Now i just copied them over to libtool 2.1a (CVS HEAD), and it doesn't
> seem to work

Please read <http://www.chiark.greenend.org.uk/~sgtatham/bugs.html>
under "it doesn't work".  Show what you did, how it failed, please.
Copy and paste, don't only describe failure.  Post the command that
caused the failure.

> I believe that there is a difference in how libtool executes these
> code snippets, is this correct?? If yes, how can i adapt this, so it
> works with  libtool 2?

Probably the globbing happens too early.

>     postinstall_cmds='base_file=`basename \${file}`~
>         dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo
> \$dlname'\''`~
>         dldir=$destdir/`dirname \$dlpath` ~
>         set dummy `ls -l $dir/\$dlname*.dll` ~

What's this line supposed to set $2 and $3 to?  If that's not one of
your problems, then surely it will be for cross-compilation.

>         while test -n "\${3}" ; do shift; done ~
>         dllname=`basename ${2}` ~

How come in these two lines you escape $2 and $3 differently?
Why do you even do all this shifting and ls -l?  Why not just
    set dummy $dir/\$dlname*.dll
    [dlname=`basename \${\$#}`]

(I haven't tested the escaping here; you probably need a set of [] for
M4-escaping the $#, and the backslashes so that the shell doesn't
interpret too early.)

But still I don't understand what the code is intended to achieve.
There could be unrelated files lying around there matching
  $dlname*.dll

for example a library whose first part of the name equals $dlname.

>         test -d \${dldir}/../bin || mkdir -p \${dldir}/../bin ~
>         $install_prog $dir/$dllname \$dldir/../bin/$dllname ~
>         chmod a+x \$dldir/../bin/$dllname'

>     postuninstall_cmds='dlpath=`$SHELL 2>&1 -c '\''. $file; echo
> \$dlname'\''`~
>         set dummy `ls -l $dir/../bin/\$dlname*.dll` ~
>         while test -n "\${3}" ; do shift; done ~
>         $rm ${2}'

Likewise here.

Hope that helps.

Cheers,
Ralf




reply via email to

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