File: configure.ac

package info (click to toggle)
qtractor 0.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 9,464 kB
  • ctags: 9,070
  • sloc: cpp: 89,893; makefile: 327; ansic: 206; xml: 19
file content (1288 lines) | stat: -rw-r--r-- 41,771 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
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
# Process this file with autoconf to produce a configure script.
AC_INIT(Qtractor, 0.6.3, rncbc@rncbc.org, qtractor)

AC_CONFIG_SRCDIR(src/qtractor.cpp)
AC_CONFIG_HEADERS(src/config.h)
AC_CONFIG_FILES(Makefile qtractor.spec src/src.pri src/qtractor.desktop)

# Set default installation prefix.
AC_PREFIX_DEFAULT(/usr/local)
ac_prefix=$prefix
if test "x$ac_prefix" = "xNONE"; then
    ac_prefix=$ac_default_prefix
fi
AC_SUBST(ac_prefix)
AC_DEFINE_UNQUOTED(CONFIG_PREFIX, ["$ac_prefix"], [Default installation prefix.])

# Enable debugging argument option.
AC_ARG_ENABLE(debug,
  AC_HELP_STRING([--enable-debug], [enable debugging (default=no)]),
  [ac_debug="$enableval"])

if test "x$ac_debug" = "xyes"; then
   AC_DEFINE(CONFIG_DEBUG, 1, [Define if debugging is enabled.])
   ac_stacktrace="yes"
   ac_debug="debug"
else
   ac_stacktrace="no"
   ac_debug="release"
fi

AC_SUBST(ac_debug)


# Enable Qt4/5 availability.
AC_ARG_ENABLE(qt4,
  AC_HELP_STRING([--enable-qt4], [enable Qt4 build (default=yes)]),
  [ac_qt4="$enableval"],
  [ac_qt4="yes"])

AC_ARG_ENABLE(qt5,
  AC_HELP_STRING([--enable-qt5], [enable Qt5 build (default=no)]),
  [ac_qt5="$enableval"],
  [ac_qt5="no"])

if test "x$ac_qt4" = "xno"; then
   ac_qt5="yes"
fi
if test "x$ac_qt5" = "xyes"; then
   ac_qt4="no"
fi

# Enable libvorbis(file) availability.
AC_ARG_ENABLE(libvorbis,
  AC_HELP_STRING([--enable-libvorbis], [enable libvorbis interface (default=yes)]),
  [ac_libvorbis="$enableval"],
  [ac_libvorbis="yes"])

# Enable libmad availability.
AC_ARG_ENABLE(libmad,
  AC_HELP_STRING([--enable-libmad], [enable libmad interface (default=yes)]),
  [ac_libmad="$enableval"],
  [ac_libmad="yes"])

# Enable libsamplerate availability.
AC_ARG_ENABLE(libsamplerate,
  AC_HELP_STRING([--enable-libsamplerate], [enable libsamplerate interface (default=yes)]),
  [ac_libsamplerate="$enableval"],
  [ac_libsamplerate="yes"])

# Enable librubberband availability.
AC_ARG_ENABLE(librubberband,
  AC_HELP_STRING([--enable-librubberband], [enable librubberband interface (default=yes)]),
  [ac_librubberband="$enableval"],
  [ac_librubberband="yes"])

# Enable liblo availability.
AC_ARG_ENABLE(liblo,
  AC_HELP_STRING([--enable-liblo], [enable liblo interface (default=yes)]),
  [ac_liblo="$enableval"],
  [ac_liblo="yes"])

# Enable libz availability.
AC_ARG_ENABLE(libz,
  AC_HELP_STRING([--enable-libz], [enable libz interface (default=yes)]),
  [ac_libz="$enableval"],
  [ac_libz="yes"])

# Enable LILV support.
AC_ARG_ENABLE(lilv,
  AC_HELP_STRING([--enable-lilv], [enable LILV interface support (default=yes)]),
  [ac_lilv="$enableval"],
  [ac_lilv="yes"])

# Enable SUIL support.
AC_ARG_ENABLE(suil,
  AC_HELP_STRING([--enable-suil], [enable SUIL interface support (default=yes)]),
  [ac_suil="$enableval"],
  [ac_suil="yes"])

# Enable SSE optimization.
AC_ARG_ENABLE(sse,
  AC_HELP_STRING([--enable-sse], [enable SSE optimization (default=yes)]),
  [ac_sse="$enableval"],
  [ac_sse="yes"])

# Enable LADSPA support.
AC_ARG_ENABLE(ladspa,
  AC_HELP_STRING([--enable-ladspa], [enable LADSPA plug-in support (default=yes)]),
  [ac_ladspa="$enableval"],
  [ac_ladspa="yes"])

# Enable DSSI support.
AC_ARG_ENABLE(dssi,
  AC_HELP_STRING([--enable-dssi], [enable DSSI plug-in support (default=yes)]),
  [ac_dssi="$enableval"],
  [ac_dssi="yes"])

# Enable VST support.
AC_ARG_ENABLE(vst,
  AC_HELP_STRING([--enable-vst], [enable VST plug-in support (default=yes)]),
  [ac_vst="$enableval"],
  [ac_vst="yes"])

AC_ARG_ENABLE(vestige,
  AC_HELP_STRING([--enable-vestige], [enable VeSTige header support (default=yes)]),
  [ac_vestige="$enableval"],
  [ac_vestige="yes"])

# Enable LV2 support.
AC_ARG_ENABLE(lv2,
  AC_HELP_STRING([--enable-lv2], [enable LV2 plug-in support (default=yes)]),
  [ac_lv2="$enableval"],
  [ac_lv2="yes"])

AC_ARG_ENABLE(lv2-event,
  AC_HELP_STRING([--enable-lv2-event], [enable LV2 plug-in MIDI/Event support (default=yes)]),
  [ac_lv2_event="$enableval"],
  [ac_lv2_event="yes"])

AC_ARG_ENABLE(lv2-atom,
  AC_HELP_STRING([--enable-lv2-atom], [enable LV2 plug-in MIDI/Atom support (default=yes)]),
  [ac_lv2_atom="$enableval"],
  [ac_lv2_atom="yes"])

AC_ARG_ENABLE(lv2-worker,
  AC_HELP_STRING([--enable-lv2-worker], [enable LV2 plug-in Worker/schedule support (default=yes)]),
  [ac_lv2_worker="$enableval"],
  [ac_lv2_worker="yes"])

AC_ARG_ENABLE(lv2-ui,
  AC_HELP_STRING([--enable-lv2-ui], [enable LV2 plug-in UI support (default=yes)]),
  [ac_lv2_ui="$enableval"],
  [ac_lv2_ui="yes"])

AC_ARG_ENABLE(lv2-external-ui,
  AC_HELP_STRING([--enable-lv2-external-ui], [enable LV2 plug-in External UI support (default=yes)]),
  [ac_lv2_external_ui="$enableval"],
  [ac_lv2_external_ui="yes"])

AC_ARG_ENABLE(lv2-state,
  AC_HELP_STRING([--enable-lv2-state], [enable LV2 plug-in State support (default=yes)]),
  [ac_lv2_state="$enableval"],
  [ac_lv2_state="yes"])

AC_ARG_ENABLE(lv2-state-files,
  AC_HELP_STRING([--enable-lv2-state-files], [enable LV2 plug-in State Files support (default=yes)]),
  [ac_lv2_state_files="$enableval"],
  [ac_lv2_state_files="yes"])

AC_ARG_ENABLE(lv2-programs,
  AC_HELP_STRING([--enable-lv2-programs], [enable LV2 plug-in Programs support (default=yes)]),
  [ac_lv2_programs="$enableval"],
  [ac_lv2_programs="yes"])

AC_ARG_ENABLE(lv2-presets,
  AC_HELP_STRING([--enable-lv2-presets], [enable LV2 plug-in Presets support (default=yes)]),
  [ac_lv2_presets="$enableval"],
  [ac_lv2_presets="yes"])

AC_ARG_ENABLE(lv2-time,
  AC_HELP_STRING([--enable-lv2-time], [enable LV2 plug-in Time support (default=yes)]),
  [ac_lv2_time="$enableval"],
  [ac_lv2_time="yes"])

AC_ARG_ENABLE(lv2-time-position,
  AC_HELP_STRING([--enable-lv2-time-position], [enable LV2 plug-in Time/position support (default=yes)]),
  [ac_lv2_time_position="$enableval"],
  [ac_lv2_time_position="yes"])

AC_ARG_ENABLE(lv2-options,
  AC_HELP_STRING([--enable-lv2-options], [enable LV2 plug-in Options support (default=yes)]),
  [ac_lv2_options="$enableval"],
  [ac_lv2_options="yes"])

AC_ARG_ENABLE(lv2-buf-size,
  AC_HELP_STRING([--enable-lv2-buf-size], [enable LV2 plug-in Buf-size support (default=yes)]),
  [ac_lv2_buf_size="$enableval"],
  [ac_lv2_buf_size="yes"])

AC_ARG_ENABLE(lv2-ui-idle,
  AC_HELP_STRING([--enable-lv2-ui-idle], [enable LV2 UI Idle interface support (default=yes)]),
  [ac_lv2_ui_idle="$enableval"],
  [ac_lv2_ui_idle="yes"])

AC_ARG_ENABLE(lv2-ui-show,
  AC_HELP_STRING([--enable-lv2-ui-show], [enable LV2 UI Show interface support (default=yes)]),
  [ac_lv2_ui_show="$enableval"],
  [ac_lv2_ui_show="yes"])

# Enable JACK session support.
AC_ARG_ENABLE(jack-session,
  AC_HELP_STRING([--enable-jack-session], [enable JACK session support (default=yes)]),
  [ac_jack_session="$enableval"],
  [ac_jack_session="yes"])

# Enable JACK latency support.
AC_ARG_ENABLE(jack-latency,
  AC_HELP_STRING([--enable-jack-latency], [enable JACK latency support (default=yes)]),
  [ac_jack_latency="$enableval"],
  [ac_jack_latency="yes"])

# Enable NSM support.
AC_ARG_ENABLE(nsm,
  AC_HELP_STRING([--enable-nsm], [enable NSM support (default=yes)]),
  [ac_nsm="$enableval"],
  [ac_nsm="yes"])

# Enable X11 unique/single instance.
AC_ARG_ENABLE(xunique,
  AC_HELP_STRING([--enable-xunique], [enable X11 unique/single instance (default=no)]),
  [ac_xunique="$enableval"],
  [ac_xunique="no"])

# Enable gradient eye-candy.
AC_ARG_ENABLE(gradient,
  AC_HELP_STRING([--enable-gradient], [enable gradient eye-candy (default=yes)]),
  [ac_gradient="$enableval"],
  [ac_gradient="yes"])

# Enable debugger stack-trace option (assumes --enable-debug).
AC_ARG_ENABLE(stacktrace,
  AC_HELP_STRING([--enable-stacktrace], [enable debugger stack-trace (default=no)]),
  [ac_stacktrace="$enableval"])


# Standard installation base dirs.
ac_with_paths="/usr /usr/local"

# Set for alternate Qt installation dir.
AC_ARG_WITH(qt,
  AC_HELP_STRING([--with-qt=PATH], [use alternate Qt install path]),
  [ac_with_paths="$ac_with_paths $withval"])

# Set for alternate JACK installation dir.
AC_ARG_WITH(jack,
  AC_HELP_STRING([--with-jack=PATH], [use alternate JACK install path]),
  [ac_with_paths="$ac_with_paths $withval"])

# Set for alternate ALSA installation dir.
AC_ARG_WITH(alsa,
  AC_HELP_STRING([--with-alsa=PATH], [use alternate ALSA install path]),
  [ac_with_paths="$ac_with_paths $withval"])

# Set for alternate libsndfile installation dir.
AC_ARG_WITH(libsndfile,
  AC_HELP_STRING([--with-libsndfile=PATH], [use alternate libsndfile path]),
  [ac_with_paths="$ac_with_paths $withval"])

# Set for alternate libvorbis installation dir.
AC_ARG_WITH(libvorbis,
  AC_HELP_STRING([--with-libvorbis=PATH], [use alternate libvorbis path]),
  [ac_with_paths="$ac_with_paths $withval"])

# Set for alternate libmad installation dir.
AC_ARG_WITH(libmad,
  AC_HELP_STRING([--with-libmad=PATH], [use alternate libmad path]),
  [ac_with_paths="$ac_with_paths $withval"])

# Set for alternate libsamplerate installation dir.
AC_ARG_WITH(libsamplerate,
  AC_HELP_STRING([--with-libsamplerate=PATH], [use alternate libsamplerate path]),
  [ac_with_paths="$ac_with_paths $withval"])

# Set for alternate librubberband installation dir.
AC_ARG_WITH(librubberband,
  AC_HELP_STRING([--with-librubberband=PATH], [use alternate librubberband path]),
  [ac_with_paths="$ac_with_paths $withval"])

# Set for alternate liblo installation dir.
AC_ARG_WITH(liblo,
  AC_HELP_STRING([--with-liblo=PATH], [use alternate liblo path]),
  [ac_with_paths="$ac_with_paths $withval"])

# Set for alternate libz installation dir.
AC_ARG_WITH(libz,
  AC_HELP_STRING([--with-libz=PATH], [use alternate libz path]),
  [ac_with_paths="$ac_with_paths $withval"])

# Set for alternate liblilv installation dir.
AC_ARG_WITH(liblilv,
  AC_HELP_STRING([--with-liblilv=PATH], [use alternate liblilv path]),
  [ac_with_paths="$ac_with_paths $withval"])

# Set for alternate libsuil installation dir.
AC_ARG_WITH(libsuil,
  AC_HELP_STRING([--with-libsuil=PATH], [use alternate libsuil path]),
  [ac_with_paths="$ac_with_paths $withval"])

# Set for alternate LADSPA include dir.
AC_ARG_WITH(ladspa,
  AC_HELP_STRING([--with-ladspa=PATH], [use alternate LADSPA header path]),
  [ac_with_ladspa="$withval"])

# Set for alternate DSSI include dir.
AC_ARG_WITH(dssi,
  AC_HELP_STRING([--with-dssi=PATH], [use alternate DSSI header path]),
  [ac_with_dssi="$withval"])

# Set for alternate VST include dir.
AC_ARG_WITH(vst,
  AC_HELP_STRING([--with-vst=PATH], [use alternate VST header path]),
  [ac_with_vst="$withval"])

# Set for alternate LV2 include dir.
AC_ARG_WITH(lv2,
  AC_HELP_STRING([--with-lv2=PATH], [use alternate LV2 header path]),
  [ac_with_lv2="$withval"])


# Honor user specified flags.
ac_cflags=$CFLAGS
ac_ldflags=$LDFLAGS


# Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_GCC_TRADITIONAL

# Checks for languages.
AC_LANG_C
AC_LANG_CPLUSPLUS


# Check for proper flags.
ac_arch=`uname -m`

# Check for some a-la-debian alternatives...
ac_qtdirs="qt"

if test "x$ac_qt4" = "xyes"; then
   ac_qtdirs="qt4 $ac_qtdirs"
fi
if test "x$ac_qt5" = "xyes"; then
   ac_qtdirs="qt5 $ac_qtdirs"
fi

ac_topdirs="/usr/share /usr/lib"

if test "x$ac_arch" = "xx86_64"; then
   CFLAGS="-fPIC $CFLAGS"
   CPPFLAGS="-fPIC $CPPFLAGS"
   ac_topdirs="$ac_topdirs /usr/lib64"
fi

for X in $ac_topdirs; do
  for Y in $ac_qtdirs; do
    if test -d $X/$Y/bin; then
      ac_with_paths="$X/$Y $ac_with_paths"
    fi
  done
done

# Prepend alternate dependencies paths.
ac_path=$PATH
for X in $ac_with_paths; do
  if test -d $X/bin; then
    ac_path="$X/bin:$ac_path"
  fi
# if test -x $X/qmake; then
#   ac_path="$X:$ac_path"
# fi
  if test -d $X/include; then
    for Y in $ac_qtdirs; do
      if test -d $X/include/$Y; then
        CFLAGS="-I$X/include/$Y $CFLAGS"
        CPPFLAGS="-I$X/include/$Y $CPPFLAGS"
        ac_incpath="$X/include/$Y $ac_incpath"
      fi
    done
    CFLAGS="-I$X/include $CFLAGS"
    CPPFLAGS="-I$X/include $CPPFLAGS"
    ac_incpath="$X/include $ac_incpath"
  fi
  if test "x$ac_arch" = "xx86_64" -a -d $X/lib64; then
    LIBS="-L$X/lib64 $LIBS"
    ac_libs="-L$X/lib64 $ac_libs"
  fi
  if test -d $X/lib; then
    LIBS="-L$X/lib $LIBS"
    ac_libs="-L$X/lib $ac_libs"
  fi
done

# Check for proper Qt version.
AC_CACHE_CHECK([for Qt library version >= 4.4],
   ac_cv_qtversion, [
   AC_TRY_LINK([#include "QtCore/qglobal.h"], [
      #if QT_VERSION < 0x040400
      #error Qt library 4.4 or greater required.
      #endif
   ], ac_cv_qtversion="yes", [
      echo "no; Qt 4.4 or greater is required"
      exit 1
   ])
])


# Check for IEEE 32bit float optimizations.
AC_CACHE_CHECK([for IEEE 32bit float optimizations],
   ac_cv_float32, [
   AC_TRY_RUN([
      int main() { return (sizeof(float) == 4 ? 0 : 1); }
   ], ac_cv_float32="yes", ac_cv_float32="no")
])
ac_float32=$ac_cv_float32
if test "x$ac_float32" = "xyes"; then
   AC_DEFINE(CONFIG_FLOAT32, 1, [Define if IEEE 32bit float optimizations are enabled.])
fi

# Check for SSE optimization.
if test "x$ac_sse" = "xyes"; then
   ac_sse_cflags="-msse -mfpmath=sse -ffast-math"
   ac_old_cflags=$CFLAGS
   ac_old_cppflags=$CPPFLAGS
   CFLAGS="$ac_sse_cflags $CFLAGS"
   CPPFLAGS="$ac_sse_cflags $CPPFLAGS"
   AC_CACHE_CHECK([for SSE optimization],
      ac_cv_sse, [
      AC_TRY_RUN([
         #include <xmmintrin.h>
         #if !defined(__SSE__)
         #error SSE optimization disabled.
         #endif
         int main() {
             unsigned int a, b, c, d;
             __asm__ __volatile__
             ("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (1));
            return ((d & (1 << 25)) ? 0 : 1);
         }
      ], ac_cv_sse="yes", ac_cv_sse="no")
   ])
   ac_sse=$ac_cv_sse
   if test "x$ac_sse" = "xyes"; then
      ac_cflags="$ac_sse_cflags $ac_cflags"
   else
      CPPFLAGS=$ac_old_cppflags
      CFLAGS=$ac_old_cflags
   fi
fi


# A common error message:
ac_errmsg="not found in current PATH. Maybe QT development environment isn't available (qt-devel)."

# Check for Qt qmake utility.
AC_PATH_PROG(ac_qmake, qmake, [no], $ac_path)
if test "x$ac_qmake" = "xno"; then
   AC_MSG_ERROR([qmake $ac_errmsg])
fi
AC_SUBST(ac_qmake)

# Check for Qt moc utility.
AC_PATH_PROG(ac_moc, moc, [no], $ac_path)
if test "x$ac_moc" = "xno"; then
   AC_MSG_ERROR([moc $ac_errmsg])
fi
AC_SUBST(ac_moc)

# Check for Qt uic utility.
AC_PATH_PROG(ac_uic, uic, [no], $ac_path)
if test "x$ac_uic" = "xno"; then
   AC_MSG_ERROR([uic $ac_errmsg])
fi
AC_SUBST(ac_uic)

# Check for Qt lupdate utility.
AC_PATH_PROG(ac_lupdate, lupdate, [no], $ac_path)
if test "x$ac_lupdate" = "xno"; then
   AC_MSG_ERROR([lupdate $ac_errmsg])
fi
AC_SUBST(ac_lupdate)

# Check for Qt lrelease utility.
AC_PATH_PROG(ac_lrelease, lrelease, [no], $ac_path)
if test "x$ac_release" = "xno"; then
   AC_MSG_ERROR([lrelease $ac_errmsg])
fi
AC_SUBST(ac_lrelease)


# Check for pkg-config utility (needed for LV2 GTK UI support).
AC_PATH_PROG(ac_pkg_config, pkg-config, [no], $ac_path)
if test "x$ac_pkg_config" = "xno"; then
   ac_lv2="no"
   ac_lilv="no"
   ac_suil="no"
fi


# Checks for libraries.
AC_CHECK_LIB(m, main)
AC_CHECK_LIB(X11, main)
AC_CHECK_LIB(Xext, main)

# Check for round math function.
AC_CHECK_LIB(m, round, [ac_round="yes"], [ac_round="no"])
if test "x$ac_round" = "xyes"; then
   AC_DEFINE(CONFIG_ROUND, 1, [Define if round is available.])
fi

# Check for JACK libraries.
AC_CHECK_LIB(jack, main, [ac_libjack="yes"], [ac_libjack="no"])
if test "x$ac_libjack" = "xno"; then
   AC_MSG_ERROR([JACK library not found.])
else
   ac_libs="$ac_libs -ljack"
fi

# Check for ALSA libraries.
AC_CHECK_LIB(asound, main, [ac_libasound="yes"], [ac_libasound="no"])
if test "x$ac_libasound" = "xno"; then
   AC_MSG_ERROR([ALSA library not found.])
else
   ac_libs="$ac_libs -lasound"
fi

# Check for sndfile library.
AC_CHECK_LIB(sndfile, main, [ac_libsndfile="yes"], [ac_libsndfile="no"])
if test "x$ac_libsndfile" = "xno"; then
   AC_MSG_ERROR([sndfile library not found.])
else
   ac_libs="$ac_libs -lsndfile"
fi

# Check for option libvorbis libraries.
if test "x$ac_libvorbis" = "xyes"; then
   AC_CHECK_LIB(ogg, main, [ac_libvorbis="yes"], [ac_libvorbis="no"])
   if test "x$ac_libvorbis" = "xyes"; then
      ac_libs="$ac_libs -logg"
   else
      AC_MSG_WARN([*** ogg library not found.])
   fi
fi

if test "x$ac_libvorbis" = "xyes"; then
   AC_CHECK_LIB(vorbis, main, [ac_libvorbis="yes"], [ac_libvorbis="no"])
   if test "x$ac_libvorbis" = "xyes"; then
      ac_libs="$ac_libs -lvorbis"
   else
      AC_MSG_WARN([*** vorbis library not found.])
   fi
fi

if test "x$ac_libvorbis" = "xyes"; then
   AC_CHECK_LIB(vorbisenc, main, [ac_libvorbis="yes"], [ac_libvorbis="no"])
   if test "x$ac_libvorbis" = "xyes"; then
      ac_libs="$ac_libs -lvorbisenc"
   else
      AC_MSG_WARN([*** vorbisenc library not found.])
   fi
fi

if test "x$ac_libvorbis" = "xyes"; then
   AC_CHECK_LIB(vorbisfile, main, [ac_libvorbis="yes"], [ac_libvorbis="no"])
   if test "x$ac_libvorbis" = "xyes"; then
      ac_libs="$ac_libs -lvorbisfile"
   else
      AC_MSG_WARN([*** vorbisfile library not found.])
   fi
fi

if test "x$ac_libvorbis" = "xyes"; then
   AC_DEFINE(CONFIG_LIBVORBIS, 1, [Define if libvorbis is available.])
else
   AC_MSG_WARN([*** Ogg Vorbis audio file support will be disabled.])
fi

# Check for optional libmad library.
if test "x$ac_libmad" = "xyes"; then
   AC_CHECK_LIB(mad, main, [ac_libmad="yes"], [ac_libmad="no"])
   if test "x$ac_libmad" = "xyes"; then
      AC_DEFINE(CONFIG_LIBMAD, 1, [Define if libmad is available.])
      ac_libs="$ac_libs -lmad"
   else
      AC_MSG_WARN([*** mad library not found.])
      AC_MSG_WARN([*** MPEG Layer III audio file support will be disabled.])
   fi
fi

# Check for optional libsamplerate library.
if test "x$ac_libsamplerate" = "xyes"; then
   AC_CHECK_LIB(samplerate, main, [ac_libsamplerate="yes"], [ac_libsamplerate="no"])
   if test "x$ac_libsamplerate" = "xyes"; then
      AC_DEFINE(CONFIG_LIBSAMPLERATE, 1, [Define if libsamplerate is available.])
      ac_libs="$ac_libs -lsamplerate"
   else
      AC_MSG_WARN([*** samplerate library not found.])
      AC_MSG_WARN([*** Sample-rate conversion support will be disabled.])
   fi
fi

# Check for optional librubberband library.
if test "x$ac_librubberband" = "xyes"; then
   AC_CHECK_LIB(rubberband, main, [ac_librubberband="yes"], [ac_librubberband="no"])
   if test "x$ac_librubberband" = "xyes"; then
      AC_DEFINE(CONFIG_LIBRUBBERBAND, 1, [Define if librubberband is available.])
      ac_libs="$ac_libs -lrubberband"
   else
      AC_MSG_WARN([*** rubberband library not found.])
      AC_MSG_WARN([*** Pitch-shifting support will be disabled.])
   fi
fi

# Check for optional liblo library.
if test "x$ac_liblo" = "xyes"; then
   AC_CHECK_LIB(lo, main, [ac_liblo="yes"], [ac_liblo="no"])
   if test "x$ac_liblo" = "xyes"; then
      AC_DEFINE(CONFIG_LIBLO, 1, [Define if liblo is available.])
      ac_libs="$ac_libs -llo"
   else
      AC_MSG_WARN([*** lo library not found.])
      AC_MSG_WARN([*** OSC service support will be disabled.])
      ac_nsm="no"
   fi
else
   ac_nsm="no"
fi

# Check for optional libz library.
if test "x$ac_libz" = "xyes"; then
   AC_CHECK_LIB(z, main, [ac_libz="yes"], [ac_libz="no"])
   if test "x$ac_libz" = "xyes"; then
      AC_DEFINE(CONFIG_LIBZ, 1, [Define if libz is available.])
      ac_libs="$ac_libs -lz"
   else
      AC_MSG_WARN([*** z library not found.])
      AC_MSG_WARN([*** Archive/Zip file support will be disabled.])
   fi
fi

# Check for LV2 support.
if test "x$ac_lv2" = "xno"; then
   ac_lilv="no"
   ac_lv2_ui="no"
fi

if test "x$ac_lv2_ui" = "xno"; then
   ac_suil="no"
   ac_lv2_external_ui="no"
   ac_lv2_ui_idle="no"
   ac_lv2_ui_show="no"
fi

# Check for optional liblilv library.
if test "x$ac_lilv" = "xyes"; then
   AC_CHECK_LIB(lilv-0, main, [ac_lilv="yes"], [ac_lilv="no"])
fi
if test "x$ac_lilv" = "xyes"; then
   ac_lilv_libs=`$ac_pkg_config --libs lilv-0 2>/dev/null`
   if test -n "$ac_lilv_libs"; then
      ac_libs="$ac_libs $ac_lilv_libs"
      AC_DEFINE(CONFIG_LIBLILV, 1, [Define if liblilv is available.])
   else
      AC_MSG_WARN([*** lilv library not found.])
      ac_lilv="no"
   fi
fi

# Check for LV2 new UI instantiation availability (libsuil).
if test "x$ac_suil" = "xyes"; then
   AC_CHECK_LIB(suil-0, main, [ac_suil="yes"], [ac_suil="no"])
fi
if test "x$ac_suil" = "xyes"; then
   ac_suil_libs=`$ac_pkg_config --libs suil-0 2>/dev/null`
   if test -n "$ac_suil_libs"; then
      ac_libs="$ac_libs $ac_suil_libs"
      AC_DEFINE(CONFIG_LIBSUIL, 1, [Define if libsuil is available.])
   else
      AC_MSG_WARN([*** suil library not found.])
      ac_suil="no"
   fi
fi

if test "x$ac_suil" = "xyes"; then
   AC_CHECK_LIB(suil-0, suil_instance_get_handle,
      [ac_suil_instance_get_handle="yes"],
      [ac_suil_instance_get_handle="no"])
   if test "x$ac_suil_instance_get_handle" = "xyes"; then
      AC_DEFINE(CONFIG_SUIL_INSTANCE_GET_HANDLE, 1, [Define if suil_instance_get_handle is available.])
   fi
else
   ac_lv2_ui="no"
   ac_lv2_external_ui="no"
   ac_lv2_ui_idle="no"
   ac_lv2_ui_show="no"
fi

# Check for LV2 host library (liblilv).
if test "x$ac_lilv" = "xno"; then
   ac_lv2="no"
   ac_lv2_ui="no"
   ac_lv2_event="no"
   ac_lv2_atom="no"
   ac_lv2_worker="no"
   ac_lv2_external_ui="no"
   ac_lv2_state="no"
   ac_lv2_state_files="no"
   ac_lv2_programs="no"
   ac_lv2_presets="no"
   ac_lv2_time="no"
   ac_lv2_time_position="no";
   ac_lv2_options="no"
   ac_lv2_buf_size="no"
   ac_lv2_ui_idle="no"
   ac_lv2_ui_show="no"
fi

# Check for JACK session event callback availability.
if test "x$ac_jack_session" = "xyes"; then
   AC_CHECK_LIB(jack, jack_set_session_callback, [ac_jack_session="yes"], [ac_jack_session="no"])
else
   AC_MSG_WARN([*** JACK session support will be disabled.])
fi

# Check for (new) JACK latency support availability.
if test "x$ac_jack_latency" = "xyes"; then
   AC_CHECK_LIB(jack, jack_port_get_latency_range, [ac_jack_latency="yes"], [ac_jack_latency="no"])
   if test "x$ac_jack_latency" = "xyes"; then
      AC_DEFINE(CONFIG_JACK_LATENCY, 1, [Define if JACK latency support is available.])
   else
      AC_MSG_WARN([*** JACK latency support will be disabled.])
   fi
fi

# Some recent distros (eg. fedora, debian) require this.
ac_libs="$ac_libs -lX11"

AC_SUBST(ac_libs)


# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/stat.h unistd.h signal.h)

# Check for JACK headers.
AC_CHECK_HEADER(jack/jack.h, [ac_jack_h="yes"], [ac_jack_h="no"])
if test "x$ac_jack_h" = "xno"; then
   AC_MSG_ERROR([JACK headers not found.])
fi

# Check for ALSA headers.
AC_CHECK_HEADER(alsa/asoundlib.h, [ac_alsa_h="yes"], [ac_alsa_h="no"])
if test "x$ac_alsa_h" = "xno"; then
   AC_MSG_ERROR([ALSA headers not found.])
fi

# Check for sndfile headers.
AC_CHECK_HEADER(sndfile.h, [ac_sndfile_h="yes"], [ac_sndfile_h="no"])
if test "x$ac_sndfile_h" = "xno"; then
   AC_MSG_ERROR([sndfile.h header file not found.])
fi

# Check for vorbisfile headers.
if test "x$ac_libvorbis" = "xyes"; then
   AC_CHECK_HEADER(vorbis/vorbisenc.h, [ac_vorbisenc_h="yes"], [ac_vorbisenc_h="no"])
   if test "x$ac_vorbisenc_h" = "xno"; then
      AC_MSG_ERROR([vorbisenc.h header file not found.])
   fi
   AC_CHECK_HEADER(vorbis/vorbisfile.h, [ac_vorbisfile_h="yes"], [ac_vorbisfile_h="no"])
   if test "x$ac_vorbisfile_h" = "xno"; then
      AC_MSG_ERROR([vorbisfile.h header file not found.])
   fi
fi

# Check for mad headers.
if test "x$ac_libmad" = "xyes"; then
   AC_CHECK_HEADER(mad.h, [ac_mad_h="yes"], [ac_mad_h="no"])
   if test "x$ac_mad_h" = "xno"; then
      AC_MSG_ERROR([mad.h header file not found.])
   fi
fi

# Check for samplerate headers.
if test "x$ac_libsamplerate" = "xyes"; then
   AC_CHECK_HEADER(samplerate.h, [ac_samplerate_h="yes"], [ac_samplerate_h="no"])
   if test "x$ac_samplerate_h" = "xno"; then
      AC_MSG_ERROR([samplerate.h header file not found.])
   fi
fi

# Check for rubberband headers.
if test "x$ac_librubberband" = "xyes"; then
   AC_CHECK_HEADER(rubberband/RubberBandStretcher.h, [ac_rubberband_h="yes"], [ac_rubberband_h="no"])
   if test "x$ac_rubberband_h" = "xno"; then
      AC_MSG_ERROR([RubberBandStretcher.h header file not found.])
   fi
fi

# Check for lo headers.
if test "x$ac_liblo" = "xyes"; then
   AC_CHECK_HEADER(lo/lo.h, [ac_lo_h="yes"], [ac_lo_h="no"])
   if test "x$ac_lo_h" = "xno"; then
      AC_MSG_ERROR([lo.h header file not found.])
      ac_nsm="no"
   fi
fi

# Check for zlib headers.
if test "x$ac_libz" = "xyes"; then
   AC_CHECK_HEADER(zlib.h, [ac_zlib_h="yes"], [ac_zlib_h="no"])
   if test "x$ac_zlib_h" = "xno"; then
      AC_MSG_ERROR([zlib.h header file not found.])
   fi
fi

# Check for lilv headers.
if test "x$ac_lilv" = "xyes"; then
   ac_lilv_cflags=`$ac_pkg_config --cflags lilv-0 2>/dev/null`
   if test -n "$ac_lilv_cflags"; then
      CFLAGS="$ac_lilv_cflags $CFLAGS"
      CPPFLAGS="$ac_lilv_cflags $CPPFLAGS"
   fi
   AC_CHECK_HEADER(lilv/lilv.h, [ac_lilv_h="yes"], [ac_lilv_h="no"])
   if test "x$ac_lilv_h" = "xno"; then
      AC_MSG_ERROR([lilv.h header file not found.])
   else
      ac_cflags="$ac_lilv_cflags $ac_cflags"
   fi
fi

# Check for suil headers.
if test "x$ac_suil" = "xyes"; then
   ac_suil_cflags=`$ac_pkg_config --cflags suil-0 2>/dev/null`
   if test -n "$ac_suil_cflags"; then
      CFLAGS="$ac_suil_cflags $CFLAGS"
      CPPFLAGS="$ac_suil_cflags $CPPFLAGS"
   fi
   AC_CHECK_HEADER(suil/suil.h, [ac_suil_h="yes"], [ac_suil_h="no"])
   if test "x$ac_suil_h" = "xno"; then
      AC_MSG_ERROR([suil.h header file not found.])
   else
      ac_cflags="$ac_suil_cflags $ac_cflags"
   fi
fi

# Check for LADSPA headers.
if test -n "$ac_with_ladspa"; then
   CFLAGS="-I$ac_with_ladspa $CFLAGS"
   CPPFLAGS="-I$ac_with_ladspa $CPPFLAGS"
   ac_ladspa="yes"
fi
if test "x$ac_ladspa" = "xyes"; then
   AC_CHECK_HEADER(ladspa.h, [ac_ladspa="yes"], [ac_ladspa="no"])
   if test "x$ac_ladspa" = "xyes"; then
      AC_DEFINE(CONFIG_LADSPA, 1, [Define if LADSPA header is available.])
      ac_incpath="$ac_with_ladspa $ac_incpath"
   else
      AC_MSG_WARN([*** ladspa.h header file not found.])
      AC_MSG_WARN([*** LADSPA plug-in support will be disabled.])
   fi
fi

# Check for DSSI headers.
if test -n "$ac_with_dssi"; then
   CFLAGS="-I$ac_with_dssi $CFLAGS"
   CPPFLAGS="-I$ac_with_dssi $CPPFLAGS"
   ac_dssi="yes"
fi
if test "x$ac_dssi" = "xyes"; then
   AC_CHECK_HEADER(dssi.h, [ac_dssi="yes"], [ac_dssi="no"])
   if test "x$ac_dssi" = "xyes"; then
      AC_DEFINE(CONFIG_DSSI, 1, [Define if DSSI header is available.])
      ac_incpath="$ac_with_dssi $ac_incpath"
   else
      AC_MSG_WARN([*** dssi.h header file not found.])
      AC_MSG_WARN([*** DSSI plug-in support will be disabled.])
   fi
fi

# Pre-check for VeSTige header.
if test "$ac_vestige" = "xyes"; then
   ac_vst="yes"
fi

# Check for VST headers.
if test -n "$ac_with_vst"; then
   CFLAGS="-I$ac_with_vst $CFLAGS"
   CPPFLAGS="-I$ac_with_vst $CPPFLAGS"
   ac_incpath="$ac_with_vst $ac_incpath"
   ac_vst="yes"
fi
if test "x$ac_vst" = "xyes"; then
   CFLAGS="-D__cdecl= $CFLAGS"
   CPPFLAGS="-D__cdecl= $CPPFLAGS"
   AC_CACHE_CHECK([for VST headers],
      ac_cv_vst, [
      AC_TRY_LINK([#include <aeffectx.h>], [
         // Checking for VST headers...
      ], ac_cv_vst="yes", ac_cv_vst="no")
   ])
   ac_vst=$ac_cv_vst
   if test "x$ac_vst" = "xno" -a "x$ac_vestige" = "xyes"; then
      CFLAGS="$CFLAGS -Isrc/vestige"
      CPPFLAGS="$CPPFLAGS -Isrc/vestige"
      ac_incpath="$ac_incpath vestige"
      AC_CHECK_HEADER(aeffectx.h, [ac_vst="yes"], [ac_vst="no"])
   else
      ac_vestige="no"
   fi
   if test "x$ac_vst" = "xyes"; then
      AC_DEFINE(CONFIG_VST, 1, [Define if VST header is available.])
   else
      AC_MSG_WARN([*** aeffectx.h header file not found.])
      AC_MSG_WARN([*** VST plug-in support will be disabled.])
      ac_vestige="no"
   fi
else
   ac_vestige="no"
fi

# Post-check for VeSTige header.
if test "x$ac_vestige" = "xyes"; then
   AC_DEFINE(CONFIG_VESTIGE, 1, [Define if VeSTige header is available.])
fi

# Check for LV2 headers.
if test -n "$ac_with_lv2"; then
   ac_lv2="yes"
fi
if test "x$ac_lv2" = "xyes"; then
   if test -n "$ac_with_lv2"; then
      CFLAGS="-I$ac_with_lv2 $CFLAGS"
      CPPFLAGS="-I$ac_with_lv2 $CPPFLAGS"
      ac_incpath="$ac_with_lv2 $ac_incpath"
   else
      CFLAGS="$CFLAGS -Isrc/lv2"
      CPPFLAGS="$CPPFLAGS -Isrc/lv2"
      ac_incpath="$ac_incpath lv2"
   fi
   AC_CHECK_HEADER(lv2.h, [ac_lv2="yes"], [ac_lv2="no"])
   if test "x$ac_lv2" = "xyes"; then
      AC_CHECK_HEADERS(
         lv2/lv2plug.in/ns/ext/urid/urid.h \
         lv2/lv2plug.in/ns/ext/uri-map/uri-map.h,
         [ac_lv2="yes"], [ac_lv2="no"])
   fi
   if test "x$ac_lv2" = "xyes"; then
      AC_DEFINE(CONFIG_LV2, 1, [Define if LV2 headers are available.])
   else
      AC_MSG_WARN([*** LV2 header files not found.])
      AC_MSG_WARN([*** LV2 plug-in support will be disabled.])
      ac_lv2_ui="no"
      ac_lv2_event="no"
      ac_lv2_atom="no"
      ac_lv2_worker="no"
      ac_lv2_external_ui="no"
      ac_lv2_state="no"
      ac_lv2_state_files="no"
      ac_lv2_programs="no"
      ac_lv2_presets="no"
      ac_lv2_time="no"
      ac_lv2_time_position="no";
      ac_lv2_options="no"
      ac_lv2_buf_size="no"
      ac_lv2_ui_idle="no"
      ac_lv2_ui_show="no"
   fi
fi
if test "x$ac_lv2_ui" = "xyes"; then
   AC_CHECK_HEADER(
      lv2/lv2plug.in/ns/extensions/ui/ui.h,
      [ac_lv2_ui="yes"], [ac_lv2_ui="no"])
   if test "x$ac_lv2_ui" = "xyes"; then
      AC_DEFINE(CONFIG_LV2_UI, 1, [Define if LV2 UI support is available.])
   else
      AC_MSG_WARN([*** LV2 UI support will be disabled.])
      ac_lv2_external_ui="no"
      ac_lv2_ui_idle="no"
      ac_lv2_ui_show="no"
   fi
else
   ac_lv2_external_ui="no"
   ac_lv2_ui_idle="no"
   ac_lv2_ui_show="no"
fi
if test "x$ac_lv2_event" = "xyes"; then
   AC_CHECK_HEADERS(
      lv2/lv2plug.in/ns/ext/event/event.h \
      lv2/lv2plug.in/ns/ext/event/event-helpers.h,
      [ac_lv2_event="yes"], [ac_lv2_event="no"])
   if test "x$ac_lv2_event" = "xyes"; then
      AC_DEFINE(CONFIG_LV2_EVENT, 1, [Define if LV2 Event/MIDI support is available.])
   else
      AC_MSG_WARN([*** LV2 Event/MIDI support will be disabled.])
   fi
fi
if test "x$ac_lv2_atom" = "xyes"; then
   AC_CHECK_HEADERS(lv2_atom_helpers.h, [ac_lv2_atom="yes"], [ac_lv2_atom="no"])
   if test "x$ac_lv2_atom" = "xyes"; then
      AC_DEFINE(CONFIG_LV2_ATOM, 1, [Define if LV2 Atom/MIDI aupport is available.])
   else
      AC_MSG_WARN([*** LV2 Atom/MIDI support will be disabled.])
      ac_lv2_options="no"
      ac_lv2_buf_size="no"
      ac_lv2_time_position="no";
   fi
else
   ac_options="no"
   ac_buf_size="no"
   ac_lv2_time_position="no";
fi
if test "x$ac_lv2_worker" = "xyes"; then
   AC_CHECK_HEADER(
      lv2/lv2plug.in/ns/ext/worker/worker.h,
      [ac_lv2_worker="yes"], [ac_lv2_worker="no"])
   if test "x$ac_lv2_worker" = "xyes"; then
      AC_DEFINE(CONFIG_LV2_WORKER, 1, [Define if LV2 Worker/Schedule aupport is available.])
   else
      AC_MSG_WARN([*** LV2 Worker/Schedule support will be disabled.])
   fi
fi
if test "x$ac_lv2_external_ui" = "xyes"; then
   AC_CHECK_HEADER(lv2_external_ui.h, [ac_lv2_external_ui="yes"], [ac_lv2_external_ui="no"])
   if test "x$ac_lv2_external_ui" = "xyes"; then
      AC_CHECK_HEADERS(
         lv2/lv2plug.in/ns/ext/data-access/data-access.h \
         lv2/lv2plug.in/ns/ext/instance-access/instance-access.h,
         [ac_lv2_external_ui="yes"], [ac_lv2_external_ui="no"])
   fi
   if test "x$ac_lv2_external_ui" = "xyes"; then
      AC_DEFINE(CONFIG_LV2_EXTERNAL_UI, 1, [Define if LV2 External UI extension is available.])
   else
      AC_MSG_WARN([*** LV2 External UI extension will be disabled.])
   fi
fi
if test "x$ac_lv2_state" = "xyes"; then
   AC_CHECK_HEADERS(
      lv2/lv2plug.in/ns/ext/atom/atom.h \
      lv2/lv2plug.in/ns/ext/state/state.h,
      [ac_lv2_state="yes"], [ac_lv2_state="no"])
   if test "x$ac_lv2_state" = "xyes"; then
      AC_DEFINE(CONFIG_LV2_STATE, 1, [Define if LV2 State extension is available.])
   else
      AC_MSG_WARN([*** LV2 State extension will be disabled.])
      ac_lv2_state_files="no"
      ac_lv2_presets="no"
   fi
   if test "x$ac_lv2_state_files" = "xyes"; then
       AC_DEFINE(CONFIG_LV2_STATE_FILES, 1, [Define if LV2 State Files feature is available.])
   else
       AC_MSG_WARN([*** LV2 State Files feature will be disabled.])
   fi
else
   ac_lv2_state_files="no"
   ac_lv2_presets="no"
fi
if test "x$ac_lv2_programs" = "xyes"; then
   AC_CHECK_HEADER(lv2_programs.h, [ac_lv2_programs="yes"], [ac_lv2_programs="no"])
   if test "x$ac_lv2_programs" = "xyes"; then
      AC_DEFINE(CONFIG_LV2_PROGRAMS, 1, [Define if LV2 Programs extension is available.])
   else
      AC_MSG_WARN([*** LV2 Programs extension will be disabled.])
   fi
fi
if test "x$ac_lv2_presets" = "xyes"; then
   AC_CHECK_HEADER(
      lv2/lv2plug.in/ns/ext/presets/presets.h,
      [ac_lv2_presets="yes"], [ac_lv2_presets="no"])
   if test "x$ac_lv2_presets" = "xyes"; then
      AC_DEFINE(CONFIG_LV2_PRESETS, 1, [Define if LV2 Presets are supported.])
   else
      AC_MSG_WARN([*** LV2 Presets will be disabled.])
   fi
fi
if test "x$ac_lv2_time" = "xyes"; then
   AC_CHECK_HEADER(
      lv2/lv2plug.in/ns/ext/time/time.h,
      [ac_lv2_time="yes"], [ac_lv2_time="no"])
   if test "x$ac_lv2_time" = "xyes"; then
      AC_DEFINE(CONFIG_LV2_TIME, 1, [Define if LV2 Time is supported.])
   else
      AC_MSG_WARN([*** LV2 Time support will be disabled.])
      ac_lv2_time_position="no";
   fi
else
   ac_lv2_time_position="no";
fi
if test "x$ac_lv2_options" = "xyes"; then
   AC_CHECK_HEADER(
      lv2/lv2plug.in/ns/ext/options/options.h,
      [ac_lv2_options="yes"], [ac_lv2_options="no"])
   if test "x$ac_lv2_options" = "xyes"; then
      AC_DEFINE(CONFIG_LV2_OPTIONS, 1, [Define if LV2 Options is supported.])
   else
      AC_MSG_WARN([*** LV2 Options support will be disabled.])
      ac_lv2_buf_size="no"
   fi
else
   ac_lv2_buf_size="no"
fi
if test "x$ac_lv2_buf_size" = "xyes"; then
   AC_CHECK_HEADER(
      lv2/lv2plug.in/ns/ext/buf-size/buf-size.h,
      [ac_lv2_buf_size="yes"], [ac_lv2_buf_size="no"])
   if test "x$ac_lv2_buf_size" = "xyes"; then
      AC_DEFINE(CONFIG_LV2_BUF_SIZE, 1, [Define if LV2 Buf-size is supported.])
   else
      AC_MSG_WARN([*** LV2 Buf-size support will be disabled.])
   fi
fi
if test "x$ac_lv2_ui_idle" = "xyes"; then
   AC_CACHE_CHECK([for LV2 UI Idle interface],
      ac_cv_lv2_ui_idle, [
      AC_TRY_LINK([#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"], [
         // Checking for LV2 UI Idle interface...
         LV2UI_Idle_Interface idle;
      ], ac_cv_lv2_ui_idle="yes", ac_cv_lv2_ui_idle="no")
   ])
   ac_lv2_ui_idle=$ac_cv_lv2_ui_idle
   if test "x$ac_lv2_ui_idle" = "xyes"; then
      AC_DEFINE(CONFIG_LV2_UI_IDLE, 1, [Define if LV2 UI Idle interface support is available.])
   else
      AC_MSG_WARN([*** LV2 UI Idle interface support will be disabled.])
   fi
fi
if test "x$ac_lv2_ui_show" = "xyes"; then
   AC_CACHE_CHECK([for LV2 UI Show interface],
      ac_cv_lv2_ui_show, [
      AC_TRY_LINK([#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"], [
         // Checking for LV2 UI Show interface...
         LV2UI_Show_Interface show;
      ], ac_cv_lv2_ui_show="yes", ac_cv_lv2_ui_show="no")
   ])
   ac_lv2_ui_show=$ac_cv_lv2_ui_show
   if test "x$ac_lv2_ui_show" = "xyes"; then
      AC_DEFINE(CONFIG_LV2_UI_SHOW, 1, [Define if LV2 UI Show interface support is available.])
   else
      AC_MSG_WARN([*** LV2 UI Show interface support will be disabled.])
   fi
fi
if test "x$ac_lv2_time_position" = "xyes"; then
   AC_CHECK_HEADER(lv2/lv2plug.in/ns/ext/atom/forge.h,
      [ac_lv2_time_position="yes"], [ac_lv2_time_position="no"])
   if test "x$ac_lv2_time_position" = "xyes"; then
      AC_DEFINE(CONFIG_LV2_TIME_POSITION, 1, [Define if LV2 Time/position support is available.])
      AC_CACHE_CHECK([for LV2 Time/position support (lv2_atom_forge_object)],
         ac_cv_lv2_atom_forge_object, [
         AC_TRY_LINK([#include "lv2/lv2plug.in/ns/ext/atom/forge.h"], [
            // Checking for lv2_atom_forge_object...
            LV2_Atom_Forge *forge;
            LV2_Atom_Forge_Frame *frame;
            lv2_atom_forge_object(forge, frame, 0, 101);
         ], ac_cv_lv2_atom_forge_object="yes", ac_cv_atom_forge_object="no")
      ])
      ac_lv2_atom_forge_object=$ac_cv_lv2_atom_forge_object
      if test "x$ac_lv2_atom_forge_object" = "xyes"; then
         AC_DEFINE(CONFIG_LV2_ATOM_FORGE_OBJECT, 1, [Define if lv2_atom_forge_object is available.])
      fi
      AC_CACHE_CHECK([for LV2 Time/position support (lv2_atom_forge_key)],
         ac_cv_lv2_atom_forge_key, [
         AC_TRY_LINK([#include "lv2/lv2plug.in/ns/ext/atom/forge.h"], [
            // Checking for lv2_atom_forge_key...
            LV2_Atom_Forge *forge;
            lv2_atom_forge_key(forge, 102);
         ], ac_cv_lv2_atom_forge_key="yes", ac_cv_atom_forge_key="no")
      ])
      ac_lv2_atom_forge_key=$ac_cv_lv2_atom_forge_key
      if test "x$ac_lv2_atom_forge_key" = "xyes"; then
         AC_DEFINE(CONFIG_LV2_ATOM_FORGE_KEY, 1, [Define if lv2_atom_forge_key is available.])
      fi
   else
      AC_MSG_WARN([*** LV2 Time/position support will be disabled.])
   fi
fi

# Check for JACK session headers availability.
if test "x$ac_jack_session" = "xyes"; then
   AC_CHECK_HEADER(jack/session.h, [ac_jack_session="yes"], [ac_jack_session="no"])
   if test "x$ac_jack_session" = "xyes"; then
      AC_DEFINE(CONFIG_JACK_SESSION, 1, [Define if JACK session support is available.])
   else
      AC_MSG_WARN([*** jack/session.h file not found.])
      AC_MSG_WARN([*** JACK session support will be disabled.])
   fi
fi

# Check for NSM support.
if test "x$ac_nsm" = "xyes"; then
   AC_DEFINE(CONFIG_NSM, 1, [Define if NSM support is available.])
fi

# Check for X11 unique/single instance.
if test "x$ac_xunique" = "xyes"; then
   AC_DEFINE(CONFIG_XUNIQUE, 1, [Define if X11 unique/single instance is enabled.])
fi

# Check for gradient eye-candy.
if test "x$ac_gradient" = "xyes"; then
   AC_DEFINE(CONFIG_GRADIENT, 1, [Define if gradient eye-candy is enabled.])
fi

# Check for debugging stack-trace.
if test "x$ac_stacktrace" = "xyes"; then
   AC_DEFINE(CONFIG_STACKTRACE, 1, [Define if debugger stack-trace is enabled.])
fi

AC_SUBST(ac_incpath)
AC_SUBST(ac_cflags)
AC_SUBST(ac_ldflags)


# Checks for typedefs, structures, and compiler characteristics.
# AC_C_CONST

# Checks for library functions.
AC_CHECK_FUNCS(system)

# Finally produce a configure header file and the makefiles.
AC_OUTPUT

# make clean > /dev/null 2>&1

# Output summary message

echo
echo "  $PACKAGE_NAME $PACKAGE_VERSION"
echo
echo "  Build target . . . . . . . . . . . . . . . . . . .: $ac_debug"
echo
echo "  JACK Audio Connection Kit support  . . . . . . . .: $ac_libjack"
echo "  ALSA MIDI Sequencer support  . . . . . . . . . . .: $ac_libasound"
echo "  General audio file support (libsndfile)  . . . . .: $ac_libsndfile"
echo "  Ogg Vorbis audio file support (libvorbis)  . . . .: $ac_libvorbis"
echo "  MPEG-1 Audio Layer 3 file support (libmad) . . . .: $ac_libmad"
echo "  Sample-rate conversion support (libsamplerate) . .: $ac_libsamplerate"
echo "  Pitch-shifting support (librubberband) . . . . . .: $ac_librubberband"
echo "  OSC service support (liblo)  . . . . . . . . . . .: $ac_liblo"
echo "  Archive/Zip file support (zlib)  . . . . . . . . .: $ac_libz"
echo "  IEEE 32bit float optimizations . . . . . . . . . .: $ac_float32"
echo "  SSE optimization support (x86) . . . . . . . . . .: $ac_sse"
echo "  LADSPA plug-in support . . . . . . . . . . . . . .: $ac_ladspa"
echo "  DSSI plug-in support . . . . . . . . . . . . . . .: $ac_dssi"
echo "  VST plug-in support  . . . . . . . . . . . . . . .: $ac_vst"
echo "  LV2 plug-in support (liblilv)  . . . . . . . . . .: $ac_lv2"
echo "  LV2 plug-in UI support (libsuil) . . . . . . . . .: $ac_lv2_ui"
echo "  LV2 plug-in External UI support  . . . . . . . . .: $ac_lv2_external_ui"
echo "  LV2 plug-in MIDI/Event support . . . . . . . . . .: $ac_lv2_event"
echo "  LV2 plug-in MIDI/Atom support  . . . . . . . . . .: $ac_lv2_atom"
echo "  LV2 plug-in Worker/Schedule support  . . . . . . .: $ac_lv2_worker"
echo "  LV2 plug-in State support  . . . . . . . . . . . .: $ac_lv2_state"
echo "  LV2 plug-in State Files support  . . . . . . . . .: $ac_lv2_state_files"
echo "  LV2 plug-in Programs support . . . . . . . . . . .: $ac_lv2_programs"
echo "  LV2 plug-in Presets support  . . . . . . . . . . .: $ac_lv2_presets"
echo "  LV2 plug-in Time support . . . . . . . . . . . . .: $ac_lv2_time"
echo "  LV2 plug-in Time/position support  . . . . . . . .: $ac_lv2_time_position"
echo "  LV2 plug-in Options support  . . . . . . . . . . .: $ac_lv2_options"
echo "  LV2 plug-in Buf-size support . . . . . . . . . . .: $ac_lv2_buf_size"
echo "  LV2 plug-in UI Idle interface support  . . . . . .: $ac_lv2_ui_idle"
echo "  LV2 plug-in UI Show interface support  . . . . . .: $ac_lv2_ui_show"
echo
echo "  JACK Session support . . . . . . . . . . . . . . .: $ac_jack_session"
echo "  JACK Latency support . . . . . . . . . . . . . . .: $ac_jack_latency"
echo
echo "  Non Session Management (NSM) support . . . . . . .: $ac_nsm"
echo
echo "  X11 Unique/Single instance . . . . . . . . . . . .: $ac_xunique"
echo "  VeSTige header support . . . . . . . . . . . . . .: $ac_vestige"
echo "  Gradient eye-candy . . . . . . . . . . . . . . . .: $ac_gradient"
echo "  Debugger stack-trace (gdb) . . . . . . . . . . . .: $ac_stacktrace"
echo
echo "  Install prefix . . . . . . . . . . . . . . . . . .: $ac_prefix"
echo
echo "Now type 'make', followed by 'make install' as root."
echo