bug-libtool
[Top][All Lists]
Advanced

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

Re: Library name is substitute in the execute mode.


From: Nicolas Pierron
Subject: Re: Library name is substitute in the execute mode.
Date: Thu, 24 Jul 2008 13:56:24 +0200

Hi,

I forgot to specify that I am currently using libtool 1.5.26
(1.1220.2.492 2008/01/30 06:40:56)

On Wed, Jul 23, 2008 at 16:13, Nicolas Pierron
<address@hidden> wrote:
> Hi,
>
> I am currently writing a stage compilation for a compiler.  This
> compiler use libtool to generate libraries and therefore expect to
> have file with the extension ".la" on the command line.  To test this
> compiler we use "libtool --mode=execute" to choose the dynamic
> libraries corresponding to the compiler stage.
>
> The problem is that we have to test if the compiler can correctly
> generate libraries.  This leads us to the following command line
>
> libtool --mode=execute ... compiler file.la
>
> where "file.la", which should be generated by the compiler via
> libtool, is substitute by something else.  Therefore it is not
> possible to test this part of the compiler.

I have made a small shell script to get what I would have expect from libtool.
This script uses the current behaviour to retrieve the name of the
program.  It runs libtool with the env binary to fetch the environment
modifications and to pass them to the program.

.----------------- libtool_execute
| #! /bin/sh
|
| ltargs=""
| while test "$1" == "-dlopen"; do
|   ltargs="$ltargs
|   $1
|   $2"
|   shift; shift;
| done
| prog=$1
| shift
|
| # Retrieve the program name
| ltprog=$(${LIBTOOL} --mode=execute echo $prog)
|
| # Patch the environment before executing the program.
| env $(env -i PATH=$PATH ${LIBTOOL} --mode=execute $ltargs env) $ltprog $@
`-----------------

$ libtool --mode=execute -dlopen file.la echo file.la
/the/path/to/the/file/directory
$ LIBTOOL=libtool libtool_execute -dlopen file.la echo file.la
file.la

Cheers,

-- 
Nicolas Pierron
- If you are doing something twice then you should try to do it once.




reply via email to

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