mirror of
https://github.com/transmission/transmission
synced 2024-12-23 08:13:27 +00:00
Adds a real test for lrintf because some Linux systems, like BeOS, seem
to provide a non-working lrintf implementation (Patch from Henner Sudek, modified)
This commit is contained in:
parent
ee1428db43
commit
dfaa09ce40
2 changed files with 43 additions and 6 deletions
45
configure
vendored
45
configure
vendored
|
@ -45,6 +45,37 @@ EOF
|
|||
rm -f testconf.c testconf
|
||||
}
|
||||
|
||||
lm_test()
|
||||
{
|
||||
cat > testconf.c << EOF
|
||||
int main()
|
||||
{
|
||||
sqrt( 42 );
|
||||
}
|
||||
EOF
|
||||
if ! $CC -o testconf testconf.c > /dev/null 2>&1
|
||||
then
|
||||
if $CC -o testconf testconf.c -lm > /dev/null 2>&1
|
||||
then
|
||||
LINKLIBS="$LINKLIBS -lm"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
lrintf_test()
|
||||
{
|
||||
cat > testconf.c << EOF
|
||||
int main()
|
||||
{
|
||||
return ( lrintf( 3.14 ) != 3 );
|
||||
}
|
||||
EOF
|
||||
if ( $CC -o testconf testconf.c $LINKLIBS && ./testconf ) > /dev/null 2>&1
|
||||
then
|
||||
DEFINES="$DEFINES HAVE_LRINTF"
|
||||
fi
|
||||
}
|
||||
|
||||
gettext_test()
|
||||
{
|
||||
cat > testconf.c <<EOF
|
||||
|
@ -222,7 +253,7 @@ case $SYSTEM in
|
|||
|
||||
FreeBSD)
|
||||
DEFINES="$DEFINES SYS_FREEBSD"
|
||||
LINKLIBS="$LINKLIBS -pthread -lm"
|
||||
LINKLIBS="$LINKLIBS -pthread"
|
||||
|
||||
RELEASE=`uname -r`
|
||||
case $RELEASE in
|
||||
|
@ -234,17 +265,17 @@ case $SYSTEM in
|
|||
|
||||
NetBSD)
|
||||
DEFINES="$DEFINES SYS_NETBSD"
|
||||
LINKLIBS="$LINKLIBS -lpthread -lm"
|
||||
LINKLIBS="$LINKLIBS -lpthread"
|
||||
;;
|
||||
|
||||
OpenBSD)
|
||||
DEFINES="$DEFINES SYS_OPENBSD"
|
||||
LINKLIBS="$LINKLIBS -lpthread -lm"
|
||||
LINKLIBS="$LINKLIBS -lpthread"
|
||||
;;
|
||||
|
||||
Linux)
|
||||
DEFINES="$DEFINES SYS_LINUX"
|
||||
LINKLIBS="$LINKLIBS -lpthread -lm"
|
||||
LINKLIBS="$LINKLIBS -lpthread"
|
||||
;;
|
||||
|
||||
*)
|
||||
|
@ -285,6 +316,12 @@ else
|
|||
gtk_test
|
||||
fi
|
||||
|
||||
#
|
||||
# Math functions
|
||||
#
|
||||
lm_test
|
||||
lrintf_test
|
||||
|
||||
#
|
||||
# Generate config.jam
|
||||
#
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
#include <math.h>
|
||||
#include "transmission.h"
|
||||
|
||||
#if defined(SYS_BEOS) || defined(SYS_FREEBSD_4)
|
||||
#define lrintf(a) ((int)(0.5+(a)))
|
||||
#ifndef HAVE_LRINTF
|
||||
# define lrintf(a) ((int)(0.5+(a)))
|
||||
#endif
|
||||
|
||||
/* We may try to allocate and free tables of size 0. Quick and dirty
|
||||
|
|
Loading…
Reference in a new issue