dnl Process this file with autoconf to produce a configure script.

AC_INIT(barcode.h)
AC_PREREQ(2.12)

AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL

dnl Add "-Wall" if this is gcc
if test x$GCC = xyes; then
	CFLAGS="$CFLAGS -Wall"
fi


dnl Check for getopt and libpaper. If getopt is missing, use our version
AC_CHECK_HEADER(getopt.h, ,NO_GETOPT=-DNO_GETOPT;GETOPT_O=compat/getopt.o)
AC_CHECK_HEADER(paper.h, LIBPAPER=-lpaper, NO_LIBPAPER=-DNO_LIBPAPER)

AC_CHECK_FUNC(strerror, , NO_STRERROR=-DNO_STRERROR)

AC_SUBST(GETOPT_O)
AC_SUBST(NO_GETOPT)
AC_SUBST(NO_LIBPAPER)
AC_SUBST(LIBPAPER)
AC_SUBST(NO_STRERROR)
AC_OUTPUT(Makefile)
