standalone executable on Mac OS X (as independent as possible from user's system)

Stijn Heymans <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CAF79SBWtL-Dpi4ZiEt-wa9jEKkotZug677UNiZ3Xg3cUvhzZ9w@mail.gmail.com>
Hi:

I'm working on Mac OS X to get a standalone executable out of my swi-prolog
version ( SWI-Prolog version 6.4.1 for x86_64-darwin11.4.2).

My goal is to have that executable as independent from the particular Mac
installation of users as possible (so I cannot assume they have SWI-Prolog
installed, I can
also not assume they have XCode developer tools installed).

My executable was produced as follows:

swipl --goal="server(7000)" --stand_alone=true --foreign=save -o server_pl
-c server.pl

and swipl itself was configured to compile with "--disable-readline",
"--disable-shared", "--disable-gmp".

This got the dependencies nicely down to 2:

$ otool -L server_pl
server_pl:
    /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current
version 5.4.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 159.1.0)

How can I get these particular dependencies out? I would be ok providing
them
in the same directory as I have server_pl (and that approach actually works
for
Windows and DLLs so that's great), but on my Mac I seem to be unable to
ensure that I can tell
the executable that the dependent libraries will be in a directory relative
to
that executable.

Note that things like install_name_tool (to replace libraries in
executables --
similar as chrpath on linux) results in:

$ install_name_tool -rpath /usr/lib/libncurses.5.4.dylib
@executable_path/./libncurses.5.4.dylib server_pl
install_name_tool: the __LINKEDIT segment does not cover the end of the
file (can't be processed) in: server_pl

Other things I was thinking of is changing the DYLD_LIBRARY_PATH but
server_pl
contains absolute paths to libncurses.5.6.dylib it seems.

Any pointers very welcome!!

Stijn

PS: I do not actually need ncurses I think as my executable is a server
without
need for terminal capabilities so if there is an option to compile prolog
without those (--disable-ncurses for configure does not seem to work), I'd
like
to hear about that too..
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.