dnl -*-autoconf-*- dnl dnl Configuration script for `anag' dnl dnl (c) 2016 Mark Wooding dnl dnl----- Licensing notice --------------------------------------------------- dnl dnl This file is part of Anag: a simple wordgame helper. dnl dnl Anag is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl Anag is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with Anag; if not, write to the Free Software Foundation, dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. dnl-------------------------------------------------------------------------- dnl Initialization. mdw_AUTO_VERSION AC_INIT([anag], AUTO_VERSION, [mdw@distorted.org.uk]) AC_CONFIG_SRCDIR([anag.c]) AC_CONFIG_AUX_DIR([config]) AM_INIT_AUTOMAKE([foreign]) mdw_SILENT_RULES AC_PROG_CC AX_CFLAGS_WARN_ALL dnl-------------------------------------------------------------------------- dnl C programming environment. AC_CHECK_FUNCS([regcomp]) AM_CONDITIONAL([HAVE_REGCOMP], [test $ac_cv_func_regcomp = yes]) mdw_have_pcre2=nil mdw_have_pcre=nil PKG_CHECK_MODULES([PCRE2], [libpcre2-8], [mdw_have_pcre2=t AM_CFLAGS="$AM_CFLAGS $PCRE2_CFLAGS"], [PKG_CHECK_MODULES([PCRE], [libpcre], [mdw_have_pcre=t AM_CFLAGS="$AM_CFLAGS $PCRE_CFLAGS"], [])]) AM_CONDITIONAL([HAVE_PCRE2], [test $mdw_have_pcre2 = t]) case $mdw_have_pcre2 in t) AC_DEFINE([HAVE_PCRE2], [1], [PCRE2 library is available.]) ;; esac AM_CONDITIONAL([HAVE_PCRE], [test $mdw_have_pcre = t]) case $mdw_have_pcre in t) AC_DEFINE([HAVE_PCRE], [1], [PCRE library is available.]) ;; esac dnl-------------------------------------------------------------------------- dnl Java. AC_CHECK_PROGS([JAVAC], [javac jikes], [none]) if test "$JAVAC" = "none"; then AC_MSG_WARN([No Java compiler found]); fi AM_CONDITIONAL([HAVE_JAVAC], [test "$JAVAC" != "none"]) dnl-------------------------------------------------------------------------- dnl Tcl/Tk. AC_PATH_PROGS([WISH], [wish wish8 wish8.5 wish8.4], [none]) if test "$WISH" = "none"; then AC_MSG_WARN([No Tcl/Tk interpreter found]); fi AM_CONDITIONAL([HAVE_WISH], [test "$WISH" != "none"]) dnl-------------------------------------------------------------------------- dnl Other configuration. AC_ARG_WITH(dictionary, [ --with-dictionary=DICT set default word list to be DICT], [DICTIONARY=$withval], [AC_CACHE_CHECK([dictionary], [mdw_cv_dictionary], [for mdw_cv_dictionary in \ /usr/share/dict/words \ /usr/dict/words; do if test -r "$mdw_cv_dictionary"; then break; fi done]) DICTIONARY=$mdw_cv_dictionary]) AC_DEFINE_UNQUOTED([DICTIONARY], ["$DICTIONARY"], [Define this to be your default wordlist location.]) AC_SUBST([DICTIONARY]) dnl-------------------------------------------------------------------------- dnl Produce output. AC_CONFIG_HEADER([config/config.h]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT dnl----- That's all, folks --------------------------------------------------