]> granicus.if.org Git - sudo/commitdiff
Add --disable-shared-libutil configure option. It may only be used
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 8 Aug 2014 17:03:24 +0000 (11:03 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 8 Aug 2014 17:03:24 +0000 (11:03 -0600)
in conjunction with the --enable-static-sudoers option.

INSTALL
NEWS
configure
configure.ac
lib/util/Makefile.in

diff --git a/INSTALL b/INSTALL
index ba2b278e6af2602efa957541a246c722960bf911..d2b030b8cac66498758ef8a4409855478543b60a 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -193,6 +193,15 @@ Compilation options:
         not prevent other plugins from being used and the noexec
         option will continue to function.
 
+  --disable-shared-libutil
+        Disable the use of the dynamic libsudo_util library.  By
+        default, sudo, the sudoers plugin and the associated sudo
+        utilities are linked against a shared version of libsudo_util.
+        If the --disable-shared-libutil option is specified, a
+        static version of the libsudo_util library will be used
+        instead.  This option may only be used in conjunction with
+        the --enable-static-sudoers option.
+
   --enable-zlib[=location]
        Enable the use of the zlib compress library when storing
        I/O log files.  If specified, location is the base directory
diff --git a/NEWS b/NEWS
index fef3e09d935c8d40d12f683ee92e135fcc2f2907..9064a67af295beb2d150ce48784e19eed9d4018a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -30,7 +30,9 @@ What's new in Sudo 1.8.11
    that of other gettext-enabled packages.
 
  * Sudo and its associated programs now link against a shared version
-   of libsudo_util.
+   of libsudo_util.  The --disable-shared-libutil configure option
+   may be used to force static linking if the --enable-static-sudoers
+   option is also specified.
 
  * It is now possible to match an environment variable's value as
    well as its name using env_keep and env_check.  This can be used
index 206fdc05dbbd39bc5468f039b954b5213231417d..68470037033705d4d0bf78da74fad6e4b901351e 100755 (executable)
--- a/configure
+++ b/configure
@@ -780,6 +780,7 @@ SUDO_OBJS
 SUDOERS_OBJS
 COMMON_OBJS
 LT_DEP_LIBS
+LT_STATIC_LIBUTIL
 LT_STATIC
 LT_LDEXPORTS
 LT_LDDEP
@@ -937,6 +938,7 @@ enable_admin_flag
 enable_nls
 enable_rpath
 enable_static_sudoers
+enable_shared_libutil
 with_selinux
 enable_gss_krb5_ccache_name
 enable_shared
@@ -1605,6 +1607,8 @@ Optional Features:
   --disable-rpath         Disable passing of -Rpath to the linker
   --enable-static-sudoers Build the sudoers policy module as part of the sudo
                           binary instead as a plugin
+  --disable-shared-libutil
+                          Disable use of the libsudo_util shared library.
   --enable-gss-krb5-ccache-name
                           Use GSS-API to set the Kerberos V cred cache name
   --enable-shared[=PKGS]  build shared libraries [default=yes]
@@ -2976,6 +2980,7 @@ $as_echo "$as_me: Configuring Sudo version $PACKAGE_VERSION" >&6;}
 
 
 
+
 
 
 #
@@ -5794,6 +5799,14 @@ else
 fi
 
 
+# Check whether --enable-shared_libutil was given.
+if test "${enable_shared_libutil+set}" = set; then :
+  enableval=$enable_shared_libutil;
+else
+  enable_shared_libutil=yes
+fi
+
+
 
 # Check whether --with-selinux was given.
 if test "${with_selinux+set}" = set; then :
@@ -22047,6 +22060,21 @@ case "$lt_cv_dlopen" in
        ;;
 esac
 
+#
+# We can only disable linking with the shared libsudo_util if
+# sudoers is linked statically too.
+#
+if test "$enable_shared_libutil" = "no"; then
+    if test X"$STATIC_SUDOERS" = X""; then
+       as_fn_error $? "\"--disable-shared-libutil may only be specified with --enable-static-sudoers or when dynamic linking is disabled.\"" "$LINENO" 5
+    else
+       # Disable use shared version of libsudo_util.
+       LT_STATIC_LIBUTIL="--tag=disable-shared"
+    fi
+else
+    LT_STATIC_LIBUTIL="$LT_STATIC"
+fi
+
 # On HP-UX, you cannot dlopen() a shared object that uses pthreads unless
 # the main program is linked against -lpthread.  We have no knowledge of
 # what libraries a plugin may depend on (e.g. HP-UX LDAP which uses pthreads)
index 31db4d9a80b43382793aaaf9039f33bc7424e7aa..55729b83e0d0d1eb6006b94f0e0712ffbfa6469e 100644 (file)
@@ -27,6 +27,7 @@ AC_SUBST([LT_LDOPT])
 AC_SUBST([LT_LDDEP])
 AC_SUBST([LT_LDEXPORTS])
 AC_SUBST([LT_STATIC])
+AC_SUBST([LT_STATIC_LIBUTIL])
 AC_SUBST([LT_DEP_LIBS])
 AC_SUBST([COMMON_OBJS])
 AC_SUBST([SUDOERS_OBJS])
@@ -1454,6 +1455,10 @@ AC_ARG_ENABLE(static-sudoers,
 [AS_HELP_STRING([--enable-static-sudoers], [Build the sudoers policy module as part of the sudo binary instead as a plugin])],
 [], [enable_static_sudoers=no])
 
+AC_ARG_ENABLE(shared_libutil,
+[AS_HELP_STRING([--disable-shared-libutil], [Disable use of the libsudo_util shared library.])],
+[], [enable_shared_libutil=yes])
+
 AC_ARG_WITH(selinux, [AS_HELP_STRING([--with-selinux], [enable SELinux support])],
 [case $with_selinux in
     yes)       SELINUX_USAGE="[[-r role]] [[-t type]] "
@@ -3611,6 +3616,21 @@ case "$lt_cv_dlopen" in
        ;;
 esac
 
+#
+# We can only disable linking with the shared libsudo_util if
+# sudoers is linked statically too.
+#
+if test "$enable_shared_libutil" = "no"; then
+    if test X"$STATIC_SUDOERS" = X""; then
+       AC_MSG_ERROR(["--disable-shared-libutil may only be specified with --enable-static-sudoers or when dynamic linking is disabled."])
+    else
+       # Disable use shared version of libsudo_util.
+       LT_STATIC_LIBUTIL="--tag=disable-shared"
+    fi
+else
+    LT_STATIC_LIBUTIL="$LT_STATIC"
+fi
+
 # On HP-UX, you cannot dlopen() a shared object that uses pthreads unless
 # the main program is linked against -lpthread.  We have no knowledge of
 # what libraries a plugin may depend on (e.g. HP-UX LDAP which uses pthreads)
index 53df7c1ec822b9635191471523aa8c6bdb73738b..ee7158c30a491e0ea1b8bf534e8545b5609abf00 100644 (file)
@@ -45,7 +45,7 @@ shlib_opt = util.opt
 
 # Compiler & tools to use
 CC = @CC@
-LIBTOOL = @LIBTOOL@ @LT_STATIC@
+LIBTOOL = @LIBTOOL@ @LT_STATIC_LIBUTIL@
 SED = @SED@
 
 # Our install program supports extra flags...
@@ -182,9 +182,12 @@ progname_test: $(PROGNAME_TEST_OBJS)
 pre-install:
 
 install: install-dirs
-       if [ X"$(shlib_enable)" = X"yes" ]; then \
-           INSTALL_BACKUP='~' $(LIBTOOL) --quiet --mode=install $(INSTALL) $(INSTALL_OWNER) libsudo_util.la $(DESTDIR)$(libexecdir)/sudo; \
-       fi
+       case "$(LIBTOOL)" in \
+       *disable-shared*) ;; \
+       *)  if [ X"$(shlib_enable)" = X"yes" ]; then \
+               INSTALL_BACKUP='~' $(LIBTOOL) --quiet --mode=install $(INSTALL) $(INSTALL_OWNER) libsudo_util.la $(DESTDIR)$(libexecdir)/sudo; \
+           fi;; \
+       esac
 
 install-dirs:
        $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(libexecdir)/sudo