AC_INIT(xclipboard.c)
AM_INIT_AUTOMAKE(Clipboard, 2.4)

AC_PROG_CC
AC_PROG_INSTALL
  
AC_MINIX
AC_ISC_POSIX

AC_PROG_RANLIB
AC_PROG_CXX

AC_CHECK_FUNC(memmove,,AC_DEFINE(memmove,bcopy))

AC_PATH_XTRA

builtin(include,offix.m4)

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 ------------------------------------ AC_CHECK_TYPE(XPointer, char*)
ac_save_ac_cpp="$ac_cpp"
ac_cpp="$ac_cpp $X_CFLAGS"
AC_MSG_CHECKING(for XPointer)
AC_EGREP_HEADER(XPointer, X11/Xlib.h,
ac_cv_type_XPointer=yes, ac_cv_type_XPointer=no)
AC_MSG_RESULT($ac_cv_type_XPointer)
if test $ac_cv_type_XPointer = no; then
   AC_DEFINE(XPointer, char*)
fi
ac_cpp="$ac_save_ac_cpp"


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"],)

AC_OUTPUT(Makefile)
