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

AC_PREREQ([2.69])
AC_INIT([ntch], [1.0.1.9], [akohta001@gmail.com],[ntch],[https://sourceforge.jp/projects/ntch/])
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL

# Checks for libraries.
AC_CHECK_LIB([crypto], [BIO_ctrl])
AC_CHECK_LIB([dl], [dlopen])
AC_CHECK_LIB([gdbm], [dbm_open])
AC_CHECK_LIB([gdbm_compat], [dbm_open])
AC_CHECK_LIB([m], [sqrt])
AC_CHECK_LIB([ncursesw], [initscr])
AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_LIB([sqlite3], [sqlite3_initialize])
AC_CHECK_LIB([ssl], [SSL_library_init])
AC_CHECK_LIB([z], [inflate])

# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h locale.h memory.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h wchar.h ndbm.h gdbm-ndbm.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_HEADER_STDBOOL
AC_TYPE_UID_T

# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([gethostbyname memset mkdir regcomp setlocale socket strchr strrchr strstr strtol])

AC_CONFIG_FILES([Makefile])

AC_CONFIG_COMMANDS([make-gen-dir], [mkdir -p gen])
AC_PREFIX_DEFAULT([/usr/local])
AC_PREFIX_PROGRAM([ntch])

AC_OUTPUT
