[Apcupsd-commits] apcupsd configure,1.83,1.83.2.1
Brought to you by:
adk0212
From: Adam K. <ad...@us...> - 2005-11-29 23:11:45
|
Update of /cvsroot/apcupsd/apcupsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22626 Modified Files: Tag: Branch-generic_usb configure Log Message: Add generic usb driver. Index: configure =================================================================== RCS file: /cvsroot/apcupsd/apcupsd/configure,v retrieving revision 1.83 retrieving revision 1.83.2.1 diff -u -d -r1.83 -r1.83.2.1 --- configure 26 Nov 2005 23:01:37 -0000 1.83 +++ configure 29 Nov 2005 23:11:36 -0000 1.83.2.1 @@ -311,7 +311,7 @@ # include <unistd.h> #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 ABSSRCDIR topdir TRUEPRG FALSEPRG build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP CXX CXXFLAGS ac_ct_CXX EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK HAVE_GCC_TRUE HAVE_GCC_FALSE DEBUG DLIB DINCLUDE PTHREAD_CFLAGS PTHREAD_LFLAGS WIN32 WINLIBS APCACCESS SMTP APCTEST SHUTDOWN APCUPSD_MAIL WALL SCRIPTSHELL MAKE MAKEDEPEND RANLIB LIBTOOL ETAGS CTAGS RM CP ECHO LN SED AR MV HAVE_SUN_OS_TRUE HAVE_SUN_OS_FALSE HAVE_OSF1_OS_TRUE HAVE_OSF1_OS_FALSE HAVE_AIX_OS_TRUE HAVE_AIX_OS_FALSE HAVE_HPUX_OS_TRUE HAVE_HPUX_OS_FALSE HAVE_LINUX_OS_TRUE HAVE_LINUX_OS_FALSE HAVE_FREEBSD_OS_TRUE HAVE_FREEBSD_OS_FALSE HAVE_NETBSD_OS_TRUE HAVE_NETBSD_OS_FALSE HAVE_OPENBSD_OS_TRUE HAVE_OPENBSD_OS_FALSE HAVE_BSDI_OS_TRUE HAVE_BSDI_OS_FALSE HAVE_SGI_OS_TRUE HAVE_SGI_OS_FALSE HAVE_DARWIN_OS_TRUE HAVE_DARWIN_OS_FALSE GDHEAD INSTALL_DISTDIR UNINSTALL_DISTDIR APCSMART_DRIVER DUMB_DRIVER USB_DRIVER USB_TYPE LIBUSBHID LIBUSBHIDINC LIBUSBHIDOBJS NET_DRIVER SNMP_DRIVER TEST_DRIVER NISIP POMAKE INTLSUB INTLMAKE INTLTARGET POWERFLUTE POWERLIBS CGI GDINCLUDE LIBGD LIBGDOBJ CGI_IMGFMT CGIBIN PACKAGE VERSION DATE MSGFMT SET_MAKE ac_ct_RANLIB ALLOCA USE_NLS GMSGFMT XGETTEXT GENCAT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLINCLUDE INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES l MKINSTALLDIRS EXTRADEFS LIBEXTRAOBJ EXTRAOBJ DISTNAME DISTVER SERIALDEV PIDDIR LOGDIR nologdir PWRFAILDIR LOCKDIR NETPORT NISPORT UPSTYPE UPSCABLE HOST WCFLAGS WLDFLAGS LIBOBJS 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 ABSSRCDIR topdir TRUEPRG FALSEPRG build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP CXX CXXFLAGS ac_ct_CXX EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK HAVE_GCC_TRUE HAVE_GCC_FALSE DEBUG DLIB DINCLUDE PTHREAD_CFLAGS PTHREAD_LFLAGS WIN32 WINLIBS APCACCESS SMTP APCTEST SHUTDOWN APCUPSD_MAIL WALL SCRIPTSHELL MAKE MAKEDEPEND RANLIB LIBTOOL ETAGS CTAGS RM CP ECHO LN SED AR MV HAVE_SUN_OS_TRUE HAVE_SUN_OS_FALSE HAVE_OSF1_OS_TRUE HAVE_OSF1_OS_FALSE HAVE_AIX_OS_TRUE HAVE_AIX_OS_FALSE HAVE_HPUX_OS_TRUE HAVE_HPUX_OS_FALSE HAVE_LINUX_OS_TRUE HAVE_LINUX_OS_FALSE HAVE_FREEBSD_OS_TRUE HAVE_FREEBSD_OS_FALSE HAVE_NETBSD_OS_TRUE HAVE_NETBSD_OS_FALSE HAVE_OPENBSD_OS_TRUE HAVE_OPENBSD_OS_FALSE HAVE_BSDI_OS_TRUE HAVE_BSDI_OS_FALSE HAVE_SGI_OS_TRUE HAVE_SGI_OS_FALSE HAVE_DARWIN_OS_TRUE HAVE_DARWIN_OS_FALSE GDHEAD INSTALL_DISTDIR UNINSTALL_DISTDIR APCSMART_DRIVER DUMB_DRIVER LIBUSBHID LIBUSBHIDINC LIBUSBHIDOBJS USB_DRIVER USB_TYPE LIBUSB NET_DRIVER SNMP_DRIVER TEST_DRIVER NISIP POMAKE INTLSUB INTLMAKE INTLTARGET POWERFLUTE POWERLIBS CGI GDINCLUDE LIBGD LIBGDOBJ CGI_IMGFMT CGIBIN PACKAGE VERSION DATE MSGFMT SET_MAKE ac_ct_RANLIB ALLOCA USE_NLS GMSGFMT XGETTEXT GENCAT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLINCLUDE INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES l MKINSTALLDIRS EXTRADEFS LIBEXTRAOBJ EXTRAOBJ DISTNAME DISTVER SERIALDEV PIDDIR LOGDIR nologdir PWRFAILDIR LOCKDIR NETPORT NISPORT UPSTYPE UPSCABLE HOST WCFLAGS WLDFLAGS LIBOBJS LTLIBOBJS' ac_subst_files='VARIABLES TARGETS' # Initialize some variables set by options. @@ -891,6 +891,7 @@ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-libwrap=DIR Compile in libwrap (tcp_wrappers) support + --with-generic-usb Force use of generic USB driver --with-nisip=IP-ADDRESS Specify the IP address to bind to (default=0.0.0.0) --with-cgi-bin=DIR Specify cgi-bin directory (default=/etc/apcupsd) --with-included-gettext use the GNU gettext library included here @@ -10191,45 +10192,150 @@ fi; +# Allow user to force USB type to generic +GENERICUSB="no" + +# Check whether --with-generic-usb or --without-generic-usb was given. +if test "${with_generic_usb+set}" = set; then + withval="$with_generic_usb" + + GENERICUSB="yes" + + +fi; # Check whether --enable-usb or --disable-usb was given. if test "${enable_usb+set}" = set; then enableval="$enable_usb" if test "$enableval" = "yes" ; then - if test $HAVE_UNAME=yes -a x`uname -s` = xLinux ; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_USB_DRIVER 1 -_ACEOF + if test $GENERICUSB == "no" -a \ + $HAVE_UNAME=yes -a x`uname -s` = xLinux ; then + USB_TYPE="linux" + echo "$as_me:$LINENO: result: Using Linux USB driver." >&5 +echo "${ECHO_T}Using Linux USB driver." >&6 + elif test $GENERICUSB == "no" -a \ + $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD -o \ + $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD -o \ + $HAVE_UNAME=yes -a x`uname -s` = xNetBSD ; then - USB_DRIVER="usb" - USB_TYPE="linux" + LIBUSBHIDINC="-I\$(topdir)/src/libusbhid" + LIBUSBHID=libusbhid + LIBUSBHIDOBJS="\$(topdir)/src/libusbhid/*.o" - elif test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD -o \ - $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD -o \ - $HAVE_UNAME=yes -a x`uname -s` = xNetBSD ; then - cat >>confdefs.h <<\_ACEOF -#define HAVE_USB_DRIVER 1 -_ACEOF - USB_DRIVER="usb" - USB_TYPE="bsd" - LIBUSBHIDINC="-I\$(topdir)/src/libusbhid" - LIBUSBHID=libusbhid - LIBUSBHIDOBJS="\$(topdir)/src/libusbhid/*.o" + USB_TYPE="bsd" + echo "$as_me:$LINENO: result: Using BSD USB driver." >&5 +echo "${ECHO_T}Using BSD USB driver." >&6 + else +echo "$as_me:$LINENO: checking for usb_open in -lusb" >&5 +echo $ECHO_N "checking for usb_open in -lusb... $ECHO_C" >&6 +if test "${ac_cv_lib_usb_usb_open+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char usb_open (); +int +main () +{ +usb_open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_usb_usb_open=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_usb_usb_open=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_open" >&5 +echo "${ECHO_T}$ac_cv_lib_usb_usb_open" >&6 +if test $ac_cv_lib_usb_usb_open = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBUSB 1 +_ACEOF - else - { { echo "$as_me:$LINENO: error: Can't build USB driver on this OS ($host_os)." >&5 -echo "$as_me: error: Can't build USB driver on this OS ($host_os)." >&2;} + LIBS="-lusb $LIBS" + +else + { { echo "$as_me:$LINENO: error: Cannot find libusb." >&5 +echo "$as_me: error: Cannot find libusb." >&2;} { (exit 1); exit 1; }; } +fi + + + LIBUSBHIDINC="-I\$(topdir)/src/libusbhid" + LIBUSBHID=libusbhid + LIBUSBHIDOBJS="\$(topdir)/src/libusbhid/*.o" + + + + + LIBUSB="-lusb" + + USB_TYPE="generic" + echo "$as_me:$LINENO: result: Using generic libusb USB driver." >&5 +echo "${ECHO_T}Using generic libusb USB driver." >&6 fi + + cat >>confdefs.h <<\_ACEOF +#define HAVE_USB_DRIVER 1 +_ACEOF + + USB_DRIVER="usb" + + + + DISPLAY_USB_DRIVER=$USB_TYPE-$USB_DRIVER + fi fi; + # Check whether --enable-net or --disable-net was given. if test "${enable_net+set}" = set; then enableval="$enable_net" @@ -15734,11 +15840,12 @@ s,@UNINSTALL_DISTDIR@,$UNINSTALL_DISTDIR,;t t s,@APCSMART_DRIVER@,$APCSMART_DRIVER,;t t s,@DUMB_DRIVER@,$DUMB_DRIVER,;t t -s,@USB_DRIVER@,$USB_DRIVER,;t t -s,@USB_TYPE@,$USB_TYPE,;t t s,@LIBUSBHID@,$LIBUSBHID,;t t s,@LIBUSBHIDINC@,$LIBUSBHIDINC,;t t s,@LIBUSBHIDOBJS@,$LIBUSBHIDOBJS,;t t +s,@USB_DRIVER@,$USB_DRIVER,;t t +s,@USB_TYPE@,$USB_TYPE,;t t +s,@LIBUSB@,$LIBUSB,;t t s,@NET_DRIVER@,$NET_DRIVER,;t t s,@SNMP_DRIVER@,$SNMP_DRIVER,;t t s,@TEST_DRIVER@,$TEST_DRIVER,;t t @@ -16602,7 +16709,7 @@ UPSTYPE ${UPSTYPE} UPSCABLE ${UPSCABLE} - drivers (no-* are disabled): ${APCSMART_DRIVER:-no-apcsmart} ${DUMB_DRIVER:-no-dumb} ${NET_DRIVER:-no-net} ${USB_DRIVER:-no-usb} ${DISPLAY_SNMP_DRIVER:-no-snmp} ${TEST_DRIVER:-no-test} + drivers (no-* are disabled): ${APCSMART_DRIVER:-no-apcsmart} ${DUMB_DRIVER:-no-dumb} ${NET_DRIVER:-no-net} ${DISPLAY_USB_DRIVER:-no-usb} ${DISPLAY_SNMP_DRIVER:-no-snmp} ${TEST_DRIVER:-no-test} enable-master-slave: ${OLDNET_ENABLED} enable-nis: ${NISSRV_ENABLED} |