build: drop allegedly no longer intrusive syslog-tests opt-in switch

The intention behind enabling the syslog tests on demand (642f74d) was
to tread cautiously as libtool used to alert that something controversial
is going on:

$ ./autogen.sh && ./configure --enable-syslog-tests && make check
> ...
> *** Warning: Linking the executable log.test against the loadable module
> *** _syslog_override.so is not portable!
> ...

owing to the fact that _syslog_override.so is being linked (through
libtool) with LDFLAGS=-module.

In fact, the issue did go away with a fix to the "make install" process
(ebcff54) for which _syslog_override.so* files were being picked
undesirably prior to the fix, which manifested itself also on
"make rpm" (hence the respective commit message):

> RPM build errors:
>     Installed (but unpackaged) file(s) found:
>    /usr/lib64/_syslog_override.so
>    /usr/lib64/_syslog_override.so.0
>    /usr/lib64/_syslog_override.so.0.0.0

The explanation for the secondary positive effect on the mentioned
libtool's warning going away is rather simple:
"lib" prefix switches the expectations about the result as a library
(also due to "libdir" destination) rather than as an executable object.
Change like that ensures the result is what libtool's manual calls
"dynamic module that can be opened by lt_dlopen" rather than "runtime
library that cannot" in the context of Mac OS X, which was likely the
cause of the portability warning.
(https://www.gnu.org/software/libtool/manual/libtool.html#FOOT10)

And because the tests themselves are run through the libtool wrapper
scripts capable of relinking and other magic

What libtool manual has to say on this topic:
> Note that libtool modules don’t need to have a "lib" prefix. However,
> Automake 1.4 or higher is required to build such modules.
referring to version released 15+ years back, which is assumed anyway.
(https://www.gnu.org/software/libtool/manual/libtool.html#Modules-for-libltdl)

* * *

That being said, there's now no longer a reason to have "syslog-tests"
enablement conditionalized (no longer supposed intrusive), hence enable
them unconditionally along the other libcheck-based tests
-- whenever libcheck is detected.

This changeset also drops any trace of --enable-syslog-tests switch
in various places using that (spec file, Travis CI configuration)
making for a complete vaporizatio of this choice.
This commit is contained in:
Jan Pokorný 2016-12-08 17:09:46 +01:00
parent 8fad8acb67
commit 602d04dacf
No known key found for this signature in database
GPG Key ID: 61BBB23A9E8F8DE2
5 changed files with 7 additions and 29 deletions

View File

@ -15,7 +15,7 @@ addons:
script: RPMBUILDOPTS_="--nodeps --define '_without_check 1'";
./autogen.sh
&& ./configure
&& DISTCHECK_CONFIGURE_FLAGS=--enable-syslog-tests VERBOSE=1 make distcheck
&& VERBOSE=1 make distcheck
&& sed "s|RPMBUILDOPTS =|\\0 ${RPMBUILDOPTS_}|" Makefile | make -f- rpm
after_failure:

View File

@ -474,11 +474,6 @@ AC_ARG_ENABLE([coverage],
AC_ARG_ENABLE([slow-tests],
[AS_HELP_STRING([--enable-slow-tests],[build and run slow tests])])
if test x"$with_check" = xyes; then
AC_ARG_ENABLE([syslog-tests],
[AS_HELP_STRING([--enable-syslog-tests],[build and run syslog tests])])
fi
AC_ARG_WITH([socket-dir],
[AS_HELP_STRING([--with-socket-dir=DIR],[socket directory @<:@LOCALSTATEDIR/run@:>@])],
[ SOCKETDIR="$withval" ],
@ -578,12 +573,6 @@ if test "x${enable_slow_tests}" = xyes ; then
fi
AM_CONDITIONAL(HAVE_SLOW_TESTS, [test "x${enable_slow_tests}" = xyes])
AC_SUBST(HAVE_SLOW_TESTS)
if test "x${enable_syslog_tests}" = xyes ; then
AC_DEFINE([HAVE_SYSLOG_TESTS], 1,[have syslog tests])
AC_MSG_NOTICE([Enabling syslog tests])
fi
AM_CONDITIONAL(HAVE_SYSLOG_TESTS, [test "x${enable_syslog_tests}" = xyes])
AC_SUBST(HAVE_SYSLOG_TESTS)
# --- callsite sections ---
if test "x${GCC}" = xyes; then

View File

@ -1,5 +1,4 @@
%bcond_without check
%bcond_without syslog_tests
%global alphatag @alphatag@
%global numcomm @numcomm@
@ -27,8 +26,7 @@ and polling.
%build
./autogen.sh
%configure --disable-static \
%{?with_syslog_tests:--enable-syslog-tests}
%configure --disable-static
make %{?_smp_mflags}
%if 0%{?with_check}

View File

@ -150,16 +150,14 @@ _failure_injection_la_LDFLAGS = -module
_failure_injection_la_LIBADD = $(dlopen_LIBS)
endif
log_test_SOURCES = check_log.c $(top_builddir)/include/qb/qblog.h
log_test_CFLAGS = @CHECK_CFLAGS@ -I$(top_srcdir)/include
log_test_LDADD = $(top_builddir)/lib/libqb.la @CHECK_LIBS@
if HAVE_SYSLOG_TESTS
log_test_LDADD += _syslog_override.la
check_LTLIBRARIES += _syslog_override.la
_syslog_override_la_SOURCES = _syslog_override.c _syslog_override.h
_syslog_override_la_LDFLAGS = -module
endif
log_test_SOURCES = check_log.c $(top_builddir)/include/qb/qblog.h
log_test_CFLAGS = @CHECK_CFLAGS@ -I$(top_srcdir)/include
log_test_LDADD = $(top_builddir)/lib/libqb.la @CHECK_LIBS@
log_test_LDADD += _syslog_override.la
util_test_SOURCES = check_util.c $(top_builddir)/include/qb/qbutil.h
util_test_CFLAGS = @CHECK_CFLAGS@ -I$(top_srcdir)/include

View File

@ -30,9 +30,7 @@
#include <qb/qbutil.h>
#include <qb/qblog.h>
#ifdef HAVE_SYSLOG_TESTS
#include "_syslog_override.h"
#endif
extern size_t qb_vsnprintf_serialize(char *serialize, size_t max_len, const char *fmt, va_list ap);
extern size_t qb_vsnprintf_deserialize(char *string, size_t strlen, const char *buf);
@ -859,7 +857,6 @@ START_TEST(test_zero_tags)
}
END_TEST
#ifdef HAVE_SYSLOG_TESTS
START_TEST(test_syslog)
{
qb_log_init("flip", LOG_USER, LOG_INFO);
@ -876,7 +873,6 @@ START_TEST(test_syslog)
qb_log_fini();
}
END_TEST
#endif
static Suite *
log_suite(void)
@ -898,10 +894,7 @@ log_suite(void)
#endif
add_tcase(s, tc, test_extended_information);
add_tcase(s, tc, test_zero_tags);
#ifdef HAVE_SYSLOG_TESTS
add_tcase(s, tc, test_syslog);
#endif
return s;
}