[Libclc-dev] Ninja build is broken

Tom Stellard tom at stellard.net
Fri Jan 17 13:28:44 PST 2014


On Fri, Jan 17, 2014 at 06:26:21PM +0000, Daniel Liew wrote:
> Hi All,
> 
> I was just playing around to see if building libclc with Ninja works
> and it's broken. It appears this is due to the $(DESTDIR) that appears
> in the install command.
> 

I don't think anyone is actively using ninja with libclc, so I'm not surprised
it doesn't work.  Patches to fix this are welcomed.

-Tom

> $ ./configure.py -g ninja
> $ ninja
> ninja: error: build.ninja:197: bad $-escape (literal $ must be written as $$)
>   command = mkdir -p $(DESTDIR)//usr/local/lib/clc && cp -r $
>                      ^ near here
> 
> 
> The trouble is I don't think there is anyway to have $(DESTDIR) work
> because AFAIK you can't pass variable assignments to Ninja.
> 
> I also tried escaping the '$' and changing the $() to a ${} so that
> ${DESTDIR} is passed to the shell, i.e. in build.ninja
> 
> rule install
>   command = mkdir -p $${DESTDIR}//usr/local/lib/clc && cp -r $
>       built_libs/nvptx--bugle.bc $${DESTDIR}//usr/local/lib/clc && mkdir -p $
>       $${DESTDIR}//usr/local/include && cp -r ./generic/include/clc $
>       $${DESTDIR}//usr/local/include && mkdir -p $
>       $${DESTDIR}//usr/local/share/pkgconfig && cp -r libclc.pc $
>       $${DESTDIR}//usr/local/share/pkgconfig
>   description = INSTALL
> 
> and then trying to run:
> 
> $ DESTDIR=xxx ninja install
> 
> but the environment variable is not being expanded by the shell (I
> confirmed that the variable was in the shell environment by adding "
> env & " to the beginning the of the install command).
> 
> Any thoughts?
> 
> Thanks,
> Dan.
> 
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at pcc.me.uk
> http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev




More information about the Libclc-dev mailing list