summaryrefslogtreecommitdiff
path: root/m4/libFLAC.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/libFLAC.m4')
-rw-r--r--m4/libFLAC.m426
1 files changed, 14 insertions, 12 deletions
diff --git a/m4/libFLAC.m4 b/m4/libFLAC.m4
index 26b4beba1..9ecf8dd51 100644
--- a/m4/libFLAC.m4
+++ b/m4/libFLAC.m4
@@ -8,10 +8,10 @@ AC_DEFUN([AM_PATH_LIBFLAC],
[dnl
dnl Get the cflags and libraries
dnl
-AC_ARG_WITH(libFLAC-prefix, AC_HELP_STRING([--with-libFLAC-prefix=DIR], [prefix where libFLAC is installed (optional)]), libFLAC_prefix="$withval", libFLAC_prefix="")
-AC_ARG_WITH(libFLAC-libraries, AC_HELP_STRING([--with-libFLAC-libraries=DIR], [directory where libFLAC library is installed (optional)]), libFLAC_libraries="$withval", libFLAC_libraries="")
-AC_ARG_WITH(libFLAC-includes, AC_HELP_STRING([--with-libFLAC-includes=DIR], [directory where libFLAC header files are installed (optional)]), libFLAC_includes="$withval", libFLAC_includes="")
-AC_ARG_ENABLE(libFLACtest, AC_HELP_STRING([--disable-libFLACtest], [do not try to compile and run a test libFLAC program]), enable_libFLACtest=$enableval, enable_libFLACtest=yes)
+AC_ARG_WITH(libFLAC-prefix, AS_HELP_STRING([--with-libFLAC-prefix=DIR], [prefix where libFLAC is installed (optional)]), libFLAC_prefix="$withval", libFLAC_prefix="")
+AC_ARG_WITH(libFLAC-libraries, AS_HELP_STRING([--with-libFLAC-libraries=DIR], [directory where libFLAC library is installed (optional)]), libFLAC_libraries="$withval", libFLAC_libraries="")
+AC_ARG_WITH(libFLAC-includes, AS_HELP_STRING([--with-libFLAC-includes=DIR], [directory where libFLAC header files are installed (optional)]), libFLAC_includes="$withval", libFLAC_includes="")
+AC_ARG_ENABLE(libFLACtest, AS_HELP_STRING([--disable-libFLACtest], [do not try to compile and run a test libFLAC program]), enable_libFLACtest=$enableval, enable_libFLACtest=yes)
if test "x$libFLAC_libraries" != "x" ; then
LIBFLAC_LIBS="-L$libFLAC_libraries"
@@ -46,7 +46,7 @@ dnl
dnl Now check if the installed libFLAC is sufficiently new.
dnl
rm -f conf.libFLACtest
- AC_TRY_RUN([
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -58,11 +58,13 @@ int main ()
return 0;
}
-],, no_libFLAC=yes,
- AC_TRY_LINK([
+]])],[],[no_libFLAC=yes],[no_libFLAC=cc])
+ if test "x$no_libFLAC" = xcc; then
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#include <FLAC/format.h>
-], [ return 0; ],, no_libFLAC=yes))
+]], [[ return 0; ]])],[no_libFLAC=''],[no_libFLAC=yes])
+ fi
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
@@ -78,11 +80,11 @@ int main ()
echo "*** Could not run libFLAC test program, checking why..."
CFLAGS="$CFLAGS $LIBFLAC_CFLAGS"
LIBS="$LIBS $LIBFLAC_LIBS"
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#include <FLAC/format.h>
-], [ return 0; ],
- [ echo "*** The test program compiled, but did not run. This usually means"
+]], [[ return 0; ]])],
+ [ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding libFLAC or finding the wrong"
echo "*** version of libFLAC. If it is not finding libFLAC, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
@@ -91,7 +93,7 @@ int main ()
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
+ [ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means libFLAC was incorrectly installed"
echo "*** or that you have moved libFLAC since it was installed. In the latter case, you"
echo "*** may want to edit the libFLAC-config script: $LIBFLAC_CONFIG" ])