$NetBSD: patch-ac,v 1.5 2006/10/10 03:20:48 ben Exp $ --- configure.orig 2002-07-09 02:17:13.000000000 -0400 +++ configure @@ -47,6 +47,8 @@ ac_help="$ac_help ac_help="$ac_help --disable-lckpwdf do not use the lckpwdf function" ac_help="$ac_help + --disable-crack do not use crack" +ac_help="$ac_help --with-mailspool path to mail spool directory [default _PATH_MAILDIR if defined in paths.h, otherwise /var/spool/mail]" @@ -1168,6 +1170,14 @@ else WITH_LCKPWDF=yes fi +# Check whether --enable-crack or --disable-crack was given. +if test "${enable_crack+set}" = set; then + enableval="$enable_crack" + WITH_CRACK=no +else + WITH_CRACK=yes +fi + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 @@ -1461,6 +1471,7 @@ fi +if test "$WITH_CRACK" = "yes"; then echo $ac_n "checking for FascistCheck in -lcrack""... $ac_c" 1>&6 echo "configure:1466: checking for FascistCheck in -lcrack" >&5 ac_lib_var=`echo crack'_'FascistCheck | sed 'y%./+-%__p_%'` @@ -1504,12 +1515,15 @@ else echo "$ac_t""no" 1>&6 HAVE_LIBCRACK=no fi +else +HAVE_LIBCRACK=no +fi -echo $ac_n "checking for fcrypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:1512: checking for fcrypt in -lcrypt" >&5 -ac_lib_var=`echo crypt'_'fcrypt | sed 'y%./+-%__p_%'` +echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 +echo "configure:1512: checking for crypt in -lcrypt" >&5 +ac_lib_var=`echo crypt'_'crypt | 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 @@ -1521,10 +1535,10 @@ cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then @@ -2312,7 +2326,7 @@ fi done -for ac_hdr in crypt.h +for ac_hdr in termios.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -2353,7 +2367,7 @@ fi done -for ac_hdr in ndbm.h db.h +for ac_hdr in shadow.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -2393,6 +2407,143 @@ else fi done +for ac_func in getspnam +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2400: 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 < +/* 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 $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2428: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + +for ac_hdr in crypt.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2457: 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 +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2467: \"$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_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_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + +for ac_hdr in ndbm.h db.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2498: 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 +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2508: \"$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_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_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + HAVE_NDBM_H=$ac_cv_header_ndbm_h @@ -2439,8 +2590,8 @@ done echo $ac_n "checking path to cracklib dictionary""... $ac_c" 1>&6 -echo "configure:2443: checking path to cracklib dictionary" >&5 -DICT_DIR_CANDIDATES="/usr/lib /usr/share/dict /usr/share/lib \ +echo "configure:2580: checking path to cracklib dictionary" >&5 +DICT_DIR_CANDIDATES="${prefix}/libdata /usr/lib /usr/share/dict /usr/share/lib \ /usr/local/lib /usr/local/share/lib" DICT_FILE_CANDIDATES="pw_dict cracklib_dict" CRACKLIB_DICTPATH=""