libFLAC.m4
上传用户:wstnjxml
上传日期:2014-04-03
资源大小:7248k
文件大小:4k
源码类别:

Windows CE

开发平台:

C/C++

  1. # Configure paths for libFLAC
  2. # "Inspired" by ogg.m4
  3. dnl AM_PATH_LIBFLAC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  4. dnl Test for libFLAC, and define LIBFLAC_CFLAGS and LIBFLAC_LIBS
  5. dnl
  6. AC_DEFUN([AM_PATH_LIBFLAC],
  7. [dnl 
  8. dnl Get the cflags and libraries
  9. dnl
  10. AC_ARG_WITH(libFLAC,[  --with-libFLAC=PFX   Prefix where libFLAC is installed (optional)], libFLAC_prefix="$withval", libFLAC_prefix="")
  11. AC_ARG_WITH(libFLAC-libraries,[  --with-libFLAC-libraries=DIR   Directory where libFLAC library is installed (optional)], libFLAC_libraries="$withval", libFLAC_libraries="")
  12. AC_ARG_WITH(libFLAC-includes,[  --with-libFLAC-includes=DIR   Directory where libFLAC header files are installed (optional)], libFLAC_includes="$withval", libFLAC_includes="")
  13. AC_ARG_ENABLE(libFLACtest, [  --disable-libFLACtest       Do not try to compile and run a test libFLAC program],, enable_libFLACtest=yes)
  14.   if test "x$libFLAC_libraries" != "x" ; then
  15.     LIBFLAC_LIBS="-L$libFLAC_libraries"
  16.   elif test "x$libFLAC_prefix" != "x" ; then
  17.     LIBFLAC_LIBS="-L$libFLAC_prefix/lib"
  18.   elif test "x$prefix" != "xNONE" ; then
  19.     LIBFLAC_LIBS="-L$libdir"
  20.   fi
  21.   LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC -lm"
  22.   if test "x$libFLAC_includes" != "x" ; then
  23.     LIBFLAC_CFLAGS="-I$libFLAC_includes"
  24.   elif test "x$libFLAC_prefix" != "x" ; then
  25.     LIBFLAC_CFLAGS="-I$libFLAC_prefix/include"
  26.   elif test "$prefix" != "xNONE"; then
  27.     LIBFLAC_CFLAGS="-I$prefix/include"
  28.   fi
  29.   AC_MSG_CHECKING(for libFLAC)
  30.   no_libFLAC=""
  31.   if test "x$enable_libFLACtest" = "xyes" ; then
  32.     ac_save_CFLAGS="$CFLAGS"
  33.     ac_save_CXXFLAGS="$CXXFLAGS"
  34.     ac_save_LIBS="$LIBS"
  35.     CFLAGS="$CFLAGS $LIBFLAC_CFLAGS"
  36.     CXXFLAGS="$CXXFLAGS $LIBFLAC_CFLAGS"
  37.     LIBS="$LIBS $LIBFLAC_LIBS"
  38. dnl
  39. dnl Now check if the installed libFLAC is sufficiently new.
  40. dnl
  41.       rm -f conf.libFLACtest
  42.       AC_TRY_RUN([
  43. #include <stdio.h>
  44. #include <stdlib.h>
  45. #include <string.h>
  46. #include <FLAC/format.h>
  47. int main ()
  48. {
  49.   system("touch conf.libFLACtest");
  50.   return 0;
  51. }
  52. ],, no_libFLAC=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  53.        CFLAGS="$ac_save_CFLAGS"
  54.        LIBS="$ac_save_LIBS"
  55.   fi
  56.   if test "x$no_libFLAC" = "x" ; then
  57.      AC_MSG_RESULT(yes)
  58.      ifelse([$1], , :, [$1])     
  59.   else
  60.      AC_MSG_RESULT(no)
  61.      if test -f conf.libFLACtest ; then
  62.        :
  63.      else
  64.        echo "*** Could not run libFLAC test program, checking why..."
  65.        CFLAGS="$CFLAGS $LIBFLAC_CFLAGS"
  66.        LIBS="$LIBS $LIBFLAC_LIBS"
  67.        AC_TRY_LINK([
  68. #include <stdio.h>
  69. #include <FLAC/format.h>
  70. ],     [ return 0; ],
  71.        [ echo "*** The test program compiled, but did not run. This usually means"
  72.        echo "*** that the run-time linker is not finding libFLAC or finding the wrong"
  73.        echo "*** version of libFLAC. If it is not finding libFLAC, you'll need to set your"
  74.        echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
  75.        echo "*** to the installed location  Also, make sure you have run ldconfig if that"
  76.        echo "*** is required on your system"
  77.        echo "***"
  78.        echo "*** If you have an old version installed, it is best to remove it, although"
  79.        echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
  80.        [ echo "*** The test program failed to compile or link. See the file config.log for the"
  81.        echo "*** exact error that occured. This usually means libFLAC was incorrectly installed"
  82.        echo "*** or that you have moved libFLAC since it was installed. In the latter case, you"
  83.        echo "*** may want to edit the libFLAC-config script: $LIBFLAC_CONFIG" ])
  84.        CFLAGS="$ac_save_CFLAGS"
  85.        LIBS="$ac_save_LIBS"
  86.      fi
  87.      LIBFLAC_CFLAGS=""
  88.      LIBFLAC_LIBS=""
  89.      ifelse([$2], , :, [$2])
  90.   fi
  91.   AC_SUBST(LIBFLAC_CFLAGS)
  92.   AC_SUBST(LIBFLAC_LIBS)
  93.   rm -f conf.libFLACtest
  94. ])