~ubuntu-branches/ubuntu/vivid/libmtp/vivid

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2012-06-21 10:44:53 UTC
  • mfrom: (16.2.12 experimental)
  • Revision ID: package-import@ubuntu.com-20120621104453-e9xhmt1aambphgfv
Tags: 1.1.3-24-g9aca343-3
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
AC_SUBST(OSFLAGS)
82
82
 
83
83
AC_MSG_CHECKING([if the host operating system is Linux])
84
 
AC_TRY_COMPILE([#if !(defined __linux__ || defined __FreeBSD_kernel__ || defined __GNU__)
 
84
AC_TRY_COMPILE([#ifndef __linux__
85
85
                #error "FAIL"
86
86
                #endif
87
87
                ],
111
111
AM_CONDITIONAL(MS_LIB_EXE, test x$ms_lib_exe = xyes)
112
112
 
113
113
# Check for libusb-1.0
114
 
PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= 1.0.0, found_libusb1_pkg=yes, found_libusb1_pkg=no)
115
 
if test x"$found_libusb1_pkg" = "xyes" ; then
 
114
PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= 1.0.0,[
116
115
   LIBUSB_VER=`pkg-config --modversion libusb-1.0`
117
116
   LIBUSB_REQUIRES='libusb-1.0'
118
117
   AC_DEFINE(HAVE_LIBUSB1, [], [Have libusb 1.0])
119
 
fi
120
 
 
121
 
# Check for libusb 0.x
122
 
if test x"$found_libusb1_pkg" = "xno" ; then
123
 
   if test x"$ac_cv_lib_openusb_openusb_init" != "xyes" ; then
124
 
      PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.8, found_libusb0_pkg=yes, found_libusb0_pkg=no)
125
 
      if test x"$found_libusb0_pkg" = "xyes" ; then
 
118
   found_libusb1_pkg=yes
 
119
],[
 
120
   # Check for libopenusb second
 
121
   AC_CHECK_LIB([openusb], [openusb_init],[
 
122
        AC_DEFINE(HAVE_OPENUSB, [], [Have libopenusb 1.0])
 
123
        LIBUSB_VER=1.0
 
124
   ],[
 
125
      PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.8, [
126
126
         LIBUSB_VER=`pkg-config --modversion libusb`
127
127
         LIBUSB_REQUIRES='libusb'
128
128
         AC_DEFINE(HAVE_LIBUSB0, [], [Have libusb 0.x])
129
 
      else
 
129
         found_libusb0_pkg=yes
 
130
      ],[
130
131
         # Some systems don't use pkg-config for libusb, so double check.
131
 
         AC_CHECK_LIB([usb], [usb_open], found_libusb0_pkg=yes, found_libusb0_pkg=no)
132
 
         if test x"$ac_cv_lib_usb_usb_open" = "xyes" ; then
 
132
         AC_CHECK_LIB([usb], [usb_open],[
133
133
            LIBUSB_VER=0.1
134
134
            AC_DEFINE(HAVE_LIBUSB0, [], [Have libusb 0.x])
135
 
            found_libusb0_pkg=xyes
136
 
         fi
137
 
         if test x"$found_libusb0_pkg" = "xno" ; then
 
135
            found_libusb0_pkg=yes
 
136
         ],[
138
137
            AC_MSG_ERROR([*** libusb not found! (missing -dev/-devel package?) ***\n*** prefer to install libusb-1 if you can! ***])
139
 
         fi
140
 
      fi
141
 
   fi
142
 
fi
143
 
 
144
 
# Check for libopenusb
145
 
if test x"$found_libusb1_pkg" = "xno" ; then
146
 
   AC_CHECK_LIB([openusb], [openusb_init])
147
 
   if test x"$found_libusb1_pkg" = "xno" ; then
148
 
      if test x"$ac_cv_lib_openusb_openusb_init" = "xyes" ; then
149
 
        AC_DEFINE(HAVE_OPENUSB, [], [Have libopenusb 1.0])
150
 
        LIBUSB_VER=1.0
151
 
      fi
152
 
   fi
153
 
fi
 
138
         ])
 
139
      ])
 
140
   ])
 
141
])
154
142
 
155
143
# Optionally disable MTPZ functionality.
156
144
AC_ARG_ENABLE([mtpz],