From: Todd C. Miller Date: Fri, 8 Aug 2014 17:19:20 +0000 (-0600) Subject: Avoid building/running the check_symbols test program unless we are X-Git-Tag: SUDO_1_8_11^2~70 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=696080917c95173ecd92230289139a96b5a0ed25;p=sudo Avoid building/running the check_symbols test program unless we are building a shared sudoers plugin. --- diff --git a/configure b/configure index 684700370..d9bf38db4 100755 --- a/configure +++ b/configure @@ -729,6 +729,7 @@ SSP_LDFLAGS PIE_CFLAGS PIE_LDFLAGS CROSS_COMPILING +SUDOERS_TEST_PROGS COMPAT_TEST_PROGS LOCALEDIR_SUFFIX SUDO_NLS @@ -2981,6 +2982,7 @@ $as_echo "$as_me: Configuring Sudo version $PACKAGE_VERSION" >&6;} + # @@ -22060,6 +22062,13 @@ case "$lt_cv_dlopen" in ;; esac +# +# The check_symbols test can only succeed with a dynamic sudoers plugin. +# +if test X"$STATIC_SUDOERS" = X""; then + SUDOERS_TEST_PROGS="${SUDOERS_TEST_PROGS}${SUDOERS_TEST_PROGS+ }check_symbols" +fi + # # We can only disable linking with the shared libsudo_util if # sudoers is linked statically too. diff --git a/configure.ac b/configure.ac index 55729b83e..b8713cbc5 100644 --- a/configure.ac +++ b/configure.ac @@ -80,6 +80,7 @@ AC_SUBST([LIBMD]) AC_SUBST([SUDO_NLS]) AC_SUBST([LOCALEDIR_SUFFIX]) AC_SUBST([COMPAT_TEST_PROGS]) +AC_SUBST([SUDOERS_TEST_PROGS]) AC_SUBST([CROSS_COMPILING]) AC_SUBST([PIE_LDFLAGS]) AC_SUBST([PIE_CFLAGS]) @@ -3616,6 +3617,13 @@ case "$lt_cv_dlopen" in ;; esac +# +# The check_symbols test can only succeed with a dynamic sudoers plugin. +# +if test X"$STATIC_SUDOERS" = X""; then + SUDOERS_TEST_PROGS="${SUDOERS_TEST_PROGS}${SUDOERS_TEST_PROGS+ }check_symbols" +fi + # # We can only disable linking with the shared libsudo_util if # sudoers is linked statically too. diff --git a/plugins/sudoers/Makefile.in b/plugins/sudoers/Makefile.in index 0631210b2..bf0650dcf 100644 --- a/plugins/sudoers/Makefile.in +++ b/plugins/sudoers/Makefile.in @@ -131,8 +131,8 @@ SHELL = @SHELL@ PROGS = sudoers.la visudo sudoreplay testsudoers -TEST_PROGS = check_iolog_path check_fill check_wrap check_addr check_symbols \ - check_digest check_base64 +TEST_PROGS = check_iolog_path check_fill check_wrap check_addr check_digest \ + check_base64 @SUDOERS_TEST_PROGS@ AUTH_OBJS = sudo_auth.lo @AUTH_OBJS@ @@ -227,9 +227,7 @@ check_iolog_path: $(CHECK_IOLOG_PATH_OBJS) $(LT_LIBS) # We need to link check_symbols with -lpthread on HP-UX since LDAP uses threads check_symbols: $(CHECK_SYMBOLS_OBJS) $(LT_LIBS) - if [ X"$(shlib_enable)" = X"yes" -a X"@LT_STATIC@" != X"" ]; then \ - $(LIBTOOL) --mode=link $(CC) -o $@ $(CHECK_SYMBOLS_OBJS) $(LDFLAGS) $(PIE_LDFLAGS) $(SSP_LDFLAGS) $(LIBS) @SUDO_LIBS@; \ - fi + $(LIBTOOL) --mode=link $(CC) -o $@ $(CHECK_SYMBOLS_OBJS) $(LDFLAGS) $(PIE_LDFLAGS) $(SSP_LDFLAGS) $(LIBS) @SUDO_LIBS@ check_wrap: $(CHECK_WRAP_OBJS) $(LT_LIBS) $(LIBTOOL) --mode=link $(CC) -o $@ $(CHECK_WRAP_OBJS) $(LDFLAGS) $(PIE_LDFLAGS) $(SSP_LDFLAGS) $(LIBS) @@ -338,9 +336,9 @@ check: $(TEST_PROGS) visudo testsudoers diff regress/parser/check_digest.out $(srcdir)/regress/parser/check_digest.out.ok || rval=`expr $$rval + $$?`; \ ./check_fill || rval=`expr $$rval + $$?`; \ ./check_iolog_path $(srcdir)/regress/iolog_path/data || rval=`expr $$rval + $$?`; \ - if [ X"$(shlib_enable)" = X"yes" -a X"@LT_STATIC@" != X"" ]; then \ - ./check_symbols .libs/sudoers.so $(shlib_exp) || rval=`expr $$rval + $$?`; \ - fi; \ + case "$(TEST_PROGS)" in \ + *check_symbols*) ./check_symbols .libs/sudoers.so $(shlib_exp) || rval=`expr $$rval + $$?`;; \ + esac; \ mkdir -p regress/logging; \ ./check_wrap $(srcdir)/regress/logging/check_wrap.in > regress/logging/check_wrap.out; \ diff regress/logging/check_wrap.out $(srcdir)/regress/logging/check_wrap.out.ok || rval=`expr $$rval + $$?`; \