dnl	Bitmap to EPS conversion lib
AC_INIT(bmepsm.c)
AC_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_CPP
AC_PROG_RANLIB
AC_HEADER_CHECK(string.h, AC_DEFINE(HAVE_STRING_H))
AC_HEADER_CHECK(sys/types.h, AC_DEFINE(HAVE_SYS_TYPES_H))
AC_HEADER_CHECK(stdlib.h, AC_DEFINE(HAVE_STDLIB_H))
AC_HEADER_CHECK(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
AC_HEADER_CHECK(malloc.h, AC_DEFINE(HAVE_MALLOC_H))
AC_HEADER_CHECK(string.h, AC_DEFINE(HAVE_STRING_H))
AC_HEADER_CHECK(setjmp.h, AC_DEFINE(HAVE_SETJMP_H))
AC_HEADER_CHECK(process.h, AC_DEFINE(HAVE_PROCESS_H))
AC_HEADER_CHECK(io.h, AC_DEFINE(HAVE_IO_H))
AC_HEADER_CHECK(fcntl.h, AC_DEFINE(HAVE_FCNTL_H))
AC_HAVE_FUNCS(strcasecmp stricmp unlink remove getpid)
AC_HAVE_FUNCS(getmode _getmode setmode _setmode fileno _fileno)
AC_CHECK_LIB(z, deflate, ZLIB='-lz';AC_DEFINE(HAVE_ZLIB),ZLIB='')
AC_SUBST(ZLIB)
echo "Checking for libpng... "
AC_TRY_COMPILE([#include <png.h>], [
png_structp png_ptr;
], LIBPNG='-lpng';echo yes;AC_DEFINE(HAVE_LIBPNG), LIBPNG='';echo no)
AC_SUBST(LIBPNG)
echo "Checking for jpeglib... "
AC_TRY_COMPILE([#include <stdio.h>
#include <sys/types.h>
#include <jpeglib.h>], [
  struct jpeg_decompress_struct cinfo;
],echo yes;LIBJPG='-ljpeg';AC_DEFINE(HAVE_JPEGLIB_H),LIBJPG='';echo no)
AC_SUBST(LIBJPG)
echo "Checking for NetPBM..."
LIBPNM=''
AC_TRY_COMPILE([#include <stdio.h>
#include <pnm.h>
],[
int cols, rows, format;
xelval maxval;
cols = rows = format = 0;
pnm_readpnminit(stdin, &cols, &rows, &maxval, &format);
],echo yes;LIBPNM='-lpnm -lppm -lpgm -lpbm';AC_DEFINE(HAVE_PNM_H),LIBPNM='';echo no)
AC_SUBST(LIBPNM)
AC_OUTPUT(Makefile)

