LMS-Community / slimserver-vendor

Third-party software used with Lyrion Music Server
https://lyrion.org
42 stars 68 forks source link

buildme.sh does some daft greps on FreeBSD #55

Closed mnd999 closed 6 years ago

mnd999 commented 6 years ago

buildme.sh does some greps on FreeBSD to pull the C compiler overrides out of make.conf. These greps are not safe:

        MAKE_CC=`grep CC /etc/make.conf | grep -v CCACHE | grep -v \# | sed 's#CC=##g'`
        MAKE_CXX=`grep CXX /etc/make.conf | grep -v CCACHE | grep -v \# | sed 's#CXX=##g'`
        MAKE_CPP=`grep CPP /etc/make.conf | grep -v CCACHE | grep -v \# | sed 's#CPP=##g'`

What you probably want is something like:

        MAKE_CC=`grep ^CC= /etc/make.conf | grep -v CCACHE | grep -v \# | sed 's#CC=##g'`
        MAKE_CXX=`grep ^CXX= /etc/make.conf | grep -v CCACHE | grep -v \# | sed 's#CXX=##g'`
        MAKE_CPP=`grep ^CPP= /etc/make.conf | grep -v CCACHE | grep -v \# | sed 's#CPP=##g'`

At present if you have anything containing CC in your make.conf it will screw up the build. LICENSES_ACCEPTED=SDL is a pretty common line in make.conf for building logitechmediaserver, and this will produce the following confusing output as it thinks the license line is the C compiler:

RUN_TESTS:1 CLEAN:1 USE_HINTS:1 target all
LICENSES_ACCEPTED=SDL not found - please install it
mherger commented 6 years ago

@fsbruva - could you please review the relevant changes and come up with a pull request?

fsbruva commented 6 years ago

@mnd999 Have you tested your proposed changes? Do you have a PR already?

mnd999 commented 6 years ago

No, not tested. That was off the top of my head.

mnd999 commented 6 years ago

Actually, perl -lne 'print $1 if /^CC=(\S+)/' would be even better (since we depend on perl, why not use it?). Unfortunately, we haven't located perl yet at this point of the script so some reordering would be required.

mnd999 commented 6 years ago

Created a PR - https://github.com/Logitech/slimserver-vendor/pull/56

mnd999 commented 6 years ago

This was fixed.