public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/8477: autoconf script chooses wrong value for gcc_gxx_include_path
@ 2002-11-06  5:06 ian.grant
  0 siblings, 0 replies; 5+ messages in thread
From: ian.grant @ 2002-11-06  5:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8477
>Category:       c++
>Synopsis:       autoconf script chooses wrong value for gcc_gxx_include_path
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 06 05:06:04 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     ian.grant@cl.cam.ac.uk
>Release:        gcc-3.1
>Organization:
>Environment:

>Description:
When determining the default g++ include directory gcc/configure.in assumes that libdir=$(exec_prefix)/lib which is not always the case.

in gcc/configure.in we have:

if test x${gcc_gxx_include_dir} = x; then
  if test x${enable_version_specific_runtime_libs} = xyes; then
    gcc_gxx_include_dir='${libsubdir}/include/g++'
  else
    topsrcdir=${srcdir}/.. . ${srcdir}/../config.if
changequote(<<, >>)dnl
    gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) 
| sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/"${libstdcxx_incdir}
changequote([, ])dnl
  fi
fi

in libstdc++-v3/aclocal.m4 (in the definition of GLIBCPP_EXPORT_INSTALL_INFO
used in libstdc++-v3/configure.in) we have

# Default case for install directory for include files.
if test $version_specific_libs = no &&
   test $gxx_include_dir = no; then
  gxx_include_dir='$(prefix)'/include/g++-${libstdcxx_interface}
fi

So in the case where libdir=/usr/lib/gnu/gcc and prefix=/usr we get

/usr/lib/gnu/gcc/gcc-lib/sparc-sun-solaris2.8/3.1/../../../../include/g++-v3
for the search path and /usr/include/g++-v3 for the install path. This is wrong.

Workaround: Configure with --with-gxx-include-dir=/usr/include/g++-v3
>How-To-Repeat:
../gcc-3.1/configure  --prefix=/usr \
                         --libdir=/usr/lib/gnu/gcc \
                         --enable-languages=c,c++

make bootstrap
make install

The resulting g++ will not find the c++ include files installed under /usr/include/g++-v3
>Fix:
Use the same logic to determine both the installation and the search paths? :-)
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++/8477: autoconf script chooses wrong value for gcc_gxx_include_path
@ 2003-05-12 11:28 steven
  0 siblings, 0 replies; 5+ messages in thread
From: steven @ 2003-05-12 11:28 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, ian.grant, nobody

Synopsis: autoconf script chooses wrong value for gcc_gxx_include_path

State-Changed-From-To: feedback->analyzed
State-Changed-By: steven
State-Changed-When: Mon May 12 11:25:14 2003
State-Changed-Why:
    Feedback provided.  Similar (same?) issue seen in 3.2.1

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8477


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++/8477: autoconf script chooses wrong value for  gcc_gxx_include_path
@ 2003-01-13  3:26 John Tang Boyland
  0 siblings, 0 replies; 5+ messages in thread
From: John Tang Boyland @ 2003-01-13  3:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/8477; it has been noted by GNATS.

>From boyland@cs.uwm.edu  Mon Jan 13 01:09:12 2003
From: John Tang Boyland <boyland@cs.uwm.edu>
To: ian.grant@cl.cam.ac.uk, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/8477: autoconf script chooses wrong value for 
 gcc_gxx_include_path
Date: Sun, 12 Jan 2003 21:24:41 -0600

 I have a similar problem (except not with autoconf, since
 I just use the release 3.2.1 source.)  'make install' installs
 g++ header files in $(profix)/common/c++/3.2.1/ but then g++
 looks for the files not using prefix.  It seems to do something
 strange related to where the executable is.  I show two runs of g++:
 one from a symbolic link in /usr/new/bin (and /usr/new/lib/lib-gcc
 points 
 to $(exec-prefix)/lib/gcc-lib) and one directly using the full path
 without any symbolic links.  In both cases the files aren't found:
 
 Run #1: (with symbolic links)
 
 % /usr/new/bin/g++ --verbose hello.cc
 Reading specs from
 /usr/new/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/specs
 Configured with: ../src/configure
 --prefix=/afs/cs.uwm.edu/package/gcc/gcc-3.2.1/common
 --exec-prefix=/afs/cs.uwm.edu/package/gcc/gcc-3.2.1/sun4x_58
 --enable-languages=c,c++ --disable-nls
 Thread model: posix
 gcc version 3.2.1
  /usr/new/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/cc1plus -v
 -iprefix /usr/new/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/
 -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1
 -D__GXX_ABI_VERSION=102 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4
 -D__PRAGMA_REDEFINE_EXTNAME -D__sparc__ -D__sun__ -D__unix__ -D__svr4__
 -D__SVR4 -D__PRAGMA_REDEFINE_EXTNAME -D__sparc -D__sun -D__unix
 -Asystem=unix -Asystem=svr4 -D__NO_INLINE__ -D__STDC_HOSTED__=1
 -D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1
 -D__EXTENSIONS__ -D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int
 -D__WCHAR_TYPE__=long int -D__WINT_TYPE__=long int -D__GCC_NEW_VARARGS__
 -Acpu=sparc -Amachine=sparc hello.cc -D__GNUG__=3 -D__DEPRECATED
 -D__EXCEPTIONS -quiet -dumpbase hello.cc -version -o
 /var/tmp//ccSYZafr.s
 GNU CPP version 3.2.1 (cpplib) (sparc ELF)
 GNU C++ version 3.2.1 (sparc-sun-solaris2.8)
         compiled by GNU C version 3.2.1.
 ignoring nonexistent directory
 "/usr/new/lib/gcc-lib/../../../../../../../../include/c++/3.2.1"
 ignoring nonexistent directory
 "/usr/new/lib/gcc-lib/../../../../../../../../include/c++/3.2.1/sparc-sun-solaris2.8"
 ignoring nonexistent directory
 "/usr/new/lib/gcc-lib/../../../../../../../../include/c++/3.2.1/backward"
 ignoring nonexistent directory
 "/usr/new/lib/gcc-lib/../../../../../../../sparc-sun-solaris2.8/include"
 ignoring nonexistent directory "/include/c++/3.2.1"
 ignoring nonexistent directory "/include/c++/3.2.1/sparc-sun-solaris2.8"
 ignoring nonexistent directory "/include/c++/3.2.1/backward"
 ignoring nonexistent directory "/afs/sparc-sun-solaris2.8/include"
 ignoring duplicate directory
 "/afs/cs.uwm.edu/package/gcc/gcc-3.2.1/sun4x_58/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include"
 #include "..." search starts here:
 #include <...> search starts here:
  /usr/new/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include
  /usr/local/include
  /afs/cs.uwm.edu/package/gcc/gcc-3.2.1/common/include
  /usr/include
 End of search list.
 hello.cc:1:20: iostream: No such file or directory
 hello.cc: In function `int main()':
 hello.cc:5: `cout' undeclared in namespace `std'
 hello.cc:5: `endl' undeclared in namespace `std'
 
 (2) run without symbolic links:
 
 % /afs/cs.uwm.edu/package/gcc/gcc-3.2.1/sun4x_58/bin/g++ --verbose
 hello.cc
 Reading specs from
 /afs/cs.uwm.edu/package/gcc/gcc-3.2.1/sun4x_58/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/specs
 Configured with: ../src/configure
 --prefix=/afs/cs.uwm.edu/package/gcc/gcc-3.2.1/common
 --exec-prefix=/afs/cs.uwm.edu/package/gcc/gcc-3.2.1/sun4x_58
 --enable-languages=c,c++ --disable-nls
 Thread model: posix
 gcc version 3.2.1
 
 /afs/cs.uwm.edu/package/gcc/gcc-3.2.1/sun4x_58/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/cc1plus
 -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1
 -D__GXX_ABI_VERSION=102 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4
 -D__PRAGMA_REDEFINE_EXTNAME -D__sparc__ -D__sun__ -D__unix__ -D__svr4__
 -D__SVR4 -D__PRAGMA_REDEFINE_EXTNAME -D__sparc -D__sun -D__unix
 -Asystem=unix -Asystem=svr4 -D__NO_INLINE__ -D__STDC_HOSTED__=1
 -D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1
 -D__EXTENSIONS__ -D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int
 -D__WCHAR_TYPE__=long int -D__WINT_TYPE__=long int -D__GCC_NEW_VARARGS__
 -Acpu=sparc -Amachine=sparc hello.cc -D__GNUG__=3 -D__DEPRECATED
 -D__EXCEPTIONS -quiet -dumpbase hello.cc -version -o
 /var/tmp//ccHTgJY7.s
 GNU CPP version 3.2.1 (cpplib) (sparc ELF)
 GNU C++ version 3.2.1 (sparc-sun-solaris2.8)
         compiled by GNU C version 3.2.1.
 ignoring nonexistent directory "/include/c++/3.2.1"
 ignoring nonexistent directory "/include/c++/3.2.1/sparc-sun-solaris2.8"
 ignoring nonexistent directory "/include/c++/3.2.1/backward"
 ignoring nonexistent directory "/afs/sparc-sun-solaris2.8/include"
 #include "..." search starts here:
 #include <...> search starts here:
  /usr/local/include
  /afs/cs.uwm.edu/package/gcc/gcc-3.2.1/common/include
 
 /afs/cs.uwm.edu/package/gcc/gcc-3.2.1/sun4x_58/lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/include
  /usr/include
 End of search list.
 hello.cc:1:20: iostream: No such file or directory
 hello.cc: In function `int main()':
 hello.cc:5: `cout' undeclared in namespace `std'
 hello.cc:5: `endl' undeclared in namespace `std'
 
 
 My current "fix" is to edit the binaries in emacs to put in the correct
 paths.
 But I wonder why g++ tries to do tricky things with ../../ working
 backwards from
 gcc-lib rather than just use the same place that things were installed.
 
 John
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8477


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++/8477: autoconf script chooses wrong value for gcc_gxx_include_path
@ 2003-01-08  2:42 bangerth
  0 siblings, 0 replies; 5+ messages in thread
From: bangerth @ 2003-01-08  2:42 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, ian.grant, nobody

Synopsis: autoconf script chooses wrong value for gcc_gxx_include_path

State-Changed-From-To: open->feedback
State-Changed-By: bangerth
State-Changed-When: Tue Jan  7 18:42:19 2003
State-Changed-Why:
    Phil has already asked for feedback, so let's reflect this in
    the state of the report.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8477


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: c++/8477: autoconf script chooses wrong value for gcc_gxx_include_path
@ 2002-11-06 14:46 Phil Edwards
  0 siblings, 0 replies; 5+ messages in thread
From: Phil Edwards @ 2002-11-06 14:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/8477; it has been noted by GNATS.

From: Phil Edwards <phil@jaj.com>
To: ian.grant@cl.cam.ac.uk
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/8477: autoconf script chooses wrong value for gcc_gxx_include_path
Date: Wed, 6 Nov 2002 17:42:04 -0500

 > >Release:        gcc-3.1
 
 Could you try 3.2?  These two blocks of script have been reworked to provide
 versioned include directories.  There were some nits but I believe they've
 been fixed now.
 
 
 Phil
 
 -- 
 I would therefore like to posit that computing's central challenge, viz. "How
 not to make a mess of it," has /not/ been met.
                                                  - Edsger Dijkstra, 1930-2002


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-05-12 11:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06  5:06 c++/8477: autoconf script chooses wrong value for gcc_gxx_include_path ian.grant
2002-11-06 14:46 Phil Edwards
2003-01-08  2:42 bangerth
2003-01-13  3:26 John Tang Boyland
2003-05-12 11:28 steven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).