Commit 2718d703 authored by Jamie A. Jennings's avatar Jamie A. Jennings

Fixed pre-processor check for bsd/stdio to make gcc happy

parents 9c74a43c 9957bc0d
Pipeline #71052593 passed with stage
in 1 minute and 14 seconds
......@@ -136,20 +136,29 @@ default: binaries compile sniff
# Note that this test should ALWAYS pass on OS X, since it ships with
# readline.
.PHONY: readlinetest
readlinetest: cctest
@(bash -c 'printf "#include <stdio.h>\n#include <readline/readline.h>\nint main() { }\n"' | \
$(CC) -std=c99 -lreadline -o /dev/null -xc -) && \
echo 'readline TEST: libreadline and readline.h appear to be installed' || \
echo 'libreadline and readline.h appear to be installed' || \
(echo '**'; echo '** readline TEST: Missing readline library or readline.h'; echo '**' && /usr/bin/false)
.PHONY: cctest
@(bash -c 'printf "int main() { }\n"' | \
$(CC) -std=c99 -o /dev/null -xc -) && \
echo "C compiler $(CC) appears to be working" || \
(echo '**'; \
echo '** C compiler test FAILED. (If on macos, please install XCode Command Line Tools.)'; \
echo '**' && /usr/bin/false)
# When we compile with gcc, such as on linux, we need bsd/stdio.h to
# compile rpeg. We check for it here so that we can give a useful
# error message.
.PHONY: libbsdtest
libbsdtest: cctest
@(bash -c 'printf "#if defined(__linux__)\n#if !defined(__clang__)\n#include <bsd/stdio.h>\n#endif\n#endif\nint main() { }\n"' | \
$(CC) -std=c99 -o /dev/null -xc -) && \
echo 'libbsd TEST: bsd/stdio.h appears to be installed (or is not needed)' || \
echo 'bsd/stdio.h appears to be installed (or is not needed)' || \
(echo '**'; echo '** libbsd TEST: Missing bsd/stdio.h. Try running: apt-get install libbsd'; echo '**' && /usr/bin/false)
# The submodule_sentinel indicates that submodules have been
......@@ -91,8 +91,8 @@
#include <assert.h>
#include <stdio.h>
#if defined(__GNUC__)
#if !defined(__APPLE__)
#if defined(__linux__)
#if !defined(__clang__)
#include <bsd/stdio.h>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment