File: configure.in

package info (click to toggle)
gtkpod 0.99.14-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 7,716 kB
  • ctags: 3,266
  • sloc: ansic: 43,120; sh: 4,837; xml: 1,316; lex: 637; perl: 264; makefile: 236; awk: 73; python: 35
file content (331 lines) | stat: -rw-r--r-- 13,347 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
dnl Process this file with autoconf to produce a configure script.

# Require autoconf 2.55 or higher
AC_PREREQ(2.55)

AC_INIT(configure.in)
AM_INIT_AUTOMAKE(gtkpod, 0.99.14)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC

IT_PROG_INTLTOOL([0.33])

dnl Only use -Wall if we have gcc
if test "x$GCC" = "xyes"; then
    if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
        CFLAGS="$CFLAGS -Wall"
    fi
    # gcc < 4.0 does not know '-Wno-pointer-sign'. Try to find out
    # whether we can set this option or not.
    CFLAGS_orig=$CFLAGS
    CFLAGS="$CFLAGS -Wno-pointer-sign"
    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]])],
                      [], [CFLAGS=$CFLAGS_orig])
fi

GETTEXT_PACKAGE=gtkpod
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",["Gettext package name"])

dnl check if pkg-config exists -- if not print a meaningful error message
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
if test -z "$PKG_CONFIG"; then
    AC_MSG_FAILURE([*** pkg-config required (http://www.freedesktop.org/software/pkgconfig)])
else
    ac_cv_env_PKG_CONFIG_set=set
fi

dnl check for required libs that are managed with pkg-config
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8.0,, [AC_MSG_FAILURE([*** $GTK_PKG_ERRORS])])
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.8.0,, [AC_MSG_FAILURE([*** $GLIB_PKG_ERRORS])])
PKG_CHECK_MODULES(GMODULE, gmodule-2.0,, [AC_MSG_FAILURE([*** $GMODULE_PKG_ERRORS])])
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 0.14.0,, [AC_MSG_FAILURE([*** $GTHREAD_PKG_ERRORS])])
PKG_CHECK_MODULES(LIBGLADE, libglade-2.0 >= 2.4.0,, [AC_MSG_FAILURE([*** $LIBGLADE_PKG_ERRORS])])
PKG_CHECK_MODULES(LIBGPOD, libgpod-1.0 >= 0.6.1,, [AC_MSG_FAILURE([*** $LIBGPOD_PKG_ERRORS])])

CFLAGS="$CFLAGS $GTK_CFLAGS $GLIB_CFLAGS $GMODULE_CFLAGS $GTHREAD_CFLAGS $LIBGLADE_CFLAGS $LIBGPOD_CFLAGS"
LIBS="$LIBS $GTK_LIBS $GLIB_LIBS $GMODULE_LIBS $GTHREAD_LIBS $LIBGLADE_LIBS $LIBGPOD_LIBS"

dnl we need 'flex'
AM_PROG_LEX
case "$LEX" in
flex|*/flex|lex|*/lex)
	;;
*)
        AC_MSG_FAILURE([*** flex or lex required])
	;;
esac

dnl Retrieve the path of mount and umount binaries
AC_PATH_PROG(MOUNT, mount)
AC_SUBST(MOUNT)
AC_PATH_PROG(UMOUNT, umount)
AC_SUBST(UMOUNT)

dnl Add the languages which your application supports here.
ALL_LINGUAS="de es fr he it ja ru ro sv zh_CN"
AM_GLIB_GNU_GETTEXT

dnl Check if we have to supply getopt_long
dnl If getopt_long_only is not available, getopt.c and getopt1.c
dnl (providing getopt_long*) will be included into the binary.
AC_CHECK_FUNCS(getopt_long_only, , [AC_LIBOBJ(getopt)])
AC_CHECK_FUNCS(getopt_long_only, , [AC_LIBOBJ(getopt1)])

dnl Check if flock() is available (seems to be missing on some solaris versions)
AC_CHECK_FUNCS(flock)

dnl Check if statvfs() is available (otherwise we fall back on 'df' to determine
dnl free space on the iPod
AC_CHECK_FUNCS(statvfs)

dnl Check for libid3tag
AC_SEARCH_LIBS([id3_frame_field], ["id3tag" "id3tag -lz"],,
    AC_MSG_ERROR([*** id3tag >= 0.15 lib not found (0.14 will not work!)]))

dnl Check for libcurl
AC_ARG_WITH(curl, AC_HELP_STRING([--without-curl], [Disable coverart download support]))
if test "x$with_curl" != "xno"; then
    PKG_CHECK_MODULES(CURL, [libcurl >= 7.10.0], have_curl=yes, have_curl=no)
    if test "x$with_curl" = "xyes" -a "x$have_curl" = "xno"; then
        AC_MSG_ERROR([curl support explicitly requested but curl couldn't be found])
    fi
fi
AM_CONDITIONAL(HAVE_CURL, test "x$have_curl" = "xyes")
if test "x$have_curl" = "xyes"; then
    AC_DEFINE(HAVE_CURL, 1, [Define if you have curl support])
    have_curl="yes -- will build with coverart download support"
    CPPFLAGS="$CPPFLAGS $CURL_CFLAGS"
    CFLAGS="$CFLAGS $CURL_CFLAGS"
    LIBS="$LIBS $CURL_LIBS"
else
    have_curl="*no -- will build without coverart download support"
fi

dnl Check for gnome-vfs
AC_ARG_WITH(gnome-vfs, AC_HELP_STRING([--without-gnome-vfs],[Disable autodetection support]))
if test "x$with_gnome_vfs" != "xno"; then
    PKG_CHECK_MODULES(GNOME_VFS, [gnome-vfs-2.0 >= 2.6.0], have_gnome_vfs=yes, have_gnome_vfs=no)
    if test "x$with_gnome_vfs" = "xyes" -a "x$have_gnome_vfs" = "xno"; then
        AC_MSG_ERROR([gnome-vfs support explicitly requested but gnome-vfs couldn't be found])
    fi
fi
AM_CONDITIONAL(HAVE_GNOME_VFS, test "x$have_gnome_vfs" = "xyes")
if test "x$have_gnome_vfs" = "xyes"; then
    have_gnome_vfs="yes -- will build with automount support"
    AC_DEFINE(HAVE_GNOME_VFS, 1, [Define if you have gnome-vfs support])
    CPPFLAGS="$CPPFLAGS $GNOME_VFS_CFLAGS"
    CFLAGS="$CFLAGS $GNOME_VFS_CFLAGS"
    LIBS="$LIBS $GNOME_VFS_LIBS"
else
    have_gnome_vfs="*no -- will build without iPod autodetection support"
fi

dnl Check for HAL
AC_ARG_WITH(hal, AC_HELP_STRING([--without-hal],[Disable HAL support]))
if test "x$with_hal" != "xno"; then
    PKG_CHECK_MODULES(HAL, hal >= 0.5 hal < 0.6, have_hal=yes, have_hal=no)
    if test "x$with_hal" = "xyes" -a "x$have_hal" = "xno"; then
        AC_MSG_ERROR([HAL support explicitly requested but HAL couldn't be found])
    fi
fi
AM_CONDITIONAL(HAVE_HAL, test "x$have_hal" = "xyes")
if test "x$have_hal" = "xyes"; then
    have_hal="yes -- will build with HAL support"
    AC_DEFINE(HAVE_HAL, 1, [Define if you have HAL support])
    CPPFLAGS="$CPPFLAGS $HAL_CFLAGS"
    CFLAGS="$CFLAGS $HAL_CFLAGS"
    LIBS="$LIBS $HAL_LIBS"
else
    have_hal="*no -- will build without HAL support"
fi

dnl Check for libmp4v2 (and mp4.h or mp4v2/mp4v2.h)
AC_ARG_WITH(mp4v2, AC_HELP_STRING([--without-mp4v2], [Disable MP4/AAC support]))
if test "x$with_mp4v2" != "xno"; then
    have_mp4v2_2_header=no
    AC_SEARCH_LIBS(MP4GetMetadataGrouping,
        ["mp4v2" "mp4v2 -lstdc++" "mp4v2 -lz" "mp4v2 -lz -lstdc++"],
        [AC_CHECK_HEADER(mp4.h, have_mp4v2=yes, have_mp4v2_header=no)], have_mp4v2=no)
    if test "x$have_mp4v2_header" = "xno"; then
        AC_CHECK_HEADER(mp4v2/mp4v2.h, [have_mp4v2_2_header=yes; have_mp4v2_header=yes; have_mp4v2=yes], have_mp4v2_header=no)
        if test "x$have_mp4v2_2_header" = "xyes"; then
            AC_DEFINE(HAVE_LIBMP4V2_2, 1, [Define if you have the mp4v2 library version 2.0 or greater])
        fi
    fi
    if test "x$have_mp4v2_header" = "xno"; then
        have_mp4v2="no"
        AC_MSG_WARN([mp4.h and mp4v2/mp4v2.h cannot be found or is unusable. Check your mp4v2 installation.])
    else
dnl Check if MP4GetMetadataFreeForm() requires an extra argument
        if test "x$have_mp4v2_2_header" = "xyes"; then
            AC_TRY_COMPILE( [#include <mp4v2/mp4v2.h>],
                [bool TestMP4GetMetadataFreeForm(MP4FileHandle hFile, const char *name,
                    uint8_t** pValue, uint32_t* valueSize, const char *owner)
                    {
                        MP4GetMetadataFreeForm(hFile, name,pValue, valueSize, owner);
                    } ], freeform_accepts_extra_arg=yes)
        else
            AC_TRY_COMPILE( [#include <mp4.h>],
                [bool TestMP4GetMetadataFreeForm(MP4FileHandle hFile, const char *name,
                    u_int8_t** pValue, u_int32_t* valueSize, const char *owner)
                    {
                        MP4GetMetadataFreeForm(hFile, name,pValue, valueSize, owner);
                    } ], freeform_accepts_extra_arg=yes)
        fi
        if test "x$freeform_accepts_extra_arg" = "xyes"; then
            AC_DEFINE(FREEFORM_ACCEPTS_EXTRA_ARG, 1, [MP4GetMetadataFreeForm
                      accepts an extra argument in libmp4v2 >= 1.6])
        fi
dnl Check if MP4GetMetadataCoverArt() requires an extra argument
        if test "x$have_mp4v2_2_header" = "xyes"; then
            AC_TRY_COMPILE( [#include <mp4v2/mp4v2.h>],
                [bool TestMP4GetMetadataCoverArt(MP4FileHandle hFile,
                    uint8_t **coverArt, uint32_t* size, uint32_t index)
                    {
                        MP4GetMetadataCoverArt(hFile, coverArt, size, index);
                    }], coverart_accepts_extra_arg=yes)
        else
            AC_TRY_COMPILE( [#include <mp4.h>],
                [bool TestMP4GetMetadataCoverArt(MP4FileHandle hFile,
                    u_int8_t **coverArt, u_int32_t* size, uint32_t index)
                    {
                        MP4GetMetadataCoverArt(hFile, coverArt, size, index);
                    }], coverart_accepts_extra_arg=yes)
        fi
        if test "x$coverart_accepts_extra_arg" = "xyes"; then
            AC_DEFINE(COVERART_ACCEPTS_EXTRA_ARG, 1, [MP4GetMetadataCoverArt
                      accepts an extra argument in libmp4v2 >= 1.6])
        fi
dnl Check if MP4SetMetadataAlbumArtist() exists
        AC_SEARCH_LIBS([MP4SetMetadataAlbumArtist], [-lmp4v2],
        mp4_albumartist_exists=yes, mp4_albumartist_exists=no)
        if test "x$mp4_albumartist_exists" = "xyes"; then
            AC_DEFINE(MP4_ALBUMARTIST_EXISTS, 1, [MP4GetMetadataAlbumArtist
                      requires libmp4v2 >= 1.6])
        fi
    fi
    if test "x$with_mp4v2" = "xyes" -a "x$have_mp4v2" = "xno"; then
        AC_MSG_ERROR([MP4/AAC support explicitly requested but libmp4v2 couldn't be found])
    fi
fi
AM_CONDITIONAL(HAVE_LIBMP4V2, test "x$have_mp4v2" = "xyes")
if test "x$have_mp4v2" = "xyes"; then
    have_mp4v2="yes -- will build with aac support"
    AC_DEFINE(HAVE_LIBMP4V2, 1, [Define if you have the mp4v2 library])
else
    have_mp4v2="*no -- will build without aac support"
fi

dnl Check for libvorbisfile
AC_ARG_WITH(ogg, AC_HELP_STRING([--without-ogg], [Disable Ogg/Vorbis support]))
if test "x$with_ogg" != "xno"; then
    AC_SEARCH_LIBS(ov_open, ["vorbisfile"],
        [AC_CHECK_HEADER(vorbis/vorbisfile.h, have_ogg=yes, have_ogg_header=no)], have_ogg=no)
    if test "x$have_ogg_header" = "xno"; then
        have_ogg="no"
        AC_MSG_WARN([vorbis/vorbisfile.h cannot be found or is unusable. Check your ogg/vorbis installation.])
    fi
    if test "x$with_ogg" = "xyes" -a "x$have_ogg" = "xno"; then
        AC_MSG_ERROR([Ogg/Vorbis support explicitly requested but ogg/vorbis libs couldn't be found])
    fi
fi
AM_CONDITIONAL(HAVE_LIBVORBISFILE, test "x$have_ogg" = "xyes")
if test "x$have_ogg" = "xyes"; then
    have_ogg="yes -- will build with ogg support"
    AC_DEFINE(HAVE_LIBVORBISFILE, 1, [Define if you have the ogg/vorbis library])
else
    have_ogg="*no -- will build without ogg support"
fi

dnl Check for FLAC
AC_ARG_WITH(flac, AC_HELP_STRING([--without-flac], [Disable FLAC support]))
if test "x$with_flac" != "xno"; then
    AC_SEARCH_LIBS(FLAC__metadata_get_streaminfo, ["FLAC"],
        [AC_CHECK_HEADER(FLAC/metadata.h, have_flac=yes, have_flac_header=no)], have_flac=no)
    if test "x$have_flac_header" = "xno"; then
        have_flac="no"
        AC_MSG_WARN([FLAC/metadata.h cannot be found or is unusable. Check your FLACinstallation.])
    fi
    if test "xwith_flac" = "xyes" -a "x$have_flac" = "xno"; then
        AC_MSG_ERROR([FLAC support explicitly requested but flac libs couldn't be found])
    fi
fi
AM_CONDITIONAL(HAVE_FLAC, test "x$have_flac" = "xyes")
if test "x$have_flac" = "xyes"; then
    have_flac="yes -- will build with FLAC support"
    AC_DEFINE(HAVE_FLAC, 1, [Define if you have the flac library])
else
    have_flac="*no -- will build without FLAC support"
fi

dnl Additional libs maybe needed when compiling under solaris
AC_SEARCH_LIBS(bind, ["socket" "nsl" "socket -lnsl"])

dnl Check for Linux-specific headers (so we can compile Linux-specific
dnl stuff only when compiling under Linux)
AC_CHECK_HEADERS(linux/cdrom.h scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h)

libgpod_version=`$PKG_CONFIG libgpod-1.0 --modversion`
AC_DEFINE_UNQUOTED(LIBGPOD_VERSION, "${libgpod_version}", [Set this to the libgpod version])

AC_OUTPUT([
Makefile
src/Makefile
po/Makefile.in
scripts/Makefile
data/Makefile
data/icons/Makefile
data/icons/16x16/Makefile
data/icons/22x22/Makefile
data/icons/24x24/Makefile
data/icons/32x32/Makefile
data/icons/48x48/Makefile
data/icons/64x64/Makefile
data/icons/scalable/Makefile
data/icons/hicolor/Makefile
data/icons/hicolor/16x16/Makefile
data/icons/hicolor/16x16/places/Makefile
data/icons/hicolor/16x16/status/Makefile
data/icons/hicolor/22x22/Makefile
data/icons/hicolor/22x22/places/Makefile
data/icons/hicolor/24x24/Makefile
data/icons/hicolor/24x24/places/Makefile
data/icons/hicolor/32x32/Makefile
data/icons/hicolor/32x32/places/Makefile
data/icons/hicolor/48x48/Makefile
data/icons/hicolor/48x48/places/Makefile
data/icons/hicolor/scalable/Makefile
data/icons/hicolor/scalable/places/Makefile
data/man/Makefile
data/man/gtkpod.1
doc/Makefile
doc/figures/Makefile
])

echo "
Configuration for $PACKAGE $VERSION :
--------------------------------

 Host System Type .....: $host
 Install path .........: $prefix
 GTK2 version .........: `$PKG_CONFIG gtk+-2.0 --modversion`
 GLib2/GThread version : `$PKG_CONFIG gthread-2.0 --modversion`
 libgpod version ......: $libgpod_version
 gnome-vfs.............: $have_gnome_vfs
 hal...................: $have_hal
 libcurl ..............: $have_curl
 mp4v2 ................: $have_mp4v2
 vorbisfile ...........: $have_ogg
 FLAC .................: $have_flac
 Preprocessor .........: $CC $CPPFLAGS
 Compiler .............: $CC $CFLAGS
 Linker ...............: $CC $LDFLAGS $LIBS

 Now type 'make' to build $PACKAGE $VERSION,
 and then 'make install' for installation.
"