AC_PREREQ(2.50)
AC_CONFIG_HEADER(config.h)
CUPS_VERSION="1.1.23"
AC_SUBST(CUPS_VERSION)
AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION")
AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION")
CFLAGS="${CFLAGS:=}"
CPPFLAGS="${CPPFLAGS:=}"
CXXFLAGS="${CXXFLAGS:=}"
LDFLAGS="${LDFLAGS:=}"
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL
if test "$INSTALL" = "$ac_install_sh"; then
INSTALL="`pwd`/install-sh -c"
fi
AC_PROG_RANLIB
AC_PATH_PROG(AR,ar)
AC_PATH_PROG(HTMLDOC,htmldoc)
AC_PATH_PROG(LN,ln)
AC_PATH_PROG(MV,mv)
AC_PATH_PROG(NROFF,nroff)
if test "x$NROFF" = x; then
AC_PATH_PROG(GROFF,groff)
if test "x$GROFF" = x; then
NROFF="echo"
else
NROFF="$GROFF -T ascii"
fi
fi
AC_PATH_PROG(RM,rm)
AC_PATH_PROG(SED,sed)
AC_PATH_PROG(STRIP,strip)
if test "x$AR" = x; then
AC_MSG_ERROR([Unable to find required library archive command.])
fi
if test "x$CC" = x; then
AC_MSG_ERROR([Unable to find required C compiler command.])
fi
if test "x$CXX" = x; then
AC_MSG_ERROR([Unable to find required C++ compiler command.])
fi
AC_C_BIGENDIAN
AC_SEARCH_LIBS(crypt, crypt)
AC_SEARCH_LIBS(getspent, sec gen)
LIBMALLOC=""
AC_ARG_ENABLE(mallinfo, [ --enable-mallinfo turn on malloc debug information, default=no])
if test x$enable_mallinfo = xyes; then
AC_CHECK_LIB(c,mallinfo,LIBS="$LIBS"; AC_DEFINE(HAVE_MALLINFO),LIBS="$LIBS")
if test "$ac_cv_lib_c_mallinfo" = "no"; then
AC_CHECK_LIB(malloc,mallinfo,
LIBS="$LIBS"
LIBMALLOC="-lmalloc"
AC_DEFINE(HAVE_MALLINFO),
LIBS="$LIBS")
fi
fi
AC_SUBST(LIBMALLOC)
AC_ARG_ENABLE(libpaper, [ --enable-libpaper turn on libpaper support, default=no])
if test x$enable_libpaper = xyes; then
AC_CHECK_LIB(paper,systempapername,
AC_DEFINE(HAVE_LIBPAPER)
LIBPAPER="-lpaper",
LIBPAPER="")
else
LIBPAPER=""
fi
AC_SUBST(LIBPAPER)
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_CHECK_HEADER(crypt.h,AC_DEFINE(HAVE_CRYPT_H))
AC_CHECK_HEADER(langinfo.h,AC_DEFINE(HAVE_LANGINFO_H))
AC_CHECK_HEADER(malloc.h,AC_DEFINE(HAVE_MALLOC_H))
AC_CHECK_HEADER(shadow.h,AC_DEFINE(HAVE_SHADOW_H))
AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
AC_CHECK_HEADER(inttypes.h,AC_DEFINE(HAVE_INTTYPES_H))
AC_CHECK_HEADER(libgen.h,AC_DEFINE(HAVE_LIBGEN_H))
AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
echo Forcing snprintf emulation for HP-UX.
else
AC_CHECK_FUNCS(snprintf vsnprintf)
fi
AC_MSG_CHECKING(for correct format string to use with strftime)
case "$uname" in
IRIX | SunOS*)
AC_MSG_RESULT(NULL)
AC_DEFINE(CUPS_STRFTIME_FORMAT, NULL)
;;
*)
AC_MSG_RESULT("%c")
AC_DEFINE(CUPS_STRFTIME_FORMAT, "%c")
;;
esac
AC_CHECK_FUNCS(mkstemp mkstemps)
AC_CHECK_FUNCS(geteuid)
AC_CHECK_FUNCS(vsyslog)
case "$uname" in
Linux | GNU)
;;
*)
AC_CHECK_FUNCS(sigset)
;;
esac
AC_CHECK_FUNCS(sigaction)
AC_CHECK_FUNCS(waitpid)
AC_CHECK_FUNCS(wait3)
AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
AC_TRY_COMPILE([ int o = t.tm_gmtoff;],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_TM_GMTOFF),
AC_MSG_RESULT(no))
AC_CHECK_HEADER(notify.h, AC_DEFINE(HAVE_NOTIFY_H))
AC_CHECK_FUNCS(notify_post)
AC_MSG_CHECKING(for CFLocaleCreateCanonicalLocaleIdentifierFromString)
if test "$uname" = "Darwin" -a $uversion -ge 700; then
AC_DEFINE(HAVE_CF_LOCALE_ID)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
AC_CHECK_FUNCS(mbr_uid_to_uuid)
case $uname in
Darwin* | *BSD*)
ARFLAGS="-rcv"
;;
*)
ARFLAGS="crvs"
;;
esac
AC_SUBST(ARFLAGS)
case $uname in
Darwin*)
BACKLIBS="-framework CoreFoundation -framework IOKit"
COMMONLIBS=""
LIBCUPSLIBS="-framework CoreFoundation"
CUPSDLIBS="-framework CoreFoundation -framework IOKit \$(DNSSDLIBS)"
;;
*)
BACKLIBS=""
COMMONLIBS=""
LIBCUPSLIBS=""
CUPSDLIBS=""
;;
esac
AC_SUBST(BACKLIBS)
AC_SUBST(COMMONLIBS)
AC_SUBST(LIBCUPSLIBS)
AC_SUBST(CUPSDLIBS)