mirror of
https://github.com/cuberite/libdeflate.git
synced 2025-08-04 18:27:27 -04:00

* Bring in common headers and program code from xpack project * Move program code to programs/ * Move library code to lib/ * GNU89 and MSVC2010 compatibility * Other changes
33 lines
672 B
Bash
Executable File
33 lines
672 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ -z "$CC" ]; then
|
|
CC=cc
|
|
fi
|
|
|
|
echo "/* THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. */"
|
|
echo "#ifndef _CONFIG_H"
|
|
echo "#define _CONFIG_H"
|
|
|
|
tmpfile="$(mktemp -t libdeflate_config.XXXXXXXX)"
|
|
trap "rm -f \"$tmpfile\"" EXIT
|
|
|
|
check_function() {
|
|
funcname="$1"
|
|
macro="HAVE_$(echo $funcname | tr a-z A-Z)"
|
|
echo "int main() { $funcname(); }" > "$tmpfile"
|
|
echo
|
|
echo "/* Is the $funcname() function available? */"
|
|
if $CC -x c $tmpfile -o /dev/null > /dev/null 2>&1; then
|
|
echo "#define $macro 1"
|
|
else
|
|
echo "/* $macro is not set */"
|
|
fi
|
|
}
|
|
|
|
check_function clock_gettime
|
|
check_function futimens
|
|
check_function futimes
|
|
|
|
echo
|
|
echo "#endif /* _CONFIG_H */"
|