File: configure.in

package info (click to toggle)
dictd 1.13.1%2Bdfsg-1.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,940 kB
  • sloc: ansic: 12,523; sh: 4,435; yacc: 512; makefile: 442; cpp: 277; lex: 256; perl: 175; awk: 12
file content (249 lines) | stat: -rw-r--r-- 6,026 bytes parent folder | download | duplicates (2)
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
dnl Process this file with autoconf to produce a configure script for dict.
dnl
dnl Created: Wed Apr 24 14:11:05 1996 by faith@dict.org
dnl Copyright 1996-1999, 2001-2002 Rickard E. Faith (faith@dict.org)
dnl Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net)
dnl
dnl This program is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by the
dnl Free Software Foundation; either version 1, or (at your option) any
dnl later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License along
dnl with this program; if not, write to the Free Software Foundation, Inc.,
dnl 675 Mass Ave, Cambridge, MA 02139, USA.
dnl
dnl Flag conventions:
dnl     CFLAGS and LDFLAGS should be settable on the make commandline
dnl             for optimization and stripping.
dnl     LIBOBJS is an automatically-generated list of extra objects we need


define(VERSION, 1.13.1)


AC_PREREQ(2.53)
AC_REVISION($Revision: 1.144 $)

AC_INIT([dict],[VERSION],[dict-beta@dict.org])

AC_CONFIG_SRCDIR([dictd.c])
AC_CONFIG_HEADER(config.h)

echo Configuring for dict
echo .

DICT_VERSION=VERSION

AC_CANONICAL_HOST

AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX

AC_ISC_POSIX

REALCC="$CC"
if test "$CC" = gcc; then
    CFLAGS="$CFLAGS -Wall"
    CFLAGS="$CFLAGS -Wwrite-strings -Wcast-align -Wmissing-prototypes"
    CFLAGS="$CFLAGS -Wshadow -Wnested-externs -Waggregate-return"
fi

AC_ARG_ENABLE([plugin],[  --disable-plugin        without plugin support])
if test "x${enableval}" != xno; then
    AC_CHECK_LIB(c, dlopen,
        [USE_PLUGIN=2],
        AC_CHECK_LIB(dl, dlopen,
            [LIBS="$LIBS -ldl"; USE_PLUGIN=2],
            AC_CHECK_LIB(ltdl,lt_dlopen,
                [LIBS="$LIBS -lltdl"; USE_PLUGIN=1])))
fi

dnl Checks for programs.
echo Checking for programs

AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_MAKE_SET
AC_PROG_YACC
AC_PROG_LEX

AC_CHECK_PROG(LIBTOOL,libtool,libtool)

AC_CHECK_PROGS(NROFF,gnroff nroff)
AC_CHECK_PROGS(TROFF,groff troff)
AC_CHECK_PROGS(COL,col cat)
AC_CHECK_PROGS(EXPAND,expand cat)

echo .
echo Checking for libraries

AC_CHECK_LIB(maa,maa_shutdown, [LIBMAA=-lmaa],
	[AC_MSG_ERROR([Libmaa not found])])

AC_ARG_WITH(plugin-dbi,
[  --with-plugin-dbi       build libdbi plugin (plugin support should be enabled)],
[
if test "x${withval}" != xno; then
       AC_CHECK_LIB(dbi,  dbi_shutdown,
           [PLUGINS="$PLUGINS dictdplugin_dbi.la"],
           [AC_MSG_ERROR([libdbi not found, cannot continue])])
       AC_CHECK_HEADER([dbi/dbi.h],,
           [AC_MSG_ERROR([dbi/dbi.h not found, cannot continue])])
fi
])

AC_ARG_WITH(plugin-judy,
[  --with-plugin-judy      build judy plugin (plugin support should be enabled)],
[
if test "x${withval}" != xno; then
       AC_CHECK_LIB(Judy, JudySLNext,
           [PLUGINS="$PLUGINS dictdplugin_judy.la"],
           [AC_MSG_ERROR([libJudy not found, cannot continue])])
       AC_CHECK_HEADER([Judy.h],,
           [AC_MSG_ERROR([Judy.h not found, cannot continue])])
fi
])

AC_CHECK_LIB(c,getnameinfo,
	[true],
	[AC_CHECK_LIB(socket,getnameinfo)])

AC_CHECK_LIB(c,inet_ntop,
	[true],
	[AC_CHECK_LIB(nsl,inet_ntop)])

echo .
echo Checking for header files

AC_HEADER_STDC
AC_HEADER_TIME

if test "x${USE_PLUGIN}" = "x2"; then
   # We use native dlopen
   AC_CHECK_HEADERS(dlfcn.h, [CFLAGS="$CFLAGS -DUSE_PLUGIN"], [USE_PLUGIN=])
fi
if test "x${USE_PLUGIN}" = "x1"; then
   # We use libltdl
   AC_CHECK_HEADERS(ltdl.h, [CFLAGS="$CFLAGS -DUSE_PLUGIN"], [USE_PLUGIN=])
fi

AC_CHECK_HEADER([zlib.h], ,
    [AC_MSG_ERROR([zlib.h is required for dictd])])

echo .
echo Checking for system constants

AC_C_CONST
AC_C_INLINE

echo .
echo Checking for library functions

AC_CHECK_FUNCS(dlopen)

AC_CHECK_FUNC(daemon,, [AC_LIBOBJ([daemon3])])

AC_FUNC_ALLOCA

AC_REPLACE_FUNCS(setenv)
AC_CHECK_FUNCS(putenv)

AC_LIBOBJ([wcrtomb])
AC_LIBOBJ([wctomb])
AC_LIBOBJ([mbrlen])
AC_LIBOBJ([mbrtowc])
AC_LIBOBJ([mbstowcs])
AC_LIBOBJ([mbtowc])
AC_LIBOBJ([iswspace])
AC_LIBOBJ([iswalnum])
AC_LIBOBJ([towlower])
#	AC_LIBOBJ([wcwidth])

AC_REPLACE_FUNCS(strlcpy strlcat)

echo .
echo Making output files

CC="$REALCC"

test "_$exec_prefix" = _NONE && exec_prefix='${prefix}'

eval3 () { eval echo $(eval echo $(eval echo $@)); }

SYSCONFDIR=`eval3 $sysconfdir`
BINDIR=`eval3 $bindir`
SBINDIR=`eval3 $sbindir`
LIBEXECDIR=`eval3 $libexecdir`
DATADIR=`eval3 $datadir`

AC_SUBST(DICT_VERSION)
AC_SUBST(USE_PLUGIN)
AC_SUBST(EXEEXT)
AC_SUBST(allsubdirs)
AC_SUBST(LIBTOOL)

AC_SUBST(PLUGINS)

AC_SUBST(SYSCONFDIR)
AC_SUBST(BINDIR)
AC_SUBST(SBINDIR)
AC_SUBST(LIBEXECDIR)
AC_SUBST(DATADIR)

AC_SUBST(LIBMAA)
AC_SUBST(srcdir)

AC_CONFIG_FILES([Makefile doc/Makefile])
AC_CONFIG_FILES([dictdplugin-config], [chmod +x dictdplugin-config])
AC_CONFIG_FILES([dictl], [chmod +x dictl])
AC_CONFIG_FILES([colorit], [chmod +x colorit])
AC_CONFIG_FILES([dictunformat], [chmod +x dictunformat])
AC_CONFIG_FILES([dictfmt_index2suffix], [chmod +x dictfmt_index2suffix])
AC_CONFIG_FILES([dictfmt_index2word], [chmod +x dictfmt_index2word])
AC_CONFIG_FILES([examples/dictd_popen.conf])

AC_CONFIG_FILES(colorit.1)
AC_CONFIG_FILES(dict.1)
AC_CONFIG_FILES(dictfmt.1)
AC_CONFIG_FILES(dictfmt_index2suffix.1)
AC_CONFIG_FILES(dictfmt_index2word.1)
AC_CONFIG_FILES(dictl.1)
AC_CONFIG_FILES(dict_lookup.1)
AC_CONFIG_FILES(dictunformat.1)
AC_CONFIG_FILES(dictzip.1)
AC_CONFIG_FILES(dictd.8)

AC_CONFIG_FILES(test/dictd_test)
AC_CONFIG_FILES(test/dictzip_test)

AC_OUTPUT

printf '\n\n'

# PLUGIN SUPPORT
printf "plugin support:  "
if test "_$USE_PLUGIN" = "_"; then
  echo disabled
else
  case "$USE_PLUGIN" in
    1) echo libltdl;;
    2) echo native
  esac

  printf " enabled plugins: %s\n" "$PLUGINS"
fi

printf '\n\n'

touch stamp-h.in
touch stamp-h
#echo .
#echo Done