From 994010511da947c6069200b87f89352082a7082e Mon Sep 17 00:00:00 2001 From: "W. Eric Norum" Date: Tue, 1 Apr 2003 16:24:51 +0000 Subject: [PATCH] Converted to HTML. --- documentation/README.darwin | 131 ------------------------------------ 1 file changed, 131 deletions(-) delete mode 100644 documentation/README.darwin diff --git a/documentation/README.darwin b/documentation/README.darwin deleted file mode 100644 index 2e36ce0a3..000000000 --- a/documentation/README.darwin +++ /dev/null @@ -1,131 +0,0 @@ -Installation notes for EPICS on Mac OS X (Darwin). -================================================== - -$Id$ - -EPICS Base -========== -1) To build base set the EPICS_HOST_ARCH environment variable to darwin-ppc - and run make in the top-level source directory. The scripts in the - base/startup directory can do this for you. For example, here's what's - in my Bash login script (~/.bash_login): - # - # EPICS - # - EPICS_BASE="${HOME}/src/EPICS/work/epics/base" - EPICS_EXTENSIONS="${HOME}/src/EPICS/work/epics/extensions" - . "${EPICS_BASE}"/startup/Site.profile - -2) As distributed, EPICS on Mac OS X uses the default command line input - routines. IOC applications are much more pleasant to interact with if - either the readline or libtecla input libraries is used. The easiest - way to get either or both of these libraries on to your system is to - download and install them using the Fink package manager which may be - found at: - http://fink.sourceforge.net/ - -3) If broadcasts are not seen locally, try adding "localhost" (127.0.0.1) - to the EPICS_CA_ADDR_LIST. - -EPICS Extensions -================ -Many extensions build and run properly on OS X. To build and run medm, first -obtain the X11 run-time and developer packages from Apple and the OpenMotif3 -package from Fink. - -Objective-C -=========== -Code written in Objective-C can be included in host or IOC applications. -Here are a couple of short Objective-C examples which can be used to send -AppleScript events to other applications on the OS X machine. - -============================================================================== - -/* - * exampleAppleScriptRecord.m - * - * Simple Objective-C/AppleScript subroutine record - * - * To use this record in an application: - * - * 1) Make the following changes to the application Makefile: - * - Add exampleAppleScriptRecord.m to the application SRCS. - * - Add -framework Foundation to the application LDFLAGS. - * 2) Add the following line to the application database description: - * function(exampleAppleScriptProcess) - * 3) Add a record to the application database: - * record(sub,"setVolume") - * { - * field(SNAM,"exampleAppleScriptProcess") - * } - */ -#import -#include -#include -#include -#include - -/* - * Shim between EPICS and NSAppleScript class. - */ -long -exampleAppleScriptProcess(struct subRecord *psub) - { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSDictionary *err; - NSAppleScript *nsa; - - nsa = [[NSAppleScript alloc] initWithSource:[NSString stringWithFormat: - @"tell application \"Finder\" to set volume %g\n", psub->a]]; - if ([nsa executeAndReturnError:&err] == nil) { - errlogPrintf("Failed to run AppleScript: %s\n", - [[err objectForKey:NSAppleScriptErrorMessage] cString]); - recGblSetSevr(psub, SOFT_ALARM, INVALID_ALARM); - } - [nsa release]; - [pool release]; - return 0; -} - - -============================================================================== -/* - * runAppleScript.m - * - * Simple Objective-C/AppleScript shim to allow EPICS application to - * send arbitrary AppleScript messages to other applications. - * - * To use this subroutine in an application make the following - * changes to the application Makefile: - * - Add runAppleScript.m to the application SRCS. - * - Add -framework Foundation to the application LDFLAGS. - */ -#import -#include - -int -runAppleScript(const char *format, ...) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSString *script; - NSMutableDictionary *err; - NSAppleScript *nsa; - va_list args; - int ret = 0; - - va_start(args, format); - script = [[NSString alloc] initWithFormat: - [NSString stringWithCString:format] arguments:args]; - va_end(args); - err = [NSMutableDictionary dictionaryWithCapacity:10]; - nsa = [[NSAppleScript alloc] initWithSource:script]; - if ([nsa executeAndReturnError:&err] == nil) { - errlogPrintf("Failed to run AppleScript: %s\n", - [[err objectForKey:NSAppleScriptErrorMessage] cString]); - ret = -1; - } - [script release]; - [nsa release]; - [pool release]; - return ret; -}