Better support for "non-standard" GSS mechs (fix)
[metze/heimdal/wip.git] / configure.ac
index f1e8d7b15e5328cb46a9a4a87437591fae0c95cc..29709561b65626cc865a583f77c17e38a93e90b3 100644 (file)
@@ -182,6 +182,54 @@ AM_CONDITIONAL([HAVE_CAPNG], [test "$with_capng" != "no"])
 AC_SUBST([CAPNG_CFLAGS])
 AC_SUBST([CAPNG_LIBS])
 
+dnl libmicrohttpd
+AC_ARG_WITH([microhttpd],
+  AC_HELP_STRING([--with-microhttpd], [use microhttpd to serve KDC REST API @<:@default=check@:>@]),
+  [],
+  [with_microhttpd=check])
+if test "$with_microhttpd" != "no"; then
+  PKG_CHECK_MODULES([MICROHTTPD], [libmicrohttpd >= 0.9.37],
+                   [with_microhttpd=yes],[with_microhttpd=no])
+fi
+if test "$with_microhttpd" = "yes"; then
+  AC_DEFINE_UNQUOTED([HAVE_MICROHTTPD], 1, [whether libmicrohttpd is available for KDC REST API])
+fi
+AM_CONDITIONAL([HAVE_MICROHTTPD], [test "$with_microhttpd" != "no"])
+AC_SUBST([MICROHTTPD_CFLAGS])
+AC_SUBST([MICROHTTPD_LIBS])
+
+dnl libcjwt
+AC_ARG_WITH([cjwt],
+  AC_HELP_STRING([--with-cjwt], [(Experimental) use cjwt to validate JWT tokens @<:@default=check@:>@]),
+  [],
+  [with_cjwt=check])
+if test "$with_cjwt" != "no"; then
+  PKG_CHECK_MODULES([CJWT], [libcjwt >= 1.0.0],
+                   [with_cjwt=yes],[with_cjwt=no])
+fi
+if test "$with_cjwt" = "yes"; then
+  AC_DEFINE_UNQUOTED([HAVE_CJWT], 1, [whether libcjwt is available for KDC REST API])
+fi
+AM_CONDITIONAL([HAVE_CJWT], [test "$with_cjwt" != "no"])
+AC_SUBST([CJWT_CFLAGS])
+AC_SUBST([CJWT_LIBS])
+
+dnl libcjson
+AC_ARG_WITH([cjson],
+  AC_HELP_STRING([--with-cjson], [(Experimental) use cJSON to extract private claims from JWT tokens @<:@default=check@:>@]),
+  [],
+  [with_cjson=check])
+if test "$with_cjson" != "no"; then
+  PKG_CHECK_MODULES([CJSON], [libcjson >= 1.0.0],
+                   [with_cjson=yes],[with_cjson=no])
+fi
+if test "$with_cjson" = "yes"; then
+  AC_DEFINE_UNQUOTED([HAVE_CJSON], 1, [whether libcjson is available for KDC REST API])
+fi
+AM_CONDITIONAL([HAVE_CJSON], [test "$with_cjson" != "no"])
+AC_SUBST([CJSON_CFLAGS])
+AC_SUBST([CJSON_LIBS])
+
 dnl Check for sqlite
 rk_TEST_PACKAGE(sqlite3,
 [#include <sqlite3.h>
@@ -349,11 +397,13 @@ AC_CHECK_HEADERS([\
        fnmatch.h                               \
        inttypes.h                              \
        io.h                                    \
+       keyutils.h                              \
        libutil.h                               \
        limits.h                                \
        maillock.h                              \
        netgroup.h                              \
        netinet/in6_machtypes.h                 \
+       netinet/tcp.h                           \
        pthread.h                               \
        pty.h                                   \
        sac.h                                   \
@@ -456,7 +506,7 @@ AC_FIND_FUNC_NO_LIBS(openpty, util,[
 #endif
 ],[0,0,0,0,0])
 
-AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses,[
+AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses tinfo,[
 #ifdef HAVE_TERMCAP_H
 #include <termcap.h>
 #endif
@@ -523,6 +573,7 @@ KRB_CAPABILITIES
 rk_DLADDR
 
 AC_CHECK_GETPWNAM_R_POSIX
+AC_CHECK_GETPWUID_R_POSIX
 
 dnl detect doors on solaris
 if test "$enable_pthread_support" != no; then
@@ -547,7 +598,28 @@ if test "$enable_kcm" = yes; then
 fi
 AM_CONDITIONAL(KCM, test "$enable_kcm" = yes)
 
+dnl detect keyring on Linux
+if test "$ac_cv_header_keyutils_h" = yes; then
+    AC_CHECK_SIZEOF([key_serial_t],,[
+       #ifdef HAVE_INTTYPES_H
+       #include <inttypes.h>
+       #endif
+       #ifdef HAVE_SYS_TYPES_H
+       #include <sys/types.h>
+       #endif
+       #include <keyutils.h>
+    ])
+fi
+
+AC_FIND_FUNC_NO_LIBS(add_key, keyutils)
+if test -n "$LIB_add_key"; then
+    saved_LIBS="$LIBS"
+    LIBS="$LIBS $LIB_add_key"
+    AC_CHECK_FUNCS(keyctl_get_persistent)
+    LIBS="$saved_LIBS"
+fi
 
+AC_CHECK_SIZEOF([time_t])
 
 dnl Cray stuff
 AC_CHECK_FUNCS(getudbnam setlim)
@@ -642,7 +714,6 @@ AC_CONFIG_FILES(Makefile            \
        appl/dbutils/Makefile           \
        appl/gssmask/Makefile           \
        appl/otp/Makefile               \
-       appl/su/Makefile                \
        appl/test/Makefile              \
        appl/kf/Makefile                \
        appl/dceutils/Makefile          \
@@ -713,12 +784,13 @@ else
             User=${USER:-${LOGNAME:-`id -nu`}}
         fi
         if test -d "$srcdir/.git"; then
-            GitCommit=`git rev-parse HEAD`
-            GitBranch=`git rev-parse --abbrev-ref HEAD`
+            GitCommit=`cd $srcdir && git rev-parse HEAD`
+            GitBranch=`cd $srcdir && git rev-parse --abbrev-ref HEAD`
             if test "x$GitBranch" = master; then
-                GitDesc=`git describe --all --dirty`
+                GitDesc=`cd $srcdir && git describe --all --dirty`
             else
-                GitDesc=`git describe --tags --match 'heimdal-*' --dirty`
+                GitDesc=`cd $srcdir && \
+                        git describe --tags --match 'heimdal-*' --dirty`
             fi
         else
             GitCommit='<commit-unknown>'