This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: introduce configure --with-sysroot


On Oct 10, 2002, Alexandre Oliva <aoliva@redhat.com> wrote:

> I've updated the patch such that --with-sysroot would no longer do any
> copying, and, if the argument started with ${gcc_tooldir} (passed
> literally to gcc's configure, to be expanded by the Makefile), it will
> be relocatable.  I've also arranged for the target root directory to
> *not* be relocated in case it doesn't exist within the relocated tree,
> which is useful at build time (so I could remove the ugly hack that
> created a link to $(libdir) in the top builddir, that assumed
> exec_prefix was a subdir of prefix and would only work for gcc as a
> sub-directory of the top build tree).

> I've also added documentation.  The resulting patch, against the
> basic-improvements-branch, is below.  I know it is going to conflict
> with Jakub's multi-os-directory, but I'm not sure what to do about
> it.  Should I post the patch against mainline and wait until Jakub's
> patch is merged into the branch, or merge mainline into the branch
> myself and then post a revised patch?

Here's a revised patch, updated after Jakub's multi-os-directory patch
was merged into the 3.4-bi branch.  Ok to install?

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>
	Angela Marie Thomas  <angela@releasedominatrix.com>
	Brendan Kehoe  <brendan@zen.org>
	Nick Clifton  <nickc@redhat.com>
	Andrew Haley  <aph@redhat.com>

	* configure.in (--with-sysroot): New.  Don't inhibit libc if
	given.  AC_SUBST TARGET_SYSTEM_ROOT, TARGET_SYSTEM_ROOT_DEFINE
	and CROSS_SYSTEM_HEADER_DIR.
	* configure: Rebuilt.
	* Makefile.in (CROSS_SYSTEM_HEADER_DIR): Set in configure.
	(TARGET_SYSTEM_ROOT): New.
	(DRIVER_DEFINES): Define CROSS_INCLUDE_DIR from
	CROSS_SYSTEM_HEADER_DIR.
	(install-gcc-tooldir): New target.
	(stmp-fixinc): Do not create $(libsubdir), but rather bail out
	of SYSTEM_HEADER_DIR does not exist.
	(deduced.h, stmp-fixproto): Quote SYSTEM_HEADER_DIR properly.
	(install-mkheaders): Likewise.
	* gcc.c (target_system_root): New variable.
	(add_sysrooted_prefix): New function.
	(process_command): Recompute run-time target_system_root from
	gcc_exec_prefix, keeping it unchanged if the relocated sysroot
	does not exist.
	(do_spec_1): Process 'R' spec.
	(main): Add md_exec_prefix to exec_prefixes regardless of
	startfile_prefix_spec.  Use add_sysrooted_prefix for
	startfile_prefixes, and don't skip the default ones when cross
	compiling with sysroot enabled.  Removed unused case of
	non-absolute standard_startfile_prefix.
	* config/interix.h: Remove the only potential, yet disabled,
	occurrence of non-absolute (empty) standard_startfile_prefix.
	* config/sh/linux.h (LIB_SPEC): Add -rpath-link in non-static
	linking.
	* config/mips/linux.h (LIB_SPEC): Define as in sh/linux.h.
	* doc/install.texi (--with-sysroot): Document.
	(--with-headers, --with-libs): Deprecate.

Index: gcc/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.939.2.8
diff -u -p -r1.939.2.8 Makefile.in
--- gcc/Makefile.in 15 Oct 2002 01:32:43 -0000 1.939.2.8
+++ gcc/Makefile.in 19 Oct 2002 21:30:12 -0000
@@ -254,7 +254,7 @@ FIBHEAP_H   = $(srcdir)/../include/fibhe
 # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
 NATIVE_SYSTEM_HEADER_DIR = /usr/include
 # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
-CROSS_SYSTEM_HEADER_DIR = $(build_tooldir)/sys-include
+CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
 
 # autoconf sets SYSTEM_HEADER_DIR to one of the above.
 SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@
@@ -266,6 +266,10 @@ STMP_FIXINC = @STMP_FIXINC@
 # Test to see whether <limits.h> exists in the system header files.
 LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
 
+# Directory for prefix to system directories, for
+# each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
+TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
+
 target=@target@
 target_alias=@target_alias@
 xmake_file=@dep_host_xmake_file@
@@ -1261,6 +1265,7 @@ DRIVER_DEFINES = \
   -DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
   -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
   -DTOOLDIR_BASE_PREFIX=\"$(unlibsubdir)/../\" \
+  @TARGET_SYSTEM_ROOT_DEFINE@ \
   `test "X$${SHLIB_LINK}" = "X" || test "@enable_shared@" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` \
   `test "X$${SHLIB_MULTILIB}" = "X" || echo "-DNO_SHARED_LIBGCC_MULTILIB"`
 
@@ -2176,7 +2181,7 @@ PREPROCESSOR_DEFINES = \
   -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_alias)\" \
   -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
   -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
-  -DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \
+  -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\"
 
 LIBCPP_OBJS =	cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o cpptrad.o \
@@ -2353,8 +2358,17 @@ fixinc.sh: $(FIXINCSRCDIR)/mkfixinc.sh $
 	export MAKE srcdir CC CFLAGS LDFLAGS WARN_CFLAGS; cd ./fixinc && \
 	$(SHELL) $${srcdir}/mkfixinc.sh $(build_canonical) $(target))
 
+.PHONY: install-gcc-tooldir
+install-gcc-tooldir:
+	$(SHELL) ${srcdir}/mkinstalldirs $(gcc_tooldir)
+
 # Build fixed copies of system files.
 stmp-fixinc: fixinc.sh gsyslimits.h
+	@if test ! -d ${SYSTEM_HEADER_DIR}; then \
+	  echo The directory that should contain system headers does not exist: >&2 ; \
+	  echo "  ${SYSTEM_HEADER_DIR}" >&2 ; \
+	  exit 1; \
+	fi
 	rm -rf include; mkdir include
 	-chmod a+rx include
 	(TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD}`; \
@@ -2368,20 +2382,6 @@ stmp-fixinc: fixinc.sh gsyslimits.h
 	  cp $(srcdir)/gsyslimits.h include/syslimits.h; \
 	fi; \
 	chmod a+r include/syslimits.h)
-# If $(SYSTEM_HEADER_DIR) is $(build_tooldir)/sys-include, and
-# that directory exists, then make sure that $(libsubdir) exists.
-# This is because cpp is compiled to find $(gcc_tooldir)/include via
-# $(libsubdir)/$(unlibsubdir), which will only work if $(libsubdir)
-# exists.
-# ??? Better would be to use -isystem $(build_tooldir)/sys-include,
-# but fixincludes does not take such arguments.
-	if [ "$(SYSTEM_HEADER_DIR)" = "$(build_tooldir)/sys-include" ] \
-	   && [ -d $(build_tooldir)/sys-include ]; then \
-	  if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi; \
-	  if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib; fi; \
-	  if [ -d $(libdir)/gcc-lib/$(target_alias) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias) ; fi; \
-	  if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version) ; fi; \
-	else true; fi
 	$(STAMP) stmp-fixinc
 
 # Files related to the fixproto script.
@@ -2390,7 +2390,7 @@ stmp-fixinc: fixinc.sh gsyslimits.h
 # libiberty.a.
 
 deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
-	if [ -d $(SYSTEM_HEADER_DIR) ]; \
+	if [ -d "$(SYSTEM_HEADER_DIR)" ]; \
 	then \
 	  CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -I. -I$(srcdir) -isystem include -isystem ${SYSTEM_HEADER_DIR}"; \
 	  export CC; \
@@ -2456,7 +2456,7 @@ stmp-fixproto: fixhdr.ready fixproto stm
 	  FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"; export FIXPROTO_DEFINES; \
 	  mkinstalldirs="$(SHELL) $(srcdir)/mkinstalldirs"; \
 	    export mkinstalldirs; \
-	  if [ -d $(SYSTEM_HEADER_DIR) ] ; then \
+	  if [ -d "$(SYSTEM_HEADER_DIR)" ]; then \
 	    $(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \
 	    if [ $$? -eq 0 ] ; then true ; else exit 1 ; fi ; \
 	  else true; fi; \
@@ -3040,7 +3040,7 @@ install-mkheaders: stmp-int-hdrs $(STMP_
 		$(itoolsdir)/fix-header$(build_exeext) ; \
 	else :; fi
 	$(INSTALL_PROGRAM) mkheaders $(itoolsdir)/mkheaders
-	echo 'SYSTEM_HEADER_DIR="$(SYSTEM_HEADER_DIR)"' \
+	echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
 		> $(itoolsdir)/mkheaders.conf
 	echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \
 		>> $(itoolsdir)/mkheaders.conf
Index: gcc/configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.617.4.3
diff -u -p -r1.617.4.3 configure.in
--- gcc/configure.in 3 Oct 2002 06:21:21 -0000 1.617.4.3
+++ gcc/configure.in 19 Oct 2002 21:30:18 -0000
@@ -373,6 +373,25 @@ AC_ARG_ENABLE(shared,
 ], [enable_shared=yes])
 AC_SUBST(enable_shared)
 
+AC_ARG_WITH(sysroot,
+[  --with-sysroot[=DIR] Search for usr/lib, usr/include, et al, within DIR.],
+[
+ case ${with_sysroot} in
+ yes) TARGET_SYSTEM_ROOT='${gcc_tooldir}/sys-root' ;;
+ *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
+ esac
+   
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
+ CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR)'
+], [
+ TARGET_SYSTEM_ROOT=
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=0'
+ CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include'
+])
+AC_SUBST(TARGET_SYSTEM_ROOT)
+AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
+AC_SUBST(CROSS_SYSTEM_HEADER_DIR)
+
 # Determine the host, build, and target systems
 AC_CANONICAL_SYSTEM
 
@@ -1183,12 +1202,9 @@ fi
 # This prevents libgcc2 from containing any code which requires libc
 # support.
 inhibit_libc=
-if [test x$host != x$target] && [test x$with_headers = x]; then
+if { test x$host != x$target && test "x$with_headers" = x &&
+     test "x$with_sysroot" = x ; } || test x$with_newlib = xyes ; then
        inhibit_libc=-Dinhibit_libc
-else
-       if [test x$with_newlib = xyes]; then
-               inhibit_libc=-Dinhibit_libc
-       fi
 fi
 AC_SUBST(inhibit_libc)
 
Index: gcc/gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.336.4.8
diff -u -p -r1.336.4.8 gcc.c
--- gcc/gcc.c 15 Oct 2002 01:32:53 -0000 1.336.4.8
+++ gcc/gcc.c 19 Oct 2002 21:30:23 -0000
@@ -197,6 +197,11 @@ static int target_help_flag;
 
 static int report_times;
 
+/* Nonzero means place this string before uses of /, so that include
+   and library files can be found in an alternate location.  */
+
+static const char *target_system_root = TARGET_SYSTEM_ROOT;
+
 /* Nonzero means write "temp" files in source directory
    and use the source file's name in them, and don't delete them.  */
 
@@ -289,6 +294,8 @@ static char *find_a_file	PARAMS ((struct
 					 int, int));
 static void add_prefix		PARAMS ((struct path_prefix *, const char *,
 					 const char *, int, int, int *, int));
+static void add_sysrooted_prefix PARAMS ((struct path_prefix *, const char *,
+					  const char *, int, int, int *, int));
 static void translate_options	PARAMS ((int *, const char *const **));
 static char *skip_whitespace	PARAMS ((char *));
 static void delete_if_ordinary	PARAMS ((const char *));
@@ -2771,6 +2778,33 @@ add_prefix (pprefix, prefix, component, 
   pl->next = (*prev);
   (*prev) = pl;
 }
+
+/* Same as add_prefix, but prepending target_system_root to prefix.  */
+static void
+add_sysrooted_prefix (pprefix, prefix, component, priority,
+		      require_machine_suffix, warn, os_multilib)
+     struct path_prefix *pprefix;
+     const char *prefix;
+     const char *component;
+     /* enum prefix_priority */ int priority;
+     int require_machine_suffix;
+     int *warn;
+     int os_multilib;
+{
+  if (!IS_ABSOLUTE_PATHNAME (prefix))
+    abort ();
+
+  if (target_system_root)
+    {
+      prefix = concat (target_system_root, prefix, NULL);
+      /* We have to override this because GCC's notion of sysroot
+	 moves along with GCC.  */
+      component = "GCC";
+    }
+
+  add_prefix (pprefix, prefix, component, priority,
+	      require_machine_suffix, warn, os_multilib);
+}
 
 /* Execute the command specified by the arguments on the current line of spec.
    When using pipes, this includes several piped-together commands
@@ -3935,6 +3969,15 @@ warranty; not even for MERCHANTABILITY o
 	      concat (tooldir_prefix, "lib", dir_separator_str, NULL),
 	      "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
 
+  if (target_system_root && gcc_exec_prefix)
+    {
+      char *tmp_prefix = make_relative_prefix (argv[0],
+					       standard_bindir_prefix,
+					       target_system_root);
+      if (tmp_prefix && access_check (tmp_prefix, F_OK) == 0)
+	target_system_root = tmp_prefix;
+    }
+
   /* More prefixes are enabled in main, after we read the specs file
      and determine whether this is cross-compilation or not.  */
 
@@ -5140,6 +5183,14 @@ do_spec_1 (spec, inswitch, soft_matched_
 	    }
 	    break;
 
+	  case 'R':
+	    /* We assume there is a directory
+	       separator at the end of this string.  */
+	    if (target_system_root)
+	      obstack_grow (&obstack, target_system_root, 
+			    strlen (target_system_root));
+	    break;
+
 	  case 'S':
 	    value = do_spec_1 (startfile_spec, 0, NULL);
 	    if (value != 0)
@@ -6078,34 +6129,51 @@ main (argc, argv)
   if (access (specs_file, R_OK) == 0)
     read_specs (specs_file, TRUE);
 
-  /* If not cross-compiling, look for startfiles in the standard places.
-     Similarly, don't add the standard prefixes if startfile handling
-     will be under control of startfile_prefix_spec.  */
-  if (*cross_compile == '0' && *startfile_prefix_spec == 0)
+  /* If not cross-compiling, look for executables in the standard
+     places.  */
+  if (*cross_compile == '0')
     {
       if (*md_exec_prefix)
 	{
 	  add_prefix (&exec_prefixes, md_exec_prefix, "GCC",
 		      PREFIX_PRIORITY_LAST, 0, NULL, 0);
-	  add_prefix (&startfile_prefixes, md_exec_prefix, "GCC",
-		      PREFIX_PRIORITY_LAST, 0, NULL, 0);
 	}
+    }
+
+  /* Look for startfiles in the standard places.  */
+  if (*startfile_prefix_spec != 0
+      && do_spec_2 (startfile_prefix_spec) == 0
+      && do_spec_1 (" ", 0, NULL) == 0)
+    {
+      int ndx;
+      for (ndx = 0; ndx < argbuf_index; ndx++)
+	add_sysrooted_prefix (&startfile_prefixes, argbuf[ndx], "BINUTILS",
+			      PREFIX_PRIORITY_LAST, 0, NULL, 1);
+    }
+  /* We should eventually get rid of all these and stick to
+     startfile_prefix_spec exclusively.  */
+  else if (*cross_compile == '0' || target_system_root)
+    {
+      if (*md_exec_prefix)
+	add_sysrooted_prefix (&startfile_prefixes, md_exec_prefix, "GCC",
+			      PREFIX_PRIORITY_LAST, 0, NULL, 1);
 
       if (*md_startfile_prefix)
-	add_prefix (&startfile_prefixes, md_startfile_prefix, "GCC",
-		    PREFIX_PRIORITY_LAST, 0, NULL, 1);
+	add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix,
+			      "GCC", PREFIX_PRIORITY_LAST, 0, NULL, 1);
 
       if (*md_startfile_prefix_1)
-	add_prefix (&startfile_prefixes, md_startfile_prefix_1, "GCC",
-		    PREFIX_PRIORITY_LAST, 0, NULL, 1);
+	add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix_1,
+			      "GCC", PREFIX_PRIORITY_LAST, 0, NULL, 1);
 
       /* If standard_startfile_prefix is relative, base it on
 	 standard_exec_prefix.  This lets us move the installed tree
 	 as a unit.  If GCC_EXEC_PREFIX is defined, base
 	 standard_startfile_prefix on that as well.  */
       if (IS_ABSOLUTE_PATHNAME (standard_startfile_prefix))
-	add_prefix (&startfile_prefixes, standard_startfile_prefix, "BINUTILS",
-		    PREFIX_PRIORITY_LAST, 0, NULL, 1);
+	add_sysrooted_prefix (&startfile_prefixes,
+			      standard_startfile_prefix, "BINUTILS",
+			      PREFIX_PRIORITY_LAST, 0, NULL, 1);
       else
 	{
 	  if (gcc_exec_prefix)
@@ -6120,33 +6188,14 @@ main (argc, argv)
 		      NULL, PREFIX_PRIORITY_LAST, 0, NULL, 1);
 	}
 
-      add_prefix (&startfile_prefixes, standard_startfile_prefix_1,
-		  "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
-      add_prefix (&startfile_prefixes, standard_startfile_prefix_2,
-		  "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
+      add_sysrooted_prefix (&startfile_prefixes, standard_startfile_prefix_1,
+			    "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
+      add_sysrooted_prefix (&startfile_prefixes, standard_startfile_prefix_2,
+			    "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
 #if 0 /* Can cause surprises, and one can use -B./ instead.  */
       add_prefix (&startfile_prefixes, "./", NULL,
 		  PREFIX_PRIORITY_LAST, 1, NULL, 0);
 #endif
-    }
-  else
-    {
-      if (!IS_ABSOLUTE_PATHNAME (standard_startfile_prefix)
-	  && gcc_exec_prefix)
-	add_prefix (&startfile_prefixes,
-		    concat (gcc_exec_prefix, machine_suffix,
-			    standard_startfile_prefix, NULL),
-		    "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
-    }
-
-  if (*startfile_prefix_spec != 0
-      && do_spec_2 (startfile_prefix_spec) == 0
-      && do_spec_1 (" ", 0, NULL) == 0)
-    {
-      int ndx;
-      for (ndx = 0; ndx < argbuf_index; ndx++)
-	add_prefix (&startfile_prefixes, argbuf[ndx], "BINUTILS",
-		    PREFIX_PRIORITY_LAST, 0, NULL, 1);
     }
 
   /* Process any user specified specs in the order given on the command
Index: gcc/config/interix.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/interix.h,v
retrieving revision 1.7.8.2
diff -u -p -r1.7.8.2 interix.h
--- gcc/config/interix.h 1 Oct 2002 17:31:58 -0000 1.7.8.2
+++ gcc/config/interix.h 19 Oct 2002 21:30:24 -0000
@@ -70,19 +70,6 @@ for windows/multi thread */
   && strcmp (STR, "Tbss"))
 
 
-#if 0	
-/* don't do this until we can sort out the default path issues. MK */
-#undef STANDARD_EXEC_PREFIX
-#define STANDARD_EXEC_PREFIX ""
-
-#undef STANDARD_STARTFILE_PREFIX
-#define STANDARD_STARTFILE_PREFIX ""
-
-#undef TOOLDIR_BASE_PREFIX
-#define TOOLDIR_BASE_PREFIX ""
-
-#endif /* 0 */
-
 #define STDC_0_IN_SYSTEM_HEADERS 1
 
 #define HANDLE_SYSV_PRAGMA
Index: gcc/config/mips/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/linux.h,v
retrieving revision 1.52
diff -u -p -r1.52 linux.h
--- gcc/config/mips/linux.h 21 Aug 2002 02:41:49 -0000 1.52
+++ gcc/config/mips/linux.h 19 Oct 2002 21:30:24 -0000
@@ -252,3 +252,9 @@ void FN ()							\
 /* The current Linux binutils uses MIPS_STABS_ELF and doesn't support
    COFF.  */
 #undef SDB_DEBUGGING_INFO
+
+#undef LIB_SPEC
+#define LIB_SPEC "\
+%{!static:-rpath-link %R/lib:%R/usr/lib} \
+%{!shared: %{pthread:-lthread} \
+  %{profile:-lc_p} %{!profile: -lc}}"
Index: gcc/config/sh/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/linux.h,v
retrieving revision 1.9
diff -u -p -r1.9 linux.h
--- gcc/config/sh/linux.h 13 Jun 2002 19:23:27 -0000 1.9
+++ gcc/config/sh/linux.h 19 Oct 2002 21:30:25 -0000
@@ -55,6 +55,7 @@ do { \
 #undef LIB_SPEC
 #define LIB_SPEC \
   "%{shared: -lc} \
+   %{!static:-rpath-link %R/lib:%R/usr/lib} \
    %{!shared: %{pthread:-lthread} \
      %{profile:-lc_p} %{!profile: -lc}}"
 
Index: gcc/doc/install.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/install.texi,v
retrieving revision 1.136.2.3
diff -u -p -r1.136.2.3 install.texi
--- gcc/doc/install.texi 1 Oct 2002 17:32:34 -0000 1.136.2.3
+++ gcc/doc/install.texi 19 Oct 2002 21:30:28 -0000
@@ -883,8 +883,29 @@ forward to maintain the port.
 
 Some options which only apply to building cross compilers:
 @table @code
+@item --with-sysroot
+@itemx --with-sysroot=@var{dir}
+Tells GCC to consider @var{dir} as the root of a tree that contains a
+(subset of) the root filesystem of the target operating system.
+Target system headers, libraries and run-time object files will be
+searched in there.  The specified directory is not copied into the
+install tree, unlike the options @option{--with-headers} and
+@option{--with-libs} that this option obsoletes.  The default value,
+in case @option{--with-sysroot} is not given an argument, is
+@option{$@{gcc_tooldir@}/sys-root}.  Starting the pathname with
+@option{$@{gcc_tooldir@}/}, in such a way that this variable is not
+expanded by the shell, but rather by the gcc Makefile, enables the
+target sysroot directory to be relocatable along with the entire
+install tree, but it will require the gcc tool directory to be created
+@emph{before} the build is started.  This directory, as well as its
+intermediate pathnames, can be easily created by running @command{make
+install-gcc-tooldir} the gcc build directory.  This is not done
+automatically to avoid touching the install tree without explicit
+permission.
+
 @item --with-headers
 @itemx --with-headers=@var{dir}
+Deprecated in favor of @option{--with-sysroot}.
 Specifies that target headers are available when building a cross compiler.
 The @var{dir} argument specifies a directory which has the target include
 files.  These include files will be copied into the @file{gcc} install
@@ -895,6 +916,7 @@ pre-exist, the @var{dir} argument may be
 will be run on these files to make them compatible with GCC.
 @item --with-libs
 @itemx --with-libs=``@var{dir1} @var{dir2} @dots{} @var{dirN}''
+Deprecated in favor of @option{--with-sysroot}.
 Specifies a list of directories which contain the target runtime
 libraries.  These libraries will be copied into the @file{gcc} install
 directory.  If the directory list is omitted, this option has no
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]