summaryrefslogtreecommitdiff
path: root/muse2/configure.ac
blob: 7fa0536193c8df66f15fae053a9441ff393e4cfb (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
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
dnl --------------------------------------------------
dnl configure.ac for the MusE
dnl --------------------------------------------------

AC_INIT(MusE, 1.1)
AC_CONFIG_SRCDIR(muse/app.cpp)
AM_INIT_AUTOMAKE(1.1)
AM_CONFIG_HEADER(config.h)
### AM_MAINTAINER_MODE
AM_ACLOCAL_INCLUDE(m4)

dnl ***** Check for programs *****
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_PROG_LN_S

###############
### DocBook ###
###############
PGAC_PROG_JADE
if test -n "$JADE"; then
  PGAC_CHECK_DOCBOOK(4.1)
  if test "$pgac_cv_check_docbook" = "yes"; then
    PGAC_PATH_DOCBOOK_STYLESHEETS
    if test -n "$DOCBOOKSTYLE"; then
      DOCBOOKTARGETS="book1.html"
    else
      AC_MSG_WARN([DocBook stylesheets not found or not usable - documentation will not be built])
    fi
  else
    AC_MSG_WARN([DocBook 4.1 DTD not found or not usable - documentation will not be built])
  fi
else
  AC_MSG_WARN([jade not found - documentation will not be built])
fi
AC_SUBST(DOCBOOKTARGETS)

###############
### doxygen ###
###############
AC_ARG_VAR(DOXYGEN, Doxygen)
AC_PATH_PROG(DOXYGEN, doxygen, no)

################
### graphviz ###
################
AC_ARG_VAR(DOT, The "dot" program from graphviz)
AC_PATH_PROG(DOT, dot, no)
if test "$DOT" != "no"; then
  HAVEDOT=YES
  DOTPATH=$( dirname "$DOT" )
else
  HAVEDOT=NO
fi
AC_SUBST(HAVEDOT)
AC_SUBST(DOTPATH)

############
### perl ###
############
AC_ARG_VAR(PERL, Perl)
AC_PATH_PROG(PERL, perl, no)
if test "$PERL" == "no"; then
  AC_MSG_WARN([you don't have perl installed!  wierdo!  (and doxygen might not like this)])
fi

dnl ***** Check for libraries *****

#########
### X ###
#########
AC_PATH_XTRA
if test "$X_DISPLAY_MISSING" != ""; then
  AC_MSG_ERROR([X required])
fi



##########
### QT ###
##########
#CONFIGURE_QT(3.2.0, , AC_MSG_ERROR([need qt >= 3.2.0]))
#if test "$muse_qttest" = "yes"; then
#  AC_LANG_PUSH([C++])
#  muse_save_CFLAGS="$CFLAGS"
#  CFLAGS="$CFLAGS $QT_CFLAGS"
#  muse_save_CXXFLAGS="$CXXFLAGS"
#  CXXFLAGS="$CXXFLAGS $QT_CFLAGS"
#  muse_save_LDFLAGS="$LDFLAGS"
#  LDFLAGS="$LDFLAGS $QT_LIBS"
#  AC_CHECK_LIB(qt-mt, qt_selection_property, [
#    true
#  ],[
#    AC_MSG_ERROR([
#
#  MusE requires thread enabled QT (qt-mt) >= 3.2.0
#
#  You can either compile your own version of QT (making sure you enable
#  threading!) or install the appropriate package for your distribution.
#])
#  ])
#  CFLAGS="$muse_save_CFLAGS"
#  CXXFLAGS="$muse_save_CXXFLAGS"
#  LDFLAGS="$muse_save_LDFLAGS"
#  unset muse_save_CFLAGS
#  unset muse_save_CXXFLAGS
#  unset muse_save_LDFLAGS
#  AC_LANG_POP([C++])
#fi

QTDIR=/usr/share/qt4

AC_MSG_RESULT($QTDIR)
AC_PATH_XTRA
QT_LIBS="-Wl,-rpath,$QTDIR/lib -L$QTDIR/lib -lQtGui -lQtOpenGL -lQtCore -lQt3Support $X_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS -lGLU -lGL -lpthread"
QTDIR_INC="-I$QTDIR/include -I$QTDIR/include/QtGui -I$QTDIR/include/QtCore -I$QTDIR/include/Qt3Support $X_CFLAGS -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED"
QTDIR_BIN="$QTDIR/bin"


############
### ALSA ###
############
AM_PATH_ALSA(0.9.0,
  true,
  AC_MSG_ERROR([latest alsa (0.9.x) is required])
)

#################
### fluidsynth ###
#################
LIBFLUIDSYNTH=
muse_enable_fluidlib="yes"
synth_fluidsynth="fluidsynth"
synth_fluid="fluid"
AC_ARG_ENABLE(fluidsynth,[  --disable-fluidsynth    disable fluidsynth softsynth plugin],[
  case "$enableval" in
    "yes")
      synth_fluidsynth="fluidsynth"
      synth_fluid="fluid"
      ;;
    "no")
      muse_enable_fluidlib="no"
      synth_fluidsynth=""
      synth_fluid=""
      ;;
    *)
      AC_MSG_ERROR([must use --enable-fluidsynth(=yes/no) or --disable-fluidsynth])
      ;;
  esac
])

AM_CONDITIONAL(ENABLEFLUIDSYNTH, test "$muse_enable_fluidlib" = "yes")
PKG_CHECK_MODULES(Fluidsynth, fluidsynth,
  [FLUIDSYNTHDIRS="fluid fluidsynth"; AC_DEFINE(ENABLEFLUIDSYNTH, 1, [Compile fluidsynth])],
  [AC_MSG_WARN([libfluidsynth not found; disabling fluidsynth plugins]) ;
  muse_enable_fluidlib="no"]
  )
AC_SUBST(FLUIDSYNTHDIRS)
AC_SUBST(synth_fluidsynth)
AC_SUBST(synth_fluid)
if test "$muse_enable_fluidlib" = "no"; then
  synth_fluidsynth=""
  synth_fluid=""
fi


###############
### sndfile ###
###############
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.0,
  true,
  AC_MSG_ERROR([need libsndfile >= 1.0.0])
)

###############
### libsamplerate ###
###############
PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.1.0,
  true,
  AC_MSG_ERROR([need libsamplerate])
)

###############
### libuuid ###
###############
AC_CHECK_HEADER(uuid/uuid.h, UUID_FOUND="yes", UUID_FOUND="no")
if test x$UUID_FOUND = xno; then
  AC_MSG_ERROR([Header file uuid.h, from the uuid-dev (sometimes in e2fsprogs) package, is required])
fi

AC_CHECK_LIB(uuid, uuid_generate, UUID_FOUND="yes", UUID_FOUND="no")
if test x$UUID_FOUND = xno; then
  AC_MSG_ERROR([libuuid (sometimes in e2fsprogs package) is required])
fi
UUID_LIBS="-luuid"
AC_SUBST(UUID_CFLAGS)
AC_SUBST(UUID_LIBS)

## PKG_CHECK_MODULES(UUID, uuid >= 1.0,
##   true,
##   AC_MSG_ERROR([need libuuid >= 1.0 from e2fsprogs package])
## )

############
### JACK ###
############

PKG_CHECK_MODULES(JACK,
    jack >= 0.98.0,
    true,
    AC_MSG_ERROR([need JACK >= 0.98.0])
  )

##############
### LASH ###
##############
muse_enable_lash="no"
AC_ARG_ENABLE(lash,
  [  --enable-lash           enable LASH support],[
  case "$enableval" in
    "yes")
      muse_enable_lash="yes"
      ;;
    "no")
      muse_enable_lash="no"
      ;;
    *)
      AC_MSG_ERROR([must use --enable-lash(=yes/no) or --disable-lash])
      ;;
  esac
])

if test "$muse_enable_lash" = "yes"; then
  PKG_CHECK_MODULES(LASH, lash-1.0 >= 0.2, LASH_FOUND="yes", LASH_FOUND="no")
  AC_SUBST(LASH_CFLAGS)
  AC_SUBST(LASH_LIBS)

  if test "$LASH_FOUND" = "yes"; then
    AC_DEFINE(HAVE_LASH, 1, [whether or not we are supporting lash])
    LASH_VERSION=$( pkg-config --modversion lash-1.0 )
    AC_DEFINE_UNQUOTED(LASH_VERSION, "$LASH_VERSION", [The version of lash we're compiling against])
  fi
else
  AC_MSG_WARN([LASH support is disabled])
  LASH_FOUND="no"
fi
AM_CONDITIONAL(HAVE_LASH, test "$LASH_FOUND" = "yes")


dnl ***** Check for header files *****

dnl ***** Check for options *****

#################
### givertcap ###
#################

GIVERTCAP=
report_rtcap="no"
AC_ARG_ENABLE(rtcap,
  [  --enable-rtcap (deprecated) use Tommi Ilmonen's "givertcap" to give
                          realtime capabilities],[
  case "$enableval" in
    "yes")
      AC_DEFINE(RTCAP, 1, [Use givertcap])
      MUSECXXFLAGS="$MUSECXXFLAGS -DRTCAP"
      GIVERTCAP="givertcap"

      AC_CHECK_HEADER(sys/capability.h,
               report_rtcap="yes",
               AC_MSG_ERROR([Missing sys/capability.h]))
      ;;
    "no")
      ;;
    *)
      AC_MSG_ERROR([must use --enable-rtcap(=yes/no) or --disable-rtcap])
  esac
])
AM_CONDITIONAL(RTCAP, test "$report_rtcap" = "yes")
AC_SUBST(GIVERTCAP)


####################
### suid-install ###
####################

SUIDINSTALL="no"
AC_ARG_ENABLE(suid-install,
  [  --enable-suid-install (deprecated) install MusE setuid root (with kernel 2.6, use realtime-lsm instead)],[
  case "$enableval" in
    "yes")
      SUIDINSTALL="yes"
      ;;
    "no")
      ;;
    *)
      AC_MSG_ERROR([must use --enable-suid-install(=yes/no) or --disable-suid-install])
      ;;
  esac
])
AC_SUBST(SUIDINSTALL)

##################
### suid-build ###
##################
SUIDBUILD="no"
AC_ARG_ENABLE(suid-build,
  [  --enable-suid-build (deprecated) build MusE setuid root(with kernel 2.6, use realtime-lsm instead)],[
  case "$enableval" in
    "yes")
      SUIDBUILD="yes"
      ;;
    "no")
      SUIDBUILD="no"
      ;;
    *)
      AC_MSG_ERROR([must use --enable-suid-build(=yes/no) or --disable-suid-build])
      ;;
  esac
])
AC_SUBST(SUIDBUILD)


########################
### doxygen-treeview ###
########################
DOXYGEN_TREEVIEW="YES"
report_doxy_treeview="yes";
AC_ARG_ENABLE(doxy-treeview,
  [  --disable-doxy-treeview stop Doxygen from generating java-ified
                          treeview menus in its HTML output],[
  case "$enableval" in
    "yes")
      ;;
    "no")
      DOXYGEN_TREEVIEW="NO"
      report_doxy_treeview="no";
      ;;
    *)
      AC_MSG_ERROR([must use --enable-doxy-treeview(=yes/no) or --disable-doxy-treeview])
      ;;
  esac
])
AC_SUBST(DOXYGEN_TREEVIEW)

################
### patchbay ###
################
###PATCHBAY="no"
###AC_SUBST(PATCHBAY)
###AM_CONDITIONAL(PATCHBAY, test "$PATCHBAY" == "yes")

## -DQT_NO_CAST_ASCII
MUSECXXFLAGS="-g -fno-exceptions -Wall -W -D_GNU_SOURCE -D_REENTRANT \
  -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT \
  -I\$(top_srcdir) -I\$(top_srcdir)/muse/widgets \$(QT_CFLAGS)"

#MUSEOPTCXXFLAGS="-O6 -fomit-frame-pointer -ffast-math -fstrength-reduce \
#-funroll-loops"
#MUSEOPTCXXFLAGS="-O2"
MUSEOPTCXXFLAGS="-O3 -fomit-frame-pointer -ffast-math -fstrength-reduce -funroll-loops"

# -fmove-all-movables

################
### optimize ###
################
report_optimise="no"
AC_ARG_ENABLE(optimize,
  [  --enable-optimize       ask the compiler for its best optimizations (possibly only i386)],[
    case "$enableval" in
      "yes")
        report_optimise="yes"
        CXXFLAGS="$( echo "$CXXFLAGS" | sed "s/-O.[ ]*//" )"
        MUSECXXFLAGS="$MUSECXXFLAGS $MUSEOPTCXXFLAGS"
        ;;
      "no")
        ;;
      *)
        AC_MSG_ERROR([must use --enable-optimize(=yes/no) or --disable-optimize])
        ;;
    esac
  ])

#############
### debug ###
#############
report_debug="no"
AC_ARG_ENABLE(debug,
  [  --enable-debug          disable optimizations],[
    case "$enableval" in
      "yes")
        report_debug="yes"
        CXXFLAGS=""
        ;;
      "no")
        ;;
      *)
        AC_MSG_ERROR([must use --enable-debug(=yes/no) or --disable-debug])
        ;;
    esac
  ])

###########################
### PCH                 ###
### precompiled headers ###
###########################

AC_ARG_ENABLE(pch,
  [  --enable-pch            enable precompiled headers (gcc 3.4 required)],[
    case "$enableval" in
      "yes")
        MUSECXXFLAGS="$MUSECXXFLAGS -Winvalid-pch"
        PCH="yes"
        AC_SUBST(PCH)
        AC_DEFINE(PCH, 1, [whether or not we use precompiled headers])
        ;;
      "no")
        ;;
      *)
        AC_MSG_ERROR([must use --enable-pch(=yes/no) or --disable-pch])
        ;;
    esac
  ])
AM_CONDITIONAL(PCH, test "$PCH" = "yes")

############
### arch ###
############

report_march="none"
AC_ARG_ENABLE(arch,
[  --enable-arch=ARCH      use -march=ARCH and -mtune=ARCH argument to CXX
                          choose from any supported gcc architecture such as:  
                          386, 486, 586, 686, pentium, pentiumpro, k6, athlon...],[
    case "$enableval" in
      "no")
        ;;
      *)
        report_march="$enableval"
        MUSECXXFLAGS="$MUSECXXFLAGS -mtune=$enableval -march=$enableval"
        ;;
    esac
  ])

###########################
### SSE                 ###
### SSE optimizations   ###
###########################

report_sse="no"
AC_ARG_ENABLE(sse,
  [  --enable-sse            enable SSE optimizations],[
    case "$enableval" in
      "yes")
        ## MUSECXXFLAGS="$MUSECXXFLAGS -Winvalid-pch"
        report_sse="yes"
        USE_SSE="yes"
        AC_SUBST(USE_SSE)
        AC_DEFINE(USE_SSE, 1, [whether or not to enable SSE])
        ;;
      "no")
        ;;
      *)
        AC_MSG_ERROR([must use --enable-sse(=yes/no) or --disable-sse])
        ;;
    esac
  ])
AM_CONDITIONAL(USE_SSE, test "$USE_SSE" = "yes")

##########
# PYTHON #
##########
# python detection borrowed from libvirt (http://libvirt.org)
AC_ARG_WITH([python],
[  --enable-python              Build python bindings (on)],[],[enable_python=yes])

PYTHON_VERSION=
PYTHON_INCLUDES=
if test "$enable_python" != "no" ; then
    if test -x "$enable_python/bin/python"
    then
        AC_MSG_NOTICE(Found python in $enable_python/bin/python)
        PYTHON="$enable_python/bin/python"
        enable_python=yes
    else
        if test -x "$enable_python"
        then
            AC_MSG_NOTICE(Found python in $enable_python)
            PYTHON="$enable_python"
            enable_python=yes
        else
            if test -x "$PYTHON"
            then
                AC_MSG_NOTICE(Found python in environment PYTHON=$PYTHON)
                enable_python=yes
            fi
        fi
    fi

    if test "$enable_python" == "yes" ; then
        AM_PATH_PYTHON(,, [:])

        if test "$PYTHON" != : ; then
            PYTHON_CONFIG="$PYTHON-config"

            if test -x "$PYTHON_CONFIG"
            then
                PYTHON_INCLUDES=`$PYTHON_CONFIG --includes`
                PYTHON_LIB=`$PYTHON_CONFIG --libs`
            else
                if test -r $PYTHON_EXEC_PREFIX/include/python$PYTHON_VERSION/Python.h
                then
                    PYTHON_INCLUDES=-I$PYTHON_EXEC_PREFIX/include/python$PYTHON_VERSION
                else
                    if test -r $prefix/include/python$PYTHON_VERSION/Python.h
                    then
                        PYTHON_INCLUDES=-I$prefix/include/python$PYTHON_VERSION
                    else
                        if test -r /usr/include/python$PYTHON_VERSION/Python.h
                        then
                            PYTHON_INCLUDES=-I/usr/include/python$PYTHON_VERSION
                        else
                            AC_MSG_NOTICE([Could not find python$PYTHON_VERSION/Python.h, disabling bindings])
                            enable_python=no
                        fi
                    fi
                fi
            fi
        else
            AC_MSG_NOTICE([Could not find python interpreter, disabling bindings])
            enable_python=no
        fi
    else
        AC_MSG_NOTICE([Could not find python in $enable_python, disabling bindings])
        enable_python=no
    fi
fi
AM_CONDITIONAL(ENABLE_PYTHON, test "$enable_python" = "yes")
AC_SUBST([PYTHON_VERSION])
AC_SUBST([PYTHON_INCLUDES])
AC_SUBST([PYTHON_LIB])

#AC_ARG_ENABLE(python,
#enable_python="yes"
# [  --disable-python         disable python bindings for MusE],[
#   case "$enableval" in
#     "no")
#       enable_python="no"
#       ;;
#     *)
#       AC_MSG_ERROR([must use --enable-python(=yes/no) or --disable-python])
#       ;;
#   esac
# ])
#
#if test "$enable_python" = "yes"; then
#    AM_PATH_PYTHON
#    PYTHON_INCLUDE_DIR=""
#    if test -n "$PYTHON_INCLUDES" ; then
#        PYTHON_INCLUDE_DIR=$PYTHON_INCLUDES
#        python_bindings="yes"
#    else
#        python_bindings="no - devel pkg not found"
#    fi
#fi
#AM_CONDITIONAL(ENABLE_PYTHON, test "$python_bindings" = "yes")

###################
### vst plugins ###
###################

vst_possible=no
VST="no"
AC_ARG_ENABLE(vst,[  --enable-vst (deprecated, use dssi) build VST/win support. (disabled by default) ],
        [ if test x$enable_vst = xyes ; then
            vst_requested=yes;
        fi
        ]
)

if test x$vst_requested = xyes ; then
      PKG_CHECK_MODULES(FST,libfst, [ vst_possible=yes ], [ vst_possible=no ])
fi

if test x$vst_possible = xyes -a x$vst_requested = xyes ; then
      AC_MSG_CHECKING([support for VST/win plugins])
      VST_CFLAGS="$FST_CFLAGS"
      VST_LIBS="$FST_LIBS"
      VST="yes"
      AC_DEFINE(VST_SUPPORT, 1, [support for VST/win plugins])
fi

AM_CONDITIONAL(VST_SUPPORT, test x$vst_possible = xyes -a x$vst_requested = xyes)


###################
### OSC support ###
###################

osc_requested=no
LO_LIB_FOUND="no"
OSC="no"
AC_ARG_ENABLE(osc,[  --enable-osc            build OSC support. (disabled by default) 
                                             --enable-dssi is also recommended!      ],
        [ if test x$enable_osc = xyes ; then
            osc_requested=yes;
        fi
        ]
)

if test x$osc_requested = xyes ; then
      AC_MSG_CHECKING([support for OSC])
##      AC_CHECK_LIB(lo, lo_send, LO_LIB_FOUND="yes", LO_LIB_FOUND="no")
##      PKG_CHECK_MODULES(LO, lo >= 0.2, LO_LIB_FOUND="yes", LO_LIB_FOUND="no")
      PKG_CHECK_MODULES(LO,liblo, [ LO_LIB_FOUND=yes ], [ LO_LIB_FOUND=no ])
      if test x$LO_LIB_FOUND = xno; then
        AC_MSG_ERROR([Library liblo from The Lightweight OSC Implementation is required])
      fi
fi

if test x$LO_LIB_FOUND = xyes ; then
      LO_CFLAGS="$LO_CFLAGS"
      ##LO_LIBS="$LO_LIBS"
      LO_LIBS="-llo"
      OSC="yes"
      AC_SUBST(LO_CFLAGS)
      AC_SUBST(LO_LIBS)
      AC_DEFINE(OSC_SUPPORT, 1, [support for OSC])
fi

AM_CONDITIONAL(OSC_SUPPORT, test x$LO_LIB_FOUND = xyes)

## LO_LIBS="-llo"
## AC_SUBST(LO_CFLAGS)
## AC_SUBST(LO_LIBS)

## PKG_CHECK_MODULES(LO, lo >= 0.23,
##   true,
##   AC_MSG_ERROR([need liblo >= 0.23 ])
## )



###################
### dssi plugins ###
###################

dssi_requested=no
## LO_LIB_FOUND="no"
DSSI_H_FOUND="no"
DSSI="no"
AC_ARG_ENABLE(dssi,[  --enable-dssi           build DSSI + DSSI-Vst support. (disabled by default) 
                                              --enable-osc is also recommended!                   ],
        [ if test x$enable_dssi = xyes ; then
            dssi_requested=yes;
        fi
        ]
)


if test x$dssi_requested = xyes ; then
      AC_MSG_CHECKING([support for DSSI + DSSI-Vst plugins])
      ## AC_CHECK_LIB(lo, lo_send, LO_LIB_FOUND="yes", LO_LIB_FOUND="no")
      ## PKG_CHECK_MODULES(LO, lo >= 0.2, LO_LIB_FOUND="yes", LO_LIB_FOUND="no")
##      PKG_CHECK_MODULES(LO,liblo, [ LO_LIB_FOUND=yes ], [ LO_LIB_FOUND=no ])
##      if test x$LO_LIB_FOUND = xno; then
##        AC_MSG_ERROR([Library liblo from The Lightweight OSC Implementation is required])
##      fi
      
      AC_CHECK_HEADER(dssi.h, DSSI_FOUND="yes", DSSI_FOUND="no")
      ## PKG_CHECK_MODULES(DSSI [ DSSI_FOUND=yes ], [ DSSI_FOUND=no ])
      if test x$DSSI_FOUND = xno; then
      AC_MSG_ERROR([Header file dssi.h from DSSI (Disposable Soft Synth Interface) is required])
      fi
fi

## if test x$LO_LIB_FOUND = xyes -a x$DSSI_FOUND = xyes ; then
if test x$DSSI_FOUND = xyes ; then
##      LO_CFLAGS="$LO_CFLAGS"
      ##LO_LIBS="$LO_LIBS"
##      LO_LIBS="-llo"
      DSSI="yes"
##      AC_SUBST(LO_CFLAGS)
##      AC_SUBST(LO_LIBS)
      AC_DEFINE(DSSI_SUPPORT, 1, [support for DSSI + DSSI-Vst plugins])
fi

## AM_CONDITIONAL(DSSI_SUPPORT, test x$LO_LIB_FOUND = xyes -a x$DSSI_FOUND = xyes)
AM_CONDITIONAL(DSSI_SUPPORT, test x$DSSI_FOUND = xyes)

## LO_LIBS="-llo"
## AC_SUBST(LO_CFLAGS)
## AC_SUBST(LO_LIBS)

## PKG_CHECK_MODULES(LO, lo >= 0.23,
##   true,
##   AC_MSG_ERROR([need liblo >= 0.23 ])
## )




######################################


AC_DEFINE(HAVE_AUDIO, 1, [Make audio-specific code])
AM_CONDITIONAL(HAVE_AUDIO, test "yes" = "yes")
AC_SUBST(MUSECXXFLAGS)
AC_SUBST(QTDIR_INC)
AC_SUBST(QT_LIBS)
AC_SUBST(QTDIR_BIN)

if test -n "$GIVERTCAP"; then
      SUIDINSTALL="no"
      SUIDBUILD="no"
      fi


AC_OUTPUT([
Makefile
m4/Makefile
al/Makefile
doc/Makefile
xpm/Makefile
demos/Makefile
grepmidi/Makefile
packaging/Makefile
muse/Makefile
muse/widgets/Makefile
muse/master/Makefile
muse/midiedit/Makefile
muse/arranger/Makefile
muse/liste/Makefile
muse/driver/Makefile
muse/waveedit/Makefile
muse/ctrl/Makefile
muse/instruments/Makefile
muse/mixer/Makefile
muse/cliplist/Makefile
muse/marker/Makefile
muse/mplugins/Makefile
muse/remote/Makefile
share/Makefile
share/drummaps/Makefile
share/html/Makefile
share/locale/Makefile
share/wallpapers/Makefile
share/instruments/Makefile
share/plugins/Makefile
share/templates/Makefile
share/pybridge/Makefile
share/scripts/Makefile
synti/Makefile
synti/libsynti/Makefile
synti/fluidsynth/Makefile
synti/fluid/Makefile
synti/organ/Makefile
synti/s1/Makefile
synti/vam/Makefile
synti/deicsonze/Makefile
synti/simpledrums/Makefile
lib/Makefile
lib/synthi/Makefile
lib/plugins/Makefile
plugins/Makefile
plugins/freeverb/Makefile
plugins/pandelay/Makefile
plugins/doublechorus/Makefile
Doxyfile
utils/Makefile
])

######## Show a configuration report ########
if test -n "$JADE"; then
  jade_report="$JADE";
else
  jade_report="not present"
fi
AC_MSG_NOTICE([
  QTDIR 			 $QTDIR
  QTDIR_INC			 $QTDIR_INC
  QTDIR_BIN			 $QTDIR_BIN
  QT_LIBS			 $QT_LIBS

  MusE configured

  LASH support:                  $LASH_FOUND
  OSC support:                   $OSC
  DSSI support:                  $DSSI
  FluidSynth:                    $muse_enable_fluidlib

  jade:                          $jade_report
  doxygen:                       $DOXYGEN
  graphviz:                      $DOT
  perl:                          $PERL
  treeviews in doxygen
  html output:                   $report_doxy_treeview

  C++ compiler:                  $CXX
  optimizing:                    $report_optimise
  debug:                         $report_debug
  optimise for arch:             $report_march
  SSE optimizations              $report_sse
  python bindings:               $enable_python

  installation prefix:           $prefix

  Deprecated:
  ---------------------------------------------------
  using rtcap:                   $report_rtcap
  setuid root install:           $SUIDINSTALL
  setuid root build:             $SUIDBUILD
  VST/win support:               $VST

])