#! /bin/sh ## # SWISH++ # config-sh -- Configuration script # # Copyright (C) 1998 Paul J. Lucas # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ## ## # This code is Bourne Shell for maximal portability. ## ########### You shouldn't have to change anything below this line. ############ ME=$0; ME=`expr $ME : '.*/\(.*\)'` USAGE="usage: $ME target.h target.mk compiler [ compiler-options ]" N=3 [ $# -lt $N ] && { echo $USAGE >&2; exit 1; } TARGET_H=$1 TARGET_MK=$2 CC=$3 shift $N CFLAGS="$* -c" DATE=`date` echo echo "$ME: checking C++ compiler $CC" trap "rm -f *.o $TARGET_H $TARGET_MK; exit 1" 0 1 2 15 ########## .h target preamble ################################################# cat > $TARGET_H < $TARGET_MK <> $TARGET_H value=`echo $definition | cut -f2 -d' '` echo "$symbol:=$value" >> $TARGET_MK } for file in src/*.c do echo "+ checking for \"`grep TEST $file | cut -f3-`\"..." if $CC $CFLAGS $file >/dev/null 2>/dev/null then define PASS continue fi if grep ERROR $file >&- 2>&- then echo '------------------------------------------------------------------------------' grep ERROR $file | cut -f3- echo '------------------------------------------------------------------------------' exit 1 fi define FAIL done echo ########## .h target epilogue ################################################# cat >> $TARGET_H <