compile_et 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. #
  3. #
  4. AWK=gawk
  5. DIR=/croot/krb5_1686930994487/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/share/et
  6. usage="usage: $0 [ -d scriptDir ] [ --textdomain domain [ --localedir dir ] ]"
  7. usage="$usage inputfile.et"
  8. TEXTDOMAIN=
  9. LOCALEDIR=
  10. while [ $# -ge 2 ]; do
  11. if [ "$1" = "-d" ]; then
  12. DIR=$2; shift; shift
  13. elif [ "$1" = "--textdomain" ]; then
  14. TEXTDOMAIN=$2; shift; shift
  15. elif [ "$1" = "--localedir" ]; then
  16. LOCALEDIR=$2; shift; shift
  17. else
  18. echo $usage 1>&2 ; exit 1
  19. fi
  20. done
  21. # --localedir requires --textdomain.
  22. if [ $# -ne 1 -o \( -n "$LOCALEDIR" -a -z "$TEXTDOMAIN" \) ]; then
  23. echo $usage 1>&2 ; exit 1
  24. fi
  25. ROOT=`echo $1 | sed -e s/.et$//`
  26. BASE=`echo "$ROOT" | sed -e 's;.*/;;'`
  27. set -ex
  28. $AWK -f ${DIR}/et_h.awk "outfile=${BASE}.h" "$ROOT.et"
  29. $AWK -f ${DIR}/et_c.awk "outfile=${BASE}.c" "textdomain=$TEXTDOMAIN" \
  30. "localedir=$LOCALEDIR" "$ROOT.et"