Changeset 179 for trunk/configure


Ignore:
Timestamp:
Apr 3, 2006, 9:05:47 AM (16 years ago)
Author:
titer
Message:

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)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure

    r171 r179  
    4444  fi
    4545  rm -f testconf.c testconf
     46}
     47
     48lm_test()
     49{
     50  cat > testconf.c << EOF
     51  int main()
     52  {
     53    sqrt( 42 );
     54  }
     55EOF
     56  if ! $CC -o testconf testconf.c > /dev/null 2>&1
     57  then
     58    if $CC -o testconf testconf.c -lm > /dev/null 2>&1
     59    then
     60      LINKLIBS="$LINKLIBS -lm"
     61    fi
     62  fi
     63}
     64
     65lrintf_test()
     66{
     67  cat > testconf.c << EOF
     68  int main()
     69  {
     70    return ( lrintf( 3.14 ) != 3 );
     71  }
     72EOF
     73  if ( $CC -o testconf testconf.c $LINKLIBS && ./testconf ) > /dev/null 2>&1
     74  then
     75    DEFINES="$DEFINES HAVE_LRINTF"
     76  fi
    4677}
    4778
     
    223254  FreeBSD)
    224255    DEFINES="$DEFINES SYS_FREEBSD"
    225     LINKLIBS="$LINKLIBS -pthread -lm"
     256    LINKLIBS="$LINKLIBS -pthread"
    226257
    227258    RELEASE=`uname -r`
     
    235266  NetBSD)
    236267    DEFINES="$DEFINES SYS_NETBSD"
    237     LINKLIBS="$LINKLIBS -lpthread -lm"
     268    LINKLIBS="$LINKLIBS -lpthread"
    238269    ;;
    239270
    240271  OpenBSD)
    241272    DEFINES="$DEFINES SYS_OPENBSD"
    242     LINKLIBS="$LINKLIBS -lpthread -lm"
     273    LINKLIBS="$LINKLIBS -lpthread"
    243274    ;;
    244275
    245276  Linux)
    246277    DEFINES="$DEFINES SYS_LINUX"
    247     LINKLIBS="$LINKLIBS -lpthread -lm"
     278    LINKLIBS="$LINKLIBS -lpthread"
    248279    ;;
    249280
     
    285316    gtk_test
    286317fi
     318
     319#
     320# Math functions
     321#
     322lm_test
     323lrintf_test
    287324
    288325#
Note: See TracChangeset for help on using the changeset viewer.