c++/8477: autoconf script chooses wrong value for gcc_gxx_include_path
ian.grant@cl.cam.ac.uk
ian.grant@cl.cam.ac.uk
Wed Nov 6 05:06:00 GMT 2002
>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:
More information about the Gcc-prs
mailing list