-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
231 lines (192 loc) · 6.71 KB
/
configure.in
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
dnl Process this file with autoconf to produce a configure script.
dnl Configuration pour flrn
dnl Jo.
AC_INIT(src/art_group.c)
if test -e configure; then
echo "In-tree build not recommended until build system is clean."
exit 1
fi
AC_CONFIG_HEADER(src/config.h)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_YACC
dnl En fait, on peut s'en passer...
AC_CHECK_PROGS(MAKEDEPEND,gccmakedep makedepend, echo)
AC_PATH_PROG(SENDMAIL, sendmail, no, `echo $PATH`:/usr/sbin:/usr/lib)
AC_DEFINE_UNQUOTED(SENDMAIL, "$ac_cv_path_SENDMAIL", [Path to sendmail])
if test "$ac_cv_path_SENDMAIL" = no; then
AC_MSG_WARN(no sendmail found. \\mail-answer will not work !)
fi
AC_ARG_WITH(default-host, [ --with-default-host[=MACHINE] default host for adresses],
AC_DEFINE_UNQUOTED(DEFAULT_HOST, "$withval", [Default host for adresses])
AC_MSG_RESULT(default host : $withval)
)
AC_ARG_WITH(domain, [ --with-domain[=DOMAIN] default domain for adresses],[
AC_MSG_RESULT(domain : $withval)
AC_DEFINE_UNQUOTED(DOMAIN, "$withval", [Default domain for adresses])
],
AC_MSG_WARN(no domain defined, use --with-domain to change this)
)
AC_ARG_WITH(headers, [ --with-headers=nb Set the number of headers that flrn can handle to nb],AC_DEFINE_UNQUOTED(MAX_HEADER_LIST,$withval,[Number of headers that flrn can handle for header options]))
AC_ARG_ENABLE(expert, [ --enable-expert Compile flrn in expert mode],
AC_DEFINE_UNQUOTED(MODE_EXPERT, , [Mode expert]))
AC_ARG_ENABLE(slang, [ --enable-slang Enable use of S-Lang (v1.4 or more) script language],
AC_DEFINE_UNQUOTED(USE_SLANG_LANGUAGE, , [Use of S-Lang script language]))
if test "$ac_cv_prog_ac_ct_CC" = gcc; then
CFLAGS="-Wall -fno-strict-aliasing $CFLAGS"
fi
CFLAGS="-I. $CFLAGS"
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyname)
if test "`(uname) 2>/dev/null`" = SunOS &&
uname -r | grep '^5' >/dev/null; then
solaris=yes;
fi
if test "`(uname) 2>/dev/null`" = FreeBSD &&
uname -r | grep '^5' >/dev/null; then
freebsd=yes;
fi
AC_MSG_CHECKING(for 8 bit nroff)
if test X`echo 'é'| nroff | head -1` = 'Xé'; then
MANISO=.iso
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
ROOTDIR=`pwd`
flrn_cv_slang=no
AC_ARG_WITH(slang, [ --with-slang[=DIR] use S-Lang in dir DIR],
AC_MSG_CHECKING(for S-Lang)
if test $withval = yes; then
if test -d $srcdir/../slang; then
flrn_cv_slang=$srcdir/../slang/src
CPPFLAGS="$CPPFLAGS -I${flrn_cv_slang}"
LDFLAGS="$LDFLAGS -L${flrn_cv_slang}/objs"
else
flrn_cv_slang=yes
fi
else
dnl ---Check to see if $withval is a source directory
if test -f $withval/src/slang.h; then
flrn_cv_slang=$withval/src
CPPFLAGS="$CPPFLAGS -I${flrn_cv_slang}"
LDFLAGS="$LDFLAGS -L${flrn_cv_slang}/objs"
else
dnl ---Must be installed somewhere
flrn_cv_slang=$withval
if test -d $withval/include/slang; then
CPPFLAGS="$CPPFLAGS -I${withval}/include/slang"
elif test -d $withval/include; then
CPPFLAGS="$CPPFLAGS -I${withval}/include"
fi
LDFLAGS="$LDFLAGS -L${withval}/lib"
if test X$solaris = Xyes; then
LDFLAGS="$LDFLAGS -R${withval}/lib"
fi
fi
fi
AC_MSG_RESULT($flrn_cv_slang)
)
LIBS="$LIBS -lslang -lm -letpan"
if test X$freebsd = Xyes; then
LIBS="$LIBS -lncurses"
fi
dnl --- un petit test en plus pour linux
if test X$flrn_cv_slang = Xno; then
if test -d /usr/include/slang; then
CPPFLAGS="$CPPFLAGS -I/usr/include/slang"
elif test -d /usr/local/include/slang; then
CPPFLAGS="$CPPFLAGS -I/usr/local/include/slang"
fi
fi
dnl --- try to link a sample program to check if we're ok
AC_MSG_CHECKING(if I can compile a test SLang program)
AC_TRY_LINK([], [SLang_init_tty ();],
[AC_MSG_RESULT(yes)],
[AC_MSG_ERROR(unable to compile. check config.log)])
dnl Checks for iconv
flrn_iconv=no
AC_ARG_WITH(iconv, [ --with-iconv[=DIR] use libiconv ],
[if test $withval != yes; then
if test -d $withval/lib; then
flrn_iconv=$withval/lib
CPPFLAGS="-I$withval/include $CPPFLAGS"
else
flrn_iconv=$withval
CPPFLAGS="-I$withval $CPPFLAGS"
fi
else
flrn_iconv=yes
fi],
[AC_CHECK_FUNCS(iconv,,[flrn_iconv=yes])
])
if test X$flrn_iconv != Xno; then
if test X$flrn_iconv != Xyes; then
LDFLAGS="$LDFLAGS -L$flrn_iconv"
if test X$solaris = Xyes; then
LDFLAGS="$LDFLAGS -R$flrn_iconv"
fi
fi
echo checking for libiconv... $flrn_cv_rx
AC_CHECK_LIB(iconv, iconv,,[
AC_MSG_ERROR(You need to use the option --with-iconv)])
fi
dnl Checks for gettext
flrn_intl=yes
AC_ARG_WITH(iconv, [ --disable-nls disable internationalization ],
[flrn_intl=no],
[AC_CHECK_FUNCS(gettext,,[flrn_intl=no])
])
dnl Checks for libraries.
dnl Replace `main' with a function in -lslang:
dnl AC_CHECK_LIB(slang, SLkp_init)
flrn_cv_rx=no
AC_ARG_WITH(rx, [ --with-rx[=DIR] Use GNU rx ],
[if test $withval != yes; then
if test -d $withval/lib; then
flrn_cv_rx=$withval/lib
CPPFLAGS="-I$withval/include $CPPFLAGS"
else
flrn_cv_rx=$withval
CPPFLAGS="-I$withval $CPPFLAGS"
fi
else
flrn_cv_rx=yes
fi],
[AC_CHECK_FUNCS(regcomp,,[flrn_cv_rx=yes])
AC_CHECK_HEADER(regdef.h)
])
if test X$flrn_cv_rx != Xno; then
if test X$flrn_cv_rx != Xyes; then
LDFLAGS="$LDFLAGS -L$flrn_cv_rx"
if test X$solaris = Xyes; then
LDFLAGS="$LDFLAGS -R$flrn_cv_rx"
fi
fi
echo checking for librx... $flrn_cv_rx
AC_CHECK_LIB(rx, regcomp,,[
AC_MSG_ERROR(You need to use the option --with-rx)])
fi
TBLS=`(cd ${srcdir}/src; ls chrtrans/*.tbl | tr '\n' ' ')`
TBLS_h=`echo $TBLS | sed 's%chrtrans/%%g;s%\.tbl%\.h%g'`
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/time.h unistd.h ctype.h errno.h wchar.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
dnl Checks for library functions.
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(gethostname select socket strdup strspn strstr strtol)
AC_CHECK_FUNCS(inet_aton snprintf isdigit isblank)
AC_SUBST(ROOTDIR)
AC_SUBST(MANISO)
AC_SUBST(TBLS)
AC_SUBST(TBLS_h)
AC_OUTPUT(src/Makefile src/chrtrans/Makefile Makefile)
MAKE=${MAKE:-make}
echo starting make depend
${MAKE} depend