dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFA: libgloss.exp: Only use -isystem to include system header files.


From: Nick Clifton
Subject: Re: RFA: libgloss.exp: Only use -isystem to include system header files.
Date: Fri, 19 Nov 2004 09:49:14 +0000
User-agent: Mozilla Thunderbird 0.7.3 (X11/20040803)

Hi Rob,

 Please may I have permission to apply the attached patch ?  It
 implements a change you suggested here:

Sure, since this works the way we discussed Sorry this took a bit, I've been on a road trip and mostly offline.

No worries - although I did forget one thing - I do not have write access to the repository. Doh! Please could you commit the patch for me ? (I am reattaching the patch to save you time).

Cheers
  Nick

dejagnu/ChangeLog
2004-11-19  Nick Clifton  <address@hidden>

        * lib/libgloss.exp (newlib_include_flags): Document why -isystem
        is used instead of -I.
        (libio_include_flags): Use -I instead of -isystem and
        document why.
        (g++_include_flags): Use -I instead of -isystem.
        (libstdc++_include_flags): Likewise.


Index: lib/libgloss.exp
===================================================================
RCS file: /cvsroot/dejagnu/dejagnu/lib/libgloss.exp,v
retrieving revision 1.16
diff -c -3 -p -r1.16 libgloss.exp
*** lib/libgloss.exp    7 Jun 2004 01:39:49 -0000       1.16
--- lib/libgloss.exp    19 Nov 2004 09:44:24 -0000
***************
*** 1,5 ****
  # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
! # 2001, 2002, 2003 Free Software Foundation, Inc.
  #
  # This file is part of DejaGnu.
  #
--- 1,5 ----
  # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
! # 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  #
  # This file is part of DejaGnu.
  #
*************** proc newlib_include_flags { args } {
*** 158,163 ****
--- 158,169 ----
        if { ${newlib_dir} != "" } {
            set newlib_dir [file dirname ${newlib_dir}]
        }
+       # Note - we use -isystem rather than -I because newlib contains
+       # system header files.  This is especially important for the
+       # limits.h header which makes use of the #include_next directive.
+       # #include_next will generate error messages from GCC if compiling
+       # in strict ANSI mode or if another limits.h header cannot be found.
+       # When it is included via -isystem these things do not happen.
        return " -isystem $gccpath/newlib/targ-include -isystem ${newlib_dir}"
      } else {
        verbose "No newlib support for this target"
*************** proc libio_include_flags { args } {
*** 190,196 ****
      if { $libio_bin_dir != "" && $libio_src_dir != "" } {
        set libio_src_dir [file dirname ${libio_src_dir}]
        set libio_bin_dir [file dirname ${libio_bin_dir}]
!       return " -isystem ${libio_src_dir} -isystem ${libio_bin_dir}"
      } else {
        return ""
      }
--- 196,207 ----
      if { $libio_bin_dir != "" && $libio_src_dir != "" } {
        set libio_src_dir [file dirname ${libio_src_dir}]
        set libio_bin_dir [file dirname ${libio_bin_dir}]
!       # Note - unlike the newlib_include_flags proc above we use the -I
!       # switch to specify the include paths.  This is because these headers
!       # are not system headers, and if -isystem were to be used GCC would
!       # generate an implicit extern "C" { ... } surrounding them.  This
!       # will break targets which do not define NO_IMPLICIT_EXTERN_C.
!       return " -I${libio_src_dir} -I${libio_bin_dir}"
      } else {
        return ""
      }
*************** proc g++_include_flags { args } {
*** 225,247 ****
  
      set dir [lookfor_file ${srcdir} libg++]
      if { ${dir} != "" } {
!       append flags " -isystem ${dir} -isystem ${dir}/src"
      }
  
      set dir [lookfor_file ${srcdir} libstdc++-v3]
      if { ${dir} != "" } {
!       append flags " -isystem ${dir}/include -isystem ${dir}/include/std"
!       append flags " -isystem ${dir}/include/c_std -isystem ${dir}/libsupc++"
      }
  
      set dir [lookfor_file ${gccpath} libstdc++-v3]
      if { ${dir} != "" } {
!       append flags " -isystem ${dir}/include -isystem 
${dir}/include/${target_alias}"
      }
  
      set dir [lookfor_file ${srcdir} libstdc++]
      if { ${dir} != "" } {
!       append flags " -isystem ${dir} -isystem ${dir}/stl"
      }
  
      return "$flags"
--- 236,259 ----
  
      set dir [lookfor_file ${srcdir} libg++]
      if { ${dir} != "" } {
!       # See comment in libio_include_flags about using -I.
!       append flags " -I${dir} -I${dir}/src"
      }
  
      set dir [lookfor_file ${srcdir} libstdc++-v3]
      if { ${dir} != "" } {
!       append flags " -I${dir}/include -I${dir}/include/std"
!       append flags " -I${dir}/include/c_std -I${dir}/libsupc++"
      }
  
      set dir [lookfor_file ${gccpath} libstdc++-v3]
      if { ${dir} != "" } {
!       append flags " -I${dir}/include -I${dir}/include/${target_alias}"
      }
  
      set dir [lookfor_file ${srcdir} libstdc++]
      if { ${dir} != "" } {
!       append flags " -I${dir} -I${dir}/stl"
      }
  
      return "$flags"
*************** proc libstdc++_include_flags { args } {
*** 317,336 ****
  
      set dir [lookfor_file ${srcdir} libstdc++-v3]
      if { ${dir} != "" } {
!       append flags " -isystem ${dir}/include -isystem ${dir}/include/std"
!       append flags " -isystem ${dir}/include/c_std -isystem ${dir}/libsupc++"
      }
  
      set gccpath [get_multilibs]
  
      set dir [lookfor_file ${gccpath} libstdc++-v3]
      if { ${dir} != "" } {
!       append flags " -isystem ${dir}/include -isystem 
${dir}/include/${target_alias}"
      }
  
      set dir [lookfor_file ${srcdir} libstdc++]
      if { ${dir} != "" } {
!       append flags " -isystem ${dir} -isystem ${dir}/stl"
      }
  
      return "$flags"
--- 329,349 ----
  
      set dir [lookfor_file ${srcdir} libstdc++-v3]
      if { ${dir} != "" } {
!       # See comment in libio_include_flags about using -I.
!       append flags " -I${dir}/include -I${dir}/include/std"
!       append flags " -I${dir}/include/c_std -I${dir}/libsupc++"
      }
  
      set gccpath [get_multilibs]
  
      set dir [lookfor_file ${gccpath} libstdc++-v3]
      if { ${dir} != "" } {
!       append flags " -I${dir}/include -I${dir}/include/${target_alias}"
      }
  
      set dir [lookfor_file ${srcdir} libstdc++]
      if { ${dir} != "" } {
!       append flags " -I${dir} -I${dir}/stl"
      }
  
      return "$flags"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]