[Mesa-dev] [PATCH v3 08/25] configure.ac: Move LLVM version check to the top
Tobias Droste
tdroste at gmx.de
Wed Oct 12 18:11:09 UTC 2016
Am Mittwoch, 12. Oktober 2016, 10:11:50 CEST schrieb Emil Velikov:
> On 12 October 2016 at 00:02, Tobias Droste <tdroste at gmx.de> wrote:
> > A function with the LLVM version checked is moved to the top.
> > The function is called where the old code was.
>
> Replace the second line with "... in order to reuse/rework X"
>
> > No functional change.
> >
> > Signed-off-by: Tobias Droste <tdroste at gmx.de>
> > ---
> >
> > configure.ac | 91
> > ++++++++++++++++++++++++++++++++---------------------------- 1 file
> > changed, 49 insertions(+), 42 deletions(-)
> >
> > diff --git a/configure.ac b/configure.ac
> > index 933e7b5..0f19a4f 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -861,6 +861,54 @@ fi
> >
> > AC_SUBST([SELINUX_CFLAGS])
> > AC_SUBST([SELINUX_LIBS])
> >
> > +dnl
> > +dnl LLVM
> > +dnl
> > +llvm_get_version() {
>
> Nit: The code below does a lot more than "get_version" -
> get_environment/set_variables/other
Any ideas? :-D
>
> With the above
> Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
>
> > + if test -z "${LLVM_CONFIG}"; then
> > + if test -n "$llvm_prefix"; then
> > + AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no],
> > ["$llvm_prefix/bin"]) + else
> > + AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no])
> > + fi
> > + fi
> > +
> > + if test "x$LLVM_CONFIG" != xno; then
> > + LLVM_VERSION=`$LLVM_CONFIG --version | egrep -o '^[[0-9.]]+'`
>
> ...
>
> > + else
> > + MESA_LLVM=0
> > + LLVM_VERSION_INT=0
>
> Just realised that we should error out in this case. After all one
> requests llvm, so silently ignoring that they're missing llvm-config
> isn't a smart idea. Something like below (be that as a preparatory,
> in-between or at the end of the series) would be great.
At this point in time we don't know if we actually need LLVM.
This will be handled by all the llvm_check_version_for() calls for each
driver.
This has also the advantage, that you not only know that you need LLVM but you
also know which version!
>
> if test "x$LLVM_CONFIG" = xno; then
> AC_MSG_ERROR([...])
> fi
>
> LLVM_VERSION=...
> ...
>
> -Emil
More information about the mesa-dev
mailing list