# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ([2.63]) AC_INIT([duser], [1.0.0], [jhunkeler@stsci.edu], [duser], [https://github.com/jhunkeler/duser.git]) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE(1.11.1) AC_CONFIG_HEADERS([include/config.h]) AC_CONFIG_SRCDIR([src/duser.c]) # Checks for programs. AC_PROG_CC AM_PROG_CC_C_O AC_PROG_INSTALL # Checks for libraries. # Checks for header files. AC_CHECK_HEADERS_ONCE([fcntl.h limits.h stdlib.h string.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T # Checks for library functions. AC_FUNC_MALLOC AC_CHECK_FUNCS_ONCE([memset strcasecmp strdup strerror strncasecmp strstr strchrnul strcasestr]) # Checks for currently used operating system. case "$host_os" in *linux*) CFLAGS="-O2 -Wall -Wextra -I../include" AC_DEFINE([__NLINUX__], 1, [host operating system is linux]) ;; *solaris*) # The STSCI Build of GNU GCC has a broken -Wextra handler CFLAGS="-O2 -Wall -I../include" AC_DEFINE([__NSOLARIS__], 1, [host operating system is solaris]) ;; *) AC_MSG_ERROR([duser does not currently support your platform]) ;; esac # Figure out where everything goes in the filesystem AC_ARG_WITH(config-path, AC_HELP_STRING([--with-config-path=], [specify the path for duser config files (default: /usr/local/etc/duser)]), [CFGPATH="$withval"], [CFGPATH="/usr/local/etc/duser"]) AC_SUBST(CONFIGDIR) AC_DEFINE_UNQUOTED([CFG_PATH], "$CFGPATH", [duser configuration path]) AC_OUTPUT([Makefile src/Makefile])