diff options
author | Russ Allbery <rra@stanford.edu> | 2008-01-04 02:13:41 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2008-01-04 02:13:41 +0000 |
commit | 71ab261ffdb5be4c70c1e5575ee1547913ea77fa (patch) | |
tree | a12269f87d70b58a599e7ed45143d8d5cff79721 /configure.ac | |
parent | a7f692f43917e4a1f3cc2b9f6dbb87ab66ca96d1 (diff) |
The build system now probes for GSS-API, Kerberos v5 and v4, and AFS
libraries as necessary rather than hard-coding libraries. Building
on systems without strong shared library dependencies and building
against static libraries should now work.
Building kasetkey (for AFS kaserver synchronization) is now optional
and not enabled by default. Pass --with-afs to enable it. This
allows wallet to be easily built in an environment without AFS.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 89 |
1 files changed, 23 insertions, 66 deletions
diff --git a/configure.ac b/configure.ac index da5c302..dd4b502 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,8 @@ dnl Process this file with Autoconf to produce a configure script. dnl $Id$ dnl dnl Written by Russ Allbery <rra@stanford.edu> -dnl Copyright 2006, 2007 Board of Trustees, Leland Stanford Jr. University +dnl Copyright 2006, 2007, 2008 +dnl Board of Trustees, Leland Stanford Jr. University dnl dnl See LICENSE for licensing terms. @@ -14,34 +15,18 @@ AC_CONFIG_LIBOBJ_DIR([portable]) AM_INIT_AUTOMAKE([1.10]) AM_MAINTAINER_MODE -AFS_CPPFLAGS= -AC_ARG_WITH([afs-headers], - AC_HELP_STRING([--with-afs-headers=DIR], - [Prefix for AFS headers (for kasetkey)]), - [if test x"$withval" != xno ; then - AFS_CPPFLAGS="-I${withval}" - fi]) -AC_SUBST([AFS_CPPFLAGS]) -AFS_LDFLAGS= -AC_ARG_WITH([afs-libs], - AC_HELP_STRING([--with-afs-libs=DIR], - [Prefix for AFS libraries (for kasetkey)]), - [if test x"$withval" != xno ; then - AFS_LDFLAGS="-L${withval} -L${withval}/afs" - fi]) -AC_SUBST([AFS_LDFLAGS]) +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_INSTALL +AC_PROG_RANLIB -REMCTL_CPPFLAGS= -REMCTL_LDFLAGS= -AC_ARG_WITH([remctl], - AC_HELP_STRING([--with-remctl=DIR], - [Prefix for remctl headers and libraries]), - [if test x"$withval" != xno ; then - REMCTL_CPPFLAGS="-I${withval}/include" - REMCTL_LDFLAGS="-L${withval}/lib" - fi]) -AC_SUBST([REMCTL_CPPFLAGS]) -AC_SUBST([REMCTL_LDFLAGS]) +AC_CHECK_DECLS([snprintf, vsnprintf]) +RRA_C_C99_VAMACROS +RRA_C_GNU_VAMACROS +AC_CHECK_TYPES([long long]) +RRA_FUNC_SNPRINTF +AC_CHECK_FUNCS([setrlimit]) +AC_REPLACE_FUNCS([asprintf]) AC_ARG_WITH([wallet-server], AC_HELP_STRING([--with-wallet-server=HOST], [Default wallet server]), @@ -57,6 +42,16 @@ AC_ARG_WITH([wallet-port], [Define to the default server port.]) fi]) +RRA_LIB_REMCTL +RRA_LIB_KRB5 +RRA_LIB_AFS +AS_IF([test x"$rra_afs" = xtrue], + [RRA_LIB_KRB4 + RRA_LIB_AFS_SWITCH + AC_CHECK_DECLS([ubik_Call], , , [#include <ubik.h>]) + RRA_LIB_AFS_RESTORE]) +AM_CONDITIONAL([AFS], [test x"$rra_afs" = xtrue]) + AC_ARG_VAR([REMCTLD], [Path to the remctld binary]) AC_PATH_PROG([REMCTLD], [remctld], , [$PATH:/usr/sbin:/usr/local/sbin]) if test x"$REMCTLD" != x ; then @@ -64,44 +59,6 @@ if test x"$REMCTLD" != x ; then [Define to the full path to remctld to run remctl tests.]) fi -AC_PROG_CC -AM_PROG_CC_C_O -AC_PROG_INSTALL -AC_PROG_RANLIB -AC_SEARCH_LIBS([gethostbyname], [nsl]) -AC_SEARCH_LIBS([socket], [socket], , - [AC_CHECK_LIB([nsl], [socket], - [LIBS="-lnsl -lsocket $LIBS"], , [-lsocket])]) -AC_SEARCH_LIBS([res_search], [resolv], , - [AC_SEARCH_LIBS([__res_search], [resolv])]) - -save_LDFLAGS=$LDFLAGS -LDFLAGS="$AFS_LDFLAGS $LDFLAGS" -AC_CHECK_LIB([afsauthent], [KAM_DeleteUser], - [AFS_LIBS="-lafsauthent -lafsrpc -lpthread"], - [AFS_LIBS="-lkauth.krb -lauth.krb -lubik -lrxkad -lrx -llwp -lsys" - AFS_LIBS="${AFS_LIBS} -lcom_err -lafsutil"], - [-lafsrpc -lpthread]) -LDFLAGS="$save_LDFLAGS" -AC_SUBST([AFS_LIBS]) - -AC_CHECK_HEADERS([kerberosIV/krb.h]) -AC_CHECK_DECLS([snprintf, vsnprintf]) -AC_CHECK_DECLS([ubik_Call], , , [#include <ubik.h>]) -RRA_C_C99_VAMACROS -RRA_C_GNU_VAMACROS -AC_CHECK_TYPES([long long]) -RRA_FUNC_SNPRINTF -AC_CHECK_FUNCS([setrlimit]) -AC_REPLACE_FUNCS([asprintf]) - -save_LIBS=$LIBS -LIBS=-lkrb5 -AC_CHECK_FUNCS([krb5_get_error_message \ - krb5_free_error_message \ - krb5_get_err_text]) -LIBS=$save_LIBS - dnl Needed to get prototypes for functions like asprintf on Linux. AC_DEFINE([_GNU_SOURCE], [1], [Define to 1 on Linux to get full prototypes.]) |