#!/bin/sh # progname=`basename $0` termcode= configopt= printUsage () { echo "Usage: $progname {EUC|JIS|SJIS}" exit 1 } if [ ! -f ../config.status ]; then echo "../config.status not found." echo "please make orignal Web2c programs before make pTeX." exit 1 fi # 引数チェック test -z "$*" && printUsage case $1 in [Ss][Jj][Ii][Ss]) termcode="SJIS" ;; [Jj][Ii][Ss]) termcode="JIS" ;; [Ee][Uu][Cc]) termcode="EUC" ;; *) echo "unknown option $1"; printUsage ;; esac CONFIGSED=config.sed echo "s%@configopt@%$*%g" > $CONFIGSED echo "s%@TERMCODE@%$termcode%g" >> $CONFIGSED case $termcode in "SJIS") echo "s%@configkcode@%sjis%g" >> $CONFIGSED ;; "JIS") echo "s%@configkcode@%jis%g" >> $CONFIGSED ;; *) echo "s%@configkcode@%euc%g" >> $CONFIGSED ;; esac echo "creating kanji.h" sed -f $CONFIGSED kanji.h.in > kanji.h # Makefile の作成 CONFIG_FILES=Makefile CONFIG_HEADERS=.. export CONFIG_FILES CONFIG_HEADERS ../config.status TMPFILE=makefile.tmp sed -f $CONFIGSED Makefile > $TMPFILE mv -f $TMPFILE Makefile exit 0