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

Windows CE

开发平台:

C/C++

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