(clean): clean universal binary intermediate steps, too
[arla.git] / cf / check-sl.m4
blobb729e6eae8c4301e9892a7ee078e3150f09a4673
1 dnl
2 dnl $Id$
3 dnl
5 AC_DEFUN([AC_CHECK_SL],[
7 SL_H=sl.h
8 DIR_sl=sl
9 LIB_sl='$(top_builddir)/lib/sl/libsl.la'
10 INC_sl='-I$(top_builddir)/include'
11 DEPEND_sl='$(top_builddir)/lib/sl/libsl.la'
13 AC_ARG_WITH(sl,
14 [  --with-sl=dir           make with sl in dir],
15 [if test "$with_sl" != "no"; then
16    SL_H=
17    DIR_sl=
18    DEPEND_sl=
19    if test "X$withval" != "Xyes"; then
20         if test -f "$withval/lib/liblsl.la" ; then
21             LIB_sl="$withval/lib/liblsl.la"
22         else
23             LIB_sl="-L$withval/lib -lsl"
24         fi
25         INC_sl="-I$withval/include"
26    else
27         LIB_sl='-lsl'
28         INC_sl=
29    fi
30 fi],[with_sl=builtin])
32 AC_ARG_WITH(sl-include,
33 [  --with-sl-include=dir   make with sl headers in dir],
34 [if test "$with_sl" != "no"; then
35    SL_H=
36    DIR_sl=
37    if test "X$withval" != "Xyes"; then
38         INC_sl="-I$withval"
39    else
40         INC_sl=
41    fi
42 fi])
44 AC_ARG_WITH(sl-lib,
45 [  --with-sl-lib=dir       make with sl lib in dir],
46 [if test "$with_sl" != "no"; then
47    SL_H=
48    DIR_sl=
49    DEPEND_sl=
50    if test "X$withval" != "Xyes"; then
51         if test -f "$withval/liblsl.la" ; then
52             LIB_sl="$withval/liblsl.la"
53         else
54             LIB_sl="-L$withval -lsl"
55         fi
56    else
57         LIB_sl="-lsl"
58    fi
59 fi])
61 dnl kerberos may include sl, lets use that if available
62 dnl should this try the roken path instead?
64 if test "X$SL_H" != "X"; then
66   old_LIBS="$LIBS"
67   LIBS="$KRB5_LIB_DIR -lsl $LIB_readline_ac $LIBS"
69   AC_MSG_CHECKING([for sl in $KRB5_LIB_DIR])
71   AC_TRY_LINK_FUNC(sl_apropos,
72   [working_krb_sl_libs=yes],[working_krb_sl_libs=no])
73   AC_MSG_RESULT($working_krb_sl_libs)
75   LIBS="$old_LIBS"
77   if test "X$working_krb_sl_libs" = "Xyes"; then
78     SL_H=
79     DIR_sl=
80     DEPEND_sl=
81     LIB_sl="$KRB5_LIB_DIR -lsl"
82     INC_sl="$KRB5_INC_DIR"
83   fi
87 AC_SUBST(INC_sl)
88 AC_SUBST(LIB_sl)
89 AC_SUBST(DIR_sl)
90 AC_SUBST(SL_H)
91 AC_SUBST(DEPEND_sl)
93 AC_MSG_CHECKING([if sl have sl_apropos])
94 AC_CACHE_VAL(ac_cv_slcompat_sl_apropos,[
96 if test "X$with_sl" = "Xbuiltin"; then
97     dnl built in sl do have sl_apropos
98     ac_cv_slcompat_sl_apropos=builtin   
99 else
100     old_LIBS="$LIBS"
101     LIBS="$LIB_sl $LIB_readline_ac $LIBS"
102     AC_TRY_LINK_FUNC(sl_apropos,
103     [ac_cv_slcompat_sl_apropos=yes],[ac_cv_slcompat_sl_apropos=no])
105     LIBS="$old_LIBS"
109 if test "X$ac_cv_slcompat_sl_apropos" = "Xno"; then
110         AC_DEFINE_UNQUOTED(NEED_SLCOMPAT_SL_APROPOS, 1,[libsl need sl_apropos])
113 AC_MSG_RESULT($ac_cv_slcompat_sl_apropos)