Boost logo

Boost :

Subject: Re: [boost] [BCP] Script for global renaming Boost Namespace
From: Bjørn Roald (bjorn_at_[hidden])
Date: 2009-05-30 14:11:11


Hi,

Interesting, I did something similar as a C++ patch to bcp some years ago. I
think there is interest for such a feature, especially if you are willing to
maintain it on regular basis.

I had a quick look at your code, it locks like you do similar stuff to what I
did. I have not tested it. If we do expect all possible users to have Python
installed, it may be nice to use python for this. But how do you propose to
integrate with bcp?

There should be some discussions on the list if you are interested. Google
"bcp replace_namespace".

-- 
Bjørn Roald 
On Saturday 30 May 2009 10:55:25 am Artyom wrote:
> Hello,
>
> Some updates:
> -------------
>
> 1. Added copyright - Boost License.
> 2. Some more regression tests passed, some code cleanup
>
> Questions:
> ----------
>
> 1. How can I submit it as an addon to BCP utility?
> 2. Have anybody tested it, I'd like to see if there any problems,
>    especially on Windows platform -- I hadn't tested it there.
>
>
> Thanks
>   Artyom
>
> P.S.: The source is there http://art-blog.no-ip.info/files/rename.py
>
> --- On Mon, 5/25/09, Artyom <artyomtnk_at_[hidden]> wrote:
> > From: Artyom <artyomtnk_at_[hidden]>
> > Subject: [BCP] Script for global renaming Boost Namespace
> > To: boost_at_[hidden]
> > Date: Monday, May 25, 2009, 11:14 AM
> > Hello,
> >
> > Today Boost does not provide any backward binary
> > compatibility. This
> > makes big problems in shipping 3rd part libraries that
> > depend on Boost
> > because library user must use the same version of Boost as
> > that 3rd
> > part library was compiled with.
> >
> > The problem is become even more critical for ELF platforms
> > (UNIXes)
> > where all symbols are exported by default.
> >
> > I had written a small Python script that switches boost
> > namespace
> > to other, allowing 3rd part project include it without
> > collisions
> > with primary Boost namespace.
> >
> > The script passes over the source tree of boost and changes
> > each
> > include path from <boost/foo/bar.hpp> too
> > <newnamespace/foo/bar.hpp>
> > and renames all macros and identifiers from
> > some_BOOST_something to
> > some_NEWNAMESPACE_something and some_boost_something to
> > some_newnamespace_something.
> >
> > It does not touch comments (copyright) and strings unless
> > the string
> > is in form "boost/.*" which is usually some reference for
> > include.
> >
> > I've run this script on the 1.39 version of boost and
> > successfully build full boost release and run some of
> > regression tests
> > like Boost.Asio, Boost.Regex, Boost.Function and others,
> >
> > The source code is available at:
> > http://art-blog.no-ip.info/files/rename.py
> >
> > You run it as:
> >
> >    ./rename /path/to/boost/source
> > new_namespace_name
> >
> > It renames all macros and namespaces to new namespace, and
> > renames
> > main include directory to new_namespace_na,e.
> >
> > Few points:
> >
> > 1. It is only alpha version script, I just want to see
> > feedback and
> >    proposals
> > 2. I do not update build scripts. I assume that each
> > library that
> >    tryes to import its own version of Boost
> > would provide its own
> >    build system.
> > 3. The build scripts should be updated differently because
> > they have
> >    different syntax and grammar. The
> > required changes are to
> >    fix different build defines
> >
> > Please, give feedback proposal. If there someone who is
> > familiar
> > with Boost.Build systems can actually help, this would be
> > very good.
> >
> > Today there is a big problem with working with different
> > versions of
> > Boost. It should be solved.
> >
> > I think this script may be a valuable addition to
> > Boost.BCP  utility
> > that allows extracting a subset of boost for integration in
> > 3rd part
> > tools and libraries.
> >
> > Thanks,
> >   Artyom
> >
> >
> >      
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk