From 475afe216276babeb6167b1ca8b63d126473c875 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 19 May 2020 12:08:05 -0400 Subject: [PATCH] configure: Do a real check for -idirafter anyhow. (The CMake project cheats around this by asking "are we GCC or Clang?" and I'm inclined to leave it like that for now.) --- configure | 32 +++++++++++++++++++++++++++++++- configure.ac | 17 ++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 30d30f44f79a6..e421c2f7e240f 100755 --- a/configure +++ b/configure @@ -16000,7 +16000,37 @@ case "$host" in ;; esac -INCLUDE="-I$srcdir/include -I$srcdir/src/video/khronos" +save_CFLAGS="$CFLAGS" +have_idirafter="no" +idirafter="-I" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -idirafter option" >&5 +$as_echo_n "checking for -idirafter option... " >&6; } +CFLAGS="$save_CFLAGS -idirafter src" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +have_idirafter="yes" +idirafter="-idirafter" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_idirafter" >&5 +$as_echo "$have_idirafter" >&6; } +CFLAGS="$save_CFLAGS" + +INCLUDE="-I$srcdir/include $idirafter $srcdir/src/video/khronos" if test x$srcdir != x.; then INCLUDE="-Iinclude $INCLUDE" elif test -d .hg; then diff --git a/configure.ac b/configure.ac index 0fb7504b0a15a..2c312fae59b2e 100644 --- a/configure.ac +++ b/configure.ac @@ -69,8 +69,23 @@ case "$host" in ;; esac +dnl see if -idirafter is available. +save_CFLAGS="$CFLAGS" +have_idirafter="no" +idirafter="-I" +AC_MSG_CHECKING(for -idirafter option) +CFLAGS="$save_CFLAGS -idirafter src" +AC_TRY_COMPILE([ +],[ +],[ +have_idirafter="yes" +idirafter="-idirafter" +]) +AC_MSG_RESULT($have_idirafter) +CFLAGS="$save_CFLAGS" + dnl Set up the compiler and linker flags -INCLUDE="-I$srcdir/include -I$srcdir/src/video/khronos" +INCLUDE="-I$srcdir/include $idirafter $srcdir/src/video/khronos" if test x$srcdir != x.; then INCLUDE="-Iinclude $INCLUDE" elif test -d .hg; then