acinclude.m4
上传用户:tjmskj2
上传日期:2020-08-17
资源大小:577k
文件大小:3k
源码类别:

midi

开发平台:

C/C++

  1. dnl Some additional autoconf macros
  2. AC_DEFUN([AC_MIDISHARE],
  3. [
  4.   AC_ARG_ENABLE(midishare, AS_HELP_STRING([--enable-midishare],
  5.   [Compile MIDISHARE support (default=auto)]),
  6.      midishare=$enableval, midishare=yes)
  7.   MIDISHARE_SUPPORT=0 
  8.   if test "x$midishare" != "xno"; then
  9.     AC_CHECK_HEADERS(MidiShare.h)
  10.     if test "${ac_cv_header_MidiShare_h}" = "yes"; then
  11.        MIDISHARE_SUPPORT=1 
  12. midishare_found=yes
  13.   AC_CHECK_LIB([MidiShare], [MidiOpen],, [midishare_found=no])
  14.  
  15.   if test "x$midishare_found" = "xyes" ; then
  16.       MIDISHARE_SUPPORT=1
  17.       AC_DEFINE(MIDISHARE_SUPPORT, 1, [Define to enable MidiShare driver])
  18. fi
  19.  
  20.   if test "x$midishare_found" = "xno" ; then
  21.             AC_MSG_WARN([ *** Could not find the required MidiShare library])
  22.   fi dnl  midishare_found = yes test
  23.  
  24.      else
  25.          AC_MSG_WARN([ *** Could not find MidiShare.h, disabling MidiShare driver])
  26.      fi dnl  midishare.h header test
  27.    fi dnl  enable_midishare != no?
  28. ])
  29. AC_DEFUN([AC_OSS_AUDIO],
  30. [
  31.   AC_ARG_ENABLE(oss-support,
  32.     [  --disable-oss-support   Do not compile OSS support (default=auto)],
  33.     enable_oss_support=$enableval, enable_oss_support="yes")
  34.   OSS_SUPPORT=0
  35.   if test "x$enable_oss_support" != "xno"; then
  36.     AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/soundcard.h machine/soundcard.h)
  37.     if test "${ac_cv_header_fcntl_h}" = "yes" && 
  38.      test "${ac_cv_header_sys_ioctl_h}" = "yes"; then
  39.       if test "${ac_cv_header_sys_soundcard_h}" = "yes" || 
  40.        test "${ac_cv_header_machine_soundcard_h}" = "yes"; then
  41. OSS_SUPPORT=1
  42. AC_DEFINE(OSS_SUPPORT, 1, [Define to enable OSS driver])
  43.       else
  44.         AC_MSG_WARN([ *** Could not find soundcard.h, disabling OSS driver])
  45.       fi dnl  soundcard.h header test
  46.     else
  47.       AC_MSG_WARN([ *** Could not find fcntl.h and/or ioctl.h which are required for sound and midi support])
  48.     fi dnl  fcntl.h & ioctl.h header test
  49.   fi dnl  enable_oss_support != no?
  50. ])
  51. dnl Configure Paths for readline (Josh Green 2003-06-10)
  52. dnl
  53. dnl AM_PATH_READLINE([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  54. dnl Test for readline, and define READLINE_CFLAGS and
  55. dnl READLINE_LIBS as appropriate.
  56. dnl enables arguments --with-readline-prefix=
  57. AC_DEFUN([AM_PATH_READLINE],
  58. [dnl Save the original CFLAGS, and LIBS
  59. save_CFLAGS="$CFLAGS"
  60. save_LIBS="$LIBS"
  61. readline_found=yes
  62. dnl
  63. dnl Setup configure options
  64. dnl
  65. AC_ARG_WITH(readline-prefix,
  66.   [  --with-readline-prefix=PATH  Path where readline is (optional)],
  67.   [readline_prefix="$withval"], [readline_prefix=""])
  68. AC_MSG_CHECKING(for readline)
  69. dnl Add readline to the LIBS path
  70. READLINE_LIBS="-lreadline"
  71. if test "${readline_prefix}" != "" ; then
  72.   READLINE_LIBS="-L${readline_prefix}/lib $READLINE_LIBS"
  73.   READLINE_CFLAGS="-I${readline_prefix}/include"
  74. else
  75.   READLINE_CFLAGS=""
  76. fi
  77. LIBS="$READLINE_LIBS $LIBS"
  78. CFLAGS="$READLINE_CFLAGS $CFLAGS"
  79. AC_TRY_COMPILE([
  80. #include <stdio.h>
  81. #include <readline/readline.h>
  82. ], [
  83. #ifndef readline
  84.    return (1);
  85. #else
  86.    return (0);
  87. #endif
  88. ],
  89.   [AC_MSG_RESULT(found.)],
  90.   [AC_MSG_RESULT(not present.)
  91.    readline_found=no]
  92. )
  93. CFLAGS="$save_CFLAGS"
  94. LIBS="$save_LIBS"
  95. if test "x$readline_found" = "xyes" ; then
  96.    ifelse([$1], , :, [$1])
  97. else
  98.    READLINE_CFLAGS=""
  99.    READLINE_LIBS=""
  100.    ifelse([$2], , :, [$2])
  101. fi
  102. dnl That should be it.  Now just export out symbols:
  103. AC_SUBST(READLINE_CFLAGS)
  104. AC_SUBST(READLINE_LIBS)
  105. ])