s4-s3upgrade: Add my wins.dat and fix the parsing error
[Samba.git] / lib / popt / libpopt.m4
blobcfa2eaad23210342575082f0d16009478dce2303
1 dnl Check to see if we should use the included popt
3 INCLUDED_POPT=auto
4 AC_ARG_WITH(included-popt,
5 [  --with-included-popt    use bundled popt library, not from system],
6 [ INCLUDED_POPT=$withval ])
8 AC_SUBST(POPT_LIBS)
9 AC_SUBST(POPT_CFLAGS)
11 if test x"$INCLUDED_POPT" != x"yes"; then
12         AC_CHECK_HEADERS(popt.h)
13         AC_CHECK_LIB(popt, poptGetContext, [ POPT_LIBS="-lpopt" ])
14         if test x"$ac_cv_header_popt_h" = x"no" -o x"$ac_cv_lib_popt_poptGetContext" = x"no"; then
15                 INCLUDED_POPT=yes
16                 POPT_CFLAGS=""
17         else
18                 INCLUDED_POPT=no
19         fi
22 AC_MSG_CHECKING(whether to use included popt)
23 AC_MSG_RESULT($INCLUDED_POPT)
24 if test x"$INCLUDED_POPT" != x"no"; then
25         dnl find the popt sources. This is meant to work both for 
26         dnl popt standalone builds, and builds of packages using popt
27         poptdir=""
28         poptpaths="$srcdir $srcdir/lib/popt $srcdir/popt $srcdir/../popt $srcdir/../lib/popt"
29         for d in $poptpaths; do
30                 if test -f "$d/popt.c"; then
31                         poptdir="$d"            
32                         POPT_CFLAGS="-I$d"
33                         AC_SUBST(poptdir)
34                         break
35                 fi
36         done
37         if test x"$poptdir" = "x"; then
38                 AC_MSG_ERROR([cannot find popt source in $poptpaths])
39         fi
40         POPT_OBJ="popt.o findme.o poptconfig.o popthelp.o poptparse.o"
41         AC_SUBST(POPT_OBJ)
42         AC_CHECK_HEADERS([float.h alloca.h])