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
|
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()
|
gettext_test()
|
||||||
{
|
{
|
||||||
cat > testconf.c <<EOF
|
cat > testconf.c <<EOF
|
||||||
|
@ -222,7 +253,7 @@ case $SYSTEM in
|
||||||
|
|
||||||
FreeBSD)
|
FreeBSD)
|
||||||
DEFINES="$DEFINES SYS_FREEBSD"
|
DEFINES="$DEFINES SYS_FREEBSD"
|
||||||
LINKLIBS="$LINKLIBS -pthread -lm"
|
LINKLIBS="$LINKLIBS -pthread"
|
||||||
|
|
||||||
RELEASE=`uname -r`
|
RELEASE=`uname -r`
|
||||||
case $RELEASE in
|
case $RELEASE in
|
||||||
|
@ -234,17 +265,17 @@ case $SYSTEM in
|
||||||
|
|
||||||
NetBSD)
|
NetBSD)
|
||||||
DEFINES="$DEFINES SYS_NETBSD"
|
DEFINES="$DEFINES SYS_NETBSD"
|
||||||
LINKLIBS="$LINKLIBS -lpthread -lm"
|
LINKLIBS="$LINKLIBS -lpthread"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
OpenBSD)
|
OpenBSD)
|
||||||
DEFINES="$DEFINES SYS_OPENBSD"
|
DEFINES="$DEFINES SYS_OPENBSD"
|
||||||
LINKLIBS="$LINKLIBS -lpthread -lm"
|
LINKLIBS="$LINKLIBS -lpthread"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
Linux)
|
Linux)
|
||||||
DEFINES="$DEFINES SYS_LINUX"
|
DEFINES="$DEFINES SYS_LINUX"
|
||||||
LINKLIBS="$LINKLIBS -lpthread -lm"
|
LINKLIBS="$LINKLIBS -lpthread"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
@ -285,6 +316,12 @@ else
|
||||||
gtk_test
|
gtk_test
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Math functions
|
||||||
|
#
|
||||||
|
lm_test
|
||||||
|
lrintf_test
|
||||||
|
|
||||||
#
|
#
|
||||||
# Generate config.jam
|
# Generate config.jam
|
||||||
#
|
#
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "transmission.h"
|
#include "transmission.h"
|
||||||
|
|
||||||
#if defined(SYS_BEOS) || defined(SYS_FREEBSD_4)
|
#ifndef HAVE_LRINTF
|
||||||
#define lrintf(a) ((int)(0.5+(a)))
|
# define lrintf(a) ((int)(0.5+(a)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* We may try to allocate and free tables of size 0. Quick and dirty
|
/* We may try to allocate and free tables of size 0. Quick and dirty
|
||||||
|
|
Loading…
Reference in a new issue