* Shell script functions #!/bin/sh testheader () { h=$1 r=`echo $1 | sed 's:[/\.]:_:g' | tr 'a-z' 'A-Z'` echo echo "Checking for header $h..." if test -f /usr/include/$h then echo "Header $h found." echo "#define HAVE_$r 1" else echo "Header $h not found." echo "/* #undef HAVE_$r */" fi } testheader sys/time.h testheader time.h testheader timer.h ############################################################################## * Makefiles building s/w in different directories but sharing the source tree VPATH in makefiles use Makefile.tmpl use sed to autogen the Makefile ranlib encoded in makefiles * Separate build vs. source directories separate sources: 3-way merge problems same dir for binaries: execute diff arch fails