]> granicus.if.org Git - sudo/commitdiff
Add --disable-weak-symbols option to disable use of weak symbols
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 5 Mar 2015 21:43:06 +0000 (14:43 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 5 Mar 2015 21:43:06 +0000 (14:43 -0700)
in libsudo_util.

INSTALL
configure
configure.ac

diff --git a/INSTALL b/INSTALL
index 0fa413781a96a24f47d023ad9eef7396f6c4a36c..f1f0f4e34b611a29bdeb3466402eee1c7ad0eb00 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -212,6 +212,14 @@ Compilation options:
         instead.  This option may only be used in conjunction with
         the --enable-static-sudoers option.
 
+  --disable-weak-symbols
+        Disable the use of weak symbols in the libsudo_util library.
+        By default, libsudo_util will provide weak symbols for the
+        sudo_warn_gettext() amd sudo_warn_strerror() functions which
+        may be overridden.  If weak symbols are disabled, these
+        functions will be omitted from the library and must be
+        provided by any binary that links against libsudo_util.
+
   --enable-zlib[=location]
        Enable the use of the zlib compress library when storing
        I/O log files.  If specified, location is the base directory
index f40a97ce351251d7a3698b78baf4cb908854b92a..6e60713cd5c8191474ce3df88349b0eeaae58cde 100755 (executable)
--- a/configure
+++ b/configure
@@ -948,6 +948,7 @@ enable_nls
 enable_rpath
 enable_static_sudoers
 enable_shared_libutil
+enable_weak_symbols
 with_selinux
 enable_gss_krb5_ccache_name
 enable_shared
@@ -1623,6 +1624,8 @@ Optional Features:
                           binary instead as a plugin
   --disable-shared-libutil
                           Disable use of the libsudo_util shared library.
+  --disable-weak-symbols  Disable use of weak symbols in 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]
@@ -5670,6 +5673,14 @@ else
 fi
 
 
+# Check whether --enable-weak_symbols was given.
+if test "${enable_weak_symbols+set}" = set; then :
+  enableval=$enable_weak_symbols;
+else
+  enable_weak_symbols=yes
+fi
+
+
 
 # Check whether --with-selinux was given.
 if test "${with_selinux+set}" = set; then :
@@ -15643,7 +15654,7 @@ $as_echo "#define volatile /**/" >>confdefs.h
 
 fi
 
-if test "$enable_shared_libutil" = "yes"; then
+if test "$enable_shared_libutil$enable_weak_symbols" = "yesyes"; then
 
   # starting point: no aliasing scheme yet...
   ax_sys_weak_alias=no
index 2f9240db01d4617fb07b8f5d280c615d5da6f53d..818181351c10653c01028702e6dd5b1a39a33c2c 100644 (file)
@@ -1463,6 +1463,10 @@ 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_ENABLE(weak_symbols,
+[AS_HELP_STRING([--disable-weak-symbols], [Disable use of weak symbols in the libsudo_util shared library.])],
+[], [enable_weak_symbols=yes])
+
 AC_ARG_WITH(selinux, [AS_HELP_STRING([--with-selinux], [enable SELinux support])],
 [case $with_selinux in
     yes)       SELINUX_USAGE="[[-r role]] [[-t type]] "
@@ -2144,7 +2148,7 @@ dnl
 AC_PROG_CC_STDC
 AC_C_CONST
 AC_C_VOLATILE
-if test "$enable_shared_libutil" = "yes"; then
+if test "$enable_shared_libutil$enable_weak_symbols" = "yesyes"; then
     AX_SYS_WEAK_ALIAS
 fi
 AC_MSG_CHECKING([for variadic macro support in cpp])