~ubuntu-branches/ubuntu/lucid/libimobiledevice/lucid

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne
  • Date: 2010-02-02 21:19:51 UTC
  • Revision ID: james.westby@ubuntu.com-20100202211951-qv87ejwmucigqezf
Tags: upstream-0.9.7
ImportĀ upstreamĀ versionĀ 0.9.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#                                               -*- Autoconf -*-
 
2
# Process this file with autoconf to produce a configure script.
 
3
 
 
4
AC_PREREQ(2.61)
 
5
AC_INIT(libimobiledevice, 0.9.7, nospam@nowhere.com)
 
6
AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])
 
7
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
 
8
AC_CONFIG_SRCDIR([src/])
 
9
AC_CONFIG_HEADERS([config.h])
 
10
AC_CONFIG_MACRO_DIR([m4])
 
11
 
 
12
AM_PATH_PYTHON(2.3)
 
13
AC_PROG_SWIG(1.3.21)
 
14
AX_SWIG_ENABLE_CXX
 
15
SWIG_PYTHON
 
16
 
 
17
dnl libtool versioning
 
18
# +1 : 0 : +1  == adds new functions to the interface
 
19
# +1 : 0 : 0   == changes or removes functions (changes include both
 
20
#                 changes to the signature and the semantic)
 
21
#  ? :+1 : ?   == just internal changes
 
22
# CURRENT : REVISION : AGE
 
23
LIBIMOBILEDEVICE_SO_VERSION=0:0:0
 
24
 
 
25
AC_SUBST(LIBIMOBILEDEVICE_SO_VERSION)
 
26
 
 
27
# Checks for programs.
 
28
AC_PROG_CC
 
29
AM_PROG_CC_C_O
 
30
AC_PROG_LIBTOOL
 
31
 
 
32
# Checks for libraries.
 
33
PKG_CHECK_MODULES(libusbmuxd, libusbmuxd >= 0.1.4)
 
34
PKG_CHECK_MODULES(libglib2, glib-2.0 >= 2.14.1)
 
35
PKG_CHECK_MODULES(libgthread2, gthread-2.0 >= 2.14.1)
 
36
PKG_CHECK_MODULES(libgnutls, gnutls >= 1.6.3 )
 
37
PKG_CHECK_MODULES(libtasn1, libtasn1 >= 1.1)
 
38
PKG_CHECK_MODULES(libplist, libplist >= 0.15)
 
39
PKG_CHECK_MODULES(libplistmm, libplist++ >= 0.15)
 
40
AC_CHECK_LIB(gcrypt, gcry_control, [AC_SUBST(libgcrypt_LIBS,[-lgcrypt])], ["libgcrypt is required to build libimobiledevice"])
 
41
 
 
42
# Checks for header files.
 
43
AC_HEADER_STDC
 
44
AC_CHECK_HEADERS([arpa/inet.h stdint.h stdlib.h string.h gcrypt.h])
 
45
 
 
46
# Checks for typedefs, structures, and compiler characteristics.
 
47
AC_C_CONST
 
48
AC_TYPE_SIZE_T
 
49
AC_TYPE_SSIZE_T
 
50
AC_TYPE_UINT16_T
 
51
AC_TYPE_UINT32_T
 
52
AC_TYPE_UINT8_T
 
53
 
 
54
# Checks for library functions.
 
55
AC_FUNC_MALLOC
 
56
AC_FUNC_REALLOC
 
57
AC_CHECK_FUNCS([strcasecmp strdup strerror strndup])
 
58
 
 
59
python_bindings=yes
 
60
AC_ARG_WITH([swig],
 
61
            [AS_HELP_STRING([--without-swig],
 
62
            [build Python bindings using swig (default is yes)])],
 
63
            [build_swig=false],
 
64
            [build_swig=true])
 
65
if test "$build_swig" = "true" -a "$SWIG" != "false" ; then
 
66
            SWIG_SUB=swig
 
67
else
 
68
            SWIG_SUB=
 
69
            python_bindings=no
 
70
fi
 
71
 
 
72
AM_CONDITIONAL([HAVE_SWIG],[test "x$SWIG_SUB" = "xswig"])
 
73
 
 
74
AC_SUBST([DEV_SUB])
 
75
 
 
76
 
 
77
AC_ARG_ENABLE([dev-tools],
 
78
            [AS_HELP_STRING([--enable-dev-tools],
 
79
            [build development helper tools (default is no)])],
 
80
            [build_dev_tools=true],
 
81
            [build_dev_tools=false])
 
82
if test "$build_dev_tools" = true; then
 
83
            DEV_SUB=dev
 
84
            AC_CHECK_HEADERS([readline/readline.h],
 
85
                             [],
 
86
                             [AC_MSG_ERROR([Please install readline development headers])]
 
87
            )
 
88
            building_dev_tools=yes
 
89
else
 
90
            DEV_SUB=
 
91
            building_dev_tools=no
 
92
fi
 
93
 
 
94
AM_CONDITIONAL([ENABLE_DEVTOOLS],[test "x$DEV_SUB" = "xdev"])
 
95
 
 
96
AC_SUBST([DEV_SUB])
 
97
 
 
98
AC_ARG_ENABLE([debug-code],
 
99
            [AS_HELP_STRING([--disable-debug-code],
 
100
            [disable debug message reporting in library (default is yes)])],
 
101
            [no_debug_code=false],
 
102
            [no_debug_code=true])
 
103
if test "$no_debug_code" = true; then
 
104
        building_debug_code=no
 
105
        AC_DEFINE(STRIP_DEBUG_CODE,1,[Strip debug reporting code])
 
106
else
 
107
        building_debug_code=yes
 
108
fi
 
109
 
 
110
AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith  -Wwrite-strings -Wswitch-default -Wno-unused-parameter")
 
111
AC_SUBST(GLOBAL_CFLAGS)
 
112
 
 
113
# check for large file support
 
114
AC_SYS_LARGEFILE
 
115
LFS_CFLAGS=''
 
116
if test "$enable_largefile" != no; then
 
117
    if test "$ac_cv_sys_file_offset_bits" != 'no'; then
 
118
        LFS_CFLAGS="$LFS_CFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
 
119
    else
 
120
        AC_MSG_CHECKING(for native large file support)
 
121
        AC_RUN_IFELSE([#include <unistd.h>
 
122
          int main (int argc, char **argv)
 
123
          {
 
124
              exit(!(sizeof(off_t) == 8));
 
125
          }],
 
126
        [ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
 
127
         AC_MSG_RESULT(yes)],
 
128
        [AC_MSG_RESULT(no)])
 
129
    fi
 
130
    if test "$ac_cv_sys_large_files" != 'no'; then
 
131
        LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES=1"
 
132
    fi
 
133
    AC_FUNC_FSEEKO
 
134
    if test "$ac_cv_sys_largefile_source" != 'no'; then
 
135
        LFS_CFLAGS="$LFS_CFLAGS -D_LARGEFILE_SOURCE=1"
 
136
    fi
 
137
fi
 
138
AC_SUBST(LFS_CFLAGS)
 
139
 
 
140
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 
141
 
 
142
AC_OUTPUT([
 
143
Makefile
 
144
src/Makefile
 
145
include/Makefile
 
146
fdi/Makefile
 
147
dev/Makefile
 
148
tools/Makefile
 
149
swig/Makefile
 
150
libimobiledevice-1.0.pc
 
151
])
 
152
 
 
153
echo "
 
154
Configuration for $PACKAGE $VERSION:
 
155
-------------------------------------------
 
156
 
 
157
  Install prefix: .........: $prefix
 
158
  Debug code ..............: $building_debug_code
 
159
  Dev tools ...............: $building_dev_tools
 
160
  Python bindings .........: $python_bindings
 
161
 
 
162
  Now type 'make' to build $PACKAGE $VERSION,
 
163
  and then 'make install' for installation.
 
164
"