Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Build a project composed by multiple shared libs
Build a project composed by multiple shared libs [message #41762] Fri, 17 January 2014 23:10 Go to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Hi,

I'd like to build a set of shared libs at once. I'm doing it creating a main package that uses some tenths of packages, each of them building a shared lib :

MAIN
 |
 |-- lib1
 |-- lib2
 |-- .....
 |-- libn


I put the SO flag in main package, so all used packages are built as dll. The problem is in naming... in unix dlls should be named 'libXXXXX.so', but inside theide they're named 'MAIN_lib1.so'. If I rename and install the dlls, dependences between them is broken.
For example, if lib2 needs lib1, resulting shared libs are named MAIN_lib1.so and MAIN_lib2.so. If I rename them to liblib1.so and liblib2.so and install them, liblib2.so complains about missing MAIN_lib1.so.

Is there a possibility to force the name of built shared objects ? I know that it works for main package, adding a target, but not found a way for non-main packages.

Ciao

Max
Re: Build a project composed by multiple shared libs [message #41763 is a reply to message #41762] Fri, 17 January 2014 23:54 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Hmmmm... the worse is that .so paths are hardcoded inside executable and between them. Is impossible to move them around.
Re: Build a project composed by multiple shared libs [message #41765 is a reply to message #41762] Sat, 18 January 2014 08:15 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Max,

Would a scripting be possible workaround? You could have a main package for each of your libs, with proper target. Then you'd have a one "super main", that would include all of these packages and a macro file (something.usc). The supermain package doesn't need to be compiled, it would be just used to run the compilation of all the libs.

The macro would be quite simple, something like
macro "Build all libs" Ctrl+Alt+F5 {
    ClearConsole();
    // list of libs to build
    libs = [ "lib1", "lib2", lib3 ]
    for (p in libs) {
        // Get .upp file location for the package
        upp = PackageDir(p) + "/"+p+".upp";
        // Construct the target name
        target = "lib"+p+".so";
        // Build that package with currently set flags
        BuildProject(upp, Flags(), target);
    }
}


I know that it is not really a solution, but it could save you some time before a better way to do it is found Smile

Best regards,
Honza
Re: Build a project composed by multiple shared libs [message #41771 is a reply to message #41765] Sat, 18 January 2014 10:07 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Hi Honza,

thank you for suggestion.... it's not bad, but I guess it doesn't solve the dependencies between shared libs.
I mean.... what happen if lib2 depends on lib1 ?

Ciao

Max
Re: Build a project composed by multiple shared libs [message #41773 is a reply to message #41771] Sat, 18 January 2014 12:34 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

mdelfede wrote on Sat, 18 January 2014 10:07

what happen if lib2 depends on lib1 ?
In that case you'd probably have to take care about it manually in the macro... Ensure the correct compilation order and copy the results to some directory from where the rest of the libs could access it.

So it is probably doable, but even less elegant than before Neutral

Honza
Re: Build a project composed by multiple shared libs [message #41774 is a reply to message #41773] Sat, 18 January 2014 12:37 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Yep.... I think the best way would be t patch GccBuilder to generate libxxxx filenames and remove hardcoded paths inside .so modules....
Previous Topic: IDE debugger hangs on GuiMT example
Next Topic: CTRL-F2 crashes on UBUNTU 12.04 64-Bit
Goto Forum:
  


Current Time: Thu Mar 28 12:06:59 CET 2024

Total time taken to generate the page: 0.01398 seconds