From 385fae6dca60b9b41e91c9b8bfe1a05a4eb18240 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 29 Apr 2013 14:54:52 -0700 Subject: [PATCH] configure: Add checks for GL/gl.h Previously, the compile would just forge ahead assuming GL/gl.h was present. Now, at configure time, actually look for gl.h, (first, by looking for a pkg-config "gl" package, otherwise, trying to just test-compile something with a #include ). If things aren't found at configure time, tell the user which packages to install. --- configure | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/configure b/configure index f86db97..121aec4 100755 --- a/configure +++ b/configure @@ -228,6 +228,45 @@ else fi rm -f elf-minimal elf-minimal.c +printf "Checking for OpenGL header file GL/gl.h... " +have_gl=0 +if pkg-config --exists gl; then + printf "Yes.\n" + have_gl=1 + gl_cflags=$(pkg-config --cflags gl) +else + printf "#include \nint main(void){return 0;}\n" > gl-minimal.c + if ${CC} -o gl-minimal gl-minimal.c > /dev/null 2>&1 + then + printf "Yes.\n" + have_gl=1 + else + printf "No.\n" + errors=$((errors + 1)) + fi + rm -f gl-minimal gl-minimal.c +fi + +printf "Checking for GL window-system-binding headers:\n" +have_gl_winsys=0 + +printf " Checking for GL/glx.h... " +have_glx=0 +printf "#include \nint main(void){return 0;}\n" > glx-minimal.c +if ${CC} -o glx-minimal glx-minimal.c ${gl_cflags} > /dev/null 2>&1 +then + printf "Yes.\n" + have_gl_winsys=1 + have_glx=1 +else + printf "No.\n" +fi +rm -f glx-minimal glx-minimal.c + +if [ $have_gl_winsys -eq 0 ]; then + errors=$((errors + 1)) +fi + if [ $errors -gt 0 ]; then cat <