dnl dnl Process this file with autoconf to produce a configure script. dnl dnl $Id: configure.in,v 1.33 2008/02/08 15:10:17 adeniz Exp $ dnl dnl autoconf input for the MicroNeil SNFServer distribution. dnl dnl Author: Alban Deniz dnl dnl Copyright (C) 2008 by MicroNeil Corporation. All rights reserved. dnl See www.armresearch.com for the copyright terms. dnl dnl AC_PREREQ(2.52) AC_INIT(snf-server, REPLACE_WITH_VERSION) AC_CONFIG_SRCDIR(source/SNFMulti/snfCFGmgr.cpp) AC_CONFIG_AUX_DIR(config) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AM_CONFIG_HEADER(config.h) AC_LANG(C++) AC_PROG_LIBTOOL AC_PROG_CXX AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET dnl dnl Check for programs. dnl AC_CHECK_PROG(haveCURL, curl, true, false) if [[ $haveCURL == "false" ]] then AC_MSG_ERROR([The CURL program was not found]); fi dnl dnl Load the user-specified OS. dnl AC_ARG_ENABLE(os-type, [AS_HELP_STRING([--enable-os-type=TYPE], [where TYPE is OpenBSD, FreeBSD, RedHat, Suse, Ubuntu, or ArchLinux])], [SNF_OSTYPE="${enableval}" ]) case "$SNF_OSTYPE" in OpenBSD|FreeBSD|Suse|Ubuntu) SNF_RPM_SENDMAIL_OTHER_REQUIRES="" ;; RedHat) SNF_RPM_SENDMAIL_OTHER_REQUIRES="Requires: sendmail-cf" ;; *) AC_MSG_ERROR([Invalid OS type: "$SNF_OSTYPE". You must specify a valid OS type with --enable-os-type=TYPE, where TYPE is one of: OpenBSD FreeBSD Suse RedHat Ubuntu ArchLinux]) ;; esac AC_SUBST(SNF_OSTYPE) AM_CONDITIONAL([OpenBSD], [test x$SNF_OSTYPE = xOpenBSD]) AM_CONDITIONAL([FreeBSD], [test x$SNF_OSTYPE = xFreeBSD]) AM_CONDITIONAL([Suse], [test x$SNF_OSTYPE = xSuse]) AM_CONDITIONAL([RedHat], [test x$SNF_OSTYPE = xRedHat]) AM_CONDITIONAL([Ubuntu], [test x$SNF_OSTYPE = xUbuntu]) AM_CONDITIONAL([ArchLinux], [test x$SNF_OSTYPE = xArchLinux]) dnl dnl Load whether this is for a package. dnl AC_ARG_ENABLE(for-package, [AS_HELP_STRING([--enable-for-package], [enable if building for a package])], [FOR_PACKAGE="${enableval}" ]) AM_CONDITIONAL([ForPackage], [test x$FOR_PACKAGE = xyes]) dnl dnl Check libraries. dnl dnl dnl pthread library. dnl AC_CHECK_LIB(pthread, pthread_create,, AC_MSG_ERROR([libpthread is required to build AC_PACKAGE_NAME])) dnl dnl Additional compile-time and link-time flags. dnl OTHER_CXXFLAGS='-O3' SNF_CXXFLAGS='$(OTHER_CXXFLAGS) -pthread' SNF_LIBS='' AC_SUBST(OTHER_CXXFLAGS) AC_SUBST(SNF_CXXFLAGS) AC_SUBST(SNF_LIBS) AC_SUBST(SNF_RPM_SENDMAIL_OTHER_REQUIRES) dnl dnl Output the makefiles. dnl AC_OUTPUT([Makefile ${PACKAGE_NAME}.spec ${PACKAGE_NAME}-postfix.spec ${PACKAGE_NAME}-sendmail.spec binary/SNFServer/Makefile binary/SNFClient/Makefile binary/SNF2Check/Makefile binary/SNFServerConfig/Makefile Scripts/Makefile config_files/Makefile Docs/Makefile]) echo " Type "make" to build the system using the default (optimized) parameters. Type "make SNF_CXXFLAGS='-g -pthread'" to build the system for debugging. Type "make OTHER_CXXFLAGS=flags" to build the system with compiler flags 'flags'. For example: Type "make OTHER_CXXFLAGS=-g" to build the system for debugging. Type "make OTHER_CXXFLAGS=-Wall" to enable all warnings. Type "make OTHER_CXXFLAGS=-Wall -O3" to enable warnings and O3 optimizations. Default value: $OTHER_CXXFLAGS OS type: $SNF_OSTYPE The software will be installed in $prefix. Done "