f1cac477d3738bf9ec456d4bf2274559e55bb895
[anag] / configure.ac
1 dnl -*-autoconf-*-
2 dnl
3 dnl Configuration script for `anag'
4 dnl
5 dnl (c) 2016 Mark Wooding
6 dnl
7
8 dnl----- Licensing notice ---------------------------------------------------
9 dnl
10 dnl This file is part of Anag: a simple wordgame helper.
11 dnl
12 dnl Anag is free software; you can redistribute it and/or modify
13 dnl it under the terms of the GNU General Public License as published by
14 dnl the Free Software Foundation; either version 2 of the License, or
15 dnl (at your option) any later version.
16 dnl
17 dnl Anag is distributed in the hope that it will be useful,
18 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
19 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 dnl GNU General Public License for more details.
21 dnl
22 dnl You should have received a copy of the GNU General Public License
23 dnl along with Anag; if not, write to the Free Software Foundation,
24 dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26 dnl--------------------------------------------------------------------------
27 dnl Initialization.
28
29 mdw_AUTO_VERSION
30 AC_INIT([anag], AUTO_VERSION, [mdw@distorted.org.uk])
31 AC_CONFIG_SRCDIR([anag.c])
32 AC_CONFIG_AUX_DIR([config])
33 AM_INIT_AUTOMAKE([foreign])
34 mdw_SILENT_RULES
35
36 AC_PROG_CC
37 AX_CFLAGS_WARN_ALL
38
39 dnl--------------------------------------------------------------------------
40 dnl C programming environment.
41
42 AC_CHECK_FUNCS([regcomp])
43
44 AC_SEARCH_LIBS([pcre_fullinfo], [pcre],
45 [AC_DEFINE([HAVE_PCRE], [1], [Define if you have libpcre available.])])
46
47 dnl--------------------------------------------------------------------------
48 dnl Java.
49
50 AC_CHECK_PROGS([JAVAC], [javac jikes], [none])
51 if test "$JAVAC" = "none"; then AC_MSG_WARN([No Java compiler found]); fi
52 AM_CONDITIONAL([HAVE_JAVAC], [test "$JAVAC" != "none"])
53
54 dnl--------------------------------------------------------------------------
55 dnl Tcl/Tk.
56
57 AC_PATH_PROGS([WISH], [wish wish8 wish8.5 wish8.4], [none])
58 if test "$WISH" = "none"; then AC_MSG_WARN([No Tcl/Tk interpreter found]); fi
59 AM_CONDITIONAL([HAVE_WISH], [test "$WISH" != "none"])
60
61 dnl--------------------------------------------------------------------------
62 dnl Other configuration.
63
64 AC_ARG_WITH(dictionary,
65 [ --with-dictionary=DICT set default word list to be DICT],
66 [DICTIONARY=$withval],
67 [AC_CACHE_CHECK([dictionary], [mdw_cv_dictionary],
68 [for mdw_cv_dictionary in \
69 /usr/share/dict/words \
70 /usr/dict/words; do
71 if test -r "$mdw_cv_dictionary"; then break; fi
72 done])
73 DICTIONARY=$mdw_cv_dictionary])
74
75 AC_DEFINE_UNQUOTED([DICTIONARY], ["$DICTIONARY"],
76 [Define this to be your default wordlist location.])
77 AC_SUBST([DICTIONARY])
78
79 dnl--------------------------------------------------------------------------
80 dnl Produce output.
81
82 AC_CONFIG_HEADER([config/config.h])
83 AC_CONFIG_FILES([Makefile])
84 AC_OUTPUT
85
86 dnl----- That's all, folks --------------------------------------------------