Pass CFLAGS to detect.sh

Needed when cross-compiling with clang.
This commit is contained in:
Eric Biggers 2016-09-04 23:43:30 -07:00
parent 8081ce7853
commit f2b401539c
2 changed files with 2 additions and 2 deletions

View File

@ -156,7 +156,7 @@ PROG_OBJ := $(PROG_COMMON_OBJ) $(PROG_SPECIFIC_OBJ)
# Generate autodetected configuration header
programs/config.h:programs/detect.sh .prog-cflags
$(QUIET_GEN) CC=$(CC) $< > $@
$(QUIET_GEN) CC="$(CC)" CFLAGS="$(CFLAGS)" $< > $@
# Compile program object files
$(PROG_OBJ): %.o: %.c $(PROG_COMMON_HEADERS) $(COMMON_HEADERS) .prog-cflags

View File

@ -17,7 +17,7 @@ check_function() {
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
if $CC $CFLAGS -x c $tmpfile -o /dev/null > /dev/null 2>&1; then
echo "#define $macro 1"
else
echo "/* $macro is not set */"