correct handling of --enable-libusb / --disable-libusb in configure.in

This commit is contained in:
marschap
2005-02-28 09:40:30 +00:00
parent 44e5bb9c61
commit 9633fa7a2f
+19 -28
View File
@@ -209,36 +209,29 @@ dnl not all options have effect at the moment
AC_SUBST(libusb_libs) AC_SUBST(libusb_libs)
AC_SUBST(libusb_cflags) AC_SUBST(libusb_cflags)
enable_libusb=yes
AC_MSG_CHECKING([if libusb support has been enabled]); AC_MSG_CHECKING([if libusb support has been enabled]);
AC_ARG_ENABLE( AC_ARG_ENABLE(
libusb, libusb,
[ --enable-libusb compile with USB support using libusb. ], [ --enable-libusb compile with USB support using libusb. ],
[ [
if test "$enable_libusb" = "yes"; then if test "$enableval" != "no"; then
AC_MSG_RESULT(yes) enable_libusb="yes"
else
AC_MSG_RESULT(no)
fi fi
], ],
[ [ enable_libusb="yes" ]
enable_libusb="no";
AC_MSG_RESULT(no)
]
) )
AC_MSG_RESULT($enable_libusb)
AC_PATH_PROG(libusb_config,libusb-config, :)
if test "$enable_libusb" = "yes"; then if test "$enable_libusb" = "yes"; then
AC_ARG_WITH( AC_PATH_PROG(libusb_config, libusb-config, :)
AC_ARG_WITH(
libusb-includes, libusb-includes,
[ --with-libusb-includes=DIR [ --with-libusb-includes=DIR
libusb include files are in DIR libusb include files are in DIR
(default: found by libusb-config). ], (default: found by libusb-config). ],
[ [
if test "$withval" = "no"; then if test "$withval" != "no"; then
libusb_build_dir="";
else
libusb_includepath="$withval" libusb_includepath="$withval"
libusb_cflags="-I$withval" libusb_cflags="-I$withval"
fi fi
@@ -251,7 +244,7 @@ AC_ARG_WITH(
for libusb_includepath in /usr/include /usr/local/include \ for libusb_includepath in /usr/include /usr/local/include \
/usr/include/libusb /usr/local/include/libusb \ /usr/include/libusb /usr/local/include/libusb \
/usr/include/usb /usr/local/include/usb ; do \ /usr/include/usb /usr/local/include/usb ; do \
if test -f "${ibusb_includepath}/libusb.h"; then if test -f "${libusb_includepath}/libusb.h" ; then
libusb_cflags="-I$libusb_includepath" libusb_cflags="-I$libusb_includepath"
break break
fi fi
@@ -259,27 +252,25 @@ AC_ARG_WITH(
fi fi
AC_MSG_RESULT($libusb_cflags) AC_MSG_RESULT($libusb_cflags)
] ]
) )
if test x$libusb_includepath != x ; then if test x$libusb_includepath != x ; then
AC_CHECK_FILE( AC_CHECK_FILE(
$libusb_includepath/usb.h, $libusb_includepath/usb.h,
[ : ] , [ : ] ,
[ enable_libusb="no" ] [ enable_libusb="no" ]
) )
fi fi
fi fi
if test "$enable_libusb" = "yes"; then if test "$enable_libusb" = "yes"; then
AC_ARG_WITH( AC_ARG_WITH(
libusb-libraries, libusb-libraries,
[ --with-libusb-libraries=DIR [ --with-libusb-libraries=DIR
libusb library files are in DIR libusb library files are in DIR
(default: found by libusb-config). ], (default: found by libusb-config). ],
[ [
if test "$withval" = "no"; then if test "$withval" != "no"; then
libusb_build_dir="";
else
libusb_libs="-L$withval -lusb" libusb_libs="-L$withval -lusb"
fi fi
], ],
@@ -299,15 +290,15 @@ AC_ARG_WITH(
fi fi
AC_MSG_RESULT($libusb_libs) AC_MSG_RESULT($libusb_libs)
] ]
) )
AC_CHECK_LIB( AC_CHECK_LIB(
usb, usb,
main, main,
[ : ], [ : ],
[ enable_libusb="no" ], [ enable_libusb="no" ],
$libusb_libs $libusb_libs
) )
fi fi
if test "$enable_libusb" = "yes"; then if test "$enable_libusb" = "yes"; then