diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | config.mk.in | 1 | ||||
-rwxr-xr-x | configure | 489 | ||||
-rw-r--r-- | configure.in | 76 | ||||
-rw-r--r-- | support/include/config.h.in | 18 |
5 files changed, 368 insertions, 225 deletions
@@ -1,3 +1,12 @@ +2005-08-26 Kevin Coffman <kwc@citi.umich.edu> + * configure.in etc + Consolidate some of the Kerberos checking instead of repeating + the same things for MIT and Heimdal. + Also adds more checks to distinguish 32-bit from 64-bit + (mainly for gssapi.h) + Fix svcgssd Makefile so make TOP=../../ works correctly there. + Enable running a modern autoheader. + 2005-04-12 G. Allen Morris III <gam3@gam3.net> * All Makefile: added TOP as needed for easier compile. diff --git a/config.mk.in b/config.mk.in index afbed88..fa05149 100644 --- a/config.mk.in +++ b/config.mk.in @@ -61,7 +61,6 @@ INSTALL = install MAN2PS = groff -Tps -man AFLAGS = -I$(TOP)support/include \ - -I$(KRBDIR)/include \ -Wall $(ARCHFLAGS) -pipe ifdef KERNEL_INCDIR AFLAGS += -I$(KERNEL_INCDIR) @@ -1540,21 +1540,14 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo event | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF - - LIBS="-levent $LIBS" - + libevent=1 else echo "$ac_t""no" 1>&6 { echo "configure: error: libevent needed for nfsv4 support" 1>&2; exit 1; } fi echo $ac_n "checking for nfs4_init_name_mapping in -lnfsidmap""... $ac_c" 1>&6 -echo "configure:1558: checking for nfs4_init_name_mapping in -lnfsidmap" >&5 +echo "configure:1551: checking for nfs4_init_name_mapping in -lnfsidmap" >&5 ac_lib_var=`echo nfsidmap'_'nfs4_init_name_mapping | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1562,7 +1555,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnfsidmap $LIBS" cat > conftest.$ac_ext <<EOF -#line 1566 "configure" +#line 1559 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1573,7 +1566,7 @@ int main() { nfs4_init_name_mapping() ; return 0; } EOF -if { (eval echo configure:1577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1588,14 +1581,7 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo nfsidmap | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF - - LIBS="-lnfsidmap $LIBS" - + libnfsidmap=1 else echo "$ac_t""no" 1>&6 { echo "configure: error: libnfsidmap needed for nfsv4 support" 1>&2; exit 1; } @@ -1605,17 +1591,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1609: checking for $ac_hdr" >&5 +echo "configure:1595: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1614 "configure" +#line 1600 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1619: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1646,17 +1632,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1650: checking for $ac_hdr" >&5 +echo "configure:1636: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1655 "configure" +#line 1641 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1686,7 +1672,7 @@ done fi if test "$knfsd_cv_glibc2" = no; then echo $ac_n "checking for daemon in -lbsd""... $ac_c" 1>&6 -echo "configure:1690: checking for daemon in -lbsd" >&5 +echo "configure:1676: checking for daemon in -lbsd" >&5 ac_lib_var=`echo bsd'_'daemon | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1694,7 +1680,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <<EOF -#line 1698 "configure" +#line 1684 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1705,7 +1691,7 @@ int main() { daemon() ; return 0; } EOF -if { (eval echo configure:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1732,14 +1718,14 @@ fi echo $ac_n "checking for the tcp wrapper library""... $ac_c" 1>&6 -echo "configure:1736: checking for the tcp wrapper library" >&5 +echo "configure:1722: checking for the tcp wrapper library" >&5 if eval "test \"`echo '$''{'knfsd_cv_tcp_wrapper'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else old_LIBS="$LIBS" LIBS="$LIBS -lwrap $LIBNSL" cat > conftest.$ac_ext <<EOF -#line 1743 "configure" +#line 1729 "configure" #include "confdefs.h" int deny_severity = 0; @@ -1748,7 +1734,7 @@ int main() { return hosts_ctl ("nfsd", "", "") ; return 0; } EOF -if { (eval echo configure:1752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* knfsd_cv_tcp_wrapper=yes else @@ -1775,17 +1761,17 @@ if test "$enable_gss" = yes; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1779: checking for $ac_hdr" >&5 +echo "configure:1765: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1784 "configure" +#line 1770 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1789: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1814,7 +1800,7 @@ done echo $ac_n "checking for Kerberos v5""... $ac_c" 1>&6 -echo "configure:1818: checking for Kerberos v5" >&5 +echo "configure:1804: checking for Kerberos v5" >&5 # Check whether --with-krb5 or --without-krb5 was given. if test "${with_krb5+set}" = set; then withval="$with_krb5" @@ -1830,8 +1816,8 @@ if test "${with_krb5+set}" = set; then fi - for dir in $krb5_with /usr/kerberos /usr/local /usr/local/krb5 /usr/krb5 \ - /usr/heimdal /usr/local/heimdal /usr/athena /usr ; do + for dir in $krb5_with /usr /usr/kerberos /usr/local /usr/local/krb5 \ + /usr/krb5 /usr/heimdal /usr/local/heimdal /usr/athena ; do K5CONFIG="" if test -f $dir/bin/krb5-config; then K5CONFIG=$dir/bin/krb5-config @@ -1839,6 +1825,13 @@ fi K5CONFIG="/usr/kerberos/bin/krb5-config" fi if test "$K5CONFIG" != ""; then + KRBINC=`$K5CONFIG --cflags` + KRBLIB=`$K5CONFIG --libs gssapi` + K5VERS=`$K5CONFIG --version | head -n 1 | awk '{split($4,v,"."); if (v[3] == "") v[3] = "0"; print v[1]v[2]v[3] }'` + cat >> confdefs.h <<EOF +#define KRB5_VERSION $K5VERS +EOF + if test -f $dir/include/gssapi/gssapi_krb5.h -a \ \( -f $dir/lib/libgssapi_krb5.a -o \ -f $dir/lib/libgssapi_krb5.so \) ; then @@ -1847,28 +1840,48 @@ fi EOF KRBDIR="$dir" - K5VERS=`$K5CONFIG --version | awk '{split($4,v,"."); print v[1]v[2]v[3] }'` - cat >> confdefs.h <<EOF -#define KRB5_VERSION $K5VERS -EOF - - KRBLIB=`$K5CONFIG --libs gssapi` - if test $K5VERS -le 131; then + if test $K5VERS -le 131; then cat >> confdefs.h <<\EOF -#define USE_PRIVATE_KRB5_FUNCTIONS 1 +#define USE_GSS_KRB5_CCACHE_NAME 1 EOF fi - echo $ac_n "checking for gss_krb5_export_lucid_sec_context in -lgssapi_krb5""... $ac_c" 1>&6 -echo "configure:1864: checking for gss_krb5_export_lucid_sec_context in -lgssapi_krb5" >&5 -ac_lib_var=`echo gssapi_krb5'_'gss_krb5_export_lucid_sec_context | sed 'y%./+-%__p_%'` + gssapi_lib=gssapi_krb5 + break + elif test \( -f $dir/include/heim_err.h -o\ + -f $dir/include/heimdal/heim_err.h \) -a \ + -f $dir/lib/libroken.a; then + cat >> confdefs.h <<\EOF +#define HAVE_HEIMDAL 1 +EOF + + KRBDIR="$dir" + gssapi_lib=gssapi + break + fi + CFLAGS=$CFLAGS `$K5CONFIG --cflags` + fi + done + if test "x$KRBDIR" = "x"; then + if test "x$krb5_with" = "x"; then + { echo "configure: error: Kerberos v5 with GSS support not found: consider --disable-gss or --with-krb5=" 1>&2; exit 1; } + else + { echo "configure: error: Kerberos v5 with GSS support not found at $krb5_with" 1>&2; exit 1; } + fi + fi + CFLAGS="$CFLAGS `$K5CONFIG --cflags`" + echo "$ac_t""$KRBDIR" 1>&6 + + echo $ac_n "checking for gss_krb5_export_lucid_sec_context in -l$gssapi_lib""... $ac_c" 1>&6 +echo "configure:1877: checking for gss_krb5_export_lucid_sec_context in -l$gssapi_lib" >&5 +ac_lib_var=`echo $gssapi_lib'_'gss_krb5_export_lucid_sec_context | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lgssapi_krb5 $KRBLIB $LIBS" +LIBS="-l$gssapi_lib $KRBLIB $LIBS" cat > conftest.$ac_ext <<EOF -#line 1872 "configure" +#line 1885 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1879,7 +1892,7 @@ int main() { gss_krb5_export_lucid_sec_context() ; return 0; } EOF -if { (eval echo configure:1883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1902,16 +1915,16 @@ else echo "$ac_t""no" 1>&6 fi - echo $ac_n "checking for gss_krb5_set_allowable_enctypes in -lgssapi_krb5""... $ac_c" 1>&6 -echo "configure:1907: checking for gss_krb5_set_allowable_enctypes in -lgssapi_krb5" >&5 -ac_lib_var=`echo gssapi_krb5'_'gss_krb5_set_allowable_enctypes | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gss_krb5_set_allowable_enctypes in -l$gssapi_lib""... $ac_c" 1>&6 +echo "configure:1920: checking for gss_krb5_set_allowable_enctypes in -l$gssapi_lib" >&5 +ac_lib_var=`echo $gssapi_lib'_'gss_krb5_set_allowable_enctypes | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lgssapi_krb5 $KRBLIB $LIBS" +LIBS="-l$gssapi_lib $KRBLIB $LIBS" cat > conftest.$ac_ext <<EOF -#line 1915 "configure" +#line 1928 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1922,7 +1935,7 @@ int main() { gss_krb5_set_allowable_enctypes() ; return 0; } EOF -if { (eval echo configure:1926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1945,16 +1958,16 @@ else echo "$ac_t""no" 1>&6 fi - echo $ac_n "checking for gss_krb5_ccache_name in -lgssapi_krb5""... $ac_c" 1>&6 -echo "configure:1950: checking for gss_krb5_ccache_name in -lgssapi_krb5" >&5 -ac_lib_var=`echo gssapi_krb5'_'gss_krb5_ccache_name | sed 'y%./+-%__p_%'` + echo $ac_n "checking for gss_krb5_ccache_name in -l$gssapi_lib""... $ac_c" 1>&6 +echo "configure:1963: checking for gss_krb5_ccache_name in -l$gssapi_lib" >&5 +ac_lib_var=`echo $gssapi_lib'_'gss_krb5_ccache_name | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lgssapi_krb5 $KRBLIB $LIBS" +LIBS="-l$gssapi_lib $KRBLIB $LIBS" cat > conftest.$ac_ext <<EOF -#line 1958 "configure" +#line 1971 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -1965,7 +1978,7 @@ int main() { gss_krb5_ccache_name() ; return 0; } EOF -if { (eval echo configure:1969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1988,183 +2001,107 @@ else echo "$ac_t""no" 1>&6 fi - break - elif test \( -f $dir/include/heim_err.h -o\ - -f $dir/include/heimdal/heim_err.h \) -a \ - -f $dir/lib/libroken.a; then - cat >> confdefs.h <<\EOF -#define HAVE_HEIMDAL 1 -EOF - - KRBDIR="$dir" - K5VERS=`$K5CONFIG --version | head -1 | awk '{split($2,v,"."); print v[1]v[2]v[3] }'` - cat >> confdefs.h <<EOF -#define KRB5_VERSION $K5VERS -EOF - - KRBLIB=`$K5CONFIG --libs gssapi` - echo $ac_n "checking for gss_krb5_export_lucid_sec_context in -lgssapi""... $ac_c" 1>&6 -echo "configure:2008: checking for gss_krb5_export_lucid_sec_context in -lgssapi" >&5 -ac_lib_var=`echo gssapi'_'gss_krb5_export_lucid_sec_context | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lgssapi $KRBLIB $LIBS" -cat > conftest.$ac_ext <<EOF -#line 2016 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gss_krb5_export_lucid_sec_context(); -int main() { -gss_krb5_export_lucid_sec_context() -; return 0; } -EOF -if { (eval echo configure:2027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_LUCID_CONTEXT_SUPPORT 1 -EOF + if test "x$krb5_with" != "x" -a "$krb5_with" != "$KRBDIR"; then + echo "configure: warning: Using $KRBDIR instead of requested value of $krb5_with for Kerberos!" 1>&2 + fi -else - echo "$ac_t""no" 1>&6 + + + + fi - echo $ac_n "checking for gss_krb5_set_allowable_enctypes in -lgssapi""... $ac_c" 1>&6 -echo "configure:2051: checking for gss_krb5_set_allowable_enctypes in -lgssapi" >&5 -ac_lib_var=`echo gssapi'_'gss_krb5_set_allowable_enctypes | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +for ac_hdr in com_err.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2020: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lgssapi $KRBLIB $LIBS" -cat > conftest.$ac_ext <<EOF -#line 2059 "configure" + cat > conftest.$ac_ext <<EOF +#line 2025 "configure" #include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gss_krb5_set_allowable_enctypes(); - -int main() { -gss_krb5_set_allowable_enctypes() -; return 0; } +#include <$ac_hdr> EOF -if { (eval echo configure:2070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_SET_ALLOWABLE_ENCTYPES 1 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $ac_tr_hdr 1 EOF - + else echo "$ac_t""no" 1>&6 fi +done - echo $ac_n "checking for gss_krb5_ccache_name in -lgssapi""... $ac_c" 1>&6 -echo "configure:2094: checking for gss_krb5_ccache_name in -lgssapi" >&5 -ac_lib_var=`echo gssapi'_'gss_krb5_ccache_name | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +for ac_hdr in et/com_err.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2060: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lgssapi $KRBLIB $LIBS" -cat > conftest.$ac_ext <<EOF -#line 2102 "configure" + cat > conftest.$ac_ext <<EOF +#line 2065 "configure" #include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gss_krb5_ccache_name(); - -int main() { -gss_krb5_ccache_name() -; return 0; } +#include <$ac_hdr> EOF -if { (eval echo configure:2113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_header_$ac_safe=yes" else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_GSS_KRB5_CCACHE_NAME 1 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $ac_tr_hdr 1 EOF - + else echo "$ac_t""no" 1>&6 fi - - break - fi - CFLAGS=$CFLAGS `$K5CONFIG --cflags` - fi - done - if test "x$KRBDIR" = "x"; then - echo "$ac_t"""no"" 1>&6 - if test "x$krb5_with" = "x"; then - { echo "configure: error: Kerberos v5 with GSS support not found: consider --disable-gss or --with-krb5=" 1>&2; exit 1; } - else - { echo "configure: error: Kerberos v5 with GSS support not found at $krb5_with" 1>&2; exit 1; } - fi - fi - echo "$ac_t""$KRBDIR" 1>&6 - if test "x$krb5_with" != "x" -a "$krb5_with" != "$KRBDIR"; then - echo "configure: warning: Using $KRBDIR instead of requested value of $krb5_with for Kerberos!" 1>&2 - fi - - - - -fi +done for ac_func in innetgr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2163: checking for $ac_func" >&5 +echo "configure:2100: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2168 "configure" +#line 2105 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2187,7 +2124,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2212,6 +2149,171 @@ fi done + echo $ac_n "checking size of short""... $ac_c" 1>&6 +echo "configure:2154: checking size of short" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <<EOF +#line 2162 "configure" +#include "confdefs.h" +#include <stdio.h> + #include <sys/types.h> + main() + { + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(short)); + exit(0); + } +EOF +if { (eval echo configure:2174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_short=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_short=0 +fi +rm -fr conftest* +fi + +fi + + echo "$ac_t""$ac_cv_sizeof_short" 1>&6 + cat >> confdefs.h <<EOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +EOF + + + echo $ac_n "checking size of int""... $ac_c" 1>&6 +echo "configure:2195: checking size of int" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <<EOF +#line 2203 "configure" +#include "confdefs.h" +#include <stdio.h> + #include <sys/types.h> + main() + { + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(int)); + exit(0); + } +EOF +if { (eval echo configure:2215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_int=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_int=0 +fi +rm -fr conftest* +fi + +fi + + echo "$ac_t""$ac_cv_sizeof_int" 1>&6 + cat >> confdefs.h <<EOF +#define SIZEOF_INT $ac_cv_sizeof_int +EOF + + + echo $ac_n "checking size of long""... $ac_c" 1>&6 +echo "configure:2236: checking size of long" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <<EOF +#line 2244 "configure" +#include "confdefs.h" +#include <stdio.h> + #include <sys/types.h> + main() + { + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(long)); + exit(0); + } +EOF +if { (eval echo configure:2256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_long=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_long=0 +fi +rm -fr conftest* +fi + +fi + + echo "$ac_t""$ac_cv_sizeof_long" 1>&6 + cat >> confdefs.h <<EOF +#define SIZEOF_LONG $ac_cv_sizeof_long +EOF + + + echo $ac_n "checking size of size_t""... $ac_c" 1>&6 +echo "configure:2277: checking size of size_t" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <<EOF +#line 2285 "configure" +#include "confdefs.h" +#include <stdio.h> + #include <sys/types.h> + main() + { + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + fprintf(f, "%d\n", sizeof(size_t)); + exit(0); + } +EOF +if { (eval echo configure:2297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_sizeof_size_t=`cat conftestval` +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_sizeof_size_t=0 +fi +rm -fr conftest* +fi + +fi + + echo "$ac_t""$ac_cv_sizeof_size_t" 1>&6 + cat >> confdefs.h <<EOF +#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t +EOF + + + cat >> confdefs.h <<EOF #define NFS_STATEDIR "$statedir" EOF @@ -2392,6 +2494,7 @@ s%@LIBBSD@%$LIBBSD%g s%@LIBWRAP@%$LIBWRAP%g s%@KRBDIR@%$KRBDIR%g s%@KRBLIB@%$KRBLIB%g +s%@KRBINC@%$KRBINC%g s%@K5VERS@%$K5VERS%g CEOF diff --git a/configure.in b/configure.in index aaffb2d..8cd00df 100644 --- a/configure.in +++ b/configure.in @@ -34,7 +34,7 @@ AC_ARG_ENABLE(nfsv3, enable_nfsv3=$enableval, enable_nfsv3=yes) if test "$enable_nfsv3" = yes; then - AC_DEFINE(NFS3_SUPPORTED) + AC_DEFINE(NFS3_SUPPORTED, 1, [Define this if you want NFSv3 support compiled in]) else enable_nfsv3= fi @@ -44,7 +44,7 @@ AC_ARG_ENABLE(nfsv4, enable_nfsv4=$enableval, enable_nfsv4=yes) if test "$enable_nfsv4" = yes; then - AC_DEFINE(NFS4_SUPPORTED) + AC_DEFINE(NFS4_SUPPORTED, 1, [Define this if you want NFSv4 support compiled in]) IDMAPD=idmapd else enable_nfsv4= @@ -57,7 +57,7 @@ AC_ARG_ENABLE(gss, enable_gss=$enableval, enable_gss=yes) if test "$enable_gss" = yes; then - AC_DEFINE(GSS_SUPPORTED) + AC_DEFINE(GSS_SUPPORTED, 1, [Define this if you want rpcsec_gss support compiled in]) GSSD=gssd SVCGSSD=svcgssd else @@ -78,7 +78,7 @@ AC_ARG_ENABLE(secure-statd, test "$enableval" = "yes" && secure_statd=yes, secure_statd=no) if test "$secure_statd" = yes; then - AC_DEFINE(RESTRICTED_STATD) + AC_DEFINE(RESTRICTED_STATD, 1, [Define this if you want to enable various security checks in statd. These checks basically keep anyone but lockd from using this service.]) fi AC_SUBST(secure_statd) AC_ARG_ENABLE(rquotad, @@ -117,8 +117,8 @@ AC_CHECK_LIB(socket, main, [LIBSOCKET="-lnsl"]) AC_CHECK_LIB(nsl, main, [LIBNSL="-lnsl"]) AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"]) if test "$enable_nfsv4" = yes; then - AC_CHECK_LIB(event, event_dispatch, , [AC_MSG_ERROR(libevent needed for nfsv4 support)]) - AC_CHECK_LIB(nfsidmap, nfs4_init_name_mapping, ,[AC_MSG_ERROR(libnfsidmap needed for nfsv4 support)]) + AC_CHECK_LIB(event, event_dispatch, [libevent=1], [AC_MSG_ERROR(libevent needed for nfsv4 support)]) + AC_CHECK_LIB(nfsidmap, nfs4_init_name_mapping, [libnfsidmap=1], [AC_MSG_ERROR(libnfsidmap needed for nfsv4 support)]) AC_CHECK_HEADERS(event.h, ,[AC_MSG_ERROR(libevent needed for nfsv4 support)]) AC_CHECK_HEADERS(nfsidmap.h, ,[AC_MSG_ERROR(libnfsidmap needed for nfsv4 support)]) fi @@ -155,8 +155,8 @@ if test "$enable_gss" = yes; then esac ] ) - for dir in $krb5_with /usr/kerberos /usr/local /usr/local/krb5 /usr/krb5 \ - /usr/heimdal /usr/local/heimdal /usr/athena /usr ; do + for dir in $krb5_with /usr /usr/kerberos /usr/local /usr/local/krb5 \ + /usr/krb5 /usr/heimdal /usr/local/heimdal /usr/athena ; do dnl This ugly hack brought on by the split installation of dnl MIT Kerberos on Fedora Core 1 K5CONFIG="" @@ -166,40 +166,34 @@ if test "$enable_gss" = yes; then K5CONFIG="/usr/kerberos/bin/krb5-config" fi if test "$K5CONFIG" != ""; then + KRBINC=`$K5CONFIG --cflags` + KRBLIB=`$K5CONFIG --libs gssapi` + K5VERS=`$K5CONFIG --version | head -n 1 | awk '{split($4,v,"."); if (v[[3]] == "") v[[3]] = "0"; print v[[1]]v[[2]]v[[3]] }'` + AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number]) if test -f $dir/include/gssapi/gssapi_krb5.h -a \ \( -f $dir/lib/libgssapi_krb5.a -o \ -f $dir/lib/libgssapi_krb5.so \) ; then - AC_DEFINE(HAVE_KRB5) + AC_DEFINE(HAVE_KRB5, 1, [Define this if you have MIT Kerberos libraries]) KRBDIR="$dir" - K5VERS=`$K5CONFIG --version | awk '{split($4,v,"."); print v[[1]]v[[2]]v[[3]] }'` - AC_DEFINE_UNQUOTED(KRB5_VERSION,$K5VERS) - KRBLIB=`$K5CONFIG --libs gssapi` + dnl If we are using MIT K5 1.3.1 and before, we *MUST* use the + dnl private function (gss_krb5_ccache_name) to get correct + dnl behavior of changing the ccache used by gssapi. + dnl Starting in 1.3.2, we *DO NOT* want to use + dnl gss_krb5_ccache_name, instead we want to set KRB5CCNAME + dnl to get gssapi to use a different ccache if test $K5VERS -le 131; then - AC_DEFINE(USE_PRIVATE_KRB5_FUNCTIONS) + AC_DEFINE(USE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the private function, gss_krb5_cache_name, must be used to tell the Kerberos library which credentials cache to use. Otherwise, this is done by setting the KRB5CCNAME environment variable]) fi - AC_CHECK_LIB(gssapi_krb5, gss_krb5_export_lucid_sec_context, - AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT),,$KRBLIB) - AC_CHECK_LIB(gssapi_krb5, gss_krb5_set_allowable_enctypes, - AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES),,$KRBLIB) - AC_CHECK_LIB(gssapi_krb5, gss_krb5_ccache_name, - AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME),,$KRBLIB) + gssapi_lib=gssapi_krb5 break dnl The following ugly hack brought on by the split installation dnl of Heimdal Kerberos on SuSe elif test \( -f $dir/include/heim_err.h -o\ -f $dir/include/heimdal/heim_err.h \) -a \ -f $dir/lib/libroken.a; then - AC_DEFINE(HAVE_HEIMDAL) + AC_DEFINE(HAVE_HEIMDAL, 1, [Define this if you have Heimdal Kerberos libraries]) KRBDIR="$dir" - K5VERS=`$K5CONFIG --version | head -1 | awk '{split($2,v,"."); print v[[1]]v[[2]]v[[3]] }'` - AC_DEFINE_UNQUOTED(KRB5_VERSION,$K5VERS) - KRBLIB=`$K5CONFIG --libs gssapi` - AC_CHECK_LIB(gssapi, gss_krb5_export_lucid_sec_context, - AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT),,$KRBLIB) - AC_CHECK_LIB(gssapi, gss_krb5_set_allowable_enctypes, - AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES),,$KRBLIB) - AC_CHECK_LIB(gssapi, gss_krb5_ccache_name, - AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME),,$KRBLIB) + gssapi_lib=gssapi break fi CFLAGS=$CFLAGS `$K5CONFIG --cflags` @@ -207,14 +201,23 @@ if test "$enable_gss" = yes; then done dnl We didn't find a usable Kerberos environment if test "x$KRBDIR" = "x"; then - AC_MSG_RESULT("no") if test "x$krb5_with" = "x"; then AC_MSG_ERROR(Kerberos v5 with GSS support not found: consider --disable-gss or --with-krb5=) else AC_MSG_ERROR(Kerberos v5 with GSS support not found at $krb5_with) fi fi + CFLAGS="$CFLAGS `$K5CONFIG --cflags`" AC_MSG_RESULT($KRBDIR) + + dnl Now check for functions within gssapi library + AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context, + AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT, 1, [Define this if the Kerberos GSS library supports gss_krb5_export_lucid_sec_context]), ,$KRBLIB) + AC_CHECK_LIB($gssapi_lib, gss_krb5_set_allowable_enctypes, + AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES, 1, [Define this if the Kerberos GSS library supports gss_krb5_set_allowable_enctypes]), ,$KRBLIB) + AC_CHECK_LIB($gssapi_lib, gss_krb5_ccache_name, + AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the Kerberos GSS library supports gss_krb5_ccache_name]), ,$KRBLIB) + dnl If they specified a directory and it didn't work, give them a warning if test "x$krb5_with" != "x" -a "$krb5_with" != "$KRBDIR"; then AC_MSG_WARN(Using $KRBDIR instead of requested value of $krb5_with for Kerberos!) @@ -222,6 +225,7 @@ if test "$enable_gss" = yes; then AC_SUBST([KRBDIR]) AC_SUBST([KRBLIB]) + AC_SUBST([KRBINC]) AC_SUBST([K5VERS]) fi @@ -229,6 +233,8 @@ dnl ************************************************************* dnl Check for headers dnl ************************************************************* dnl AC_HAVE_HEADERS(string.h) +AC_HAVE_HEADERS(com_err.h) +AC_HAVE_HEADERS(et/com_err.h) dnl ************************************************************* dnl Check for functions @@ -236,9 +242,17 @@ dnl ************************************************************* AC_HAVE_FUNCS(innetgr) dnl ************************************************************* +dnl Check for data sizes +dnl ************************************************************* +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) +AC_CHECK_SIZEOF(size_t) + +dnl ************************************************************* dnl Export some path names to config.h dnl ************************************************************* -AC_DEFINE_UNQUOTED(NFS_STATEDIR, "$statedir") +AC_DEFINE_UNQUOTED(NFS_STATEDIR, "$statedir", [This defines the location of the NFS state files. Warning: this must match definitions in config.mk!]) AC_SUBST(LDFLAGS) AC_SUBST(CXXFLAGS) diff --git a/support/include/config.h.in b/support/include/config.h.in index 6a6a065..4be7b04 100644 --- a/support/include/config.h.in +++ b/support/include/config.h.in @@ -5,6 +5,12 @@ /* Define this if you have string.h */ #undef HAVE_STRING_H +/* Define this if you have com_err.h */ +#undef HAVE_COM_ERR_H + +/* Define this if you have <et/com_err.h> */ +#undef HAVE_ET_COM_ERR_H + /* Define this if you have netgroup support */ #undef HAVE_INNETGR @@ -43,3 +49,15 @@ /* Define this if the Kerberos gssapi library has function * gss_krb5_cache_name */ #undef HAVE_GSS_KRB5_CCACHE_NAME + +/* The size of a `int', as computed by sizeof. */ +#undef SIZEOF_INT + +/* The size of a `long', as computed by sizeof. */ +#undef SIZEOF_LONG + +/* The size of a `short', as computed by sizeof. */ +#undef SIZEOF_SHORT + +/* The size of a `size_t', as computed by sizeof. */ +#undef SIZEOF_SIZE_T |