1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#!/bin/sh
# Configure some things for gkrellmd when make is run.
# This configure is run automatically so no need to run it by hand.
#
# Copyright (C) 2006-2021 Bill Wilson
for i
do
if [ "$i" = "--without-libsensors" ]
then
without_libsensors=yes
fi
done
rm -f configure.h configure.log test test.o test.c
touch configure.h
exec 5>./configure.log
CC=${CC-gcc}
echo "CC : ${CC}" 1>& 5
echo "CFLAGS: ${CFLAGS}" 1>& 5
if [ "$without_libsensors" != "yes" ]
then
echo "Checking for libsensors... " 1>& 5
cat << EOF > test.c
#include <stdio.h>
#include <sensors/sensors.h>
int main()
{
if (sensors_init(NULL) != 0)
return 1;
return 0;
}
EOF
$CC ${CFLAGS} -c test.c -o test.o 2>& 5
$CC test.o -o test -lsensors 2>& 5
if [ -x ./test ]
then
echo 'Defining HAVE_LIBSENSORS' 1>& 5
echo '#define HAVE_LIBSENSORS 1' >> configure.h
else
echo "Not found, sensors will not have libsensors support..." 1>& 5
fi
fi
# end of libsensors check
rm -f test test.o test.c
exit 0
|