s3-waf: Link split_tokens only against needed subsystems.
[Samba/gbeck.git] / lib / iniparser_build / config.m4
blob282c977c18d2cb6ee0406c2e8ea655f3df801497
1 AC_ARG_WITH(included-iniparser,
2 [AS_HELP_STRING([--with-included-iniparser], [use bundled iniparser library, not from system])],
4   case "$withval" in
5   yes)
6     INCLUDED_INIPARSER=yes
7     ;;
8   no)
9     INCLUDED_INIPARSER=no
10     ;;
11   esac ],
13 if test x"$INCLUDED_INIPARSER" != x"yes"; then
14     AC_CHECK_LIB_EXT(iniparser, LIBINIPARSER_LIBS, iniparser_load)
18 AC_MSG_CHECKING(whether to use included iniparser)
19 if test x"$ac_cv_lib_ext_iniparser" != x"yes"; then
21   iniparserpaths="../iniparser ../lib/iniparser"
22   for d in $iniparserpaths; do
23     if test -f "$srcdir/$d/src/iniparser.c"; then
24       iniparserdir="$d"
25       break;
26     fi
27   done
28   if test x"$iniparserdir" = "x"; then
29      AC_MSG_ERROR([cannot find iniparser source in $iniparserpaths])
30   fi
31   INIPARSER_CFLAGS="-I$srcdir/$iniparserdir/src"
32   AC_MSG_RESULT(yes)
34   INIPARSER_OBJS=""
35   INIPARSER_OBJS="$INIPARSER_OBJS $srcdir/$iniparserdir/../iniparser_build/iniparser.o"
36   INIPARSER_OBJS="$INIPARSER_OBJS $srcdir/$iniparserdir/../iniparser_build/dictionary.o"
37   INIPARSER_OBJS="$INIPARSER_OBJS $srcdir/$iniparserdir/../iniparser_build/strlib.o"
39   SMB_SUBSYSTEM(LIBINIPARSER,[$INIPARSER_OBJS],[],[$INIPARSER_CFLAGS])
40 else
41   AC_MSG_RESULT(no)
42   SMB_EXT_LIB(LIBINIPARSER,,,,${LIBINIPARSER_LIBS})
43   SMB_ENABLE(LIBINIPARSER,YES)