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

AC_PREREQ(2.57)
AC_INIT([desync], [alpha-1], [justin_finnerty@optusnet.com.au])
AC_REVISION($Revision: 2.3 $)
AC_CONFIG_SRCDIR([fso/posixprp.c])
AC_CONFIG_HEADER([config.h])
# "/usr/local/SmartEiffel/tools/"
# "/usr/local/SmartEiffel/lib/"
# CC -> cc : "gcc"
# C_COMPILER_OPTIONS -> c_compiler_options : "-O3 -pipe -I/usr/include"
# Checks for programs.
AC_PROG_CC
AC_CHECK_PROGS([EC],[ec se vec],[error])
EC_SET=no
if test "error" = "$EC"; then
EC_SET=yes
fi
if test "vec" != "$EC"; then
if test "se" != "$EC"; then
if test "ec" != "$EC"; then
EC_SET=yes
fi
fi
fi
if test yes = $EC_SET; then
AC_MSG_ERROR([
------------------------------------------------------------
Program cannot be compiled as Eiffel Studio, SmartEiffel or Visual
Eiffel is required. Please download and install either Eiffel Studio,
SmartEiffel or Visual Eiffel before retrying "./configure".  If one
is present try "./configure EC=/path/to/ec_or_se_or_vec".
------------------------------------------------------------])
fi
AC_CHECK_PROG([GEPP],[gepp],[gepp],[error])
AC_CHECK_PROG([GEXACE],[gexace],[gexace],[error])
GOBO_SET=no
if test "x" = "x$GOBO"; then
GOBO_SET=yes
fi
if test "error" = "$GEPP"; then
GOBO_SET=yes
fi
if test "error" = "$GEXACE"; then
GOBO_SET=yes
fi
if test yes = $GOBO_SET; then
AC_MSG_ERROR([
------------------------------------------------------------
Program cannot be compiled as the GOBO library is required. Please
download and install GOBO library before running "./configure".  If
GOBO is present try "./configure GOBO=/path/to/gobo". Additionally the
GOBO tools "gexace" and "gepp" must be in your path.
------------------------------------------------------------])
fi
AC_ARG_VAR([EC],[Eiffel compiler (ec or se or vec)])
AC_ARG_VAR([GOBO],[GOBO directory])

# Checks for libraries.
AC_CHECK_LIB([z],[gzopen])
AC_CHECK_LIB([bz2],[BZ2_bzopen])

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

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T

# Checks for library functions.
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset strdup strerror])

AC_CONFIG_FILES([makefile makefile.sys])
AC_OUTPUT
