[PATCH app-xdm 06/11] greeter: only build the shared library version

Gaetan Nadon memsize at videotron.ca
Sun Aug 29 06:24:47 PDT 2010


There is no evidence that the static version is needed since monolith
as hinted by the comment in configure.ac.

The greeter code is now all managed by the greeter Makefile.
The configure option enable-dynamic-greeter no longer needed.
GREET_USER_STATIC is no longer needed.
GREET_LIB is still needed in greet.h as it is compiled with
both session.c for xdm execuatable and greeter shared lib.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 Makefile.am         |   15 -------------
 configure.ac        |   56 +++++++++++---------------------------------------
 greeter/Makefile.am |    4 +-
 greeter/greet.c     |    5 ----
 session.c           |   10 ---------
 5 files changed, 15 insertions(+), 75 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 341e65a..fa1b0c4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -94,21 +94,6 @@ xdm_SOURCES += krb5auth.c
 endif
 
 #
-# greeter
-#
-
-if !DYNAMIC_GREETER
-xdm_SOURCES += \
-	greeter/greet.c		\
-	greeter/Login.c		\
-	greeter/Login.h		\
-	greeter/LoginP.h	\
-	greeter/verify.c
-xdm_CFLAGS += $(XDMGREET_CFLAGS)
-endif
-
-
-#
 #  xdm man page 
 #
 
diff --git a/configure.ac b/configure.ac
index dd23034..142ac7e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -385,53 +385,23 @@ PKG_CHECK_MODULES(AUTH, xau)
 # Greeter
 #
 
-AC_MSG_CHECKING([if the greeter should be built as a dynamically loaded shared object])
-
-AC_ARG_ENABLE(dynamic-greeter,
-	AC_HELP_STRING([--enable-dynamic-greeter],
-         [Build greeter as dynamically loaded shared object]),
-	[DYNAMIC_GREETER="$enableval"], [DYNAMIC_GREETER="auto"])
-
-# Not all OS'es built dynamic greeter in monolith, but all the ones supported
-# in the modular tree should be able to use it.   We'll leave this here in case
-# some are found that can't.
-if test "x$DYNAMIC_GREETER" = "xauto" ; then
-	case $host_os in
-	    *)	DYNAMIC_GREETER="yes" ;;
-	esac
+GREETER_CFLAGS="$GREETER_CFLAGS -DGREET_LIB"
+
+# The xdm binary needs to export symbols so that they can be used from
+# libXdmGreet.so.  Some platforms require extra flags to do this.
+# gcc should set these flags when -rdynamic is passed to it, other
+# compilers/linkers may need to be added
+if test "x$GCC" = "xyes"; then
+	XDM_LDFLAGS="$XDM_LDFLAGS -rdynamic"
 fi
 
-AC_MSG_RESULT([$DYNAMIC_GREETER])
-
-if test "x$DYNAMIC_GREETER" = "xyes" ; then
-
-	GREETER_CFLAGS="$GREETER_CFLAGS -DGREET_LIB"
+PKG_CHECK_MODULES(XDMGREET, xt x11 xext)
 
-	# The xdm binary needs to export symbols so that they can be used from
-	# libXdmGreet.so.  Some platforms require extra flags to do this.   
-	# gcc should set these flags when -rdynamic is passed to it, other 
-	# compilers/linkers may need to be added
-	if test "x$GCC" = "xyes"; then
-		XDM_LDFLAGS="$XDM_LDFLAGS -rdynamic"
-	fi	
-
-	PKG_CHECK_MODULES(XDMGREET, xt x11 xext)
-
-	GREETERLIB="${XDMLIBDIR}/libXdmGreet.so"
-	AX_DEFINE_DIR(DEF_GREETER_LIB, GREETERLIB,
-			[Location of Xdm Greeter library])
-
-	XDMGREET_CFLAGS="$XDMGREET_CFLAGS $XDM_PRINT_CFLAGS $DMCP_CFLAGS $XLIB_CFLAGS $OS_CFLAGS $GREETER_CFLAGS $AUTH_CFLAGS"
-	XDMGREET_LIBS="$XDMGREET_LIBS $XDM_PRINT_LIBS $DMCP_LIBS $GREETER_LIBS"
-
-	AC_SUBST(XDMGREET_CFLAGS)
-	AC_SUBST(XDMGREET_LIBS)
-else
-	XDM_CFLAGS="$XDM_CFLAGS $XDM_PRINT_CFLAGS $GREETER_CFLAGS -DGREET_USER_STATIC"
-	XDM_LIBS="$XDM_LIBS $XDM_PRINT_LIBS $GREETER_LIBS"
-fi
+GREETERLIB="${XDMLIBDIR}/libXdmGreet.so"
+AX_DEFINE_DIR(DEF_GREETER_LIB, GREETERLIB, [Location of Xdm Greeter library])
 
-AM_CONDITIONAL(DYNAMIC_GREETER, test x$DYNAMIC_GREETER = xyes)
+XDMGREET_CFLAGS="$XDMGREET_CFLAGS $XDM_PRINT_CFLAGS $DMCP_CFLAGS $XLIB_CFLAGS $OS_CFLAGS $GREETER_CFLAGS $AUTH_CFLAGS"
+XDMGREET_LIBS="$XDMGREET_LIBS $XDM_PRINT_LIBS $DMCP_LIBS $GREETER_LIBS"
 
 #
 #  XDM
diff --git a/greeter/Makefile.am b/greeter/Makefile.am
index 70fa5df..668a2fd 100644
--- a/greeter/Makefile.am
+++ b/greeter/Makefile.am
@@ -1,10 +1,11 @@
-if DYNAMIC_GREETER
 xdmlibdir = $(XDMLIBDIR)
 
 xdmlib_LTLIBRARIES = libXdmGreet.la
 
 libXdmGreet_la_SOURCES = \
 		  Login.c \
+		  Login.h \
+		  LoginP.h \
 		  greet.c \
 		  verify.c
 
@@ -13,7 +14,6 @@ libXdmGreet_la_LIBADD = $(XDMGREET_LIBS)
 AM_CFLAGS = $(CWARNFLAGS) $(XDMGREET_CFLAGS) -I$(top_srcdir)
 
 libXdmGreet_la_LDFLAGS = -module -avoid-version
-endif
 
 if LINT
 ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
diff --git a/greeter/greet.c b/greeter/greet.c
index eaf7527..6e29b05 100644
--- a/greeter/greet.c
+++ b/greeter/greet.c
@@ -93,7 +93,6 @@ from The Open Group.
 extern int getdomainname(char *name, size_t len);
 #endif
 
-#ifdef GREET_LIB
 /*
  * Function pointers filled in by the initial call ito the library
  */
@@ -135,8 +134,6 @@ char     *(*__xdm_crypt)(CRYPT_ARGS) = NULL;
 pam_handle_t **(*__xdm_thepamhp)(void) = NULL;
 # endif
 
-#endif
-
 #ifdef SECURE_RPC
 # include <rpc/rpc.h>
 # include <rpc/key_prot.h>
@@ -438,7 +435,6 @@ greet_user_rtn GreetUser(
 {
     int i;
 
-#ifdef GREET_LIB
 /*
  * These must be set before they are used.
  */
@@ -478,7 +474,6 @@ greet_user_rtn GreetUser(
 # ifdef USE_PAM
     __xdm_thepamhp = dlfuncs->_thepamhp;
 # endif
-#endif
 
     *dpy = InitGreet (d);
     /*
diff --git a/session.c b/session.c
index 15747f4..5be3276 100644
--- a/session.c
+++ b/session.c
@@ -76,12 +76,10 @@ extern int key_setnet(struct key_netstarg *arg);
 #include <selinux/get_context_list.h>
 #endif /* HAVE_SELINUX */
 
-#ifndef GREET_USER_STATIC
 # include <dlfcn.h>
 # ifndef RTLD_NOW
 #  define RTLD_NOW 1
 # endif
-#endif
 
 #ifdef HAVE_SELINUX
 /* This should be run just before we exec the user session. */
@@ -327,9 +325,7 @@ ManageSession (struct display *d)
     Display		*dpy;
     greet_user_rtn	greet_stat;
     static GreetUserProc greet_user_proc = NULL;
-#ifndef GREET_USER_STATIC
     void		*greet_lib_handle;
-#endif
 
     Debug ("ManageSession %s\n", d->name);
     (void)XSetIOErrorHandler(IOErrorHandler);
@@ -344,9 +340,6 @@ ManageSession (struct display *d)
      */
     LoadXloginResources (d);
 
-#ifdef GREET_USER_STATIC
-    greet_user_proc = GreetUser;
-#else
     Debug ("ManageSession: loading greeter library %s\n", greeterLib);
     greet_lib_handle = dlopen(greeterLib, RTLD_NOW);
     if (greet_lib_handle != NULL)
@@ -355,7 +348,6 @@ ManageSession (struct display *d)
 	LogError ("%s while loading %s\n", dlerror(), greeterLib);
 	exit(UNMANAGE_DISPLAY);
 	}
-#endif
 
     /* tell the possibly dynamically loaded greeter function
      * what data structure formats to expect.
@@ -375,10 +367,8 @@ ManageSession (struct display *d)
 	    if (StartClient (&verify, d, &clientPid, greet.name, greet.password)) {
 		Debug ("Client Started\n");
 
-#ifndef GREET_USER_STATIC
                 /* Save memory; close library */
                 dlclose(greet_lib_handle);
-#endif
 
 		/*
 		 * Wait for session to end,
-- 
1.6.0.4



More information about the xorg-devel mailing list