[PATCH v2] Support building when fts and obstack aren't part of libc.

Dmitry V. Levin ldv@altlinux.org
Tue Nov 3 22:33:15 GMT 2020


On Sun, Nov 01, 2020 at 09:48:50PM -0300, Érico Nogueira via Elfutils-devel wrote:
> From: Érico Rolim <erico.erc@gmail.com>
> 
> - Make configure.ac test for fts and obstack availability;
> - Add fts and obstack ldflags to all files that need them;
> - Add missing argp ldflags to programs in debuginfod/.
> 
> Signed-off-by: Érico Rolim <erico.erc@gmail.com>
> ---
>  ChangeLog              |  4 ++++
>  configure.ac           | 20 ++++++++++++++++++++
>  debuginfod/Makefile.am |  6 +++---
>  libdw/Makefile.am      |  2 +-
>  src/Makefile.am        |  6 +++---
>  5 files changed, 31 insertions(+), 7 deletions(-)
> 
> diff --git a/ChangeLog b/ChangeLog
> index 128da6c6..565d021c 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,7 @@
> +2020-11-01  Érico N. Rolim  <erico.erc@gmail.com>
> +
> +	* configure.ac: Check for fts and obstack from outside libc.
> +
>  2020-10-28  Mark Wielaard  <mark@klomp.org>
>  
>  	* configure.ac: Set version to 0.182.
> diff --git a/configure.ac b/configure.ac
> index 515ac704..c1a6954d 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -542,6 +542,26 @@ else
>  fi
>  AC_SUBST([argp_LDADD])
>  
> +saved_LIBS="$LIBS"
> +AC_SEARCH_LIBS([fts_close], [fts])
> +LIBS="$saved_LIBS"
> +case "$ac_cv_search_fts_close" in
> +        no) AC_MSG_FAILURE([failed to find fts_close]) ;;
> +        -l*) fts_LIBS="$ac_cv_search_fts_close" ;;
> +        *) fts_LIBS= ;;
> +esac
> +AC_SUBST([fts_LIBS])
> +
> +saved_LIBS="$LIBS"
> +AC_SEARCH_LIBS([_obstack_free], [obstack])
> +LIBS="$saved_LIBS"
> +case "$ac_cv_search__obstack_free" in
> +        no) AC_MSG_FAILURE([failed to find obstack_free]) ;;
> +        -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;;
> +        *) obstack_LIBS= ;;
> +esac
> +AC_SUBST([obstack_LIBS])
> +

Hmm.  In [1] I suggested to check for obstack_free, but
here I see you're checking for _obstack_free instead.
Since both symbols are provided by glibc, I wonder what was
the reason for this change.  Is it something to do with libobstack?

By the way, the text of AC_MSG_FAILURE is out of sync with the symbol name.

[1] https://sourceware.org/pipermail/elfutils-devel/2020q4/002970.html


-- 
ldv


More information about the Elfutils-devel mailing list