#! /bin/sh # This script has been known to work with pfe-33 and: # Mac OS X 10.5.6 (ppc) gcc 4.0.1 # Mac OS X 10.6.4 (intel) gcc 4.2.1 # --dnw 25Jun2010 # Compile, link, and install the pfe loadable module $1.so from # source files in the current directory: $1-ext.c, $1-dll.c, # and $1-ext.h. # We constructed the script from the output of pfe "make" with # --silent removed from the LIBTOOL line in Makefile in the # build directory. # In the following, -m32 prevents defaulting to 64 bits in Snow # Leopard, and is redundant in Leopard. # Define the appropriate prefix: PREFIX=/usr/local # PREFIX=$HOME # These directories must already exist. INCLUDEDIR=$PREFIX/include LIBDIR=$PREFIX/lib/pfe-forth # compile # cc -I. -I$INCLUDEDIR -I. -DHAVE_CONFIG_H \ -DNDEBUG -O3 -fomit-frame-pointer -frounding-math -DUNROLL_NEXT -m32 \ -Wall -pipe -funsigned-char -Wno-char-subscripts -Wwrite-strings \ -no-cpp-precomp -fno-common \ -c -o $1-ext.o $1-ext.c cc -I. -I$INCLUDEDIR -I. -DHAVE_CONFIG_H \ -DNDEBUG -O3 -fomit-frame-pointer -DUNROLL_NEXT -m32 \ -Wall -pipe -funsigned-char -Wno-char-subscripts -Wwrite-strings \ -no-cpp-precomp -fno-common \ -c -o $1-dll.o $1-dll.c # link cc -bundle -flat_namespace -undefined suppress -m32 \ -std=c99 -pedantic \ -lm -lmx -o $1.so $1-dll.o $1-ext.o # install cp -p $1.so $LIBDIR /usr/bin/install -p $1.so $LIBDIR cp -p $1-ext.h $INCLUDEDIR