diff --git a/Makefile b/Makefile index ddf59c29c5..3d81527fc5 100644 --- a/Makefile +++ b/Makefile @@ -15,12 +15,6 @@ else STRIP = strip endif -ifdef NO_UI - X11_UI_LIBS = -else - X11_UI_LIBS = -lfreetype -lGL -lGLU -L/usr/X11R6/lib -lX11 -endif - ifdef CONFIG include $(CONFIG) endif @@ -56,6 +50,10 @@ default: @echo "" @echo "On Unix, pass NO_UI=1 if you don't want to link with the" @echo "X11 and OpenGL libraries." + @echo "" + @echo "On Mac OS X, pass X11=1 if you want to link with the" + @echo "X11 library instead of Cocoa. You will also need to bootstrap" + @echo "Factor with the -no-cocoa -x11 switches." @echo @echo "Also, you might want to set the SITE_CFLAGS environment" @echo "variable to enable some CPU-specific optimizations; this" diff --git a/README.txt b/README.txt index 3d7042bcac..65469f87dc 100644 --- a/README.txt +++ b/README.txt @@ -10,7 +10,8 @@ implementation. It is not an introduction to the language itself. - Compiling Factor - Building Factor - Running Factor on Unix with X11 -- Running Factor on Mac OS X +- Running Factor on Mac OS X - Cocoa UI +- Running Factor on Mac OS X - X11 UI - Running Factor on Windows - Source organization - Community @@ -119,10 +120,11 @@ the following two commands: The latter keeps the terminal listener running. -* Running Factor on Mac OS X +* Running Factor on Mac OS X - Cocoa UI -On Mac OS X, a Cocoa UI is available in addition to the terminal -listener. +On Mac OS X 10.4 and later, a Cocoa UI is available in addition to the +terminal listener. If you are using Mac OS X 10.3, you can only run the +X11 UI, as documented in the next section. The 'f' executable runs the terminal listener: @@ -139,6 +141,22 @@ this point), and the library source into a self-contained Factor.app. Factor.app runs the UI when double-clicked and can be transported between PowerPC Macs. +* Running Factor on Mac OS X - X11 UI + +The X11 UI is available on Mac OS X, however its use is not recommended +since it does not integrate with the host OS. However, if you are +running Mac OS X 10.3, it is your only choice. + +When compiling Factor, pass the X11=1 parameter: + + make macosx-ppc X11=1 + +Then bootstrap with the following pair of switches: + + ./f boot.image.ppc -no-cocoa -x11 + +Now if $DISPLAY is set, running ./f will start the UI. + * Running Factor on Windows If you did not download the binary package, you can bootstrap Factor in diff --git a/vm/Config.macosx b/vm/Config.macosx index 8e35a3a06a..aa65af4ecf 100644 --- a/vm/Config.macosx +++ b/vm/Config.macosx @@ -1,3 +1,8 @@ include vm/Config.unix PLAF_OBJS += vm/os-macosx.o vm/mach_signal.o -LIBS= -lm -framework Cocoa -framework OpenGL -framework AppKit -L/usr/X11R6/lib -lfreetype + +ifdef X11 + LIBS = -lm -framework Foundation $(X11_UI_LIBS) +else + LIBS = -lm -framework Cocoa -framework OpenGL -framework AppKit -L/usr/X11R6/lib -lfreetype +endif diff --git a/vm/Config.unix b/vm/Config.unix index 821ea8394f..0fca1bf1da 100644 --- a/vm/Config.unix +++ b/vm/Config.unix @@ -1 +1,7 @@ PLAF_OBJS = vm/os-unix.o + +ifdef NO_UI + X11_UI_LIBS = +else + X11_UI_LIBS = -lfreetype -lGL -lGLU -L/usr/X11R6/lib -lX11 +endif