comparison acinclude.m4 @ 200:ec8b735f5418

Support for libNanoSID dropped.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 19 Aug 2004 19:06:02 +0000
parents 89844080b44b
children a66c634b222a
comparison
equal deleted inserted replaced
199:6117c326cc3e 200:ec8b735f5418
476 AC_SUBST(HARDSID_LDADD) 476 AC_SUBST(HARDSID_LDADD)
477 AC_LANG_POP(C++) 477 AC_LANG_POP(C++)
478 ]) 478 ])
479 479
480 480
481 dnl -------------------------------------------------------------------------
482 dnl Try to find NanoSID library and header files.
483 dnl $xs_have_nanosid will be "yes" or "no"
484 dnl @NANOSID_LDADD@ will be substituted with linker parameters
485 dnl @NANOSID_INCLUDES@ will be substituted with compiler parameters
486 dnl -------------------------------------------------------------------------
487
488 AC_DEFUN(XS_PATH_LIBNANOSID,
489 [
490 AC_MSG_CHECKING([for working NanoSID library and headers])
491
492 AC_LANG_PUSH(C)
493
494 # Use include path given by user (if any).
495 if test -n "$xs_nanosid_includes"; then
496 xs_nanosid_cflags="-I$xs_nanosid_includes"
497 else
498 xs_nanosid_cflags=""
499 fi
500
501 # Use library path given by user (if any).
502 if test -n "$xs_nanosid_library"; then
503 xs_nanosid_ldflags="-L$xs_nanosid_library"
504 else
505 xs_nanosid_ldflags=""
506 fi
507
508 AC_CACHE_VAL(xs_cv_have_nanosid,
509 [
510 # Run test compilation with either standard search path
511 # or user-defined paths.
512 MY_TRY_LIBNANOSID
513 if test "$xs_nanosid_works" = yes; then
514 xs_cv_have_nanosid="xs_have_nanosid=yes \
515 xs_nanosid_cflags=\"$xs_nanosid_cflags\" \
516 xs_nanosid_ldflags=\"$xs_nanosid_ldflags\" "
517 else
518 MY_FIND_LIBNANOSID
519 fi
520 ])
521
522 eval "$xs_cv_have_nanosid"
523
524 if test "$xs_have_nanosid" = yes; then
525 if test -n "$xs_nanosid_cflags" || test -n "$xs_nanosid_ldflags"; then
526 AC_MSG_RESULT([$xs_nanosid_cflags $xs_nanosid_ldflags])
527 else
528 AC_MSG_RESULT([yes])
529 fi
530
531 NANOSID_LDADD="$xs_nanosid_ldflags -lNanoSID -lm -lz"
532 NANOSID_INCLUDES="$xs_nanosid_cflags"
533 AC_SUBST(NANOSID_LDADD)
534 AC_SUBST(NANOSID_INCLUDES)
535 else
536 AC_MSG_RESULT([no])
537 fi
538
539 AC_LANG_POP(C)
540 ])
541
542 dnl Functions used by XS_PATH_LIBNANOSID.
543
544 AC_DEFUN(MY_FIND_LIBNANOSID,
545 [
546 # Search common locations where header files might be stored.
547 xs_nanosid_incdirs="$xs_nanosid_includes /usr/include /usr/local/include"
548 MY_FIND_FILE(libNanoSID.h, $xs_nanosid_incdirs, xs_nanosid_includes)
549
550 # Search common locations where library might be stored.
551 xs_nanosid_libdirs="$xs_nanosid_library /usr/lib /usr/local/lib"
552 MY_FIND_FILE(libNanoSID.a, $xs_nanosid_libdirs, xs_nanosid_library)
553
554 if test -z "$xs_nanosid_includes" || test -z "$xs_nanosid_library"; then
555 xs_cv_have_nanosid="xs_have_nanosid=no \
556 xs_nanosid_ldflags=\"\" xs_nanosid_cflags=\"\" "
557 else
558 # Test compilation with found paths.
559 xs_nanosid_ldflags="-L$xs_nanosid_library"
560 xs_nanosid_cflags="-I$xs_nanosid_includes"
561 MY_TRY_LIBNANOSID
562 xs_cv_have_nanosid="xs_have_nanosid=$xs_nanosid_works \
563 xs_nanosid_ldflags=\"$xs_nanosid_ldflags\" \
564 xs_nanosid_cflags=\"$xs_nanosid_cflags\" "
565 fi
566 ])
567
568 AC_DEFUN(MY_TRY_LIBNANOSID,
569 [
570 MY_TRY_LINK_SAVE
571
572 CFLAGS="$CFLAGS $xs_nanosid_cflags"
573 LDFLAGS="$LDFLAGS $xs_nanosid_ldflags"
574 LIBS="$LIBS -lNanoSID -lm -lz"
575
576 AC_LINK_IFELSE([AC_LANG_PROGRAM(
577 [[#include <libNanoSID.h>]],
578 [[libNanoSID_Init();libNanoSID_GetSamplingRate();libNanoSID_GetANewSIDChip();]])],
579 [xs_nanosid_works=yes],
580 [xs_nanosid_works=no]
581 )
582
583 MY_TRY_LINK_RESTORE
584 ])
585
586