1dnl Check to see if we should use the included popt 2 3INCLUDED_POPT=auto 4AC_ARG_WITH(included-popt, 5[ --with-included-popt use bundled popt library, not from system], 6[ INCLUDED_POPT=$withval ]) 7 8AC_SUBST(POPT_LIBS) 9AC_SUBST(POPT_CFLAGS) 10 11if 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 20fi 21 22AC_MSG_CHECKING(whether to use included popt) 23AC_MSG_RESULT($INCLUDED_POPT) 24if 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]) 43fi 44