#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT(jbrowse, 0.1, gmod-ajax@lists.sourceforge.net)
AC_CONFIG_HEADER([src/config.h])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_LN_S

AC_DEFINE_UNQUOTED([CPLUSPLUS_COMPILER],["$CXX"],[C++ compiler])

# Checks for libraries.

# Check for libpng
AC_SEARCH_LIBS([png_create_write_struct],
	[png],
	[],
	[AC_MSG_ERROR([libpng not found. Please install libpng and try again. Or if it is already installed (e.g. in /usr/X11), pass the include and link paths to configure like so: ./configure CXXFLAGS=-I/usr/X11/include LDFLAGS=-L/usr/X11/lib])])

# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([float.h stdlib.h string.h unistd.h png.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T
AC_C_RESTRICT
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_CHECK_TYPES([ptrdiff_t])

# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([dup2 floor memmove pow regcomp sqrt strchr strcspn strrchr strspn strstr])

# create the makefiles and other files
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
