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
|
## GNU recode library test. This file is in public domain.
## Defines:
## HAVE_LIBRECODE when have recode_new_outer() and recode.h
## LIBS (adds library when needed)
AC_DEFUN([ye_CHECK_LIB_RECODE],
[AC_REQUIRE([AC_PROG_CC])dnl
dnl
dnl Test for librecode.
dnl Braindead librecode depends on symbol program_name defined in main program
dnl this makes the test braindead too. In header file test, we have to use
dnl a whole load of fakes, since it depends e.g. on bool and FILE defined.
AC_ARG_WITH(librecode,
[ --with-librecode@<:@=DIR@:>@ look for librecode in DIR/lib and DIR/include @<:@auto@:>@],
[case "$withval" in
yes|auto) WANT_LIBRECODE=1 ;;
no) WANT_LIBRECODE=0 ;;
*) WANT_LIBRECODE=1 ; yeti_librecode_CPPFLAGS="-I$withval/include" ; yeti_librecode_LDFLAGS="-L$withval/lib" ;;
esac],
[WANT_LIBRECODE=1])
if test "$WANT_LIBRECODE" = 1; then
yeti_save_LIBS="$LIBS"
yeti_save_CPPFLAGS="$CPPFLAGS"
yeti_save_LDFLAGS="$LDFLAGS"
LIBS="$LIBS -lrecode"
CPPFLAGS="$CPPFLAGS $yeti_librecode_CPPFLAGS"
LDFLAGS="$LDFLAGS $yeti_librecode_LDFLAGS"
AC_CACHE_CHECK([for recode_new_outer in librecode],
yeti_cv_lib_recode_new_outer,
AC_TRY_LINK([char* program_name = "";],
[recode_new_outer(0);],
yeti_cv_lib_recode_new_outer=yes,
yeti_cv_lib_recode_new_outer=no))
librecode_ok="$yeti_cv_lib_recode_new_outer";
if test "$librecode_ok" = yes; then
AC_CHECK_HEADER(recode.h,
librecode_ok=yes,
librecode_ok=no,
[#define bool int
#define size_t int
#define FILE void])
fi
if test "$librecode_ok" = yes; then
AC_CHECK_HEADER(recodext.h,
librecode_ok=yes,
librecode_ok=no,
[#define bool int
#define size_t int
#define FILE void])
fi
if test "$librecode_ok" = yes; then
AC_DEFINE(HAVE_LIBRECODE,1,[Define if you have the recode library (-lrecode).])
CONVERTER_LIBS="$CONVERTER_LIBS -lrecode"
fi
LIBS="$yeti_save_LIBS"
else
librecode_ok=no
fi
if test "$librecode_ok" != "yes"; then
if test "$WANT_LIBRECODE" = 1; then
CPPFLAGS="$yeti_save_CPPFLAGS"
LDFLAGS="$yeti_save_LDFLAGS"
fi
fi])
|