Am 02.11.2012 18:37, schrieb Ian Lance Taylor: > On Fri, Nov 2, 2012 at 6:26 AM, Matthias Klose wrote: >> >>> +ifeq ($(enable_multiarch),yes) >>> + if_multiarch = $(1) >>> +else ifeq ($(enable_multiarch),auto-detect) >>> + if_multiarch = $(if $(wildcard $(shell echo >>> $(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1)) >>> +else >>> + if_multiarch = >>> +endif >>> >>> This is nicely tricky but I don't understand why you are doing this in >>> such a confusing way. Why not simply set the names in config.gcc? >>> What information do you have at make time that you don't have at >>> configure time? >> >> >> this is for the auto case. SYSTEM_HEADER_DIR is not accessible/available >> from >> config.gcc. This is the same approach as taken for MULTILIB_OSDDIRNAMES. >> Also setting the names for the multiarch directories in the same place as >> done for for the MULTILIB_OSDIRNAMES seems to be better choice. > > SYSTEM_HEADER_DIR is available in gcc/configure.ac, and you could do > the $(if $(wildcard $(shell echo >>> $(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o) there. I can't see any reason to do it at make time rather than configure time. in the thread starting at http://gcc.gnu.org/ml/gcc-patches/2007-09/msg00696.html it was suggested to use this construct. SYSTEM_HEADER_DIR is in Makefile syntax, and cannot be evaluated in configure.ac. Now you could add a SYSTEM_HEADER_DIR_sh variable to track the same configuration in shell syntax, but this seems to be error prone to maintain. Plus the Makefile has the comment for this macro saying "to be overridden by targets". For now, I added a comment in the Makefile.in, why SYSTEM_HEADER_DIR cannot be used in configure.ac. >> + if (*q2 == ':') >> + end = q2; > > Don't reuse end here. Use a new variable. done. > Please update the comment for set_multilib_dir. It's not a very good > comment, but it does describe the syntax, and you seem to be changing > the syntax. added: A subdirectory name is optionally followed by a colon and the corresponding multiarch name. >> - if (this_path[0] == '.' && this_path[1] == ':') >> + if (this_path[0] == '.' && this_path[1] == ':' && this_path[2] != ':') > > The existing comment here is reasonably clear. Please update the > comment to show why this change is correct. updated comment: /* When --disable-multilib was used but target defines MULTILIB_OSDIRNAMES, entries starting with .: (and not starting with .:: for multiarch configurations) are there just to find multilib_os_dir, so skip them from output. */ >> +Specify wether to enable or disable multiarch support. The default is > > s/wether/whether/ > >> +to detect for glibc start files in a multiarch location, and enable it > > s/detect/check/ or something along those lines. done. now testing the attached patch. Matthias