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

AC_PREREQ([2.68])
AC_INIT([libtrhash],
        [1.0.0],
        [Georg Hopp <georg@steffers.org>])
LT_INIT
AM_INIT_AUTOMAKE
#AM_INIT_AUTOMAKE([subdir-objects])
AM_SILENT_RULES([yes])
AC_COPYRIGHT([Copyright © 2016 Georg Hopp])
AC_REVISION([1.0.0])
AC_CONFIG_SRCDIR([src/sdbm.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])

m4_include([m4/gcov.m4])
AC_TDD_GCOV

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_LIBTOOL
AM_PROG_CC_C_O

# openssl
m4_include([m4/openssl.m4])
AC_OPENSSL

# Doxygen
AC_CHECK_PROGS([DOXYGEN], [doxygen])
if test -z "$DOXYGEN";
   then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
fi

AM_CONDITIONAL([HAVE_DOXYGEN],
               [test -n "$DOXYGEN"])
AM_COND_IF([HAVE_DOXYGEN],
	   [AC_CONFIG_FILES([docs/Doxyfile])])

# Checks for header files.
AC_CHECK_HEADERS([stdarg.h string.h stdlib.h stdio.h unistd.h syslog.h \
		  sys/types.h])
AC_CHECK_HEADER(trbase.h, [], [
	AC_MSG_ERROR([unable to find the trbase header])
])
AC_CHECK_HEADER(trio.h, [], [
	AC_MSG_ERROR([unable to find the trio header])
])

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

# Checks for library functions.
AC_CHECK_FUNCS([memset])

AM_CFLAGS="${AM_CFLAGS} ${DRAGONEGG_FLAGS}"
AM_CFLAGS="${AM_CFLAGS} ${MEM_OPT_FLAGS}"
AM_CFLAGS="${AM_CFLAGS} ${CFLAGS}"
AC_SUBST(AM_CFLAGS)

AM_LDFLAGS=""
AC_SUBST(AM_LDFLAGS)

AC_CONFIG_FILES([Makefile
		 docs/Makefile
		 tests/Makefile
		 src/Makefile
		 include/Makefile])
AC_OUTPUT