dnl elmo - ELectronic Mail Operator dnl dnl Copyright (C) 2002, 2003, 2004 rzyjontko dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; version 2. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software Foundation, dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. AC_SUBST(HAVE_SHORT_NAME, "") AC_SUBST(ELMOLIBS, "") AC_INIT(elmo, 1.2.0) AC_CONFIG_SRCDIR(src/elmo.c) AM_INIT_AUTOMAKE(1.7) AC_CONFIG_HEADER(config.h) dnl dnl Checks for programs. dnl AC_PROG_INSTALL AC_PROG_CC AM_PROG_LEX dnl Unfortunately AM_GNU_GETTEXT doesn't call this macro. AC_CHECK_FUNCS(strchr) AC_SYS_LARGEFILE dnl dnl NLS dnl ALL_LINGUAS="pl de" AM_GNU_GETTEXT dnl dnl GnuPG support dnl GPGME4="notdefined" have_gpgme=no AC_CHECK_HEADER(gpgme.h, [ AC_DEFINE(HAVE_GPGME_H, 1, [Has gpgme.h]) GPGME4="no" ]) AC_CHECK_HEADER(gpgme4/gpgme.h, [ AC_DEFINE(HAVE_GPGME4_H, 1, [Has gpgme4/gpgme.h]) GPGME4="yes" ]) have_gpgme=no if test "$GPGME4" == "no" ; then AM_PATH_GPGME([0.4.2], have_gpgme=yes, have_gpgme=no) if test "$have_gpgme" = yes; then AC_DEFINE(HAVE_GPGME, 1, [Use libgpgme.so]) AC_DEFINE([GPG_SUPPORT], [1], [Define to 1 if gpgme library is present.]) fi else if test "$GPGME4" == "yes" ; then AC_CHECK_LIB(gpgme4, gpgme_check_version, [ have_gpgme=yes GPGME_LIBS="-lgpgme4" AC_SUBST(GPGME_LIBS) AC_DEFINE(HAVE_GPGME4, 1, [Use libgpgme4.so]) AC_DEFINE([GPG_SUPPORT], [1], [Define to 1 if gpgme library is present.]) ]) fi fi dnl dnl OpenSSL support dnl ac_use_openssl="yes" ac_openssl_lib_dir="/usr/lib /usr/local /usr/local/ssl /usr/local/ssl/lib /usr/pkg" ac_openssl_inc_dir="/usr/include /usr/local /usr/local/ssl /usr/pkg /usr/local/ssl/include" AC_ARG_WITH([openssl], [AC_HELP_STRING([--with-openssl=DIR], [root location for OpenSSL])], if test "x$withval" = xno; then ac_use_openssl="false" else ac_openssl_lib_dir="$withval/lib $withval" ac_openssl_inc_dir=$withval/include fi ) AC_ARG_WITH([openssl-inc], [AC_HELP_STRING([--with-openssl-inc=DIR], [OpenSSL include files])], ac_openssl_inc_dir=$withval ) AC_ARG_WITH([openssl-lib], [AC_HELP_STRING([--with-openssl-lib=DIR], [OpenSSL library files])], ac_openssl_lib_dir=$withval ) if test "$ac_use_openssl" != "no"; then ac_found_openssl_inc_dir="no" AC_MSG_CHECKING([for OpenSSL include files]) for dir in $ac_openssl_inc_dir; do if test -f $dir/openssl/ssl.h; then ac_found_openssl_inc_dir=$dir break fi done if test "x$ac_found_openssl_inc_dir" != xno; then echo "found in $ac_found_openssl_inc_dir" else echo "not found." ac_use_openssl="no" fi fi if test "$ac_use_openssl" != "no"; then ac_found_openssl_lib_dir="no" AC_MSG_CHECKING([for OpenSSL libraries]) for dir in $ac_openssl_lib_dir; do found_ssl="false" if test -f $dir/libssl.a -a -f $dir/libcrypto.a; then found_ssl="true" fi if test -f $dir/libssl.so -a -f $dir/libcrypto.so; then found_ssl="true" fi if $found_ssl != "false"; then dnl Ok, we think we've found them, but check that they dnl actually ontain the right functions save_LIBS=$LIBS save_LDFLAGS=$LDFLAGS LIBS="-lssl -lcrypto $LIBS" LDFLAGS="-L$dir $LDFLAGS" AC_TRY_LINK_FUNC(SSL_load_error_strings,ac_linked_libssl="true", ac_linked_libssl="false"); AC_TRY_LINK_FUNC(RC4_set_key,ac_linked_libcrypto="true", ac_linked_libcrypto="false"); if test "$ac_linked_libssl" != "false" -a \ "$ac_linked_libcrypto" != "false"; then ac_found_openssl_lib_dir=$dir break fi LIBS=$save_LIBS LDFLAGS=$save_LDFLAGS fi done if test "$ac_found_openssl_lib_dir" != "no"; then echo "found in $ac_found_openssl_lib_dir" INCLUDES="-I$ac_found_openssl_inc_dir $INCLUDES" DEFINES="-DOPENSSL $DEFINES" else echo "not found." ac_use_openssl="no" fi fi if test "$ac_use_openssl" = yes; then AC_DEFINE([OPENSSL_SUPPORT], [1], [Define to 1 if openssl is present.]) fi dnl Checks for libraries. AC_SEARCH_LIBS(initscr, ncurses curses) AC_SEARCH_LIBS(socket, socket) AC_SEARCH_LIBS(gethostbyname, nsl) AC_SEARCH_LIBS(hstrerror, resolv) dnl dnl Checks for header files. dnl AC_CHECK_HEADERS(getopt.h wordexp.h glob.h) AC_CHECK_HEADERS(ncurses/ncurses.h ncurses.h curses.h locale.h) AC_CHECK_HEADERS(sys/dir.h) dnl dnl Checks for typedefs, structures, and compiler characteristics. dnl AC_CHECK_SIZEOF(unsigned) dnl dnl Checks for library functions. dnl AC_CHECK_FUNCS(scandir, have_scandir=yes, have_scandir=no) AC_CHECK_FUNCS(getopt_long) AC_CHECK_FUNCS(mmap) dnl dnl Debug dnl AC_ARG_ENABLE([debug], [AC_HELP_STRING([--enable-debug], [additional debugging support])]) if test "x$enable_debug" = xyes; then AC_DEFINE([DEBUG], [1], [turns on debugging facilities]) CFLAGS="-gdwarf-2 -g3 -O0" else enable_debug=no fi dnl dnl memory leaks tracing dnl AC_MSG_CHECKING([wheter to trace memory leaks]) if test -n "$XMALLOC_TRACE"; then AC_DEFINE([XMALLOC_DEBUG], [], [traces for memory leaks when defined]) AC_DEFINE([XMALLOC_CNT], [4], [frame depth in xmalloc.c]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi dnl dnl Offensive boundary dnl AC_ARG_ENABLE([offensive-boundary], [AC_HELP_STRING([--disable-offensive-boundary], [make boundary a neutral string])]) if test "x$enable_offensive_boundary" = xno; then AC_DEFINE([NO_OFFENSIVE_BOUNDARY], [], [turns off the offensive boundary]) fi dnl dnl maildir dnl AM_CONDITIONAL([EKG_SCANDIR], [test "x$have_scandir" = xno]) dnl dnl home-etc dnl AC_ARG_WITH([home-etc], [AC_HELP_STRING([--with-home-etc[=DIR]], [Use HOME-ETC library to let the configuration files be located in a non-standard place ])], [ if test "$with_home_etc" != "no" then if test "$with_home_etc" != "yes" then LDFLAGS="$LDFLAGS -L$with_home_etc/lib" fi saved_LIBS="$LIBS" AC_SEARCH_LIBS(get_home_etc_static, home_etc) AC_CHECK_HEADERS(home_etc.h) ELMOLIBS="$ELMOLIBS -lhome_etc" LIBS="$saved_LIBS" AC_DEFINE([USE_HOME_ETC], [1], [ Define if want to use the HOME-ETC library. ]) need_home_etc=yes fi ]) LIBS="$LIBS $ELMOLIBS" AC_OUTPUT(Makefile \ po/Makefile.in \ po/Makefile \ po/POTFILES \ intl/Makefile \ themes/Makefile \ doc/Makefile \ src/Makefile) echo echo " Debugging information: $enable_debug" echo " GPG support: $have_gpgme" echo " OpenSSL support: $ac_use_openssl" echo