Blame view

tools/sctk-2.4.10/src/sclite/config.in 4.53 KB
8dcb6dfcb   Yannick Estève   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
  dnl Process this file with autoconf to produce a configure script.
  AC_INIT(sclite.c)
  
  dnl Checks for programs.
  AC_PROG_CC
  dnl AC_PROG_INSTALL
  AC_PROG_MAKE_SET
  
  dnl Checks for libraries.
  dnl Replace `main' with a function in -lm:
  AC_CHECK_LIB(m, main)
  
  dnl Checks for header files.
  AC_HEADER_STDC
  AC_CHECK_HEADERS(unistd.h)
  
  dnl If gcc is used, check the system.  If it's any of the below,
  dnl add OPTIONS to CFLAGS
  if test "$CC" = "cc" ; then
      echo "Setting default CFLAGS for Native cc"
      case "`uname -s`" in
  	OSF1)   CFLAGS="$CFLAGS -std1"; export CFLAGS;;
  	HP-UX) CFLAGS="$CFLAGS -Ae"; export CFLAGS;;
      esac
  fi
  
  dnl Checks for typedefs, structures, and compiler characteristics.
  AC_C_CONST
  AC_TYPE_SIZE_T
  
  dnl Checks for library functions.
  dnl AC_FUNC_VPRINTF
  dnl AC_CHECK_FUNCS(strdup)
  dnl AC_CHECK_FUNC(readpipe)
  
  AC_PATH_PROGS(INSTALL, install cp copy)
  
  echo ""
  echo "!!!!!!!!!!!!!   USER INFORMATION NEEDED   !!!!!!!!!!!!!"
  echo "Sclite has the ability to use GNU's 'diff' program as means to"
  echo "align reference and hypothesis strings.  Currently, no evaluations"
  echo "have used GNU-DIFF for alignments, so it may be un-neccessary for"
  echo "you to enable its use.  Also, some versions of GNU's diff, V2.8.1,"
  echo "will not work with GB encoded Mandarin characters and test6 of the"
  echo "test suite will fail."
  echo ""
  echo "    Do you want to enable alignments via GNU's 'diff'.  yes or no"
  echo ""
  ans=""
  while test "$ans" = "" ; do 
  	read ans
  	ans=`echo $ans | tr 'A-Z' 'a-z'`
  	if test "$ans" = "no" ; then
  		echo "Disabling GNU-DIFF alignments"
  	elif test "$ans" = "yes" ; then
  		echo "Enabling GNU-DIFF alignments"
  	else
  		echo "Error: You must respond either yes or no"
  		ans=""
  	fi
  done
  
  CFLAGS_BEFORE_DIFF=$CFLAGS
  if test "$ans" = "yes" ; then
    AC_PATH_PROGS(DIFF, gnudiff diffgnu gdiff diff)
    case "$DIFF" in
      *gdiff)
        # Carefully avoid gdiff for X as found on SGI systems.
        DISPLAY= gdiff /dev/null /dev/null > /dev/null 2>&1 || DIFF=""
        if test -z "$DIFF" ; then
  	  echo "    Not using $DIFF, it's an X window executable"
  	  AC_PATH_PROGS(NDIFF, diff)
  	  DIFF=$NDIFF
        fi
        ;;
    esac
    if test -z "$DIFF" ; then
      echo "Error: Unable to locate 'diff'"
      exit 1
    fi
    echo "    Making sure diff supports '-y'"
    if test ! -z "`$DIFF -y /dev/null /dev/null 2>&1`" ; then
      echo "Error: $DIFF does not support '-y'.  Install GNU's diff"
      exit 1
    fi
    CFLAGS="$CFLAGS -DDIFF_EXE=\\\"\$(GNUDIFF)\\\""
  else
    DIFF=""
  fi
  
  echo ""
  echo "!!!!!!!!!!!!!   USER INFORMATION NEEDED   !!!!!!!!!!!!!"
  echo ""
  echo "In support of the LVCSR/HUB-5 evaluations, a newly defined DP"
  echo "alignment cost function has been incorporated into SCTK.  The cost"
  echo "function is defined to be a function of language model probabilities."
  echo "In order to compute the LM probabilities, the CMU-Cambridge SLM"
  echo "Toolkit - V2 has been included in SCTK.  The compilation including"
  echo "the SLM toolkit is optionally, depending on your needs."
  echo ""
  echo "    Do you want to compile in the CMU-Cambridge SLM toolkit?.  yes or no"
  echo ""
  ans=""
  SLM_DEFS=""
  while test "$ans" = "" ; do 
  	read ans
  	ans=`echo $ans | tr 'A-Z' 'a-z'`
  	if test "$ans" = "no" ; then
  		echo "Disabling Compilation of CMU-Cambridge SLM "
  		SLM_TARGETS=""
  	elif test "$ans" = "yes" ; then
  		echo "Enabling Compilation of CMU-Cambridge SLM "
                  echo "    Checking for Un-expanded tar archive of SLM"
                  if test -f slm_v2.tar ; then
                          echo "        Expanding tar file"
                          tar xf slm_v2.tar
                          rm slm_v2.tar
                  fi
  		echo "    Checking Endian-ness for SLM toolkit"
  		echo 'main(){short s=1; char *b=(char *)&s; printf("%s",(*b==0)?"Big":"Little");}' > x.c
  		$CC $CFLAGS_BEFORE_DIFF x.c -o a.out
  		endian=`./a.out`
  		rm -f a.out x.c
  
  		if test "$endian" = "Little" ; then
  			SLM_DEFS="-DSLM_SWAP_BYTES"
  			echo "        Little-endian machine"
  		else
  			echo "        Big-endian machine"
  		fi
  		CFLAGS="$CFLAGS -DWITH_SLM"
  		SLM_TARGETS="slm_v2/lib/SLM2.a"
  		cat slm_v2/src/makefile.in | \
  			sed "s/@CC@/$CC/" | \
  			sed "s/@SCTK_FLAGS@/$CFLAGS_BEFORE_DIFF/" | \
  			sed "s/@SLM_DEFS@/$SLM_DEFS/"  > slm_v2/src/makefile
  	else
  		echo "Error: You must respond either yes or no"
  		ans=""
  	fi
  done
  
  AC_SUBST(SLM_DEFS)		
  AC_SUBST(SLM_TARGETS)		
  
  dnl Check to see nist.local exists, if it does, define AT_NIST
  echo "Checking installation site"
  test -f nist.local && CFLAGS="$CFLAGS -DAT_NIST -DPEDANTIC -ansi -pedantic -pedantic-errors -Wall -Wstrict-prototypes -Wmissing-prototypes -DWARN_ZERO_MALLOC"
  
  AC_OUTPUT(Makefile)