configure: Just don't do the -idirafter on QNX.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 19 May 2020 13:22:01 -0400
changeset 13834bb68bb2d5ccb
parent 13833 9e4cca5c8e62
child 13835 3f63f707ca4f
configure: Just don't do the -idirafter on QNX.

The compiler understands it, but the "qcc" compiler driver doesn't, and the
standard Khronos headers upset QNX anyhow, since they try to include X11
headers in the __unix__ section.
configure
configure.ac
     1.1 --- a/configure	Tue May 19 12:30:26 2020 -0400
     1.2 +++ b/configure	Tue May 19 13:22:01 2020 -0400
     1.3 @@ -16000,37 +16000,16 @@
     1.4          ;;
     1.5  esac
     1.6  
     1.7 -save_CFLAGS="$CFLAGS"
     1.8 -have_idirafter="no"
     1.9 -idirafter="-I"
    1.10 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -idirafter option" >&5
    1.11 -$as_echo_n "checking for -idirafter option... " >&6; }
    1.12 -CFLAGS="$save_CFLAGS -idirafter src"
    1.13 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1.14 -/* end confdefs.h.  */
    1.15 -
    1.16 -
    1.17 -int
    1.18 -main ()
    1.19 -{
    1.20 -
    1.21 -
    1.22 -  ;
    1.23 -  return 0;
    1.24 -}
    1.25 -_ACEOF
    1.26 -if ac_fn_c_try_compile "$LINENO"; then :
    1.27 -
    1.28 -have_idirafter="yes"
    1.29 -idirafter="-idirafter "
    1.30 -
    1.31 -fi
    1.32 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    1.33 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_idirafter" >&5
    1.34 -$as_echo "$have_idirafter" >&6; }
    1.35 -CFLAGS="$save_CFLAGS"
    1.36 -
    1.37 -INCLUDE="-I$srcdir/include $idirafter$srcdir/src/video/khronos"
    1.38 +INCLUDE="-I$srcdir/include"
    1.39 +
    1.40 +case "$host" in
    1.41 +    *-*-nto-qnx*)
    1.42 +        ;;
    1.43 +    *)
    1.44 +        INCLUDE="$INCLUDE -idirafter $srcdir/src/video/khronos"
    1.45 +        ;;
    1.46 +esac
    1.47 +
    1.48  if test x$srcdir != x.; then
    1.49      INCLUDE="-Iinclude $INCLUDE"
    1.50  elif test -d .hg; then
     2.1 --- a/configure.ac	Tue May 19 12:30:26 2020 -0400
     2.2 +++ b/configure.ac	Tue May 19 13:22:01 2020 -0400
     2.3 @@ -69,23 +69,18 @@
     2.4          ;;
     2.5  esac
     2.6  
     2.7 -dnl see if -idirafter is available.
     2.8 -save_CFLAGS="$CFLAGS"
     2.9 -have_idirafter="no"
    2.10 -idirafter="-I"
    2.11 -AC_MSG_CHECKING(for -idirafter option)
    2.12 -CFLAGS="$save_CFLAGS -idirafter src"
    2.13 -AC_TRY_COMPILE([
    2.14 -],[
    2.15 -],[
    2.16 -have_idirafter="yes"
    2.17 -idirafter="-idirafter "
    2.18 -])
    2.19 -AC_MSG_RESULT($have_idirafter)
    2.20 -CFLAGS="$save_CFLAGS"
    2.21 -
    2.22  dnl Set up the compiler and linker flags
    2.23 -INCLUDE="-I$srcdir/include $idirafter$srcdir/src/video/khronos"
    2.24 +INCLUDE="-I$srcdir/include"
    2.25 +
    2.26 +dnl Don't use our khronos headers on QNX.
    2.27 +case "$host" in
    2.28 +    *-*-nto-qnx*)
    2.29 +        ;;
    2.30 +    *)
    2.31 +        INCLUDE="$INCLUDE -idirafter $srcdir/src/video/khronos"
    2.32 +        ;;
    2.33 +esac
    2.34 +
    2.35  if test x$srcdir != x.; then
    2.36      INCLUDE="-Iinclude $INCLUDE"
    2.37  elif test -d .hg; then