From a56266ab4fd1a64a13f397588f678c59794baec0 Mon Sep 17 00:00:00 2001 From: Henning Geinitz Date: Sat, 25 Nov 2000 17:51:20 +0000 Subject: [PATCH] 2000-11-25 Henning Meier-Geinitz * configure configure.in acinclude.m4 aclocal.m4 include/sane/config.h.in: Added test for PTAL library and headers (patch from David Paschal ). Some reformating of the output of configure --help. * backend/GUIDE: Updated entry about #include. --- acinclude.m4 | 37 ++++++++++++++++++++++++++++++ aclocal.m4 | 49 ++++++++++++++++++++++++++++++++++------ backend/GUIDE | 6 ++--- include/sane/config.h.in | 3 +++ 4 files changed, 85 insertions(+), 10 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 79e0b2233..94d94ea5e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -44,3 +44,40 @@ AC_DEFUN(SANE_V4L_VERSION, )]) fi ]) + +# +# 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 +]) diff --git a/aclocal.m4 b/aclocal.m4 index bc77debc8..6ce6c7ec5 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -57,6 +57,43 @@ AC_DEFUN(SANE_V4L_VERSION, fi ]) +# +# 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 +]) + # serial 40 AC_PROG_LIBTOOL AC_DEFUN(AC_PROG_LIBTOOL, @@ -104,12 +141,7 @@ AC_REQUIRE([AC_PROG_LN_S])dnl dnl # Check for any special flags to pass to ltconfig. -# -# the following will cause an existing older ltconfig to fail, so -# we ignore this at the expense of the cache file... Checking this -# will just take longer ... bummer! -#libtool_flags="--cache-file=$cache_file" -# +libtool_flags="--cache-file=$cache_file" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" @@ -151,7 +183,10 @@ case "$host" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) + [AC_LANG_SAVE + AC_LANG_C + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_RESTORE]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" diff --git a/backend/GUIDE b/backend/GUIDE index dccf5e78a..1b51be735 100644 --- a/backend/GUIDE +++ b/backend/GUIDE @@ -84,11 +84,11 @@ backend: char *buf = alloca (n); } -* Use #include "sane/..." to inlude the sane header files instead - of #include . Otherwise problems with different installed +* Use #include ".../include/sane/..." to inlude the sane header files + instead of #include . Otherwise problems with different installed SANE versions may occur. -* Don't forget to #include "sane/config.h" in your backend before +* Don't forget to #include ".../include/sane/config.h" in your backend before any other includes. If you use lalloca.h see above for the correct includes. diff --git a/include/sane/config.h.in b/include/sane/config.h.in index 7393bee58..76bc2d811 100644 --- a/include/sane/config.h.in +++ b/include/sane/config.h.in @@ -344,6 +344,9 @@ /* Define if you have cfmakeraw() */ #undef HAVE_CFMAKERAW +/* Define if you have PTAL. */ +#undef HAVE_PTAL + #ifndef HAVE_STRNCASECMP /* OS/2 needs this */ # define strncasecmp(a, b, c) strnicmp(a, b, c)