summaryrefslogtreecommitdiff
path: root/gcc/configure
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-16 06:43:36 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-05-16 06:43:36 +0000
commite83194ca860bd35501bdd19b7765107df4bc216f (patch)
tree5f4fe514ca446c48467629008ad6d9d9ab87fc10 /gcc/configure
parent796d236fec6d15b0d2df306ede8423b4b9aceccd (diff)
downloadgcc-e83194ca860bd35501bdd19b7765107df4bc216f.tar.gz
gcc/
Revert: 2007-05-12 Richard Sandiford <richard@codesourcery.com> * configure.ac (gcc_gxx_include_dir): Use $(libsubdir_to_prefix). (gcc_tooldir): Likewise. * configure: Regenerate. * Makefile.in (libsubdir_to_prefix): New variable, based on the old configure.ac gcc_tooldir setting. (prefix_to_exec_prefix): New variable. (DRIVER_DEFINES): Use $(libsubdir_to_prefix)$(prefix_to_exec_prefix) rather than $(unlibsubdir)/../ to derive TOOLDIR_BASE_PREFIX. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124760 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/configure')
-rwxr-xr-xgcc/configure37
1 files changed, 35 insertions, 2 deletions
diff --git a/gcc/configure b/gcc/configure
index f9206396669..b3aa2b09ce7 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1688,7 +1688,7 @@ if test x${gcc_gxx_include_dir} = x; then
if test x$host != x$target; then
libstdcxx_incdir="$target_alias/$libstdcxx_incdir"
fi
- gcc_gxx_include_dir="\$(libsubdir)/\$(libsubdir_to_prefix)$libstdcxx_incdir"
+ gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/$libstdcxx_incdir"
fi
fi
@@ -16835,7 +16835,40 @@ if test "x$subdirs" != x; then
fi
echo "source ${srcdir}/gdbinit.in" >> .gdbinit
-gcc_tooldir='$(libsubdir)/$(libsubdir_to_prefix)$(target_noncanonical)'
+# If $(exec_prefix) exists and is not the same as $(prefix), then compute an
+# absolute path for gcc_tooldir based on inserting the number of up-directory
+# movements required to get from $(exec_prefix) to $(prefix) into the basic
+# $(libsubdir)/@(unlibsubdir) based path.
+# Don't set gcc_tooldir to tooldir since that's only passed in by the toplevel
+# make and thus we'd get different behavior depending on where we built the
+# sources.
+if test x$exec_prefix = xNONE -o x$exec_prefix = x$prefix; then
+ gcc_tooldir='$(libsubdir)/$(unlibsubdir)/../$(target_noncanonical)'
+else
+# An explanation of the sed strings:
+# -e 's|^\$(prefix)||' matches and eliminates 'prefix' from 'exec_prefix'
+# -e 's|/$||' match a trailing forward slash and eliminates it
+# -e 's|^[^/]|/|' forces the string to start with a forward slash (*)
+# -e 's|/[^/]*|../|g' replaces each occurrence of /<directory> with ../
+#
+# (*) Note this pattern overwrites the first character of the string
+# with a forward slash if one is not already present. This is not a
+# problem because the exact names of the sub-directories concerned is
+# unimportant, just the number of them matters.
+#
+# The practical upshot of these patterns is like this:
+#
+# prefix exec_prefix result
+# ------ ----------- ------
+# /foo /foo/bar ../
+# /foo/ /foo/bar ../
+# /foo /foo/bar/ ../
+# /foo/ /foo/bar/ ../
+# /foo /foo/bar/ugg ../../
+#
+ dollar='$$'
+ gcc_tooldir="\$(libsubdir)/\$(unlibsubdir)/\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/\$(dollar)||' -e 's|^[^/]|/|' -e 's|/[^/]*|../|g'\`\$(target_noncanonical)"
+fi