Skip to content

Commit

Permalink
configure: Do a real check for -idirafter anyhow.
Browse files Browse the repository at this point in the history
(The CMake project cheats around this by asking "are we GCC or Clang?" and I'm
inclined to leave it like that for now.)
  • Loading branch information
icculus committed May 19, 2020
1 parent 2f565b4 commit 475afe2
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
32 changes: 31 additions & 1 deletion configure
Expand Up @@ -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
Expand Down
17 changes: 16 additions & 1 deletion configure.ac
Expand Up @@ -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
Expand Down

0 comments on commit 475afe2

Please sign in to comment.