diff options
author | Simon Howard | 2011-09-11 23:40:44 +0000 |
---|---|---|
committer | Simon Howard | 2011-09-11 23:40:44 +0000 |
commit | efd15d965dee947a04727bb62f4e2092cf28732f (patch) | |
tree | 730d99c1e88d5e3145e552ad69dec52d30026d01 /pkg/osx/Execute.m | |
parent | 4d17ab361e90a75dc6deefd37e6eb2ba0610b386 (diff) | |
parent | 11024d8214580d63ca7a9e70a121f5ff542a2fce (diff) | |
download | chocolate-doom-efd15d965dee947a04727bb62f4e2092cf28732f.tar.gz chocolate-doom-efd15d965dee947a04727bb62f4e2092cf28732f.tar.bz2 chocolate-doom-efd15d965dee947a04727bb62f4e2092cf28732f.zip |
Merge from raven-branch.
Subversion-branch: /branches/strife-branch
Subversion-revision: 2367
Diffstat (limited to 'pkg/osx/Execute.m')
-rw-r--r-- | pkg/osx/Execute.m | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/pkg/osx/Execute.m b/pkg/osx/Execute.m index 608443e2..0dcfbb7c 100644 --- a/pkg/osx/Execute.m +++ b/pkg/osx/Execute.m @@ -175,6 +175,19 @@ void OpenTerminalWindow(const char *doomwadpath) fprintf(stream, "#!/bin/sh\n"); //fprintf(stream, "set -x\n"); fprintf(stream, "PATH=\"%s:$PATH\"\n", executable_path); + + // MANPATH is set to point to the directory within the bundle that + // contains the Unix manpages. However, the bundle name or path to + // it can contain a space, and OS X doesn't like this! As a + // workaround, create a symlink in /tmp to point to the real directory, + // and put *this* in MANPATH. + + fprintf(stream, "rm -f \"/tmp/%s.man\"\n", PACKAGE_TARNAME); + fprintf(stream, "ln -s \"%s/man\" \"/tmp/%s.man\"\n", + executable_path, PACKAGE_TARNAME); + fprintf(stream, "MANPATH=\"/tmp/%s.man:$(manpath)\"\n", PACKAGE_TARNAME); + fprintf(stream, "export MANPATH\n"); + fprintf(stream, "DOOMWADPATH=\"%s\"\n", doomwadpath); fprintf(stream, "export DOOMWADPATH\n"); fprintf(stream, "rm -f \"%s\"\n", TEMP_SCRIPT); @@ -206,3 +219,13 @@ void OpenTerminalWindow(const char *doomwadpath) withApplication: @"Terminal"]; } +void OpenDocumentation(const char *filename) +{ + NSString *path; + + path = [NSString stringWithFormat: @"%s/Documentation/%s", + executable_path, filename]; + + [[NSWorkspace sharedWorkspace] openFile: path]; +} + |