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
+9 -18
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_PATH_PROG(libusb_config, libusb-config, :)
AC_ARG_WITH( 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
@@ -277,9 +270,7 @@ AC_ARG_WITH(
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
], ],