[GRASS-dev] Checking for compilation errors

Paul Kelly paul-grass at stjohnspoint.co.uk
Wed Aug 16 07:12:24 EDT 2006


On Wed, 16 Aug 2006, [utf-8] M?ris Narti?s wrote:

> Hi, sorry for my lameness,
>
> I have script like ./configure, make, make install. Problem is - how to check
> where some errors during compilation? They are printed to console, but how to
> check them from script? Just to issue ERROR instead of proceeding with make
> install.

If you apply the patch below to Makefile, it will cause make to exit 
with an error code instead of success if there have been any errors (i.e. 
there are more than 8 lines in error.log!). It currently always exits with
success which is arguably not correct behaviour.

After this is applied you can do
./configure && make && make install
so it will only continue to make install if make exits with a successful 
return code.

It would seem like a good idea to apply this patch or a variant to CVS; 
does anybody disagree? Perhaps the format and generation of error.log 
could be tidied though; maybe now would be the time to do that.

Paul


Index: Makefile
===================================================================
RCS file: /grassrepository/grass6/Makefile,v
retrieving revision 1.101
diff -u -r1.101 Makefile
--- Makefile    10 Aug 2006 08:23:53 -0000      1.101
+++ Makefile    16 Aug 2006 11:06:29 -0000
@@ -93,6 +93,7 @@
         @echo "Finished compilation: `date`" >> $(GRASS_HOME)/error.log
         @echo "(In case of errors please change into the directory with error and run 'make')" >> $(GRASS_HOME)/error.log
         @cat $(GRASS_HOME)/error.log
+       @if [ `cat "$(GRASS_HOME)/error.log" | wc -l` -gt 8 ] ; then false ; else true ; fi

  LIBDIRS = \
         lib/external/shapelib \




More information about the grass-dev mailing list