changeset 36398:4eb02d8a5095

Fix configure for cases when libm is not available. This seems to be the case for e.g. Haiku. Admittedly supporting such different-for-no-good-reason setups is a bit questionable, but it's not much effort in this case.
author reimar
date Sat, 26 Oct 2013 21:30:17 +0000
parents 44750c937ec8
children 9855a1d4e745
files configure
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sat Oct 26 10:23:03 2013 +0000
+++ b/configure	Sat Oct 26 21:30:17 2013 +0000
@@ -58,9 +58,9 @@
   echo >> "$TMPLOG"
   cat "$source" >> "$TMPLOG"
   echo >> "$TMPLOG"
-  echo "$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o $TMPEXE $@ -lm" >> "$TMPLOG"
+  echo "$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o $TMPEXE $@ $libm" >> "$TMPLOG"
   rm -f "$TMPEXE"
-  $_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS "$source" $extra_cflags $ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o "$TMPEXE" "$@" -lm >> "$TMPLOG" 2>&1
+  $_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS "$source" $extra_cflags $ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o "$TMPEXE" "$@" $libm >> "$TMPLOG" 2>&1
   TMPRES="$?"
   echo >> "$TMPLOG"
   echo >> "$TMPLOG"
@@ -1798,6 +1798,8 @@
 cflag_check "" || die "Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
 echo "yes"
 
+cflag_check "-lm" && libm="-lm"
+
 if test -z "$_target" ; then
   cat > $TMPC << EOF
 int main(void) {
@@ -8048,7 +8050,7 @@
 fi
 echores "$_dvdnav"
 
-extra_ldflags="$extra_ldflags -lm"
+extra_ldflags="$extra_ldflags $libm"
 
 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
 # Read dvdnav comment above.
@@ -8508,7 +8510,7 @@
 AS_DEPFLAGS= $DEPFLAGS
 HOSTCC     = \$(HOST_CC)
 HOSTCFLAGS = $HOSTCFLAGS
-HOSTLIBS   = -lm
+HOSTLIBS   = $libm
 AS_O       = -o \$@
 CC_O       = -o \$@
 CXX_O      = -o \$@