Bill Janssen <jans...@parc.com> wrote:

> Andi Vajda <va...@apache.org> wrote:
> 
> > > I did patch setuptools, and as you can see below, the config.py says
> > > "Shared=True", so I believe I have shared mode enabled.  I'm certainly
> > > using jcc with the "--shared" switch with no complaints.
> > 
> > Something's off. libjcc.so is not shown in your list.
> > You need to solve that mystery before embedding can proceed.
> > 
> > Andi..
> 
> Looks like the patch failed, and the check doesn't notice that failure.
> I removed setuptools, then re-installed it, then went to build JCC
> again.  It told me I needed the patch, so I tried to apply the patch per
> instructions:
> 
> % sudo patch -d /usr/lib/python2.6/dist-packages -Nup0 < 
> /tmp/pylucene/branches/branch_3x/jcc/jcc/patches/patch.43.0.6c11
> patching file setuptools/extension.py
> patching file setuptools/command/build_ext.py
> Hunk #1 FAILED at 85.
> Hunk #2 succeeded at 177 (offset 7 lines).
> Hunk #3 succeeded at 259 (offset 7 lines).
> 1 out of 3 hunks FAILED -- saving rejects to file 
> setuptools/command/build_ext.py.rej
> %
> 
> The EGG-INFO for "setuptools" says:
> 
> Metadata-Version: 1.0
> Name: setuptools
> Version: 0.6c11
> Summary: xxxx
> Home-page: xxx
> Author: xxx
> Author-email: xxx
> License: xxx
> Description: xxx
> 
> build_ext.py:get_ext_filename() is:
> 
>     def get_ext_filename(self, fullname):
>         filename = _build_ext.get_ext_filename(self,fullname)
>         if fullname not in self.ext_map:
>             return filename
>         ext = self.ext_map[fullname]
>         if isinstance(ext,Library):
>             fn, ext = os.path.splitext(filename)
>             return self.shlib_compiler.library_filename(fn,libtype)
>         elif use_stubs and ext._links_to_dynamic:
>             d,fn = os.path.split(filename)
>             return os.path.join(d,'dl-'+fn)
>         else:
>             return filename
> 
> I believe the patched version should look like this:
> 
>     def get_ext_filename(self, fullname):
>         filename = _build_ext.get_ext_filename(self,fullname)
>         if fullname not in self.ext_map:
>             return filename
>         ext = self.ext_map[fullname]
>         if isinstance(ext,Library):
>             if ext.force_shared and not use_stubs:
>                 _libtype = 'shared'
>             else:
>                 _libtype = libtype
>             fn, ext = os.path.splitext(filename)
>             return self.shlib_compiler.library_filename(fn,_libtype)
>         elif use_stubs and ext._links_to_dynamic:
>             d,fn = os.path.split(filename)
>             return os.path.join(d,'dl-'+fn)
>         else:
>             return filename

After fixing get_ext_filename(), I now have libjcc.so on my Linux box.

Bill

Reply via email to