#! /bin/sh # This script has been known to work with Linux 2.4.29 and # gcc 3.3.1 --dnw 20May05 # 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. # Define the appropriate prefix. # PREFIX=/usr/local PREFIX=$HOME # These directories must already exist. INCLUDEDIR=$PREFIX/include LIBDIR=$PREFIX/lib/pfe # compile gcc -DHAVE_CONFIG_H -I. -I$INCLUDEDIR -I. \ -DNDEBUG -O3 -Wall \ -fno-writable-strings -Wwrite-strings -Wstrict-prototypes \ -fno-strict-aliasing -fomit-frame-pointer \ -D_OMIT_FRAME_POINTER -DUNROLL_NEXT \ -c $1-dll.c -fPIC -DPIC -o $1-dll.o gcc -DHAVE_CONFIG_H -I. -I$INCLUDEDIR -I. \ -DNDEBUG -O3 -Wall \ -fno-writable-strings -Wwrite-strings -Wstrict-prototypes \ -fno-strict-aliasing -fomit-frame-pointer \ -D_OMIT_FRAME_POINTER -DUNROLL_NEXT \ -c $1-ext.c -fPIC -DPIC -o $1-ext.o # link gcc -shared $1-dll.o $1-ext.o -ldl -lm -Wl,-soname -Wl,$1.so -o $1.so # install cp -p $1.so $LIBDIR cp -p $1-ext.h $INCLUDEDIR