diff options
author | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2005-11-14 04:25:43 +0000 |
---|---|---|
committer | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2005-11-14 04:25:43 +0000 |
commit | 6ebcb3aab1c6a0c58b6d6d304d7ae61168990c33 (patch) | |
tree | 33aa9b64bf338728b3545cdeecb890c5ae0aca83 | |
parent | f9e6bc3588358c82c9d6e3293cc4eae28567959b (diff) |
Add --enable-dynamic-greeter flag to allow choosing whether greeter should
be built into xdm binary or dynamically loaded libXdmGreet.so object.
Add -rdynamic flag to link options when using gcc with dynamic greeter
to allow greeter object to reference symbols in xdm.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | Makefile.am | 22 | ||||
-rw-r--r-- | configure.ac | 84 | ||||
-rw-r--r-- | greeter/Makefile.am | 2 |
4 files changed, 91 insertions, 28 deletions
@@ -1,3 +1,14 @@ +2005-11-13 Alan Coopersmith <alan.coopersmith@sun.com> + + * configure.ac: + * Makefile.am: + * greeter/Makefile.am: + Add --enable-dynamic-greeter flag to allow choosing whether + greeter should be built into xdm binary or dynamically loaded + libXdmGreet.so object. + Add -rdynamic flag to link options when using gcc with dynamic + greeter to allow greeter object to reference symbols in xdm. + 2005-11-12 Alan Coopersmith <alan.coopersmith@sun.com> * Makefile.am: diff --git a/Makefile.am b/Makefile.am index 728d81b..b815a08 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,7 +31,7 @@ xdmlib_PROGRAMS = chooser # xdm_CFLAGS = $(XDM_CFLAGS) -D_BSD_SOURCE -xdm_LDADD = $(XDM_LIBS) +xdm_LDADD = $(XDM_LIBS) $(XDM_LDFLAGS) xdm_SOURCES = \ auth.c \ @@ -55,11 +55,6 @@ xdm_SOURCES = \ genauth.c \ access.c \ choose.c \ - greeter/greet.c \ - greeter/Login.c \ - greeter/Login.h \ - greeter/LoginP.h \ - greeter/verify.c \ dm_auth.h \ dm_error.h \ dm.h \ @@ -85,6 +80,21 @@ 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 e5f062c..f6210d9 100644 --- a/configure.ac +++ b/configure.ac @@ -115,7 +115,6 @@ case $host_os in ;; solaris*|sysv4*) OS_CFLAGS="" - GREETER_CFLAGS="$GREETER_CFLAGS -DGREET_LIB" SU="su" ;; *) @@ -200,6 +199,8 @@ AC_SUBST(SHELL_CMD) # Checks for pkg-config packages +PKG_CHECK_MODULES(XDM, xmu x11) + PKG_CHECK_EXISTS(xinerama, [ AC_DEFINE([USE_XINERAMA], 1, [Define to 1 to use XINERAMA in greeter & chooser]) @@ -247,17 +248,70 @@ AC_SUBST(XDM_PIXMAP) AC_SUBST(XDM_BWPIXMAP) AC_SUBST(XDM_PIXMAPDIR) +# Packages used by multiple programs + +XAW_CHECK_XPRINT_SUPPORT(XDM_PRINT) +PKG_CHECK_MODULES(DMCP, xdmcp) +PKG_CHECK_MODULES(XPROTO, xproto) # -# XDM +# Greeter # -XAW_CHECK_XPRINT_SUPPORT(XDM_PRINT) +AC_MSG_CHECKING([if the greeter should be built as a dynamically loaded shared object]) -PKG_CHECK_MODULES(DMCP, xdmcp) -PKG_CHECK_MODULES(XPROTO, xproto) -XDM_CFLAGS="$XDM_CFLAGS $XDM_PRINT_CFLAGS $DMCP_CFLAGS $XPROTO_CFLAGS $OS_CFLAGS" -XDM_LIBS="$XDM_LIBS $XDM_PRINT_LIBS $DMCP_LIBS" +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 +fi + +AC_MSG_RESULT([$DYNAMIC_GREETER]) + +if test "x$DYNAMIC_GREETER" = "xyes" ; then + + 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 + + PKG_CHECK_MODULES(XDMGREET, xt x11) + + GREETERLIB="${XDMLIBDIR}/libXdmGreet.so" + AC_DEFINE_DIR(DEF_GREETER_LIB, GREETERLIB, + [Location of Xdm Greeter library]) + + XDMGREET_CFLAGS="$XDMGREET_CFLAGS $XDM_PRINT_CFLAGS $DMCP_CFLAGS $XPROTO_CFLAGS $OS_CFLAGS $GREETER_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 + +AM_CONDITIONAL(DYNAMIC_GREETER, test x$DYNAMIC_GREETER = xyes) + +# +# XDM +# + +XDM_CFLAGS="$XDM_CFLAGS $DMCP_CFLAGS $XPROTO_CFLAGS $OS_CFLAGS" +XDM_LIBS="$XDM_LIBS $DMCP_LIBS" AC_CHECK_LIB(Xdmcp, XdmcpWrap, [xdmauth="yes"], [xdmauth="no"], [$DMCP_LIBS]) AC_SEARCH_LIBS(crypt, crypt) @@ -266,6 +320,7 @@ AM_CONDITIONAL(HAS_XDM_AUTH, test x$xdmauth = xyes) AC_SUBST(XDM_CFLAGS) AC_SUBST(XDM_LIBS) +AC_SUBST(XDM_LDFLAGS) # # xdmshell @@ -280,21 +335,6 @@ AC_SUBST(XDMSHELL_CFLAGS) AC_SUBST(XDMSHELL_LIBS) # -# Greeter -# - -PKG_CHECK_MODULES(XDMGREET, xt x11) - -XDMGREET_CFLAGS="$XDMGREET_CFLAGS $DMCP_CFLAGS $XPROTO_CFLAGS $OS_CFLAGS $GREETER_CFLAGS" -XDMGREET_LIBS="$XDMGREET_LIBS $DMCP_LIBS $GREETER_LIBS" - -GREETERLIB="${XDMLIBDIR}/libXdmGreet.so" -AC_DEFINE_DIR(DEF_GREETER_LIB, GREETERLIB, [Location of Xdm Greeter library]) - -AC_SUBST(XDMGREET_CFLAGS) -AC_SUBST(XDMGREET_LIBS) - -# # Chooser # diff --git a/greeter/Makefile.am b/greeter/Makefile.am index 6b4f31a..d035811 100644 --- a/greeter/Makefile.am +++ b/greeter/Makefile.am @@ -1,5 +1,6 @@ # $XdotOrg: app/xdm/greeter/Makefile.am,v $ +if DYNAMIC_GREETER xdmlibdir = $(XDMLIBDIR) xdmlib_LTLIBRARIES = libXdmGreet.la @@ -14,3 +15,4 @@ libXdmGreet_la_LIBADD = $(XDMGREET_LIBS) AM_CFLAGS = $(XDMGREET_CFLAGS) -I$(top_srcdir) libXdmGreet_la_LDFLAGS = -module -avoid-version +endif |