From 749ceed2e6c83a338885556e47134c42bf550732 Mon Sep 17 00:00:00 2001 From: Henning Geinitz Date: Wed, 2 Apr 2003 16:21:07 +0000 Subject: [PATCH] Added a switch to disable libusb. Removed switch to enable ipv6 uncondinionally. Check for sys/poll.h. --- ChangeLog | 4 ++ acinclude.m4 | 45 +++++++++----------- aclocal.m4 | 45 +++++++++----------- configure | 92 ++++++++++++++++++++++------------------ configure.in | 33 +++++++++----- frontend/saned.c | 4 +- include/sane/config.h.in | 3 ++ 7 files changed, 124 insertions(+), 102 deletions(-) diff --git a/ChangeLog b/ChangeLog index a3c903da1..868c423dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,10 @@ addresses and website as dead. Fixed AT3 misdectection that was on the TODO list for some time. Initialize global variables in sane_init. + * acinclude.m4 aclocal.m4 configure configure.in + include/sane/config.h.in frontend/saned.c: Added a switch to + disable libusb. Removed switch to enable ipv6 uncondinionally. + Check for sys/poll.h. 2003-03-31 Henning Meier-Geinitz diff --git a/acinclude.m4 b/acinclude.m4 index 49ee23abe..cd0d0690e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -349,22 +349,17 @@ AC_DEFUN([SANE_CHECK_GPHOTO2], # Check for AF_INET6, determines whether or not to enable IPv6 support AC_DEFUN([SANE_CHECK_IPV6], [ -AC_MSG_CHECKING([whether to enable IPv6]) -AC_ARG_ENABLE(ipv6, -[ --enable-ipv6 enable IPv6 (with IPv4) support - --disable-ipv6 disable IPv6 support], -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - ipv6=no - ;; - *) AC_MSG_RESULT(yes) - AC_DEFINE([ENABLE_IPV6], 1, [Define to 1 if the system supports IPv6]) - ipv6=yes - ;; - esac ], - - AC_TRY_COMPILE([ + AC_MSG_CHECKING([whether to enable IPv6]) + AC_ARG_ENABLE(ipv6, + AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]), + [ if test "$enableval" = "no" ; then + AC_MSG_RESULT([no, manually disabled]) + ipv6=no + fi + ]) + + if test "$ipv6" != "no" ; then + AC_TRY_COMPILE([ #define INET6 #include #include ], [ @@ -373,15 +368,15 @@ AC_ARG_ENABLE(ipv6, exit(1); else exit(0); -], - AC_MSG_RESULT(yes) - AC_DEFINE([ENABLE_IPV6], 1, [Define to 1 if the system supports IPv6]) - ipv6=yes, - AC_MSG_RESULT(no) - ipv6=no, - AC_MSG_RESULT(no) - ipv6=no -)) + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE([ENABLE_IPV6], 1, [Define to 1 if the system supports IPv6]) + ipv6=yes + ],[ + AC_MSG_RESULT([no (couldn't compile test program)]) + ipv6=no + ]) + fi ]) # diff --git a/aclocal.m4 b/aclocal.m4 index bd1047f16..3aa32b65d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -361,22 +361,17 @@ AC_DEFUN([SANE_CHECK_GPHOTO2], # Check for AF_INET6, determines whether or not to enable IPv6 support AC_DEFUN([SANE_CHECK_IPV6], [ -AC_MSG_CHECKING([whether to enable IPv6]) -AC_ARG_ENABLE(ipv6, -[ --enable-ipv6 enable IPv6 (with IPv4) support - --disable-ipv6 disable IPv6 support], -[ case "$enableval" in - no) - AC_MSG_RESULT(no) - ipv6=no - ;; - *) AC_MSG_RESULT(yes) - AC_DEFINE([ENABLE_IPV6], 1, [Define to 1 if the system supports IPv6]) - ipv6=yes - ;; - esac ], - - AC_TRY_COMPILE([ + AC_MSG_CHECKING([whether to enable IPv6]) + AC_ARG_ENABLE(ipv6, + AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]), + [ if test "$enableval" = "no" ; then + AC_MSG_RESULT([no, manually disabled]) + ipv6=no + fi + ]) + + if test "$ipv6" != "no" ; then + AC_TRY_COMPILE([ #define INET6 #include #include ], [ @@ -385,15 +380,15 @@ AC_ARG_ENABLE(ipv6, exit(1); else exit(0); -], - AC_MSG_RESULT(yes) - AC_DEFINE([ENABLE_IPV6], 1, [Define to 1 if the system supports IPv6]) - ipv6=yes, - AC_MSG_RESULT(no) - ipv6=no, - AC_MSG_RESULT(no) - ipv6=no -)) + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE([ENABLE_IPV6], 1, [Define to 1 if the system supports IPv6]) + ipv6=yes + ],[ + AC_MSG_RESULT([no (couldn't compile test program)]) + ipv6=no + ]) + fi ]) # diff --git a/configure b/configure index 16c2cb251..1a401ddad 100755 --- a/configure +++ b/configure @@ -468,7 +468,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS V_MAJOR V_MINOR V_REV PACKAGE VERSION NUMBER_VERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE CPP EGREP SANE_CONFIG_PATH MSGFMT XGETTEXT MSGMERGE INCLUDES LINKER_RPATH DL_LIB DYNAMIC_FLAG HAVE_GPHOTO2 ac_ct_HAVE_GPHOTO2 ALLOCA LIBOBJS LN_S ECHO RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP LIBTOOL DC210 DC240 DJPEG CANON_PP HPSJ5S GPHOTO2 PINT QCAM V4L NET SANED SM3600 SNAPSCAN DLL_PRELOAD PNM INSTALL_TRANSLATIONS SELECTED_BACKENDS DISTCLEAN_FILES LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS V_MAJOR V_MINOR V_REV PACKAGE VERSION NUMBER_VERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE CPP EGREP SANE_CONFIG_PATH MSGFMT XGETTEXT MSGMERGE INCLUDES LINKER_RPATH DL_LIB DYNAMIC_FLAG HAVE_GPHOTO2 ac_ct_HAVE_GPHOTO2 ALLOCA LIBOBJS LN_S ECHO RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP LIBTOOL DC210 DC240 DJPEG CANON_PP HPSJ5S GPHOTO2 PINT QCAM V4L NET SANED SNAPSCAN DLL_PRELOAD PNM SM3600 INSTALL_TRANSLATIONS SELECTED_BACKENDS DISTCLEAN_FILES LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1011,7 +1011,7 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-warnings turn on tons of compiler warnings (GCC only) - --enable-ipv6 enable IPv6 (with IPv4) support + --disable-libusb disable support for libusb --disable-ipv6 disable IPv6 support --enable-static=PKGS build static libraries default=no --enable-shared=PKGS build shared libraries default=yes @@ -5618,6 +5618,7 @@ fi + for ac_header in fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \ @@ -5627,7 +5628,7 @@ for ac_header in fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \ camlib.h os2.h sys/socket.h sys/io.h gscdds.h sys/hw.h \ sys/types.h sys/scsi/scsi.h sys/scsi/sgdefs.h sys/scsi/targets/scgio.h \ apollo/scsi.h sys/sdi_comm.h sys/passthrudef.h linux/ppdev.h usb.h \ - sys/bitypes.h sys/sem.h + sys/bitypes.h sys/sem.h sys/poll.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -8225,7 +8226,19 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi -if test "${ac_cv_header_usb_h}" = "yes" ; then + +USE_LIBUSB=yes +# Check whether --enable-libusb or --disable-libusb was given. +if test "${enable_libusb+set}" = set; then + enableval="$enable_libusb" + + if eval "test x$enable_libusb = xno"; then + USE_LIBUSB= + fi + +fi; + +if test "${ac_cv_header_usb_h}" = "yes" && test "$USE_LIBUSB" = "yes" ; then echo "$as_me:$LINENO: checking for usb_get_busses in -lusb" >&5 echo $ECHO_N "checking for usb_get_busses in -lusb... $ECHO_C" >&6 @@ -8305,29 +8318,21 @@ fi if test "$ac_cv_func_getnameinfo" = "yes" && test "$ac_cv_func_getaddrinfo" = "yes" ; then -echo "$as_me:$LINENO: checking whether to enable IPv6" >&5 + echo "$as_me:$LINENO: checking whether to enable IPv6" >&5 echo $ECHO_N "checking whether to enable IPv6... $ECHO_C" >&6 -# Check whether --enable-ipv6 or --disable-ipv6 was given. + # Check whether --enable-ipv6 or --disable-ipv6 was given. if test "${enable_ipv6+set}" = set; then enableval="$enable_ipv6" - case "$enableval" in - no) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ipv6=no - ;; - *) echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + if test "$enableval" = "no" ; then + echo "$as_me:$LINENO: result: no, manually disabled" >&5 +echo "${ECHO_T}no, manually disabled" >&6 + ipv6=no + fi -cat >>confdefs.h <<\_ACEOF -#define ENABLE_IPV6 1 -_ACEOF +fi; - ipv6=yes - ;; - esac -else - cat >conftest.$ac_ext <<_ACEOF + if test "$ipv6" != "no" ; then + cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF @@ -8364,24 +8369,28 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 + + echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define ENABLE_IPV6 1 _ACEOF - ipv6=yes + ipv6=yes + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ipv6=no + + echo "$as_me:$LINENO: result: no (couldn't compile test program)" >&5 +echo "${ECHO_T}no (couldn't compile test program)" >&6 + ipv6=no + fi rm -f conftest.$ac_objext conftest.$ac_ext -fi; + fi else ipv6="no" @@ -9564,7 +9573,7 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 9567 "configure"' > conftest.$ac_ext + echo '#line 9576 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -10093,7 +10102,7 @@ chmod -w . save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no -if { (eval echo configure:10096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then +if { (eval echo configure:10105: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then @@ -11925,7 +11934,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <]) SANE_CHECK_MISSING_HEADERS SANE_V4L_VERSION @@ -196,8 +196,20 @@ dnl *********************************************************************** if test -c /dev/urandom ; then AC_DEFINE(HAVE_DEV_URANDOM, 1, [Is /dev/urandom available?]) fi + +dnl libusb on enabled by default (if found) +USE_LIBUSB=yes +AC_ARG_ENABLE(libusb, + AC_HELP_STRING([--disable-libusb], + [disable support for libusb]), + [ + if eval "test x$enable_libusb = xno"; then + USE_LIBUSB= + fi + ]) + dnl we need both libusb header and a libusb providing usb_get_busses -if test "${ac_cv_header_usb_h}" = "yes" ; then +if test "${ac_cv_header_usb_h}" = "yes" && test "$USE_LIBUSB" = "yes" ; then AC_CHECK_LIB(usb, usb_get_busses) if test "${ac_cv_lib_usb_usb_get_busses}" = "yes" ; then HAVE_LIBUSB="yes" @@ -311,14 +323,6 @@ else fi AC_SUBST(NET) AC_SUBST(SANED) -if test "${HAVE_LIBUSB}" = "yes" ; then - echo "enabling SM3600 backend" - SM3600=sm3600 -else - echo "disabling SM3600 backend" - SM3600= -fi -AC_SUBST(SM3600) if test "${ac_cv_header_sys_sem_h}" = "no" ; then echo "disabling SnapScan backend" SNAPSCAN= @@ -375,6 +379,15 @@ AC_ARG_ENABLE(parport-directio, fi ]) +if test "${HAVE_LIBUSB}" = "yes" ; then + echo "enabling SM3600 backend" + SM3600=sm3600 +else + echo "disabling SM3600 backend" + SM3600= +fi +AC_SUBST(SM3600) + AC_ARG_ENABLE(translations, AC_HELP_STRING([--disable-translations], [don't install translations of backend options]), diff --git a/frontend/saned.c b/frontend/saned.c index f7297258c..6ca0ad4ef 100644 --- a/frontend/saned.c +++ b/frontend/saned.c @@ -64,7 +64,9 @@ #include #include #ifdef SANED_USES_AF_INDEP -# include +# ifdef HAVE_SYS_POLL_H +# include +# endif /* HAVE_SYS_POLL_H */ #endif /* SANED_USES_AF_INDEP */ #include #include diff --git a/include/sane/config.h.in b/include/sane/config.h.in index ffbc2a91f..585598332 100644 --- a/include/sane/config.h.in +++ b/include/sane/config.h.in @@ -219,6 +219,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PASSTHRUDEF_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_POLL_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SCANIO_H