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

AC_PREREQ(2.57)
AC_INIT(libnexstar,0.15, rumen@skyarchive.org)
AM_INIT_AUTOMAKE(libnexstar,0.15)
AC_CONFIG_SRCDIR([src/])
AC_CONFIG_HEADER([src/config.h])

# Checks for programs.
AC_PROG_CC
AC_SUBST([AM_CFLAGS], [-fPIC])

# Checks for libraries.
AC_CHECK_LIB(m, floor, LIBS="$LIBS -lm",)

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h strings.h sys/time.h termios.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
AC_HEADER_TIME
AC_STRUCT_TM

# Checks for library functions.
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRTOD
AC_CHECK_FUNCS([floor bind gettimeofday localtime_r memset])

tmp_dir="/tmp";

test "x${prefix}" = "xNONE" && prefix=${ac_default_prefix}
test "x${exec_prefix}" = "xNONE" && exec_prefix=${prefix}

AC_DEFINE_UNQUOTED(PREFIX_DIR, "${prefix}", [Prefix])
AC_DEFINE_UNQUOTED(BIN_DIR, "`eval echo $bindir`", [Executable Directory])

AC_ARG_ENABLE(debug,  --enable-debug  Enable debugging mode, AC_DEFINE_UNQUOTED(DEBUG,,[Compile in DEBUG mode]),,)

os_type=`uname`;
AC_DEFINE_UNQUOTED(GUESSED_OS_TYPE, "${os_type}", [Guesed Target Operating System])
AC_DEFINE_UNQUOTED(GUESSED_HARDWARE, "`uname -i`", [Guesed Target Hardware])

AC_CONFIG_FILES([Makefile libnexstar.pc:libnexstar.pc.in])

#AC_CONFIG_MACRO_DIR([m4])
#LT_INIT()
#AC_PROG_LIBTOOL
LT_INIT()

AC_OUTPUT
