[PATCH app-xdm v2 1/6] config: add "Check for system libraries" section

Alan Coopersmith alan.coopersmith at oracle.com
Tue Oct 26 16:51:01 PDT 2010


Gaetan Nadon wrote:
> This section gathers all the system libraries needed for
> xdm features. They may be in standard C library on some
> platforms and in discrete libraries on others.
> 
> Any xorg library is excluded from this section.
> XTRANS macros will be invoked at a later time and contribute
> additional libraries.
> 
> Although a function is used to search for the library, this
> should not be confused with function checking (AC_CHECK_FUNC).
> 
> Sample configuration output on GNU/Linux:
> checking for library containing getifaddrs... none required
> checking for library containing getspnam... none required
> checking for library containing setproctitle... no
> checking for library containing setusercontext... no
> checking for library containing arc4random... -lbsd
> checking for library containing crypt... -lcrypt
> 
> In the Makefile, libs are pre-pended:
> LIBS = -lcrypt -lbsd
> 
> Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
> ---
>  configure.ac |   29 +++++++++++++++++++++++++++--
>  1 files changed, 27 insertions(+), 2 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 72a08fd..7e35a20 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -53,6 +53,33 @@ XORG_WITH_LINT
>  AC_PATH_PROG(MKTEMP_COMMAND, mktemp)
>  AM_CONDITIONAL(HAVE_MKTEMP_COMMAND, test x$MKTEMP_COMMAND != x)
>  
> +#------------------------------------------------------------------------------
> +#			Check for system libraries
> +#
> +# AC_SEARCH_LIBS: tests using $LIBS and tests again with each listed library.
> +#                 pre-pends the found library to $LIBS.
> +#
> +#------------------------------------------------------------------------------
> +# Function getifaddrs() comes from the C library or the -lnsl name service library
> +AC_SEARCH_LIBS([getifaddrs], [nsl])
> +
> +# Function getspnam() comes from the C library, System V -lsec, UnixWare 7 -lgen
> +# or Old Linux versions -lshadow
> +AC_SEARCH_LIBS([getspnam], [sec gen shadow])
> +
> +# Function setproctitle() is in BSD -lutil or GNU systems -lbsd but N/A on Solaris
> +AC_SEARCH_LIBS([setproctitle], [util bsd])
> +
> +# Function setusercontext() is in BSD -lutil but N/A on Solaris or GNU systems
> +AC_SEARCH_LIBS([setusercontext], [util])
> +
> +# Function arc4random() is in BSD standard C or GNU systems -lbsd
> +AC_SEARCH_LIBS([arc4random], [bsd])
> +
> +# Function crypt() comes from the C library or the -lcrypt data encryption library
> +AC_SEARCH_LIBS(crypt, crypt)
> +#------------------------------------------------------------------------------
> +
>  m4_ifdef([AM_SILENT_RULES],[HAVE_AM_SILENT_RULES=yes])
>  AM_CONDITIONAL(HAVE_AM_SILENT_RULES, test x$HAVE_AM_SILENT_RULES != x)
>  
> @@ -400,8 +427,6 @@ fi
>  
>  AM_CONDITIONAL(HAS_XDM_AUTH, test x$xdmauth = xyes -a x$xdmauth_enable != xno)
>  
> -AC_SEARCH_LIBS(crypt, crypt)
> -
>  AC_SUBST(XDM_CFLAGS)
>  AC_SUBST(XDM_LIBS)
>  

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list