-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
180 lines (149 loc) · 5.32 KB
/
configure.ac
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
AC_INIT([irstlm], [5.80.06])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
m4_pattern_allow([AM_PROG_AR],[AM_PROG_AR])
AM_PROG_AR
AC_ARG_ENABLE([doc],
[AC_HELP_STRING([--enable-doc|--disable-doc], [Enable or Disable (default) creation of documentation])])
AC_ARG_ENABLE([trace],
[AC_HELP_STRING([--enable-trace|--disable-trace], [Enable (default) or Disable trace info at run-time])])
AC_ARG_ENABLE([assert],
[AC_HELP_STRING([--enable-assert|--disable-assert], [Enable (default) or Disable assert calls at run-time])])
AC_ARG_ENABLE([debugging],
[AC_HELP_STRING([--enable-debugging|--disable-debugging], [Enable or Disable (default) debugging info ("-g -O2")])])
AC_ARG_ENABLE(profiling,
[AC_HELP_STRING([--enable-profiling|--disable-profiling], [Enable or Disable (default) profiling info ("-pg")])])
AC_ARG_ENABLE(caching,
[AC_HELP_STRING([--enable-caching|--disable-caching], [Enable or Disable (default) internal caches to store probs and other info])])
AC_ARG_ENABLE(output,
[AC_HELP_STRING([--enable-output|--disable-output], [Enable (default) or Disable part of the output])])
AC_ARG_ENABLE(interpolatedsearch,
[AC_HELP_STRING([--enable-interpolatedsearch|--disable-interpolatedsearch], [Enable or Disable (default) interpolated search for n-grams])])
AC_ARG_ENABLE(optimization,
[AC_HELP_STRING([--enable-optimization|--disable-optimization], [Enable or Disable (default) optimization info ("-O3")])])
AC_ARG_WITH(zlib,
[AC_HELP_STRING([--with-zlib=PATH], [(optional) path to zlib])],
[with_zlib=$withval],
[with_zlib=no]
)
AC_ARG_WITH(tracelevel,
[AC_HELP_STRING([--with-tracelevel=VAL], [(optional) level of tracing; default 0, tracing disabled])],
[with_tracelevel=$withval],
[with_tracelevel=0]
)
AM_CONDITIONAL([DOC_COMPILATION],false)
if test "x$enable_doc" = 'xyes'
then
AC_CHECK_TOOL(PDFLATEX,pdflatex,"no")
AC_CHECK_TOOL(BIBTEX,bibtex,"no")
if test "x$PDFLATEX" != "xno" && test "x$BIBTEX" != "xno"
then
AM_CONDITIONAL([DOC_COMPILATION],true)
AC_MSG_NOTICE([pdflatex and bibtex are available])
AC_MSG_NOTICE([documentation will be created])
else
AC_MSG_NOTICE([either pdflatex or bibtex is not available])
AC_MSG_NOTICE([documentation will not be created (default); get it through the website $WEBSITE])
fi
else
AC_MSG_NOTICE([documentation will not be created (default); get it through the website $WEBSITE])
fi
#### Use this if you want that the default is yes
#### if test "x$enable_foo" != 'xno'
#### Use this if you want that the default is no
#### if test "x$enable_foo" = 'xyes'
if test "x$with_tracelevel" != 'x0'
then
if test "x$enable_trace" != 'xno'
then
TRACELEVEL=${with_tracelevel}
AC_MSG_NOTICE([trace enabled (default); trace level is $TRACELEVEL])
else
TRACELEVEL=0
AC_MSG_NOTICE([trace disabled; trace level is overwritten to $TRACELEVEL; most regression tests will fail])
fi
else
if test "x$enable_trace" != 'xno'
then
TRACELEVEL=1
AC_MSG_NOTICE([trace enabled (default); trace level is overwritten to default value $TRACELEVEL])
else
TRACELEVEL=0
AC_MSG_NOTICE([trace disabled; trace level is $TRACELEVEL; most regression tests will fail])
fi
fi
CPPFLAGS="$CPPFLAGS -DTRACE_LEVEL=$TRACELEVEL"
if test "x$enable_assert" != 'xno'
then
AC_MSG_NOTICE([assert enabled (default)])
CPPFLAGS="$CPPFLAGS -DMY_ASSERT_FLAG"
else
AC_MSG_NOTICE([assert disabled])
CPPFLAGS="$CPPFLAGS -UMY_ASSERT_FLAG"
fi
if test "x$enable_debugging" = 'xyes'
then
AC_MSG_NOTICE([generation of debugging symbols enabled, compilation with "-g -O2"])
CPPFLAGS="$CPPFLAGS -g -O2"
else
AC_MSG_NOTICE([generation of debugging symbols disabled (default), compilation without "-g", only "-O2"])
fi
if test "x$enable_profiling" = 'xyes'
then
AC_MSG_NOTICE([profiling enabled, compilation with "-pg"])
CPPFLAGS="$CPPFLAGS -pg"
LDFLAGS="$LDFLAGS -pg"
else
AC_MSG_NOTICE([profiling disabled (default)])
fi
if test "x$enable_caching" = 'xyes'
then
AC_MSG_NOTICE([caching enabled])
CPPFLAGS="$CPPFLAGS -DPS_CACHE_ENABLE -DLMT_CACHE_ENABLE -DMDIADAPTLM_CACHE_ENABLE";
LDFLAGS="$LDFLAGS"
else
AC_MSG_NOTICE([caching disabled (default)])
fi
if test "x$enable_output" = 'xno'
then
AC_MSG_NOTICE([part of the output on stdout is suppressed])
CPPFLAGS="$CPPFLAGS -DOUTPUT_SUPPRESSED";
LDFLAGS="$LDFLAGS"
else
AC_MSG_NOTICE([caching disabled (default)])
fi
if test "x$enable_interpolatedsearch" = 'xyes'
then
AC_MSG_NOTICE([interpolated search enabled])
CPPFLAGS="$CPPFLAGS -DINTERP_SEARCH";
LDFLAGS="$LDFLAGS"
else
AC_MSG_NOTICE([interpolated search disabled (default)])
fi
if test "x$enable_optimization" = 'xyes'
then
AC_MSG_NOTICE([optimization enabled, compilation with "-O3"])
CPPFLAGS="$CPPFLAGS -O3";
LDFLAGS="$LDFLAGS -O3"
else
AC_MSG_NOTICE([optimization disabled (default)])
fi
if test "x$with_zlib" != 'xno'
then
CPPFLAGS="$CPPFLAGS -I${with_zlib}/include"
LDFLAGS="$LDFLAGS -L${with_zlib}/lib"
fi
LIBS="$LIBS -lz"
AC_CONFIG_FILES([
Makefile
src/Makefile
scripts/Makefile
doc/Makefile
])
AC_SUBST(transform,'s/_lm/-lm/')
AC_OUTPUT()
AC_MSG_NOTICE([The software will be installed into $prefix])