Here's the thing: we have several distros to build Debian packages on, but the thing is that one of them is older than another, and the name of deb packages, required for make are different.
For example, in Debian Jessie, there's a package liblog4cxx10-dev, which on Ubuntu and newer Debian distros is named as liblog4cxx-dev. If the packages is not installed - make returns fail, and this is correct behaviour for us.
Here's a part of code for Makefile:
all: build
#yadayadayada
ifeq ($(dpkg -l | grep -E '\sliblog4cxx10-dev:?'), )
build_dependences += liblog4cxx10-dev(>=0.10.0)
else
build_dependences += liblog4cxx-dev(>=0.10.0)
endif
# build_dependences += liblog4cxx10-dev(>=0.10.0)
# build_dependences += liblog4cxx-dev(>=0.10.0)
build_dependences += qos-libqos-dev(>=1.3.0)
build_dependences += libjsoncpp-dev(>=0.5.0)
I am trying to make a universal solution for newer and older distros, like:
if <package of Jessie repo is installed>
<add old package name to var>
elif <package of Bionic repo is installed (the case if we are building on newer distros, not Jessie, where older name of package exists)>
<add new package name to var>
endif
but Makefile syntax doesn't have normal elif. I need that snippet to check whether if package for Jessie or Bionic is installed to add package name to build_dependence var and start compiling.
Any suggestions?
Aucun commentaire:
Enregistrer un commentaire