~ubuntu-branches/ubuntu/precise/libmtp/precise-updates

« back to all changes in this revision

Viewing changes to .pc/2001-pkgconfig_requires.patch/configure.ac

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2012-04-03 08:45:30 UTC
  • mfrom: (0.2.6)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: package-import@ubuntu.com-20120403084530-4pzddlb80jviafad
* New upstream bugfix release:
  - Soname libmtp.so.9.0.3 - binary compatible.
  - Probably nailed the bugs in the Samsung Galaxy Tab S2 family
    of devices. Ignacio Martinez helped us fixing this!
  - Build fixes by Alessio Treglia and others.
  - A horde of new devices in the database.
* Remove patches applied upstream:
  - 0001-broken_object_info.patch
  - 0002-devicedb_updates.patch
  - 2001-pkgconfig_requires.patch
* Refresh 1001-kfreebsd_hurd_ftbfs.patch.
* Refresh symbols file.
* Update debian/copyright.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Process this file with autoconf to produce a configure script.
2
 
AC_PREREQ(2.52)
3
 
AC_INIT([libmtp], [1.1.2], [libmtp-discuss@lists.sourceforge.net])
4
 
AC_CONFIG_MACRO_DIR([m4])
5
 
AM_INIT_AUTOMAKE([foreign])
6
 
AC_CONFIG_SRCDIR([src/libmtp.c])
7
 
AM_CONFIG_HEADER(config.h)
8
 
 
9
 
# Checks for programs.
10
 
AC_PROG_CC
11
 
AC_PROG_INSTALL
12
 
AC_PROG_LN_S
13
 
AC_LIBTOOL_WIN32_DLL
14
 
AC_PROG_LIBTOOL
15
 
AM_ICONV
16
 
 
17
 
# Optionally set install location of udev
18
 
UDEV=/lib/udev
19
 
AC_ARG_WITH(udev,
20
 
    AC_HELP_STRING([--with-udev=DIR],
21
 
    [directory where udev is installed [default=/lib/udev]]),
22
 
    [UDEV="${withval}"], [])
23
 
AC_SUBST(UDEV)
24
 
 
25
 
# Optionally set name of udev rules file, default
26
 
# priority is 69, to appear before 70-acl.rules which handles
27
 
# access control to the devices. We try to let all other userspace
28
 
# libusb-based device handlers take precedence since libmtp may
29
 
# attempt to autoprobe the devices.
30
 
#
31
 
# Later rules can then use the identifiers for its processing.
32
 
UDEV_RULES=69-libmtp.rules
33
 
AC_ARG_WITH(udev-rules,
34
 
    AC_HELP_STRING([--with-udev-rules=NAME],
35
 
    [file name for udev rules [default=69-libmtp.rules]]),
36
 
    [UDEV_RULES="${withval}"], [])
37
 
AC_SUBST(UDEV_RULES)
38
 
 
39
 
# Optionally set group for device nodes
40
 
UDEV_GROUP=
41
 
AC_ARG_WITH(udev-group,
42
 
    AC_HELP_STRING([--with-udev-group=GROUP],
43
 
    [file group for device nodes [default: none specified]]),
44
 
    [UDEV_GROUP="-g\"${withval}\""], [])
45
 
AC_SUBST(UDEV_GROUP)
46
 
 
47
 
# Optionally set mode for device nodes
48
 
UDEV_MODE=
49
 
AC_ARG_WITH(udev-mode,
50
 
    AC_HELP_STRING([--with-udev-mode=GROUP],
51
 
    [file mode for device nodes [default: none specified]]),
52
 
    [UDEV_MODE="-m\"${withval}\""], [])
53
 
AC_SUBST(UDEV_MODE)
54
 
 
55
 
# Optionally enable and check for doxygen
56
 
AC_ARG_ENABLE([doxygen],
57
 
    AS_HELP_STRING([--enable-doxygen], [Build API documentation using Doxygen [default=no]]),
58
 
    [ac_enable_doxygen=$enableval], [ac_enable_doxygen=auto])
59
 
if test "x$ac_enable_doxygen" == "xyes"; then
60
 
    AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false)
61
 
    if test "x$HAVE_DOXYGEN" = "xfalse" -a "x$ac_enable_doxygen" = "xyes"; then
62
 
        AC_MSG_ERROR([*** API documentation explicitly requested but Doxygen not found])
63
 
    fi
64
 
    AC_MSG_NOTICE([API documentation will be generated using Doxygen])
65
 
else
66
 
    HAVE_DOXYGEN=false
67
 
    AC_MSG_NOTICE([API documentation will not be generated])
68
 
fi
69
 
AM_CONDITIONAL(HAVE_DOXYGEN,$HAVE_DOXYGEN)
70
 
 
71
 
# Check for Darwin
72
 
AC_MSG_CHECKING([if the host operating system is Darwin])
73
 
case "$host" in
74
 
  *-darwin*)
75
 
    AC_MSG_RESULT([yes])
76
 
    CFLAGS="$CFLAGS -DUSE_DARWIN"
77
 
    OSFLAGS="-framework IOKit"
78
 
    ;;
79
 
  *) AC_MSG_RESULT([no]) ;;
80
 
esac
81
 
AC_SUBST(OSFLAGS)
82
 
 
83
 
AC_MSG_CHECKING([if the host operating system is Linux])
84
 
AC_TRY_COMPILE([#if !(defined __linux__ || defined __FreeBSD_kernel__ || defined __GNU__)
85
 
                #error "FAIL"
86
 
                #endif
87
 
                ],
88
 
                [int test;],
89
 
                [ AC_MSG_RESULT(yes)
90
 
                  AM_CONDITIONAL(USE_LINUX, true)
91
 
                ],
92
 
                [ AC_MSG_RESULT(no)
93
 
                  AM_CONDITIONAL(USE_LINUX, false)
94
 
                ])
95
 
 
96
 
# Check for mingw compiler platform
97
 
AC_MSG_CHECKING([For MinGW32])
98
 
case "$host" in
99
 
  *-*-mingw*)
100
 
    AC_MSG_RESULT([yes])
101
 
    mingw_compiler=yes
102
 
    ;;
103
 
  *) AC_MSG_RESULT([no]) ;;
104
 
esac
105
 
AM_CONDITIONAL(COMPILE_MINGW32, [test "$mingw_compiler" = "yes"])
106
 
 
107
 
# Check if Microsoft LIB.EXE is available
108
 
if test "$mingw_compiler" = "yes"; then
109
 
  AC_CHECK_PROG(ms_lib_exe, lib.exe, yes, no)
110
 
fi
111
 
AM_CONDITIONAL(MS_LIB_EXE, test x$ms_lib_exe = xyes)
112
 
 
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
116
 
   LIBUSB_VER=`pkg-config --modversion libusb-1.0`
117
 
   AC_DEFINE(HAVE_LIBUSB1, [], [Have libusb 1.0])
118
 
fi
119
 
 
120
 
# Check for libopenusb
121
 
AC_CHECK_LIB([openusb], [openusb_init])
122
 
if test x"$found_libusb1_pkg" = "xno" ; then
123
 
   if test x"$ac_cv_lib_openusb_openusb_init" = "xyes" ; then
124
 
      AC_DEFINE(HAVE_OPENUSB, [], [Have libopenusb 1.0])
125
 
      LIBUSB_VER=1.0
126
 
   fi
127
 
fi
128
 
 
129
 
# Check for libusb 0.x
130
 
if test x"$found_libusb1_pkg" = "xno" ; then
131
 
   if test x"$ac_cv_lib_openusb_openusb_init" = "xno" ; then
132
 
      PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.8, found_libusb0_pkg=yes, found_libusb0_pkg=no)
133
 
      if test x"$found_libusb0_pkg" = "xyes" ; then
134
 
         LIBUSB_VER=`pkg-config --modversion libusb`
135
 
         AC_DEFINE(HAVE_LIBUSB0, [], [Have libusb 0.x])
136
 
      else
137
 
         # Some systems don't use pkg-config for libusb, so double check.
138
 
         AC_CHECK_LIB([usb], [usb_open], found_libusb0_pkg=yes, found_libusb0_pkg=no)
139
 
         if test x"$ac_cv_lib_usb_usb_open" = "xyes" ; then
140
 
            LIBUSB_VER=0.1
141
 
            AC_DEFINE(HAVE_LIBUSB0, [], [Have libusb 0.x])
142
 
            found_libusb0_pkg=xyes
143
 
         fi
144
 
         if test x"$found_libusb0_pkg" = "xno" ; then
145
 
            AC_MSG_ERROR([*** libusb not found! (missing -dev/-devel package?) ***\n*** prefer to install libusb-1 if you can! ***])
146
 
         fi
147
 
      fi
148
 
   fi
149
 
fi
150
 
 
151
 
 
152
 
AC_SUBST(LIBUSB_CFLAGS)
153
 
AC_SUBST(LIBUSB_LIBS)
154
 
AM_CONDITIONAL(LIBUSB1_COMPILE, test x"$found_libusb1_pkg" = "xyes")
155
 
AM_CONDITIONAL(LIBUSB0_COMPILE, test x"$found_libusb0_pkg" = "xyes")
156
 
AM_CONDITIONAL(LIBOPENUSB_COMPILE, test x"$ac_cv_lib_openusb_openusb_init" = "xyes")
157
 
AC_MSG_NOTICE([*** using libusb $LIBUSB_VER ***])
158
 
 
159
 
# Checks for header files.
160
 
AC_HEADER_STDC
161
 
AC_HEADER_TIME
162
 
# zlib.h the day we need to decompress firmware
163
 
AC_CHECK_HEADERS([ctype.h errno.h fcntl.h getopt.h libgen.h \
164
 
        limits.h stdio.h string.h sys/stat.h sys/time.h unistd.h \
165
 
        langinfo.h locale.h arpa/inet.h byteswap.h sys/uio.h])
166
 
 
167
 
# Checks for typedefs, structures, and compiler characteristics.
168
 
AC_C_CONST
169
 
AC_TYPE_OFF_T
170
 
AC_TYPE_SIGNAL
171
 
AC_TYPE_SIZE_T
172
 
AC_STRUCT_ST_BLKSIZE
173
 
 
174
 
# Checks for library functions.
175
 
AC_FUNC_MALLOC
176
 
AC_FUNC_MEMCMP
177
 
AC_FUNC_STAT
178
 
AC_CHECK_FUNCS(basename memset select strdup strerror strndup strrchr strtoul usleep mkstemp)
179
 
 
180
 
# Switches.
181
 
# Enable LFS (Large File Support)
182
 
AC_SYS_LARGEFILE
183
 
# Stick in "-Werror" if you want to be more aggressive.
184
 
# (No need to use AC_SUBST on this default substituted environment variable.)
185
 
# Only add these additional CFLAGS if we are using GCC. Other C compilers may
186
 
# not support them.
187
 
if test x"$GCC" == "xyes" ; then
188
 
        CFLAGS="$CFLAGS -Wall -Wmissing-prototypes"
189
 
fi
190
 
 
191
 
# Output files
192
 
 
193
 
# Create a stdint.h-like file containing size-specific integer definitions
194
 
# that will always be available. The <stdint.h> file is required by the
195
 
# library, but we provide this anyway because the libptp2 stuff wants this
196
 
# file.
197
 
AX_NEED_STDINT_H([src/_stdint.h])
198
 
 
199
 
# Create a header file containing NetBSD-style byte swapping macros.
200
 
# This m4 macros has caused severe pain, I am considering creating a
201
 
# hard-coded byte swapper that will be eternally portable.
202
 
AC_NEED_BYTEORDER_H(src/gphoto2-endian.h)
203
 
 
204
 
AC_CONFIG_FILES([src/libmtp.h doc/Doxyfile Makefile doc/Makefile src/Makefile
205
 
        examples/Makefile util/Makefile libmtp.sh hotplug.sh libmtp.pc])
206
 
AC_OUTPUT
207
 
chmod +x hotplug.sh