summaryrefslogtreecommitdiff
path: root/src/libFLAC/libFLAC.m4
diff options
context:
space:
mode:
authorJosh Coalson <jcoalson@users.sourceforce.net>2006-10-25 00:44:26 +0000
committerJosh Coalson <jcoalson@users.sourceforce.net>2006-10-25 00:44:26 +0000
commit03a6887cbe34b5afdcb35520229ce66bce119b00 (patch)
tree2ceb8136f859bdd921b390672c9941d3d9bc28d9 /src/libFLAC/libFLAC.m4
parent08b7d0cb4c82f8020e02aed8db6f9ac246d36f4d (diff)
downloadflac-03a6887cbe34b5afdcb35520229ce66bce119b00.tar.gz
add LIBFLAC_LIBDIR, make AC_TRY_RUN more robust
Diffstat (limited to 'src/libFLAC/libFLAC.m4')
-rw-r--r--src/libFLAC/libFLAC.m420
1 files changed, 15 insertions, 5 deletions
diff --git a/src/libFLAC/libFLAC.m4 b/src/libFLAC/libFLAC.m4
index 8f9ef741..e26d0a8b 100644
--- a/src/libFLAC/libFLAC.m4
+++ b/src/libFLAC/libFLAC.m4
@@ -2,7 +2,7 @@
# "Inspired" by ogg.m4
dnl AM_PATH_LIBFLAC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-dnl Test for libFLAC, and define LIBFLAC_CFLAGS and LIBFLAC_LIBS
+dnl Test for libFLAC, and define LIBFLAC_CFLAGS, LIBFLAC_LIBS, LIBFLAC_LIBDIR
dnl
AC_DEFUN([AM_PATH_LIBFLAC],
[dnl
@@ -14,14 +14,14 @@ AC_ARG_WITH(libFLAC-includes,[ --with-libFLAC-includes=DIR Directory where li
AC_ARG_ENABLE(libFLACtest, [ --disable-libFLACtest Do not try to compile and run a test libFLAC program],, enable_libFLACtest=yes)
if test "x$libFLAC_libraries" != "x" ; then
- LIBFLAC_LIBS="-L$libFLAC_libraries"
+ LIBFLAC_LIBDIR="$libFLAC_libraries"
elif test "x$libFLAC_prefix" != "x" ; then
- LIBFLAC_LIBS="-L$libFLAC_prefix/lib"
+ LIBFLAC_LIBDIR="$libFLAC_prefix/lib"
elif test "x$prefix" != "xNONE" ; then
- LIBFLAC_LIBS="-L$libdir"
+ LIBFLAC_LIBDIR="$libdir"
fi
- LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC -lm"
+ LIBFLAC_LIBS="-L$LIBFLAC_LIBDIR -lFLAC $OGG_LIBS -lm"
if test "x$libFLAC_includes" != "x" ; then
LIBFLAC_CFLAGS="-I$libFLAC_includes"
@@ -39,9 +39,11 @@ AC_ARG_ENABLE(libFLACtest, [ --disable-libFLACtest Do not try to compile
ac_save_CFLAGS="$CFLAGS"
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
+ ac_save_LDPATH="$LD_LIBRARY_PATH"
CFLAGS="$CFLAGS $LIBFLAC_CFLAGS"
CXXFLAGS="$CXXFLAGS $LIBFLAC_CFLAGS"
LIBS="$LIBS $LIBFLAC_LIBS"
+ LD_LIBRARY_PATH="$LIBFLAC_LIBDIR:$LD_LIBRARY_PATH"
dnl
dnl Now check if the installed libFLAC is sufficiently new.
dnl
@@ -60,7 +62,9 @@ int main ()
],, no_libFLAC=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
+ CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
+ LD_LIBRARY_PATH="$ac_save_LD_LIBRARY_PATH"
fi
if test "x$no_libFLAC" = "x" ; then
@@ -73,7 +77,9 @@ int main ()
else
echo "*** Could not run libFLAC test program, checking why..."
CFLAGS="$CFLAGS $LIBFLAC_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $LIBFLAC_CFLAGS"
LIBS="$LIBS $LIBFLAC_LIBS"
+ LD_LIBRARY_PATH="$LIBFLAC_LIBDIR:$LD_LIBRARY_PATH"
AC_TRY_LINK([
#include <stdio.h>
#include <FLAC/format.h>
@@ -92,13 +98,17 @@ int main ()
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" ])
CFLAGS="$ac_save_CFLAGS"
+ CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
+ LD_LIBRARY_PATH="$ac_save_LD_LIBRARY_PATH"
fi
LIBFLAC_CFLAGS=""
+ LIBFLAC_LIBDIR=""
LIBFLAC_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(LIBFLAC_CFLAGS)
+ AC_SUBST(LIBFLAC_LIBDIR)
AC_SUBST(LIBFLAC_LIBS)
rm -f conf.libFLACtest
])