[Mesa-dev] [PATCH] configure: check for dladdr via AC_CHECK_FUNC/AC_CHECK_LIB

Emil Velikov emil.l.velikov at gmail.com
Fri Aug 8 13:30:46 PDT 2014


On 08/08/14 20:09, Jon TURNEY wrote:
> On 08/08/2014 18:58, Ilia Mirkin wrote:
>> The problem is that AC_CHECK_FUNCS would stick the LDFLAGS before the
>> conftest.c arg while AC_CHECK_LIB sticks the -ldl after conftest.c.
>> This apparently matters with newer gcc's. There's probably some
> 
> The key difference seems to be that lto was enabled, which I guess means we
> can't get away with listing objects in a random order :-)
> 
>> correct autoconf way of dealing with it, but... this works :)
> 
> I think I have used LDFLAGS here where I should have used LIBS.
> 
> So the more correct way is something like:
> 
Ouch... this seems like a trivial typo which we could have been spotted during
review. To make it even more "inspiring" I've pushed Pali's version :\ Feel
free to revert and/or commit this patch.

-Emil

> diff --git a/configure.ac b/configure.ac
> index 96a67a3..bba64a0 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -535,9 +535,10 @@ AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"],
>  AC_SUBST([DLOPEN_LIBS])
> 
>  dnl Check if that library also has dladdr
> -AC_CHECK_FUNC([dladdr], [DEFINES="$DEFINES -DHAVE_DLADDR"],
> -    [AC_CHECK_LIB([dl], [dladdr],
> -       [DEFINES="$DEFINES -DHAVE_DLADDR"])])
> +save_LIBS="$LIBS"
> +LIBS="$LIBS $DLOPEN_LIBS"
> +AC_CHECK_FUNCS([dladdr])
> +LIBS="$save_LIBS"
> 
>  case "$host_os" in
>  darwin*|mingw*)
> 
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list