aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac68
1 files changed, 4 insertions, 64 deletions
diff --git a/configure.ac b/configure.ac
index f1bc6e9..ca7fe19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,7 +52,6 @@ AC_CHECK_HEADERS([ \
52 dirent.h \ 52 dirent.h \
53 errno.h \ 53 errno.h \
54 fcntl.h \ 54 fcntl.h \
55 iconv.h \
56 langinfo.h \ 55 langinfo.h \
57 libgen.h \ 56 libgen.h \
58 locale.h \ 57 locale.h \
@@ -129,7 +128,6 @@ AC_CHECK_FUNCS([ \
129 vsnprintf \ 128 vsnprintf \
130]) 129])
131 130
132
133dnl Windows requires the mingw-catgets library for the catgets function. 131dnl Windows requires the mingw-catgets library for the catgets function.
134AC_SEARCH_LIBS([catgets], [catgets], [], []) 132AC_SEARCH_LIBS([catgets], [catgets], [], [])
135 133
@@ -182,68 +180,10 @@ AC_COMPILE_IFELSE([
182 AC_MSG_RESULT([no]) 180 AC_MSG_RESULT([no])
183]) 181])
184 182
185 183AM_ICONV
186dnl --------------- 184AS_IF([test x$am_cv_proto_iconv_arg1 = "xconst"], [
187dnl CHECK FOR ICONV 185 AC_DEFINE([HAVE_CONST_ICONV], [1], [Is second argument of iconv() is of type 'const char **' or 'char **'])
188dnl --------------- 186])
189dnl Find iconv. It may be in libiconv and may be iconv() or libiconv()
190if test "x$ac_cv_header_iconv_h" = "xyes"; then
191 ac_found_iconv=no
192 AC_COMPILE_IFELSE(
193 [AC_LANG_PROGRAM(
194 [[#include <stdlib.h>
195 #include <iconv.h>]],
196 [[
197 iconv_open(NULL, NULL);
198 return 0;
199 ]]
200 )],
201 [
202 ac_found_iconv=yes
203 ],
204 [ ])
205
206 AC_COMPILE_IFELSE(
207 [AC_LANG_PROGRAM(
208 [[#include <stdlib.h>
209 #include <iconv.h>]],
210 [[
211 libiconv_open(NULL, NULL);
212 return 0;
213 ]]
214 )],
215 [
216 ac_found_iconv=yes
217 ],
218 [ ])
219
220 if test "x$ac_found_iconv" = xyes; then
221 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
222 AC_CHECK_LIB(iconv, iconv_open, LIBS="-liconv $LIBS")
223 AC_CHECK_LIB(iconv, libiconv_open, LIBS="-liconv $LIBS")
224
225dnl Check if iconv uses const in prototype declaration
226 AC_CACHE_CHECK(for iconv declaration,
227 ac_cv_iconv_const,
228 [AC_COMPILE_IFELSE(
229 [AC_LANG_PROGRAM(
230 [[#include <stdlib.h>
231 #include <iconv.h>]],
232 [[
233 char **msg, **new_msg;
234 size_t result, inleft, outleft;
235 result = iconv((iconv_t)(-1), msg, &inleft, new_msg, &outleft);
236 return 0;
237 ]]
238 )],
239 [ac_cv_iconv_const=no],
240 [ac_cv_iconv_const=yes])
241 ])
242 if test "x$ac_cv_iconv_const" = xyes; then
243 AC_DEFINE(HAVE_CONST_ICONV, 1, [Define if you have the iconv() function.])
244 fi
245 fi
246fi
247 187
248dnl Check for networking libraries 188dnl Check for networking libraries
249AC_CHECK_LIB([nsl], [t_open], [LIBS="-lnsl $LIBS"]) 189AC_CHECK_LIB([nsl], [t_open], [LIBS="-lnsl $LIBS"])