1 dnl aclocal.m4 generated automatically by aclocal 1.3
3 dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
4 dnl This Makefile.in is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 dnl MY_DEFINE(VARIABLE)
15 [cat >> confdefs.h <<EOF
20 dnl CONFIG_INTERFACE(package,macro_name,interface_id,help
22 dnl action-if-yes-or-dynamic,
24 dnl action-if-yes,action-if-dynamic,action-if-no)
26 AC_DEFUN(CONFIG_INTERFACE,
27 [AC_ARG_ENABLE($1,[$4],
28 [case "x$enable_$1" in xyes|xdynamic) $5 ;; esac])
32 AM_CONDITIONAL(ENABLE_$2, true)
36 dynamic_targets="$dynamic_targets interface_$3.\$(so)"
47 dnl alsa.m4 starts form here
48 dnl Configure Paths for Alsa
49 dnl Christopher Lansdown (lansdoct@cs.alfred.edu)
51 dnl modified for TiMidity++ by Isaku Yamahata(yamahata@kusm.kyoto-u.ac.jp)
53 dnl AM_PATH_ALSA_LOCAL(MINIMUM-VERSION)
54 dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
55 dnl if there exit ALSA, define have_alsa=yes, otherwise no.
56 dnl enables arguments --with-alsa-prefix= --with-alsa-enc-prefix= --disable-alsatest
58 AC_DEFUN(AM_PATH_ALSA_LOCAL,
60 dnl Get the clfags and libraries for alsa
63 AC_ARG_WITH(alsa-prefix,[ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)],
64 [alsa_prefix="$withval"], [alsa_prefix=""])
65 AC_ARG_WITH(alsa-inc-prefix, [ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)],
66 [alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
67 AC_ARG_ENABLE(alsatest, [ --disable-alsatest Do not try to compile and run a test Alsa program], [enable_alsatest=no], [enable_alsatest=yes])
69 dnl Add any special include directories
70 AC_MSG_CHECKING(for ALSA CFLAGS)
71 if test "$alsa_inc_prefix" != "" ; then
72 ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
73 CFLAGS="$CFLAGS -I$alsa_inc_prefix"
75 AC_MSG_RESULT($ALSA_CFLAGS)
77 dnl add any special lib dirs
78 AC_MSG_CHECKING(for ALSA LDFLAGS)
79 if test "$alsa_prefix" != "" ; then
80 ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
84 dnl add the alsa library
85 ALSA_LIBS="$ALSA_LIBS -lasound"
86 AC_MSG_RESULT($ALSA_LIBS)
88 dnl Check for the presence of the library
89 dnl if test $enable_alsatest = yes; then
90 dnl AC_MSG_CHECKING(for working libasound)
92 dnl #include <sys/asoundlib.h>
99 dnl [AC_MSG_RESULT("present")],
100 dnl [AC_MSG_RESULT("not found. ")
101 dnl AC_MSG_ERROR(Fatal error: Install alsa-lib package or use --with-alsa-prefix option...)],
102 dnl [AC_MSG_RESULT(unsopported)
103 dnl AC_MSG_ERROR(Cross-compiling isn't supported...)]
107 dnl Check for a working version of libasound that is of the right version.
108 min_alsa_version=ifelse([$1], ,0.1.1,$1)
109 AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version)
111 alsa_min_major_version=`echo $min_alsa_version | \
112 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
113 alsa_min_minor_version=`echo $min_alsa_version | \
114 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
115 alsa_min_micro_version=`echo $min_alsa_version | \
116 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
119 #include <sys/asoundlib.h>
121 /* ensure backward compatibility */
122 #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
123 #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
125 #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
126 #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
128 #if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
129 #define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
132 # if(SND_LIB_MAJOR > $alsa_min_major_version)
135 # if(SND_LIB_MAJOR < $alsa_min_major_version)
139 # if(SND_LIB_MINOR > $alsa_min_minor_version)
142 # if(SND_LIB_MINOR < $alsa_min_minor_version)
146 # if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
153 [AC_MSG_RESULT(found.)
155 [AC_MSG_RESULT(not present.)]
158 dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
159 AC_CHECK_LIB([asound], [snd_cards],,
160 [AC_MSG_RESULT(No linkable libasound was found.)]
163 dnl That should be it. Now just export out symbols:
164 AC_SUBST(ALSA_CFLAGS)
167 dnl alsa.m4 ends here
170 dnl CHECK_DLSYM_UNDERSCORE([ACTION-IF-NEED [, ACTION IF-NOT-NEED]])
172 dnl CC CFLAGS CPPFLAGS LDFLAGS LIBS SHCFLAGS SHLD SHLDFLAGS
173 dnl ac_cv_header_dlfcn_h lib_dl_opt so
174 AC_DEFUN(CHECK_DLSYM_UNDERSCORE,
175 [dnl Check if dlsym need a leading underscore
176 AC_MSG_CHECKING(whether your dlsym() needs a leading underscore)
177 AC_CACHE_VAL(timidity_cv_func_dlsym_underscore,
178 [case "$ac_cv_header_dlfcn_h" in
179 yes) i_dlfcn=define;;
190 #include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
192 #include <sys/types.h>
206 int mode = RTLD_LAZY ;
208 handle = dlopen("./dyna.$so", mode) ;
209 if (handle == NULL) {
214 symbol = dlsym(handle, "fred") ;
215 if (symbol == NULL) {
216 /* try putting a leading underscore */
217 symbol = dlsym(handle, "_fred") ;
218 if (symbol == NULL) {
231 : Call the object file tmp-dyna.o in case dlext=o.
232 if ${CC-cc} $CFLAGS $SHCFLAGS $CPPFLAGS -c dyna.c > /dev/null 2>&1 &&
233 mv dyna.o tmp-dyna.o > /dev/null 2>&1 &&
234 $SHLD $SHLDFLAGS -o dyna.$so tmp-dyna.o > /dev/null 2>&1 &&
235 ${CC-cc} -o fred $CFLAGS $CPPFLAGS $LDFLAGS fred.c $LIBS $lib_dl_opt > /dev/null 2>&1; then
238 1) AC_MSG_WARN(Test program failed using dlopen. Perhaps you should not use dynamic loading.)
240 2) AC_MSG_WARN(Test program failed using dlsym. Perhaps you should not use dynamic loading.)
242 3) timidity_cv_func_dlsym_underscore=yes
244 4) timidity_cv_func_dlsym_underscore=no
248 AC_MSG_WARN(I can't compile and run the test program.)
250 rm -f dyna.c dyna.o dyna.$so tmp-dyna.o fred.c fred.o fred
252 case "x$timidity_cv_func_dlsym_underscore" in
263 dnl contains program from perl5
265 AC_DEFUN(CONTAINS_INIT,
266 [dnl Some greps do not return status, grrr.
267 AC_MSG_CHECKING(whether grep returns status)
268 echo "grimblepritz" >grimble
269 if grep blurfldyick grimble >/dev/null 2>&1 ; then
270 contains="./contains"
271 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
274 contains="./contains"
277 dnl the following should work in any shell
279 grep) AC_MSG_RESULT(yes)
282 AC_MSG_RESULT(AGH! Grep doesn't return a status. Attempting remedial action.)
283 cat >./contains <<'EOSS'
284 grep "[$]1" "[$]2" >.greptmp && cat .greptmp && test -s .greptmp
286 chmod +x "./contains"
292 dnl CONTAINS(word,filename,action-if-found,action-if-not-found)
294 [if $contains "^[$1]"'[$]' $2 >/dev/null 2>&1; then
302 dnl SET_UNIQ_WORDS(shell-variable,words...)
303 AC_DEFUN(SET_UNIQ_WORDS,
304 [rm -f wordtmp >/dev/null 2>&1
307 CONTAINS([$f],wordtmp,:,[echo $f >>wordtmp; val="$val $f"])
310 rm -f wordtmp >/dev/null 2>&1
313 # Define a conditional.
315 AC_DEFUN(AM_CONDITIONAL,
326 # Do all the work for Automake. This macro actually does too much --
327 # some checks are only needed if your package does certain things.
328 # But this isn't really a big deal.
333 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
335 AC_DEFUN(AM_INIT_AUTOMAKE,
336 [AC_REQUIRE([AM_PROG_INSTALL])
341 dnl test to see if srcdir already configured
342 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
343 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
346 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
347 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
348 AC_REQUIRE([AM_SANITY_CHECK])
349 AC_REQUIRE([AC_ARG_PROGRAM])
350 dnl FIXME This is truly gross.
351 missing_dir=`cd $ac_aux_dir && pwd`
352 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
353 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
354 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
355 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
356 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
357 AC_REQUIRE([AC_PROG_MAKE_SET])])
362 AC_DEFUN(AM_PROG_INSTALL,
363 [AC_REQUIRE([AC_PROG_INSTALL])
364 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
365 AC_SUBST(INSTALL_SCRIPT)dnl
369 # Check to make sure that the build environment is sane.
372 AC_DEFUN(AM_SANITY_CHECK,
373 [AC_MSG_CHECKING([whether build environment is sane])
376 echo timestamp > conftestfile
377 # Do `set' in a subshell so we don't clobber the current shell's
378 # arguments. Must try -L first in case configure is actually a
379 # symlink; some systems play weird games with the mod time of symlinks
380 # (eg FreeBSD returns the mod time of the symlink's containing
383 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
384 if test "[$]*" = "X"; then
386 set X `ls -t $srcdir/configure conftestfile`
388 if test "[$]*" != "X $srcdir/configure conftestfile" \
389 && test "[$]*" != "X conftestfile $srcdir/configure"; then
391 # If neither matched, then we have a broken ls. This can happen
392 # if, for instance, CONFIG_SHELL is bash and it inherits a
393 # broken ls alias from the environment. This has actually
394 # happened. Such a system could not be considered "sane".
395 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
396 alias in your environment])
399 test "[$]2" = conftestfile
405 AC_MSG_ERROR([newly created file is older than distributed files!
406 Check your system clock])
411 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
412 dnl The program must properly implement --version.
413 AC_DEFUN(AM_MISSING_PROG,
414 [AC_MSG_CHECKING(for working $2)
415 # Run test in a subshell; some versions of sh will print an error if
416 # an executable is not found, even if stderr is redirected.
417 # Redirect stdin to placate older versions of autoconf. Sigh.
418 if ($2 --version) < /dev/null > /dev/null 2>&1; then
423 AC_MSG_RESULT(missing)
427 # Like AC_CONFIG_HEADER, but automatically create stamp file.
429 AC_DEFUN(AM_CONFIG_HEADER,
431 AC_CONFIG_HEADER([$1])
432 dnl When config.status generates a header, we must update the stamp-h file.
433 dnl This file resides in the same directory as the config header
434 dnl that is generated. We must strip everything past the first ":",
435 dnl and everything past the last "/".
436 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
437 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
438 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
440 for am_file in <<$1>>; do
441 case " <<$>>CONFIG_HEADERS " in
442 *" <<$>>am_file "*<<)>>
443 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
446 am_indx=`expr "<<$>>am_indx" + 1`
453 AC_DEFUN(AM_PATH_LISPDIR,
454 [# If set to t, that means we are running in a shell under Emacs.
455 # If you have an Emacs named "t", then use the full path.
456 test "$EMACS" = t && EMACS=
457 AC_PATH_PROG(EMACS, emacs xemacs, no)
458 if test $EMACS != "no"; then
459 AC_MSG_CHECKING([where .elc files should go])
460 dnl Set default value
461 lispdir="\$(datadir)/emacs/site-lisp"
462 if test "x$prefix" = "xNONE"; then
463 if test -d $ac_default_prefix/share/emacs/site-lisp; then
464 lispdir="\$(prefix)/share/emacs/site-lisp"
466 if test -d $ac_default_prefix/lib/emacs/site-lisp; then
467 lispdir="\$(prefix)/lib/emacs/site-lisp"
471 if test -d $prefix/share/emacs/site-lisp; then
472 lispdir="\$(prefix)/share/emacs/site-lisp"
474 if test -d $prefix/lib/emacs/site-lisp; then
475 lispdir="\$(prefix)/lib/emacs/site-lisp"
479 AC_MSG_RESULT($lispdir)
483 # Configure paths for GTK+
484 # Owen Taylor 97-11-3
486 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
487 dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
489 AC_DEFUN(AM_PATH_GTK,
491 dnl Get the cflags and libraries from the gtk-config script
493 AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
494 gtk_config_prefix="$withval", gtk_config_prefix="")
495 AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
496 gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
497 AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
498 , enable_gtktest=yes)
500 if test x$gtk_config_exec_prefix != x ; then
501 gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
502 if test x${GTK_CONFIG+set} != xset ; then
503 GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
506 if test x$gtk_config_prefix != x ; then
507 gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
508 if test x${GTK_CONFIG+set} != xset ; then
509 GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
513 AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
514 min_gtk_version=ifelse([$1], ,0.99.7,$1)
515 AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
517 if test "$GTK_CONFIG" = "no" ; then
520 GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
521 GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
522 gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
523 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
524 gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
525 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
526 gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
527 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
528 if test "x$enable_gtktest" = "xyes" ; then
529 ac_save_CFLAGS="$CFLAGS"
531 CFLAGS="$CFLAGS $GTK_CFLAGS"
532 LIBS="$LIBS $GTK_LIBS"
534 dnl Now check if the installed GTK is sufficiently new. (Also sanity
535 dnl checks the results of gtk-config to some extent
545 int major, minor, micro;
548 system ("touch conf.gtktest");
550 /* HP/UX 9 (%@#!) writes to sscanf strings */
551 tmp_version = g_strdup("$min_gtk_version");
552 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
553 printf("%s, bad version string\n", "$min_gtk_version");
557 if ((gtk_major_version != $gtk_config_major_version) ||
558 (gtk_minor_version != $gtk_config_minor_version) ||
559 (gtk_micro_version != $gtk_config_micro_version))
561 printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
562 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
563 gtk_major_version, gtk_minor_version, gtk_micro_version);
564 printf ("*** was found! If gtk-config was correct, then it is best\n");
565 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
566 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
567 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
568 printf("*** required on your system.\n");
569 printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
570 printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
571 printf("*** before re-running configure\n");
575 if ((gtk_major_version > major) ||
576 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
577 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
583 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
584 gtk_major_version, gtk_minor_version, gtk_micro_version);
585 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
586 major, minor, micro);
587 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
589 printf("*** If you have already installed a sufficiently new version, this error\n");
590 printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
591 printf("*** being found. The easiest way to fix this is to remove the old version\n");
592 printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
593 printf("*** correct copy of gtk-config. (In this case, you will have to\n");
594 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
595 printf("*** so that the correct libraries are found at run-time))\n");
600 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
601 CFLAGS="$ac_save_CFLAGS"
605 if test "x$no_gtk" = x ; then
607 ifelse([$2], , :, [$2])
610 if test "$GTK_CONFIG" = "no" ; then
611 echo "*** The gtk-config script installed by GTK could not be found"
612 echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
613 echo "*** your path, or set the GTK_CONFIG environment variable to the"
614 echo "*** full path to gtk-config."
616 if test -f conf.gtktest ; then
619 echo "*** Could not run GTK test program, checking why..."
620 CFLAGS="$CFLAGS $GTK_CFLAGS"
621 LIBS="$LIBS $GTK_LIBS"
625 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
626 [ echo "*** The test program compiled, but did not run. This usually means"
627 echo "*** that the run-time linker is not finding GTK or finding the wrong"
628 echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
629 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
630 echo "*** to the installed location Also, make sure you have run ldconfig if that"
631 echo "*** is required on your system"
633 echo "*** If you have an old version installed, it is best to remove it, although"
634 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
636 echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
637 echo "*** came with the system with the command"
639 echo "*** rpm --erase --nodeps gtk gtk-devel" ],
640 [ echo "*** The test program failed to compile or link. See the file config.log for the"
641 echo "*** exact error that occured. This usually means GTK was incorrectly installed"
642 echo "*** or that you have moved GTK since it was installed. In the latter case, you"
643 echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
644 CFLAGS="$ac_save_CFLAGS"
650 ifelse([$3], , :, [$3])