summaryrefslogtreecommitdiffstats
path: root/configure.in
blob: 469619baba6bec68bf888f8371c34f7928ad78fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
dnl =======================================================
dnl FILE: ./admin/configure.in.min
dnl =======================================================

dnl    This file is part of the KDE libraries/packages
dnl    Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
 
dnl    This file is free software; you can redistribute it and/or
dnl    modify it under the terms of the GNU Library General Public
dnl    License as published by the Free Software Foundation; either
dnl    version 2 of the License, or (at your option) any later version.
 
dnl    This library is distributed in the hope that it will be useful,
dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
dnl    Library General Public License for more details.
 
dnl    You should have received a copy of the GNU Library General Public License
dnl    along with this library; see the file COPYING.LIB.  If not, write to
dnl    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
dnl    Boston, MA 02110-1301, USA.

# Original Author was Kalle@kde.org
# I lifted it in some mater. (Stephan Kulow)
# I used much code from Janos Farkas

dnl Process this file with autoconf to produce a configure script.

AC_INIT(acinclude.m4) dnl a source file from your sub dir

dnl This is so we can use kde-common
AC_CONFIG_AUX_DIR(admin)

dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
unset CDPATH

dnl Checking host/target/build systems, for make, install etc.
AC_CANONICAL_SYSTEM 
dnl Perform program name transformation
AC_ARG_PROGRAM

dnl Automake doc recommends to do this only here. (Janos)
AM_INIT_AUTOMAKE(kaffeine-0.8.8, "3.5.7") dnl searches for some needed programs

KDE_SET_PREFIX

dnl generate the config header
AM_CONFIG_HEADER(config.h) dnl at the distribution this done

dnl Checks for programs.
AC_CHECK_COMPILERS
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
KDE_PROG_LIBTOOL

dnl for NLS support. Call them in this order!
dnl WITH_NLS is for the po files
AM_KDE_WITH_NLS

KDE_USE_QT(3.3)
AC_PATH_KDE
dnl =======================================================
dnl FILE: configure.in.in
dnl =======================================================

#MIN_CONFIG(3.3)
CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"

if test "$build_arts" = "yes"; then
    AC_DEFINE(USE_ARTS, 1, [If we use arts volume])
    LIB_ARTS="-lartskde"
    AC_SUBST(LIB_ARTS)
fi

KDE_INIT_DOXYGEN([The API Reference], [Version $VERSION])

dnl =======================================================
dnl FILE: ./kaffeine/configure.in.in
dnl =======================================================

dnl -----------
dnl basic stuff
dnl -----------

KDE_ENABLE_HIDDEN_VISIBILITY

AC_ARG_VAR([PKG_CONFIG], [Path to pkg-config])

if test -z "$PKG_CONFIG" ; then
	PKG_CONFIG="pkg-config"
fi

AC_MSG_CHECKING([for pkg-config])

if ! "$PKG_CONFIG" --version ; then
	echo ""
	echo "---------------------------------------------------------------------"
	echo "ERROR: Could not find pkg-config. Make sure it is in your path or set"
	echo "the PKG_CONFIG environment variable to the full path to pkg-config."
	echo "---------------------------------------------------------------------"
	echo ""
	AC_MSG_ERROR([could not find pkg-config])
fi

AC_ARG_WITH([xinit-workaround],
  [AS_HELP_STRING([--with-xinit-workaround],
    [use this flag if Kaffeine hangs at startup and you are using XFree86 4.4 or X.Org 6.7.0])],,
  [with_xinit_workaround=no])

if test "$with_xinit_workaround" = "yes" ; then
	AC_DEFINE([XINIT_WKRND],,[workaround buggy X server])
fi

dnl ------------------------
dnl check for DPMS extension
dnl ------------------------

AC_ARG_WITH([dpms], [AS_HELP_STRING([--without-dpms], [build without DPMS support])],,
  [with_dpms=yes])

CFLAGS_DPMS=""
LIB_DPMS=""

if test "$with_dpms" != "no" ; then
	AC_MSG_CHECKING([for DPMS extension])

	if "$PKG_CONFIG" --exists xext ; then
		with_dpms=yes
		CFLAGS_DPMS=`"$PKG_CONFIG" --cflags xext`
		LIB_DPMS=`"$PKG_CONFIG" --libs xext`
		AC_DEFINE([HAVE_DPMS],,[DPMS extension available])
		AC_MSG_RESULT([yes])
	else
		with_dpms=no
		AC_MSG_RESULT([no])
	fi
fi

AC_SUBST([CFLAGS_DPMS])
AC_SUBST([LIB_DPMS])

dnl -------------------------
dnl check for XTest extension
dnl -------------------------

AC_ARG_WITH([xtest], [AS_HELP_STRING([--without-xtest], [build without XTest support])],,
  [with_xtest=yes])

CFLAGS_XTEST=""
LIB_XTEST=""

if test "$with_xtest" != "no" ; then
	AC_MSG_CHECKING([for XTest extension])

	if "$PKG_CONFIG" --exists xtst ; then
		with_xtest=yes
		CFLAGS_XTEST=`"$PKG_CONFIG" --cflags xtst`
		LIB_XTEST=`"$PKG_CONFIG" --libs xtst`
		AC_DEFINE([HAVE_XTEST],,[XTest extension available])
		AC_MSG_RESULT([yes])
	else
		with_xtest=no
		AC_MSG_RESULT([no])
	fi
fi

AC_SUBST([CFLAGS_XTEST])
AC_SUBST([LIB_XTEST])

dnl ----------------------------
dnl check for Xinerama extension
dnl ----------------------------

AC_ARG_WITH([xinerama], [AS_HELP_STRING([--without-xinerama], [build without Xinerama support])],,
  [with_xinerama=yes])

CFLAGS_XINERAMA=""
LIB_XINERAMA=""

if test "$with_xinerama" != "no" ; then
	AC_MSG_CHECKING([for Xinerama extension])

	if "$PKG_CONFIG" --exists xinerama ; then
		with_xinerama=yes
		CFLAGS_XINERAMA=`"$PKG_CONFIG" --cflags xinerama`
		LIB_XINERAMA=`"$PKG_CONFIG" --libs xinerama`
		AC_DEFINE([HAVE_XINERAMA],,[Xinerama extension available])
		AC_MSG_RESULT([yes])
	else
		with_xinerama=no
		AC_MSG_RESULT([no])
	fi
fi

AC_SUBST([CFLAGS_XINERAMA])
AC_SUBST([LIB_XINERAMA])

dnl ------------------
dnl check for xine-lib
dnl ------------------

AC_MSG_CHECKING([for xine-lib])

CFLAGS_XINE=""
LIB_XINE=""

if "$PKG_CONFIG" --exists "libxine >= 1.1.9" ; then
	CFLAGS_XINE=`"$PKG_CONFIG" --cflags libxine`
	LIB_XINE=`"$PKG_CONFIG" --libs libxine`
	AC_MSG_RESULT([yes])
else
	AC_MSG_RESULT([no])

	echo ""
	echo "---------------------------------------"
	echo "ERROR: Could not find xine-lib >= 1.1.9"
	echo "---------------------------------------"
	echo ""

	AC_MSG_ERROR([could not find xine-lib])
fi

AC_SUBST([CFLAGS_XINE])
AC_SUBST([LIB_XINE])

dnl -------------
dnl check for xcb
dnl -------------

AC_ARG_WITH([xcb], [AS_HELP_STRING([--without-xcb], [disable xcb support (not recommended)])],,
  [with_xcb=yes])

AC_MSG_CHECKING([for xcb and xine-lib >= 1.1.9])

CFLAGS_XCB=""
LIB_XCB=""

if test "$with_xcb" != "no" ; then
	if "$PKG_CONFIG" --exists "xcb >= 1.0" ; then
		with_xcb=yes
		CFLAGS_XCB=`"$PKG_CONFIG" --cflags xcb`
		LIB_XCB=`"$PKG_CONFIG" --libs xcb`
		AC_DEFINE([HAVE_XCB],,[xcb available])
		AC_MSG_RESULT([yes])
	else
		with_xcb=no
		AC_MSG_RESULT([no])
	fi
fi

AC_SUBST([CFLAGS_XCB])
AC_SUBST([LIB_XCB])

AM_CONDITIONAL([with_xcb], [test "$with_xcb" = "yes"])

dnl ---------------------
dnl check for DVB headers
dnl ---------------------

AC_ARG_WITH([dvb], [AS_HELP_STRING([--without-dvb], [build without DVB support])],,
  [with_dvb=yes])

if test "$with_dvb" != "no" ; then
	KDE_CHECK_HEADER([linux/dvb/frontend.h], [with_dvb=yes]
	  [AC_DEFINE([HAVE_DVB],,[DVB headers installed])], [with_dvb=no])
fi

AM_CONDITIONAL([with_dvb], [test "$with_dvb" = "yes"])

dnl -------------------
dnl check for gstreamer
dnl -------------------

AC_ARG_WITH([gstreamer], [AS_HELP_STRING([--without-gstreamer], [disable GStreamer player part])],,
  [with_gstreamer=yes])

CFLAGS_GSTREAMER=""
LIB_GSTREAMER=""

if test "$with_gstreamer" != "no" ; then
	AC_MSG_CHECKING([for GStreamer])

	if "$PKG_CONFIG" --exists "gstreamer-0.10 gstreamer-plugins-base-0.10"; then
		with_gstreamer=yes
		CFLAGS_GSTREAMER=`"$PKG_CONFIG" --cflags gstreamer-0.10 gstreamer-plugins-base-0.10`
		LIB_GSTREAMER=`"$PKG_CONFIG" --libs gstreamer-0.10 gstreamer-plugins-base-0.10`
		AC_MSG_RESULT([yes])
	else
		with_gstreamer=no
		AC_MSG_RESULT([no])
	fi
fi

AC_SUBST([CFLAGS_GSTREAMER])
AC_SUBST([LIB_GSTREAMER])

AM_CONDITIONAL([with_gstreamer], [test "$with_gstreamer" = "yes"])

dnl --------------------
dnl check for cdparanoia
dnl --------------------

KDE_CHECK_HEADER([cdio/cdda.h], [with_cdparanoia=yes], [with_cdparanoia=no])

if test "$with_cdparanoia" != "yes" ; then
	echo ""
	echo "-----------------------------------------"
	echo "ERROR: Could not find cdparanoia headers."
	echo "-----------------------------------------"
	echo ""

	AC_MSG_ERROR([could not find cdparanoia headers])
fi

dnl ----------------------------
dnl check for Ogg Vorbis encoder
dnl ----------------------------

AC_ARG_WITH([oggvorbis], [AS_HELP_STRING([--without-oggvorbis], [build without Ogg Vorbis support])],,
  [with_oggvorbis=yes])

CFLAGS_OGGVORBIS=""
LIB_OGGVORBIS=""

if test "$with_oggvorbis" != "no" ; then
	AC_MSG_CHECKING([for Ogg/Vorbis encoder])

	if "$PKG_CONFIG" --exists vorbisenc ; then
		with_oggvorbis=yes
		CFLAGS_OGGVORBIS=`"$PKG_CONFIG" --cflags vorbisenc`
		LIB_OGGVORBIS=`"$PKG_CONFIG" --libs vorbisenc`
		AC_MSG_RESULT([yes])
	else
		with_oggvorbis=no
		AC_MSG_RESULT([no])
	fi
fi

AC_SUBST([CFLAGS_OGGVORBIS])
AC_SUBST([LIB_OGGVORBIS])

AM_CONDITIONAL([with_oggvorbis], [test "$with_oggvorbis" = "yes"])

dnl --------------
dnl check for LAME
dnl --------------

AC_ARG_WITH([lame], [AS_HELP_STRING([--without-lame], [build without LAME support])],,
  [with_lame=yes])

LIB_LAME=""

if test "$with_lame" != "no" ; then
	KDE_CHECK_HEADER([lame/lame.h], [with_lame=yes], [with_lame=no])
fi

if test "$with_lame" = "yes" ; then
	KDE_CHECK_LIB([mp3lame], [lame_init], [LIB_LAME="-lmp3lame"], [with_lame=no], [-lm])
fi

AC_SUBST([LIB_LAME])

AM_CONDITIONAL([with_lame], [test "$with_lame" = "yes"])
KDE_CREATE_SUBDIRSLIST
AM_CONDITIONAL(doc_SUBDIR_included, test "x$doc_SUBDIR_included" = xyes)
AM_CONDITIONAL(kaffeine_SUBDIR_included, test "x$kaffeine_SUBDIR_included" = xyes)
AM_CONDITIONAL(po_SUBDIR_included, test "x$po_SUBDIR_included" = xyes)
AC_CONFIG_FILES([ Makefile ])
AC_CONFIG_FILES([ doc/Makefile ])
AC_CONFIG_FILES([ doc/kaffeine/Makefile ])
AC_CONFIG_FILES([ kaffeine/Makefile ])
AC_CONFIG_FILES([ kaffeine/images/Makefile ])
AC_CONFIG_FILES([ kaffeine/mimetypes/Makefile ])
AC_CONFIG_FILES([ kaffeine/mimetypes/application/Makefile ])
AC_CONFIG_FILES([ kaffeine/protocols/Makefile ])
AC_CONFIG_FILES([ kaffeine/servicemenus/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/audiobrowser/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/disc/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/disc/plugins/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/disc/plugins/mp3lame/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/disc/plugins/oggvorbis/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/dvb/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/dvb/lib/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/dvb/lib/libdvbapi/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/dvb/lib/libdvben50221/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/dvb/lib/libucsi/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/dvb/lib/libucsi/atsc/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/dvb/lib/libucsi/dvb/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/dvb/lib/libucsi/mpeg/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/dvb/plugins/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/dvb/plugins/epg/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/dvb/plugins/stream/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/input/dvbclient/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/player-parts/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/player-parts/dummy-part/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/player-parts/gstreamer-part/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/player-parts/kaffeine-part/Makefile ])
AC_CONFIG_FILES([ kaffeine/src/player-parts/xine-part/Makefile ])
AC_CONFIG_FILES([ po/Makefile ])
AC_OUTPUT
echo ""
echo "-------------------------------------------------------"
echo "Kaffeine configure results:"
echo ""

if test "$with_xcb" = "yes" ; then
	echo "Build with xcb support:                             yes"
else
	echo "Build with xcb support:                              no"
	echo "IMPORTANT: this is strongly discouraged"
fi

if test "$with_dpms" = "yes" ; then
	echo "Build with DPMS support:                            yes"
else
	echo "Build with DPMS support:                             no"
fi

if test "$with_xtest" = "yes" ; then
	echo "Build with XTest support:                           yes"
else
	echo "Build with XTest support:                            no"
fi

if test "$with_xinerama" = "yes" ; then
	echo "Build with Xinerama support:                        yes"
else
	echo "Build with Xinerama support:                         no"
fi

if test "$with_dvb" = "yes" ; then
	echo "Build with DVB support:                             yes"
else
	echo "Build with DVB support:                              no"
fi

if test "$with_gstreamer" = "yes" ; then
	echo "Build GStreamer player part:                        yes"
	echo "IMPORTANT: the GStreamer player part is experimental"
else
	echo "Build GStreamer player-part:                         no"
fi

if test "$with_oggvorbis" = "yes" ; then
	echo "Build Ogg Vorbis encoder plugin:                    yes"
else
	echo "Build Ogg Vorbis encoder plugin:                     no"
fi

if test "$with_lame" = "yes" ; then
	echo "Build LAME encoder plugin:                          yes"
else
	echo "Build LAME encoder plugin:                           no"
fi
# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
  # And if so, warn when they don't match
  if test "$kde_libs_prefix" != "$given_prefix"; then
    # And if kde doesn't know about the prefix yet
    echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
    if test $? -ne 0; then
      echo ""
      echo "Warning: you chose to install this package in $given_prefix,"
      echo "but KDE was found in $kde_libs_prefix."
      echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
      echo "that TDEDIRS contains it, e.g. export TDEDIRS=$given_prefix:$kde_libs_prefix"
      echo "Then restart KDE."
      echo ""
    fi
  fi
fi

if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
  echo ""
  echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
  echo "was not included. Therefore, GCC symbol visibility support remains disabled."
  echo ""
  echo "For better performance, consider including the Qt visibility supporting patch"
  echo "located at:"
  echo ""
  echo "http://bugs.kde.org/show_bug.cgi?id=109386"
  echo ""
  echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
  echo "everything will continue to work just fine without it."
  echo ""
fi

if test "$all_tests" = "bad"; then
  if test ! "$cache_file" = "/dev/null"; then
    echo ""
    echo "Please remove the file $cache_file after changing your setup"
    echo "so that configure will find the changes next time."
    echo ""
  fi
else
  echo ""
  echo "Good - your configure finished. Start make now"
  echo ""
fi