Am 08.09.2011 um 14:14 schrieb Julien Rioux:

> On 08/09/2011 10:12 AM, Enrico Forestieri wrote:
>> On Thu, Sep 08, 2011 at 01:59:23AM +0200, jri...@lyx.org wrote:
>>> Author: jrioux
>>> Date: Thu Sep  8 01:59:23 2011
>>> New Revision: 39643
>>> URL: http://www.lyx.org/trac/changeset/39643
>>> 
>>> Log:
>>> * configure.py : Fix the detection of tex2lyx when running in-place (#6986).
>>> Remove the hack with os.environ and instead directly search for
>>> ../src/tex2lyx/tex2lyx relative to where configure.py is found.
>>> 
>>> Modified:
>>>    lyx-devel/trunk/lib/configure.py
>>> 
>>> Modified: lyx-devel/trunk/lib/configure.py
>>> ==============================================================================
>>> --- lyx-devel/trunk/lib/configure.py        Thu Sep  8 01:59:14 2011        
>>> (r39642)
>>> +++ lyx-devel/trunk/lib/configure.py        Thu Sep  8 01:59:23 2011        
>>> (r39643)
>>> @@ -617,24 +617,21 @@
>>> 
>>>      checkLuatex()
>>> 
>>> -    ''' If we're running LyX in-place then tex2lyx will be found in
>>> -            ../src/tex2lyx. Add this directory to the PATH temporarily and
>>> -            search for tex2lyx.
>>> -            Use PATH to avoid any problems with paths-with-spaces.
>>> -    '''
>>> -    path_orig = os.environ["PATH"]
>>> -    os.environ["PATH"] = os.path.join('..', 'src', 'tex2lyx') + \
>>> -        os.pathsep + path_orig
>>> +    # Look for tex2lyx in this order (see bugs #3308 and #6986):
>>> +    #   1)  If we're running LyX in-place then tex2lyx will be found
>>> +    #       in ../src/tex2lyx with respect to the srcdir.
>>> +    #   2)  If LyX was configured with a version suffix then tex2lyx
>>> +    #       will also have this version suffix.
>>> +    #   3)  Otherwise always use tex2lyx.
>>> +    in_place = os.path.join('srcdir', '..', 'src', 'tex2lyx', 'tex2lyx')
>>> +    in_place = os.path.abspath(in_place)
>> 
>> You should not put single quotes around srcdir.
> 
> Fixed, thanks. I tested but committed on a different machine and forgot this 
> fixup.
> 
>> However, this is still
>> going to fail as I think that nobody builds lyx directly in srcdir, i.e.,
>> srcdir != builddir and thus the in-place tex2lyx will not be found, still.
>> 
> 
> I do build in-place, so that makes at least one person. I think I always just 
> followed what's described in README, INSTALL, and INSTALL.autoconf
> 
>> The only solution I foresee is adding another option to configure.py
>> (--with-tex2lyx /path/to/tex2lyx) and letting lyx call it using this
>> option, as lyx knows whether it has been called in place and where this
>> place is.
>> 
> 
> Autoconf preserves the directory structure. Do scons and cmake preserve the 
> directory structure? Then passing --builddir would be sufficient and might be 
> more versatile in case we need to look for more stuff besides just tex2lyx.

Maybe I miss something, but Cmake doesn't preserve the directory structure on 
Mac. Here I get the binaries in the following directory tree:

$builddir/src/tex2lyx/lyx.build/Debug/tex2lyx.build/Objects-normal/i386/tex2lyx.o
...
$builddir/bin/Debug/LyX
$builddir/bin/Debug/tex2lyx
...

Stephan

Reply via email to