[go: up one dir, main page]

File: configure.in

package info (click to toggle)
lmms 0.2.1-1.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 17,056 kB
  • ctags: 5,168
  • sloc: cpp: 46,243; sh: 8,540; ansic: 5,786; xml: 1,989; makefile: 614
file content (744 lines) | stat: -rw-r--r-- 25,872 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
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
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.50)
AC_INIT(lmms, 0.2.1, tobydox/at/users/dot/sourceforge/dot/net)
AM_INIT_AUTOMAKE(lmms, 0.2.1)

AM_CONFIG_HEADER(config.h)

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_GCC_TRADITIONAL
AC_PROG_LIBTOOL

# -fomit-frame-pointer crashes wine on Ubuntu Dapper--Danny 7/21/06
#EXTRAFLAGS="-floop-optimize2 -fomit-frame-pointer -fgcse-sm -fgcse-las"
EXTRAFLAGS="-floop-optimize2 -fgcse-sm  -fgcse-las"

# Tested with GCC 4.0--needs to be tested with 4.1--Danny 7/21/06
if test "x`$CC --version|head -1|cut -d\  -f3|cut -d. -f1`" = "x4" ; then
	EXTRAFLAGS="$EXTRAFLAGS -ftree-vectorize -ftree-loop-linear"
	if test "x`$CC --version|head -1|cut -d\  -f3|cut -d. -f2`" != "x0" ; then
		EXTRAFLAGS="$EXTRAFLAGS -funsafe-loop-optimizations -Wunsafe-loop-optimizations"
	fi	
fi

CFLAGS="$CFLAGS $EXTRAFLAGS"
CXXFLAGS="$CXXFLAGS $EXTRAFLAGS"

AC_PATH_XTRA
gw_CHECK_QT


# checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([fcntl.h memory.h string.h sys/ioctl.h unistd.h stdlib.h pthread.h sys/ipc.h sys/shm.h sys/time.h sys/select.h sys/types.h stdarg.h signal.h sched.h])

# checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_C_VOLATILE
AC_C_BIGENDIAN
AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t, long long])

# checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL

AC_CHECK_FUNCS([usleep pipe sprintf])



# search for include-path of SDL (just for supporting the FreeBSD-guys.... ;-)
for i in SDL SDL10 SDL11 SDL12 ; do
	FOUND=""
	AC_CHECK_HEADER($i/SDL.h, FOUND="true")
	if test "$FOUND" = "true" ; then
		SDL_INC_PATH="$i"
		break
	fi
done


AH_TEMPLATE(SDL_SDL_H, [Define to location of SDL.h])
AH_TEMPLATE(SDL_SDL_AUDIO_H, [Define to location of SDL_audio.h])
AH_TEMPLATE(SDL_SDL_SOUND_H, [Define to location of SDL_sound.h])

OLD_LIBS="$LIBS"
LIBS="$LIBS -lpthread"

# check for SDL-lib
AC_ARG_WITH(sdl,
	AS_HELP_STRING([--without-sdl],
			[disable support for SDL-audio-output]), ,
 	[ with_sdlaudio=yes ])
AH_TEMPLATE(HAVE_SDL_SDL_AUDIO_H, [Define to 1 if you have the <$SDL_INC_PATH/SDL_audio.h> header file.])
if test "x$with_sdlaudio" = "xyes" -a ! -z "$SDL_INC_PATH"; then
	AC_CHECK_HEADER($SDL_INC_PATH/SDL_audio.h, HAVE_SDL_SDL_AUDIO_H="true")
	AC_CHECK_LIB([SDL], [SDL_OpenAudio], HAVE_LIBSDL="true", HAVE_SDL_SDL_AUDIO_H="")
fi
if test ! -z "$HAVE_SDL_SDL_AUDIO_H" ; then
	AC_DEFINE_UNQUOTED(SDL_SDL_H, <$SDL_INC_PATH/SDL.h>)
	AC_DEFINE_UNQUOTED(SDL_SDL_AUDIO_H, <$SDL_INC_PATH/SDL_audio.h>)
	AC_DEFINE(HAVE_SDL_SDL_AUDIO_H)
fi
AM_CONDITIONAL(HAVE_LIBSDL, test ! -z "$HAVE_SDL_SDL_AUDIO_H")


# check for SDL_sound-lib
AC_ARG_WITH(sdlsound,
	AS_HELP_STRING([--without-sdlsound],
			[disable support for reading samples via SDL_sound]), ,
 	[ with_sdlsound=yes ])
AH_TEMPLATE(HAVE_SDL_SDL_SOUND_H, [Define to 1 if you have the <$SDL_INCL_PATH/SDL_sound.h> header file.])
if test "x$with_sdlsound" = "xyes" -a ! -z "$SDL_INC_PATH"; then
	AC_CHECK_HEADER($SDL_INC_PATH/SDL_sound.h, HAVE_SDL_SDL_SOUND_H="true")
	AC_CHECK_LIB([SDL_sound], [Sound_Init], HAVE_LIBSDL_SOUND="true", HAVE_SDL_SDL_SOUND_H="")
fi
if test ! -z "$HAVE_SDL_SDL_SOUND_H" ; then
	AC_DEFINE_UNQUOTED(SDL_SDL_SOUND_H, <$SDL_INC_PATH/SDL_sound.h>)
	AC_DEFINE(HAVE_SDL_SDL_SOUND_H)
fi

AM_CONDITIONAL(HAVE_LIBSDL_SOUND, test ! -z "$HAVE_LIBSDL_SOUND")

LIBS="$OLD_LIBS"


# check for ALSA-lib
AC_ARG_WITH(asound,
	AS_HELP_STRING([--without-asound],
			[disable support for ALSA-sound-output]), ,
 	[ with_asound=yes ])
AH_TEMPLATE(HAVE_ALSA_ASOUNDLIB_H, [Define to 1 if you have the <alsa/asoundlib.h> header file.])
if test "x$with_asound" = "xyes" ; then
	AC_CHECK_HEADER(alsa/asoundlib.h, HAVE_ALSA_ASOUNDLIB_H="true")
	AC_CHECK_LIB([asound], [snd_pcm_open], HAVE_LIBASOUND="true", HAVE_ALSA_ASOUNDLIB_H="")
fi
if test ! -z "$HAVE_ALSA_ASOUNDLIB_H" ; then
	AC_DEFINE(HAVE_ALSA_ASOUNDLIB_H)
fi
AM_CONDITIONAL(HAVE_LIBASOUND, test ! -z "$HAVE_ALSA_ASOUNDLIB_H")


# check for OSS
AC_ARG_WITH(oss,
	AS_HELP_STRING([--without-oss],
			[disable support for OSS-sound-output]), ,
 	[ with_oss=yes ])
AH_TEMPLATE(HAVE_SYS_SOUNDCARD_H, [Define to 1 if you have the <sys/soundcard.h> header file.])
AH_TEMPLATE(HAVE_SOUNDCARD_H, [Define to 1 if you have the <soundcard.h> header file.])
if test "x$with_oss" = "xyes" ; then
	AC_CHECK_HEADER(sys/soundcard.h, HAVE_SYS_SOUNDCARD_H="true")
	AC_CHECK_HEADER(soundcard.h, HAVE_SOUNDCARD_H="true")
fi
if test ! -z "$HAVE_SYS_SOUNDCARD_H" ; then
	AC_DEFINE(HAVE_SYS_SOUNDCARD_H)
fi
if test ! -z "$HAVE_SOUNDCARD_H" ; then
	AC_DEFINE(HAVE_SOUNDCARD_H)
fi


# check for JACK
AC_ARG_WITH(jack,
	AS_HELP_STRING([--without-jack],
			[disable support for JACK-transport]), ,
 	[ with_jack=yes ])
AH_TEMPLATE(HAVE_JACK_JACK_H, [Define to 1 if you have the <jack/jack.h> header file.])
AH_TEMPLATE(OLD_JACK, [Define to 1 if your JACK-version doesnt know about jack_client_open() etc.])
if test "x$with_jack" = "xyes" ; then
	AC_CHECK_HEADER(jack/jack.h, HAVE_JACK_JACK_H="true")
	AC_CHECK_LIB([jack], [jack_client_new], HAVE_LIBJACK="true", HAVE_JACK_JACK_H="")
	AC_CHECK_LIB([jack], [jack_client_open], JACK_CLIENT_OPEN="true")
	if test -z "$JACK_CLIENT_OPEN" ; then
		AC_DEFINE(OLD_JACK)
	fi
fi
if test ! -z "$HAVE_JACK_JACK_H" ; then
	AC_DEFINE(HAVE_JACK_JACK_H)
fi
AM_CONDITIONAL(HAVE_LIBJACK, test ! -z "$HAVE_JACK_JACK_H")


# check for proper WINE-installation and existing Steinberg headers
AC_ARG_WITH(vst,
	AS_HELP_STRING([--with-vst],
			[enable support for builtin VST-plugin-hosting]), [ with_vst=yes ], [ with_vst=no ])
AH_TEMPLATE(HAVE_VST_AEFFECTX_H, [Define to 1 if you have the <aeffectx.h> header file.])
if test "x$with_vst" = "xyes" ; then

	ORIG_CFLAGS=$CFLAGS
	ORIG_CPPFLAGS=$CPPFLAGS
	CFLAGS="$CLFAGS -I./include"
	CPPFLAGS="$CPPFLAGS -I./include"
	ORIG_CC="$CC"
	CC="$CXX"
	AC_CHECK_HEADER(aeffectx.h, HAVE_VST_AEFFECTX_H="true")
	CFLAGS="$ORIG_CFLAGS"
	CPPFLAGS="$ORIG_CPPFLAGS"

	AC_CHECK_PROG(WINEGCC, winegcc, /usr/bin/winegcc,,/usr/bin)
	AC_CHECK_LIB([wine], [wine_init])
	if test ! -z "$WINEGCC" ; then
		if test ! -z "$HAVE_VST_AEFFECTX_H" ; then
			WINE_OK_BUT_VST_INCOMPLETE=""
			AC_DEFINE(HAVE_VST_AEFFECTX_H)
		else
			WINE_OK_BUT_VST_INCOMPLETE="true"
		fi
	fi
	CC="$ORIG_CC"
fi
AM_CONDITIONAL(VST_SUPPORT, test ! -z "$WINEGCC")


# check for LADSPA-SDK
AC_ARG_WITH(src,
	AS_HELP_STRING([--without-ladspa],
		[disable support for LADSPA-support]), ,
 	[ with_ladspa=yes ])
AH_TEMPLATE(HAVE_LADSPA_H, [Define to 1 if you have the <ladspa.h> header file.])
if test "x$with_ladspa" = "xyes" ; then
	AC_CHECK_HEADER(ladspa.h, HAVE_LADSPA_H="true")
fi
if test ! -z "$HAVE_LADSPA_H" ; then
	AC_DEFINE(HAVE_LADSPA_H)
fi


# check for vorbis-lib
AC_ARG_WITH(vorbis,
 	AS_HELP_STRING([--without-vorbis],
		[disable support for exporting song to OGG-files]), ,
 	[ with_vorbis=yes ])
AH_TEMPLATE(HAVE_VORBIS_CODEC_H, [Define to 1 if you have the <vorbis/codec.h> header file.])
AH_TEMPLATE(HAVE_VORBIS_VORBISENC_H, [Define to 1 if you have the <vorbis/vorbisenc.h> header file.])
AH_TEMPLATE(HAVE_VORBIS_VORBISFILE_H, [Define to 1 if you have the <vorbis/vorbisfile.h> header file.])
if test "x$with_vorbis" = "xyes" ; then
	OGG_SUPPORT="true"
	AC_CHECK_HEADER(vorbis/codec.h, HAVE_VORBIS_CODEC_H="true",OGG_SUPPORT="")
	AC_CHECK_HEADER(vorbis/vorbisenc.h, HAVE_VORBIS_VORBISENC_H="true",OGG_SUPPORT="")
	AC_CHECK_HEADER(vorbis/vorbisfile.h, HAVE_VORBIS_VORBISFILE_H="true",OGG_SUPPORT="")
	AC_CHECK_LIB([vorbis], [vorbis_analysis], HAVE_LIBVORBIS="true", OGG_SUPPORT="")
fi
if test ! -z "$OGG_SUPPORT" ; then
	AC_DEFINE(HAVE_VORBIS_CODEC_H)
	AC_DEFINE(HAVE_VORBIS_VORBISENC_H)
	AC_DEFINE(HAVE_VORBIS_VORBISFILE_H)
fi
AM_CONDITIONAL(HAVE_LIBVORBIS, test ! -z "$OGG_SUPPORT")


# check for libFLAC
AC_ARG_WITH(flac,
	AS_HELP_STRING([--without-flac],
		[disable support for internal encoding/decoding with FLAC]), ,
 	[ with_flac=yes ])
AH_TEMPLATE(HAVE_FLAC_STREAM_ENCODER_H, [Define to 1 if you have the <FLAC/stream_encoder.h> header file.])
AH_TEMPLATE(HAVE_FLAC_STREAM_DECODER_H, [Define to 1 if you have the <FLAC/stream_decoder.h> header file.])
if test "x$with_flac" = "xyes" ; then
	AC_CHECK_HEADER(FLAC/stream_encoder.h, HAVE_FLAC_STREAM_ENCODER_H="true")
	AC_CHECK_HEADER(FLAC/stream_decoder.h, HAVE_FLAC_STREAM_DECODER_H="true")
	AC_CHECK_LIB([FLAC], [FLAC__stream_encoder_new], HAVE_LIBFLAC="true")
fi
if test ! -z "$HAVE_FLAC_STREAM_ENCODER_H" -a ! -z "$HAVE_FLAC_STREAM_DECODER_H" -a ! -z "$HAVE_LIBFLAC"; then
	AC_DEFINE(HAVE_FLAC_STREAM_ENCODER_H)
	AC_DEFINE(HAVE_FLAC_STREAM_DECODER_H)
fi
AM_CONDITIONAL(HAVE_LIBFLAC, test ! -z "$HAVE_LIBFLAC")


# check for libsamplerate
AC_ARG_WITH(libsrc,
	AS_HELP_STRING([--without-libsrc],
		[disable support for resampling via libsamplerate]), ,
 	[ with_libsrc=yes ])
AH_TEMPLATE(HAVE_SAMPLERATE_H, [Define to 1 if you have the <samplerate.h> header file.])
if test "x$with_libsrc" = "xyes" ; then
	AC_CHECK_HEADER(samplerate.h, HAVE_SAMPLERATE_H="true")
	AC_CHECK_LIB([samplerate], [src_simple], HAVE_LIBSRC="true", HAVE_SAMPLERATE_H="")
fi
if test ! -z "$HAVE_SAMPLERATE_H" ; then
	AC_DEFINE(HAVE_SAMPLERATE_H)
fi
AM_CONDITIONAL(HAVE_LIBSRC, test ! -z "$HAVE_SAMPLERATE_H")


# libsndfile-stuff
AC_ARG_WITH(sndfile,
 	AS_HELP_STRING([--without-libsf],
		[disable support for importing files via libsndfile]), ,
 	[ with_libsf=yes ])
AH_TEMPLATE(HAVE_SNDFILE_H, [Define to 1 if you have the <sndfile.h> header file.])
if test "x$with_libsf" = "xyes" ; then
	AC_CHECK_HEADER(sndfile.h, HAVE_SNDFILE_H="true")
	AC_CHECK_LIB([sndfile], [sf_command], HAVE_LIBSF="true", HAVE_SNDFILE_H="")
	AC_MSG_CHECKING([version of libsndfile])
	AH_TEMPLATE(OLD_SNDFILE, [Define to 1 if libsndfile < 1.0.11])
	OLD_LIBS="$LIBS"
	LIBS="$LIBS -lsndfile"
	AC_RUN_IFELSE([	#include <sndfile.h>
			int main( void )
			{
				SF_INFO si;
				( void )sf_open( "", SFM_READ, &si );
				return 0;
			}],
	AC_MSG_RESULT([>= 1.0.11]),
	AC_MSG_RESULT([< 1.0.11])
	AC_DEFINE(OLD_SNDFILE)
		)
	LIBS="$OLD_LIBS"
fi
if test ! -z "$HAVE_SNDFILE_H" ; then
	AC_DEFINE(HAVE_SNDFILE_H)
fi
AM_CONDITIONAL(HAVE_LIBSF, test ! -z "$HAVE_SNDFILE_H")

AC_ARG_WITH(nosmpdecs,
	AS_HELP_STRING([--without-sample-decoders],
			[force compiling LMMS even if no usable libraries for sample-decoding were found]),
 	[ with_smpdecs=yes ])

if test -z "$HAVE_SND_FILE" -a -z "$HAVE_SDL_SDL_SOUND_H" -a -z "$OGG_SUPPORT" -a ! -z "$with_smpdecs"; then
	AC_MSG_ERROR([*** neither libsndfile nor SDL_sound nor libvorbis (or according devel-files) were found which would make LMMS unable to load any samples so please install at least one of the packages and try again! Use --without-sample-decoders to force compiling without any sample-decoding-libraries.])
fi



# check whether to disable surround-support
AC_MSG_CHECKING([whether to disable surround-support])
AH_TEMPLATE(DISABLE_SURROUND, [Define if you want to disable surround-support in LMMS.])
AC_ARG_ENABLE([surround],
	AS_HELP_STRING([--disable-surround],
			[compile LMMS without surround-support]),
	DISABLE_SURROUND="yes")
if test "x$DISABLE_SURROUND" = "xyes" ; then
	AC_MSG_RESULT(yes)
	AC_DEFINE(DISABLE_SURROUND)
else
	AC_MSG_RESULT(no)
fi


# check whether to enable high-quality sinc-resampling
AC_MSG_CHECKING([whether to enable high quality sinc-resampling])
AH_TEMPLATE(HQ_SINC, [Define if you want to enable high quality sinc-resampling.])
AC_ARG_ENABLE([hqsinc],
	AS_HELP_STRING([--enable-hqsinc],
		[enable high quality sinc-resampling]), HQ_SINC="yes")
if test "x$HQ_SINC" = "xyes" ; then
	AC_MSG_RESULT(yes)
	AC_DEFINE(HQ_SINC)
else
	AC_MSG_RESULT(no)
fi

# check whether to disable single-source-compile
AC_MSG_CHECKING([whether to disable single-source-compile])
# AH_TEMPLATE(SINGLE_SOURCE_COMPILE, [Define if you want to enable single-source-compile.])
AC_ARG_ENABLE([ssc],
	AS_HELP_STRING([--disable-ssc],
		[disable single-source-compile]), NO_SSC="true")
if test ! "x$NO_SSC" = "xtrue" ; then
	AC_MSG_RESULT(no)
	# AC_DEFINE(SINGLE_SOURCE_COMPILE)
	CXXFLAGS="$CXXFLAGS -DSINGLE_SOURCE_COMPILE"
else
	AC_MSG_RESULT(yes)
fi



# check whether compiler of current platform supports attribute regparm(x)
AC_MSG_CHECKING([whether we can use function-attribute regparm(x) on current platform])
AH_TEMPLATE(FASTCALL, [Define to any attribute, speeding up function-calls])
AC_RUN_IFELSE([	int  __attribute__((regparm(3))) foo( int a, int b, int c )
			{ return( a=b=c ); }
		int __attribute__((regparm(3))) main( void )
			{ return( foo(2,1,0) ); }],
	AC_MSG_RESULT(yes)
	AC_DEFINE(FASTCALL, [__attribute__((regparm(3)))]),
	AC_MSG_RESULT(no)
	AC_DEFINE_UNQUOTED(FASTCALL,[])
		)


AC_MSG_CHECKING([whether floorf is known by compiler])
AH_TEMPLATE(floorf, [Define to floor if floorf is not known])
AC_TRY_LINK([#include <math.h>], [ floorf ],
	AC_MSG_RESULT(yes),
	AC_MSG_RESULT([no - will use floor instead])
	AC_DEFINE(floorf, floor)
		)

AC_MSG_CHECKING([whether powf is known by compiler])
AH_TEMPLATE(powf, [Define to pow if powf is not known])
AC_TRY_LINK([#include <math.h>], [ powf ],
	AC_MSG_RESULT(yes),
	AC_MSG_RESULT([no - will use pow instead])
	AC_DEFINE(powf, pow)
		)

AC_MSG_CHECKING([whether fabsf is known by compiler])
AH_TEMPLATE(fabsf, [Define to pow if fabsf is not known])
AC_TRY_LINK([#include <math.h>], [ fabsf ],
	AC_MSG_RESULT(yes),
	AC_MSG_RESULT([no - will use fabs instead])
	AC_DEFINE(fabsf, fabs)
		)

AC_MSG_CHECKING([whether logf is known by compiler])
AH_TEMPLATE(logf, [Define to lof if logf is not known])
AC_TRY_LINK([#include <math.h>], [ logf ],
	AC_MSG_RESULT(yes),
	AC_MSG_RESULT([no - will use log instead])
	AC_DEFINE(logf, log)
		)


# check whether to enable debugging-code
AC_MSG_CHECKING([whether to enable debugging-code])
AH_TEMPLATE(LMMS_DEBUG, [Define if you want to disable debbuging-code in LMMS.])
AC_ARG_ENABLE([debug],
	AS_HELP_STRING([--enable-debug],
		[compile LMMS with additional debugging support]), DEBUG="yes")
if test "x$DEBUG" = "xyes" ; then
	AC_MSG_RESULT(yes)
	AC_DEFINE(LMMS_DEBUG)
else
	AC_MSG_RESULT(no)
fi


# check for rpm SOURCES path
echo -n "checking for rpm sources path... "
RPMSOURCEDIR="NOT-FOUND"
for directory in packages OpenLinux redhat RedHat rpm RPM "" ; do
	if test -d /usr/src/${directory}/SOURCES ; then
		RPMSOURCEDIR="/usr/src/${directory}/SOURCES/"
	fi
done
echo "$RPMSOURCEDIR"
AM_CONDITIONAL(HAVE_RPM, test "$RPMSOURCEDIR" != "NOT-FOUND")
AC_SUBST(RPMSOURCEDIR)

lmmsdatadir="$datadir/$PACKAGE"
AC_SUBST(lmmsdatadir)


#CFLAGS="$CXXFLAGS -g -O2"
#CXXFLAGS="$CXXFLAGS -g -O2"
if test "x$CXX" == "xg++" ; then
	CXXFLAGS="$CXXFLAGS -ansi -Wall -fno-exceptions"
fi

LDFLAGS="$LDFLAGS -L/usr/local/lib"
CXXFLAGS="$CXXFLAGS -I/usr/local/include"

AC_CONFIG_FILES([Makefile
		 buildtools/Makefile
		 data/Makefile
		 data/locale/Makefile
		 data/midi-maps/Makefile
		 data/presets/Makefile
		 data/presets/AudioFileProcessor/Makefile
		 data/presets/BitInvader/Makefile
		 data/presets/Organic/Makefile
		 data/presets/PluckedStringSynth/Makefile
		 data/presets/TripleOscillator/Makefile
		 data/presets/VeSTige/Makefile
		 data/projects/Makefile
		 data/projects/cool_songs/Makefile
		 data/projects/covers/Makefile
		 data/projects/demos/Makefile
		 data/projects/misc/Makefile
		 data/projects/recorded_loops/Makefile
		 data/projects/templates/Makefile
		 data/projects/tutorials/Makefile
		 data/samples/Makefile
		 data/samples/basses/Makefile
		 data/samples/bassloopes/Makefile
		 data/samples/beats/Makefile
		 data/samples/drums/Makefile
		 data/samples/effects/Makefile
		 data/samples/instruments/Makefile
		 data/samples/latin/Makefile
		 data/samples/misc/Makefile
		 data/samples/shapes/Makefile
		 data/samples/stringsnpads/Makefile
		 data/themes/Makefile
		 data/track_icons/Makefile
		 plugins/Makefile
		 plugins/audio_file_processor/Makefile
		 plugins/bit_invader/Makefile
		 plugins/flp_import/Makefile
		 plugins/midi_import/Makefile
		 plugins/organic/Makefile
		 plugins/plucked_string_synth/Makefile
		 plugins/triple_oscillator/Makefile
		 plugins/vestige/Makefile
		 plugins/vibed/Makefile
		 lmms.spec])
AC_OUTPUT

with_warnings="false"

echo
echo

PLUGINS_TO_BUILD=""


if test -z "$HAVE_ALSA_ASOUNDLIB_H" ; then
	echo " ========================"
	echo " ===  LMMS - WARNING  ======================================================="
	echo " ========================"
	echo " ="
	echo " = You don't seem to have ALSA-library installed and/or ALSA-lib-development-"
	echo " = package is missing. This will disable support for sound-output via ALSA!"
	echo " = Consider installing the missing packages for using the full power of LMMS."
	echo " ="
	with_warnings="true"
else
	PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* ALSA for audio- and MIDI-input/output"
fi



if test -z "$HAVE_JACK_JACK_H" ; then
	echo " ========================"
	echo " ===  LMMS - WARNING  ======================================================="
	echo " ========================"
	echo " ="
	echo " = You don't seem to have JACK-library installed and/or JACK-lib-development-"
	echo " = package is missing. This will disable support for JACK-transport."
	echo " = This is no problem but you'll miss the great possibilities of interacting"
	echo " = with other sound-applications in realtime!"
	echo " = Consider installing the missing packages for using the full power of LMMS."
	echo " ="
	with_warnings="true"
else
	PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* JACK for audio-input/output"
fi




if test -z "$HAVE_SOUNDCARD_H" -a -z "$HAVE_SYS_SOUNDCARD_H" ; then
	echo " ========================"
	echo " ===  LMMS - WARNING  ======================================================="
	echo " ========================"
	echo " ="
	echo " = You don't seem to have soundcard.h which is neccessary for outputting "
	echo " = sound via OSS under Linux/BSD/Solaris."
	echo " = This will also disable support for MIDI using OSS."
	echo " = If you're building for a different platform or do not need OSS-support, you"
	echo " = can ignore this warning."
	echo " ="
	with_warnings="true"
else
	PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* OSS for audio- and MIDI-input/output"
fi




if test -z "$HAVE_SDL_SDL_AUDIO_H" ; then
	echo " ========================"
	echo " ===  LMMS - WARNING  ======================================================="
	echo " ========================"
	echo " ="
	echo " = You don't seem to have SDL-library installed and/or SDL-lib-development-"
	echo " = package is missing. This will disable support for sound-output via SDL, "
	echo " = which is important, if you're using sound-daemons (arts, ESD etc.)"
	echo " = When compiling without SDL, you'll always have to kill your sound-daemon"
	echo " = before using LMMS...!"
	echo " = Consider installing the missing packages for using the full power of LMMS."
	echo " ="
	with_warnings="true"
else
	PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* SDL for audio-output"
fi



if test -z "$OGG_SUPPORT" ; then
	echo " ========================"
	echo " ===  LMMS - WARNING  ======================================================="
	echo " ========================"
	echo " ="
	echo " = You don't seem to have libvorbis installed and/or libvorbis-development-"
	echo " = package is missing. This will disable support for exporting songs to"
	echo " = OGG-files! If SDL_sound is missing too, you'll not be able to use the "
	echo " = samples coming with LMMS since libsndfile currently has no OGG-support!"
	echo " = Consider installing the missing packages for using the full power of LMMS."
	echo " ="
	with_warnings="true"
else
	PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* libvorbis for encoding/decoding OGG-files"
fi



if test -z "$HAVE_SDL_SDL_SOUND_H" ; then
	echo " ========================"
	echo " ===  LMMS - WARNING  ======================================================="
	echo " ========================"
	echo " ="
	echo " = You don't seem to have SDL_sound-library installed and/or SDL_sound-"
	echo " = development-package is missing. This means that you can only load samples"
	echo " = within LMMS if you have libsndfile and libvorbis installed!"
	echo " = Consider installing the missing packages for using the full power of LMMS."
	echo " ="
	with_warnings="true"
else
	PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* SDL_sound for sample-decoding"
fi




if test -z "$HAVE_SNDFILE_H" ; then
	echo " ========================"
	echo " ===  LMMS - WARNING  ======================================================="
	echo " ========================"
	echo " ="
	echo " = You don't seem to have libsndfile installed and/or libsndfile-development-"
	echo " = package is missing. This is not that fatal as long as you have SDL_sound"
	echo " = installed. Otherwise it's strongly recommended to install libsndfile and"
	echo " = libvorbis for being able to use samples within LMMS."
	echo " = Consider installing the missing packages for using the full power of LMMS."
	echo " ="
	with_warnings="true"
else
	PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* libsndfile for sample-decoding"
fi



# not yet...
#if test -z "$HAVE_LADSPA_H" ; then
#	echo " ========================"
#	echo " ===  LMMS - WARNING  ======================================================="
#	echo " ========================"
#	echo " ="
#	echo " = You don't seem to have installed LADSPA-SDK which is neccessary for"
#	echo " = building LMMS with LADSPA support. LADSPA-support is very useful"
#	echo " = as you're able to use a lot of LADSPA-effects inside LMMS."
#	echo " = Consider installing the missing packages for using the full power of LMMS."
#	echo " ="
#	with_warnings="true"
#else
#	PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* LADSPA-plugins"
#fi




if test -z "$HAVE_SAMPLERATE_H" ; then
	echo " ========================"
	echo " ===  LMMS - WARNING  ======================================================="
	echo " ========================"
	echo " ="
	echo " = You don't seem to have libsamplerate installed and/or libsamplerate-"
	echo " = development-package is missing. This will disable resampling with"
	echo " = libsamplerate and results in worse quality! Currently LMMS will also"
	echo " = crash more often, because internal sample-rate-converter has some bugs..."
	echo " = Consider installing the missing packages for using the full power of LMMS."
	echo " ="
	with_warnings="true"
else
	PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* libsamplerate for internal samplerate-conversion"
fi


if test "x$with_vst" = "xno" ; then
	echo " ========================"
	echo " ===  LMMS - INFORMATION  ==================================================="
	echo " ========================"
	echo " ="
	echo " = If you want VST-support within LMMS, please pass"
	echo " ="
	echo " = --with-vst"
	echo " ="
	echo " = to configure, since it is disabled per default!"
	echo " ="
else

	if test ! -z "$WINE_OK_BUT_VST_INCOMPLETE" ; then
		echo " ========================"
		echo " ===  LMMS - WARNING  ======================================================="
		echo " ========================"
		echo " ="
		echo " = You seem to have a proper WINE-installation, but the header-files"
		echo " = (AEffect.h and aeffectx.h) from Steinberg-VST-SDK are missing or not present"
		echo " = in /usr/include/ or ./include. We cannot distribute them as they're licensed under"
		echo " = a GPL-incompatible license, so you'll have to download them at"
		echo " ="
		echo " = http://audacity.cvs.sourceforge.net/*checkout*/audacity/audacity-old/effects/aeffectx.h"
		echo " = http://audacity.cvs.sourceforge.net/*checkout*/audacity/audacity-old/effects/AEffect.h"
		echo " ="
		echo " = and put the mentioned files into /usr/include/ or ./include."
		echo " = Otherwise (now!) configure will disable LMMS's support for built-in VST-"
		echo " = plugin-usage. If you do not intend to use VST-plugins with LMMS you can "
		echo " = ignore this warning."
		echo " = Consider installing the missing packages for using the full power of LMMS."
		echo " ="
		with_warnings="true"
	else
		if test ! -z "$HAVE_VST_AEFFECTX_H" ; then
			PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* LMMS VST Support Layer (LVSL) for integrated VST-plugin usage"
		else
			echo " ========================"
			echo " ===  LMMS - WARNING  ======================================================="
			echo " ========================"
			echo " ="
			echo " = You don't seem to have installed WINE or it's development-packages (headers,"
			echo " = winegcc etc.) which are neccessary for building LMMS with built-in"
			echo " = VST-support."
			echo " = If you do not intend to use VST-plugins with LMMS you can ignore this "
			echo " = warning."
			echo " = Consider installing the missing packages for using the full power of LMMS."
			echo " ="
			with_warnings="true"
		fi
	fi
fi


echo
echo
echo "LMMS will be able to use $PLUGINS_TO_BUILD" | sed -e "s/\\\n/\n/g" | sed -e "s/\\\t/\t/g" | sed -e "s/\\\\\*/\*/g"
echo
echo
echo " ============================"
echo " ===  LMMS - INFORMATION  ==================================================="
echo " ============================"
echo " ="
if test "$with_warnings" = "false" ; then
	echo " = LMMS has been configured successfully. Now you can build it by typing 'make'."
	echo " = After the compilation-process has finished, you can install LMMS by"
	echo " = typing 'make install'."
else
	echo " = LMMS has been configured, but there were one or more warnings you should"
	echo " = not ignore. First try to solve the mentioned problems before"
	echo " = proceeding. Otherwise don't complain, if LMMS doesn't run the way"
	echo " = you might expect..."
fi
echo " ="
echo " = If there're problems while compiling LMMS, please send a mail to "
echo " = tobydox [at] users.sourceforge.net!"
echo " ="
echo