[PATCH app-xdm 19/23] config: use AC_SEARCH_LIBS and AC_CHECK_FUNCS for setprocttile

Gaetan Nadon memsize at videotron.ca
Wed Sep 1 11:03:47 PDT 2010


It does the same thing, but on one line.
Added "bsd" on the libs search list for Debian.

Only difference is that -lutil is added to LIBS
so it is available to all targets. This is done elsewhere
for PAM and selinux checks.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 choose.c     |    2 +-
 configure.ac |   10 +---------
 dm.c         |    2 +-
 dm.h         |    2 +-
 session.c    |    2 +-
 5 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/choose.c b/choose.c
index 1e61047..c4cda8a 100644
--- a/choose.c
+++ b/choose.c
@@ -516,7 +516,7 @@ RunChooser (struct display *d)
     char    **env;
 
     Debug ("RunChooser %s\n", d->name);
-# ifndef HAS_SETPROCTITLE
+# ifndef HAVE_SETPROCTITLE
     SetTitle (d->name, "chooser", (char *) 0);
 # else
     setproctitle("chooser %s", d->name);
diff --git a/configure.ac b/configure.ac
index 288bfa7..2e251e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,15 +69,7 @@ AC_CHECK_FUNC(getifaddrs, AC_DEFINE(HAS_GETIFADDRS,1,
 AC_CHECK_FUNC(getspnam, AC_DEFINE(USESHADOW,1,
 	[Define to 1 if you have the shadow password functions.]))
 
-
-# According to the old Imakefile, FreeBSD has this in libutil
-AC_CHECK_FUNC(setproctitle, [HAS_SETPROCTITLE="yes"],
-	AC_CHECK_LIB(util, setproctitle, 
-		     [HAS_SETPROCTITLE="yes" ; XDM_OS_LIBS="$XDM_OS_LIBS -lutil"]))
-if test "x$HAS_SETPROCTITLE" = "xyes" ; then
-	AC_DEFINE(HAS_SETPROCTITLE,1,
-		[Define to 1 if you have the 'setproctitle' function.])
-fi
+AC_SEARCH_LIBS([setproctitle], [util bsd], [AC_CHECK_FUNCS(setproctitle)])
 
 # According to the old Imakefile, BSD/OS has this in libutil
 AC_CHECK_FUNC(setusercontext, [HAS_SETUSERCONTEXT="yes"],
diff --git a/dm.c b/dm.c
index 7016daf..858a06e 100644
--- a/dm.c
+++ b/dm.c
@@ -1004,7 +1004,7 @@ UnlockPidFile (void)
 }
 #endif
 
-#ifndef HAS_SETPROCTITLE
+#ifndef HAVE_SETPROCTITLE
 void SetTitle (char *name, ...)
 {
 # ifndef NOXDMTITLE
diff --git a/dm.h b/dm.h
index af50328..502cbb9 100644
--- a/dm.h
+++ b/dm.h
@@ -378,7 +378,7 @@ extern void BecomeOrphan (void);
 extern void CloseOnFork (void);
 extern void RegisterCloseOnFork (int fd);
 extern void StartDisplay (struct display *d);
-# ifndef HAS_SETPROCTITLE
+# ifndef HAVE_SETPROCTITLE
 extern void SetTitle (char *name, ...);
 # endif
 
diff --git a/session.c b/session.c
index 5be3276..ad216d3 100644
--- a/session.c
+++ b/session.c
@@ -330,7 +330,7 @@ ManageSession (struct display *d)
     Debug ("ManageSession %s\n", d->name);
     (void)XSetIOErrorHandler(IOErrorHandler);
     (void)XSetErrorHandler(ErrorHandler);
-#ifndef HAS_SETPROCTITLE
+#ifndef HAVE_SETPROCTITLE
     SetTitle(d->name, (char *) 0);
 #else
     setproctitle("%s", d->name);
-- 
1.6.0.4



More information about the xorg-devel mailing list