1
dnl configure.ac for Presage
3
dnl Presage, an extensible predictive text entry system
4
dnl ---------------------------------------------------
6
dnl Copyright (C) 2008 Matteo Vescovi <matteo.vescovi\@yahoo.co.uk>
8
dnl This program is free software; you can redistribute it and/or modify
9
dnl it under the terms of the GNU General Public License as published by
10
dnl the Free Software Foundation; either version 2 of the License, or
11
dnl (at your option) any later version.
13
dnl This program is distributed in the hope that it will be useful,
14
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
15
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
dnl GNU General Public License for more details.
18
dnl You should have received a copy of the GNU General Public License along
19
dnl with this program; if not, write to the Free Software Foundation, Inc.,
20
dnl 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22
dnl Process this file with autoconf to produce a configure script.
27
[matteo.vescovi@yahoo.co.uk])
28
AM_INIT_AUTOMAKE([-Wall -Werror])
30
AC_CONFIG_SRCDIR([src/lib/presage.cpp])
31
AC_CONFIG_HEADERS([config.h:config.hin])
32
AC_CONFIG_MACRO_DIR([m4])
34
dnl Checks for programs.
44
AM_CONDITIONAL([USE_GCC], [test "x$GCC" = "xyes"])
46
dnl ==================
47
dnl Checks for libtool
48
dnl ==================
49
############################
50
# Temporarily disabling this
52
#AC_LIBLTDL_CONVENIENCE
60
dnl ============================
61
dnl Checks for ld version script
62
dnl ============================
63
AC_MSG_CHECKING([whether linker supports version scripts])
64
cat > conftest.map <<EOF
79
save_ldflags="$LDFLAGS"
80
LDFLAGS="$LDFLAGS -Wl,--version-script,conftest.map"
83
[[const char hello_world[] = "Hello, World\n";]],
85
[have_ld_with_version_script=yes],
86
[have_ld_with_version_script=no]
88
LDFLAGS="$save_ldflags"
90
if test "x$have_ld_with_version_script" = "xyes"
95
AC_MSG_WARN([Linker does not support version scripts.])
97
AM_CONDITIONAL([HAVE_LD_WITH_VERSION_SCRIPT],
98
[test "x$have_ld_with_version_script" = "xyes"])
101
dnl Cygwin windows specific flag
102
LDFLAGS="-L/usr/local/lib $LDFLAGS"
104
dnl ====================
105
dnl Checks for libraries
106
dnl ====================
108
dnl =======================
109
dnl Checks for header files
110
dnl =======================
113
AC_CHECK_HEADERS([pwd.h])
115
dnl ==================
116
dnl Checks for ncurses
117
dnl ==================
118
AC_CHECK_LIB([curses],
120
[have_curses_library=true],
121
[AC_MSG_WARN([curses library not found. curses demo programs will not be built.])])
122
AC_CHECK_HEADERS([curses.h],
123
[have_curses_header=true],
124
[AC_MSG_WARN([curses header file not found. curses demo programs will not be built.])],
126
AM_CONDITIONAL([HAVE_CURSES], [test "x$have_curses_library" = "xtrue" -a "x$have_curses_header" = "xtrue"])
129
dnl ==================
130
dnl Checks for tinyxml
131
dnl ==================
132
AC_CHECK_LIB([tinyxml],
134
[have_tinyxml_library=true],
135
[AC_MSG_WARN([tinyxml library not found. Embedded tinyxml library will be built.])])
136
AC_CHECK_HEADERS([tinyxml.h],
137
[have_tinyxml_header=true],
138
[AC_MSG_WARN([tinyxml library not found. Embedded tinyxml library will be built.])],
140
if test "x$have_tinyxml_library" != "xtrue" -o "x$have_tinyxml_header" != "xtrue"
145
AC_DEFINE([TIXML_USE_STL], [1], [Define to 1 to use STL string in TinyXML])
147
AM_CONDITIONAL([BUILD_TINYXML], [test "x$build_tinyxml" = "xyes"])
150
dnl =================
151
dnl Checks for SQLite
152
dnl =================
153
AC_ARG_ENABLE([sqlite],
154
AS_HELP_STRING([--disable-sqlite],[disable use of SQLite (default: enabled)]),
155
[enable_sqlite=$enableval],
158
dnl check for libsqlite3
159
dnl if (libsqlite3 found) {
160
dnl set SQLITE_LIBS to -lsqlite3
161
dnl check for sqlite3.h
162
dnl if (sqlite3.h found) {
168
dnl check for libsqlite2
169
dnl if (libsqlite2 found) {
170
dnl set SQLITE_LIBS to -lsqlite
171
dnl check for sqlite2.h
172
dnl if (sqlite2.h found) {
181
if test "x$enable_sqlite" = "xyes"
183
AC_CHECK_LIB([sqlite3],
185
[SQLITE_LIBS="-lsqlite3" && \
186
AC_CHECK_HEADERS([sqlite3.h],
187
[have_sqlite=yes && AC_MSG_NOTICE([using sqlite 3])],
188
[AC_MSG_ERROR([Found sqlite3 library, but cannot find matching sqlite3.h header.])],
190
[AC_CHECK_LIB([sqlite],
192
[SQLITE_LIBS="-lsqlite" && \
193
AC_CHECK_HEADERS([sqlite.h],
194
[have_sqlite=yes && AC_MSG_NOTICE([using sqlite 2])],
195
[AC_MSG_ERROR([Found sqlite 2 library, but cannot find matching sqlite.h header.])],
199
AC_MSG_ERROR([SQLite library not found. SQLite can be obtained from http://sqlite.org.])])])
200
AC_SUBST([SQLITE_LIBS], ["$SQLITE_LIBS"])
203
if test "x$enable_sqlite" = "xyes" -a "x$have_sqlite" = "xyes"
206
AC_DEFINE([USE_SQLITE], [1], [Define to 1 if you want to use SQLite])
210
AM_CONDITIONAL([USE_SQLITE], [test "x$use_sqlite" = "xyes"])
213
dnl ==================
214
dnl Checks for CppUnit
215
dnl ==================
216
AM_PATH_CPPUNIT([1.9.6],
218
[AC_MSG_WARN([CppUnit not found. Unit tests will not be built. CppUnit can be obtained from http://cppunit.sourceforge.net.])])
219
AM_CONDITIONAL([HAVE_CPPUNIT], [test "$CPPUNIT_LIBS"])
222
dnl ============================
223
dnl Bindings for other languages
229
AC_PATH_PROG([SWIG], [swig])
232
AC_PATH_PROG([SWIG], [swig2.0])
234
AM_CONDITIONAL([HAVE_SWIG], [test "$SWIG"])
237
dnl =================
238
dnl Checks for Python
239
dnl =================
240
AM_PATH_PYTHON([2.0],
242
[AC_MSG_WARN([Python not found. Python is required to build presage python binding. Python can be obtained from http://www.python.org])])
245
python_include_path=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc();"`
246
AC_CHECK_HEADERS([${python_include_path}/Python.h],
247
[have_python_header=true],
248
[AC_MSG_WARN([Python.h header file not found. Python development files are required to build presage python binding. Python can be obtained from http://www.python.org])],
251
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" -a "x$have_python_header" = "xtrue"])
254
AC_ARG_ENABLE([python-binding],
255
AS_HELP_STRING([--disable-python-binding],
256
[build python binding (default=enabled)]),
257
[ac_enable_python_binding=$enableval],
258
[ac_enable_python_binding=yes])
259
if test "x$ac_enable_python_binding" = "xyes"
261
if test ! "$SWIG" -o ! "$PYTHON" -o ! "x$have_python_header" = "xtrue"
263
AC_MSG_WARN([Python binding for presage cannot be built. Ensure that SWIG and Python packages are available.])
266
AC_MSG_NOTICE([Python binding for presage will not be built.])
267
AC_MSG_NOTICE([Enable Python binding module building with --enable-python-binding])
269
AM_CONDITIONAL([ENABLE_PYTHON_BINDING], [test "x$ac_enable_python_binding" = "xyes"])
272
dnl ========================
273
dnl Checks for documentation
274
dnl ========================
275
AC_ARG_ENABLE([documentation],
276
AS_HELP_STRING([--disable-documentation],[disable documentation generation (default: enabled)]),
277
[enable_documentation=$enableval],
278
[enable_documentation=yes])
279
AM_CONDITIONAL([BUILD_DOCUMENTATION], [test "x$enable_documentation" = "xyes"])
282
dnl ==================
283
dnl Checks for Doxygen
284
dnl ==================
285
AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [yes], [no])
286
if test "x$HAVE_DOXYGEN" = "xno"
288
AC_MSG_NOTICE([Doxygen not found. API documentation will not be built.])
290
AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$HAVE_DOXYGEN" = "xyes"])
291
if test "x$enable_documentation" = "xyes" -a "x$HAVE_DOXYGEN" = "xyes"
293
build_documentation=yes
295
build_documentation=no
301
AC_CHECK_PROG([HAVE_DOT], [dot], [yes], [no])
302
if test "x$HAVE_DOT" = "xno"
304
AC_MSG_NOTICE([dot not found. Documentation graphs and diagrams will not be generated.])
306
AC_SUBST([HAVE_DOT], ["$HAVE_DOT"])
307
if test "x$enable_documentation" = "xyes" -a "x$HAVE_DOXYGEN" = "xyes" -a "x$HAVE_DOT" = "xyes"
309
build_documentation_diagrams=yes
311
build_documentation_diagrams=no
315
dnl ===================
316
dnl Checks for help2man
317
dnl ===================
318
AC_CHECK_PROG([HAVE_HELP2MAN], [help2man], [yes], [no])
319
if test "x$HAVE_HELP2MAN" = "xno"
321
AC_MSG_NOTICE([help2man not found. Man documentation pages will not be built.])
323
AM_CONDITIONAL([HAVE_HELP2MAN], [test "x$HAVE_HELP2MAN" = "xyes"])
326
dnl ====================
327
dnl Checks for GTK tools
328
dnl ====================
329
AC_ARG_ENABLE([gpresagemate],
330
AS_HELP_STRING([--disable-gpresagemate],[build gpresagemate (default: enabled)]),
331
[enable_gpresagemate=$enableval],
332
[enable_gpresagemate=yes])
334
AC_ARG_ENABLE([gprompter],
335
AS_HELP_STRING([--disable-gprompter],[build gprompter (default: enabled)]),
336
[enable_gprompter=$enableval],
337
[enable_gprompter=yes])
339
if test "x$enable_gpresagemate" = "xyes"
341
AC_CHECK_HEADERS([X11/Xlib.h X11/Xproto.h X11/X.h X11/Xutil.h X11/keysymdef.h pthread.h],
342
[have_x11_headers=yes],
343
[have_x11_headers=no],
345
AC_CHECK_HEADERS([X11/extensions/Xevie.h],
346
[have_x11_extension_xevie=yes],
347
[have_x11_extension_xevie=no],
348
[[#if HAVE_X11_XLIB_H
349
# include <X11/Xlib.h>
353
if test "x$enable_gpresagemate" = "xyes" -o "x$enable_gprompter" = "xyes"
355
PKG_CHECK_MODULES([GNOME],
359
AC_SUBST([GNOME_CFLAGS])
360
AC_SUBST([GNOME_LIBS])
361
PKG_CHECK_MODULES([GTHREAD],
365
AC_SUBST([GTHREAD_CFLAGS])
366
AC_SUBST([GTHREAD_LIBS])
369
if test "x$enable_gpresagemate" = "xyes" -a \
370
"x$have_x11_headers" = "xyes" -a \
371
"x$have_x11_extension_xevie" = "xyes" -a \
372
"x$have_gtk" = "xyes" -a \
373
"x$have_gthread" = "xyes"
375
build_gtk_presage_mate=yes
377
build_gtk_presage_mate=no
379
AM_CONDITIONAL([BUILD_GTK_PRESAGE_MATE], [test "x$build_gtk_presage_mate" = "xyes"])
381
if test "x$enable_gprompter" = "xyes" -a \
382
"x$have_gtk" = "xyes" -a \
383
"x$have_gthread" = "xyes"
385
build_gtk_prompter=yes
387
build_gtk_prompter=no
389
AM_CONDITIONAL([BUILD_GTK_PROMPTER], [test "x$build_gtk_prompter" = "xyes"])
391
dnl ===================================================
392
dnl Checks for CMU-Statistical Language Modelling tools
393
dnl ===================================================
394
AC_PATH_PROG([TEXT2WFREQ], [text2wfreq])
395
AC_PATH_PROG([TEXT2IDNGRAM], [text2idngram])
396
AC_PATH_PROG([WFREQ2VOCAB], [wfreq2vocab])
397
AC_PATH_PROG([IDNGRAM2LM], [idngram2lm])
398
if test "$TEXT2WFREQ" -a \
403
build_arpa_ngram_resources=yes
405
build_arpa_ngram_resources=no
406
AC_MSG_NOTICE([CMU-Cambridge SLM tools not found. ARPA ngram language model will not be built.])
408
AM_CONDITIONAL([BUILD_ARPA_NGRAM], [test "x$build_arpa_ngram_resources" = "xyes"])
411
############################
412
# Temporarily disabling this
413
#AC_CONFIG_SUBDIRS(src/plump)
416
dnl ======================
417
dnl Checks for dbus python
418
dnl ======================
419
PKG_CHECK_EXISTS([dbus-python], [have_dbus_python=yes], [have_dbus_python=no])
420
AM_CONDITIONAL([HAVE_DBUS_PYTHON], [test "x$have_dbus_python" = "xyes"])
427
src/lib/core/Makefile
428
src/lib/core/tokenizer/Makefile
429
src/lib/core/context_tracker/Makefile
430
src/lib/simulator/Makefile
431
src/lib/tinyxml/Makefile
432
src/lib/predictors/Makefile
433
src/lib/predictors/dbconnector/Makefile
437
test/lib/common/Makefile
438
test/lib/core/Makefile
439
test/lib/core/tokenizer/Makefile
440
test/lib/core/context_tracker/Makefile
441
test/lib/predictors/Makefile
442
test/lib/predictors/dbconnector/Makefile
443
test/lib/simulator/Makefile
445
test/integration/Makefile
447
resources/arpa/Makefile
448
resources/profiles/Makefile
451
bindings/python/setup.py
452
bindings/python/Makefile
455
apps/gtk/gpresagemate/Makefile
456
apps/gtk/gprompter/Makefile
458
apps/python/pyprompter
459
apps/python/pypresagemate
462
apps/dbus/presage_dbus_python_demo
466
bindings/python/presage_python_demo
469
if test "x$have_curses_library" = "xtrue" -a "x$have_curses_header" = "xtrue"
471
build_demo_application="yes"
473
build_demo_application="no"
475
if test "$CPPUNIT_LIBS"
477
build_unit_tests="yes"
479
build_unit_tests="no"
481
if test "$SWIG" -a "$PYTHON" -a "x$have_python_header" = "xtrue" -a "x$ac_enable_python_binding" = "xyes"
483
build_python_binding="yes"
485
build_python_binding="no"
488
$PACKAGE $VERSION configured successfully.
490
General configuration:
492
Compiler: ................... ${CXX}
493
Curses demo application: .... ${build_demo_application}
494
Unit tests: ................. ${build_unit_tests}
495
Python binding: ............. ${build_python_binding}
496
Man pages: .................. ${HAVE_HELP2MAN}
497
API documentation: .......... ${build_documentation}
498
API documentation diagrams: . ${build_documentation_diagrams}
503
Smoothed n-gram: ............ ${use_sqlite}
504
Recency promotion: .......... yes
505
Abbreviation expansion: ..... yes
506
Smoothed count: ............. ${use_sqlite}
507
Dictionary: ................. yes
508
Deja-vu: .................... yes
509
ARPA: ....................... yes
512
Additional applications:
514
wxPython prompter: .......... ${build_python_binding}
515
GTK+ presage mate: .......... ${build_gtk_presage_mate}
516
GTK+ prompter: .............. ${build_gtk_prompter}
517
D-BUS presage service: ...... ${have_dbus_python}
520
Additional resources:
521
ARPA format ngram: .......... ${build_arpa_ngram_resources}
526
Type `make' to build $PACKAGE.
527
Type `make check' to test $PACKAGE.
528
Type `make install' to install $PACKAGE.