GSS_S_PROMPTING_NEEDED is a bit
[cyrus-sasl.git] / cmulocal / common.m4
1 dnl $Id: common.m4,v 1.13 2006/02/25 18:29:46 cg2v Exp $
2
3 AC_DEFUN([CMU_TEST_LIBPATH], [
4 changequote(<<, >>)
5 define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_lib, <<- *>>, <<__p>>))
6 changequote([, ])
7 if test "$CMU_AC_CV_FOUND" = "yes"; then
8   if test \! -r "$1/lib$2.a" -a \! -r "$1/lib$2.so" -a \! -r "$1/lib$2.sl" -a \! -r "$1/lib$2.dylib"; then
9     CMU_AC_CV_FOUND=no
10   fi
11 fi
12 ])
13
14 AC_DEFUN([CMU_TEST_INCPATH], [
15 changequote(<<, >>)
16 define(<<CMU_AC_CV_FOUND>>, translit(ac_cv_found_$2_inc, [ *], [_p]))
17 changequote([, ])
18 if test "$CMU_AC_CV_FOUND" = "yes"; then
19   if test \! -r "$1/$2.h"; then
20     CMU_AC_CV_FOUND=no
21   fi
22 fi
23 ])
24
25 dnl CMU_CHECK_HEADER_NOCACHE(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
26 AC_DEFUN([CMU_CHECK_HEADER_NOCACHE],
27 [dnl Do the transliteration at runtime so arg 1 can be a shell variable.
28 ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
29 AC_MSG_CHECKING([for $1])
30 AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes",
31   eval "ac_cv_header_$ac_safe=no")
32 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
33   AC_MSG_RESULT(yes)
34   ifelse([$2], , :, [$2])
35 else
36   AC_MSG_RESULT(no)
37 ifelse([$3], , , [$3
38 ])dnl
39 fi
40 ])
41
42 AC_DEFUN([CMU_FIND_LIB_SUBDIR],
43 [dnl
44 AC_ARG_WITH([lib-subdir], AC_HELP_STRING([--with-lib-subdir=DIR],[Find libraries in DIR instead of lib]))
45 AC_CHECK_SIZEOF(long)
46 AC_CACHE_CHECK([what directory libraries are found in], [ac_cv_cmu_lib_subdir],
47 [test "X$with_lib_subdir" = "Xyes" && with_lib_subdir=
48 test "X$with_lib_subdir" = "Xno" && with_lib_subdir=
49 if test "X$with_lib_subdir" = "X" ; then
50   ac_cv_cmu_lib_subdir=lib
51   if test $ac_cv_sizeof_long -eq 4 ; then
52     test -d /usr/lib32 && ac_cv_cmu_lib_subdir=lib32
53   fi
54   if test $ac_cv_sizeof_long -eq 8 ; then
55     test -d /usr/lib64 && ac_cv_cmu_lib_subdir=lib64
56   fi
57 else
58   ac_cv_cmu_lib_subdir=$with_lib_subdir
59 fi])
60 AC_SUBST(CMU_LIB_SUBDIR, $ac_cv_cmu_lib_subdir)
61 ])