dnl Process this file with autoconf to produce a configure script.
AC_INIT(picoapi/init.c)
AM_INIT_AUTOMAKE(api, 0.9)
dnl Checks for programs.

dnl Checks for libraries.
AC_PROG_LIBTOOL

dnl Checks for header files.
AC_PATH_XTRA
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(strtoul)

AM_CONDITIONAL(ARM, test "$host_alias" = arm-linux-gnu -o "$host_alias" = arm-linux-gnu)

AC_ARG_ENABLE(debug, [--enable-debug            Enable debugging], [CFLAGS=-g CXXFLAGS=-g], [CFLAGS="" CXXFLAGS=""] )

AC_ARG_WITH(tk, [ --with-tk		Tk library], [export TK_LIB=$withval],[export TK_LIB=/usr/local/lib/])
AC_ARG_WITH(acctrl, [ --with-acctrl		Acctrl library], [export ACCTL_LIB=$withval],[export ACCTL_LIB=/usr/local/lib/])
AC_ARG_WITH(misc, [ --with-misc		Miscellanious library], [export MISC_LIB=$withval],[export MISC_LIB=/usr/local/lib/])
AC_ARG_WITH(picowidget, [ --with-picowidget		Picowidget library], [export PICOWIDGET=$withval],[export PICOWIDGET=/usr/local/lib/])

AC_SUBST(TK_LIB)
AC_SUBST(ACCTL_LIB)
AC_SUBST(MISC_LIB)
AC_SUBST(PICOWIDGET)

dnl if test "$host_alias" != arm-linux-gnu; then
dnl AC_CHECK_LIB(tk8.4, Tk_Init)
dnl fi

AC_OUTPUT(Makefile picoapi/Makefile systemapi/Makefile)
