summaryrefslogtreecommitdiffstats
path: root/configure.in.in
blob: e63d3bebad612364cf08f61b2c2d7a14aeb950ac (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
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
#MIN_CONFIG

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h features.h alloca.h linux/awe_voice.h awe_voice.h /usr/src/sys/i386/isa/sound/awe_voice.h /usr/src/sys/gnu/i386/isa/sound/awe_voice.h linux/ucdrom.h sys/stdtypes.h sys/filio.h sys/audioio.h Alib.h sys/sem.h string.h getopt.h machine/endian.h sys/awe_voice.h)

dnl First, setup HAVE_LINUX_CDROM_H.
dnl This gets cached, so later we can selectively
dnl disable applications by using _CHECK_HEADER
AC_CHECK_HEADERS(linux/cdrom.h)

AC_CHECK_FUNCS(usleep snprintf)

AC_MSG_CHECKING(machine architecture)
AC_SUBST(ARCH_TYPE)
ARCH_TYPE=`uname -m`
if test `uname -s` = "FreeBSD"
then
	HW_MODEL=`sysctl -n hw.model`

	case "$HW_MODEL" in
		"Pentium II/Pentium II Xeon/Celeron")
			ARCH_TYPE="i686"
		;;
	esac
fi;
AC_MSG_RESULT($ARCH_TYPE)

case "$ARCH_TYPE" in
i?86)
	AC_MSG_CHECKING(for a binutils new enough to support MMX)
	as_ver=`echo|as -v 2>&1|grep ".*version.*"`
	if test -z "$as_ver"
	then
		MMX_SUPPORT="no"
	else
		as_ver=`echo $as_ver |sed -e "s/.*version //;s/ .*//"`
		as_major=`echo $as_ver |cut -d. -f1`
		if test $as_major -gt 2
		then
			MMX_SUPPORT="yes"
		else
			if test $as_major -lt 2
			then
				MMX_SUPPORT="no"
			else
				as_minor=`echo $as_ver |cut -d. -f2`
				if test $as_minor -ge 10
				then
					MMX_SUPPORT="yes"
				else
					MMX_SUPPORT="no"
				fi
			fi
		fi
	fi
	AC_MSG_RESULT($MMX_SUPPORT)
	;;
*)
	dnl No MMX support on non-x86 architecture toolchains
	MMX_SUPPORT="no"
  ;;
esac

dnl Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_TIME
CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"

dnl check if the assembler supports SSE instructions
AC_MSG_CHECKING([for x86 SSE instructions])
AC_CACHE_VAL(ac_cv_x86_sse,
[
AC_TRY_COMPILE(,
[
#if defined(__GNUC__) && defined(__i386__)
__asm__("movups %xmm0, (%esp)");
#else
#error Not gcc on x86
#endif
],
ac_cv_x86_sse=yes,
ac_cv_x86_sse=no)
])
AC_MSG_RESULT($ac_cv_x86_sse)
if test "x$ac_cv_x86_sse" = "xyes"; then
	    AC_DEFINE(HAVE_X86_SSE,1,
		        [Define if your assembler supports x86 SSE instructions])
fi

AC_DEFUN([KDE_CHECK_OGGVORBIS],
[
  have_oggvorbis=yes

  KDE_CHECK_LIB(ogg, ogg_page_version,
    [:], [have_oggvorbis=no])

  KDE_CHECK_HEADER(vorbis/vorbisfile.h,
    [:], [have_oggvorbis=no])

  KDE_CHECK_LIB(vorbis, vorbis_info_init,
    [:], [have_oggvorbis=no])

  KDE_CHECK_LIB(vorbisfile, ov_open,
    [:], [have_oggvorbis=no], -lvorbis -logg)

  KDE_CHECK_LIB(vorbisenc, vorbis_encode_init,
    [:], [have_oggvorbis=no], -lvorbis -logg)

  KDE_CHECK_LIB(vorbis, vorbis_bitrate_addblock,
    [have_vorbis_value=2], [have_vorbis_value=1])

  if test "x$have_oggvorbis" = xyes; then
    # for akode/plugins/xiph_decoder/ kioslave/audiocd/plugins/ and krec/ogg_export/
    VORBIS_LIBS="-lvorbis -logg"
    VORBISFILE_LIBS="-lvorbisfile"
    VORBISENC_LIBS="-lvorbisenc"

    # for akode/plugins/xiph_decoder/
    AC_DEFINE_UNQUOTED(HAVE_OGG_VORBIS, 1, [Define if you have ogg/vorbis installed])

    # for kioslave/audiocd/plugins/ and krec/ogg_export/
    AC_DEFINE_UNQUOTED(HAVE_VORBIS, $have_vorbis_value, [Define if you ogg/vorbis installed])

    # for mpeglib/
    OGG_VORBISLIBS="-lvorbisfile -lvorbis -logg"
    AC_DEFINE(OGG_VORBIS, 1, [Define if you have ogg/vorbis installed])
  fi

  AC_SUBST(VORBIS_LIBS)
  AC_SUBST(VORBISFILE_LIBS)
  AC_SUBST(VORBISENC_LIBS)
])

AC_DEFUN([KDE_CHECK_OSSAUDIO],
[
  have_ossaudio=no

  AC_CHECK_HEADERS([soundcard.h sys/soundcard.h],
    [have_ossaudio=yes])

  AC_CHECK_LIB(ossaudio, _oss_ioctl,
    [:], [have_ossaudio=no])

  if test "x$have_ossaudio" = xyes; then
    # for kmix/ and akode/
    LIBOSSAUDIO="-lossaudio"
  fi

  AC_SUBST(LIBOSSAUDIO)
])

AC_DEFUN([KDE_CHECK_ALSA],
[
  have_alsa=no

  AC_CHECK_HEADERS([sys/asoundlib.h alsa/asoundlib.h],
    [have_alsa=yes])

  AC_CHECK_LIB(asound, snd_seq_create_simple_port,
    [:], [have_alsa=no])

  AC_LANG_SAVE
  AC_LANG_C
  if test "x$have_alsa" = xyes; then
    AC_TRY_COMPILE([
      #include "confdefs.h"
      #ifdef HAVE_SYS_ASOUNDLIB_H
      #include <sys/asoundlib.h>
      #endif
      #ifdef HAVE_ALSA_ASOUNDLIB_H
      #include <alsa/asoundlib.h>
      #endif
    ],[
      #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5)
        /* we have ALSA 0.5.x */
      #else
        #error not ALSA 0.5.x
      #endif
    ],
    have_alsa_0_5=yes)

    AC_TRY_COMPILE([
      #include "confdefs.h"
      #ifdef HAVE_SYS_ASOUNDLIB_H
      #include <sys/asoundlib.h>
      #endif
      #ifdef HAVE_ALSA_ASOUNDLIB_H
      #include <alsa/asoundlib.h>
      #endif
    ],[
      #if (SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9)
        /* we have ALSA 0.9.x */
      #else
        #error not ALSA 0.9.x
      #endif
    ],
    have_alsa_0_9=yes)

    AC_TRY_COMPILE([
      #include "confdefs.h"
      #ifdef HAVE_SYS_ASOUNDLIB_H
      #include <sys/asoundlib.h>
      #endif
      #ifdef HAVE_ALSA_ASOUNDLIB_H
      #include <alsa/asoundlib.h>
      #endif
    ],[
      #if (SND_LIB_MAJOR == 1)
        /* we have ALSA 1.x */
      #else
        #error not ALSA 1.x
      #endif
    ],
    have_alsa_1=yes)
  fi
  AC_LANG_RESTORE

  if test "x$have_alsa_0_9" = xyes || test "x$have_alsa_1" = xyes; then
    # for kmix/ and akode/
    LIBASOUND="-lasound"
    AC_DEFINE(HAVE_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])

    # for arts/
    ARTS_LIBASOUND="-lasound"
    AC_DEFINE(HAVE_ARTS_LIBASOUND2, 1, [Define if you have libasound.so.2 (required for ALSA 0.9.x/1.x support)])
  fi

  if test "x$have_alsa_0_5" = xyes; then
    # for arts/
    ARTS_LIBASOUND="-lasound"
    AC_DEFINE(HAVE_ARTS_LIBASOUND, 1, [Define if you have libasound.so.1 (required for ALSA 0.5.x support)])
  fi

  AC_SUBST(LIBASOUND)
  AC_SUBST(ARTS_LIBASOUND)
])

AC_DEFUN([KDE_CHECK_CDPARANOIA],
[
  have_cdparanoia=yes

  if test -z "$CDPARANOIA"; then
    KDE_FIND_PATH(cdparanoia, CDPARANOIA, [/bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin])
  fi

  if test -z "$CDPARANOIA"; then
    have_cdparanoia=no
  fi

  KDE_CHECK_HEADER(cdda_interface.h,
    [:], [have_cdparanoia=no])

  # Older versions of FreeBSD's cdparanoia lack cdrom_drive.cdda_device_name
  AC_MSG_CHECKING([for cdrom_drive.cdda_device_name in cdda_interface.h])
  kde_save_CPPFLAGS="$CPPFLAGS"
  CPPFLAGS="$CPPFLAGS $all_includes"
  AC_LANG_SAVE
  AC_LANG_C
  AC_TRY_COMPILE([
    #include <cdda_interface.h>
    ],
    [
        struct cdrom_drive device;
        device.cdda_device_name = 0;
    ],
    [
        AC_MSG_RESULT([yes])
    ], [
        AC_MSG_RESULT([no])
        have_cdparanoia=no
    ])
  AC_LANG_RESTORE
  CPPFLAGS=$kde_save_CPPFLAGS

  KDE_CHECK_LIB(cdda_paranoia, paranoia_init,
    [:], [have_cdparanoia=no], [-lcdda_interface -lm])

  # because of the horrible hack we need shared cdparanoia
  for ext in so sl la a; do
    AC_FIND_FILE(libcdda_paranoia.$ext, $kde_libraries /usr/lib /usr/local/lib,
      para_libdir)
    if test -r $para_libdir/libcdda_paranoia.$ext; then
      if test $ext = a && ls "$para_libdir" | grep "^libcdda_paranoia.so.*" 2>&1 >/dev/null; then
        ext=so
      fi
      break
    fi
  done
  if test "$ext" = la; then
      grep "^library_names='.*[a-z].*'" $para_libdir/libcdda_paranoia.$ext 2>&1 > /dev/null || have_cdparanoia_only_static=yes
  fi
  if test "$ext" = a; then
    have_cdparanoia_only_static=yes
  fi

  if test "x$have_cdparanoia" = xyes; then
    # for kioslave/audiocd/
    CDPARANOIA_LIBS="-lcdda_paranoia -lcdda_interface -lm"

    # for mpeglib/
    CDDALIBS="-lcdda_paranoia -lcdda_interface -lm"
    AC_DEFINE(CDDA_PARANOIA, 1, [Define if you have cdparanoia installed])
  fi

  if test "x$have_cdparanoia_only_static" = xyes; then
    # for kioslave/audiocd/
    AC_DEFINE_UNQUOTED(CDPARANOIA_STATIC, 1, [Define if you only have a static cdparanoia])
  fi

  AC_SUBST(CDPARANOIA_LIBS)
])

AC_DEFUN([KDE_CHECK_LAME],
[
  have_lame=yes

  KDE_CHECK_HEADER(lame/lame.h,
    [:], [have_lame=no])

  KDE_CHECK_LIB(mp3lame, lame_init,
    [:], [have_lame=no], [-lm])

  if test "x$have_lame" = xyes; then
    # for krec/mp3_export/ (kioslave/audiocd/ uses the lame binary at runtime)
    LAME_LIBS="-lmp3lame -lm"
  fi

  AC_SUBST(LAME_LIBS)
])

AC_DEFUN([KDE_CHECK_TAGLIB],
[
  AC_PATH_PROG(TAGLIB_CONFIG, taglib-config, [no], [$PATH:$prefix/bin])

  if test "x$TAGLIB_CONFIG" != xno; then
    AC_DEFINE(HAVE_TAGLIB, 1, [define if you have TagLib])
    taglib_includes=`$TAGLIB_CONFIG --cflags`
    taglib_libs=`$TAGLIB_CONFIG --libs`
    have_taglib=yes
  else
    taglib_includes=""
    taglib_libs=""
    have_taglib=no
  fi

  KDE_CHECK_HEADER(taglib/mpcfile.h, have_taglib_mpc=yes, have_taglib_mpc=no)

  AC_SUBST(taglib_includes)
  AC_SUBST(taglib_libs)
])

AC_DEFUN([KDE_CHECK_AKODE],
[
  AC_PATH_PROG(AKODE_CONFIG, akode-config, [no], [$PATH:$prefix/bin])

  if test "x$AKODE_CONFIG" != xno; then
    AC_DEFINE(HAVE_AKODE, 1, [define if you have aKodelib installed])
    akode_includes=`$AKODE_CONFIG --cflags`
    akode_libs=`$AKODE_CONFIG --libs`
    have_akode=yes
  else
    akode_includes=""
    akode_libs=""
    have_akode=no
  fi

  AC_SUBST(akode_includes)
  AC_SUBST(akode_libs)
])

AC_DEFUN([KDE_CHECK_MPEGLIB_ARTS],
[
  MPEGLIB_ARTS_MAJOR_VERSION=0
  MPEGLIB_ARTS_MINOR_VERSION=3
  MPEGLIB_ARTS_MICRO_VERSION=0

  MPEGLIB_ARTS_VERSION=$MPEGLIB_ARTS_MAJOR_VERSION.$MPEGLIB_ARTS_MINOR_VERSION.$MPEGLIB_ARTS_MICRO_VERSION

  AC_SUBST(MPEGLIB_ARTS_MAJOR_VERSION)
  AC_SUBST(MPEGLIB_ARTS_MINOR_VERSION)
  AC_SUBST(MPEGLIB_ARTS_MICRO_VERSION)
  AC_SUBST(MPEGLIB_ARTS_VERSION)

  dnl build search PATH
  artsc_config_test_path=$prefix/bin:$exec_prefix/bin:$KDEDIR/bin:$PATH
  AC_PATH_PROG(kde_artsplug_compiles,artsc-config,no,$artsc_config_test_path)

  dnl if we found it here set variable
  if test x$kde_artsplug_compiles != xno; then
    ARTSCCONFIG=$kde_artsplug_compiles;
    kde_artsplug_compiles=yes
  fi

  dnl this is needed for a standalone mpeglib
  dnl it should compile without KDE installed
  dnl but if we find arts we need the include
  dnl path for it.

  if test x$kde_artsplug_compiles = xyes; then
    ARTSC_INCLUDE=`${ARTSCCONFIG} --cflags`
    AC_MSG_RESULT([arts includes... $ARTSC_INCLUDE])
    AC_SUBST(ARTSC_INCLUDE)
    ARTSC_LIBS=`${ARTSCCONFIG} --libs`
    AC_MSG_RESULT([arts libraries... $ARTSC_LIBS])
    AC_SUBST(ARTSC_LIBS)
    AC_SUBST(LIBDL)
  fi

  if test x$kde_mpeglib_compiles = xno; then
    AC_MSG_RESULT([** mpeglib disabled we disable artsplug **])
    kde_artsplug_compiles=no;
    fi

  if test x$kde_artsplug_compiles = xno; then
    AC_MSG_RESULT([** DO NOT COMPILE mpeglib_artsplug **])
    DO_NOT_COMPILE="$DO_NOT_COMPILE mpeglib_artsplug"
  fi
])dnl KDE_CHECK_MPEGLIB_ARTS

AC_TYPE_SIGNAL

AC_ARG_WITH(vorbis,
  [AC_HELP_STRING(--with-vorbis,
    [enable support for Ogg Vorbis @<:@default=check@:>@])],
  [], with_vorbis=check)

have_oggvorbis=no
if test "x$with_vorbis" != xno; then
  KDE_CHECK_OGGVORBIS

  if test "x$with_vorbis" != xcheck && test "x$have_oggvorbis" != xyes; then
    AC_MSG_ERROR([--with-vorbis was given, but test for Ogg Vorbis failed])
  fi
fi

# for krec/ogg_export
AM_CONDITIONAL(compile_ogg_export, test "x$have_oggvorbis" = xyes)

if test "x$kde_mpeglib_compiles" = xyes -o "x$have_oggvorbis" = xno; then
  DO_NOT_COMPILE="$DO_NOT_COMPILE oggvorbis_artsplugin"
fi

AC_ARG_WITH(ossaudio,
  [AC_HELP_STRING(--with-ossaudio,
    [enable support for OpenBSD ossaudio @<:@default=check@:>@])],
  [], with_ossaudio=check)

if test "x$with_ossaudio" != xno; then
  KDE_CHECK_OSSAUDIO

  if test "x$with_ossaudio" != xcheck && test "x$have_ossaudio" != xyes; then
    AC_MSG_ERROR([--with-ossaudio was given, but test for ossaudio failed])
  fi
fi

AC_ARG_WITH(alsa,
  [AC_HELP_STRING(--with-alsa,
    [enable support for ALSA @<:@default=check@:>@])],
  [], with_alsa=check)

have_alsa=no
if test "x$with_alsa" != xno; then
  KDE_CHECK_ALSA

  if test "x$with_alsa" != xcheck && test "x$have_alsa" != xyes; then
    AC_MSG_ERROR([--with-alsa was given, but test for ALSA failed])
  fi
fi

AC_ARG_WITH(cdparanoia,
  [AC_HELP_STRING(--with-cdparanoia,
    [enable support for CD ripping thorugh cdparanoia @<:@default=check@:>@])],
  [], with_cdparanoia=check)

have_cdparanoia=no
if test "x$with_cdparanoia" != xno; then
  KDE_CHECK_CDPARANOIA

  if test "x$with_cdparanoia" != xcheck && test "x$have_cdparanoia" != xyes; then
    AC_MSG_ERROR([--with-cdparanoia was given, but test for cdparanoia failed])
  fi
fi

# for kioslave/audiocd/
AM_CONDITIONAL(include_kioslave_audiocd, test "x$have_cdparanoia" = xyes)
AM_CONDITIONAL(include_kcm_audiocd, test "x$have_cdparanoia" = xyes)
if test "x$have_cdparanoia" != xyes; then
    # kaudiocreator depends on kio_audiocd
    DO_NOT_COMPILE="$DO_NOT_COMPILE kaudiocreator"
fi

AC_ARG_WITH(lame,
  [AC_HELP_STRING(--with-lame,
    [enable support for MP3 encoding thorugh lame @<:@default=check@:>@])],
  [], with_lame=check)

have_lame=no
if test "x$with_lame" != xno; then
  KDE_CHECK_LAME

  if test "x$with_lame" != xcheck && test "x$have_lame" != xyes; then
    AC_MSG_ERROR([--with-lame was given, but test for lame failed])
  fi
fi

# for krec/mp3_export
AM_CONDITIONAL(compile_mp3_export, test "x$have_lame" = xyes)

AC_ARG_WITH(taglib,
  [AC_HELP_STRING(--with-taglib,
    [enable support for TagLib @<:@default=check@:>@])],
  [], with_taglib=check)

have_taglib=no
have_taglib_mpc=no
if test "x$with_taglib" != xno; then
  KDE_CHECK_TAGLIB

  if test "x$with_taglib" != xcheck && test "x$have_taglib" != xyes; then
    AC_MSG_ERROR([--with-taglib was given, but test for TagLib failed])
  fi
fi

AC_ARG_WITH(akode,
    [AC_HELP_STRING([--with-akode],
        [enable the aKode decoder @<:@default=check@:>@])],
    [], with_akode=check)

have_akode=no
if test "x$with_akode" != xno; then
  KDE_CHECK_AKODE

  if test "x$with_akode" != xcheck && test "x$have_akode" != xyes; then
    AC_MSG_ERROR([--with-akode was given, but test for aKode failed])
  fi
fi

artsc_config_test_path=$prefix/bin:$exec_prefix/bin:$KDEDIR/bin:$PATH
AC_PATH_PROG(ARTSCCONFIG, artsc-config, no, $artsc_config_test_path)

if test "x$build_arts" = "xyes" && test "x$ARTSCCONFIG" != "xno" ; then
	LIB_ARTS="-lartskde"
	ARTS_PREFIX=[`$ARTSCCONFIG --arts-prefix`]
	ARTS_CFLAGS="-I$ARTS_PREFIX/include/arts"
	AC_DEFINE(HAVE_ARTS, 1, [have arts support in juk])
else
	build_arts="no"
	LIB_ARTS=""
	ARTS_CFLAGS=""
	AC_DEFINE(HAVE_ARTS, 0, [no arts support in juk])
fi

AC_SUBST(LIB_ARTS)
AC_SUBST(ARTS_CFLAGS)

KDE_CHECK_MPEGLIB_ARTS