[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#772642: cpp-4.9: please support multiarch for the user search paths (CPATH, etc.)



On 2015-05-03 18:33:12 +0200, Matthias Klose wrote:
> On 12/09/2014 03:03 PM, Vincent Lefevre wrote:
> > cpp currently supports multiarch search paths for /usr/local and /usr,
> > but not for directories supplied via environment variables like $CPATH
> > and $C_INCLUDE_PATH. For instance, "cpp -v" gives:
> > 
> > /usr/local/include/x86_64-linux-gnu
> > /usr/local/include
> > [...]
> > /usr/include/x86_64-linux-gnu
> > /usr/include
> > 
> > and when adding the -m32 option:
> > 
> > /usr/local/include/i386-linux-gnu
> > /usr/local/include
> > [...]
> > /usr/include/i386-linux-gnu
> > /usr/include
> > 
> > But if I use CPATH=/home/vlefevre/include, I just get:
> > 
> > /home/vlefevre/include
> > 
> > Adding the other directory to $CPATH is not a good solution because
> > one doesn't always know the ABI (whether -m32 is present or not) in
> > advance, i.e. one doesn't know in advance which directory to add.
> 
> the preprocessor doesn't know anything about "/home/vlefevre/include".
> what should it append?

It should follow the same convention as the system directories.
For instance, if I use CPATH=/home/vlefevre/include then it should
add:

  /home/vlefevre/include/x86_64-linux-gnu
  /home/vlefevre/include

for x86_64 compilation, and

  /home/vlefevre/include/i386-linux-gnu
  /home/vlefevre/include

for i386 compilation (i.e. with -m32).

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: