AC_INIT(src/Main.c)
AM_INIT_AUTOMAKE(Printer, 2.4d)

AC_PROG_CC
AC_PROG_INSTALL
  
AC_MINIX
AC_ISC_POSIX

AC_PROG_RANLIB
AC_PROG_CXX

AC_HEADER_STDC
AC_HEADER_DIRENT

AC_PATH_XTRA

builtin(include, offix.m4)dnl

OFFIX_CHECK_DND

AC_CHECK_LIB(Xpm,main,[AC_DEFINE(XPM) X_PRE_LIBS="-lXpm $X_PRE_LIBS"],,$X_LIBS -lX11 $X_EXTRA_LIBS)

dnl -------  path for xpm
AC_ARG_WITH(xpm-inc,
    [  ]--with-xpm-inc=value    where to find xpm include,
    [AC_DEFINE(XPM) X_CFLAGS="$X_CFLAGS -I$withval"],)
AC_ARG_WITH(xpm-lib,
    [  ]--with-xpm-lib=value    where to find xpm library,
    [X_PRE_LIBS="-lXpm $X_PRE_LIBS" LDFLAGS="$LDFLAGS -L$withval"],)

dnl -------  XtRegisterDrawable
ac_save_LIBS="$LIBS"
LIBS="$LIBS $X_LIBS -lXmu -lXt -lX11 $X_EXTRA_LIBS"
AC_CHECK_FUNC(XtRegisterDrawable, AC_DEFINE(HAVE_XTREGISTERDRAWABLE))
LIBS="$ac_save_LIBS"

dnl -------  use xshape X11 extension
AC_ARG_WITH(xshape,
    [  ]--with-xshape           make icons using XSHAPE extension,
    if test "$withval" != no; then 
	  AC_DEFINE(XSHAPE)
    fi,
	AC_DEFINE(XSHAPE))


dnl -------  LprNG spool system compatibility
AC_ARG_WITH(lprng,
    [  ]--with-lprng            use LprNG as spool system,
    if test "$withval" != no; then 
	  AC_DEFINE(USE_LpnNG)
    fi,
	AC_DEFINE(USE_LpnNG))

AC_OUTPUT(Makefile src/Makefile) 


