GSS_S_PROMPTING_NEEDED is a bit
[cyrus-sasl.git] / cmulocal / cyrus.m4
1 dnl
2 dnl Additional macros for configure.in packaged up for easier theft.
3 dnl $Id: cyrus.m4,v 1.4 2003/10/08 20:35:24 rjs3 Exp $
4 dnl tjs@andrew.cmu.edu 6-may-1998
5 dnl
6
7 dnl It would be good if ANDREW_ADD_LIBPATH could detect if something was
8 dnl already there and not redundantly add it if it is.
9
10 dnl add -L(arg), and possibly (runpath switch)(arg), to LDFLAGS
11 dnl (so the runpath for shared libraries is set).
12 AC_DEFUN([CMU_ADD_LIBPATH], [
13   # this is CMU ADD LIBPATH
14   if test "$andrew_runpath_switch" = "none" ; then
15         LDFLAGS="-L$1 ${LDFLAGS}"
16   else
17         LDFLAGS="-L$1 $andrew_runpath_switch$1 ${LDFLAGS}"
18   fi
19 ])
20
21 dnl add -L(1st arg), and possibly (runpath switch)(1st arg), to (2nd arg)
22 dnl (so the runpath for shared libraries is set).
23 AC_DEFUN([CMU_ADD_LIBPATH_TO], [
24   # this is CMU ADD LIBPATH TO
25   if test "$andrew_runpath_switch" = "none" ; then
26         $2="-L$1 ${$2}"
27   else
28         $2="-L$1 ${$2} $andrew_runpath_switch$1"
29   fi
30 ])
31
32 dnl runpath initialization
33 AC_DEFUN([CMU_GUESS_RUNPATH_SWITCH], [
34    # CMU GUESS RUNPATH SWITCH
35   AC_CACHE_CHECK(for runpath switch, andrew_runpath_switch, [
36     # first, try -R
37     SAVE_LDFLAGS="${LDFLAGS}"
38     LDFLAGS="-R /usr/lib"
39     AC_TRY_LINK([],[],[andrew_runpath_switch="-R"], [
40         LDFLAGS="-Wl,-rpath,/usr/lib"
41     AC_TRY_LINK([],[],[andrew_runpath_switch="-Wl,-rpath,"],
42     [andrew_runpath_switch="none"])
43     ])
44   LDFLAGS="${SAVE_LDFLAGS}"
45   ])])