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

Gaetan Nadon memsize at videotron.ca
Mon Oct 25 17:21:33 PDT 2010


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..2833010 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 name service library (nsl)
+AC_SEARCH_LIBS([getifaddrs], [nsl])
+
+# Function getspnam comes from the C library, Sysmtem 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])
+
+# The crypto library comes from OpenSSL
+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)
 
-- 
1.6.0.4



More information about the xorg-devel mailing list