Add log dump
[lash.git] / configure.ac
blob38113b958780b991d44bc362380f098abd246980
1 AC_INIT([LASH],[0.6.0])
2 AC_CONFIG_SRCDIR([lash/types.h])
3 AC_CONFIG_HEADER([config.h])
4 AM_INIT_AUTOMAKE
5 #AM_ACLOCAL_INCLUDE([m4])
8 ### Check for programs ###
9 AC_LANG([C])
10 AM_PROG_CC_C_O
11 AC_PROG_LIBTOOL
14 ######################
15 ### --enable-debug ###
16 ######################
18 lash_debug="no"
19 AC_MSG_CHECKING([whether to enable debugging output])
20 AC_ARG_ENABLE(debug,
21   [AS_HELP_STRING(--enable-debug, enable debugging output [default=no])],
22   [case "$enableval" in
23     "yes")
24       lash_debug="yes"
25       ;;
26     "no")
27       ;;
28     *)
29       AC_MSG_ERROR([must use --enable-debug(=yes/no) or --disable-debug])
30       ;;
31   esac]
33 if test "x$lash_debug" = "xyes"; then
34   AC_MSG_RESULT([yes])
35   AC_DEFINE(LASH_DEBUG, 1, [whether or not to enable debugging output])
36 else
37   AC_MSG_RESULT([no])
41 ########################
42 ### --enable-old-api ###
43 ########################
45 lash_old_api="yes"
46 AC_MSG_CHECKING([whether to enable the old API])
47 AC_ARG_ENABLE(old-api,
48   [AS_HELP_STRING(--enable-old-api, enable the old API [default=yes])],
49   [case "$enableval" in
50     "yes")
51       ;;
52     "no")
53       lash_old_api="no"
54       ;;
55     *)
56       AC_MSG_ERROR([must use --enable-old-api(=yes/no) or --disable-old-api])
57       ;;
58   esac]
60 if test "x$lash_old_api" = "xyes"; then
61   AC_MSG_RESULT([yes])
62 else
63   AC_MSG_RESULT([no])
67 ########################
68 ### --with-jack-dbus ###
69 ########################
71 lash_jack_dbus="yes"
72 AC_MSG_CHECKING([whether to use D-Bus for JACK communication])
73 AC_ARG_WITH(jack-dbus, [
74 AS_HELP_STRING(--with-jack-dbus, [use D-Bus for JACK communication [default=yes]])],
75   [case "x$withval" in
76     "xyes")
77       ;;
78     "xno")
79       lash_jack_dbus="no"
80       ;;
81     *)
82       AC_MSG_ERROR([must use --with-jack-dbus(=yes/no) or --without-jack-dbus])
83       ;;
84   esac]
86 if test "x$lash_jack_dbus" = "xyes"; then
87   AC_MSG_RESULT([yes])
88 else
89   AC_MSG_RESULT([no])
93 ###################
94 ### --with-alsa ###
95 ###################
97 lash_alsa=""
98 AC_MSG_CHECKING([whether to build with ALSA MIDI support])
99 AC_ARG_WITH(alsa,
100   [AS_HELP_STRING(--with-alsa, [build with ALSA MIDI support [default=auto]])],
101   [case "x$withval" in
102     "xyes")
103       lash_alsa="yes"
104       ;;
105     "xno")
106       lash_alsa="no"
107       ;;
108     *)
109       AC_MSG_ERROR([must use --with-alsa(=yes/no) or --without-alsa])
110       ;;
111   esac]
113 if test "x$lash_alsa" = "x"; then
114   AC_MSG_RESULT([auto])
115 elif test "x$lash_alsa" = "xyes"; then
116   AC_MSG_RESULT([yes])
117 else
118   AC_MSG_RESULT([no])
122 ###################
123 ### --with-gtk2 ###
124 ###################
126 lash_gtk2=""
127 AC_MSG_CHECKING([whether to build clients which require GTK+ 2])
128 AC_ARG_WITH(gtk2,
129   [AS_HELP_STRING(--with-gtk2, [build clients which require GTK+ 2 [default=auto]])],
130   [case "$withval" in
131     "yes")
132       lash_gtk2="yes"
133       ;;
134     "no")
135       lash_gtk2="no"
136       ;;
137     *)
138       AC_MSG_ERROR([must use --with-gtk2(=yes/no) or --without-gtk2])
139       ;;
140   esac]
142 if test "x$lash_gtk2" = "x"; then
143   AC_MSG_RESULT([auto])
144 elif test "x$lash_gtk2" = "xyes"; then
145   AC_MSG_RESULT([yes])
146 else
147   AC_MSG_RESULT([no])
151 #####################
152 ### --with-python ###
153 #####################
155 lash_python="yes"
156 AC_MSG_CHECKING([whether to build Python bindings])
157 AC_ARG_WITH(python,
158   [AS_HELP_STRING(--with-python, [build Python bindings [default=yes]])],
159   [case "x$withval" in
160     "xyes")
161       ;;
162     "xno")
163       lash_python="no"
164       ;;
165     *)
166       AC_MSG_ERROR([must use --with-python(=yes/no) or --without-python])
167       ;;
168   esac]
170 if test "x$lash_python" = "xyes"; then
171   AC_MSG_RESULT([yes])
172 else
173   AC_MSG_RESULT([no])
177 # Check for all required and selected dependencies. Report all missing
178 # packages in one go so that the user doesn't need to play hit-and-miss.
180 MISSING_REQUIRED=""
182 # 0.99.17 = first version with jack_client_open
183 HAVE_JACK="no"
184 PKG_CHECK_MODULES(JACK, jack >= 0.99.17, HAVE_JACK="yes", MISSING_REQUIRED="    JACK >= 0.99.17")
186 HAVE_DBUS="no"
187 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0.0, HAVE_DBUS="yes", [
188   if test "x$MISSING_REQUIRED" != "x"; then
189     MISSING_REQUIRED="$MISSING_REQUIRED
190     D-Bus >= 1.0.0"
191   else
192     MISSING_REQUIRED="    D-Bus >= 1.0.0"
193   fi
196 HAVE_UUID="no"
197 PKG_CHECK_MODULES(UUID, uuid, HAVE_UUID="pc",
198   [
199     AC_CHECK_HEADER(uuid/uuid.h,
200       [
201         AC_CHECK_LIB(uuid, uuid_generate, HAVE_UUID="lib", )
202       ],
203     )
204     if test "x$HAVE_UUID" = "xno"
205     then
206       if test "x$MISSING_REQUIRED" != "x"
207       then
208         MISSING_REQUIRED="$MISSING_REQUIRED
209         libuuid (from e2fsprogs)"
210       else
211         MISSING_REQUIRED="    libuuid (from e2fsprogs)"
212       fi
213     fi
214   ]
217 HAVE_XML2="no"
218 PKG_CHECK_MODULES(XML2, libxml-2.0 >= 2.0.0, HAVE_XML2="yes", [
219   if test "x$MISSING_REQUIRED" != "x"; then
220     MISSING_REQUIRED="$MISSING_REQUIRED
221     libxml2 >= 2.0.0"
222   else
223     MISSING_REQUIRED="    libxml2 >= 2.0.0"
224   fi
228 MISSING_OPTIONAL=""
230 HAVE_ALSA=""
231 if test "x$lash_alsa" != "xno"; then
232   PKG_CHECK_MODULES(ALSA, alsa >= 0.9, HAVE_ALSA="maybe", HAVE_ALSA="no")
234   if test "x$HAVE_ALSA" = "xmaybe"; then
235     # Check that there's seq functions in the library
236     ORIG_LIBS="$LIBS"
237     LIBS="$LIBS $ALSA_LIBS"
238     ORIG_CFLAGS="$CFLAGS"
239     CFLAGS="$CFLAGS $ALSA_CFLAGS"
241     AC_CHECK_FUNC(snd_seq_open, HAVE_ALSA="yes",
242       HAVE_ALSA="no"
243       AC_MSG_WARN([The ALSA library you're using doesn't have sequencer functions]))
245     LIBS="$ORIG_LIBS"
246     CFLAGS="$ORIG_CFLAGS"
247   fi
249   if test "x$lash_alsa" = "x"; then
250     if test "x$HAVE_ALSA" = "xyes"; then
251       lash_alsa="yes (auto-selected)"
252     else
253       lash_alsa="no (auto-selected)"
254     fi
255   elif test "x$HAVE_ALSA" = "xno"; then
256     MISSING_OPTIONAL="    ALSA >= 0.9"
257   fi
260 HAVE_GTK2=""
261 if test "x$lash_gtk2" != "xno"; then
262   PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.0, HAVE_GTK2="yes", HAVE_GTK2="no")
264   if test "x$lash_gtk2" = "x"; then
265     if test "x$HAVE_GTK2" = "xyes"; then
266       lash_gtk2="yes (auto-selected)"
267     else
268       lash_gtk2="no (auto-selected)"
269     fi
270   elif test "x$HAVE_GTK2" = "xno"; then
271     if test "x$MISSING_OPTIONAL" != "x"; then
272       MISSING_OPTIONAL="$MISSING_OPTIONAL
273     GTK+ >= 2.0.0"
274     else
275       MISSING_OPTIONAL="    GTK+ >= 2.0.0"
276     fi
277   fi
280 HAVE_PYTHON=""
281 if test "x$lash_python" = "xyes"; then
282   AM_PATH_PYTHON([2.3], [HAVE_PYTHON="yes"], [HAVE_PYTHON="no"])
283   if test "x$HAVE_PYTHON" = "xyes"; then
284     AM_CHECK_PYTHON_HEADERS(, [HAVE_PYTHON="no"])
285   fi
287   if test "x$HAVE_PYTHON" = "xno"; then
288     if test "x$MISSING_OPTIONAL" != "x"; then
289       MISSING_OPTIONAL="$MISSING_OPTIONAL
290     Python >= 2.3"
291     else
292       MISSING_OPTIONAL="    Python >= 2.3"
293     fi
294   fi
298 if test "x$MISSING_REQUIRED" != "x"; then
299     AC_MSG_RESULT([
300   The following required dependencies are missing from your system:
302 $MISSING_REQUIRED])
305 if test "x$MISSING_OPTIONAL" != "x"; then
306     AC_MSG_RESULT([
307   The following optionally selected dependencies are missing from your system:
309 $MISSING_OPTIONAL])
312 if test "x$MISSING_REQUIRED$MISSING_OPTIONAL" != "x"; then
313   AC_MSG_RESULT([
314   Please refer to these websites for further information:
317   if test "x$HAVE_JACK" = "xno"; then
318     AC_MSG_RESULT([    JACK:     http://jackaudio.org/])
319   fi
320   if test "x$HAVE_DBUS" = "xno"; then
321     AC_MSG_RESULT([    D-Bus:    http://dbus.freedesktop.org/])
322   fi
323   if test "x$HAVE_UUID" = "xno"; then
324     AC_MSG_RESULT([    libuuid:  http://e2fsprogs.sourceforge.net/])
325   fi
326   if test "x$HAVE_XML2" = "xno"; then
327     AC_MSG_RESULT([    libxml2:  http://xmlsoft.org/])
328   fi
329   if test "x$HAVE_ALSA" = "xno"; then
330     AC_MSG_RESULT([    ALSA:     http://alsa-project.org/])
331   fi
332   if test "x$HAVE_GTK2" = "xno"; then
333     AC_MSG_RESULT([    GTK+ 2:   http://gtk.org/])
334   fi
335   if test "x$HAVE_PYTHON" = "xno"; then
336     AC_MSG_RESULT([    Python:   http://www.python.org/])
337   fi
339   AC_MSG_RESULT([])
341   AC_MSG_ERROR([Missing packages])
345 ###############
346 ### Old API ###
347 ###############
349 if test "x$lash_old_api" = "xyes"; then
350   AC_DEFINE(LASH_OLD_API, 1, [whether or not to enable the old API])
352 AM_CONDITIONAL(LASH_OLD_API, [test "x$lash_old_api" = "xyes"])
354 ############
355 ### JACK ###
356 ############
358 JACK_VERSION=$(pkg-config --modversion jack)
359 AC_DEFINE_UNQUOTED(LASH_JACK_VERSION, "$JACK_VERSION", [The version of jack we're compiling against])
360 AM_CONDITIONAL(HAVE_JACK_DBUS, [test "x$lash_jack_dbus" = "xyes"])
361 if test "x$lash_jack_dbus" = "xyes"; then
362   AC_DEFINE(HAVE_JACK_DBUS, 1, [Whether to use D-Bus for JACK communication])
363 else
364   AC_SUBST(JACK_CFLAGS)
365   AC_SUBST(JACK_LIBS)
366   PC_REQUIRES="jack"
369 #############
370 ### D-Bus ###
371 #############
373 DBUS_VERSION=$(pkg-config --modversion dbus-1)
374 AC_SUBST(DBUS_CFLAGS)
375 AC_SUBST(DBUS_LIBS)
376 AC_DEFINE_UNQUOTED(LASH_DBUS_VERSION, "$DBUS_VERSION", [The version of D-Bus we're compiling against])
377 PC_REQUIRES="$PC_REQUIRES dbus-1"
379 AC_ARG_ENABLE(pkg-config-dbus-service-dir,
380   [  --enable-pkg-config-dbus-service-dir    force D-Bus service install dir to be one returned by pkg-config ],
381   DBUS_SERVICES_DIR_FORCE_REAL=$enableval , DBUS_SERVICES_DIR_FORCE_REAL=no ) 
383 DBUS_SERVICES_DIR_REAL=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1`
384 if test "x$DBUS_SERVICES_DIR_FORCE_REAL" = "xyes"
385 then
386   AC_MSG_WARN([overriding D-Bus service install dir])
387   DBUS_SERVICES_DIR="$DBUS_SERVICES_DIR_REAL"
388 else
389   AS_AC_EXPAND(DATADIR, $datadir)
390   DBUS_SERVICES_DIR="$DATADIR/dbus-1/services"
392 AC_SUBST(DBUS_SERVICES_DIR)
393 AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
395 ###############
396 ### libuuid ###
397 ###############
399 if test "x$HAVE_UUID" = "xpc"
400 then
401   UUID_VERSION=$(pkg-config --modversion uuid)
402   PC_REQUIRES="$PC_REQUIRES uuid"
403 else
404   UUID_VERSION="unknown"
405   UUID_CFLAGS=""
406   UUID_LIBS="-luuid"
408 AC_SUBST(UUID_CFLAGS)
409 AC_SUBST(UUID_LIBS)
410 AC_DEFINE_UNQUOTED(LASH_UUID_VERSION, "$UUID_VERSION", [The version of libuuid we're compiling against])
413 ###############
414 ### libxml2 ###
415 ###############
417 XML2_VERSION=$(pkg-config --modversion libxml-2.0)
418 AC_SUBST(XML2_CFLAGS)
419 AC_SUBST(XML2_LIBS)
420 AC_DEFINE_UNQUOTED(LASH_XML2_VERSION, "$XML2_VERSION", [The version of libxml2 we're compiling against])
421 PC_REQUIRES="$PC_REQUIRES libxml-2.0"
424 ############
425 ### ALSA ###
426 ############
428 if test "x$HAVE_ALSA" = "xyes"; then
429   ALSA_VERSION=$(pkg-config --modversion alsa)
430   AC_SUBST(ALSA_CFLAGS)
431   AC_SUBST(ALSA_LIBS)
432   AC_DEFINE(HAVE_ALSA, 1, [ALSA sequencer support])
433   AC_DEFINE_UNQUOTED(LASH_ALSA_VERSION, "$ALSA_VERSION", [The version of alsa we're compiling against])
434   PC_REQUIRES="$PC_REQUIRES alsa"
436 AM_CONDITIONAL(HAVE_ALSA, [test "x$HAVE_ALSA" = "xyes"])
439 ##############
440 ### GTK+ 2 ###
441 ##############
443 if test "x$HAVE_GTK2" = "xyes"; then
444   GTK2_VERSION=$(pkg-config --modversion gtk+-2.0)
445   AC_SUBST(GTK2_CFLAGS)
446   AC_SUBST(GTK2_LIBS)
447   AC_DEFINE(HAVE_GTK2, 1, [Whether or not GTK+ 2 support is enabled])
448   AC_DEFINE_UNQUOTED(LASH_GTK2_VERSION, "$GTK2_VERSION", [The version of GTK+ 2 we're compiling against])
450 AM_CONDITIONAL(HAVE_GTK2, [test "x$HAVE_GTK2" = "xyes"])
453 # Check for optionals
455 ################
456 ### Readline ###
457 ################
459 lash_readline="yes"
460 VL_LIB_READLINE
461 AC_SUBST(READLINE_LIBS)
463 AC_MSG_CHECKING([whether to enable readline])
464 if test "x$vl_cv_lib_readline" != "xno"; then
465   AC_MSG_RESULT([yes])
466   AC_DEFINE(HAVE_READLINE, 1, [whether readline library is available])
467 else
468   AC_MSG_RESULT([no])
469   lash_readline="no"
471 AM_CONDITIONAL(HAVE_READLINE, test "x$lash_readline" != "xno")
474 ################
475 ###  Python  ###
476 ################
478 AM_CONDITIONAL(BUILD_PYLASH, [test "x$HAVE_PYTHON" = "xyes"])
481 #################
482 ### texi2html ###
483 #################
485 AC_CHECK_PROG(lash_texi2html, texi2html, "yes", "no")
486 if test x$lash_texi2html = xyes; then
487   AC_MSG_NOTICE([texi2html found, building manual])
488 else
489   AC_MSG_WARN([texi2html not found, manual will not be built])
491 AM_CONDITIONAL(HAVE_TEXI2HTML, test x$lash_texi2html = xyes)
494 ##########################
495 ### --with-project-dir ###
496 ##########################
498 AC_MSG_CHECKING([where to store projects])
499 AC_ARG_WITH(project-dir,
500 [AS_HELP_STRING(--with-project-dir=DIR, [store projects in $HOME/DIR [default=audio-projects]])],[
501   if test x$withval = xno; then
502     AC_MSG_ERROR([use --with-project-dir=DIR, not --without-project-dir])
503   fi
504   DEFAULT_PROJECT_DIR="$withval";
506   DEFAULT_PROJECT_DIR="audio-projects";
508 AC_DEFINE_UNQUOTED(DEFAULT_PROJECT_DIR, "$DEFAULT_PROJECT_DIR", [Where to store projects])
509 AC_MSG_RESULT($DEFAULT_PROJECT_DIR)
512 ######################
513 ### default CFLAGS ###
514 ######################
516 LASH_CFLAGS=""
517 if test "x$lash_debug" = "xyes"; then
518   LASH_CFLAGS="-g"
520 AC_SUBST(LASH_CFLAGS)
521 AC_MSG_CHECKING(LASH_CFLAGS)
522 AC_MSG_RESULT($LASH_CFLAGS)
524 # For the manual
525 DATE="`date -u`"
526 AC_SUBST(DATE)
528 # For the Requires: line in the PC file
529 AC_SUBST(PC_REQUIRES)
530 AC_SUBST(PACKAGE_VERSION)
532 AC_CONFIG_FILES([Makefile])
533 AC_CONFIG_FILES([lash-1.0.pc])
534 AC_CONFIG_FILES([m4/Makefile])
535 AC_CONFIG_FILES([docs/lash-manual.texi])
536 AC_CONFIG_FILES([docs/Makefile])
537 AC_CONFIG_FILES([docs/lash-manual-html-one-page/Makefile])
538 AC_CONFIG_FILES([docs/lash-manual-html-split/Makefile])
539 AC_CONFIG_FILES([lash/Makefile])
540 AC_CONFIG_FILES([common/Makefile])
541 AC_CONFIG_FILES([dbus/Makefile])
542 AC_CONFIG_FILES([liblash/Makefile])
543 AC_CONFIG_FILES([lashd/Makefile])
544 AC_CONFIG_FILES([clients/Makefile])
545 AC_CONFIG_FILES([clients/simple_client/Makefile])
546 AC_CONFIG_FILES([clients/shell/Makefile])
547 AC_CONFIG_FILES([clients/synth/Makefile])
548 AC_CONFIG_FILES([clients/save_button/Makefile])
549 AC_CONFIG_FILES([clients/panel/Makefile])
550 AC_CONFIG_FILES([icons/Makefile])
551 AC_CONFIG_FILES([pylash/Makefile])
554 ### Print the results ###
556 AC_OUTPUT
558 if test "x$lash_readline" = "xno"; then
559   lash_readline="no (lash_shell will not be built)"
562 AC_MSG_RESULT([
563   LASH Configured
565   JACK D-Bus support:    $lash_jack_dbus
566   ALSA MIDI support:     $lash_alsa
567   GTK+ 2 clients:        $lash_gtk2
568   Readline support:      $lash_readline
569   Python bindings:       $lash_python
570   HTML manual:           $lash_texi2html
571   Debugging output:      $lash_debug
572   Support old API:       $lash_old_api
574   JACK version:          $JACK_VERSION
575   D-Bus version:         $DBUS_VERSION
576   libuuid version:       $UUID_VERSION
577   libxml2 version:       $XML2_VERSION])
579 if test x$HAVE_ALSA = xyes; then
580   AC_MSG_RESULT([  ALSA version:          $ALSA_VERSION])
583 if test x$HAVE_GTK2 = xyes; then
584   AC_MSG_RESULT([  GTK+ 2 version:        $GTK2_VERSION])
587 AC_MSG_RESULT([
588   CFLAGS:  $CFLAGS
590   JACK_CFLAGS:  $JACK_CFLAGS
591   DBUS_CFLAGS:  $DBUS_CFLAGS
592   UUID_CFLAGS:  $UUID_CFLAGS
593   XML2_CFLAGS:  $XML2_CFLAGS])
595 if test x$HAVE_ALSA = xyes; then
596   AC_MSG_RESULT([  ALSA_CFLAGS:  $ALSA_CFLAGS])
599 if test x$HAVE_GTK2 = xyes; then
600   AC_MSG_RESULT([  GTK2_CFLAGS:  $GTK2_CFLAGS])
603 AC_MSG_RESULT([
604   JACK_LIBS:    $JACK_LIBS
605   DBUS_LIBS:    $DBUS_LIBS
606   UUID_LIBS:    $UUID_LIBS
607   XML2_LIBS:    $XML2_LIBS])
609 if test x$HAVE_ALSA = xyes; then
610   AC_MSG_RESULT([  ALSA_LIBS:    $ALSA_LIBS])
613 if test x$HAVE_GTK2 = xyes; then
614   AC_MSG_RESULT([  GTK2_LIBS:    $GTK2_LIBS])
617 if test x$lash_readline = xyes; then
618   AC_MSG_RESULT([  READLINE_LIBS: $READLINE_LIBS])
621 AC_MSG_RESULT([
622   Default project store:     $DEFAULT_PROJECT_DIR
623   Installation prefix:       $prefix
624   D-Bus service install dir: $DBUS_SERVICES_DIR])
626 if test "x$DBUS_SERVICES_DIR_REAL" != "x$DBUS_SERVICES_DIR"
627 then
628         AC_MSG_WARN([D-Bus session services directory as reported by pkg-config is $DBUS_SERVICES_DIR_REAL])
629         AC_MSG_WARN([but service file will be installed in $DBUS_SERVICES_DIR])
630         AC_MSG_WARN([You may need to adjust your D-Bus configuration after installing jackdbus])
631         AC_MSG_WARN([You can override dbus service install dir])
632         AC_MSG_WARN([with --enable-pkg-config-dbus-service-dir option to this script])