2001-04-16 17:16:57 +00:00
|
|
|
dnl
|
|
|
|
dnl Contains the following macros
|
|
|
|
dnl SANE_EXTRACT_LDFLAGS(LDFLAGS, LIBS)
|
|
|
|
dnl SANE_V4L_VERSION
|
|
|
|
dnl SANE_CHECK_PTAL
|
|
|
|
dnl SANE_CHECK_JPEG
|
|
|
|
dnl JAPHAR_GREP_CFLAGS(flag, cmd_if_missing, cmd_if_present)
|
|
|
|
dnl
|
|
|
|
|
2000-03-05 13:57:25 +00:00
|
|
|
#
|
|
|
|
# Separate LIBS from LDFLAGS to link correctly on HP/UX (and other
|
|
|
|
# platforms who care about the order of params to ld. It removes all
|
|
|
|
# non '-l..'-params from $2(LIBS), and appends them to $1(LDFLAGS)
|
|
|
|
#
|
|
|
|
# Use like this: SANE_EXTRACT_LDFLAGS(LDFLAGS, LIBS)
|
|
|
|
AC_DEFUN(SANE_EXTRACT_LDFLAGS,
|
|
|
|
[tmp_LIBS=""
|
|
|
|
for param in ${$2}; do
|
|
|
|
case "${param}" in
|
|
|
|
-l*)
|
|
|
|
tmp_LIBS="${tmp_LIBS} ${param}"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
$1="${$1} ${param}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
$2="${tmp_LIBS}"
|
|
|
|
unset tmp_LIBS
|
|
|
|
unset param
|
|
|
|
])
|
2000-08-12 15:11:46 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Test header file <linux/videodev.h> to check if this is Video for
|
|
|
|
# Linux 1 or 2. Sets variable sane_v4l_version to 'v4l' or 'v4l2'
|
|
|
|
# depending on the detected version.
|
|
|
|
# Test by Petter Reinholdtsen <pere@td.org.uit.no>, 2000-07-07
|
|
|
|
#
|
|
|
|
AC_DEFUN(SANE_V4L_VERSION,
|
|
|
|
[
|
|
|
|
AC_CHECK_HEADER(linux/videodev.h)
|
|
|
|
if test "${ac_cv_header_linux_videodev_h}" = "yes"
|
|
|
|
then
|
|
|
|
AC_CACHE_CHECK([Video4Linux version 1 or 2], sane_v4l_version,
|
|
|
|
[AC_EGREP_CPP(v4l2_yes,
|
|
|
|
[#include <linux/videodev.h>
|
|
|
|
#ifdef V4L2_MAJOR_VERSION
|
|
|
|
v4l2_yes
|
|
|
|
#endif
|
|
|
|
],[sane_v4l_version=v4l2],
|
|
|
|
|
|
|
|
[sane_v4l_version=v4l]
|
|
|
|
)])
|
|
|
|
fi
|
|
|
|
])
|
2000-11-25 17:51:20 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Checks for PTAL, needed for MFP support in HP backend.
|
|
|
|
AC_DEFUN(SANE_CHECK_PTAL,
|
|
|
|
[
|
|
|
|
PTAL_TMP_HAVE_PTAL=no
|
|
|
|
AC_ARG_WITH(ptal,
|
|
|
|
[ --with-ptal=DIR specify the top-level PTAL directory
|
|
|
|
[default=/usr/local]])
|
|
|
|
if test "$with_ptal" = "no" ; then
|
|
|
|
echo disabling PTAL
|
|
|
|
else
|
|
|
|
PTAL_OLD_CPPFLAGS=${CPPFLAGS}
|
|
|
|
PTAL_OLD_LDFLAGS=${LDFLAGS}
|
|
|
|
|
|
|
|
if test "$with_ptal" = "yes" ; then
|
|
|
|
with_ptal=/usr/local
|
|
|
|
fi
|
|
|
|
CPPFLAGS="${CPPFLAGS} -I$with_ptal/include"
|
|
|
|
LDFLAGS="${LDFLAGS} -L$with_ptal/lib"
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(ptal.h,
|
|
|
|
AC_CHECK_LIB(ptal,ptalInit,
|
2001-04-16 17:16:57 +00:00
|
|
|
AC_DEFINE(HAVE_PTAL, 1, [Is PTAL available?])
|
2000-11-25 17:51:20 +00:00
|
|
|
LDFLAGS="${LDFLAGS} -lptal"
|
|
|
|
PTAL_TMP_HAVE_PTAL=yes))
|
|
|
|
|
|
|
|
if test "${PTAL_TMP_HAVE_PTAL}" != "yes" ; then
|
|
|
|
CPPFLAGS=${PTAL_OLD_CPPFLAGS}
|
|
|
|
LDFLAGS=${PTAL_OLD_LDFLAGS}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
unset PTAL_TMP_HAVE_PTAL
|
|
|
|
unset PTAL_OLD_CPPFLAGS
|
|
|
|
unset PTAL_OLD_LDFLAGS
|
|
|
|
])
|
2000-11-28 20:29:34 +00:00
|
|
|
|
|
|
|
#
|
2001-04-08 15:53:05 +00:00
|
|
|
# Checks for jpeg library >= v6B (61), needed for DC210 and DC240 backends.
|
2000-11-28 20:29:34 +00:00
|
|
|
AC_DEFUN(SANE_CHECK_JPEG,
|
|
|
|
[
|
|
|
|
AC_CHECK_LIB(jpeg,jpeg_start_decompress,
|
|
|
|
[
|
|
|
|
AC_CHECK_HEADER(jconfig.h,
|
|
|
|
[
|
|
|
|
AC_MSG_CHECKING([for jpeglib - version >= 61 (6a)])
|
|
|
|
AC_EGREP_CPP(sane_correct_jpeg_lib_version_found,
|
|
|
|
[
|
|
|
|
#include <jpeglib.h>
|
|
|
|
#if JPEG_LIB_VERSION >= 61
|
|
|
|
sane_correct_jpeg_lib_version_found
|
|
|
|
#endif
|
|
|
|
],[sane_cv_use_libjpeg="yes"; LIBS="${LIBS} -ljpeg";
|
|
|
|
AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
|
|
|
|
],)
|
|
|
|
],)
|
|
|
|
])
|
2001-04-16 17:16:57 +00:00
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl JAPHAR_GREP_CFLAGS(flag, cmd_if_missing, cmd_if_present)
|
|
|
|
dnl
|
|
|
|
dnl From Japhar. Report changes to japhar@hungry.com
|
|
|
|
dnl
|
|
|
|
AC_DEFUN(JAPHAR_GREP_CFLAGS,
|
|
|
|
[case "$CFLAGS" in
|
|
|
|
"$1" | "$1 "* | *" $1" | *" $1 "* )
|
|
|
|
ifelse($#, 3, [$3], [:])
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
$2
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
])
|