Switch to unified view

a/src/configure.ac b/src/configure.ac
...
...
196
  NOPIC="#"
196
  NOPIC="#"
197
fi
197
fi
198
198
199
AC_CHECK_FUNCS(mkdtemp)
199
AC_CHECK_FUNCS(mkdtemp)
200
200
201
##### Look for iconv. We look for libiconv in ${libdir}, /opt/local/lib,
201
##### Look for iconv. This can exist in either libc (ie: Linux, solaris) or
202
##### /usr/local/lib then in libc (Linux, solaris). Note that there is no
203
##### way to find libiconv in /usr/local if one exists in ${libdir} (can't
204
##### do because the link will always succeed in this case so that if we
205
##### put /usr/local/lib in front in this case, we may end up with using it
206
##### even if no libiconv in there. We'd need a --with-libiconv= option
202
##### libiconv. We'd need a --with-libiconv= option
207
AC_LANG(C++)
203
AC_LANG(C++)
208
LIBICONV=""
204
LIBICONV=""
209
S_LDFLAGS=$LDFLAGS
205
S_LDFLAGS=$LDFLAGS
210
206
S_CPPFLAGS=$CPPFLAGS
211
for dir in ${libdir} /opt/local/lib /usr/local/lib ;do
207
for dir in ${libdir} /opt/local/lib /usr/local/lib ;do
208
  CPPFLAGS="$S_CPPFLAGS -I$dir/../include"
209
212
  LDFLAGS="$S_LDFLAGS -L$dir"
210
  LDFLAGS="$S_LDFLAGS -L$dir"
213
  unset ac_cv_lib_iconv_iconv_open
211
  AC_TRY_LINK([#include <stdlib.h>
214
  AC_CHECK_LIB(iconv, iconv_open, LIBICONV="-L$dir -liconv";INCICONV=-I$dir/../include)
212
#include <iconv.h>],
213
      [iconv_t cd = iconv_open("","");
214
       iconv(cd,NULL,NULL,NULL,NULL);
215
       iconv_close(cd);],
216
      LIBICONV="-L$dir";INCICONV=-I$dir/../include)
215
  if test A"$LIBICONV" != A ; then
217
  if test A"$LIBICONV" != A ; then
216
     break
218
     break
217
  fi
219
  fi
220
221
  LDFLAGS="$S_LDFLAGS -L$dir -liconv"
222
  AC_TRY_LINK([#include <stdlib.h>
223
#include <iconv.h>],
224
      [iconv_t cd = iconv_open("","");
225
       iconv(cd,NULL,NULL,NULL,NULL);
226
       iconv_close(cd);],
227
      LIBICONV="-L$dir -liconv";INCICONV=-I$dir/../include)
228
  if test A"$LIBICONV" != A ; then
229
     break
230
  fi
231
218
done
232
done
219
233
220
if test A"$LIBICONV" = A; then
221
  dir=${libdir}
222
  LDFLAGS="$S_LDFLAGS -L$dir"
223
  unset ac_cv_lib_iconv_iconv_open
224
  AC_CHECK_LIB(c, iconv_open, LIBICONV=NONE;INCICONV=-I/usr/include)
225
fi
226
227
LDFLAGS=$S_LDFLAGS
234
LDFLAGS=$S_LDFLAGS
235
CPPFLAGS=$S_CPPFLAGS
236
228
if test A"$LIBICONV" = A ; then
237
if test A"$LIBICONV" = A ; then
229
   AC_MSG_ERROR([Cannot find iconv_open anywhere. Please install iconv])
238
   AC_MSG_ERROR([Cannot find iconv_open anywhere. Please install iconv])
230
   exit 1
239
   exit 1
231
fi
232
if test A"$LIBICONV" = ANONE ; then
233
   LIBICONV=""
234
fi
240
fi
235
#echo LIBICONV $LIBICONV
241
#echo LIBICONV $LIBICONV
236
#echo INCICONV $INCICONV
242
#echo INCICONV $INCICONV
237
243
238
CPPFLAGS="$CPPFLAGS $INCICONV"
244
CPPFLAGS="$CPPFLAGS $INCICONV"
...
...
246
if test X$rcl_iconv_inbuf_const = X1 ; then
252
if test X$rcl_iconv_inbuf_const = X1 ; then
247
  AC_DEFINE(RCL_ICONV_INBUF_CONST, 1, [iconv parameter 2 is const char**])
253
  AC_DEFINE(RCL_ICONV_INBUF_CONST, 1, [iconv parameter 2 is const char**])
248
fi
254
fi
249
255
250
256
257
############# Putenv
251
AC_MSG_CHECKING(for type of string parameter to putenv)
258
AC_MSG_CHECKING(for type of string parameter to putenv)
252
AC_TRY_COMPILE([
259
AC_TRY_COMPILE([
253
    #include <stdlib.h>
260
    #include <stdlib.h>
254
  ],[
261
  ],[
255
    putenv((const char *)0);
262
    putenv((const char *)0);
256
  ], rcl_putenv_string_const="1", rcl_putenv_string_const="0")
263
  ], rcl_putenv_string_const="1", rcl_putenv_string_const="0")
257
if test X$rcl_putenv_string_const = X1 ; then
264
if test X$rcl_putenv_string_const = X1 ; then
258
  AC_DEFINE(PUTENV_ARG_CONST, 1, [putenv parameter is const])
265
  AC_DEFINE(PUTENV_ARG_CONST, 1, [putenv parameter is const])
259
fi
266
fi
267
260
268
261
#### Look for Xapian
269
#### Look for Xapian
262
AC_PATH_PROG(XAPIAN_CONFIG, xapian-config, no)
270
AC_PATH_PROG(XAPIAN_CONFIG, xapian-config, no)
263
if test "$XAPIAN_CONFIG" = "no" ; then
271
if test "$XAPIAN_CONFIG" = "no" ; then
264
   AC_MSG_ERROR([Cannot find xapian-config command in $PATH. Is
272
   AC_MSG_ERROR([Cannot find xapian-config command in $PATH. Is