# This file is part of Wydawca -*- autoconf -*- # Copyright (C) 2007, 2008, 2009 Sergey Poznyakoff # # Wydawca is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # # Wydawca is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with wydawca. If not, see . AC_PREREQ(2.59) AC_INIT([wydawca], 1.9.90, [bug-wydawca@gnu.org.ua]) AC_CONFIG_SRCDIR([src/wydawca.c]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE # Checks for programs. AC_PROG_CC gl_EARLY AC_PROG_LEX AC_PROG_YACC AC_PROG_RANLIB # Checks for libraries. # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([stdlib.h string.h sys/file.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIGNAL AC_TYPE_UID_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_STDBOOL # Checks for library functions. gl_INIT AC_FUNC_FORK AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_STAT AC_FUNC_VPRINTF AC_CHECK_FUNCS([memset strchr strdup strerror strrchr setegid setregid setresgid setresuid seteuid setreuid vsyslog sysconf getdtablesize]) # ********************** # Mailutils # ********************** AM_GNU_MAILUTILS(2.0, [mailer], [:]) # ********************** # MySQL # ********************** AC_SUBST(SQLLIB) AH_TEMPLATE(HAVE_MYSQL,[Define if you have libmysql]) WD_CHECK_LIB(mysqlclient, mysql_real_connect, [-lm], [ AC_DEFINE(HAVE_MYSQL) SQLLIB="$wd_cv_lib_mysqlclient" ], [ AC_MSG_FAILURE([The requested library libmysqlclient is not found or is unusable])], [/usr/lib/mysql /usr/local/lib/mysql]) # ********************** # GPGME # ********************** AC_SUBST(GPGMELIB) AH_TEMPLATE(HAVE_GPGME,[Define if you have gpgme]) AC_CHECK_HEADERS(gpgme.h) WD_CHECK_LIB([gpgme],[main],[], [GPGMELIB="$wd_cv_lib_gpgme" AC_DEFINE(HAVE_GPGME) ], [ AC_MSG_FAILURE([The requested library libgpgme is not found or is unusable])], [/usr/pkg/lib /opt/lib /sw/lib]) # ********************** # Preprocessor # ********************** AC_ARG_WITH([preprocessor], AC_HELP_STRING([--without-preprocessor], [do not use external preprocessor]), [ case "${withval}" in yes) use_ext_pp=yes ;; no) use_ext_pp=no ;; *) AC_MSG_ERROR(bad value ${withval} for --with-preprocessor) ;; esac],[use_ext_pp=yes]) if test $use_ext_pp != no; then # Check for default preprocessor AC_ARG_VAR([DEFAULT_PREPROCESSOR], [Set default preprocessor name]) if test -z "$DEFAULT_PREPROCESSOR" ; then DEFAULT_PREPROCESSOR="m4 -s" fi save_PATH=$PATH PREPROC_OPTIONS=`echo $DEFAULT_PREPROCESSOR | sed -n 's/[[^ ]][[^ ]]* //p'` case "$DEFAULT_PREPROCESSOR" in /*) PATH=`expr $DEFAULT_PREPROCESSOR : '\(.*\)/.*'`:$PATH DEFAULT_PREPROCESSOR=`expr $DEFAULT_PREPROCESSOR : '.*/\(.*\)'`;; esac AC_PATH_PROG(PPBIN, $DEFAULT_PREPROCESSOR) DEFAULT_PREPROCESSOR=$PPBIN if test -n "$DEFAULT_PREPROCESSOR"; then DEFAULT_PREPROCESSOR="$DEFAULT_PREPROCESSOR $PREPROC_OPTIONS" case $PPBIN in *m4) AC_SUBST(PP_SETUP_FILE,'pp-setup');; # Install default pp-setup esac fi PATH=$save_PATH DEFAULT_PREPROCESSOR="\\\"$DEFAULT_PREPROCESSOR\\\"" else DEFAULT_PREPROCESSOR=NULL fi AH_BOTTOM([ #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __attribute__(x) #endif #ifndef GSC_PRINTFLIKE # define GSC_PRINTFLIKE(fmt,narg) __attribute__ ((__format__ (__printf__, fmt, narg))) #endif ]) # Initialize the test suite. AC_CONFIG_TESTDIR(tests) AC_CONFIG_FILES([tests/Makefile tests/atlocal tests/etc/Makefile]) AM_MISSING_PROG([AUTOM4TE], [autom4te]) AC_PATH_PROG(GPG, gpg, '') if test -n "$GPG"; then AC_SUBST(WYDAWCA_GPGFILES, '$(GPGFILES)') fi AC_CONFIG_FILES([Makefile doc/Makefile gnu/Makefile gconf/Makefile src/Makefile etc/Makefile]) AC_OUTPUT