#!/bin/sh # PROJECT: MusixTeX PreProcessor # FILE : configure # AUTHOR : J. C. Nieuwenhuizen # # copyright (c) FlowerSoft 1995 # --------------------------------------------------------------------------- # ABSTRACT: script to configure mpp and to determine specifics of C++ release # -- case $# in 1) ;; *) echo Usage configure host-name echo " host-name is one of unix, msdos, gnu" exit 1 ;; esac echo "determining C++ release" compile= config=config.h echo > $config case $1 in gnu) compile=g++;; unix) compile=CC;; esac $compile -DTEST -o assign assign.cc; if test ! -x assign then echo "error compiling assign.cc" exit 1 fi #$compile -DTEST -o comma comma.cc; #if test ! -x comma #then # echo "error compiling comma.cc" # exit 1 #fi $compile -DTEST -o postfix postfix.cc; if test ! -x postfix then echo "error compiling postfix.cc" exit 1 fi #$compile -DTEST -o nest.cc if ./assign # true if exit status == 0 then echo "\c" # do nothing else echo "warning: assignment operator has left to right associativity"; echo "#define ASSIGN_LEFT_TO_RIGHT" >> $config fi #if ./comma # true if exit status == 0 #then # echo "\c" # do nothing #else # echo "warning: comma operator groups right to left"; # echo "#define COMMA_RIGHT_TO_LEFT" >> $config #fi #if ./postfix # true if exit status == 0 #then echo "#define POSTFIX_INT int" >> $config; echo "#define DELETE_ARRAY( size ) delete[]" >> $config echo "#define NESTED_IN( Class ) Class::" >> $config #else # echo "warning: old C++ release; please upgrade" # echo "#define POSTFIX_INT" >> $config; # echo "#define DELETE_ARRAY( size ) delete[ size ]" >> $config # echo "#define NESTED_IN( Class )" >> $config #fi #if ./nested #then # echo "#define NESTED_IN( Class ) Class::" >> $config #else # echo "warning: old C++ release; please upgrade" # echo "#define NESTED_IN( Class )" >> $config #fi name=mpp case $1 in gnu) sed -f gnu.sed $name.in > $name.gnu; cp $name.gnu Makefile ;; unix) sed -f unix.sed $name.in > $name.unix; cp $name.unix Makefile ;; msdos) sed -f msdos.sed $name.in > $name.dos; cp $name.dos Makefile.dos; echo > config.h ;; *) echo sorry , you have to make a $1.sed yourself exit 1;; esac echo configured for $1 echo \"make\" for compiling echo \"make INSTALLDIR=PATH install\" for installing in \"PATH\"