1 AC_INIT([LASH],[0.6.0])
2 AC_CONFIG_SRCDIR([lash/types.h])
3 AC_CONFIG_HEADER([config.h])
5 #AM_ACLOCAL_INCLUDE([m4])
8 ### Check for programs ###
14 ######################
15 ### --enable-debug ###
16 ######################
19 AC_MSG_CHECKING([whether to enable debugging output])
21 [AS_HELP_STRING(--enable-debug, enable debugging output [default=no])],
29 AC_MSG_ERROR([must use --enable-debug(=yes/no) or --disable-debug])
33 if test "x$lash_debug" = "xyes"; then
35 AC_DEFINE(LASH_DEBUG, 1, [whether or not to enable debugging output])
41 ########################
42 ### --enable-old-api ###
43 ########################
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=no])],
56 AC_MSG_ERROR([must use --enable-old-api(=yes/no) or --disable-old-api])
60 if test "x$lash_old_api" = "xyes"; then
67 ########################
68 ### --with-jack-dbus ###
69 ########################
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]])],
82 AC_MSG_ERROR([must use --with-jack-dbus(=yes/no) or --without-jack-dbus])
86 if test "x$lash_jack_dbus" = "xyes"; then
98 AC_MSG_CHECKING([whether to build with ALSA MIDI support])
100 [AS_HELP_STRING(--with-alsa, [build with ALSA MIDI support [default=auto]])],
109 AC_MSG_ERROR([must use --with-alsa(=yes/no) or --without-alsa])
113 if test "x$lash_alsa" = "x"; then
114 AC_MSG_RESULT([auto])
115 elif test "x$lash_alsa" = "xyes"; then
127 AC_MSG_CHECKING([whether to build clients which require GTK+ 2])
129 [AS_HELP_STRING(--with-gtk2, [build clients which require GTK+ 2 [default=auto]])],
138 AC_MSG_ERROR([must use --with-gtk2(=yes/no) or --without-gtk2])
142 if test "x$lash_gtk2" = "x"; then
143 AC_MSG_RESULT([auto])
144 elif test "x$lash_gtk2" = "xyes"; then
151 #####################
152 ### --with-python ###
153 #####################
156 AC_MSG_CHECKING([whether to build Python bindings])
158 [AS_HELP_STRING(--with-python, [build Python bindings [default=yes]])],
166 AC_MSG_ERROR([must use --with-python(=yes/no) or --without-python])
170 if test "x$lash_python" = "xyes"; then
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.
182 # 0.99.17 = first version with jack_client_open
184 PKG_CHECK_MODULES(JACK, jack >= 0.99.17, HAVE_JACK="yes", MISSING_REQUIRED=" JACK >= 0.99.17")
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
192 MISSING_REQUIRED=" D-Bus >= 1.0.0"
197 PKG_CHECK_MODULES(UUID, uuid, HAVE_UUID="pc",
199 AC_CHECK_HEADER(uuid/uuid.h,
201 AC_CHECK_LIB(uuid, uuid_generate, HAVE_UUID="lib", )
204 if test "x$HAVE_UUID" = "xno"
206 if test "x$MISSING_REQUIRED" != "x"
208 MISSING_REQUIRED="$MISSING_REQUIRED
209 libuuid (from e2fsprogs)"
211 MISSING_REQUIRED=" libuuid (from e2fsprogs)"
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
223 MISSING_REQUIRED=" libxml2 >= 2.0.0"
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
237 LIBS="$LIBS $ALSA_LIBS"
238 ORIG_CFLAGS="$CFLAGS"
239 CFLAGS="$CFLAGS $ALSA_CFLAGS"
241 AC_CHECK_FUNC(snd_seq_open, HAVE_ALSA="yes",
243 AC_MSG_WARN([The ALSA library you're using doesn't have sequencer functions]))
246 CFLAGS="$ORIG_CFLAGS"
249 if test "x$lash_alsa" = "x"; then
250 if test "x$HAVE_ALSA" = "xyes"; then
251 lash_alsa="yes (auto-selected)"
253 lash_alsa="no (auto-selected)"
255 elif test "x$HAVE_ALSA" = "xno"; then
256 MISSING_OPTIONAL=" ALSA >= 0.9"
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)"
268 lash_gtk2="no (auto-selected)"
270 elif test "x$HAVE_GTK2" = "xno"; then
271 if test "x$MISSING_OPTIONAL" != "x"; then
272 MISSING_OPTIONAL="$MISSING_OPTIONAL
275 MISSING_OPTIONAL=" GTK+ >= 2.0.0"
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"])
287 if test "x$HAVE_PYTHON" = "xno"; then
288 if test "x$MISSING_OPTIONAL" != "x"; then
289 MISSING_OPTIONAL="$MISSING_OPTIONAL
292 MISSING_OPTIONAL=" Python >= 2.3"
298 if test "x$MISSING_REQUIRED" != "x"; then
300 The following required dependencies are missing from your system:
305 if test "x$MISSING_OPTIONAL" != "x"; then
307 The following optionally selected dependencies are missing from your system:
312 if test "x$MISSING_REQUIRED$MISSING_OPTIONAL" != "x"; then
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/])
320 if test "x$HAVE_DBUS" = "xno"; then
321 AC_MSG_RESULT([ D-Bus: http://dbus.freedesktop.org/])
323 if test "x$HAVE_UUID" = "xno"; then
324 AC_MSG_RESULT([ libuuid: http://e2fsprogs.sourceforge.net/])
326 if test "x$HAVE_XML2" = "xno"; then
327 AC_MSG_RESULT([ libxml2: http://xmlsoft.org/])
329 if test "x$HAVE_ALSA" = "xno"; then
330 AC_MSG_RESULT([ ALSA: http://alsa-project.org/])
332 if test "x$HAVE_GTK2" = "xno"; then
333 AC_MSG_RESULT([ GTK+ 2: http://gtk.org/])
335 if test "x$HAVE_PYTHON" = "xno"; then
336 AC_MSG_RESULT([ Python: http://www.python.org/])
341 AC_MSG_ERROR([Missing packages])
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"])
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])
364 AC_SUBST(JACK_CFLAGS)
373 DBUS_VERSION=$(pkg-config --modversion dbus-1)
374 AC_SUBST(DBUS_CFLAGS)
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"
386 AC_MSG_WARN([overriding D-Bus service install dir])
387 DBUS_SERVICES_DIR="$DBUS_SERVICES_DIR_REAL"
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])
399 if test "x$HAVE_UUID" = "xpc"
401 UUID_VERSION=$(pkg-config --modversion uuid)
402 PC_REQUIRES="$PC_REQUIRES uuid"
404 UUID_VERSION="unknown"
408 AC_SUBST(UUID_CFLAGS)
410 AC_DEFINE_UNQUOTED(LASH_UUID_VERSION, "$UUID_VERSION", [The version of libuuid we're compiling against])
417 XML2_VERSION=$(pkg-config --modversion libxml-2.0)
418 AC_SUBST(XML2_CFLAGS)
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"
428 if test "x$HAVE_ALSA" = "xyes"; then
429 ALSA_VERSION=$(pkg-config --modversion alsa)
430 AC_SUBST(ALSA_CFLAGS)
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"])
443 if test "x$HAVE_GTK2" = "xyes"; then
444 GTK2_VERSION=$(pkg-config --modversion gtk+-2.0)
445 AC_SUBST(GTK2_CFLAGS)
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
461 AC_SUBST(READLINE_LIBS)
463 AC_MSG_CHECKING([whether to enable readline])
464 if test "x$vl_cv_lib_readline" != "xno"; then
466 AC_DEFINE(HAVE_READLINE, 1, [whether readline library is available])
471 AM_CONDITIONAL(HAVE_READLINE, test "x$lash_readline" != "xno")
478 AM_CONDITIONAL(BUILD_PYLASH, [test "x$HAVE_PYTHON" = "xyes"])
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])
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])
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 ######################
517 if test "x$lash_debug" = "xyes"; then
520 AC_SUBST(LASH_CFLAGS)
521 AC_MSG_CHECKING(LASH_CFLAGS)
522 AC_MSG_RESULT($LASH_CFLAGS)
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 ###
558 if test "x$lash_readline" = "xno"; then
559 lash_readline="no (lash_shell will not be built)"
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])
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])
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])
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"
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])