# # $Author: misho $ # $Id: configure.in,v 1.3 2013/04/09 15:59:44 misho Exp $ # AC_INIT(suX, 3.0, misho@aitnet.org) AC_CONFIG_SRCDIR([src/sux.c]) AC_CONFIG_HEADERS([inc/config.h]) # Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_CANONICAL_HOST AC_CANONICAL_TARGET AC_CHECK_TOOL(MKDEP, mkdep, no) AC_SUBST(MKDEP) CFLAGS="-Wall -O2 -fPIC -I/usr/local/include ${CFLAGS}" LDFLAGS="-L/usr/local/lib ${LDFLAGS}" # Checks for libraries. AC_CHECK_LIB([pthread], [pthread_create]) AC_CHECK_LIB([util], [setusercontext]) AC_CHECK_LIB([elwix], [array_Args]) AC_CHECK_LIB([aitcfg], [cfgLoadConfig]) # Checks for header files. AC_CHECK_HEADERS([stdlib.h string.h sys/param.h syslog.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_INLINE # Checks for library functions. AC_CHECK_FUNCS([endgrent endpwent getcwd strcasecmp strerror strrchr strtol]) STATIC=no AC_MSG_CHECKING(Static build) AC_ARG_ENABLE(static, [ --enable-static Build static program ], [ STATIC=$enableval case "$enableval" in yes) LDFLAGS="-static ${LDFLAGS}" ;; *) ;; esac ],) AC_MSG_RESULT($STATIC) DEBUG=no AC_MSG_CHECKING(Debug Build) AC_ARG_ENABLE(debug, [ --enable-debug Build program with debug information and additional messages], [ DEBUG=$enableval case "$enableval" in yes) AC_DEFINE(__DEBUG,, [Build libraries with debug information and additional messages]) CFLAGS="-g ${CFLAGS}" ;; *) AC_DEFINE(NDEBUG,, [Turn off debug asserts]) ;; esac ], AC_DEFINE(NDEBUG,, [Turn off debug asserts])) AC_MSG_RESULT($DEBUG) AC_CONFIG_FILES([Makefile bin/Makefile inc/Makefile src/Makefile]) AC_OUTPUT