From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nix To: "John David Anglin" Cc: gcc@gcc.gnu.org, jgarzik@mandrakesoft.com Subject: Re: gcc 3.2's cpp breaks configure scripts Date: Mon, 12 Aug 2002 14:40:00 -0000 Message-id: <87d6snpxik.fsf@amaterasu.srvr.nix> References: <200208111727.g7BHR6Ml023343@hiauly1.hia.nrc.ca> X-SW-Source: 2002-08/msg00689.html On Sun, 11 Aug 2002, John David Anglin mused: > Jeff, > >> cpp is spitting out a warning about changing the search order of include >> directories, and this is breaking a _ton_ of configure scripts. I found >> this when I started rebuilding Mandrake with gcc-3.2 branch. > > You might try the patch below and see if it fixes your problem. It is a > variant for gcc-3.2 branch of the patch proposed in this message for the > main: < http://gcc.gnu.org/ml/gcc-patches/2002-08/msg00708.html >. Nice :) > + This algorithm is quadratic in the number of -I switches, which is > + acceptable since there aren't usually that many of them. */ You could invert it to yield something that was quadratic in the number of system directories, which might be preferable since the number of system directories is fixed and may be quite low compared to the silly number of -I flags used by some programs (look at Evolution build one of these days); something like static struct search_path * remove_dup_nonsys_dirs (pfile, head_ptr, end) cpp_reader *pfile; struct search_path **head_ptr; struct search_path *end; { struct search_path *cur; for (cur = *head_ptr; cur != end; cur = cur ? cur->next : *head_ptr) if (cur->sysp) { struct search_path *prev, *other; for (other = *head_ptr, prev = NULL; other && other != cur; other = other->next) { if (INO_T_EQ (cur->ino, other->ino) && cur->dev == other->dev && !(other->sysp)) { other = remove_dup_dir (pfile, prev, head_ptr); break; } prev = other; } } return prev; } (I'm not sure whether the head_ptr manipulation in the outer loop is needed anymore, and this is utterly untested). > +system include directories, GCC will ignore the option so that system > +directories are continued to be processed in the correct order. This s/are continued to be/continue to be/ > +Sites that need to install multiple versions of GCC may not want to > +use the above simple configuration. It is possible to use the > +@option{--program-prefix}, @option{--program-suffix} and > +@option{--program-transform-name} options to install multiple versions > +into a single directory, Even though I've done this myself forever, it *is* quite tricky to keep libstdc++ working for multiple GCC versions in that situation. (--enable-version-specific-runtime-libs or waiting for GCC 3.3 is the solution to that, of course.) -- `There's something satisfying about killing JWZ over and over again.' -- 1i, personal communication