~vanvugt/ubuntu/oneiric/mediatomb/fix-770964-784431

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Andres Mejia
  • Date: 2009-04-22 21:39:19 UTC
  • mto: (4.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20090422213919-52m015y6gcpv1m1g
Tags: upstream-0.12.0~svn2018
ImportĀ upstreamĀ versionĀ 0.12.0~svn2018

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
#    Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
8
8
#                       Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
9
9
#    
10
 
#    Copyright (C) 2006-2008 Gena Batyan <bgeradz@mediatomb.cc>,
 
10
#    Copyright (C) 2006-2009 Gena Batyan <bgeradz@mediatomb.cc>,
11
11
#                            Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
12
12
#                            Leonhard Wimmer <leo@mediatomb.cc>
13
13
#    
24
24
#    version 2 along with MediaTomb; if not, write to the Free Software
25
25
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
26
26
#    
27
 
#    $Id: configure.ac 1722 2008-03-01 20:23:14Z jin_eld $
 
27
#    $Id: configure.ac 2015 2009-01-11 23:22:17Z jin_eld $
28
28
#
29
29
#*MT*
30
30
 
31
31
AC_PREREQ(2.61)
32
 
AC_INIT([MediaTomb], [0.11.0], [jin@mediatomb.cc])
 
32
AC_INIT([MediaTomb], [0.12.0], [jin@mediatomb.cc])
33
33
AM_CONFIG_HEADER([autoconfig.h tombupnp/upnp/inc/upnpconfig.h])
34
34
AC_CONFIG_AUX_DIR(configure_aux)
35
35
AC_CONFIG_SRCDIR([src/common.h])
44
44
DARWIN_OS=0
45
45
CYGWIN_OS=0
46
46
FREEBSD_OS=0
 
47
OPENBSD_OS=0
 
48
 
 
49
LIBS_SAVE="$LIBS"
47
50
 
48
51
AC_CANONICAL_HOST
49
52
 
60
63
        ;;
61
64
    *-*-freebsd*)
62
65
        FREEBSD_OS=1
63
 
        ;;
 
66
        ;;
 
67
    *-*-openbsd*)
 
68
        OPENBSD_OS=1
 
69
        ;;
64
70
esac
65
71
 
66
 
AC_ARG_WITH(search, 
67
 
        AC_HELP_STRING([--with-search=DIR], [Additionally search for packages in DIR]),
68
 
        [
69
 
            SEARCH_DIR=$withval
70
 
            AC_MSG_NOTICE([Will also search for packages in $SEARCH_DIR])
71
 
        ]
72
 
)
 
72
MT_SET_SEARCHPATH
 
73
 
 
74
#AC_ARG_WITH(search, 
 
75
#        AC_HELP_STRING([--with-search=DIR], [Additionally search for packages in DIR]),
 
76
#        [
 
77
#            SEARCH_DIR=$withval
 
78
#            AC_MSG_NOTICE([Will also search for packages in $SEARCH_DIR])
 
79
#        ]
 
80
#)
73
81
 
74
82
SEARCH_DIR_HEADERS="$SEARCH_DIR/include"
75
83
SEARCH_DIR_LIBS="$SEARCH_DIR/lib"
76
84
SEARCH_DIR_PROGS="$SEARCH_DIR/bin"
77
85
    
78
86
# per package header and library search paths
79
 
AC_ARG_WITH(sqlite3-h, 
80
 
        AC_HELP_STRING([--with-sqlite3-h=DIR], [search for sqlite3 headers only in DIR]),
81
 
        [
82
 
            SQLITE3_SEARCH_HEADERS="$withval"
83
 
        ]
84
 
)
85
 
 
86
 
AC_ARG_WITH(sqlite3-libs, 
87
 
        AC_HELP_STRING([--with-sqlite3-libs=DIR], [search for sqlite3 libraries only in DIR]),
88
 
        [
89
 
            SQLITE3_SEARCH_LIBS="$withval"
90
 
        ]
91
 
)
92
 
 
93
 
AC_ARG_WITH(mysql-cfg,
94
 
        AC_HELP_STRING([--with-mysql-cfg=mysql_config], [absolute path/name of mysql_config]),
95
 
        [
96
 
            MYSQL_SEARCH_CONFIG="$withval"
97
 
        ]
98
 
)
99
 
 
100
 
# AC_ARG_WITH(pg-cfg,
101
 
#       AC_HELP_STRING([--with-pg-cfg=pg_config], [absolute path/name of pg_config (for the PostgreSQL database)]),
102
 
#        [
103
 
#            PGSQL_SEARCH_CONFIG="$withval"
104
 
#        ]
105
 
#)
106
 
 
107
 
 
108
87
 
109
88
AC_ARG_WITH(js-h,
110
89
        AC_HELP_STRING([--with-js-h=DIR], [search for js (spidermonkey) headers in DIR]),
120
99
        ]
121
100
)
122
101
 
123
 
AC_ARG_WITH(magic-h,
124
 
        AC_HELP_STRING([--with-magic-h=DIR], [search for filemagic headers in DIR]),
125
 
        [
126
 
            MAGIC_SEARCH_HEADERS="$withval"
127
 
        ]
128
 
)
129
 
 
130
 
AC_ARG_WITH(magic-libs,
131
 
        AC_HELP_STRING([--with-magic-libs=DIR], [search for filemagic libraries in DIR]),
132
 
        [
133
 
            MAGIC_SEARCH_LIBS="$withval"
134
 
        ]
135
 
)
136
 
 
137
 
 
138
 
AC_ARG_WITH(exif-h,
139
 
        AC_HELP_STRING([--with-exif-h=DIR], [search for libexif headers in DIR]),
140
 
        [
141
 
            EXIF_SEARCH_HEADERS="$withval"
142
 
            AC_MSG_NOTICE([Will search for libexif headers in $withval])
143
 
        ]
144
 
)
145
 
 
146
 
AC_ARG_WITH(exif-libs,
147
 
        AC_HELP_STRING([--with-exif-libs=DIR], [search for libexif libraries in DIR]),
148
 
        [
149
 
            EXIF_SEARCH_LIBS="$withval"
150
 
            AC_MSG_NOTICE([Will search for libexif libraries in $withval])
151
 
        ]
152
 
)
153
 
 
154
 
AC_ARG_WITH(expat-h,
155
 
        AC_HELP_STRING([--with-expat-h=DIR], [search for expat headers in DIR]),
156
 
        [
157
 
            EXPAT_SEARCH_HEADERS="$withval"
158
 
            AC_MSG_NOTICE([Will search for expat headers in $withval])
159
 
        ]
160
 
)
161
 
 
162
 
AC_ARG_WITH(expat-libs,
163
 
        AC_HELP_STRING([--with-expat-libs=DIR], [search for expat libraries in DIR]),
164
 
        [
165
 
            EXPAT_SEARCH_LIBS="$withval"
166
 
            AC_MSG_NOTICE([Will search for libexif libraries in $withval])
167
 
        ]
168
 
)
169
 
 
170
 
 
171
 
AC_ARG_WITH(taglib-cfg,
172
 
        AC_HELP_STRING([--with-taglib-cfg=taglib-config], [absolute path/name of taglib-config]),
173
 
        [
174
 
            TAGLIB_SEARCH_CONFIG="$withval"
175
 
            AC_MSG_NOTICE([Will search for taglib-config in $withval])
176
 
        ]
177
 
)
178
 
 
179
 
AC_ARG_WITH(id3lib-h,
180
 
        AC_HELP_STRING([--with-id3lib-h=DIR], [search for id3lib headers in DIR]),
181
 
        [
182
 
            ID3_SEARCH_HEADERS="$withval"
183
 
            AC_MSG_NOTICE([Will search for id3lib headers in $withval])
184
 
        ]
185
 
)
186
 
 
187
 
AC_ARG_WITH(id3lib-libs,
188
 
        AC_HELP_STRING([--with-id3lib-libs=DIR], [search for id3lib libraries in DIR]),
189
 
        [
190
 
            ID3_SEARCH_LIBS="$withval"
191
 
            AC_MSG_NOTICE([Will search for id3 libraries in $withval])
192
 
        ]
193
 
)
194
 
 
195
 
AC_ARG_WITH(zlib-h,
196
 
        AC_HELP_STRING([--with-zlib-h=DIR], [search for zlib headers in DIR]),
197
 
        [
198
 
            Z_SEARCH_HEADERS="$withval"
199
 
        ]
200
 
)
201
 
 
202
 
AC_ARG_WITH(zlib-libs,
203
 
        AC_HELP_STRING([--with-zlib-libs=DIR], [search for zlib libraries in DIR]),
204
 
        [
205
 
            Z_SEARCH_LIBS="$withval"
206
 
        ]
207
 
)
208
 
 
209
 
AC_ARG_WITH(inotify-h,
210
 
        AC_HELP_STRING([--with-inotify-h=DIR], [search for inotify header in DIR/sys]),
211
 
        [
212
 
            INOTIFY_SEARCH_HEADERS="$withval"
213
 
            AC_MSG_NOTICE([Will search for inotify header in $withval/sys])
214
 
        ]
215
 
)
216
 
 
217
102
AC_ARG_WITH(iconv-h,
218
103
        AC_HELP_STRING([--with-iconv-h=DIR], [search for iconv headers in DIR]),
219
104
        [
230
115
        ]
231
116
)
232
117
 
233
 
AC_ARG_WITH(ffmpeg-h,
234
 
        AC_HELP_STRING([--with-ffmpeg-h=DIR], [search for ffmpeg headers in DIR]),
235
 
        [
236
 
            FFMPEG_SEARCH_HEADERS="$withval"
237
 
            AC_MSG_NOTICE([Will search for ffmpeg headers in $withval])
238
 
        ]
239
 
)
240
 
 
241
 
AC_ARG_WITH(ffmpeg-libs,
242
 
        AC_HELP_STRING([--with-ffmpeg-libs=DIR], [search for ffmpeg libraries in DIR]),
243
 
        [
244
 
            FFMPEG_SEARCH_LIBS="$withval"
245
 
            AC_MSG_NOTICE([Will search for ffmpeg libraries in $withval])
246
 
        ]
247
 
)
248
 
 
249
 
AC_ARG_WITH(extractor-h,
250
 
        AC_HELP_STRING([--with-extractor-h=DIR], [search for extractor headers in DIR]),
251
 
        [
252
 
            EXTRACTOR_SEARCH_HEADERS="$withval"
253
 
            AC_MSG_NOTICE([Will search for extractor headers in $withval])
254
 
        ]
255
 
)
256
 
 
257
 
AC_ARG_WITH(extractor-libs,
258
 
        AC_HELP_STRING([--with-extractor-libs=DIR], [search for extractor libraries in DIR]),
259
 
        [
260
 
            EXTRACTOR_SEARCH_LIBS="$withval"
261
 
            AC_MSG_NOTICE([Will search for extractor libraries in $withval])
262
 
        ]
263
 
)
264
 
 
265
 
STATIC="no"
266
 
 
267
 
AC_ARG_ENABLE(static, 
268
 
        AC_HELP_STRING([--enable-static], [build a static version of MediaTomb (default: no)]),
269
 
        [
270
 
            if test "x$enableval" = xyes; then
271
 
                CFLAGS="$CFLAGS -static"
272
 
                CXXFLAGS="$CXXFLAGS -static"
273
 
                AC_MSG_NOTICE([Building a static executable.])
274
 
                STATIC="yes"
275
 
            fi
276
 
        ]
277
 
)
278
 
 
279
 
AUTOCREATE=1
280
 
AUTOCREATE_PRINT="0"
281
 
AUTOCREATE_REQUESTED=0
282
 
AC_ARG_ENABLE(db-autocreate,
283
 
        AC_HELP_STRING([--enable-db-autocreate], [enable automatic creation of the media database (default: yes)]),
284
 
        [
285
 
            if test "x$enableval" = xno; then
286
 
                AUTOCREATE=0
287
 
                AUTOCREATE_PRINT="disabled"
288
 
            else
289
 
                AUTOCREATE_REQUESTED=1
290
 
                AUTOCREATE_PRINT="yes"
291
 
                AUTOCREATE=1
292
 
            fi
293
 
        ],
294
 
        [
295
 
            AUTOCREATE=1
296
 
        ]
297
 
)
298
 
 
299
 
DEBUG_MALLOC_0=0
300
 
AC_ARG_ENABLE([debug-malloc0],
301
 
              [
302
 
AC_HELP_STRING([--enable-debug-malloc0],
303
 
[only for debugging purposes: abort when we try to call malloc or realloc with a value of zero (default: no)])
304
 
            ],
305
 
            [
306
 
                if test "x$enableval" = xno; then
307
 
                    DEBUG_MALLOC_0=0
308
 
                else
309
 
                    DEBUG_MALLOC_0=1
310
 
                fi
311
 
            ]
312
 
)
313
 
 
314
 
if test $DEBUG_MALLOC_0 -eq 1; then
315
 
    AC_DEFINE([DEBUG_MALLOC_0], [1], [debug: abort on malloc/realloc of zero bytes])
316
 
fi
317
 
 
318
 
PTHREAD_FORCE_LIB=0
319
 
AC_ARG_ENABLE([pthread-lib],
320
 
              [
321
 
AC_HELP_STRING([--enable-pthread-lib],
322
 
[if this option is set we will try to link with -lpthread, else the flag for pthread will be autodetected (default: no)])
323
 
            ],
324
 
            [
325
 
                if test "x$enableval" = xno; then
326
 
                    PTHREAD_FORCE_LIB=0
327
 
                else
328
 
                    PTHREAD_FORCE_LIB=1
329
 
                fi
330
 
            ]
331
 
)
332
 
 
333
 
ICONV_FORCE_LIB=0
334
 
AC_ARG_ENABLE([iconv-lib],
335
 
              [
336
 
AC_HELP_STRING([--enable-iconv-lib],
337
 
[if this option is set we will try to link with -liconv, else we will first try to use iconv built into glibc and only then search for libiconv (default: no)])
338
 
            ],
339
 
            [
340
 
                if test "x$enableval" = xno; then
341
 
                    ICONV_FORCE_LIB=0
342
 
                else
343
 
                    ICONV_FORCE_LIB=1
344
 
                fi
345
 
            ]
346
 
)
 
118
MT_OPTION([static], [enable],
 
119
          [build a static version of MediaTomb],
 
120
          [
 
121
            CFLAGS="$CFLAGS -static"
 
122
            CXXFLAGS="$CXXFLAGS -static"
 
123
            AC_MSG_NOTICE([Building a static executable.])
 
124
          ],
 
125
          [])
 
126
 
 
127
MT_OPTION([db-autocreate], [disable],
 
128
          [automatic creation of the database],[],[])
 
129
 
 
130
MT_OPTION([debug-malloc0], [enable],
 
131
          [only for debugging purposes: abort when we try to call malloc or realloc with a value of zero],
 
132
          [
 
133
            AC_DEFINE([DEBUG_MALLOC_0], [1], 
 
134
                      [debug: abort on malloc/realloc of zero bytes])
 
135
          ],
 
136
          [])
 
137
 
 
138
 
 
139
MT_OPTION([pthread-lib], [enable],
 
140
          [if this option is set we will try to link with -lpthread, else the flag for pthread will be autodetected], [], [])
 
141
 
 
142
MT_OPTION([iconv-lib], [enable],
 
143
          [if this option is set we will try to link with -liconv, else we will first try to use iconv built into glibc and only then search for libiconv],
 
144
          [],[])
 
145
 
347
146
 
348
147
ATOMIC_X86_SMP=0
349
148
ATOMIC_X86_SMP_REQ=0
353
152
        ATOMIC_X86_SMP=1
354
153
        X86=1
355
154
    ;;
 
155
    *86*64)
 
156
        ATOMIC_X86_SMP=1
 
157
        X86=1
 
158
    ;;
356
159
esac
357
160
 
358
161
ATOMIC_X86=0
359
 
AC_ARG_ENABLE([atomic-x86-single],
360
 
              [
361
 
AC_HELP_STRING([--enable-atomic-x86-single],
362
 
[use x86 singleprocessor code for atomic arithmetic operations, this will increase performance but you must not use the compiled binary on an SMP system. Doing so might result in crashes and unexpected behaviour (default: no)])
363
 
            ],
364
 
            [
365
 
                if test "x$enableval" = xno; then
366
 
                    ATOMIC_X86=0 
367
 
                else
368
 
                    if test "$X86" -eq 1; then
369
 
                        ATOMIC_X86=1
370
 
                        ATOMIC_X86_SMP=0
371
 
                    else
372
 
                        AC_MSG_ERROR([Tried to activate x86 specific option for a non x86 host!])
373
 
                    fi
374
 
                fi
375
 
            ]
376
 
)
 
162
 
 
163
MT_OPTION([atomic-x86-single], [enable], 
 
164
          [use x86 singleprocessor code for atomic arithmetic operations, this will increase performance but you must not use the compiled binary on an SMP system. Doing so might result in crashes and unexpected behaviour],
 
165
          [
 
166
              if test "$X86" -eq 1; then
 
167
                    ATOMIC_X86=1
 
168
                    ATOMIC_X86_SMP=0
 
169
              else
 
170
                    AC_MSG_ERROR([Tried to activate x86 specific option for a non x86 host!])
 
171
              fi
 
172
          ],
 
173
          [])
377
174
 
378
175
AC_ARG_ENABLE([atomic-pthread],
379
176
              [
385
182
                    if test "$ATOMIC_X86" -eq 1; then
386
183
                        AC_MSG_ERROR([You can not use atomic-x86-single and atomic-pthread code at the same time!])
387
184
                    else
388
 
 
389
185
                        ATOMIC_X86=0 
390
186
                        ATOMIC_X86_SMP=0 
391
187
                    fi
393
189
            ]
394
190
)
395
191
 
396
 
 
397
 
AC_ARG_ENABLE([atomic],
398
 
              [
399
 
AC_HELP_STRING([--disable-atomic],
400
 
[NEVER use this! This is only for devel/debugging - disables all atomic arithmetics code (default: no)])
401
 
            ],
402
 
            [
403
 
                if test "x$enableval" = xno; then
404
 
                        ATOMIC_X86=0
405
 
                        ATOMIC_X86_SMP=0
406
 
 
407
 
                        AC_MSG_WARN(You disabled the use of atomic arithmetics! You have been warned!)
408
 
                        AC_DEFINE([ATOMIC_TORTURE], [1], [NEVER use this! This is only for devel/debugging - disables all atomic arithmetics code.])
409
 
                fi
410
 
            ]
411
 
)
412
 
 
413
 
 
 
192
MT_OPTION([atomic], [disable],
 
193
          [NEVER disable this! This is only for devel/debugging - disables all atomic arithmetics code],
 
194
          [],
 
195
          [
 
196
              ATOMIC_X86=0
 
197
              ATOMIC_X86_SMP=0
 
198
              AC_MSG_WARN(You disabled the use of atomic arithmetics! You have been warned!)
 
199
               AC_DEFINE([ATOMIC_TORTURE], [1], [NEVER use this! This is only for devel/debugging - disables all atomic arithmetics code.])
 
200
          ])
414
201
 
415
202
if ((test $ATOMIC_X86_SMP -eq 1) && (test $ATOMIC_X86 -eq 1)); then
416
203
    AC_MSG_ERROR([Cannot use atomic-x86-smp and atomic-x86 options at the same time!])
452
239
    AC_DEFINE([ENABLE_SIGHUP], [1], [enable SIGHUP handling])
453
240
fi
454
241
 
455
 
AC_ARG_ENABLE([mrreg-service],
456
 
              [
457
 
AC_HELP_STRING([--enable-mrreg-service],
458
 
[Enable the X_MS_MediaReceiverRegistrar UPnP service. This is for future XBox 360 support, other renderers will probably not need it (default: no)])
459
 
              ],
460
 
              [
461
 
                if test "x$enableval" = xyes; then
462
 
                    AC_DEFINE([ENABLE_MRREG], [1], [Enable the X_MS_MediaReceiverRegistrar UPnP service. This is for future XBox 360 support, other renderers will probably not need it])
463
 
                fi 
464
 
              ]
465
 
)
466
 
 
467
 
EXTERNAL_TRANSCODING=1
468
 
AC_ARG_ENABLE([external-transcoding],
469
 
                      [
470
 
AC_HELP_STRING([--disable-external-transcoding],
471
 
[enable external transcoding support (default: yes)])
472
 
              ],
473
 
              [
474
 
                if test "x$enableval" = xno; then
475
 
                    EXTERNAL_TRANSCODING=0
476
 
                else
477
 
                    EXTERNAL_TRANSCODING=1
478
 
                fi
479
 
              ]
480
 
)
481
 
 
482
 
EXTEND_PROTINFO=1
483
 
AC_ARG_ENABLE([protocolinfo-extension],
484
 
              [
485
 
AC_HELP_STRING([--enable-protocolinfo-extension],
486
 
[This is required for Playstation 3 support, it adds certain tags to the protocolInfo attribute (default: yes)])
487
 
              ],
488
 
              [
489
 
                if test "x$enableval" = xno; then
490
 
                    EXTEND_PROTINFO=0
491
 
                else
492
 
                    EXTEND_PROTINFO=1
493
 
                fi 
494
 
              ]
495
 
)
496
 
 
497
 
if test $EXTEND_PROTINFO -eq 1; then
498
 
    AC_DEFINE([EXTEND_PROTOCOLINFO], [1], [This is required for Playstation 3 support, it adds certain tags to the protocolInfo attribute])
499
 
fi
500
 
 
501
 
YOUTUBE=0
502
 
YOUTUBE_REQUESTED=0
503
 
dnl
504
 
dnl AC_ARG_ENABLE([youtube],
505
 
dnl               [
506
 
dnl AC_HELP_STRING([--enable-youtube],
507
 
dnl [Enable support for the YouTube service (default: yes)])
508
 
dnl               ],
509
 
dnl              [
510
 
dnl                if test "x$enableval" = xno; then
511
 
dnl                    YOUTUBE=0
512
 
dnl                else
513
 
dnl                    YOUTUBE_REQUESTED=1
514
 
dnl                    YOUTUBE=1
515
 
dnl                fi 
516
 
dnl              ]
517
 
dnl )
518
 
 
 
242
MT_OPTION([mrreg-service], [enable],
 
243
          [Enable the X_MS_MediaReceiverRegistrar UPnP service. This is for future XBox 360 support, other renderers will probably not need it],
 
244
          [
 
245
            AC_DEFINE([ENABLE_MRREG], [1], [Enable the X_MS_MediaReceiverRegistrar UPnP service. This is for future XBox 360 support, other renderers will probably not need it])
 
246
          ],[])
 
247
 
 
248
MT_OPTION([external-transcoding], [disable],
 
249
          [external transcoding support],
 
250
          [],[EXTERNAL_TRANSCODING_OPTION_ENABLED=disabled])
 
251
 
 
252
MT_OPTION([sopcast], [enable],
 
253
          [SopCast service support],
 
254
          [
 
255
            AC_DEFINE([SOPCAST], [1], [SopCast service support])
 
256
          ],[SOPCAST_OPTION_ENABLED=disabled])
 
257
 
 
258
 
 
259
MT_OPTION([youtube], [disable],
 
260
          [YouTube service support],
 
261
          [],[YOUTUBE_OPTION_ENABLED=disabled])
 
262
 
 
263
MT_OPTION([weborama], [enable],
 
264
          [Weborama service support],
 
265
          [],[WEBORAMA_OPTION_ENABLED=disabled])
 
266
 
 
267
MT_OPTION([atrailers], [disable],
 
268
          [Apple Trailers service support],
 
269
          [],[ATRAILERS_OPTION_ENABLED=disabled])
 
270
 
 
271
MT_OPTION([sqlite-backup-defaults], [enable],
 
272
          [enable sqlite database backup settings in config.xml by default],
 
273
          [],[])
 
274
 
 
275
MT_OPTION([protocolinfo-extension], [disable],
 
276
          [This is required for Playstation 3 support, it adds certain tags to the protocolInfo attribute],
 
277
          [
 
278
            AC_DEFINE([EXTEND_PROTOCOLINFO], [1], [This is required for Playstation 3 support, it adds certain tags to the protocolInfo attribute])
 
279
          ],[])
519
280
 
520
281
USE_CURL=1
521
282
CURL_REQUESTED=0
522
283
AC_ARG_ENABLE([curl],
523
284
              [
524
285
AC_HELP_STRING([--enable-curl],
525
 
[Enable curl support (provides additional functionality for the external transcoding feature (default: auto)])
 
286
[Enable curl support (required for YouTube support, provides additional functionality for the external transcoding feature (default: auto)])
526
287
              ],
527
288
              [
528
289
                if test "x$enableval" = xno; then
546
307
            ]
547
308
)
548
309
 
549
 
 
550
 
SKIP_FSEEKO_TEST=0
551
 
AC_ARG_ENABLE([fseeko-check],
552
 
              [
553
 
AC_HELP_STRING([--disable-fseeko-check],
554
 
[This is a workaround for a bug on some Debian distros, use this if configure fails complaining about off_t (default: no)])
555
 
            ],
556
 
            [
557
 
                if test "x$enableval" = xno; then
558
 
                    SKIP_FSEEKO_TEST=1     
559
 
                fi
560
 
            ]
561
 
)
562
 
 
 
310
MT_OPTION([fseeko-check], [disable],
 
311
          [This is a workaround for a bug on some Debian distros, use this if configure fails complaining about off_t],
 
312
          [],[])
563
313
 
564
314
###############################################################################
565
315
# The following block is derived from the configure.ac script from the 
588
338
AC_LANG_C
589
339
AM_PROG_CC_C_O
590
340
 
591
 
AC_CHECK_HEADERS([syslog.h stddef.h unistd.h arpa/inet.h fcntl.h], [],
 
341
AC_CHECK_HEADERS([time.h syslog.h stddef.h unistd.h arpa/inet.h fcntl.h], [],
592
342
                 [AC_MSG_ERROR(required header not found)]) 
593
343
 
594
344
AC_CHECK_HEADERS([limits.h netdb.h netinet/in.h stdlib.h string.h sys/file.h],
600
350
 
601
351
AC_CHECK_HEADERS([langinfo.h locale.h],[],[AC_MSG_WARN(Header that is required to retrieve system locale not found, will use default value)])
602
352
 
 
353
AC_CHECK_HEADERS([sys/utsname.h])
 
354
 
603
355
AC_CHECK_HEADERS([sched.h ctype.h],[],[])
604
 
AC_CHECK_FUNCS([sched_getparam sched_setparam],[],[])
 
356
AC_CHECK_FUNCS([sched_getparam sched_setparam sched_get_priority_min sched_get_priority_max],[],[])
605
357
   
606
358
AC_CHECK_FUNCS([mkdir], [],
607
359
              [AC_MSG_ERROR(required function not found)])
627
379
CXXFLAGS_SAVE="$CXXFLAGS"
628
380
LDFLAGS_SAVE="$LDFLAGS"
629
381
 
630
 
if test $EXTERNAL_TRANSCODING -eq 1; then
631
 
    AC_CHECK_FUNCS([mkfifo],[],
632
 
                   [
633
 
                        AC_MSG_ERROR([mkfifo is required by the external transcoding feature])
634
 
                   ]
 
382
if test "x$EXTERNAL_TRANSCODING_OPTION_ENABLED" = xyes; then
 
383
    AC_CHECK_FUNCS([mkfifo],
 
384
       [
 
385
            AC_DEFINE([EXTERNAL_TRANSCODING], [1], [external transcoding feature])
 
386
       ],
 
387
       [
 
388
           if test "x$EXTERNAL_TRANSCODING_OPTION_REQUESTED" = xyes; then
 
389
               AC_MSG_ERROR([mkfifo is required by the external transcoding feature])
 
390
           else
 
391
               AC_MSG_WARN([mkfifo is required by the external transcoding feature])
 
392
               EXTERNAL_TRANSCODING_OPTION_ENABLED=disabled
 
393
 
 
394
           fi
 
395
       ]
635
396
    )
636
 
    AC_DEFINE([EXTERNAL_TRANSCODING], [1], [external transcoding feature])
637
 
    EXTERNAL_TRANSCODING_OK=yes
638
 
else
639
 
    EXTERNAL_TRANSCODING_OK=disabled
640
397
fi
641
398
 
642
399
ICONV_CXXFLAGS=
683
440
 
684
441
LIBICONV=0
685
442
if test -n "$ICONV_SEARCH_LIBS"; then
686
 
    if test $ICONV_FORCE_LIB -eq 0; then
 
443
    if test "x$ICONV_LIB_OPTION_ENABLED" = xno; then
687
444
        LDFLAGS="-L$ICONV_SEARCH_LIBS"
688
445
        AC_CHECK_FUNC([iconv],
689
446
            [
719
476
        )
720
477
    fi
721
478
else
722
 
    if test $ICONV_FORCE_LIB -eq 0; then
 
479
    if test "x$ICONV_LIB_OPTION_ENABLED" = xno; then
723
480
        AC_CHECK_FUNC([iconv],
724
481
            [
725
482
                ICONV_LIBS="$LDFLAGS"
806
563
AC_TYPE_SIZE_T
807
564
#AC_CHECK_TYPES([ssize_t], [], [], [#include <sys/types.h>])
808
565
 
809
 
if test "$SKIP_FSEEKO_TEST" -eq 0; then
 
566
if test "x$FSEEKO_CHECK_OPTION_ENABLED" = xyes; then
810
567
    AC_FUNC_FSEEKO
811
568
 
812
569
    if test "$ac_cv_func_fseeko" = no || test "$ac_cv_sys_largefile_source" = unknown; then
952
709
        [
953
710
            AC_CHECK_HEADERS([lwres/netdb.h],
954
711
                [
955
 
                    AC_CHECK_LIB(lwres, lwres_gethostbyname_r,[],[AC_MSG_ERROR(required library function not found)])
 
712
                    AC_CHECK_LIB(lwres, lwres_gethostbyname_r,
 
713
                                 [
 
714
                                    LWRES_LIBS="-llwres"
 
715
                                    AC_DEFINE(HAVE_LIBLWRES, 1, [lwres library presence])
 
716
                                    AC_SUBST(LWRES_LIBS)
 
717
                                 ],
 
718
                                 [AC_MSG_ERROR(required library function not found)])
956
719
                ],
957
720
                [
958
 
                    if ((test $DARWIN_OS -eq 0) && (test $CYGWIN_OS -eq 0)) ; then
 
721
                    if ((test $DARWIN_OS -eq 0) && (test $CYGWIN_OS -eq 0) && (test $OPENBSD_OS -eq 0)) ; then
959
722
                        AC_MSG_ERROR([required header not found])
960
723
                    fi
961
724
                ])
963
726
 
964
727
AC_CHECK_FUNCS([if_nameindex],[],
965
728
        [
966
 
            AC_CHECK_LIB(nsl, if_nameindex,[],
 
729
            AC_CHECK_LIB(nsl, if_nameindex,
 
730
                [
 
731
                    NSL_LIBS="-lnsl"
 
732
                    AC_SUBST(NSL_LIBS)
 
733
                ],
967
734
                [
968
735
                    if test $CYGWIN_OS -eq 0; then
969
736
                        AC_MSG_ERROR(required library function not found)
977
744
        [
978
745
            AC_CHECK_LIB(nsl, if_freenameindex,[],
979
746
                [
980
 
                    if test $CYGWIN_OS -eq 0; then
 
747
                    if ((test $CYGWIN_OS -eq 0) && (test $OPENBSD_OS -eq 0)); then
981
748
                        AC_MSG_ERROR(required library function not found)
982
749
                    fi
983
750
                ]
994
761
ADD_PTHREAD_CFLAGS=
995
762
 
996
763
# see acinclude.m4 for the definition of ACX_PTHREAD
997
 
if test $PTHREAD_FORCE_LIB -eq 1; then
998
 
    AC_CHECK_LIB(pthread, pthread_create,[],
999
 
            [
1000
 
                AC_MSG_ERROR([pthread library not found, try running configure without the --enable-pthread-lib option])
1001
 
            ]
1002
 
    )
 
764
if test "x$PTHREAD_LIB_OPTION_ENABLED" = xyes; then
 
765
    MT_CHECK_LIBRARY([pthread], [pthread], [pthread_create])
 
766
    if test "x$PTHREAD_STATUS" != xyes; then
 
767
        AC_MSG_ERROR([pthread library not found, try running configure without the --enable-pthread-lib option])
 
768
    fi
1003
769
else
1004
770
    ACX_PTHREAD(,AC_MSG_ERROR(POSIX threads missing))
1005
771
 
1007
773
        ADD_PTHREAD_CFLAGS="$PTHREAD_CFLAGS $PTHREAD_LIBS"
1008
774
    fi
1009
775
 
 
776
    if test "x$STATIC_OPTION_ENABLED" = xyes; then
 
777
        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 
778
        LIBS="$LIBS $PTHREAD_LIBS"
 
779
        CFLAGS_SAVE="$CFLAGS_SAVE $PTHREAD_CFLAGS"
 
780
        LIBS_SAVE="$LIBS_SAVE $PTHREAD_LIBS"
 
781
    fi
 
782
 
1010
783
    AC_SUBST(PTHREAD_LIBS)
1011
784
    AC_SUBST(PTHREAD_CFLAGS)
1012
785
fi
1013
786
 
1014
 
LIBS_SAVE="$LIBS"
1015
787
unset LIBS
1016
 
    
1017
 
# check librt stuff - clock_gettime
1018
 
AC_CHECK_FUNC([clock_gettime],
1019
 
        [
1020
 
            AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [clock_gettime presense])
1021
 
# we sill might need -lrt for sqlite3, so let's check for it
1022
 
            if test "x$SQLITE3_OK" = xyes; then
1023
 
            AC_CHECK_LIB(rt, clock_gettime,
1024
 
                [
1025
 
                    RT_LIBS="-lrt"
1026
 
                ],
1027
 
                [
1028
 
                    LDFLAGS="-L$SEARCH_DIR_LIBS"
1029
 
                    unset ac_cv_lib_rt_clock_gettime
1030
 
                    AC_CHECK_LIB(rt, clock_gettime,
1031
 
                        [
1032
 
                            RT_LIBS="-L$SEARCH_DIR_LIBS -lrt"
1033
 
                        ]
1034
 
                    )
1035
 
                ]
1036
 
            )
1037
 
            fi
1038
 
        ],
1039
 
        [
1040
 
            AC_CHECK_LIB(rt, clock_gettime,
1041
 
                [
1042
 
                    RT_LIBS="-lrt"
1043
 
                    AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [clock_gettime presense])
1044
 
                ],
1045
 
                [
1046
 
                    LDFLAGS="-L$SEARCH_DIR_LIBS"
1047
 
                    unset ac_cv_lib_rt_clock_gettime
1048
 
                    AC_CHECK_LIB(rt, clock_gettime,
1049
 
                        [
1050
 
                            RT_LIBS="-L$SEARCH_DIR_LIBS -lrt"
1051
 
                            AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [clock_gettime presense])
1052
 
                        ]
1053
 
                    )
1054
 
                ]
1055
 
            )
1056
 
        ]
1057
 
)
1058
 
 
1059
 
LIBS="$LIBS_SAVE"
1060
 
LDFLAGS="$LDFLAGS_SAVE"
1061
 
AC_SUBST(RT_LIBS)
1062
 
 
1063
 
    
1064
 
ZLIB_OK=yes
1065
 
Z_CXXFLAGS=
1066
 
Z_LIBS=
1067
 
if test -n "$Z_SEARCH_HEADERS" ; then
1068
 
    AC_MSG_NOTICE([Will search for zlib headers in $Z_SEARCH_HEADERS])
1069
 
    AC_CHECK_HEADER([$Z_SEARCH_HEADERS/zlib.h],
1070
 
            [
1071
 
                Z_CXXFLAGS="-I$Z_SEARCH_HEADERS"
1072
 
            ],
1073
 
            [
1074
 
                AC_MSG_ERROR([zlib.h not found in requested location $Z_SEARCH_HEADERS])
1075
 
            ]
1076
 
    )
1077
 
else
1078
 
   AC_CHECK_HEADER([zlib.h], [], 
1079
 
           [
1080
 
                unset ac_cv_header_zlib_h
1081
 
                AC_CHECK_HEADER([$SEARCH_DIR_HEADERS/zlib.h],
1082
 
                    [
1083
 
                        Z_CXXFLAGS="-I$SEARCH_DIR_HEADERS"
1084
 
                    ],
1085
 
                    [
1086
 
                        ZLIB_OK=missing
1087
 
                    ])
1088
 
           ])
1089
 
fi
1090
 
 
1091
 
if test -n "$Z_SEARCH_LIBS" ; then     
1092
 
    AC_MSG_NOTICE([Will search for zlib libraries in $Z_SEARCH_LIBS])
1093
 
    LDFLAGS="-L$Z_SEARCH_LIBS"
1094
 
    AC_CHECK_LIB(z, uncompress,
1095
 
            [
1096
 
                Z_LIBS="-L$Z_SEARCH_LIBS -lz"
1097
 
            ],
1098
 
            [
1099
 
                AC_MSG_ERROR([zlib libraries not found in requested location $Z_SEARCH_LIBS])
1100
 
            ]
1101
 
    )
1102
 
else
1103
 
    AC_CHECK_LIB(z,uncompress,
1104
 
            [],
1105
 
            [
1106
 
                LDFLAGS="-L$SEARCH_DIR_LIBS"
1107
 
                unset ac_cv_lib_z_uncompress
1108
 
                AC_CHECK_LIB(z, uncompress,
1109
 
                    [
1110
 
                        Z_LIBS="-L$SEARCH_DIR_LIBS -lz"
1111
 
                    ],
1112
 
                    [
1113
 
                        ZLIB_OK=missing
1114
 
                    ]
1115
 
                )
1116
 
                    
1117
 
            ]
1118
 
    )
1119
 
fi
1120
 
 
1121
 
if test "x$ZLIB_OK" = xyes; then
1122
 
    AC_SUBST(Z_CXXFLAGS)
1123
 
    AC_SUBST(Z_LIBS)
1124
 
 
1125
 
    if test $AUTOCREATE -eq 1; then
 
788
 
 
789
# we might need librt for sqlite
 
790
MT_CHECK_LIBRARY([rt], [rt], [clock_gettime])
 
791
 
 
792
if test "x$RT_STATUS" != xyes; then
 
793
    AC_CHECK_FUNC(clock_gettime)
 
794
fi
 
795
 
 
796
############ zlib
 
797
 
 
798
MT_CHECK_OPTIONAL_PACKAGE([zlib], [disable],
 
799
                 [zlib support required for automated database creation],
 
800
                 [zlib], [z], [uncompress])
 
801
    
 
802
 
 
803
if test "x$ZLIB_STATUS" = xyes; then
 
804
    if test "x$DB_AUTOCREATE_OPTION_ENABLED" = xyes; then
1126
805
        AC_DEFINE([AUTO_CREATE_DATABASE], [1], [create database automatically if it does not exist])
1127
806
    fi
1128
807
else
1129
 
    if test $AUTOCREATE_REQUESTED -eq 1; then
1130
 
        AC_MSG_ERROR([Automatic database creation not possible due to missing zlib headers/libraries])
 
808
    if test "x$DB_AUTOCREATE_OPTION_ENABLED" = xyes; then
 
809
        if test "x$DB_AUTOCREATE_OPTION_REQUESTED" = xyes; then
 
810
            AC_MSG_ERROR([Automatic database creation not possible due to missing zlib headers/libraries])
 
811
        else
 
812
            AC_MSG_WARN([Automatic database creation not possible due to missing zlib headers/libraries])
 
813
            DB_AUTOCREATE_OPTION_ENABLED=disabled
 
814
        fi
1131
815
    fi
1132
816
fi
1133
817
 
1135
819
 
1136
820
######### SQLite3
1137
821
 
1138
 
AC_ARG_ENABLE(sqlite3, 
1139
 
        AC_HELP_STRING([--enable-sqlite3], [compile with sqlite3 support (default: yes)]),
1140
 
        [
1141
 
            SQLITE3_EN=$enableval
1142
 
            if test "x$enableval" = xno; then
1143
 
                SQLITE3_OK=disabled
1144
 
            else
1145
 
                SQLITE3_OK=yes
1146
 
            fi
1147
 
        ],
1148
 
        [
1149
 
            SQLITE3_OK=yes      
1150
 
        ]
1151
 
)
1152
 
 
1153
 
if test "x$SQLITE3_OK" = xyes; then
1154
 
    if test -n "$SQLITE3_SEARCH_HEADERS"; then
1155
 
        AC_MSG_NOTICE([Will search for sqlite3 headers in $SQLITE3_SEARCH_HEADERS])
1156
 
        AC_CHECK_HEADER([$SQLITE3_SEARCH_HEADERS/sqlite3.h],
1157
 
                [
1158
 
                    SQLITE3_CXXFLAGS="-I$SQLITE3_SEARCH_HEADERS"
1159
 
                    SQLITE3_OK=yes
1160
 
                ],
1161
 
                [
1162
 
                    AC_MSG_ERROR(sqlite3.h not found in requested locatoin $SQLITE3_SEARCH_HEADERS)
1163
 
                ]
1164
 
        )
1165
 
    else
1166
 
    
1167
 
    AC_CHECK_HEADER(sqlite3.h, [], 
1168
 
            [
1169
 
                SQLITE3_OK=missing
1170
 
                for sqlite3_path in $SEARCH_DIR_HEADERS; do
1171
 
                    if test "x$ac_cv_header_sqlite3_h" != xyes ; then
1172
 
                        unset ac_cv_header_sqlite3_h
1173
 
                        AC_CHECK_HEADER($sqlite3_path/sqlite3.h, 
1174
 
                            [
1175
 
                                SQLITE3_CXXFLAGS="-I$sqlite3_path"
1176
 
                                SQLITE3_OK=yes
1177
 
                            ]
1178
 
                        )
1179
 
                    fi
1180
 
                done
1181
 
            ])
1182
 
    fi
 
822
if test "x$RT_STATUS" = xyes; then
 
823
    LDFLAGS="$LDFLAGS $RT_LDFLAGS $RT_LIBS"
1183
824
fi
1184
825
 
1185
 
if test "x$SQLITE3_OK" = xyes; then
1186
 
    if test -n "$SQLITE3_SEARCH_LIBS"; then
1187
 
        LDFLAGS="$LDFLAGS_SAVE -L$SQLITE3_SEARCH_LIBS $RT_LIBS $ADD_PTHREAD_CFLAGS"
1188
 
        AC_MSG_NOTICE([Will search for sqlite3 libraries in $SQLITE3_SEARCH_LIBS])
1189
 
        AC_CHECK_LIB(sqlite3, sqlite3_open,
1190
 
                [
1191
 
                    SQLITE3_LIBS="-L$SQLITE3_SEARCH_LIBS $RT_LIBS -lsqlite3"
1192
 
                    SQLITE3_OK=yes
1193
 
                ],
1194
 
                [
1195
 
                    AC_MSG_ERROR(sqlite3 library not found in requested location $SQLITE3_SEARCH_LIBS)
1196
 
                ]
1197
 
        )
1198
 
    else
1199
 
    LDFLAGS="$LDFLAGS_SAVE $RT_LIBS $ADD_PTHREAD_CFLAGS"
1200
 
    AC_CHECK_LIB(sqlite3, sqlite3_open, [],
1201
 
        [
1202
 
            SQLITE3_OK=missing
1203
 
            for sqlite3_path in $SEARCH_DIR_LIBS; do
1204
 
                if test "x$ac_cv_lib_sqlite3_sqlite3_open" != xyes ; then
1205
 
                    unset ac_cv_lib_sqlite3_sqlite3_open
1206
 
                    LDFLAGS="$LDFLAGS_SAVE -L$sqlite3_path $RT_LIBS $ADD_PTHREAD_CFLAGS"
1207
 
                    AC_CHECK_LIB(sqlite3, sqlite3_open,
1208
 
                        [
1209
 
                            SQLITE3_LIBS="-L$sqlite3_path $RT_LIBS -lsqlite3"
1210
 
                            SQLITE3_OK=yes
1211
 
                        ],
1212
 
                        [
1213
 
                            SQLITE3_OK=missing
1214
 
                        ]
1215
 
                     )
1216
 
                fi
1217
 
            done
1218
 
        ]
1219
 
    )
 
826
MT_CHECK_OPTIONAL_PACKAGE([sqlite3], [disable], [sqlite3 database supprot],
 
827
                          [sqlite3], [sqlite3], [sqlite3_open])
 
828
 
 
829
if test "x$SQLITE3_STATUS" = xyes; then
 
830
    if test "x$RT_STATUS" = xyes; then
 
831
        SQLITE_LDFLAGS="$SQLITE_LDFLAGS $RT_LDFLAGS"
 
832
        SQLITE_LIBS="$SQLITE_LIBS $RT_LIBS"
1220
833
    fi
1221
 
fi 
1222
834
 
1223
 
if test "x$SQLITE3_OK" = xyes; then
1224
 
    AC_DEFINE([HAVE_SQLITE3], [1], [sqlite3 library presence])
1225
 
    AC_SUBST(SQLITE3_CXXFLAGS)
 
835
    AC_SUBST(SQLITE3_LDFLAGS)
1226
836
    AC_SUBST(SQLITE3_LIBS)
 
837
 
 
838
    if test "x$SQLITE_BACKUP_OPTION_ENABLED" = xyes; then
 
839
        AC_DEFINE([SQLITE_BACKUP_ENABLED], [1], [enable sqlite db backup settings in config.xml by default])
 
840
    fi
1227
841
else
1228
 
    if test "x$SQLITE3_EN" = xyes; then
1229
 
        AC_MSG_ERROR(unable to configure sqlite3 support)
 
842
    if (test "x$SQLITE_BACKUP_OPTION_ENABLED" = xyes) &&
 
843
       (test "x$SQLITE_BACKUP_OPTION_REQUESTED" = xyes); then
 
844
        AC_MSG_ERROR(You specified the option to use sqlite backup settings but the sqlite support could not be configured)
1230
845
    fi
 
846
 
1231
847
fi
1232
848
 
1233
849
LDFLAGS="$LDFLAGS_SAVE"
1236
852
 
1237
853
########## MySQL
1238
854
 
1239
 
AC_ARG_ENABLE(mysql, 
1240
 
              AC_HELP_STRING([--enable-mysql], [compile with mysql support (default: yes)]),
1241
 
              [
1242
 
                MYSQL_EN=$enableval 
1243
 
                if test "x$enableval" = xno; then
1244
 
                    MYSQL_OK=disabled
1245
 
                else
1246
 
                    MYSQL_OK=yes
1247
 
                fi
1248
 
              ],
1249
 
              [
1250
 
                MYSQL_OK=yes
1251
 
              ]
1252
 
)
1253
 
 
1254
 
MYSQL_PROG_FOUND=0
1255
 
 
1256
 
if test "x$MYSQL_OK" = xyes; then
1257
 
    if test -n "$MYSQL_SEARCH_CONFIG"; then
1258
 
        AC_MSG_NOTICE([You specified $MYSQL_SEARCH_CONFIG for mysql_config])
1259
 
        
1260
 
        if test -f "$MYSQL_SEARCH_CONFIG"; then 
1261
 
            mysqlconfig="$MYSQL_SEARCH_CONFIG"
1262
 
        else
1263
 
            mysqlconfig="no"
1264
 
        fi
1265
 
        
1266
 
        if test "x$mysqlconfig" = xno; then
1267
 
            AC_MSG_ERROR([$MYSQL_SEARCH_CONFIG not found])
1268
 
        else
1269
 
            MYSQL_TEST=`${mysqlconfig} --version 2>/dev/null`
1270
 
            if test -z "$MYSQL_TEST"; then
1271
 
                AC_MSG_ERROR([${mysqlconfig} could not be executed or returned invalid values])
1272
 
            fi
1273
 
 
1274
 
            MYSQL_PROG_FOUND=1
1275
 
        fi
1276
 
    else
1277
 
        AC_PATH_PROG(mysqlconfig, mysql_config, no)
1278
 
        if test "x$mysqlconfig" = xno; then
1279
 
            unset ac_cv_path_mysqlconfig
1280
 
            
1281
 
            AC_PATH_PROG(mysqlconfig, mysql_config, no, $SEARCH_DIR_PROGS)
1282
 
            if test "x$mysqlconfig" = xno; then
1283
 
                MYSQL_OK=missing
1284
 
                AC_MSG_RESULT([mysql_config script not found])
1285
 
            else
1286
 
                MYSQL_PROG_FOUND=1
1287
 
            fi
1288
 
        else
1289
 
            MYSQL_PROG_FOUND=1
1290
 
        fi
1291
 
    fi
1292
 
 
1293
 
    if test $MYSQL_PROG_FOUND -eq 1 ; then 
1294
 
        AC_MSG_CHECKING(mysql version)
1295
 
        MYSQL_VERSION_MAJOR=`${mysqlconfig} --version 2>/dev/null | sed 's/^\([[0-9]]\{1,\}\)\.\([[0-9]]\{1,\}\).\([[0-9]]\{1,\}\).*$/\1/'`
1296
 
        MYSQL_VERSION_MINOR=`${mysqlconfig} --version 2>/dev/null | sed 's/^\([[0-9]]\{1,\}\)\.\([[0-9]]\{1,\}\).\([[0-9]]\{1,\}\).*$/\2/'` 
1297
 
        
1298
 
        MYSQL_PRINT_VERSION=`${mysqlconfig} --version`
1299
 
        AC_MSG_RESULT([$MYSQL_PRINT_VERSION])
1300
 
 
1301
 
        if test -z $MYSQL_VERSION_MAJOR || test -z $MYSQL_VERSION_MINOR; then
1302
 
            AC_MSG_WARN(${mysqlconfig} could not be executed or returned invalid values)
1303
 
            MYSQL_OK=missing
1304
 
        elif test $MYSQL_VERSION_MAJOR -le 3 ; then
1305
 
                AC_MSG_WARN(MySQL version too old, we only support version 4.0.x or later)
1306
 
                MYSQL_OK=missing
1307
 
        else
1308
 
            if test "$MYSQL_VERSION_MAJOR" -gt 3 ; then
1309
 
                AC_MSG_CHECKING(mysql includes)
1310
 
                MYSQL_CFLAGS=`${mysqlconfig} --include`
1311
 
                AC_MSG_RESULT($MYSQL_CFLAGS)
1312
 
 
1313
 
                AC_MSG_CHECKING(mysql libraries)
1314
 
                MYSQL_LIBS=`${mysqlconfig} --libs_r`
1315
 
                AC_MSG_RESULT($MYSQL_LIBS)
1316
 
            else
1317
 
                AC_MSG_WARN(Unsupported mysql version)
1318
 
                MYSQL_OK=missing
1319
 
            fi
1320
 
        fi
1321
 
 
1322
 
        CXXFLAGS="$CXXFLAGS $MYSQL_CFLAGS"
1323
 
        CFLAGS="$CFLAGS $MYSQL_CFLAGS"
1324
 
        CPPFLAGS="$CPPFLAGS $MYSQL_CFLAGS"
1325
 
        LDFLAGS="$LDFLAGS $MYSQL_LIBS"
 
855
MT_CHECK_OPTIONAL_PACKAGE_CFG([mysql], 
 
856
                              [disable],
 
857
                              [mysql database support],
 
858
                              [mysql_config],
 
859
                              [mysql.h],
 
860
                              [], [mysql_init],[--libs_r])
 
861
 
 
862
if test "x$MYSQL_STATUS" = xyes; then
 
863
    AC_MSG_CHECKING(mysql version)
 
864
    MYSQL_VERSION_MAJOR=`echo $MYSQL_VERSION | sed 's/^\([[0-9]]\{1,\}\)\.\([[0-9]]\{1,\}\).\([[0-9]]\{1,\}\).*$/\1/'`
 
865
    MYSQL_VERSION_MINOR=`echo $MYSQL_VERSION | sed 's/^\([[0-9]]\{1,\}\)\.\([[0-9]]\{1,\}\).\([[0-9]]\{1,\}\).*$/\2/'`
 
866
    AC_MSG_RESULT($MYSQL_VERSION)
 
867
    if test -z $MYSQL_VERSION_MAJOR || test -z $MYSQL_VERSION_MINOR; then
 
868
        AC_MSG_WARN([could not parse mysql version string])
 
869
        MYSQL_STATUS=missing
 
870
    elif test $MYSQL_VERSION_MAJOR -le 3 ; then
 
871
       AC_MSG_WARN(MySQL version too old, we only support version 4.0.x or later)
 
872
       MYSQL_STATUS=missing
1326
873
    fi
1327
874
fi
1328
875
 
1329
 
LIBS_SAVE="$LIBS"
 
876
LDFLAGS="$LDFLAGS_SAVE"
1330
877
LIBS="$LIBS $MYSQL_LIBS"
 
878
CFLAGS="$CFLAGS $MYSQL_CFLAGS"
 
879
CXXFLAGS="$CXXFLAGS $MYSQL_CFLAGS"
 
880
CPPFLAGS="$CFLAGS $MYSQL_CFLAGS"
1331
881
 
1332
 
dnl we are not doing an extra search in $SEARCH_DIR because the
1333
 
dnl mysql_config set the correct flags already, if not - something
1334
 
dnl is anyway wrong with the mysql installation
1335
 
dnl we will however accept custom user flags
1336
 
if test "x$MYSQL_OK" = xyes; then
1337
 
    AC_CHECK_HEADER(mysql.h,
1338
 
        [],
1339
 
        [
1340
 
            AC_MSG_RESULT(mysql.h failed)
1341
 
            MYSQL_OK=missing
1342
 
        ]
1343
 
    )
1344
 
fi
1345
 
if test "x$MYSQL_OK" = xyes; then
1346
 
    AC_CHECK_FUNCS(mysql_init,
1347
 
        [],
1348
 
        [
1349
 
            MYSQL_OK=missing
1350
 
            AC_MSG_RESULT(mysqlclient link failed)
1351
 
        ]
1352
 
    )
1353
 
fi
1354
 
if test "x$MYSQL_OK" = xyes; then
 
882
if test "x$MYSQL_STATUS" = xyes; then
1355
883
    AC_DEFINE([HAVE_MYSQL], [1], [MySQL library presence])
1356
884
    AC_SUBST(MYSQL_LIBS)
1357
885
    AC_SUBST(MYSQL_CFLAGS)
1376
904
        ]
1377
905
    )
1378
906
else
1379
 
    if test "x$MYSQL_EN" = xyes; then
1380
 
        AC_MSG_ERROR(unable to configure mysql support)
1381
 
    fi
1382
907
    MYSQL_CFLAGS=
1383
908
    MYSQL_LIBS=
1384
909
fi
1389
914
LDFLAGS="$LDFLAGS_SAVE"
1390
915
LIBS="$LIBS_SAVE"
1391
916
 
1392
 
######### PostgreSQL
1393
 
##AC_ARG_ENABLE(postgresql, 
1394
 
##              AC_HELP_STRING([--enable-postgresql], [compile with postgresql support (default: yes)]),
1395
 
##              [
1396
 
##                PGSQL_EN=$enableval 
1397
 
##                if test "x$enableval" = xno; then
1398
 
##                    PGSQL_OK=disabled
1399
 
##                else
1400
 
##                    PGSQL_OK=yes
1401
 
##                fi
1402
 
##              ],
1403
 
##              [
1404
 
##                PGSQL_OK=yes
1405
 
##              ]
1406
 
##)
1407
 
##
1408
 
##
1409
 
##PGSQL_PROG_FOUND=0
1410
 
##if test "x$PGSQL_OK" = xyes; then
1411
 
##    if test -n "$PGSQL_SEARCH_CONFIG"; then
1412
 
##        AC_MSG_NOTICE([You specified $PGSQL_SEARCH_CONFIG for pg_config])
1413
 
##        
1414
 
##        if test -f "$PGSQL_SEARCH_CONFIG"; then 
1415
 
##            pgconfig="$PGSQL_SEARCH_CONFIG"
1416
 
##        else
1417
 
##            pgconfig="no"
1418
 
##        fi
1419
 
##        
1420
 
##        if test "x$pgconfig" = xno; then
1421
 
##            AC_MSG_ERROR([$PGSQL_SEARCH_CONFIG not found])
1422
 
##        else
1423
 
##            PGSQL_TEST=`${pgconfig} --version 2>/dev/null`
1424
 
##            if test -z "$PGSQL_TEST"; then
1425
 
##                AC_MSG_ERROR([${pgconfig} could not be executed or returned invalid values])
1426
 
##            fi
1427
 
##            PGSQL_PROG_FOUND=1
1428
 
##        fi
1429
 
##    else
1430
 
##        AC_PATH_PROG(pgconfig, pg_config, no)
1431
 
##        if test "x$pgconfig" = xno; then
1432
 
##            unset ac_cv_path_pgconfig
1433
 
##            AC_PATH_PROG(pgconfig, pg_config, no, $SEARCH_DIR_PROGS)
1434
 
##            if test "x$pgconfig" = xno; then
1435
 
##                PGSQL_OK=missing
1436
 
##                AC_MSG_RESULT([pg_config not found, please install the postgresql-devel package])
1437
 
##            else
1438
 
##                PGSQL_PROG_FOUND=1
1439
 
##            fi
1440
 
##        else
1441
 
##            PGSQL_PROG_FOUND=1
1442
 
##        fi
1443
 
##   fi 
1444
 
##
1445
 
##   if test "$PGSQL_PROG_FOUND" -eq 1 ; then
1446
 
##        AC_MSG_CHECKING(if postgresql version is threadsafe)
1447
 
##        PGSQL_THREADSAFE=`${pgconfig} --configure | grep -- '--enable-thread-safety'`
1448
 
##    
1449
 
##       if test -z "$PGSQL_THREADSAFE"; then
1450
 
##            if test "x$PGSQL_EN" = xyes; then
1451
 
##                AC_MSG_ERROR([this PostgreSQL version is not thread safe!])
1452
 
##            else
1453
 
##                PGSQL_OK=disabled
1454
 
##            fi
1455
 
##        fi
1456
 
##
1457
 
##        if test "x$PGSQL_OK" = xyes; then
1458
 
##            AC_MSG_RESULT(yes)
1459
 
##            AC_MSG_CHECKING(postgresql cflags)
1460
 
##            PGSQL_CFLAGS=`${pgconfig} --includedir`
1461
 
##            PGSQL_CFLAGS="-I${PGSQL_CFLAGS}"
1462
 
##            AC_MSG_RESULT($PGSQL_CFLAGS)
1463
 
##
1464
 
##            AC_MSG_CHECKING(postgresql libraries)
1465
 
##            PGSQL_LIBS=`${pgconfig} --libdir`
1466
 
##            PGSQL_LIBS="-L${PGSQL_LIBS} -lpq"
1467
 
##            AC_MSG_RESULT($PGSQL_LIBS)
1468
 
##        else
1469
 
##            AC_MSG_RESULT([no, disabling])
1470
 
##        fi
1471
 
##   fi
1472
 
##fi
1473
 
##
1474
 
##if test "x$PGSQL_OK" = xyes; then
1475
 
##    CPPFLAGS="$CPPFLAGS $PGSQL_CFLAGS"
1476
 
##    CXXFLAGS="$CXXFLAGS $PGSQL_CFLAGS"
1477
 
##    AC_CHECK_HEADERS([libpq-fe.h],
1478
 
##        [],
1479
 
##        [PGSQL_OK=missing]
1480
 
##    )
1481
 
##fi
1482
 
##
1483
 
##if test "x$PGSQL_OK" = xyes; then
1484
 
##    LDFLAGS="$PGSQL_LIBS"
1485
 
##    AC_CHECK_LIB(pq, PQconnectdb, [],
1486
 
##        [PGSQL_OK=missing]
1487
 
##    )
1488
 
##fi
1489
 
##
1490
 
##if test "x$PGSQL_OK" = xyes; then
1491
 
##    LDFLAGS="$PGSQL_LIBS"
1492
 
##    AC_CHECK_LIB(pq, PQisthreadsafe, [AC_DEFINE([HAVE_PQISTHREADSAFE], [1], [PQisthreadsafe function availability])],
1493
 
##            [])
1494
 
##fi
1495
 
##
1496
 
##if test "x$PGSQL_OK" = xyes; then
1497
 
##    AC_DEFINE([HAVE_PGSQL], [1], [PostgreSQL library presence])
1498
 
##    AC_SUBST(PGSQL_CFLAGS)
1499
 
##    AC_SUBST(PGSQL_LIBS)
1500
 
##else
1501
 
##    if test "x$PGSQL_EN" = xyes; then
1502
 
##        AC_MSG_ERROR(unable to configure PostgreSQL support)
1503
 
##    fi
1504
 
##fi
1505
 
##CPPFLAGS="$CPPFLAGS_SAVE"
1506
 
##CXXFLAGS="$CXXFLAGS_SAVE"
1507
 
##LDFLAGS="$LDFLAGS_SAVE"
1508
 
 
1509
 
 
1510
 
 
1511
 
 
1512
917
#########  check if at least one database available
1513
918
 
1514
 
##if ((test "x$SQLITE3_OK" != xyes) && (test "x$MYSQL_OK" != xyes) && (test "x$PGSQL_OK" != xyes)); then
1515
 
##    AC_MSG_ERROR(Support of at least one of mysql, postgresql or sqlite3 must be configured)
1516
 
##fi
1517
 
if ((test "x$SQLITE3_OK" != xyes) && (test "x$MYSQL_OK" != xyes)); then
 
919
if ((test "x$SQLITE3_STATUS" != xyes) && (test "x$MYSQL_STATUS" != xyes)); then
1518
920
    AC_MSG_ERROR(Support of at least one of mysql or sqlite3 must be configured)
1519
921
fi
1520
922
 
1521
 
 
1522
 
 
1523
923
######### javascript
1524
924
 
1525
925
AC_ARG_ENABLE(libjs,
1717
1117
LDFLAGS="$LDFLAGS_SAVE"
1718
1118
 
1719
1119
########### libmagic
1720
 
 
1721
 
AC_ARG_ENABLE(libmagic,
1722
 
        AC_HELP_STRING([--enable-libmagic], [compile with filemagic support (default: yes)]),
1723
 
        [
1724
 
            MAGIC_EN=$enableval 
1725
 
            if test "x$enableval" = xno; then
1726
 
                MAGIC_OK=disabled
1727
 
            else
1728
 
                MAGIC_OK=yes
1729
 
            fi
1730
 
        ],
1731
 
        [
1732
 
            MAGIC_OK=yes
1733
 
        ]
1734
 
)
1735
 
 
1736
 
if test "x$MAGIC_OK" = xyes; then
1737
 
    if test -n "$MAGIC_SEARCH_HEADERS" ; then
1738
 
        AC_MSG_NOTICE([Will search for filemagic headers in $MAGIC_SEARCH_HEADERS])
1739
 
        AC_CHECK_HEADER($MAGIC_SEARCH_HEADERS/magic.h,
1740
 
                [
1741
 
                    MAGIC_CXXFLAGS="-I$MAGIC_SEARCH_HEADERS"
1742
 
                ],
1743
 
                [
1744
 
                    AC_MSG_ERROR([filemagic headers not found in requested location $MAGIC_SEARCH_HEADERS])
1745
 
                ]
1746
 
        )
1747
 
    else
1748
 
    AC_CHECK_HEADER(magic.h,
1749
 
        [],
1750
 
        [
1751
 
            unset ac_cv_header_magic_h
1752
 
            AC_CHECK_HEADER($SEARCH_DIR_HEADERS/magic.h,
1753
 
                [
1754
 
                    MAGIC_CXXFLAGS="-I$SEARCH_DIR_HEADERS"
1755
 
                ],
1756
 
                [MAGIC_OK=missing]
1757
 
            )
1758
 
        ]
1759
 
    )
1760
 
    fi
1761
 
fi
1762
 
 
1763
 
if test "x$MAGIC_OK" = xyes; then
1764
 
    if test -n "$MAGIC_SEARCH_LIBS" ; then
1765
 
        LDFLAGS="$LDFLAGS $Z_LIBS"
1766
 
        AC_CHECK_LIB(z,compress,
1767
 
           [  
1768
 
              LDFLAGS="-L$MAGIC_SEARCH_LIBS $Z_LIBS"
1769
 
              AC_MSG_NOTICE([Will search for filemagic libraries in $MAGIC_SEARCH_LIBS])
1770
 
              AC_CHECK_LIB(magic,magic_load,
1771
 
                  [
1772
 
                      MAGIC_LIBS="-L$MAGIC_SEARCH_LIBS -lmagic $Z_LIBS"
1773
 
                  ],
1774
 
                  [
1775
 
                      AC_MSG_ERROR([filemagic libraries not found in requested location $MAGIC_SEARCH_LIBS])
1776
 
                  ],
1777
 
                  [-lz]
1778
 
              )
1779
 
           ],
1780
 
           [
1781
 
              LDFLAGS="-L$MAGIC_SEARCH_LIBS"
1782
 
              AC_CHECK_LIB(magic,magic_load,
1783
 
                  [
1784
 
                      MAGIC_LIBS="-L$MAGIC_SEARCH_LIBS -lmagic"
1785
 
                  ],
1786
 
                  [
1787
 
                      AC_MSG_ERROR([filemagic libraries not found in requested location $MAGIC_SEARCH_LIBS])
1788
 
                  ]
1789
 
              )
1790
 
           ]
1791
 
       )
1792
 
    else
1793
 
    LDFLAGS="$LDFLAGS $Z_LIBS"
1794
 
    AC_CHECK_LIB(z,compress,
1795
 
         [
1796
 
            AC_CHECK_LIB(magic,magic_load,
1797
 
                [MAGIC_LIBS="$Z_LIBS -lmagic"],
1798
 
                [
1799
 
                    LDFLAGS="$LDFLAGS -L$SEARCH_DIR_LIBS"
1800
 
                    unset ac_cv_lib_magic_magic_load
1801
 
                    AC_CHECK_LIB(magic,magic_load,
1802
 
                    [MAGIC_LIBS="-L$SEARCH_DIR_LIBS $Z_LIBS -lmagic"],
1803
 
                    [MAGIC_OK=missing],[-lz])
1804
 
                ],[-lz]
1805
 
            )
1806
 
         ],
1807
 
         [
1808
 
            AC_CHECK_LIB(magic,magic_load,
1809
 
                [],
1810
 
                [
1811
 
                    LDFLAGS="-L$SEARCH_DIR_LIBS"
1812
 
                    unset ac_cv_lib_magic_magic_load
1813
 
                    AC_CHECK_LIB(magic,magic_load,
1814
 
                    [MAGIC_LIBS="-L$SEARCH_DIR_LIBS -lmagic"],
1815
 
                    [MAGIC_OK=missing])
1816
 
                ]
1817
 
            )
1818
 
        ] 
1819
 
     )
1820
 
    fi
1821
 
fi
1822
 
 
1823
 
if test "x$MAGIC_OK" = xyes; then
 
1120
MT_OPTION([libmagic], [disable],
 
1121
          [filemagic for automatic mimetype recognition],[],[])
 
1122
 
 
1123
if test "x$LIBMAGIC_OPTION_ENABLED" = xyes; then
 
1124
    MT_CHECK_PACKAGE([libmagic], [magic], [magic], [magic_load])
 
1125
 
 
1126
    if test "x$LIBMAGIC_STATUS" != xyes; then
 
1127
        if test "x$ZLIB_STATUS" != xyes; then
 
1128
            MT_CHECK_LIBRARY([zlib], [z], [compress])
 
1129
            LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS"
 
1130
            LIBS="$LIBS $ZLIB_LIBS"
 
1131
            AC_MSG_NOTICE([retrying libmagic check with zlib flags])
 
1132
            MT_CHECK_PACKAGE([libmagic], [magic], [magic], [magic_load])
 
1133
            if test "x$LIBMAGIC_STATUS" = xyes; then
 
1134
                LIBMAGIC_LIBS="$LIBMAGIC_LIBS $ZLIB_LIBS"
 
1135
                LIBMAGIC_LDFLAGS="$LIBMAGIC_LDFLAGS $ZLIB_LDFLAGS"
 
1136
            fi
 
1137
        else
 
1138
            LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS"
 
1139
            LIBS="$LIBS $ZLIB_LIBS"
 
1140
            AC_MSG_NOTICE([retrying libmagic check with zlib flags])
 
1141
            MT_CHECK_PACKAGE([libmagic], [magic], [magic], [magic_load])
 
1142
            if test "x$LIBMAGIC_STATUS" = xyes; then
 
1143
                LIBMAGIC_LIBS="$LIBMAGIC_LIBS $ZLIB_LIBS"
 
1144
                LIBMAGIC_LDFLAGS="$LIBMAGIC_LDFLAGS $ZLIB_LDFLAGS"
 
1145
            fi
 
1146
        fi
 
1147
 
 
1148
        AC_SUBST(LIBMAGIC_LIBS)
 
1149
        AC_SUBST(LIBMAGIC_LDFLAGS)
 
1150
    fi
 
1151
fi
 
1152
 
 
1153
if test "x$LIBMAGIC_STATUS" = xyes; then
 
1154
    AC_MSG_CHECKING([if libmagic is broken (Slackware check)])
 
1155
    CFLAGS="$CFLAGS $LIBMAGIC_CXXLAGS"
 
1156
    CXXFLAGS="$CXXFLAGS $LIBMAGIC_CFLAGS"
 
1157
    LDFLAGS="$LDFLAGS $LIBMAGIC_LDFLAGS $LIBMAGIC_LIBS"
 
1158
    AC_LANG_SAVE
 
1159
    AC_LANG_C
 
1160
    AC_RUN_IFELSE(
 
1161
        AC_LANG_PROGRAM([[ #include <magic.h> ]],
 
1162
         [[
 
1163
            struct magic_set *ms;
 
1164
            ms = magic_open(MAGIC_MIME);
 
1165
            if (ms == 0)
 
1166
                return 0;
 
1167
            magic_load(ms, 0);
 
1168
            magic_close(ms);
 
1169
            return 0;
 
1170
         ]]
 
1171
        ),
 
1172
        [
 
1173
            AC_MSG_RESULT([no]);
 
1174
        ],
 
1175
        [
 
1176
            AC_MSG_RESULT([yes])
 
1177
            MAGIC_OK=broken
 
1178
            AC_MSG_WARN([your magic library is broken, if you are using Slackware install the 'file' package manually])
 
1179
        ],
 
1180
        [
 
1181
            AC_MSG_RESULT([passing for cross compiling])
 
1182
        ])
 
1183
 
 
1184
   AC_LANG_RESTORE
 
1185
fi
 
1186
 
 
1187
if test "x$LIBMAGIC_STATUS" = xyes; then
1824
1188
    AC_DEFINE([HAVE_MAGIC], [1], [filemagic library presence])
1825
 
    AC_SUBST(MAGIC_CXXFLAGS)
1826
 
    AC_SUBST(MAGIC_LIBS)
1827
1189
else
1828
 
    if test "x$MAGIC_EN" = xyes; then
 
1190
    if (test "x$LIBMAGIC_OPTION_REQUESTED" = xyes) && 
 
1191
       (test "x$LIBMAGIC_OPTION_ENABLED" = xyes); then
1829
1192
        AC_MSG_ERROR(unable to configure libmagic support)
1830
1193
    fi
1831
1194
fi
1832
1195
 
 
1196
CFLAGS="$CFLAGS_SAVE"
 
1197
CXXFLAGS="$CXXFLAGS_SAVE"
 
1198
CPPFLAFS="$CPPFLAFS_SAVE"
1833
1199
LDFLGAS="$LDFLAGS_SAVE"
1834
1200
 
1835
 
######### taglib or id3lib
1836
 
TAGLIB_REQUESTED=no
1837
 
ID3_REQUESTED=no
1838
 
 
1839
 
AC_ARG_ENABLE(id3lib,
1840
 
        AC_HELP_STRING([--enable-id3lib], [compile with id3lib support (default: yes, if taglib is not available)]),
1841
 
  [
1842
 
     ID3_EN=$enableval 
1843
 
     if test "x$enableval" = xno; then
1844
 
        ID3_OK=disabled
1845
 
     else
1846
 
        ID3_OK=yes
1847
 
        ID3_REQUESTED=yes
1848
 
     fi
1849
 
  ],
1850
 
  [
1851
 
    ID3_OK=yes
1852
 
  ]
1853
 
)
1854
 
 
1855
 
AC_ARG_ENABLE(taglib,
1856
 
        AC_HELP_STRING([--enable-taglib], [compile with taglib support (default: yes, preferred over id3lib)]),
1857
 
   [
1858
 
      TAGLIB_EN=$enableval
1859
 
      if test "x$enableval" = xno; then
1860
 
        TAGLIB_OK=disabled
1861
 
      else
1862
 
        TAGLIB_REQUESTED=yes
1863
 
        TAGLIB_OK=yes
1864
 
      fi
1865
 
   ],
1866
 
   [
1867
 
        TAGLIB_OK=yes
1868
 
   ]
1869
 
)
1870
 
 
1871
 
if ((test "x$TAGLIB_REQUESTED" = xno) && (test "x$ID3_REQUESTED" = xyes)) ; then
1872
 
    TAGLIB_OK=disabled
 
1201
######### taglib or id3lib selection
 
1202
 
 
1203
TAGLIB_STATUS=
 
1204
ID3LIB_STATUS=
 
1205
 
 
1206
MT_OPTION([id3lib], [enable],
 
1207
          [id3 metadata extraction with the help of id3lib],[],[])
 
1208
 
 
1209
MT_OPTION([taglib], [disable],
 
1210
          [id3 metadata extraction with the help of taglib],[],[])
 
1211
 
 
1212
if ((test "x$TAGLIB_OPTION_ENABLED" = xno) && (test "x$ID3LIB_OPTION_ENABLED" = xyes)) ; then
 
1213
    TAGLIB_STATUS=disabled
 
1214
    TAGLIB_OPTION_ENABLED=no
1873
1215
    AC_MSG_WARN([taglib disabled])
1874
 
elif ((test "x$TAGLIB_REQUESTED" = xyes) && (test "x$ID3_REQUESTED" = xno)) ; then
1875
 
    ID3_OK=disabled
 
1216
elif ((test "x$TAGLIB_OPTION_ENABLED" = xyes) && (test "x$ID3LIB_OPTION_ENABLED" = xno)) ; then
 
1217
    ID3LIB_STATUS=disabled
 
1218
    ID3LIB_OPTION_ENABLED=no
1876
1219
    AC_MSG_WARN([id3lib disabled])
1877
 
elif ((test "x$TAGLIB_REQUESTED" = xyes) && (test "x$ID3_REQUESTED" = xyes)) ; then
 
1220
elif ((test "x$TAGLIB_OPTION_ENABLED" = xyes) && (test "x$ID3LIB_OPTION_ENABLED" = xyes)) ; then
1878
1221
    AC_MSG_ERROR([Please select either taglib or id3lib, but not both.])
1879
1222
fi
1880
1223
 
1881
 
######## taglib
1882
 
 
1883
 
TAGLIB_PROG_FOUND=0
1884
 
TAGLIB_LIBS=
1885
 
TAGLIB_CFLAGS=
1886
 
if test "x$TAGLIB_OK" = xyes; then
1887
 
    if test -n "$TAGLIB_SEARCH_CONFIG"; then
1888
 
        AC_MSG_NOTICE([You specified $TAGLIB_SEARCH_CONFIG for taglib-config])
1889
 
        
1890
 
        if test -f "$TAGLIB_SEARCH_CONFIG"; then 
1891
 
            taglibconfig="$TAGLIB_SEARCH_CONFIG"
1892
 
        else
1893
 
            taglibconfig="no"
1894
 
        fi
1895
 
        
1896
 
        if test "x$taglibconfig" = xno; then
1897
 
            AC_MSG_ERROR([$TAGLIB_SEARCH_CONFIG not found])
1898
 
        else
1899
 
            TAGLIB_TEST=`${taglibconfig} --version 2>/dev/null`
1900
 
            if test -z "$TAGLIB_TEST"; then
1901
 
                AC_MSG_ERROR([${taglibconfig} could not be executed or returned invalid values])
1902
 
            fi
1903
 
            TAGLIB_PROG_FOUND=1
1904
 
        fi
1905
 
    else
1906
 
        AC_PATH_PROG(taglibconfig, taglib-config, no)
1907
 
        if test "x$taglibconfig" = xno; then
1908
 
            unset ac_cv_path_taglibconfig
1909
 
            AC_PATH_PROG(taglibconfig, taglib-config, no, $SEARCH_DIR_PROGS)
1910
 
            if test "x$taglibconfig" = xno; then
1911
 
                TAGLIB_OK=missing
1912
 
                AC_MSG_RESULT([taglib-config not found, please install the taglib-devel package])
1913
 
            else
1914
 
                TAGLIB_PROG_FOUND=1
1915
 
            fi
1916
 
        else
1917
 
            TAGLIB_PROG_FOUND=1
1918
 
        fi
1919
 
   fi 
1920
 
 
1921
 
   if test "$TAGLIB_PROG_FOUND" -eq 1 ; then
1922
 
        AC_MSG_CHECKING(taglib cflags)
1923
 
        TAGLIB_CFLAGS=`${taglibconfig} --cflags`
1924
 
        AC_MSG_RESULT($TAGLIB_CFLAGS)
1925
 
 
1926
 
        AC_MSG_CHECKING(taglib libraries)
1927
 
        TAGLIB_LIBS=`${taglibconfig} --libs`
1928
 
        AC_MSG_RESULT($TAGLIB_LIBS)
1929
 
        TAGLIB_LIBS="$TAGLIB_LIBS $Z_LIBS"
1930
 
    fi
1931
 
fi
1932
 
 
1933
 
if test "x$TAGLIB_OK" = xyes; then
1934
 
    CPPFLAGS="$CPPFLAGS $TAGLIB_CFLAGS"
1935
 
    CXXFLAGS="$CXXFLAGS $TAGLIB_CFLAGS"
1936
 
    AC_CHECK_HEADERS([taglib.h fileref.h tag.h audioproperties.h tstring.h textidentificationframe.h attachedpictureframe.h],
1937
 
        [
1938
 
            AC_DEFINE([HAVE_ID3_ALBUMART], [1],
1939
 
                  [not aware of taglib versions that do not support album art])
1940
 
        ],
1941
 
        [TAGLIB_OK=missing]
1942
 
    )
1943
 
fi
1944
 
 
1945
 
if test "x$TAGLIB_OK" = xyes; then
1946
 
    LDFLAGS="$TAGLIB_LIBS"
1947
 
    AC_CHECK_LIB(tag, main, [],
1948
 
        [TAGLIB_OK=missing]
1949
 
    )
1950
 
fi
1951
 
 
1952
 
if test "x$TAGLIB_OK" = xyes; then
1953
 
    ID3_OK=disabled
1954
 
    AC_DEFINE([HAVE_TAGLIB], [1], [taglib library presence])
1955
 
    AC_SUBST(TAGLIB_CFLAGS)
1956
 
    AC_SUBST(TAGLIB_LIBS)
1957
 
else
1958
 
    if test "x$TAGLIB_EN" = xyes; then
1959
 
        AC_MSG_ERROR(unable to configure taglib support)
1960
 
    fi
1961
 
    TAGLIB_CFLAGS=
1962
 
    TAGLIB_LIBS=
1963
 
fi
1964
 
CPPFLAGS="$CPPFLAGS_SAVE"
1965
 
CXXFLAGS="$CXXFLAGS_SAVE"
1966
 
LDFLAGS="$LDFLAGS_SAVE"
1967
 
 
 
1224
if test "x$TAGLIB_OPTION_ENABLED" = xyes; then
 
1225
    MT_CHECK_PACKAGE_CFG([taglib],  
 
1226
                         [taglib-config], 
 
1227
                         [taglib.h fileref.h tag.h audioproperties.h tstring.h textidentificationframe.h attachedpictureframe.h],
 
1228
                         [tag], [main])
 
1229
else
 
1230
    TAGLIB_STATUS=disabled
 
1231
    if test "x$ID3_OPTION_REQUESTED" = no; then
 
1232
        ID3_OPTION_ENABLED=yes
 
1233
    fi
 
1234
fi
 
1235
 
 
1236
if test "x$TAGLIB_STATUS" = xyes; then
 
1237
    AC_DEFINE([HAVE_ID3_ALBUMART], [1], [not aware of taglib versions that do not support album art])
 
1238
    ID3LIB_STATUS=disabled
 
1239
    ID3LIB_OPTION_ENABLED=no
 
1240
else
 
1241
    if (test "x$TAGLIB_OPTION_REQUESTED" = xyes) && 
 
1242
       (test "x$TAGLIB_OPTION_ENABLED" = xyes); then
 
1243
        AC_MSG_ERROR([unable to configure taglib support])
 
1244
    fi
 
1245
fi
1968
1246
 
1969
1247
######### id3lib
1970
1248
 
1971
 
#AC_ARG_ENABLE(id3lib,
1972
 
#  [  --enable-id3lib          id3lib support],
1973
 
#  [
1974
 
#     ID3_EN=$enableval 
1975
 
#     if test "x$enableval" = xno; then
1976
 
#        ID3_OK=disabled
1977
 
#     fi
1978
 
#  ]
1979
 
#)
1980
 
 
1981
 
if test "x$ID3_OK" = xyes; then
1982
 
    if test -n "$ID3_SEARCH_HEADERS" ; then
1983
 
     CPPFLAGS="-I$ID3_SEARCH_HEADERS"
1984
 
     AC_CHECK_HEADER($ID3_SEARCH_HEADERS/id3/tag.h,
1985
 
        [
1986
 
            ID3_CXXFLAGS="-I$ID3_SEARCH_HEADERS"
1987
 
        ],
1988
 
        [
1989
 
            AC_MSG_ERROR([id3lib headers not found in requested location $ID3_SEARCH_HEADERS])
1990
 
        ]
1991
 
    )
1992
 
   else
1993
 
    AC_CHECK_HEADER(id3/tag.h,
1994
 
        [],
1995
 
        [
1996
 
            unset ac_cv_header_id3_tag_h
1997
 
            CPPFLAGS="-I$SEARCH_DIR_HEADERS"
1998
 
            AC_CHECK_HEADER(id3/tag.h,
1999
 
                [
2000
 
                    ID3_CXXFLAGS="-I$SEARCH_DIR_HEADERS"
2001
 
                ],
2002
 
                [
2003
 
                    ID3_OK=missing
2004
 
                ]
2005
 
            )
2006
 
                
2007
 
        ]
2008
 
    )
2009
 
    fi
2010
 
fi
2011
 
 
2012
 
if test "x$ID3_OK" = xyes; then
2013
 
    if test -n "$ID3_SEARCH_HEADERS" ; then
2014
 
     CPPFLAGS="-I$ID3_SEARCH_HEADERS"
2015
 
     AC_CHECK_HEADER(id3/misc_support.h,
2016
 
        [
2017
 
            ID3_CXXFLAGS="-I$ID3_SEARCH_HEADERS"
2018
 
        ],
2019
 
        [
2020
 
            AC_MSG_ERROR([id3lib headers not found in requested location $ID3_SEARCH_HEADERS])
2021
 
        ]
2022
 
    )
2023
 
   else
2024
 
    AC_CHECK_HEADER(id3/misc_support.h,
2025
 
        [],
2026
 
        [
2027
 
            unset ac_cv_header_id3_misc_support_h
2028
 
            CPPFLAGS="-I$SEARCH_DIR_HEADERS"
2029
 
            AC_CHECK_HEADER(id3/misc_support.h,
2030
 
                [
2031
 
                    ID3_CXXFLAGS="-I$SEARCH_DIR_HEADERS"
2032
 
                ],
2033
 
                [
2034
 
                    ID3_OK=missing
2035
 
                ]
2036
 
            )
2037
 
                
2038
 
        ]
2039
 
    )
2040
 
    fi
2041
 
fi
2042
 
 
2043
 
if test "x$ID3_OK" = xyes; then
2044
 
    if test -n "$ID3_SEARCH_LIBS" ; then
2045
 
        LDFLAGS="$LDFLAGS $Z_LIBS"
2046
 
        AC_CHECK_LIB(z,compress,
2047
 
           [
2048
 
              LDFLAGS="-L$ID3_SEARCH_LIBS $Z_LIBS"
2049
 
              AC_MSG_NOTICE([Will search for id3lib libraries in $ID3_SEARCH_LIBS])
2050
 
              AC_CHECK_LIB(id3, main,
2051
 
                  [
2052
 
                      ID3_LIBS="-L$ID3_SEARCH_LIBS $Z_LIBS -lid3 "
2053
 
                  ],
2054
 
                  [
2055
 
                      AC_MSG_ERROR([id3lib libraries not found in requested location $ID3_SEARCH_LIBS])
2056
 
                  ],
2057
 
                  [-lz]
2058
 
              )
2059
 
           ],
2060
 
           [
2061
 
              LDFLAGS="-L$ID_SEARCH_LIBS"
2062
 
              AC_CHECK_LIB(id3, main,
2063
 
                  [
2064
 
                      ID3_LIBS="-L$ID3_SEARCH_LIBS -lid3"
2065
 
                  ],
2066
 
                  [
2067
 
                      AC_MSG_ERROR([id3lib libraries not found in requested location $ID3_SEARCH_LIBS])
2068
 
                  ]
2069
 
              )
2070
 
           ]
2071
 
       )
2072
 
    else
2073
 
    LDFLAGS="$LDFLAGS $Z_LIBS"
2074
 
    AC_CHECK_LIB(z,compress,
2075
 
         [
2076
 
            AC_CHECK_LIB(id3, main,
2077
 
                [
2078
 
                    ID3_LIBS="$Z_LIBS -lid3"
2079
 
                ],
2080
 
                [
2081
 
                    LDFLAGS="$LDFLAGS -L$SEARCH_DIR_LIBS"
2082
 
                    unset ac_cv_lib_id3_main
2083
 
                    AC_CHECK_LIB(id3, main,
2084
 
                        [
2085
 
                            ID3_LIBS="$Z_LIBS -L$SEARCH_DIR_LIBS -lid3"
2086
 
                        ],
2087
 
                        [
2088
 
                            ID3_OK=missing
2089
 
                        ]
2090
 
                    )
2091
 
                ],
2092
 
                [-lz])
2093
 
         ],
2094
 
         [
2095
 
            AC_CHECK_LIB(id3,main,[],
2096
 
                [
2097
 
                    LDFLAGS="-L$SEARCH_DIR_LIBS"
2098
 
                    unset ac_cv_lib_id3_main
2099
 
                    AC_CHECK_LIB(id3, main,
2100
 
                        [
2101
 
                            ID3_LIBS="-L$SEARCH_DIR_LIBS -lid3"
2102
 
                        ],
2103
 
                        [
2104
 
                            ID3_OK=missing
2105
 
                        ]
2106
 
                    )
2107
 
                ]
2108
 
            )
2109
 
         ] 
2110
 
     )
2111
 
    fi
2112
 
    
2113
 
fi
2114
 
 
2115
 
if test "x$ID3_OK" = xyes; then
2116
 
   AC_DEFINE([HAVE_ID3], [1], [id3lib presence])
2117
 
   AC_SUBST(ID3_CXXFLAGS)
2118
 
   AC_SUBST(ID3_LIBS)
2119
 
   CFLAGS="$CFLAGS $ID3_CXXFLAGS"
2120
 
   CXXFLAGS="$CXXFLAGS $ID3_CXXFLAGS"
2121
 
   LDFLAGS="$LDFLAGS $ID3_LIBS"
 
1249
if test "x$ID3LIB_OPTION_ENABLED" = xyes; then
 
1250
    MT_CHECK_PACKAGE([id3lib], [id3/tag], [id3], [main])
 
1251
 
 
1252
    if test "x$ID3LIB_STATUS" != xyes; then
 
1253
        if test "x$ZLIB_STATUS" != xyes; then
 
1254
            MT_CHECK_LIBRARY([zlib], [z], [compress])
 
1255
            LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS"
 
1256
            LIBS="$LIBS $ZLIB_LIBS"
 
1257
            AC_MSG_NOTICE([retrying id3lib check with zlib flags])
 
1258
            MT_CHECK_PACKAGE([id3lib], [id3/tag], [id3], [main])
 
1259
            if test "x$ID3LIB_STATUS" = xyes; then
 
1260
                ID3LIB_LIBS="$ID3LIB_LIBS $ZLIB_LIBS"
 
1261
                ID3LIB_LDFLAGS="$ID3LIB_LDFLAGS $ZLIB_LDFLAGS"
 
1262
            fi
 
1263
        else
 
1264
            LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS"
 
1265
            LIBS="$LIBS $ZLIB_LIBS"
 
1266
            AC_MSG_NOTICE([retrying id3lib check with zlib flags])
 
1267
            MT_CHECK_PACKAGE([id3lib], [id3/tag], [id3], [main])
 
1268
            if test "x$ID3LIB_STATUS" = xyes; then
 
1269
                ID3LIB_LIBS="$ID3LIB_LIBS $ZLIB_LIBS"
 
1270
                ID3LIB_LDFLAGS="$ID3LIB_LDFLAGS $ZLIB_LDFLAGS"
 
1271
            fi
 
1272
        fi
 
1273
 
 
1274
        AC_SUBST(ID3LIB_LIBS)
 
1275
        AC_SUBST(ID3LIB_LDFLAGS)
 
1276
    fi
 
1277
fi
 
1278
 
 
1279
if test "x$ID3LIB_STATUS" = xyes; then
 
1280
   CFLAGS="$CFLAGS $ID3_CFLAGS"
 
1281
   CXXFLAGS="$CXXFLAGS $ID3_CFLAGS"
 
1282
   LDFLAGS="$LDFLAGS $ID3LIB_LDFLAGS $ID3LIB_LIBS"
2122
1283
   AC_LANG_SAVE
2123
1284
   AC_LANG_CPLUSPLUS
2124
1285
   AC_MSG_CHECKING([for album art support in id3lib])
2140
1301
        [
2141
1302
            AC_MSG_RESULT([no])
2142
1303
        ])
2143
 
   AC_LANG_RESTORE  
2144
 
   TAGLIB_OK=disabled
 
1304
   AC_LANG_RESTORE
2145
1305
else
2146
 
    if test "x$ID3_EN" = xyes; then
2147
 
        if test "x$TAGLIB_OK" = xyes; then
 
1306
    if (test "x$ID3LIB_OPTION_REQUESTED" = xyes) &&
 
1307
       (test "x$ID3LIB_OPEION_ENABLED" = xyes); then
 
1308
        if test "x$TAGLIB_STATUS" = xyes; then
2148
1309
            AC_MSG_ERROR([Please select either taglib or id3lib, but not both.])
2149
1310
        else
2150
1311
            AC_MSG_ERROR(unable to configure id3lib support)
2151
1312
        fi
 
1313
    else
 
1314
        ID3LIB_STATUS=disabled
2152
1315
    fi
2153
1316
fi
2154
1317
 
2155
1318
LDFLAGS="$LDFLAGS_SAVE"
 
1319
LIBS="$LIBS_SAVE"
2156
1320
CXXFLAGS="$CXXFLAGS_SAVE"
2157
1321
CPPFLAGS="$CPPFLAGS_SAVE"
2158
1322
######## curl
2162
1326
CURL_CFLAGS=
2163
1327
CURL_OK=no
2164
1328
 
2165
 
if ((test $YOUTUBE -eq 1) && (test $YOUTUBE_REQUESTED -eq 1) && (test $USE_CURL -eq 0) && (test $CURL_REQUESTED -eq 1)); then
 
1329
if ((test "x$YOUTUBE_OPTION_ENABLED" = xyes) && (test "x$YOUTUBE_OPTION_REQUESTED" = xyes) && (test $USE_CURL -eq 0) && (test $CURL_REQUESTED -eq 1)); then
2166
1330
    AC_MSG_ERROR([You enabled YouTube but disabled curl, however curl is required by the YouTube feature])
2167
1331
fi
2168
1332
 
2169
 
if ((test $YOUTUBE -eq 0) && (test $EXTERNAL_TRANSCODING -eq 0)); then
 
1333
if ((test "x$WEBORAMA_OPTION_ENABLED" = xyes) && (test "x$WEBORAMA_OPTION_REQUESTED" = xyes) && (test $USE_CURL -eq 0) && (test $CURL_REQUESTED -eq 1)); then
 
1334
    AC_MSG_ERROR([You enabled Weborama but disabled curl, however curl is required by the Weborama feature])
 
1335
fi
 
1336
 
 
1337
if ((test "x$ATRAILERS_OPTION_ENABLED" = xyes) && (test "x$ATRAILERS_OPTION_REQUESTED" = xyes) && (test $USE_CURL -eq 0) && (test $CURL_REQUESTED -eq 1)); then
 
1338
    AC_MSG_ERROR([You enabled Apple Trailers but disabled curl, however curl is required by the Apple Trailers feature])
 
1339
fi
 
1340
 
 
1341
if ((test "x$YOUTUBE_OPTION_ENABLED" != xyes) && (test "x$SOPCAST_OPTION_ENABLED" != xyes) && (test "x$EXTERNAL_TRANSCODING_OPTION" != xyes) && (test "x$ATRAILERS_OPTION_ENABLED" != xyes) && (test "x$WEBORAMA_OPTION_ENABLED" != xyes)); then
2170
1342
    if test $USE_CURL -eq 1; then
2171
1343
        if test $CURL_REQUESTED -eq 1; then
2172
 
            AC_MSG_ERROR([You enabled curl support but the external transcoding features is disabled - curl is not needed without it])
 
1344
            AC_MSG_ERROR([You enabled curl support but the external transcoding, YouTube and SopCast features are disabled - curl is not needed without it])
2173
1345
        else
2174
1346
            CURL_OK=no
2175
1347
            USE_CURL=0
2177
1349
    fi
2178
1350
fi
2179
1351
 
2180
 
if (((test $YOUTUBE -eq 1) || (test $EXTERNAL_TRANSCODING -eq 1)) && (test $USE_CURL -eq 1)); then
2181
 
    AC_MSG_NOTICE([Checking for curl (needed for extended external transcoding support)])
 
1352
if (((test "x$YOUTUBE_OPTION_ENABLED" = xyes) || (test "x$SOPCAST_OPTION_ENABLED" = xyes) || (test "x$ATRAILERS_OPTION_ENABLED" = xyes) || (test "x$WEBORAMA_OPTION_ENABLED" = xyes) || (test "x$EXTERNAL_TRANSCODING_OPTION" = xyes)) && (test $USE_CURL -eq 1)); then
 
1353
    AC_MSG_NOTICE([Checking for curl (needed for extended external transcoding/YouTube/SopCast support)])
2182
1354
    CURL_OK=yes
2183
1355
    if test -n "$CURL_SEARCH_CONFIG"; then
2184
1356
        AC_MSG_NOTICE([You specified $CURL_SEARCH_CONFIG for curl-config])
2246
1418
    AC_SUBST(CURL_CFLAGS)
2247
1419
    AC_SUBST(CURL_LIBS)
2248
1420
else
2249
 
    YOUTUBE=0
2250
 
    if test $YOUTUBE_REQUESTED -eq 1; then
 
1421
    if (test "x$YOUTUBE_OPTION_ENABLED" = xyes) && (test "x$YOUTUBE_OPTION_REQUESTED" = xyes); then
2251
1422
        AC_MSG_ERROR([unable to configure curl which is required for YouTube support!])
2252
1423
    fi
2253
 
    if test $EXTERNAL_TRANSCODING -eq 1; then
 
1424
 
 
1425
    if (test "x$YOUTUBE_OPTION_ENABLED" = xyes) && (test "x$YOUTUBE_OPTION_REQUESTED" != xyes); then
 
1426
        AC_MSG_WARN([curl not found, disabling YouTube])
 
1427
        YOUTUBE_OPTION_ENABLED="missing"
 
1428
    fi
 
1429
 
 
1430
    if (test "x$WEBORAMA_OPTION_ENABLED" = xyes) && (test "x$WEBORAMA_OPTION_REQUESTED" = xyes); then
 
1431
        AC_MSG_ERROR([unable to configure curl which is required for Weborama support!])
 
1432
    fi
 
1433
 
 
1434
    if (test "x$WEBORAMA_OPTION_ENABLED" = xyes) && (test "x$WEBORAMA_OPTION_REQUESTED" != xyes); then
 
1435
        AC_MSG_WARN([curl not found, disabling Weborama])
 
1436
        WEBORAMA_OPTION_ENABLED="missing"
 
1437
    fi
 
1438
 
 
1439
    if (test "x$ATRAILERS_OPTION_ENABLED" = xyes) && (test "x$ATRAILERS_OPTION_REQUESTED" = xyes); then
 
1440
        AC_MSG_ERROR([unable to configure curl which is required for Apple Trailers support!])
 
1441
    fi
 
1442
 
 
1443
    if (test "x$ATRAILERS_OPTION_ENABLED" = xyes) && (test "x$ATRAILERS_OPTION_REQUESTED" != xyes); then
 
1444
        AC_MSG_WARN([curl not found, disabling Apple Trailers])
 
1445
        ATRAILERS_OPTION_ENABLED="missing"
 
1446
    fi
 
1447
 
 
1448
    if (test "x$SOPCAST_OPTION_ENABLED" = xyes) && (test "x$SOPCAST_OPTION_REQUESTED" = xyes); then
 
1449
        AC_MSG_ERROR([unable to configure curl which is required for SopCast support!])
 
1450
    fi
 
1451
 
 
1452
    if (test "x$SOPCAST_OPTION_ENABLED" = xyes) && (test "x$SOPCAST_OPTION_REQUESTED" != xyes); then
 
1453
        AC_MSG_WARN([curl not found, disabling SopCast])
 
1454
        SOPCAST_OPTION_ENABLED="missing"
 
1455
    fi
 
1456
 
 
1457
    if test "x$EXTERNAL_TRANSCODING_OPTION" = xyes; then
2254
1458
        if ((test $USE_CURL -eq 1) && (test $CURL_REQUESTED -eq 0)); then
2255
1459
            AC_MSG_WARN([unable to configure curl, external transcoding will have limited functionality!])
2256
1460
        fi
2258
1462
        if ((test $USE_CURL -eq 1) && (test $CURL_REQUESTED -eq 1)); then
2259
1463
            AC_MSG_ERROR([You enabled curl support but the curl library could not be configured])
2260
1464
        fi
2261
 
 
2262
1465
    fi
2263
1466
 
2264
 
    if (test $YOUTUBE -eq 0) && (test $EXTERNAL_TRANSCODING -eq 0); then
 
1467
    if (test "x$YOUTUBE_OPTION_ENABLED" != xyes) && (test "x$WEBORAMA_OPTION_ENABLED" != xyes) && (test "x$ATRAILERS_OPTION_ENABLED" != xyes) && (test "x$EXTERNAL_TRANSCODING_OPTION" = !xyes) && (test "x$SOPCAST_OPTION_ENABLED" != xyes); then
2265
1468
        CURL_CFLAGS=
2266
1469
        CURL_LIBS=
2267
1470
    fi
2270
1473
CXXFLAGS="$CXXFLAGS_SAVE"
2271
1474
LDFLAGS="$LDFLAGS_SAVE"
2272
1475
 
2273
 
######### extractor or ffmpeg
2274
 
 
2275
 
FFMPEG_REQUESTED=no
2276
 
EXTRACTOR_REQUESTED=no
2277
 
 
2278
 
AC_ARG_ENABLE(ffmpeg,
2279
 
        AC_HELP_STRING([--enable-ffmpeg], [compile with ffmpeg support (default: yes, preferred over extractor)]),
2280
 
  [
2281
 
     FFMPEG_EN=$enableval 
2282
 
     if test "x$enableval" = xno; then
2283
 
        FFMPEG_OK=disabled
2284
 
     else
2285
 
        FFMPEG_OK=yes
2286
 
        FFMPEG_REQUESTED=yes
2287
 
     fi
2288
 
  ],
2289
 
  [
2290
 
    FFMPEG_OK=yes
2291
 
  ]
2292
 
)
2293
 
 
2294
 
AC_ARG_ENABLE(libextractor,
2295
 
        AC_HELP_STRING([--enable-libextractor], [compile with libextractor support (default: no)]),
2296
 
  [
2297
 
     EXTRACTOR_EN=$enableval 
2298
 
     if test "x$enableval" = xno; then
2299
 
        EXTRACTOR_OK=disabled
2300
 
     else
2301
 
        EXTRACTOR_OK=yes
2302
 
       EXTRACTOR_REQUESTED=yes
2303
 
     fi
2304
 
  ],
2305
 
  [
2306
 
    EXTRACTOR_OK=disabled
2307
 
  ]
2308
 
)
2309
 
 
2310
 
if ((test "x$EXTRACTOR_REQUESTED" = xno) && (test "x$FFMPEG_REQUESTED" = xyes)) ; then
2311
 
    EXTRACTOR_OK=disabled
2312
 
    if test "x$EXTRACTOR_REQUESTED" = xyes; then
2313
 
        AC_MSG_WARN([libextractor disabled])
2314
 
    fi
2315
 
elif ((test "x$EXTRACTOR_REQUESTED" = xyes) && (test "x$FFMPEG_REQUESTED" = xno)) ; then
2316
 
    FFMPEG_OK=disabled
 
1476
######## ffmpeg or extractor?
 
1477
 
 
1478
FFMPEG_STATUS=
 
1479
LIBEXTRACTOR_STATUS=
 
1480
 
 
1481
MT_OPTION([libextractor], [enable],
 
1482
          [metadata extraction with the help of libextractor],[],[])
 
1483
 
 
1484
MT_OPTION([ffmpeg], [disable],
 
1485
          [metadata extraction with the help of ffmpeg],[],[])
 
1486
 
 
1487
if ((test "x$FFMPEG_OPTION_ENABLED" = xno) && (test "x$LIBEXTRACTOR_OPTION_ENABLED" = xyes)) ; then
 
1488
    FFMPEG_STATUS=disabled
 
1489
    FFMPEG_OPTION_ENABLED=no
2317
1490
    AC_MSG_WARN([ffmpeg disabled])
2318
 
elif ((test "x$EXTRACTOR_REQUESTED" = xyes) && (test "x$FFMPEG_REQUESTED" = xyes)) ; then
 
1491
elif ((test "x$FFMPEG_OPTION_ENABLED" = xyes) && (test "x$LIBEXTRACTOR_OPTION_ENABLED" = xno)) ; then
 
1492
    LIBEXTRACTOR_STATUS=disabled
 
1493
    LIBEXTRACTOR_OPTION_ENABLED=no
 
1494
elif ((test "x$FFMPEG_OPTION_ENABLED" = xyes) && (test "x$LIBEXTRACTOR_OPTION_ENABLED" = xyes)) ; then
 
1495
    if ((test "x$FFMPEG_OPTION_REQUESTED" = xyes) && (test "x$LIBEXTRACTOR_OPTION_REQUESTED" = xyes)); then
2319
1496
    AC_MSG_ERROR([Please select either ffmpeg or libextractor, but not both.])
 
1497
    elif ((test "x$FFMPEG_OPTION_REQUESTED" = xyes) && (test "x$LIBEXTRACTOR_OPTION_REQUESTED" = xno)); then
 
1498
       LIBEXTRACTOR_STATUS=disabled
 
1499
       LIBEXTRACTOR_OPTION_ENABLED=no
 
1500
    elif ((test "x$FFMPEG_OPTION_REQUESTED" = xno) && (test "x$LIBEXTRACTOR_OPTION_REQUESTED" = xyes)); then
 
1501
       FFMPEG_STATUS=disabled
 
1502
       FFMPEG_OPTION_ENABLED=no
 
1503
       AC_MSG_WARN([ffmpeg disabled])
 
1504
    fi
2320
1505
fi
2321
1506
 
2322
1507
######## ffmpeg
2323
1508
 
2324
 
AC_LANG_SAVE
2325
 
AC_LANG_C
2326
 
 
2327
 
if test "x$FFMPEG_OK" = xyes; then
2328
 
    if test -n "$FFMPEG_SEARCH_HEADERS" ; then
2329
 
        CPPFLAGS="-I$FFMPEG_SEARCH_HEADERS"
2330
 
        AC_CHECK_HEADER($FFMPEG_SEARCH_HEADERS/ffmpeg/avformat.h,
2331
 
                [
2332
 
                    FFMPEG_CXXFLAGS="-I$FFMPEG_SEARCH_HEADERS"
2333
 
                ],
2334
 
                [
2335
 
                    AC_MSG_ERROR([ffmpeg headers not found in requested location $FFMPEG_SEARCH_HEADERS])
2336
 
                ],
2337
 
                [
2338
 
                    #define __STDC_CONSTANT_MACROS
2339
 
                    #include <stdint.h>
2340
 
                ]
2341
 
        )
2342
 
    else 
2343
 
        AC_CHECK_HEADER(ffmpeg/avformat.h,
2344
 
            [],
2345
 
            [
2346
 
                CPPFLAGS="-I$SEARCH_DIR_HEADERS"
2347
 
                unset ac_cv_header_ffmpeg_avformat_h
2348
 
                AC_CHECK_HEADER($SEARCH_DIR_HEADERS/ffmpeg/avformat.h,
2349
 
                    [
2350
 
                        FFMPEG_CXXFLAGS="-I$SEARCH_DIR_HEADERS"
2351
 
                    ],
2352
 
                    [
2353
 
                        FFMPEG_OK=missing
2354
 
                    ],
2355
 
                    [
2356
 
                        #define __STDC_CONSTANT_MACROS
2357
 
                        #include <stdint.h>
2358
 
                    ]
2359
 
                )
2360
 
            ],
2361
 
            [
2362
 
                #define __STDC_CONSTANT_MACROS
2363
 
                #include <stdint.h>
2364
 
            ]
2365
 
        )
2366
 
    fi
2367
 
fi
2368
 
 
2369
 
LIBS_SAVE="$LIBS"
2370
 
unset LIBS
2371
 
if test "x$FFMPEG_OK" = xyes; then
2372
 
    if test -n "$FFMPEG_SEARCH_LIBS" ; then
2373
 
        LDFLAGS="-L$FFMPEG_SEARCH_LIBS $ADD_PTHREAD_CFLAGS"
2374
 
        AC_CHECK_LIB(avformat, av_register_all,
2375
 
                [
2376
 
                    AC_CHECK_LIB(avutil, av_log_set_callback,
2377
 
                        [
2378
 
                            FFMPEG_LIBS="-L$FFMPEG_SEARCH_LIBS -lavformat -lavutil -lz"
2379
 
                        ],
2380
 
                        [
2381
 
                            AC_MSG_ERROR([avutil libraries not found in requested path $FFMPEG_SEARCH_LIBS])
2382
 
                        ],
2383
 
                        [ -lavcodec -lavutil -lz $ADD_PTHREAD_CFLAGS ])
2384
 
                ],
2385
 
                [
2386
 
                    AC_MSG_ERROR([avformat libraries not found in requested path $FFMPEG_SEARCH_LIBS])
2387
 
                ],
2388
 
                [ -lavcodec -lavutil -lz $ADD_PTHREAD_CFLAGS ]
2389
 
        )
2390
 
    else
2391
 
        AC_CHECK_LIB(avformat, av_register_all,
2392
 
            [
2393
 
                AC_CHECK_LIB(avutil, av_log_set_callback,
2394
 
                    [
2395
 
                        FFMPEG_LIBS="-lavformat -lavutil"
2396
 
                    ],
2397
 
                    [
2398
 
                        LDFLAGS="-L$SEARCH_DIR_LIBS"
2399
 
                        unset ac_cv_lib_avutil_av_log_set_callback
2400
 
                        AC_CHECK_LIB(avutil, av_log_set_callback,
2401
 
                            [
2402
 
                                FFMPEG_LIBS="-L$SEARCH_DIR_LIBS -lavformat -lavutil -lz"
2403
 
                            ],
2404
 
                            [
2405
 
                               FFMPEG_OK=missing
2406
 
                            ],
2407
 
                            [ -lavcodec -lavutil -lz $ADD_PTHREAD_CFLAGS ])
2408
 
                    ])
2409
 
            ],
2410
 
            [
2411
 
                LDFLAGS="-L$SEARCH_DIR_LIBS $ADD_PTHREAD_CFLAGS"
2412
 
                unset ac_cv_lib_avformat_av_register_all
2413
 
                AC_CHECK_LIB(avformat, av_register_all,
2414
 
                    [
2415
 
                        unset ac_cv_lib_avutil_av_log_set_callback
2416
 
                        AC_CHECK_LIB(avutil, av_log_set_callback,
2417
 
                            [
2418
 
                                FFMPEG_LIBS="-L$SEARCH_DIR_LIBS -lavformat -lavutil -lz"
2419
 
                            ],
2420
 
                            [
2421
 
                               FFMPEG_OK=missing
2422
 
                            ],
2423
 
                            [ -lavcodec -lavutil -lz $ADD_PTHREAD_CFLAGS ])
2424
 
                    ],
2425
 
                    [ FFMPEG_OK=missing ],
2426
 
                    [ -lavcodec -lavutil -lz $ADD_PTHREAD_CFLAGS ]
2427
 
                )
2428
 
            ],
2429
 
            [ -lavcodec -lavutil -lz $ADD_PTHREAD_CFLAGS ]
2430
 
        )
2431
 
    fi
2432
 
fi
2433
 
 
2434
 
# last check, my Fedora 7 is somehow broken, and allthough the above tests
2435
 
# succeed it still has unresolved symbols when linking
2436
 
 
2437
 
CXXFLAGS="$CXXFLAGS $FFMPEG_CXXFLAGS"
2438
 
LDFLAGS="$LDFLAGS $FFMPEG_LIBS"
2439
 
LIBS="$LIBS $FFMPEG_LIBS"
2440
 
 
2441
 
AC_LANG_RESTORE
2442
 
 
2443
 
if test "x$FFMPEG_OK" = xyes; then
2444
 
    AC_MSG_CHECKING([ffmpeg linking / if extern "C" is needed])
2445
 
    AC_LINK_IFELSE(
2446
 
        [AC_LANG_PROGRAM(
2447
 
            [
2448
 
                #define __STDC_CONSTANT_MACROS
2449
 
                #include <stdint.h>
2450
 
                #include <ffmpeg/avformat.h>
2451
 
            ],
2452
 
            [
2453
 
                av_register_all();
2454
 
            ]
2455
 
        )],
2456
 
        [
2457
 
            AC_MSG_RESULT([ok])
2458
 
        ],
2459
 
        [AC_LINK_IFELSE(
2460
 
            [AC_LANG_PROGRAM(
2461
 
                [
2462
 
                    #define __STDC_CONSTANT_MACROS
2463
 
                    #include <stdint.h>
2464
 
                    extern "C" {
2465
 
                        #include <ffmpeg/avformat.h>
2466
 
                    }
2467
 
                ],
2468
 
                [
2469
 
                    av_register_all();
2470
 
                ]
2471
 
            )],
2472
 
            [
2473
 
                AC_MSG_RESULT([ok])
2474
 
                AC_DEFINE([FFMPEG_NEEDS_EXTERN_C], [1],[ffmpeg header include needs to be wrapped into extern "C"])
2475
 
            ],
2476
 
            [
2477
 
                AC_MSG_RESULT([failed, check your ffmpeg installation])
2478
 
                FFMPEG_OK=missing
2479
 
            ])
2480
 
        ]
2481
 
   )
2482
 
fi
2483
 
 
2484
 
LIBS="$LIBS_SAVE $LIBS"
2485
 
 
2486
 
 
2487
 
if test "x$FFMPEG_OK" = xyes; then
 
1509
if test "x$FFMPEG_OPTION_ENABLED" = xyes; then
 
1510
       AC_LANG_SAVE
 
1511
       AC_LANG_C
 
1512
 
 
1513
    # the header location of the older and newer ffmpeg version is different
 
1514
    MT_CHECK_HEADER([avformat], [ffmpeg/avformat], [pass])
 
1515
    if test "x$AVFORMAT_STATUS" != xyes; then
 
1516
        MT_CHECK_HEADER([avformat], [libavformat/avformat])
 
1517
        if test "x$AVFORMAT_STATUS" = xyes; then
 
1518
            AC_DEFINE_UNQUOTED([AVFORMAT_INCLUDE], [<libavformat/avformat.h>], [libavformat/avformat.h])
 
1519
        fi
 
1520
    else
 
1521
       AC_DEFINE_UNQUOTED([AVFORMAT_INCLUDE], [<ffmpeg/avformat.h>], [ffmpeg/avformat.h])
 
1522
    fi
 
1523
 
 
1524
    if test "x$AVFORMAT_STATUS" = xyes; then
 
1525
        MT_CHECK_LIBRARY([avformat], [avformat], [av_register_all])
 
1526
        MT_CHECK_LIBRARY([avutil], [avutil], [av_log_set_callback])
 
1527
    fi
 
1528
    AC_LANG_RESTORE
 
1529
 
 
1530
    if ((test "x$AVFORMAT_STATUS" = xyes) && (test "x$AVUTIL_STATUS" = xyes)); then
 
1531
        FFMPEG_STATUS=yes
 
1532
    else
 
1533
        FFMPEG_STATUS=missing
 
1534
    fi
 
1535
fi
 
1536
 
 
1537
if test "x$FFMPEG_STATUS" = xyes; then
2488
1538
    AC_DEFINE([HAVE_FFMPEG], [1], [FFMPEG library presence])
2489
 
    AC_SUBST(FFMPEG_CXXFLAGS)
 
1539
    FFMPEG_CFLAGS="$AVFORMAT_CFLAGS $AVUTIL_CFLAGS"
 
1540
    FFMPEG_LDFLAGS="$AVFORMAT_LDFLAGS $AVUTIL_LDFLAGS"
 
1541
    FFMPEG_LIBS="$AVFORMAT_LIBS $AVUTIL_LIBS"
 
1542
    AC_SUBST(FFMPEG_CFLAGS)
 
1543
    AC_SUBST(FFMPEG_LDFLAGS)
2490
1544
    AC_SUBST(FFMPEG_LIBS)
2491
1545
else
2492
 
    if test "x$FFMPEG_EN" = xyes; then
 
1546
    if test "x$FFMPEG_OPTIEON_REQUESTED" = xyes; then
2493
1547
        AC_MSG_ERROR(unable to configure ffmpeg support)
2494
1548
    fi
2495
1549
fi
2496
1550
 
 
1551
MT_CHECK_OPTIONAL_PACKAGE([ffmpegthumbnailer], [disable], 
 
1552
        [compile with ffmpegthumbnailer support for video thumbnail generation],
 
1553
        [libffmpegthumbnailer/videothumbnailerc], 
 
1554
        [ffmpegthumbnailer], [create_thumbnailer])
 
1555
 
 
1556
if ((test "x$FFMPEG_STATUS" != xyes) && (test "x$FFMPEGTHUMBNAILER_STATUS" = xyes)); then
 
1557
    if test "x$FFMPEGTHUMBNAILER_OPTION_REQUESTED" = xyes; then
 
1558
      AC_MSG_ERROR([ffmpeg libraries are required in order to use ffmpegthumbnailer])
 
1559
    else
 
1560
      AC_MSG_WARN([ffmpegthumbnailer disabled: ffmpeg libraries required])
 
1561
      FFMPEGTHUMBNAILER_STATUS="disabled"
 
1562
      FFMPEGTHUMBNAILER_CFLAGS=""
 
1563
      FFMPEGTHUMBNAILER_LDFLAGS=""
 
1564
      FFMPEGTHUMBNAILER_LIBS=""
 
1565
    fi
 
1566
 
 
1567
fi
2497
1568
CXXFLAGS="$CXXFLAGS_SAVE"
2498
1569
LDFLAGS="$LDFLAGS_SAVE"
2499
1570
CPPFLAGS="$CPPFLAGS_SAVE"
2500
1571
 
2501
1572
######## extractor
2502
1573
 
2503
 
#AC_ARG_ENABLE(libextractor,
2504
 
#        AC_HELP_STRING([--enable-libextractor], [compile with libextractor support (default: no)]),
2505
 
#  [
2506
 
#     EXTRACTOR_EN=$enableval 
2507
 
#     if test "x$enableval" = xno; then
2508
 
#        EXTRACTOR_OK=disabled
2509
 
#     else
2510
 
#        EXTRACTOR_OK=yes
2511
 
#     fi
2512
 
#  ],
2513
 
#  [
2514
 
#    EXTRACTOR_OK=disabled
2515
 
#  ]
2516
 
#
2517
 
#)
2518
 
if test "x$EXTRACTOR_OK" = xyes; then
2519
 
    if test -n "$EXTRACTOR_SEARCH_HEADERS" ; then
2520
 
        AC_CHECK_HEADER($EXTRACTOR_SEARCH_HEADERS/extractor.h,
2521
 
                [ EXTRACTOR_CXXFLAGS="-I$EXTRACTOR_SEARCH_HEADERS" ],
2522
 
                [ AC_MSG_ERROR([extractor headers not found in requested location $EXTRACTOR_SEARCH_HEADERS])]
2523
 
        )
2524
 
    else
2525
 
        AC_CHECK_HEADER(extractor.h,
2526
 
            [],
2527
 
            [
2528
 
                unset ac_cv_header_extractor_h
2529
 
                AC_CHECK_HEADER($SEARCH_DIR_HEADERS/extractor.h,
2530
 
                    [ EXTRACTOR_CXXFLAGS="-I$SEARCH_DIR_HEADERS" ],
2531
 
                    [ EXTRACTOR_OK=missing ]
2532
 
                )
2533
 
            ]
2534
 
        )
2535
 
    fi
2536
 
fi
2537
 
 
2538
 
if test "x$EXTRACTOR_OK" = xyes; then
2539
 
    if test -n "$EXTRACTOR_SEARCH_HEADERS" ; then
2540
 
        LDFLAGS="-L$EXTRACTOR_SEARCH_LIBS"
2541
 
        AC_CHECK_LIB(extractor, EXTRACTOR_getKeywords,
2542
 
                [ EXTRACTOR_LIBS="-L$EXTRACTOR_SEARCH_LIBS -lextractor" ],
2543
 
                [
2544
 
                    AC_MSG_ERROR([extractor libraries not found in requested location $EXTRACTOR_SEARCH_LIBS])
2545
 
                ]
2546
 
        )
2547
 
    else
2548
 
        AC_CHECK_LIB(extractor, EXTRACTOR_getKeywords,
2549
 
            [], 
2550
 
            [
2551
 
                LDFLAGS="-L$SEARCH_DIR_LIBS"
2552
 
                unset ac_cv_lib_extractor_EXTRACTOR_getKeywords
2553
 
                AC_CHECK_LIB(extractor, EXTRACTOR_getKeywords,
2554
 
                    [ EXTRACTOR_LIBS="-L$SEARCH_DIR_LIBS -lextractor" ],
2555
 
                    [ EXTRACTOR_OK=missing ]
2556
 
                )
2557
 
            ]
2558
 
        )
2559
 
    fi
2560
 
fi
2561
 
 
2562
 
if test "x$EXTRACTOR_OK" = xyes; then
2563
 
    AC_DEFINE([HAVE_EXTRACTOR], [1], [libextractor library presence])
2564
 
    AC_SUBST(EXTRACTOR_CXXFLAGS)
2565
 
    AC_SUBST(EXTRACTOR_LIBS)
 
1574
if test "x$LIBEXTRACTOR_OPTION_ENABLED" = xyes; then
 
1575
    MT_CHECK_PACKAGE([libextractor], [extractor], [extractor], [EXTRACTOR_getKeywords])
 
1576
fi
 
1577
 
 
1578
if test "x$LIBEXTRACTOR_STATUS" = xyes; then
 
1579
    FFMPEG_STATUS=disabled
 
1580
    FFMPEG_OPTION_ENABLED=no
2566
1581
else
2567
 
    if test "x$EXTRACTOR_EN" = xyes; then
2568
 
        AC_MSG_ERROR(unable to configure libextractor support)
 
1582
    if (test "x$LIBEXTRACTOR_OPTION_REQUESTED" = xyes) &&
 
1583
       (test "x$LIBEXTRACTOR_OPTION_ENABLED" = xyes); then
 
1584
        AC_MSG_ERROR([unable to configure libextractor support])
2569
1585
    fi
2570
1586
fi
2571
1587
 
2572
1588
######## libexif
2573
1589
 
2574
 
AC_ARG_ENABLE(libexif,
2575
 
        AC_HELP_STRING([--enable-libexif], [compile with libexif support (default: yes)]),
2576
 
    [
2577
 
        EXIF_EN=$enableval 
2578
 
        if test "x$enableval" = xno; then
2579
 
            EXIF_OK=disabled
2580
 
        else
2581
 
            EXIF_OK=yes
2582
 
        fi
2583
 
    ],
2584
 
    [
2585
 
        EXIF_OK=yes
2586
 
    ]
2587
 
)
2588
 
 
2589
 
if test "x$EXIF_OK" = xyes; then
2590
 
    if test -n "$EXIF_SEARCH_HEADERS" ; then
2591
 
        CPPFLAGS="-I$EXIF_SEARCH_HEADERS"
2592
 
        AC_CHECK_HEADER($EXIF_SEARCH_HEADERS/libexif/exif-content.h,
2593
 
                [
2594
 
                    EXIF_CXXFLAGS="-I$EXIF_SEARCH_HEADERS"
2595
 
                ],
2596
 
                [
2597
 
                    AC_MSG_ERROR([libexif headers not found in requested location $EXIF_SEARCH_HEADERS])
2598
 
                ]
2599
 
        )
2600
 
    else 
2601
 
        AC_CHECK_HEADER(libexif/exif-content.h,
2602
 
            [],
2603
 
            [
2604
 
                CPPFLAGS="-I$SEARCH_DIR_HEADERS"
2605
 
                unset ac_cv_header_libexif_exif_content_h
2606
 
                AC_CHECK_HEADER($SEARCH_DIR_HEADERS/libexif/exif-content.h,
2607
 
                    [
2608
 
                        EXIF_CXXFLAGS="-I$SEARCH_DIR_HEADERS"
2609
 
                    ],
2610
 
                    [
2611
 
                        EXIF_OK=missing
2612
 
                    ]
2613
 
                )
2614
 
            ]
2615
 
        )
2616
 
    fi
2617
 
fi
2618
 
 
2619
 
LIBS_SAVE="$LIBS"
2620
 
unset LIBS
2621
 
if test "x$EXIF_OK" = xyes; then
2622
 
    if test -n "$EXIF_SEARCH_LIBS" ; then
2623
 
        LDFLAGS="-L$EXIF_SEARCH_LIBS"
2624
 
        AC_CHECK_LIB(exif, exif_data_new_from_file,
2625
 
                [
2626
 
                    EXIF_LIBS="-L$EXIF_SEARCH_LIBS -lexif"
2627
 
                ],
2628
 
                [
2629
 
                    AC_MSG_ERROR([libexif libraries not found in requested path $EXIF_SEARCH_LIBS])
2630
 
                ]
2631
 
        )
2632
 
    else
2633
 
        AC_CHECK_LIB(exif, exif_data_new_from_file,
2634
 
            [],
2635
 
            [
2636
 
                LDFLAGS="-L$SEARCH_DIR_LIBS"
2637
 
                unset ac_cv_lib_exif_exif_data_new_from_file
2638
 
                AC_CHECK_LIB(exif, exif_data_new_from_file,
2639
 
                    [
2640
 
                        EXIF_LIBS="-L$SEARCH_DIR_LIBS -lexif"
2641
 
                    ],
2642
 
                    [ EXIF_OK=missing ]
2643
 
                )
2644
 
            ]
2645
 
        )
2646
 
    fi
2647
 
fi
2648
 
 
2649
 
if test "x$EXIF_OK" = xyes; then
 
1590
MT_CHECK_OPTIONAL_PACKAGE([libexif], [disable], 
 
1591
             [compile with libexif for exif thumbnail and metadata extraction], 
 
1592
             [libexif/exif-content], [exif], [exif_data_new_from_file])
 
1593
 
 
1594
if test "x$LIBEXIF_STATUS" = xyes; then
 
1595
    CFLAGS="$CFLAGS $LIBEXIF_CFLAGS"
 
1596
    CXXFLAGS="$CXXFLAGS $LIBEXIF_CFLAGS"
 
1597
    LDFLAGS="$LDFLAGS $LIBEXIF_LDFLAGS $LIBEXIF_LIBS"
 
1598
 
2650
1599
    # try 1 argument signature
2651
1600
    AC_MSG_CHECKING([exif_entry_get_value signature])
2652
1601
    AC_COMPILE_IFELSE(
2687
1636
        ]
2688
1637
    )
2689
1638
 
2690
 
fi
2691
 
 
2692
 
LIBS="$LIBS_SAVE $LIBS"
2693
 
 
2694
 
if test "x$EXIF_OK" = xyes; then
2695
 
    AC_DEFINE([HAVE_EXIF], [1], [EXIF library presence])
2696
 
    AC_SUBST(EXIF_CXXFLAGS)
2697
 
    AC_SUBST(EXIF_LIBS)
2698
1639
    if test "x$EXIF_EGV_1" = xyes; then
2699
1640
        AC_DEFINE([EXIF_EGV_1], [1], [exif_entry_get_value() has 1 parameter])
2700
1641
    fi
2701
1642
    if test "x$EXIF_EGV_3" = xyes; then
2702
1643
        AC_DEFINE([EXIF_EGV_3], [1], [exif_entry_get_value() has 3 parameters])
2703
1644
    fi
2704
 
else
2705
 
    if test "x$EXIF_EN" = xyes; then
2706
 
        AC_MSG_ERROR(unable to configure libexif support)
2707
 
    fi
2708
1645
fi
2709
1646
 
2710
1647
LDFLAGS="$LDFLAGS_SAVE"
2711
 
CPPFLAGS="$CPPFLAGS_SAVE"
2712
 
 
 
1648
CFLAGS="$CFLAGS_SAVE"
 
1649
CXXFLAGS="$CXXFLAGS_SAVE"
2713
1650
 
2714
1651
######## expat
2715
1652
 
2716
 
dnl AC_ARG_ENABLE(libexpat,
2717
 
dnl        AC_HELP_STRING([--enable-libexpat], [compile with libexpat support (default: yes)]),
2718
 
dnl    [
2719
 
dnl        EXPAT_EN=$enableval 
2720
 
dnl        if test "x$enableval" = xno; then
2721
 
dnl            EXPAT_OK=disabled
2722
 
dnl        else
2723
 
dnl            EXPAT_OK=yes
2724
 
dnl        fi
2725
 
dnl    ],
2726
 
dnl    [
2727
 
dnl        EXPAT_OK=yes
2728
 
dnl    ]
2729
 
dnl)
2730
 
 
2731
 
# expat is now required
2732
 
EXPAT_OK=yes
2733
 
EXPAT_EN=yes
2734
 
 
2735
 
if test "x$EXPAT_OK" = xyes; then
2736
 
    if test -n "$EXPAT_SEARCH_HEADERS" ; then
2737
 
        CPPFLAGS="-I$EXPAT_SEARCH_HEADERS"
2738
 
        AC_CHECK_HEADER($EXPAT_SEARCH_HEADERS/expat.h,
2739
 
                [
2740
 
                    EXPAT_CXXFLAGS="-I$EXPAT_SEARCH_HEADERS"
2741
 
                ],
2742
 
                [
2743
 
                    AC_MSG_ERROR([libexpat headers not found in requested location $EXPAT_SEARCH_HEADERS])
2744
 
                ]
2745
 
        )
2746
 
    else 
2747
 
        AC_CHECK_HEADER(expat.h,
2748
 
            [],
2749
 
            [
2750
 
                CPPFLAGS="-I$SEARCH_DIR_HEADERS"
2751
 
                unset ac_cv_header_expat_h
2752
 
                AC_CHECK_HEADER($SEARCH_DIR_HEADERS/expat.h,
2753
 
                    [
2754
 
                        EXPAT_CXXFLAGS="-I$SEARCH_DIR_HEADERS"
2755
 
                    ],
2756
 
                    [
2757
 
                        EXPAT_OK=missing
2758
 
                    ]
2759
 
                )
2760
 
            ]
2761
 
        )
2762
 
    fi
2763
 
fi
2764
 
 
2765
 
LIBS_SAVE="$LIBS"
2766
 
unset LIBS
2767
 
if test "x$EXPAT_OK" = xyes; then
2768
 
    if test -n "$EXPAT_SEARCH_LIBS" ; then
2769
 
        LDFLAGS="-L$EXPAT_SEARCH_LIBS"
2770
 
        AC_CHECK_LIB(expat, XML_ParserCreate,
2771
 
                [
2772
 
                    EXPAT_LIBS="-L$EXPAT_SEARCH_LIBS -lexpat"
2773
 
                ],
2774
 
                [
2775
 
                    AC_MSG_ERROR([libexpat libraries not found in requested path $EXPAT_SEARCH_LIBS])
2776
 
                ]
2777
 
        )
2778
 
    else
2779
 
        AC_CHECK_LIB(expat, XML_ParserCreate,
2780
 
            [],
2781
 
            [
2782
 
                LDFLAGS="-L$SEARCH_DIR_LIBS"
2783
 
                unset ac_cv_lib_expat_XML_ParserCreate
2784
 
                AC_CHECK_LIB(expat, XML_ParserCreate,
2785
 
                    [
2786
 
                        EXPAT_LIBS="-L$SEARCH_DIR_LIBS -lexpat"
2787
 
                    ],
2788
 
                    [ EXPAT_OK=missing ]
2789
 
                )
2790
 
            ]
2791
 
        )
2792
 
    fi
2793
 
fi
2794
 
 
2795
 
LIBS="$LIBS_SAVE $LIBS"
2796
 
 
2797
 
if test "x$EXPAT_OK" = xyes; then
2798
 
    AC_DEFINE([HAVE_EXPAT], [1], [expat library presence])
2799
 
    AC_SUBST(EXPAT_CXXFLAGS)
2800
 
    AC_SUBST(EXPAT_LIBS)
2801
 
else
2802
 
    if test "x$EXPAT_EN" = xyes; then
2803
 
        AC_MSG_ERROR(unable to configure expat support)
2804
 
    fi
2805
 
fi
2806
 
 
2807
 
LDFLAGS="$LDFLAGS_SAVE"
2808
 
CPPFLAGS="$CPPFLAGS_SAVE"
2809
 
 
2810
 
######## exiv2
2811
 
# TEMPORARILY DISABLED BECAUSE EXIV2 HAS MEMORY LEAKS
2812
 
 
2813
 
#EXIV2_OK="disabled (force with --enable-exiv2)"
2814
 
#AC_ARG_ENABLE(exiv2,
2815
 
#  [  --enable-exiv2           exiv2 support],
2816
 
#  [
2817
 
#     EXIV2_EN=$enableval 
2818
 
#     if test "x$enableval" = xno; then
2819
 
#        EXIV2_OK=disabled
2820
 
#     fi
2821
 
#     if test "x$enableval" = xyes; then
2822
 
#        EXIV2_OK=yes
2823
 
#     fi
2824
 
#  ]
2825
 
#)
2826
 
#if test "x$EXIV2_OK" = xyes; then
2827
 
#    AC_CHECK_HEADER(exiv2/exif.hpp,
2828
 
#        [],
2829
 
#        [EXIV2_OK=missing],
2830
 
#        /* checking for exiv2/exif.h */
2831
 
#    )
2832
 
#fi
2833
 
#if test "x$EXIV2_OK" = xyes; then
2834
 
#   LDFLAGS="$LDFLAGS -lexiv2"
2835
 
#   AC_DEFINE(HAVE_EXIV2)
2836
 
#else
2837
 
#    if test "x$EXIV2_EN" = xyes; then
2838
 
#        AC_MSG_ERROR(unable to configure exiv2 support)
2839
 
#    fi
2840
 
#fi
 
1653
MT_CHECK_REQUIRED_PACKAGE([expat], [expat], [expat], [XML_ParserCreate])
 
1654
 
 
1655
####### libmp4v2
 
1656
 
 
1657
MT_CHECK_OPTIONAL_PACKAGE([libmp4v2], [disable],
 
1658
                 [libmp4v2 support for mp4 metadata extraction],
 
1659
                 [mp4], [mp4v2], [MP4Read]) 
 
1660
 
 
1661
if test "x$LIBMP4V2_STATUS" = xyes; then
 
1662
   CFLAGS="$CFLAGS $LIBMP4V2_CFLAGS"
 
1663
   CXXFLAGS="$CXXFLAGS $LIBMP4V2_CFLAGS"
 
1664
   LDFLAGS="$LDFLAGS $LIBMP4V2_LDFLAGS $LIBMP4V2_LIBS"
 
1665
   AC_LANG_SAVE
 
1666
   AC_LANG_CPLUSPLUS
 
1667
   AC_MSG_CHECKING([for MP4GetMetadataCoverArtCount() libmp4v2])
 
1668
   AC_COMPILE_IFELSE(
 
1669
        [AC_LANG_PROGRAM(
 
1670
            [
 
1671
                #include <mp4.h>
 
1672
            ],
 
1673
            [
 
1674
                (void)MP4GetMetadataCoverArtCount(0);
 
1675
            ]
 
1676
        )],
 
1677
        [
 
1678
            AC_MSG_RESULT([yes])
 
1679
            AC_DEFINE([HAVE_MP4_GET_METADATA_COVER_ART_COUNT], [1],
 
1680
                      [this version of libmp4v2 has MP4GetMetadataCoverArtCount() support])
 
1681
        ],
 
1682
        [
 
1683
            AC_MSG_RESULT([no])
 
1684
        ])
 
1685
 
 
1686
   AC_MSG_CHECKING([for MP4GetTrackAudioChannels() in libmp4v2])
 
1687
   AC_COMPILE_IFELSE(
 
1688
        [AC_LANG_PROGRAM(
 
1689
            [
 
1690
                #include <mp4.h>
 
1691
            ],
 
1692
            [
 
1693
                (void)MP4GetTrackAudioChannels(0, 0);
 
1694
            ]
 
1695
        )],
 
1696
        [
 
1697
            AC_MSG_RESULT([yes])
 
1698
            AC_DEFINE([HAVE_MP4_GET_TRACK_AUDIO_CHANNELS], [1],
 
1699
                      [this version of libmp4 has MP4GetTrackAudioChannels support])
 
1700
        ],
 
1701
        [
 
1702
            AC_MSG_RESULT([no])
 
1703
        ])
 
1704
 
 
1705
   AC_LANG_RESTORE
 
1706
fi
2841
1707
 
2842
1708
########## INOTIFY TOOLS
2843
1709
 
2844
 
AC_ARG_ENABLE(inotify,
2845
 
        AC_HELP_STRING([--enable-inotify], [compile with inotify support (default: yes)]),
2846
 
        [
2847
 
            INOTIFY_EN=$enableval
2848
 
            if test "x$enableval" = xno; then
2849
 
                INOTIFY_OK=disabled
2850
 
            else
2851
 
                INOTIFY_OK=yes
2852
 
            fi
2853
 
        ],
2854
 
        [
2855
 
            INOTIFY_OK=yes      
2856
 
        ]
2857
 
)
2858
 
 
2859
 
if test "x$INOTIFY_OK" = xyes; then
2860
 
    if test -n "$INOTIFY_SEARCH_HEADERS"; then
2861
 
        AC_MSG_NOTICE([Will search for inotify header in $INOTIFY_SEARCH_HEADERS])
2862
 
        AC_CHECK_HEADER([$INOTIFY_SEARCH_HEADERS/sys/inotify.h],
2863
 
                [
2864
 
                            INOTIFY_CXXFLAGS="-I$INOTIFY_SEARCH_HEADERS"
2865
 
                            INOTIFY_OK=yes
2866
 
                ],
2867
 
                [
2868
 
                    AC_MSG_ERROR(inotify.h not found in requested location $INOTIFY_SEARCH_HEADERS)
2869
 
                ]
2870
 
        )
2871
 
    else
2872
 
        inotify_path= 
2873
 
        AC_CHECK_HEADER(sys/inotify.h, [], 
2874
 
            [
2875
 
                INOTIFY_OK=missing
2876
 
                for inotify_path in $SEARCH_DIR_HEADERS; do
2877
 
                    if test "x$ac_cv_header_sys_inotify_h" != xyes ; then
2878
 
                        unset ac_cv_header_sys_inotify_h
2879
 
                        AC_CHECK_HEADER($inotify_path/sys/inotify.h, 
2880
 
                            [
2881
 
                                INOTIFY_CXXFLAGS="-I$inotify_path"
2882
 
                                INOTIFY_OK=yes
2883
 
                            ]
2884
 
                        )
2885
 
                    fi
2886
 
                done
2887
 
            ])
2888
 
    fi
2889
 
fi
2890
 
 
2891
 
if test "x$INOTIFY_EN" != xno; then
 
1710
MT_OPTION([inotify], [disable], [inotify support for imporved autoscan], [], 
 
1711
          [INOTIFY_STATUS=disabled])
 
1712
 
 
1713
if test "x$INOTIFY_OPTION_ENABLED" = xyes; then
 
1714
    MT_CHECK_HEADER([inotify], [sys/inotify])
 
1715
fi
 
1716
 
 
1717
if test "x$INOTIFY_STATUS" = xyes; then
 
1718
    AC_CHECK_FUNCS([inotify_init], [], [INOTIFY_STATUS=missing])
 
1719
fi
 
1720
 
 
1721
if test "x$INOTIFY_STATUS" = xyes; then
2892
1722
dnl The check below was inspired by configure.ac from the inotify tools
2893
1723
dnl package, see the "Acknowledgements" section in our README file for more 
2894
1724
dnl information.
2895
 
    CXXFLAGS="$CXXFLAGS $INOTIFY_CXXFLAGS"
 
1725
    CXXFLAGS="$CXXFLAGS $INOTIFY_CFLAGS"
 
1726
    CFLAGS="$CFLAGS $INOTIFY_CFLAGS"
2896
1727
    AC_MSG_CHECKING([whether sys/inotify.h works])
2897
1728
    AC_RUN_IFELSE(
2898
1729
        AC_LANG_PROGRAM([[#include <sys/inotify.h>]],
2910
1741
                        ),
2911
1742
                        [
2912
1743
                            AC_MSG_RESULT([yes]);
2913
 
                            INOTIFY_OK=yes
2914
1744
                        ],
2915
1745
                        [
2916
 
                            if test "x$INOTIFY_EN" != xyes; then
 
1746
                            if ((test "x$INOTIFY_OPTION_REQUESTED" != xyes) &&
 
1747
                                (test "x$INOTIFY_OPTION_ENABLED" = xyes)); then
2917
1748
                                AC_MSG_RESULT([no, disabling inotify support])
 
1749
                            elif ((test "x$INOTIFY_OPTION_REQUESTED" != xyes) &&
 
1750
                               (test "x$INOTIFY_OPTION_ENABLED" != xyes)); then
 
1751
                                AC_MSG_RESULT([no])
 
1752
                            fi
 
1753
                                INOTIFY_STATUS=no
 
1754
                        ],
 
1755
                        [
 
1756
                            if ((test "x$INOTIFY_OPTION_REQUESTED" = xyes) &&
 
1757
                                (test "x$INOTIFY_OPTION_ENABLED" = xyes)); then
 
1758
                                AC_MSG_RESULT([selecting yes for cross compiling]) 
 
1759
                                INOTIFY_STATUS=yes
2918
1760
                            else
2919
 
                                AC_MSG_RESULT([no])
 
1761
                                AC_MSG_RESULT([selecting no for cross compiling]) 
 
1762
                                INOTIFY_STATUS=no
2920
1763
                            fi
2921
 
                            INOTIFY_OK=missing
2922
1764
                        ])
2923
1765
 
 
1766
                ],
 
1767
                [
 
1768
                    if ((test "x$INOTIFY_OPTION_REQUESTED" = xyes) &&
 
1769
                        (test "x$INOTIFY_OPTION_ENABLED" = xyes)); then
 
1770
                       AC_MSG_RESULT([selecting yes for cross compiling]) 
 
1771
                       INOTIFY_STATUS=yes
 
1772
                    else
 
1773
                       AC_MSG_RESULT([selecting no for cross compiling]) 
 
1774
                       INOTIFY_STATUS=no
 
1775
                    fi
2924
1776
                ])
2925
1777
fi
2926
1778
 
2927
 
if test "x$INOTIFY_OK" = xyes; then
 
1779
if test "x$INOTIFY_STATUS" = xyes; then
2928
1780
    AC_DEFINE([HAVE_INOTIFY], [1], [inotify presence])
2929
 
    AC_SUBST(INOTIFY_CXXFLAGS)
 
1781
    AC_SUBST(INOTIFY_CFLAGS)
2930
1782
else
2931
 
    if test "x$INOTIFY_EN" = xyes; then
 
1783
    if ((test "x$INOTIFY_OPTION_REQUESTED" = xyes) &&
 
1784
        (test "x$INOTIFY_OPTION_ENABLED" = xyes)); then
2932
1785
        AC_MSG_NOTICE([enabling runtime inotify detection])
2933
1786
        # if system inotify header exists, go with it, otherwise take our own
2934
1787
        if test "x$ac_cv_header_sys_inotify_h" = xyes; then
2935
1788
             AC_DEFINE([SYS_INOTIFY_H_OK],[1],[sys/inotify.h exists])
2936
1789
        fi
2937
1790
        AC_DEFINE([HAVE_INOTIFY], [1], [inotify presence])
2938
 
        AC_SUBST(INOTIFY_CXXFLAGS)
2939
 
        INOTIFY_OK=yes
 
1791
        AC_SUBST(INOTIFY_CFLAGS)
 
1792
        INOTIFY_STATUS=yes
2940
1793
    fi
2941
1794
fi
2942
1795
 
2944
1797
CPPFLAGS="$CPPFLAGS_SAVE"
2945
1798
CXXFLAGS="$CXXFLAGS_SAVE"
2946
1799
 
2947
 
AC_ARG_ENABLE(tombdebug,
2948
 
        AC_HELP_STRING([--enable-tombdebug], [enable debug output for MediaTomb (default: no)]),
2949
 
  [
2950
 
     LOGDEBUG_EN=$enableval 
2951
 
     if test "x$enableval" = xno; then
2952
 
        LOGDEBUG_OK=disabled
2953
 
     else
2954
 
        LOGDEBUG_OK=yes
2955
 
     fi
2956
 
  ],
2957
 
  [
2958
 
     LOGDEBUG_OK=disabled
2959
 
  ]
2960
 
)
2961
 
if test "x$LOGDEBUG_OK" = xyes; then
2962
 
    AC_DEFINE(LOG_TOMBDEBUG, 1, [if defined compile with debug log output])
2963
 
fi
2964
 
 
2965
 
 
2966
 
AC_ARG_ENABLE(upnpdebug,
2967
 
        AC_HELP_STRING([--enable-upnpdebug], [enable debug output for TombUPnP (default: no)]),
2968
 
  [
2969
 
     UPNPDEBUG_EN=$enableval 
2970
 
     if test "x$enableval" = xno; then
2971
 
        UPNPDEBUG_OK=disabled
2972
 
     else
2973
 
        UPNPDEBUG_OK=yes
2974
 
     fi
2975
 
  ],
2976
 
  [
2977
 
    UPNPDEBUG_OK=disabled
2978
 
  ]
2979
 
)
2980
 
 
2981
 
if test "x$UPNPDEBUG_OK" = xyes; then
2982
 
    AC_DEFINE(UPNP_HAVE_DEBUG, 1, [see upnpconfig.h])
2983
 
    AC_DEFINE(DEBUG, 1, [Define to 1 to compile debug code])
2984
 
fi
2985
 
 
2986
 
if (test "x$LOGDEBUG_OK" != xyes) && (test "x$UPNPDEBUG_OK" != xyes); then
 
1800
AC_DEFINE([__STDC_CONSTANT_MACROS], [1], [needed for stdint.h])
 
1801
AC_DEFINE([__STDC_LIMIT_MACROS], [1], [needed for stdint.h])
 
1802
 
 
1803
MT_CHECK_OPTIONAL_PACKAGE_CFG([libdvdnav], [disable],
 
1804
             [compile with libdvdnav support for extended DVD image parsing],
 
1805
             [dvdnav-config],
 
1806
             [dvdnav/dvdnav.h], [dvdnav], [dvdnav_get_audio_attr], [])
 
1807
 
 
1808
 
 
1809
MT_OPTION([tombdebug], [enable], [enable debug code for MediaTomb],
 
1810
          [
 
1811
            AC_DEFINE(TOMBDEBUG, 1, [if defined compile with debug log output])
 
1812
          ],
 
1813
          [])
 
1814
 
 
1815
MT_OPTION([upnpdebug], [enable], [enable debug output for TombUPnP/libupnp],
 
1816
          [
 
1817
            AC_DEFINE(UPNP_HAVE_DEBUG, 1, [see upnpconfig.h])
 
1818
            AC_DEFINE(DEBUG, 1, [Define to 1 to compile debug code])
 
1819
          ],
 
1820
          [])
 
1821
 
 
1822
if (test "x$TOMBDEBUG_OPTION_ENABLED" != xyes) && 
 
1823
   (test "x$UPNPDEBUG_OPTION_ENABLED" != xyes); then
2987
1824
    AC_DEFINE(NDEBUG, 1, [make sure there are no asserts in the retail build])
2988
1825
fi
2989
1826
 
2990
 
AC_ARG_ENABLE(log,
2991
 
        AC_HELP_STRING([--disable-log], [disable all output from MediaTomb (default: no)]),
2992
 
  [
2993
 
     LOG_OK_EN=$enableval 
2994
 
     if test "x$enableval" = xno; then
2995
 
        LOG_OK=disabled
2996
 
     else
2997
 
        LOG_OK=yes
2998
 
     fi
2999
 
  ],
3000
 
  [
3001
 
      LOG_OK=yes
3002
 
  ]
3003
 
)
3004
 
 
3005
 
if test "x$LOG_OK" = xyes; then
3006
 
    AC_DEFINE(LOG_ENABLED, 1, [if defined compile with log output])
3007
 
fi
 
1827
MT_OPTION([log], [disable], [disable all console output],
 
1828
          [
 
1829
            AC_DEFINE(LOG_ENABLED, 1, [if defined compile with log output])
 
1830
          ],
 
1831
          [])
 
1832
 
 
1833
MT_OPTION([debug-log], [disable], [compile without debug messages],
 
1834
          [
 
1835
            AC_DEFINE(DEBUG_LOG_ENABLED, 1, [compile with debug messages])
 
1836
          ],
 
1837
          [])
 
1838
 
3008
1839
 
3009
1840
eval PACKAGE_DATADIR="${datadir}/${PACKAGE}"
3010
1841
eval PACKAGE_DATADIR="${PACKAGE_DATADIR}"
3011
1842
AC_DEFINE_UNQUOTED(PACKAGE_DATADIR, "$PACKAGE_DATADIR", [MediaTomb data directory])
3012
1843
 
3013
 
if test $YOUTUBE -eq 1; then
3014
 
    YOUTUBE_OK="yes"
 
1844
if (test "x$YOUTUBE_OPTION_ENABLED" = xyes) || (test "x$WEBORAMA_OPTION_ENABLED" = xyes) || (test "x$ATRAILERS_OPTION_ENABLED" = xyes) || (test "x$SOPCAST_OPTION_ENABLED" = xyes); then
3015
1845
    AC_DEFINE(ONLINE_SERVICES, 1, [at least one online service is supported])
 
1846
fi
 
1847
 
 
1848
if (test "x$YOUTUBE_OPTION_ENABLED" = xyes); then
3016
1849
    AC_DEFINE([YOUTUBE], [1], [Enable support for the YouTube service])
3017
 
else
3018
 
    YOUTUBE_OK="disabled"
3019
 
fi
 
1850
fi
 
1851
 
 
1852
if (test "x$WEBORAMA_OPTION_ENABLED" = xyes); then
 
1853
    AC_DEFINE([WEBORAMA], [1], [Enable support for the Weborama service])
 
1854
fi
 
1855
 
 
1856
if (test "x$ATRAILERS_OPTION_ENABLED" = xyes); then
 
1857
    AC_DEFINE([ATRAILERS], [1], [Enable support for the apple trailers])
 
1858
fi
 
1859
 
 
1860
if (test "x$SOPCAST_OPTION_ENABLED" = xyes); then
 
1861
    AC_DEFINE([SOPCAST], [1], [Enable support for the SopCast service])
 
1862
fi
 
1863
 
 
1864
AC_DEFINE_UNQUOTED([COMPILE_INFO], "host: $host; sqlite3: $SQLITE3_STATUS; mysql: $MYSQL_STATUS libjs: $JS_OK; libmagic: $LIBMAGIC_STATUS; inotify: $INOTIFY_STATUS; libexif: $LIBEXIF_STATUS; id3lib: $ID3LIB_STATUS; taglib: $TAGLIB_STATUS; ffmpeg: $FFMPEG_STATUS; libmp4v2: $LIBMP4V2_STATUS; external transcoding: $EXTERNAL_TRANSCODING_OPTION_ENABLED; curl: $CURL_OK; YouTube: $YOUTUBE_OPTION_ENABLED; SopCast: $SOPCAST_OPTION_ENABLED; Weborama: $WEBORAMA_OPTION_ENABLED; Apple Trailers: $ATRAILERS_OPTION_ENABLED; libdvdnav: $LIBDVDNAV_STATUS; libextractor: $LIBEXTRACTOR_STATUS; db-autocreate: $DB_AUTOCREATE_OPTION_ENABLED; debug log: $DEBUG_LOG_OPTION_ENABLED; protocol info extensions: $PROTOCOLINFO_EXTENSION_OPTION_ENABLED; data directory: $PACKAGE_DATADIR; ffmpegthumbnailer: $FFMPEGTHUMBNAILER_STATUS", [compile option summary])
3020
1865
 
3021
1866
###############
3022
1867
AC_CONFIG_FILES([
3025
1870
    doc/Makefile
3026
1871
    scripts/Makefile
3027
1872
    scripts/js/Makefile
 
1873
    scripts/mediatomb-service-optware
3028
1874
    tombupnp/Makefile
3029
1875
    tombupnp/build/Makefile
3030
1876
    web/Makefile
3039
1885
echo "CONFIGURATION SUMMARY ----"
3040
1886
#                        disabled
3041
1887
echo
3042
 
echo "sqlite3               : $SQLITE3_OK"
3043
 
echo "mysql                 : $MYSQL_OK"
 
1888
echo "sqlite3               : $SQLITE3_STATUS"
 
1889
echo "mysql                 : $MYSQL_STATUS"
3044
1890
##echo "postgresql          : $PGSQL_OK"
3045
1891
echo "libjs                 : $JS_OK"
3046
 
echo "libmagic              : $MAGIC_OK"
3047
 
echo "inotify               : $INOTIFY_OK"
3048
 
echo "libexif               : $EXIF_OK"
3049
 
echo "expat                 : $EXPAT_OK"
3050
 
echo "id3lib                : $ID3_OK"
3051
 
echo "taglib                : $TAGLIB_OK"
3052
 
echo "ffmpeg                : $FFMPEG_OK"
3053
 
echo "external transcoding  : $EXTERNAL_TRANSCODING_OK"
3054
 
# echo "YouTube               : $YOUTUBE_OK"
3055
 
echo "libextractor          : $EXTRACTOR_OK"
3056
 
 
3057
 
 
3058
 
 
3059
 
if  test $AUTOCREATE_PRINT != "0"; then
3060
 
    echo "db-autocreate         : $AUTOCREATE_PRINT"
3061
 
fi
 
1892
echo "libmagic              : $LIBMAGIC_STATUS"
 
1893
echo "inotify               : $INOTIFY_STATUS"
 
1894
echo "libexif               : $LIBEXIF_STATUS"
 
1895
#echo "expat                 : $EXPAT_STATUS"
 
1896
echo "id3lib                : $ID3LIB_STATUS"
 
1897
echo "taglib                : $TAGLIB_STATUS"
 
1898
echo "libmp4v2              : $LIBMP4V2_STATUS"
 
1899
echo "libdvdnav             : $LIBDVDNAV_STATUS"
 
1900
echo "ffmpeg                : $FFMPEG_STATUS"
 
1901
echo "ffmpegthumbnailer     : $FFMPEGTHUMBNAILER_STATUS"
 
1902
echo "external transcoding  : $EXTERNAL_TRANSCODING_OPTION_ENABLED"
 
1903
echo "curl                  : $CURL_OK"
 
1904
echo "YouTube               : $YOUTUBE_OPTION_ENABLED"
 
1905
echo "Weborama              : $WEBORAMA_OPTION_ENABLED"
 
1906
echo "Apple Trailers        : $ATRAILERS_OPTION_ENABLED"
 
1907
echo "SopCast               : $SOPCAST_OPTION_ENABLED"
 
1908
echo "libextractor          : $LIBEXTRACTOR_STATUS"
 
1909
echo "db-autocreate         : $DB_AUTOCREATE_OPTION_ENABLED"
3062
1910
        
3063
 
if test "$LOG_OK" != "yes"; then
3064
 
    echo "log output            : $LOG_OK"
3065
 
fi
3066
 
 
3067
 
if test "$LOGDEBUG_OK" != "disabled"; then
3068
 
    echo "debug log             : $LOGDEBUG_OK"
3069
 
fi
3070
 
 
3071
 
if test "$UPNPDEBUG_OK" != "disabled"; then
3072
 
    echo "upnpdebug             : $UPNPDEBUG_OK"
3073
 
fi
3074
 
 
3075
 
if test "$STATIC" = "yes"; then
3076
 
    echo "static build          : $STATIC"
3077
 
fi
3078
 
# echo "  libjpeg     : $LIBJPEG_OK"
3079
 
# echo "  exiv2       : $EXIV2_OK"
 
1911
if test "x$TOMBDEBUG_OPTION_ENABLED" = xyes; then
 
1912
    echo "debug log             : $TOMBDEBUG_OPTION_ENABLED"
 
1913
fi
 
1914
 
 
1915
if test "x$UPNPDEBUG_OPTION_ENABLED" = xyes; then
 
1916
    echo "upnpdebug             : $UPNPDEBUG_OPTION_ENABLED"
 
1917
fi
 
1918
 
 
1919
if test "x$STATIC_OPTION_ENABLED" = xyes; then
 
1920
    echo "static build          : $STATIC_OPTION_ENABLED"
 
1921
fi
 
1922
 
3080
1923
echo
3081
1924