acinclude.m4

branch
cpw.khc.msnp14
changeset 20472
6a6d2ef151e6
parent 14663
1eca0031fdf0
child 16267
82155fd55c27
equal deleted inserted replaced
13912:463b4fa9f067 20472:6a6d2ef151e6
409 AC_SUBST(GTK_CFLAGS) 409 AC_SUBST(GTK_CFLAGS)
410 AC_SUBST(GTK_LIBS) 410 AC_SUBST(GTK_LIBS)
411 rm -f conf.gtktest 411 rm -f conf.gtktest
412 ]) 412 ])
413 413
414 dnl This is XIPH_PATH_AO renamed to GAIM_PATH_AO to prevent conflicts.
415 dnl It's a long story. --elb
416
417 # ao.m4
418 # Configure paths for libao
419 # Jack Moffitt <jack@icecast.org> 10-21-2000
420 # Shamelessly stolen from Owen Taylor and Manish Singh
421
422 dnl GAIM_PATH_AO([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
423 dnl Test for libao, and define AO_CFLAGS and AO_LIBS
424 dnl
425 AC_DEFUN([GAIM_PATH_AO],
426 [dnl
427 dnl Get the cflags and libraries
428 dnl
429 AC_ARG_WITH(ao,[ --with-ao=PFX Prefix where libao is installed (optional)], ao_prefix="$withval", ao_prefix="")
430 AC_ARG_WITH(ao-libraries,[ --with-ao-libraries=DIR Directory where libao library is installed (optional)], ao_libraries="$withval", ao_libraries="")
431 AC_ARG_WITH(ao-includes,[ --with-ao-includes=DIR Directory where libao header files are installed (optional)], ao_includes="$withval", ao_includes="")
432 AC_ARG_ENABLE(aotest, [ --disable-aotest Do not try to compile and run a test ao program],, enable_aotest=yes)
433
434
435 if test "x$ao_libraries" != "x" ; then
436 AO_LIBS="-L$ao_libraries"
437 elif test "x$ao_prefix" != "x"; then
438 AO_LIBS="-L$ao_prefix/lib"
439 elif test "x$prefix" != "xNONE"; then
440 AO_LIBS="-L$prefix/lib"
441 fi
442
443 if test "x$ao_includes" != "x" ; then
444 AO_CFLAGS="-I$ao_includes"
445 elif test "x$ao_prefix" != "x"; then
446 AO_CFLAGS="-I$ao_prefix/include"
447 elif test "x$prefix" != "xNONE"; then
448 AO_CFLAGS="-I$prefix/include"
449 fi
450
451 # see where dl* and friends live
452 AC_CHECK_FUNCS(dlopen, [AO_DL_LIBS=""], [
453 AC_CHECK_LIB(dl, dlopen, [AO_DL_LIBS="-ldl"], [
454 AC_MSG_WARN([could not find dlopen() needed by libao sound drivers
455 your system may not be supported.])
456 ])
457 ])
458
459 AO_LIBS="$AO_LIBS -lao $AO_DL_LIBS"
460
461 AC_MSG_CHECKING(for ao)
462 no_ao=""
463
464
465 if test "x$enable_aotest" = "xyes" ; then
466 ac_save_CFLAGS="$CFLAGS"
467 ac_save_LIBS="$LIBS"
468 CFLAGS="$CFLAGS $AO_CFLAGS"
469 LIBS="$LIBS $AO_LIBS"
470 dnl
471 dnl Now check if the installed ao is sufficiently new.
472 dnl
473 rm -f conf.aotest
474 AC_TRY_RUN([
475 #include <stdio.h>
476 #include <stdlib.h>
477 #include <string.h>
478 #include <ao/ao.h>
479
480 int main ()
481 {
482 system("touch conf.aotest");
483 return 0;
484 }
485
486 ],, no_ao=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
487 CFLAGS="$ac_save_CFLAGS"
488 LIBS="$ac_save_LIBS"
489 fi
490
491 if test "x$no_ao" = "x" ; then
492 AC_MSG_RESULT(yes)
493 ifelse([$1], , :, [$1])
494 else
495 AC_MSG_RESULT(no)
496 if test -f conf.aotest ; then
497 :
498 else
499 echo "*** Could not run ao test program, checking why..."
500 CFLAGS="$CFLAGS $AO_CFLAGS"
501 LIBS="$LIBS $AO_LIBS"
502 AC_TRY_LINK([
503 #include <stdio.h>
504 #include <ao/ao.h>
505 ], [ return 0; ],
506 [ echo "*** The test program compiled, but did not run. This usually means"
507 echo "*** that the run-time linker is not finding ao or finding the wrong"
508 echo "*** version of ao. If it is not finding ao, you'll need to set your"
509 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
510 echo "*** to the installed location Also, make sure you have run ldconfig if that"
511 echo "*** is required on your system"
512 echo "***"
513 echo "*** If you have an old version installed, it is best to remove it, although"
514 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
515 [ echo "*** The test program failed to compile or link. See the file config.log for the"
516 echo "*** exact error that occurred. This usually means ao was incorrectly installed"
517 echo "*** or that you have moved ao since it was installed." ])
518 CFLAGS="$ac_save_CFLAGS"
519 LIBS="$ac_save_LIBS"
520 fi
521 AO_CFLAGS=""
522 AO_LIBS=""
523 ifelse([$2], , :, [$2])
524 fi
525 AC_SUBST(AO_CFLAGS)
526 AC_SUBST(AO_LIBS)
527 rm -f conf.aotest
528 ])
529
530 dnl audiofile.m4, included here for those people who don't have audiofile
531 dnl installed but would like to build CVS.
532
533 # Configure paths for the Audio File Library
534 # Bertrand Guiheneuf 98-10-21
535 # stolen from esd.m4 in esound :
536 # Manish Singh 98-9-30
537 # stolen back from Frank Belew
538 # stolen from Manish Singh
539 # Shamelessly stolen from Owen Taylor
540
541 dnl AM_PATH_AUDIOFILE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
542 dnl Test for Audio File Library, and define AUDIOFILE_CFLAGS and AUDIOFILE_LIBS.
543 dnl
544 AC_DEFUN([AM_PATH_AUDIOFILE],
545 [dnl
546 dnl Get compiler flags and libraries from the audiofile-config script.
547 dnl
548 AC_ARG_WITH(audiofile-prefix,[ --with-audiofile-prefix=PFX Prefix where Audio File Library is installed (optional)],
549 audiofile_prefix="$withval", audiofile_prefix="")
550 AC_ARG_WITH(audiofile-exec-prefix,[ --with-audiofile-exec-prefix=PFX Exec prefix where Audio File Library is installed (optional)],
551 audiofile_exec_prefix="$withval", audiofile_exec_prefix="")
552 AC_ARG_ENABLE(audiofiletest, [ --disable-audiofiletest Do not try to compile and run a test Audio File Library program], , enable_audiofiletest=yes)
553
554 if test x$audiofile_exec_prefix != x ; then
555 audiofile_args="$audiofile_args --exec-prefix=$audiofile_exec_prefix"
556 if test x${AUDIOFILE_CONFIG+set} != xset ; then
557 AUDIOFILE_CONFIG=$audiofile_exec_prefix/bin/audiofile-config
558 fi
559 fi
560 if test x$audiofile_prefix != x ; then
561 audiofile_args="$audiofile_args --prefix=$audiofile_prefix"
562 if test x${AUDIOFILE_CONFIG+set} != xset ; then
563 AUDIOFILE_CONFIG=$audiofile_prefix/bin/audiofile-config
564 fi
565 fi
566
567 AC_PATH_PROG(AUDIOFILE_CONFIG, audiofile-config, no)
568 min_audiofile_version=ifelse([$1], ,0.2.5,$1)
569 AC_MSG_CHECKING(for Audio File Library - version >= $min_audiofile_version)
570 no_audiofile=""
571 if test "$AUDIOFILE_CONFIG" = "no" ; then
572 no_audiofile=yes
573 else
574 AUDIOFILE_LIBS=`$AUDIOFILE_CONFIG $audiofileconf_args --libs`
575 AUDIOFILE_CFLAGS=`$AUDIOFILE_CONFIG $audiofileconf_args --cflags`
576 audiofile_major_version=`$AUDIOFILE_CONFIG $audiofile_args --version | \
577 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
578 audiofile_minor_version=`$AUDIOFILE_CONFIG $audiofile_args --version | \
579 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
580 audiofile_micro_version=`$AUDIOFILE_CONFIG $audiofile_config_args --version | \
581 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
582 if test "x$enable_audiofiletest" = "xyes" ; then
583 AC_LANG_SAVE
584 AC_LANG_C
585 ac_save_CFLAGS="$CFLAGS"
586 ac_save_LIBS="$LIBS"
587 CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS"
588 LIBS="$LIBS $AUDIOFILE_LIBS"
589 dnl
590 dnl Now check if the installed Audio File Library is sufficiently new.
591 dnl (Also checks the sanity of the results of audiofile-config to some extent.)
592 dnl
593 rm -f conf.audiofiletest
594 AC_TRY_RUN([
595 #include <stdio.h>
596 #include <stdlib.h>
597 #include <string.h>
598 #include <audiofile.h>
599
600 char*
601 my_strdup (char *str)
602 {
603 char *new_str;
604
605 if (str)
606 {
607 new_str = malloc ((strlen (str) + 1) * sizeof(char));
608 strcpy (new_str, str);
609 }
610 else
611 new_str = NULL;
612
613 return new_str;
614 }
615
616 int main ()
617 {
618 int major, minor, micro;
619 char *tmp_version;
620
621 system ("touch conf.audiofiletest");
622
623 /* HP/UX 9 (%@#!) writes to sscanf strings */
624 tmp_version = my_strdup("$min_audiofile_version");
625 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
626 printf("%s, bad version string\n", "$min_audiofile_version");
627 exit(1);
628 }
629
630 if (($audiofile_major_version > major) ||
631 (($audiofile_major_version == major) && ($audiofile_minor_version > minor)) ||
632 (($audiofile_major_version == major) && ($audiofile_minor_version == minor) && ($audiofile_micro_version >= micro)))
633 {
634 return 0;
635 }
636 else
637 {
638 printf("\n*** 'audiofile-config --version' returned %d.%d.%d, but the minimum version\n", $audiofile_major_version, $audiofile_minor_version, $audiofile_micro_version);
639 printf("*** of the Audio File Library required is %d.%d.%d. If audiofile-config is correct, then it is\n", major, minor, micro);
640 printf("*** best to upgrade to the required version.\n");
641 printf("*** If audiofile-config was wrong, set the environment variable AUDIOFILE_CONFIG\n");
642 printf("*** to point to the correct copy of audiofile-config, and remove the file\n");
643 printf("*** config.cache before re-running configure\n");
644 return 1;
645 }
646 }
647
648 ],, no_audiofile=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
649 CFLAGS="$ac_save_CFLAGS"
650 LIBS="$ac_save_LIBS"
651 AC_LANG_RESTORE
652 fi
653 fi
654 if test "x$no_audiofile" = x ; then
655 AC_MSG_RESULT(yes)
656 ifelse([$2], , :, [$2])
657 else
658 AC_MSG_RESULT(no)
659 if test "$AUDIOFILE_CONFIG" = "no" ; then
660 cat <<END
661 *** The audiofile-config script installed by the Audio File Library could
662 *** not be found. If the Audio File Library was installed in PREFIX, make
663 *** sure PREFIX/bin is in your path, or set the AUDIOFILE_CONFIG
664 *** environment variable to the full path to audiofile-config.
665 END
666 else
667 if test -f conf.audiofiletest ; then
668 :
669 else
670 echo "*** Could not run Audio File Library test program; checking why..."
671 AC_LANG_SAVE
672 AC_LANG_C
673 CFLAGS="$CFLAGS $AUDIOFILE_CFLAGS"
674 LIBS="$LIBS $AUDIOFILE_LIBS"
675 AC_TRY_LINK([
676 #include <stdio.h>
677 #include <audiofile.h>
678 ], [ return 0; ],
679 [ cat <<END
680 *** The test program compiled, but did not run. This usually means that
681 *** the run-time linker is not finding Audio File Library or finding the
682 *** wrong version of Audio File Library.
683 ***
684 *** If it is not finding Audio File Library, you'll need to set your
685 *** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
686 *** to the installed location. Also, make sure you have run ldconfig if
687 *** that is required on your system.
688 ***
689 *** If you have an old version installed, it is best to remove it, although
690 *** you may also be able to get things to work by modifying
691 *** LD_LIBRARY_PATH.
692 END
693 ],
694 [ echo "*** The test program failed to compile or link. See the file config.log"
695 echo "*** for the exact error that occurred. This usually means the Audio File"
696 echo "*** Library was incorrectly installed or that you have moved the Audio"
697 echo "*** File Library since it was installed. In the latter case, you may want"
698 echo "*** to edit the audiofile-config script: $AUDIOFILE_CONFIG" ])
699 CFLAGS="$ac_save_CFLAGS"
700 LIBS="$ac_save_LIBS"
701 AC_LANG_RESTORE
702 fi
703 fi
704 AUDIOFILE_CFLAGS=""
705 AUDIOFILE_LIBS=""
706 ifelse([$3], , :, [$3])
707 fi
708 AC_SUBST(AUDIOFILE_CFLAGS)
709 AC_SUBST(AUDIOFILE_LIBS)
710 rm -f conf.audiofiletest
711 ])
712
713 dnl ac_var_timeszone_externals.m4 414 dnl ac_var_timeszone_externals.m4
714 415
715 # Define 'timezone', 'altzone' and 'daylight' 416 # Define 'timezone', 'altzone' and 'daylight'
716 # http://www.gnu.org/software/ac-archive/Miscellaneous/ac_var_timezone_externals.html 417 # http://www.gnu.org/software/ac-archive/Miscellaneous/ac_var_timezone_externals.html
717 # Use instead of 'AC_STRUCT_TIMEZONE' to determine whether the 418 # Use instead of 'AC_STRUCT_TIMEZONE' to determine whether the
834 AC_DEFINE(ENABLE_BINRELOC,,[Use binary relocation?]) 535 AC_DEFINE(ENABLE_BINRELOC,,[Use binary relocation?])
835 fi 536 fi
836 AC_SUBST(BINRELOC_CFLAGS) 537 AC_SUBST(BINRELOC_CFLAGS)
837 AC_SUBST(BINRELOC_LIBS) 538 AC_SUBST(BINRELOC_LIBS)
838 ]) 539 ])
540 dnl AM_GCONF_SOURCE_2
541 dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
542 dnl (i.e. pass to gconftool-2
543 dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
544 dnl you should install foo.schemas files
545 dnl
546
547 AC_DEFUN([AM_GCONF_SOURCE_2],
548 [
549 if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
550 GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
551 else
552 GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
553 fi
554
555 AC_ARG_WITH(gconf-source,
556 [ --with-gconf-source=sourceaddress Config database for installing schema files.],GCONF_SCHEMA_CONFIG_SOURCE="$withval",)
557
558 AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
559 AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
560
561 if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
562 GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
563 fi
564
565 AC_ARG_WITH(gconf-schema-file-dir,
566 [ --with-gconf-schema-file-dir=dir Directory for installing schema files.],GCONF_SCHEMA_FILE_DIR="$withval",)
567
568 AC_SUBST(GCONF_SCHEMA_FILE_DIR)
569 AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
570
571 AC_ARG_ENABLE(schemas-install,
572 [ --disable-schemas-install Disable the schemas installation],
573 [case ${enableval} in
574 yes|no) ;;
575 *) AC_MSG_ERROR(bad value ${enableval} for --enable-schemas-install) ;;
576 esac])
577 AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
578 ])

mercurial