* aclocal.m4 (KRB5_AC_CHOOSE_SS): Check that the indicated system ss package
authorKen Raeburn <raeburn@mit.edu>
Thu, 19 Sep 2002 18:19:38 +0000 (18:19 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 19 Sep 2002 18:19:38 +0000 (18:19 +0000)
can actually be linked against and will produce programs that run.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14881 dc483132-0cff-0310-8789-dd5450dbe970

src/ChangeLog
src/aclocal.m4

index 71fab49ea4bdf05aa16e1b3a6086c453c3baf8ed..a6639e2e3d289e90a55d6d9e28be883477f607c6 100644 (file)
@@ -1,3 +1,9 @@
+2002-09-19  Ken Raeburn  <raeburn@mit.edu>
+
+       * aclocal.m4 (KRB5_AC_CHOOSE_SS): Check that the indicated system
+       ss package can actually be linked against and will produce
+       programs that run.
+
 2002-09-15  Tom Yu  <tlyu@mit.edu>
 
        * aclocal.m4 (AC_KRB5_TCL_FIND_CONFIG): Set TCL_LIBPATH and
index 381b99835a004776c93f968daef85cffa35f8f8e..aa2da119bcfcfa634c151260bf93b6ee10ae1056 100644 (file)
@@ -1437,13 +1437,31 @@ AC_DEFUN([KRB5_AC_CHOOSE_SS],[
 AC_ARG_WITH(system-ss,
            AC_HELP_STRING(--with-system-ss,use system -lss and mk_cmds @<:@default: use a private version@:>@))
 AC_ARG_VAR(SS_LIB,[system libraries for 'ss' package, if --with-system-ss was specified [-lss]])
+AC_MSG_CHECKING(which version of subsystem package to use)
 if test "x$with_system_ss" = xyes ; then
   SS_VERSION=sys
+  AC_MSG_RESULT(system)
   # todo: check for various libraries we might need
   # in the meantime...
   test "x${SS_LIB+set}" = xset || SS_LIB=-lss
+  old_LIBS="$LIBS"
+  LIBS="$LIBS $SS_LIB"
+  AC_CACHE_CHECK(whether system ss package works, krb5_cv_system_ss_okay,[
+  AC_TRY_RUN([
+#include <ss/ss.h>
+int main(int argc, char *argv[]) {
+  if (argc == 42) {
+    int i, err;
+    i = ss_create_invocation("foo","foo","",0,&err);
+    ss_listen(i);
+  }
+  return 0;
+}], krb5_cv_system_ss_okay=yes, AC_MSG_ERROR(cannot run test program),
+  krb5_cv_system_ss_okay="assumed")])
+  LIBS="$old_LIBS"
 else
   SS_VERSION=k5
+  AC_MSG_RESULT(krb5)
 fi
 AC_SUBST(SS_LIB)
 AC_SUBST(SS_VERSION)