[build2] how to hook "libtool" Inside the building and linking process ?

Christian Montanari cp.montanari at tiscali.co.uk
Thu Jul 12 20:49:26 UTC 2018

On Thu, Jul 12, 2018 at 12:53:33PM +0200, Boris Kolpackov wrote:
> Christian Montanari <cp.montanari at tiscali.co.uk> writes:
> > I was thinking of the GNU libtool mainly; this would solve my linking
> > of dynamic libraries under cygwinshen-bsd-gnulix ...
> To use libtool as a linker you would need to implement a custom build2
> rule.
ok what would be the example to follow? I saw that in odb, 
actualy LT_INIT is called in a post formated configure.ac.  is this the solution: to
delegate the job to autoconf? 
> The question, of course, is why would you want to? I.e., what problems
> do you have with the built-in link rule which, in many ways, is build2's
> solution to the same problem that GNU libtool tries to solve?

utlimatly I wanted an easy way out to compile a dynamic library under
cygwin. your tool does only procure a way to generate cyg*.dll
under windoz, is there a nice way to compile -fpic, and bring those cyg{butl,pkgconf}.dll
to life. I tried to compile b.exe under cygwin, and it flopped
rejecting those nice so shared librarie, even with this b.exe linked
like that :
$ ldd /usr/local/bin/b.exe
        ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffbae960000)
        KERNEL32.DLL => /cygdrive/c/WINDOWS/System32/KERNEL32.DLL (0x7ffbae870000)
        KERNELBASE.dll => /cygdrive/c/WINDOWS/System32/KERNELBASE.dll (0x7ffbaad90000)
        cygwin1.dll => /usr/bin/cygwin1.dll (0x180040000)
        cyggcc_s-seh-1.dll => /usr/bin/cyggcc_s-seh-1.dll (0x3e5f10000)
        cygstdc++-6.dll => /usr/bin/cygstdc++-6.dll (0x3b5060000)
        libpkgconf-1.4.2-a.0.e93731470f80.so => /usr/local/lib/libpkgconf-1.4.2-a.0.e93731470f80.so (0x583ea0000)
        libbutl-0.8.0-a.0.20180707103409.so => /usr/local/lib/libbutl-0.8.0-a.0.20180707103409.so (0x510de0000)

but nop, it does not run...

> > but I guess hopfully the astute Moacs duds must have ported it from the GNU
> > and thus have kept a smilar interface ?
> No, it is a completely different tool.
indeed I had a look; what a shame! GNU is going to survive 1000 eons, but
osx will die with the bite of the apple.
> > what will happen if I stage?:
> >  config.cxx="libtool --mode=compile --tags=c++"
> Not sure what you mean by "stage" here but, in any case, the answer
> is "probably nothing good".
I was just teasing. maybe you can put forward a hint for this special
build2 ruleset?


More information about the users mailing list