summaryrefslogtreecommitdiff
path: root/m4/remctl.m4
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2013-02-27 14:25:37 -0800
committerRuss Allbery <rra@stanford.edu>2013-02-27 16:52:32 -0800
commit234e3805c524a7432caed8be328df6e2fbfe9afb (patch)
treed40473e103f8cfacec000959c2ae3ea83e8e86b2 /m4/remctl.m4
parent7a572127a7305a17bf84c26e66e65ab37f66b77d (diff)
Update to rra-c-util 4.8 and C TAP Harness 1.12
Update to rra-c-util 4.8: * Look for krb5-config in /usr/kerberos/bin after the user's PATH. * Kerberos library probing fixes without transitive shared libraries. * Fix Autoconf warnings when probing for AIX's bundled Kerberos. * Avoid using krb5-config if --with-{krb5,gssapi}-{include,lib} given. * Correctly remove -I/usr/include from Kerberos and GSS-API flags. * Build on systems where krb5/krb5.h exists but krb5.h does not. * Pass --deps to krb5-config unless --enable-reduced-depends was used. * Do not use krb5-config results unless gssapi is supported. * Fix probing for Heimdal's libroken to work with older versions. * Update warning flags for GCC 4.6.1. * Update utility library and test suite for newer GCC warnings. * Fix broken GCC attribute markers causing compilation problems. * Suppress warnings on compilers that support gcc's __attribute__. * Add notices to all files copied over from rra-c-util. * Fix warnings when reporting memory allocation failure in messages.c. * Fix message utility library compiler warnings on 64-bit systems. * Include strings.h for additional POSIX functions where found. * Use an atexit handler to clean up after Kerberos tests. * Kerberos test configuration now goes in tests/config. * The principal of the test keytab is determined automatically. * Simplify the test suite calls for Kerberos and remctl tests. * Check for a missing ssize_t. * Improve the xstrndup utility function. * Checked asprintf variants are now void functions and cannot fail. * Fix use of long long in portable/mkstemp.c. * Fix test suite portability to Solaris. * Substantial improvements to the POD syntax and spelling checks. Update to C TAP Harness 1.12: * Fix compliation of runtests with more aggressive warnings. * Add a more complete usage message and a -h command-line flag. * Flush stderr before printing output from tests. * Better handle running shell tests without BUILD and SOURCE set. * Fix runtests to honor -s even if BUILD and -b aren't given. * runtests now frees all allocated resources on exit. * Only use feature-test macros when requested or built with gcc -ansi. * Drop is_double from the C TAP library to avoid requiring -lm. * Avoid using local in the shell libtap.sh library. * Suppress warnings on compilers that support gcc's __attribute__. Change-Id: I394294d5486ac1ce265c7713bec71a148aaaf1ce Reviewed-on: https://gerrit.stanford.edu/841 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
Diffstat (limited to 'm4/remctl.m4')
-rw-r--r--m4/remctl.m494
1 files changed, 78 insertions, 16 deletions
diff --git a/m4/remctl.m4 b/m4/remctl.m4
index bb3a56f..588404f 100644
--- a/m4/remctl.m4
+++ b/m4/remctl.m4
@@ -10,15 +10,28 @@ dnl REMCTL_CPPFLAGS, REMCTL_LDFLAGS, and REMCTL_LIBS. Also provides
dnl RRA_LIB_REMCTL_SWITCH to set CPPFLAGS, LDFLAGS, and LIBS to include the
dnl remctl libraries, saving the current values first, and
dnl RRA_LIB_REMCTL_RESTORE to restore those settings to before the last
-dnl RRA_LIB_REMCTL_SWITCH.
+dnl RRA_LIB_REMCTL_SWITCH. HAVE_REMCTL will always be defined if
+dnl RRA_LIB_REMCTL is used.
+dnl
+dnl Provides the RRA_LIB_REMCTL_OPTIONAL macro, which should be used if
+dnl Kerberos support is optional. This macro will still always est the
+dnl substitution variables, but they'll be empty unless --with-remctl is
+dnl given. HAVE_REMCTL will be defined if --with-remctl is given and
+dnl $rra_use_remctl will be set to "true".
dnl
dnl Depends on RRA_ENABLE_REDUCED_DEPENDS, RRA_SET_LDFLAGS, and
dnl RRA_LIB_GSSAPI.
dnl
+dnl The canonical version of this file is maintained in the rra-c-util
+dnl package, available at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+dnl
dnl Written by Russ Allbery <rra@stanford.edu>
-dnl Copyright 2008, 2009 Board of Trustees, Leland Stanford Jr. University
+dnl Copyright 2008, 2009, 2011
+dnl The Board of Trustees of the Leland Stanford Junior University
dnl
-dnl See LICENSE for licensing terms.
+dnl This file is free software; the authors give unlimited permission to copy
+dnl and/or distribute it, with or without modifications, as long as this
+dnl notice is preserved.
dnl Save the current CPPFLAGS, LDFLAGS, and LIBS settings and switch to
dnl versions that include the remctl flags. Used as a wrapper, with
@@ -55,16 +68,34 @@ dnl Sanity-check the results of the remctl library search to be sure we can
dnl really link a remctl program.
AC_DEFUN([_RRA_LIB_REMCTL_CHECK],
[RRA_LIB_REMCTL_SWITCH
- AC_CHECK_FUNC([remctl_open], ,
- [AC_MSG_FAILURE([unable to link with remctl library])])
+ AC_CHECK_FUNC([remctl_open], [],
+ [AS_IF([test x"$1" = xtrue],
+ [AC_MSG_FAILURE([unable to link with remctl library])])
+ REMCTL_CPPFLAGS=
+ REMCTL_LDFLAGS=
+ REMCTL_LIBS=])
RRA_LIB_REMCTL_RESTORE])
-dnl The main macro.
-AC_DEFUN([RRA_LIB_REMCTL],
+dnl The core of the library checking, shared between RRA_LIB_REMCTL and
+dnl RRA_LIB_REMCTL_OPTIONAL. The single argument, if "true", says to fail if
+dnl remctl could not be found.
+AC_DEFUN([_RRA_LIB_REMCTL_INTERNAL],
[AC_REQUIRE([RRA_ENABLE_REDUCED_DEPENDS])
- rra_remctl_root=
+ _RRA_LIB_REMCTL_PATHS
+ AS_IF([test x"$rra_reduced_depends" = xtrue],
+ [REMCTL_LIBS="-lremctl"],
+ [RRA_LIB_GSSAPI
+ REMCTL_CPPFLAGS="$REMCTL_CPPFLAGS $GSSAPI_CPPFLAGS"
+ REMCTL_LDFLAGS="$REMCTL_LDFLAGS $GSSAPI_LDFLAGS"
+ REMCTL_LIBS="-lremctl $GSSAPI_LIBS"])
+ _RRA_LIB_REMCTL_CHECK([$1])])
+
+dnl The main macro for packages with mandatory remctl support.
+AC_DEFUN([RRA_LIB_REMCTL],
+[rra_remctl_root=
rra_remctl_libdir=
rra_remctl_includedir=
+ rra_use_remctl=true
REMCTL_CPPFLAGS=
REMCTL_LDFLAGS=
REMCTL_LIBS=
@@ -87,12 +118,43 @@ AC_DEFUN([RRA_LIB_REMCTL],
[Location of remctl libraries])],
[AS_IF([test x"$withval" != xyes && test x"$withval" != xno],
[rra_remctl_libdir="$withval"])])
+ _RRA_LIB_REMCTL_INTERNAL([true])
+ AC_DEFINE([HAVE_REMCTL], 1, [Define to enable remctl features.])])
- _RRA_LIB_REMCTL_PATHS
- AS_IF([test x"$rra_reduced_depends" = xtrue],
- [REMCTL_LIBS="-lremctl"],
- [RRA_LIB_GSSAPI
- REMCTL_CPPFLAGS="$REMCTL_CPPFLAGS $GSSAPI_CPPFLAGS"
- REMCTL_LDFLAGS="$REMCTL_LDFLAGS $GSSAPI_LDFLAGS"
- REMCTL_LIBS="-lremctl $GSSAPI_LIBS"])
- _RRA_LIB_REMCTL_CHECK])
+dnl The main macro for packages with optional remctl support.
+AC_DEFUN([RRA_LIB_REMCTL_OPTIONAL],
+[rra_remctl_root=
+ rra_remctl_libdir=
+ rra_remctl_includedir=
+ rra_use_remctl=
+ REMCTL_CPPFLAGS=
+ REMCTL_LDFLAGS=
+ REMCTL_LIBS=
+ AC_SUBST([REMCTL_CPPFLAGS])
+ AC_SUBST([REMCTL_LDFLAGS])
+ AC_SUBST([REMCTL_LIBS])
+
+ AC_ARG_WITH([remctl],
+ [AS_HELP_STRING([--with-remctl@<:@=DIR@:>@],
+ [Location of remctl headers and libraries])],
+ [AS_IF([test x"$withval" = xno],
+ [rra_use_remctl=false],
+ [AS_IF([test x"$withval" != xyes], [rra_remctl_root="$withval"])
+ rra_use_remctl=true])])
+ AC_ARG_WITH([remctl-include],
+ [AS_HELP_STRING([--with-remctl-include=DIR],
+ [Location of remctl headers])],
+ [AS_IF([test x"$withval" != xyes && test x"$withval" != xno],
+ [rra_remctl_includedir="$withval"])])
+ AC_ARG_WITH([remctl-lib],
+ [AS_HELP_STRING([--with-remctl-lib=DIR],
+ [Location of remctl libraries])],
+ [AS_IF([test x"$withval" != xyes && test x"$withval" != xno],
+ [rra_remctl_libdir="$withval"])])
+ AS_IF([test x"$rra_use_remctl" != xfalse],
+ [AS_IF([test x"$rra_use_remctl" = xtrue],
+ [_RRA_LIB_REMCTL_INTERNAL([true])],
+ [_RRA_LIB_REMCTL_INTERNAL([false])])])
+ AS_IF([test x"$REMCTL_LIBS" != x],
+ [rra_use_remctl=true
+ AC_DEFINE([HAVE_REMCTL], 1, [Define to enable remctl features.])])])