[PATCH v2 app-xdm 1/1] config: add "Check for system libraries" section
Gaetan Nadon
memsize at videotron.ca
Thu Oct 21 13:46:43 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 pam_open_session... no
checking for library containing is_selinux_enabled... -lselinux
checking for library containing arc4random... -lbsd
checking for library containing crypt... -lcrypt
In the Makefile, libs are pre-pended:
LIBS = -lcrypt -lbsd -lselinux
Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
=========== Second edition ===========
Changed GNU/Linux to GNU systems
Changed comment for the crypto library
configure.ac | 35 +++++++++++++++++++++++++++++++++--
1 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 72a08fd..7925ebc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,6 +53,39 @@ 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 pam_open_session is in -lpam
+AC_SEARCH_LIBS([pam_open_session], [pam])
+
+# Function is_selinux_enabled is in -lselinux
+AC_SEARCH_LIBS(is_selinux_enabled, [selinux])
+
+# 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 +433,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