Commit Graph

183 Commits

Author SHA1 Message Date
David Drysdale f61151a091 test: namespaces unavailable when cross-compiling 2016-02-13 11:51:19 +00:00
David Drysdale 5dc450a4b3 test: Add framework for containerized testing
On Linux we can potentially use user and UTS namespaces to run  a test
in a pseudo-container with:
 - arbitrary filesystem (e.g. /etc/resolv.conf, /etc/nsswitch.conf, /etc/hosts)
 - arbitrary hostname/domainname.

Include a first pass at the framework code to allow this, along with a
first test case that uses the container.
2016-02-02 10:13:49 +00:00
David Drysdale 8042524c70 build: Expose whether symbol hiding is on
Adding the CARES_SYMBOL_HIDING definition allows the test suite to
detect whether internal symbols are available or not.
2016-02-02 10:13:46 +00:00
David Drysdale ace90cce05 build: Add autoconf macros for C++11 code using pthreads
Pull in testing macros from the GNU autoconf archive to allow
configure scripts to test for and setup use of a C++11 compiler
(AX_CXX_COMPILE_STDCXX_11) and the pthreads library (AX_PTHREAD).

Note that these macros are not used by the main library autoconf,
just by the tests (which share the same m4/ directory).
2016-02-02 10:13:46 +00:00
David Drysdale 1b6905cc7f build: Add a code coverage option
Configure with:
  ./configure --enable-code-coverage
Show coverage output with:
  make code-coverage-capture

Built on m4/ax_code_coverage.m4 from the GNU autoconf archive
to provide the macros to check for presence of gcov + lcov;
upstream macro modified to:
 - Remove use of $(AM_DEFAULT_VERBOSITY) , as earlier versions of
   autoconf (such as the one used by default on Travis) do not have this.
 - Rather than automatically defining CODE_COVERAGE_RULES to be a set
   of makefile rules that use ifeq/endif (which is GNU make-specific),
   instead only define CODE_COVERAGE_RULES if coverages is turned on,
   and in that case don't use conditionals in the makefile.
2016-02-02 10:13:46 +00:00
David Drysdale d493e9b17c api: Add option to expose some internal functions
Purely for testing, add --enable-expose-statics option to configure
which converts some static internal functions to be externally visible.
2016-02-02 10:05:07 +00:00
Yang Tse 742e234855 xc-am-iface.m4: comments refinement 2013-07-18 16:03:21 +02:00
Yang Tse 68b3c67e61 configure: fix 'subdir-objects' distclean related issue
See XC_AMEND_DISTCLEAN comments for details.
2013-07-18 04:20:31 +02:00
Yang Tse 9540d48184 xc-am-iface.m4: provide XC_AUTOMAKE macro 2013-07-09 00:07:27 +02:00
Yang Tse 715b499c79 configure: use XC_LIBTOOL for portability across libtool versions 2013-03-08 13:22:33 +01:00
Yang Tse f454e82dc7 xc-lt-iface.m4: provide XC_LIBTOOL macro 2013-03-08 13:22:31 +01:00
Yang Tse 75a8407985 zz40-xc-ovr.m4: fix 'wc' detection - follow-up 2
- Fix a pair of single quotes to double quotes.

URL: http://curl.haxx.se/mail/lib-2013-01/0355.html
Reported by: Tor Arntsen
2013-01-30 16:58:46 +01:00
Yang Tse b6dd41b6ef zz40-xc-ovr.m4: fix 'wc' detection - follow-up
- Take into account that 'wc' may return leading spaces and/or tabs.

- Set initial IFS to space, tab and newline.
2013-01-30 15:46:50 +01:00
Yang Tse 422717ba6f zz40-xc-ovr.m4: fix 'wc' detection
- Take into account that 'wc' may return leading spaces.

- Set internationalization behavior variables.

Tor Arntsen analyzed and reported the issue.

URL: http://curl.haxx.se/mail/lib-2013-01/0351.html
2013-01-30 12:25:53 +01:00
Yang Tse e03b5288ec zz40-xc-ovr.m4: check another three basic utilities 2013-01-29 20:49:16 +01:00
Yang Tse ddc7ab6713 zz40-xc-ovr.m4: 1.0 interface stabilization
- Stabilization results in 4 public interface m4 macros:
  XC_CONFIGURE_PREAMBLE
  XC_CONFIGURE_PREAMBLE_VER_MAJOR
  XC_CONFIGURE_PREAMBLE_VER_MINOR
  XC_CHECK_PATH_SEPARATOR
- Avoid one level of internal indirection
- Update comments
- Drop XC_OVR_ZZ40 macro
2013-01-28 21:28:42 +01:00
Yang Tse 18b7d9a9f4 zz40-xc-ovr.m4: emit witness message in configure BODY
This avoids witness message in output when running configure --help,
while sending the message to config.log for other configure runs.
2013-01-26 03:49:30 +01:00
Yang Tse e916c68de7 zz40-xc-ovr.m4: truly do version conditional overriding
- version conditional overriding
- catch unexpanded XC macros
- fix double words in comments
2013-01-25 19:20:28 +01:00
Yang Tse 0110c7f6ee zz40-xc-ovr.m4: fix variable assignment of subshell output bashism
Tor Arntsen analyzed and reported the issue.

URL: http://curl.haxx.se/mail/lib-2013-01/0306.html
2013-01-25 14:22:43 +01:00
Yang Tse 44635a5ec0 zz40-xc-ovr.m4: reinstate strict AC_REQUIRE macro dependencies 2013-01-25 12:21:47 +01:00
Yang Tse 186c57182e zz40-xc-ovr.m4: avoid double single-quote usage 2013-01-25 05:16:18 +01:00
Yang Tse b157f4a0be zz40-xc-ovr.m4: parentheses balancing of 'case' statements
m4 quadrigraph shell comment technique allows proper autoconf
parentheses balancing in shell 'case' statements. The presence
of unbalanced parentheses may otherwise trigger expansion bugs.
2013-01-25 00:46:58 +01:00
Yang Tse 15177a631e zz40-xc-ovr.m4: internals overhauling
- Update comments
- Execute commands in subshells
- Faster path separator check
- Fix missing 'test' command
- Rename private macros
- Minimize AC_REQUIRE usage
2013-01-24 20:39:08 +01:00
Yang Tse 971bdfedb2 zz40-xc-ovr.m4: redirect errors and warnings to stderr 2013-01-23 21:54:06 +01:00
Yang Tse 14e78ad68b configure: use XC_CONFIGURE_PREAMBLE early checks
Some basic checks we make were placed early enough in generated
configure script when using autoconf 2.5X versions. Newer autoconf
versions expand these checks much further into the configure script,
rendering them useless. Using XC_CONFIGURE_PREAMBLE fixes placement
of early intended checks across all our autoconf supported versions.
2013-01-23 18:20:33 +01:00
Yang Tse b74bcad714 zz40-xc-ovr.m4: provide XC_CONFIGURE_PREAMBLE macro 2013-01-23 18:20:22 +01:00
Yang Tse 037656b2d8 configure: autotools compatibility fixes - step I
Fix proper macro expansion order across autotools versions for
C compiler and preprocessor program checks.
2013-01-23 16:44:25 +01:00
Yang Tse dc6c864108 configure: fix automake 1.13 compatibility
Tested with:

buildconf: autoconf version 2.69
buildconf: autom4te version 2.69
buildconf: autoheader version 2.69
buildconf: automake version 1.13.1
buildconf: aclocal version 1.13.1
buildconf: libtool version 2.4
buildconf: GNU m4 version 1.4.16
2013-01-23 16:16:13 +01:00
Yang Tse 70ac469a0c cares-override.m4: provide AC_CONFIG_MACRO_DIR definition conditionally
Provide a 'traceable' AC_CONFIG_MACRO_DIR definition only when using
an autoconf version that does not provide it, instead of what we were
doing up to now of providing and overriding AC_CONFIG_MACRO_DIR for
all autoconf versions.
2013-01-01 18:21:34 +01:00
Yang Tse b214c21cf6 cares-functions.m4: improve gethostname arg 2 data type check 2012-12-17 16:32:24 +01:00
Yang Tse 84eb2dc220 configure: check if compiler halts on function prototype mismatch 2012-12-16 18:50:58 +01:00
Yang Tse 9da14a847f cares-functions.m4: add gethostname arg 2 data type check and definition 2012-12-15 17:46:49 +01:00
Yang Tse a28e44c344 cares-functions.m4: update thread-safeness detection of getaddrinfo()
Take in account that POSIX standard Issue 7 drops h_errno support. Now, we also
consider getaddrinfo() to be thread-safe when (_POSIX_C_SOURCE >= 200809L) or
(_XOPEN_SOURCE >= 700) independently of whether h_errno exists or not.

Take in account that h_errno might be a modifiable lvalue not defined as
a C preprocessor macro.
2012-12-15 17:36:09 +01:00
Yang Tse 54751f4d33 cares-compilers.m4: remove -Wstrict-aliasing=3 from clang
Currently it is unknown if there is any version of clang that
actually supports -Wstrict-aliasing. What is known is that there
are several that don't support it.
2012-06-29 16:40:29 +02:00
Yang Tse bc0c3c62cc cares-compilers.m4: -Wstrict-aliasing=3 for warning enabled gcc and clang builds 2012-06-26 21:24:08 +02:00
Yang Tse 2c77c33daa cares-compilers.m4: -Wno-pedantic-ms-format for Windows gcc 4.5 builds
When building a Windows target with gcc 4.5 or newer and strict compiler
warnings enabled use -Wno-pedantic-ms-format in addition to other flags.
2012-04-17 13:30:02 +02:00
Yang Tse f6b4cacfae cares-compilers.m4: double underscore decoration for visibility attribute 2012-04-17 13:30:00 +02:00
Yang Tse fc2c91c206 build adjustments: CARES_SYMBOL_HIDING no longer defined in config files
configure script now provides conditional definitions for Makefile.am
that result in CARES_SYMBOL_HIDING being defined by resulting makefiles
when appropriate.
2012-04-17 13:29:59 +02:00
Yang Tse f1a1df1e6c configure: libtool 1.5 tweaks 2011-12-20 14:02:57 +01:00
Yang Tse 34d5d76969 configure: fix symbol hiding usability check
A more thorough test is done now in order to determine visibility attribute
usability, given that some compilers don't support visibility attribute on
all configurations.
2011-08-20 20:11:00 +02:00
Yang Tse a94b4e53d1 cares-compilers.m4: CARES_CONVERT_INCLUDE_TO_ISYSTEM adjustments
Add CARES_CHECK_COMPILER as a requirement.

Ensure macro does nothing unless GNU_C or CLANG compiler is used.

This should allow usage of this macro in unforeseen placements.
2011-08-08 18:33:05 +02:00
Yang Tse f2ea96b1b7 cares-functions.m4 serial # bump 2011-07-29 20:31:56 +02:00
Yang Tse 2039e81e45 Revert "configure: additional flag checks for fcntl() and socket()"
This reverts commit 5f2a3b0e48.
2011-07-29 20:20:44 +02:00
Yang Tse 5f2a3b0e48 configure: additional flag checks for fcntl() and socket() 2011-07-29 18:25:34 +02:00
Yang Tse 08e721e004 xc-translit.m4 fix quoting 2011-06-21 00:06:00 +02:00
Yang Tse 4701b0c47a xc-translit.m4 provides transliteration macros with well defined behavior. 2011-06-17 20:59:58 +02:00
Yang Tse 45ec020795 xlc: avoid preprocessor definition usage when linking 2011-06-04 04:26:40 +02:00
Yang Tse e49ce8f973 configure: fix libtool warning
Recent versions of libtool are now tracing usage of AC_CONFIG_MACRO_DIR
macro and warn heavily when not used in configure script along with
ACLOCAL_AMFLAGS in Makefile.am.  So in order to make libtool happy
while keeping backwards compatibility this is added.
2011-03-25 13:13:55 +01:00
Yang Tse 822fd0f877 build: use getenv() replacement function for systems which lack it 2011-03-23 13:44:42 +01:00
Yang Tse 623f3cb531 configure: inet_net_pton function check adjustments
Define HAVE_INET_NET_PTON only when system's inet_net_pton function is IPv6
capable and is not affected by the WLB-2008080064 advisory.

HAVE_INET_NET_PTON_IPV6 is no longer defined nor used.
2010-12-15 02:22:04 +01:00