AC_INIT(src/Main.c)
AM_INIT_AUTOMAKE(Files, 2.4e)

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
AC_FUNC_ALLOCA

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 -------  getwd
AC_CHECK_FUNCS(getwd)

dnl -------  use magic_headers in Files
AC_DEFINE(MAGIC_HEADERS)
AC_ARG_WITH(magic-headers,
    [  ]--with-magic-headers    identify file types by magic headers,	
    if test "$withval" != no; then 
	  AC_DEFINE(USE_MAGIC_HEADERS)
    fi)

AC_OUTPUT(Makefile src/Makefile src/bitmaps/Makefile src/pixmaps/Makefile
		src/external/Makefile src/regexp/Makefile
		pixmaps/Makefile bitmaps/Makefile) 


