logic error in build/rrd.sh?

Craig Cook Craig.Cook at carquest.com
Wed May 27 18:14:28 CEST 2009


A co-worker discovered my compile issue with Hobbit 4.3.0-beta2.  Looks like it has been an issue since 4.2.0 though.

This is a for loop.  The last found instance of librrd.so is used, not the first.  Also,  the search path is hard coded.


        for DIR in /opt/rrdtool* /usr/local/rrdtool* /usr/local /usr /usr/pkg /opt/csw /opt/sfw /usr/sfw

        do

                if test -f $DIR/include/rrd.h

                then

                        RRDINC=$DIR/include

                fi



                if test -f $DIR/lib/librrd.so

                then

                        RRDLIB=$DIR/lib

                fi

                if test -f $DIR/lib/librrd.a

                then

                        RRDLIB=$DIR/lib

                fi

                if test -f $DIR/lib64/librrd.so

                then

                        RRDLIB=$DIR/lib64

                fi

                if test -f $DIR/lib64/librrd.a

                then

                        RRDLIB=$DIR/lib64

                fi



                if test -f $DIR/lib/libpng.so

                then

                        PNGLIB="-L$DIR/lib -lpng"

                fi

                if test -f $DIR/lib/libpng.a

                then

                        PNGLIB="-L$DIR/lib -lpng"

                fi

                if test -f $DIR/lib64/libpng.so

                then

                        PNGLIB="-L$DIR/lib64 -lpng"

                fi

                if test -f $DIR/lib64/libpng.a

                then

                        PNGLIB="-L$DIR/lib64 -l





The current workaround is something like this



Manually edit the Makefile and add something like this



ifdef PCRELIBS

# PCRE settings

PCRELIBS = -L/usr/local/lib -lpcre -lpng endif



ifdef RRDLIBS

RRDLIBS = -L/usr/local/rrdtool-1.2.19/lib -lrrd -L/usr/lib Endif



Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20090527/67d34f18/attachment.html>


More information about the Xymon mailing list