summaryrefslogtreecommitdiff
path: root/language/japanese/ptex/configure
diff options
context:
space:
mode:
Diffstat (limited to 'language/japanese/ptex/configure')
-rw-r--r--language/japanese/ptex/configure47
1 files changed, 47 insertions, 0 deletions
diff --git a/language/japanese/ptex/configure b/language/japanese/ptex/configure
new file mode 100644
index 0000000000..fb1b680d30
--- /dev/null
+++ b/language/japanese/ptex/configure
@@ -0,0 +1,47 @@
+#!/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