libFLAC.m4 : Prevent empty -L flag.
authorErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 13 Feb 2012 08:39:55 +0000 (19:39 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 13 Feb 2012 08:39:55 +0000 (19:39 +1100)
Fix libFLAC.m4 may set empty -L flag when configure is called without
arguments, provided of course that the target package's configure script
is properly re-generated against the fixed libFLAC.m4

Patch from Fabian Greffrath <fabian+debian@greffrath.com> via Debian.

src/libFLAC/libFLAC.m4

index 24eb0c5..da7354e 100644 (file)
@@ -14,14 +14,18 @@ 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_LIBDIR="$libFLAC_libraries"
+    LIBFLAC_LIBS="-L$libFLAC_libraries"
+  elif test "x$libFLAC_prefix" = "xno" || test "x$libFLAC_prefix" = "xyes" ; then
+    LIBFLAC_LIBS=""
   elif test "x$libFLAC_prefix" != "x" ; then
-    LIBFLAC_LIBDIR="$libFLAC_prefix/lib"
-  elif test "x$prefix" != "xNONE" ; then
-    LIBFLAC_LIBDIR="$libdir"
+    LIBFLAC_LIBS="-L$libFLAC_prefix/lib"
+  elif test "x$prefix" != "xNONE"; then
+    LIBFLAC_LIBS="-L$prefix/lib"
   fi
 
-  LIBFLAC_LIBS="-L$LIBFLAC_LIBDIR -lFLAC $OGG_LIBS -lm"
+  if test "x$libFLAC_prefix" != "xno" ; then
+    LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC $OGG_LIBS -lm"
+  fi
 
   if test "x$libFLAC_includes" != "x" ; then
     LIBFLAC_CFLAGS="-I$libFLAC_includes"