Debian Codegraph @

modules/wordnet/module.ac

raw
1 ## This file is part of GNU Dico
2 ## Copyright (C) 2014-2024 Sergey Poznyakoff
3 ##
4 ## GNU Dico is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 3, or (at your option)
7 ## any later version.
8 ##
9 ## GNU Dico is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ## GNU General Public License for more details.
13 ##
14 ## You should have received a copy of the GNU General Public License
15 ## along with GNU Dico. If not, see <http://www.gnu.org/licenses/>.
16
17 ## module description: WordNet
18
19 AC_SUBST(WORDNET_LOPT)
20 AC_SUBST(WORDNET_IOPT)
21 AC_ARG_WITH([wordnet],
22 AS_HELP_STRING([--with-wordnet@<:@=DIR@:>@],
23 [use wordnet]),
24 [
25 case "${withval}" in
26 yes) status_wordnet=req ;;
27 no) status_wordnet=no ;;
28 /*) status_wordnet=req
29 WORDNET_LOPT=-L${withval}/lib
30 WORDNET_IOPT=-I${withval}/include;;
31 *) AC_MSG_ERROR([argument for --with-wordnet must be an absoulute directory name]) ;;
32 esac],[status_wordnet=maybe])
33
34 AC_SUBST([WORDNET_LIBWN],[WN])
35 AC_ARG_WITH([libWN],
36 AS_HELP_STRING([--with-libWN@<:@=NAME@:>@],
37 [use libNAME instead of libWN]),
38 [WORDNET_LIBWN=${withval#lib}])
39
40 if test $status_wordnet != no; then
41 save_LIBS=$LIBS
42 save_CPPFLAGS=$CPPFLAGS
43 LIBS="$LIBS $WORDNET_LOPT"
44 CPPFLAGS="$CPPFLAGS $WORDNET_IOPT"
45 AC_CHECK_HEADER([wn.h],
46 [AC_CHECK_LIB($WORDNET_LIBWN, findtheinfo, status_wordnet=yes)])
47 case $status_wordnet in
48 req) AC_MSG_ERROR([required module wordnet cannot be built because of missing prerequisites]);;
49 maybe) status_wordnet=no;;
50 esac
51 LIBS=$save_LIBS
52 CPPFLAGS=$save_CPPFLAGS
53 fi
54
55 AM_CONDITIONAL([WORDNET_COND],[test $status_wordnet = yes])