summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2007-12-27 01:00:53 -0500
committerJoe Marcus Clarke <marcus@FreeBSD.org>2007-12-27 01:00:53 -0500
commit3157817f9cf41d6edd553cdb74dddaf5163a7f2b (patch)
tree440e7de72da5fb3fdf6dd598eeb28dd9975b38fd /configure.in
parent8ba8b58407003911bbdec6fc906df7e25fb2c932 (diff)
conditionalize some dependencies and fix bashisms
Add --disable arguments for libusb and libpci (not needed on FreeBSD), and change some instances of "==" to "=".
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in75
1 files changed, 45 insertions, 30 deletions
diff --git a/configure.in b/configure.in
index 90f10f36..a5ab3758 100644
--- a/configure.in
+++ b/configure.in
@@ -277,7 +277,7 @@ else
USE_PARTED=no
fi
AC_SUBST(USE_PARTED)
-AM_CONDITIONAL(USE_PARTED, [test x$use_parted == xyes])
+AM_CONDITIONAL(USE_PARTED, [test x$use_parted = xyes])
#### gcc linker flags
@@ -383,39 +383,54 @@ AC_CHECK_LIB([expat], [XML_ParserCreate], [EXPAT_LIB="-lexpat"],
AC_SUBST(EXPAT_LIB)
dnl Check libusb
-AC_CHECK_HEADERS([usb.h], [USE_LIBUSB=yes], [USE_LIBUSB=no])
-if test "x$USE_LIBUSB" = "xyes"; then
- AC_CHECK_LIB([usb], [usb_find_devices], [], [USE_LIBUSB=no])
+AC_ARG_ENABLE([usb],
+ AS_HELP_STRING([--disable-usb], [Do not use libusb]),
+ [use_usb=$enableval], [use_usb=yes])
+if test "x$use_usb" = "xyes" ; then
+ AC_CHECK_HEADERS([usb.h], [USE_LIBUSB=yes], [USE_LIBUSB=no])
+ if test "x$USE_LIBUSB" = "xyes"; then
+ AC_CHECK_LIB([usb], [usb_find_devices], [], [USE_LIBUSB=no])
+ fi
+else
+ USE_LIBUSB=no
fi
AM_CONDITIONAL([HAVE_LIBUSB],[test "x$USE_LIBUSB" = "xyes"])
dnl Check for libsmbios
-AC_LANG_PUSH([C++])
-AC_CHECK_LIB([smbios], [SMBIOSFreeMemory], [LIB_SMBIOS=yes], [LIB_SMBIOS=no])
-AC_LANG_POP([C++])
-if test "$LIB_SMBIOS" = "yes" ; then
- AC_MSG_CHECKING([for libsmbios >= 0.13.4])
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
- #include <smbios/version.h>
- int main ()
- {
- int major ;
- int minor ;
- int micro ;
-
- if ( sscanf( LIBSMBIOS_RELEASE_VERSION , "%d.%d.%d", &major, &minor, &micro ) == 3 ) {
- if ((major == 0 && minor == 13 && micro >= 4) ||
- (major == 0 && minor > 13) ||
- (major >= 0)) {
- return 0;
- }
- }
- return 1;
- }]])], [USE_SMBIOS=yes; AC_MSG_RESULT(yes); AM_CONDITIONAL(HAVE_SMBIOS,true)],
- [USE_SMBIOS=no; AC_MSG_RESULT(failed); AM_CONDITIONAL(HAVE_SMBIOS,false)])
+AC_ARG_ENABLE([smbios],
+ AS_HELP_STRING([--disable-smbios], [Do not use libsmbios]),
+ [use_smbios=$enableval], [use_smbios=yes])
+if test "x$use_smbios" = "xyes" ; then
+ AC_LANG_PUSH([C++])
+ AC_CHECK_LIB([smbios], [SMBIOSFreeMemory], [LIB_SMBIOS=yes], [LIB_SMBIOS=no])
+ AC_LANG_POP([C++])
+ if test "$LIB_SMBIOS" = "yes" ; then
+ AC_MSG_CHECKING([for libsmbios >= 0.13.4])
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ #include <smbios/version.h>
+ int main ()
+ {
+ int major ;
+ int minor ;
+ int micro ;
+
+ if ( sscanf( LIBSMBIOS_RELEASE_VERSION , "%d.%d.%d", &major, &minor, &micro ) == 3 ) {
+ if ((major == 0 && minor == 13 && micro >= 4) ||
+ (major == 0 && minor > 13) ||
+ (major >= 0)) {
+ return 0;
+ }
+ }
+ return 1;
+ }]])], [USE_SMBIOS=yes; AC_MSG_RESULT(yes); AM_CONDITIONAL(HAVE_SMBIOS,true)],
+ [USE_SMBIOS=no; AC_MSG_RESULT(failed); AM_CONDITIONAL(HAVE_SMBIOS,false)])
+ else
+ USE_SMBIOS=no
+ AM_CONDITIONAL(HAVE_SMBIOS, [false])
+ fi
else
- USE_SMBIOS=no
- AM_CONDITIONAL(HAVE_SMBIOS, [false])
+ USE_SMBIOS=no
+ AM_CONDITIONAL(HAVE_SMBIOS, [false])
fi
AC_ARG_WITH([libpci],
@@ -850,7 +865,7 @@ AC_ARG_WITH([usb-csr],
AS_HELP_STRING([--with-usb-csr],
[Whether to build addon for wireless USB mice (auto)]))
BUILD_USBCSR=no
-if test "x${USE_LIBUSB}" == "xyes" ; then
+if test "x${USE_LIBUSB}" = "xyes" ; then
if test "x$with_usb_csr" = "xyes" ; then
BUILD_USBCSR=yes
elif test "x$with_usb_csr" = "x" ; then