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,
|
|
|
|
AC_DEFINE(HAVE_PTAL)
|
|
|
|
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
|
|
|
|
])
|