Portable executable (libs)

Discussion in 'Web Design and Development' started by DenBeke, Dec 5, 2015.

  1. DenBeke macrumors regular

    Joined:
    Aug 11, 2011
    Location:
    Antwerp
    #1
    Are there tools available that make an executable portable by getting all the libraries, putting them in a folder and change the paths in the executable?

    I want to be able to give a folder with an executable to someone else, who hasn't any developer tools/SDK's.

    How to solve this?
     
  2. 0d085d macrumors regular

    Joined:
    Apr 23, 2015
    #2
    Possibly with the patchelf tool: https://nixos.org/patchelf.html

    You'll want to set the linker search path as in the example:

    Code:
    patchelf --set-rpath /opt/my-libs/lib:/foo/lib executable
    You can list the libraries used by the executable if you don't already know them:

    Code:
    ldd executable
     
  3. DenBeke thread starter macrumors regular

    Joined:
    Aug 11, 2011
    Location:
    Antwerp
    #3
    What does
    What does the tool actually do?
    And I suppose I'll need to use otool on OS X, since ldd is for Linux?
     
  4. 0d085d, Dec 5, 2015
    Last edited: Dec 6, 2015

    0d085d macrumors regular

    Joined:
    Apr 23, 2015
    #4
    Sorry, my whole answer was Linux specific... clearly wasn't paying enough attention.

    I *think* install_name_tool is what you need on OS X:

    Code:
    install_name_tool -add_rpath /path/to/library/files executable
    Yep.
    Code:
    otool -L executable
     
  5. DenBeke thread starter macrumors regular

    Joined:
    Aug 11, 2011
    Location:
    Antwerp
    #5
    Well it's good to have the Linux solution as well :)

    I was hoping for a fully automated solution, but no problem, I'll try to specify all library paths manually...
     
  6. 0d085d macrumors regular

    Joined:
    Apr 23, 2015
    #6
    You can just give the path to a directory containing the libraries - doesn't have to be each individual library.
     
  7. 960design macrumors 68020

    Joined:
    Apr 17, 2012
    Location:
    Destin, FL
    #7
    Not enough coffee this morning, because I'm just not understanding your use case or need here. So, of course I'll just throw a bunch of junk at it: GitHub? I use Inno for Windows deployments and just create pkg ( dmg ) files for Mac deployments of software.
     

Share This Page